|
@@ -385,13 +385,27 @@
|
|
|
<i class="el-icon-question" style="color:#606266"></i>
|
|
<i class="el-icon-question" style="color:#606266"></i>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</span>
|
|
</span>
|
|
|
- <el-select v-model="depForm.auditorIds" filterable v-if="user.userNameNeedTranslate != '1'" clearable multiple style="width: 100%" placeholder="请选择加班审核人">
|
|
|
|
|
- <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
- <span style="float: left">{{ item.name }}</span>
|
|
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <selectCat :subject="users" :subjectId="depForm.auditorIds" :size="'medium'" :filterable="true" :widthStr="'430'" :multiSelect="true" v-if="user.userNameNeedTranslate == '1' && departmentVisible" :distinction="'40'" :clearable="true" @selectCal="selectCal"></selectCat>
|
|
|
|
|
|
|
+ <div style="display: flex; flex-wrap: wrap; align-items: center; gap: 4px;">
|
|
|
|
|
+ <template v-for="(auditor, index) in depForm.auditorList">
|
|
|
|
|
+ <el-tag
|
|
|
|
|
+ :key="auditor.id"
|
|
|
|
|
+ closable
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ @close="removeAuditor(index)"
|
|
|
|
|
+ style="cursor: default;">
|
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='auditor.name'></TranslationOpenDataText></span>
|
|
|
|
|
+ <span v-else>{{ auditor.name }}</span>
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <span v-if="index < depForm.auditorList.length - 1" :key="'arrow-' + index" style="color: #909399; font-size: 14px; margin: 0 2px;">→</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ circle
|
|
|
|
|
+ @click="openAuditorSelectDialog">
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- 直属领导 -->
|
|
<!-- 直属领导 -->
|
|
|
<el-form-item :label="$t('leadership')" prop="reportAuditUserid" v-if="user.timeType.needDeptAudit">
|
|
<el-form-item :label="$t('leadership')" prop="reportAuditUserid" v-if="user.timeType.needDeptAudit">
|
|
@@ -890,6 +904,41 @@
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
+ <!-- 加班审核人选择弹窗 -->
|
|
|
|
|
+ <el-dialog title="选择加班审核人" :visible.sync="auditorSelectDialog" width="450px" append-to-body>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <!-- 非企业微信转译:使用 el-select 单选 -->
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-if="user.userNameNeedTranslate != '1'"
|
|
|
|
|
+ v-model="selectedAuditorId"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :placeholder="$t('defaultText.pleaseChoose')"
|
|
|
|
|
+ style="width: 100%">
|
|
|
|
|
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
+ <span style="float: left">{{ item.name }}</span>
|
|
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <!-- 企业微信转译:使用 selectCat 组件 -->
|
|
|
|
|
+ <selectCat
|
|
|
|
|
+ v-if="user.userNameNeedTranslate == '1'"
|
|
|
|
|
+ :size="'medium'"
|
|
|
|
|
+ :filterable="true"
|
|
|
|
|
+ :clearable="true"
|
|
|
|
|
+ :widthStr="'360'"
|
|
|
|
|
+ :subject="users"
|
|
|
|
|
+ :subjectId="selectedAuditorId"
|
|
|
|
|
+ :distinction="'50'"
|
|
|
|
|
+ @selectCal="selectCal">
|
|
|
|
|
+ </selectCat>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="auditorSelectDialog = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="confirmAuditorSelect" v-if="user.userNameNeedTranslate != '1'">{{ $t('btn.determine') }}</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
:title="$t('zhuanYiDao')"
|
|
:title="$t('zhuanYiDao')"
|
|
|
:visible.sync="transferActiveDialogFlag"
|
|
:visible.sync="transferActiveDialogFlag"
|
|
@@ -1264,8 +1313,19 @@ export default {
|
|
|
userGroupId: '',
|
|
userGroupId: '',
|
|
|
userGroupVisable: false,
|
|
userGroupVisable: false,
|
|
|
userGroupLoading: false,
|
|
userGroupLoading: false,
|
|
|
|
|
+
|
|
|
|
|
+ // 加班审核人选择弹窗
|
|
|
|
|
+ auditorSelectDialog: false,
|
|
|
|
|
+ auditorSearchKeyword: '',
|
|
|
|
|
+ selectedAuditorId: null,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ filteredAuditorUsers() {
|
|
|
|
|
+ if (!this.auditorSearchKeyword) return this.users;
|
|
|
|
|
+ return this.users.filter(u => u.name && u.name.indexOf(this.auditorSearchKeyword) !== -1);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
watch: {
|
|
watch: {
|
|
|
filterText(val) {
|
|
filterText(val) {
|
|
|
console.log(val)
|
|
console.log(val)
|
|
@@ -3355,7 +3415,9 @@ export default {
|
|
|
name: null,
|
|
name: null,
|
|
|
parentId: null,
|
|
parentId: null,
|
|
|
managerId: null,
|
|
managerId: null,
|
|
|
- isEnableMulti: 0
|
|
|
|
|
|
|
+ isEnableMulti: 0,
|
|
|
|
|
+ auditorList: [],
|
|
|
|
|
+ auditorIds: []
|
|
|
};
|
|
};
|
|
|
if (that.depData.id != -1 && that.depData.id != 0) {
|
|
if (that.depData.id != -1 && that.depData.id != 0) {
|
|
|
that.depForm.parentId = that.depData.id;
|
|
that.depForm.parentId = that.depData.id;
|
|
@@ -3368,7 +3430,9 @@ export default {
|
|
|
name: null,
|
|
name: null,
|
|
|
parentId: null,
|
|
parentId: null,
|
|
|
managerId: null,
|
|
managerId: null,
|
|
|
- isEnableMulti: 0
|
|
|
|
|
|
|
+ isEnableMulti: 0,
|
|
|
|
|
+ auditorList: [],
|
|
|
|
|
+ auditorIds: []
|
|
|
};
|
|
};
|
|
|
that.depTitle = this.$t('addsubdepartment');
|
|
that.depTitle = this.$t('addsubdepartment');
|
|
|
} else {
|
|
} else {
|
|
@@ -3412,6 +3476,19 @@ export default {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
this.$set(that.depForm, 'auditorIds', res.data.auditorIds);
|
|
this.$set(that.depForm, 'auditorIds', res.data.auditorIds);
|
|
|
|
|
+ // 初始化 auditorList(用于 tag 展示)
|
|
|
|
|
+ if (res.data.auditorIds) {
|
|
|
|
|
+ const ids = Array.isArray(res.data.auditorIds)
|
|
|
|
|
+ ? res.data.auditorIds
|
|
|
|
|
+ : String(res.data.auditorIds).split(',').filter(Boolean);
|
|
|
|
|
+ const list = ids.map(id => {
|
|
|
|
|
+ const u = that.users.find(u => String(u.id) === String(id));
|
|
|
|
|
+ return u ? { id: u.id, name: u.name } : { id: id, name: id };
|
|
|
|
|
+ });
|
|
|
|
|
+ that.$set(that.depForm, 'auditorList', list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$set(that.depForm, 'auditorList', []);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
(error) => {
|
|
(error) => {
|
|
@@ -3896,6 +3973,24 @@ export default {
|
|
|
this.transferActive.takeoverId = obj.id
|
|
this.transferActive.takeoverId = obj.id
|
|
|
} else if (obj.distinction == '6') {
|
|
} else if (obj.distinction == '6') {
|
|
|
this.insertForm.superiorId = obj.id;
|
|
this.insertForm.superiorId = obj.id;
|
|
|
|
|
+ } else if (obj.distinction == '50') {
|
|
|
|
|
+ // 企业微信转译模式下,加班审核人选择回调
|
|
|
|
|
+ if (!obj.id) return;
|
|
|
|
|
+ const auditorList = this.depForm.auditorList || [];
|
|
|
|
|
+ const alreadyExists = auditorList.some(a => a.id === obj.id);
|
|
|
|
|
+ if (alreadyExists) {
|
|
|
|
|
+ this.$message({ message: '该审核人已在列表中', type: 'warning' });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const user = this.users.find(u => u.id === obj.id);
|
|
|
|
|
+ if (user) {
|
|
|
|
|
+ if (!this.depForm.auditorList) {
|
|
|
|
|
+ this.$set(this.depForm, 'auditorList', []);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.depForm.auditorList.push({ id: user.id, name: user.name });
|
|
|
|
|
+ this.depForm.auditorIds = this.depForm.auditorList.map(a => a.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.auditorSelectDialog = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 企业微信可见范围设置
|
|
// 企业微信可见范围设置
|
|
@@ -4098,7 +4193,41 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
error => { this.userGroupLoading = false });
|
|
error => { this.userGroupLoading = false });
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 打开加班审核人选择弹窗
|
|
|
|
|
+ openAuditorSelectDialog() {
|
|
|
|
|
+ this.selectedAuditorId = null;
|
|
|
|
|
+ this.auditorSearchKeyword = '';
|
|
|
|
|
+ this.auditorSelectDialog = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 确认选择加班审核人
|
|
|
|
|
+ confirmAuditorSelect() {
|
|
|
|
|
+ if (!this.selectedAuditorId) {
|
|
|
|
|
+ this.$message({ message: '请选择一位审核人', type: 'warning' });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const auditorList = this.depForm.auditorList || [];
|
|
|
|
|
+ const alreadyExists = auditorList.some(a => a.id === this.selectedAuditorId);
|
|
|
|
|
+ if (alreadyExists) {
|
|
|
|
|
+ this.$message({ message: '该审核人已在列表中', type: 'warning' });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const user = this.users.find(u => u.id === this.selectedAuditorId);
|
|
|
|
|
+ if (user) {
|
|
|
|
|
+ if (!this.depForm.auditorList) {
|
|
|
|
|
+ this.$set(this.depForm, 'auditorList', []);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.depForm.auditorList.push({ id: user.id, name: user.name });
|
|
|
|
|
+ // 同步 auditorIds
|
|
|
|
|
+ this.depForm.auditorIds = this.depForm.auditorList.map(a => a.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.auditorSelectDialog = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除加班审核人
|
|
|
|
|
+ removeAuditor(index) {
|
|
|
|
|
+ this.depForm.auditorList.splice(index, 1);
|
|
|
|
|
+ this.depForm.auditorIds = this.depForm.auditorList.map(a => a.id);
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
|
|
this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
|