init
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
v-hasPermi="['project:module:claim']"
|
||||
>接取</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status === '1' && scope.row.assignee === userName"
|
||||
v-if="scope.row.status === '1' && isSelfAssignee(scope.row)"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-close"
|
||||
@@ -146,9 +146,7 @@
|
||||
<el-form-item label="模块描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接取人" prop="assignee" v-if="form.moduleId">
|
||||
<el-input v-model="form.assignee" placeholder="请输入接取人用户名" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -162,13 +160,13 @@
|
||||
<el-form-item label="模块名称">
|
||||
<el-input v-model="assignForm.moduleName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="指派给" prop="assignee">
|
||||
<el-select v-model="assignForm.assignee" placeholder="请选择用户" filterable>
|
||||
<el-form-item label="指派给" prop="designatedUser">
|
||||
<el-select v-model="assignForm.designatedUser" placeholder="请选择用户" filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.userName"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userName"
|
||||
:value="item.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -241,8 +239,9 @@ export default {
|
||||
// 指派表单
|
||||
assignForm: {
|
||||
moduleId: null,
|
||||
projectId: null,
|
||||
moduleName: null,
|
||||
assignee: null
|
||||
designatedUser: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -263,6 +262,19 @@ export default {
|
||||
this.getUserList();
|
||||
},
|
||||
methods: {
|
||||
/** 判断当前用户是否是接取人(兼容ID/用户名/昵称) */
|
||||
isSelfAssignee(row) {
|
||||
if (!row) return false
|
||||
// 优先使用后端返回的标准 assigneeId
|
||||
if (row.assigneeId != null && String(row.assigneeId) === String(this.$store.state.user.id)) return true
|
||||
const assignee = row.assignee
|
||||
if (!assignee) return false
|
||||
const uid = String(this.$store.state.user.id)
|
||||
if (String(assignee) === uid) return true
|
||||
const currentUserName = this.$store.getters && this.$store.getters.name
|
||||
const currentNickName = this.$store.getters && this.$store.getters.nickName
|
||||
return assignee === currentUserName || assignee === currentNickName
|
||||
},
|
||||
/** 查询模块列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@@ -339,8 +351,9 @@ export default {
|
||||
handleAssign(row) {
|
||||
this.assignForm = {
|
||||
moduleId: row.moduleId,
|
||||
projectId: row.projectId,
|
||||
moduleName: row.moduleName,
|
||||
assignee: null
|
||||
designatedUser: null
|
||||
};
|
||||
this.assignOpen = true;
|
||||
},
|
||||
@@ -384,7 +397,7 @@ export default {
|
||||
},
|
||||
/** 提交指派 */
|
||||
submitAssign() {
|
||||
if (!this.assignForm.assignee) {
|
||||
if (!this.assignForm.designatedUser) {
|
||||
this.$modal.msgError("请选择要指派的用户");
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user