刘洋 vor 8 Monaten
Ursprung
Commit
a9dc313685

+ 4 - 1
src/render/views/Audit/Review/ReviewAction.vue

@@ -157,7 +157,10 @@ async function switchTab(key: "review" | "history") {
 const courses = ref<SubjectItem[]>([]);
 async function getCourses() {
   const res = await getSubjectList({ examId: userStore.curExam.id });
-  courses.value = res || [];
+  courses.value = (res || []).map((item: any) => {
+    item.name = item.code + "-" + item.name;
+    return item;
+  });
 }
 getCourses();
 

+ 4 - 1
src/render/views/DataCheck/CheckAction.vue

@@ -224,7 +224,10 @@ const panelKey = ref(["1", "2", "3", "4"]);
 const courses = ref<SubjectItem[]>([]);
 async function getCourses() {
   const res = await getSubjectList({ examId: userStore.curExam.id });
-  courses.value = res || [];
+  courses.value = (res || []).map((item: any) => {
+    item.name = item.code + "-" + item.name;
+    return item;
+  });
 }
 getCourses();
 const fieldNames = { label: "name", value: "code" };

+ 43 - 2
src/render/views/RecognizeCheck/ModifyRecognizeCheckTask.vue

@@ -36,7 +36,7 @@
         >
           <a-select
             v-model:value="condition.code"
-            :options="conditionList"
+            :options="options"
             :field-names="fieldNames"
             style="width: 200px"
             @change="() => conditionChange(index)"
@@ -169,12 +169,44 @@ function onDeleteCondition(index: number) {
   formData.conditions.splice(index, 1);
 }
 
+const checkRepeat = (): boolean => {
+  let cts = formData.conditions;
+  let strs: string[] = cts.map((item) => item.code + "_" + (item.value || ""));
+  if ([...new Set(strs)].length < cts.length) {
+    window.$message.error("编辑中的任务条件有重复,请删除");
+    return false;
+  } else {
+    //从curRow中获取服务端已有的任务条件,对比判断是否有重复
+    let curRowCts: string[] = (props.rowData?.conditions || []).map(
+      (item) => item.code + "_" + (item.value || "")
+    );
+    let repeatStrs: string[] = [];
+    for (let i = 0; i < strs.length; i++) {
+      let s = strs[i];
+      if (curRowCts.includes(s)) {
+        const [code, value] = s.split("_");
+        let name =
+          (props.conditionList || []).find((item) => item.code == code)?.name ||
+          "";
+        repeatStrs.push(name + value);
+      }
+    }
+    if (repeatStrs.length) {
+      window.$message.error(`任务${repeatStrs.toString()}已创建过`);
+
+      return false;
+    }
+  }
+  return true;
+};
+
 /* confirm */
 const { loading, setLoading } = useLoading();
 async function confirm() {
   const valid = await formRef.value?.validate().catch(() => false);
   if (!valid) return;
-
+  // let checkRepeatResult = checkRepeat();
+  // if (!checkRepeatResult) return;
   setLoading(true);
   const res = await recognizeCheckTaskSave(formData).catch(() => false);
   setLoading(false);
@@ -223,4 +255,13 @@ function modalOpenHandle() {
     ];
   }
 }
+
+const options = computed(() => {
+  return (props.conditionList || []).map((item: any) => {
+    item.disabled =
+      (props.rowData?.conditions || []).find((v) => v.code == item.code) ||
+      formData.conditions.find((v) => v.code == item.code);
+    return item;
+  });
+});
 </script>

+ 4 - 1
src/render/views/RecognizeCheck/index.vue

@@ -25,7 +25,10 @@
       :loading="loading"
       bordered
     >
-      <template #bodyCell="{ column, index, text }">
+      <template #bodyCell="{ column, index, text, record }">
+        <template v-if="column.dataIndex === 'subjectName'">
+          {{ record.subjectCode + "-" + record.subjectName }}
+        </template>
         <template v-if="column.dataIndex === 'condition'">
           {{ getConditionContent(index) }}
         </template>

+ 4 - 1
src/render/views/Review/ReviewAction.vue

@@ -213,7 +213,10 @@ async function switchTab(key: "review" | "history") {
 const courses = ref<SubjectItem[]>([]);
 async function getCourses() {
   const res = await getSubjectList({ examId: userStore.curExam.id });
-  courses.value = res || [];
+  courses.value = (res || []).map((item: any) => {
+    item.name = item.code + "-" + item.name;
+    return item;
+  });
 }
 getCourses();
 

+ 5 - 0
src/render/views/ScanManage/ScanProcess.vue

@@ -9,6 +9,11 @@
       </template>
     </qm-low-form>
     <a-table :data-source="tableData" :columns="columns" size="middle" bordered>
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.dataIndex === 'subjectName'">
+          {{ `${record.subjectCode}-${record.subjectName}` }}
+        </template>
+      </template>
       <template #summary>
         <a-table-summary-row>
           <a-table-summary-cell>整体进度</a-table-summary-cell>