Selaa lähdekoodia

有多个审核人但未有主审人,提示设置

dsy 4 päivää sitten
vanhempi
commit
09e52a31e4

+ 19 - 2
src/api/list.js

@@ -123,7 +123,10 @@ export function PageQueryTemplateListOrgManager(data) {
  * @param {number} data.cur_page - 当前查询页码
  */
 export function PageQueryPinyinCorrectionListPersonal(data) {
-  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_Personal`, data);
+  return http.post(
+    `${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_Personal`,
+    data,
+  );
 }
 
 /**
@@ -133,7 +136,10 @@ export function PageQueryPinyinCorrectionListPersonal(data) {
  * @param {number} data.cur_page - 当前查询页码
  */
 export function PageQueryPinyinCorrectionListOrg(data) {
-  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_OrgManager`, data);
+  return http.post(
+    `${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_OrgManager`,
+    data,
+  );
 }
 
 /**
@@ -145,3 +151,14 @@ export function PageQueryPinyinCorrectionListOrg(data) {
 export function PageQueryPinyinCorrectionListAdmin(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=page_query-PageQueryPinyinCorrectionList_Admin`, data);
 }
+
+/**
+ * @description 得到可选审校人列表
+ * @param {object} data
+ * @param {string} data.book_id - 教材ID
+ * @param {string} data.book_chapter_node_id - 教材章节结构中的节点 ID(包含章节或课件)空或ROOT表示根节点
+ * @param {string} data.flow_node_id - 流程节点 ID
+ */
+export function GetAuditorList_Select(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_audit_manager-GetAuditorList_Select`, data);
+}

+ 0 - 1
src/views/personal_workbench/project/ProductionEditorialManage.vue

@@ -160,7 +160,6 @@
       :id="auditor.id"
       :book-id="book_id"
       :visible.sync="auditor.visible"
-      :member-list="member_list"
       @close="getBookChapterStructExpandList"
     />
 

+ 30 - 6
src/views/personal_workbench/project/components/SetAuditor.vue

@@ -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;
     },