|
|
@@ -44,6 +44,7 @@
|
|
|
import SetUser from './SetUser.vue';
|
|
|
|
|
|
import { SetAuditor, SetMainAuditor, GetChapterNodeAuditorList } from '@/api/project';
|
|
|
+import { GetAuditorList_Select } from '@/api/list';
|
|
|
|
|
|
export default {
|
|
|
name: 'SetAuditor',
|
|
|
@@ -59,10 +60,6 @@ export default {
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
- memberList: {
|
|
|
- type: Array,
|
|
|
- default: () => [],
|
|
|
- },
|
|
|
bookId: {
|
|
|
type: String,
|
|
|
default: '',
|
|
|
@@ -78,6 +75,7 @@ export default {
|
|
|
visible: false,
|
|
|
flow_node_id: '',
|
|
|
},
|
|
|
+ auditor_list: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -86,7 +84,7 @@ export default {
|
|
|
},
|
|
|
userList() {
|
|
|
if (this.user.type === 'auditor') {
|
|
|
- return this.memberList;
|
|
|
+ return this.auditor_list;
|
|
|
} else if (this.user.type === 'mainAuditor') {
|
|
|
return this.flow_node_list.find((item) => item.id === this.user.flow_node_id).auditor_list;
|
|
|
}
|
|
|
@@ -101,7 +99,30 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 得到可选审校人列表
|
|
|
+ */
|
|
|
+ async getAuditorList_Select() {
|
|
|
+ const { auditor_list } = await GetAuditorList_Select({
|
|
|
+ book_id: this.bookId,
|
|
|
+ book_chapter_node_id: this.id,
|
|
|
+ flow_node_id: this.user.flow_node_id,
|
|
|
+ });
|
|
|
+ this.auditor_list = auditor_list;
|
|
|
+ },
|
|
|
dialogClose() {
|
|
|
+ // 如果存在多个审核人但未设置主审核人,则提示用户设置主审核人
|
|
|
+ const isMultHasMainAuditor = this.flow_node_list.every(({ auditor_list, main_auditor }) => {
|
|
|
+ if (auditor_list.length > 1 && !main_auditor?.id) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!isMultHasMainAuditor) {
|
|
|
+ this.$message.warning('存在多个审核人但未设置主审核人,请先设置主审核人');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$emit('update:visible', false);
|
|
|
this.$emit('close');
|
|
|
this.flow_node_list = [];
|
|
|
@@ -113,8 +134,11 @@ export default {
|
|
|
flow_node_id: '',
|
|
|
};
|
|
|
},
|
|
|
- openSetUserDialog(flow_node_id, type) {
|
|
|
+ async openSetUserDialog(flow_node_id, type) {
|
|
|
this.user.flow_node_id = flow_node_id;
|
|
|
+ if (type === 'auditor') {
|
|
|
+ await this.getAuditorList_Select();
|
|
|
+ }
|
|
|
this.user.type = type;
|
|
|
this.user.visible = true;
|
|
|
},
|