fuyou 4 months ago
parent
commit
1f9b0074b5
1 changed files with 37 additions and 23 deletions
  1. 37 23
      check-ui/src/views/business/proofread/topage.vue

+ 37 - 23
check-ui/src/views/business/proofread/topage.vue

@@ -44,7 +44,7 @@
 
     </el-dialog>
 
-    <!--  核记录的对话框  -->
+    <!--  核记录的对话框  -->
     <el-dialog :visible.sync="RecheckRecordDialog" width="80%" class="record-dialog">
       <el-form :model="RecheckRecordForm">
         <el-form-item label="条目截图" prop="imgCode">
@@ -55,7 +55,7 @@
             fit="contain"
           />
         </el-form-item>
-        <el-form-item label="核记录" prop="text">
+        <el-form-item label="核记录" prop="text">
           <div v-for="(item, index) in RecheckRecordForm.text" :key="index" class="record-item"
                :class="{
           'final-record': RecheckRecordForm.isFinal[index], // 最终复核通过的记录
@@ -804,9 +804,17 @@ export default {
         this.RecheckRecordForm.userName = byItemResponse.data.map((item) => item.userGuid);
         this.RecheckRecordForm.code = byItemResponse.data.map((item) => item.code); // 记录类型
 
+        // 获取 target3 的值(用于标记是不是最终复核通过的记录,0表示不是,1表示是)
+        const target3 = itemResponse.data.target3 || "0";
+        console.log("target3:",target3);
+
+        // // 标记最终通过的记录
+        // this.RecheckRecordForm.isFinal = byItemResponse.data.map((item) => item.isFinal || false);
 
-        // 标记最终通过的记录
-        this.RecheckRecordForm.isFinal = byItemResponse.data.map((item) => item.isFinal || false);
+        // 标记最终复核通过的记录
+        this.RecheckRecordForm.isFinal = byItemResponse.data.map((item) => {
+          return item.code === "A01" && target3 === "1"; // 审核记录且最终复核通过
+        });
 
         // // 获取所有记录
         // this.RecheckRecordForm.text = byItemResponse.data.map((item) => item.target2);
@@ -815,9 +823,9 @@ export default {
         // this.RecheckRecordForm.isFinal = byItemResponse.data.map((item) => item.isFinal || false);
         // this.RecheckRecordForm.code = byItemResponse.data.map((item) => item.code); // 记录类型
 
-        console.log("byItemResponse.data:", byItemResponse.data);
-        console.log("byItemResponse.data[0].target2:", byItemResponse.data[0]?.target2);
-        console.log("RecheckRecordForm.text:", this.RecheckRecordForm.text);
+        // console.log("byItemResponse.data:", byItemResponse.data);
+        // console.log("byItemResponse.data[0].target2:", byItemResponse.data[0]?.target2);
+        // console.log("RecheckRecordForm.text:", this.RecheckRecordForm.text);
         console.log("RecheckRecordForm.isFinal:", this.RecheckRecordForm.isFinal);
 
 
@@ -993,6 +1001,12 @@ export default {
         this.TaskForm.itemText = this.checkText;
         await updateTask(this.TaskForm);
 
+        // 更新 item 表的 target3 字段为 "1"(target3字段用来标记是不是最终复核通过的记录,0表示不是,1表示是)
+        const itemResponse = await getItem(this.itemGuid);
+        this.itemForm = { ...itemResponse.data };
+        this.itemForm.target3 = "1"; // 标记为最终复核通过
+        await updateItem(this.itemForm);
+
         // 更新已复核条目数
         this.recheckedItems += 1;
         this.recheckProgress = ((this.recheckedItems / this.totalItems) * 100).toFixed(2);
@@ -1034,28 +1048,28 @@ export default {
         //     text.includes(this.RecheckForm.text[this.RecheckIndex])
         // );
 
-        // 标记最终复核通过的记录
-        const finalReviewIndex = this.RecheckRecordForm.text.findIndex(
-          (text, index) => this.RecheckRecordForm.code[index] === "A02" && text === this.RecheckForm.text[this.RecheckIndex]
-        );
-        if (finalReviewIndex !== -1) {
-          this.$set(this.RecheckRecordForm.isFinal, finalReviewIndex, true);
-        }
-
-        console.log("finalReviewIndex:", finalReviewIndex);
+        // // 标记最终复核通过的记录
+        // const finalReviewIndex = this.RecheckRecordForm.text.findIndex(
+        //   (text, index) => this.RecheckRecordForm.code[index] === "A02" && text === this.RecheckForm.text[this.RecheckIndex]
+        // );
+        // if (finalReviewIndex !== -1) {
+        //   this.$set(this.RecheckRecordForm.isFinal, finalReviewIndex, true);
+        // }
+        //
+        // console.log("finalReviewIndex:", finalReviewIndex);
 
-        if (finalReviewIndex !== -1) {
-          this.$set(this.RecheckRecordForm.isFinal, finalReviewIndex, true);
-        }
+        // if (finalReviewIndex !== -1) {
+        //   this.$set(this.RecheckRecordForm.isFinal, finalReviewIndex, true);
+        // }
 
         console.log("this.RecheckRecordForm.isFinal:", this.RecheckRecordForm.isFinal);
         console.log("RecheckForm.text[this.RecheckIndex]:", this.RecheckForm.text[this.RecheckIndex]);
         console.log("RecheckRecordForm.text:", this.RecheckRecordForm.text);
         console.log("RecheckRecordForm.code:", this.RecheckRecordForm.code);
-        if (this.RecheckRecordForm.text.length === 0 || this.RecheckForm.text.length === 0) {
-          console.error("RecheckRecordForm.text 或 RecheckForm.text 为空");
-          return;
-        }
+        // if (this.RecheckRecordForm.text.length === 0 || this.RecheckForm.text.length === 0) {
+        //   console.error("RecheckRecordForm.text 或 RecheckForm.text 为空");
+        //   return;
+        // }
         console.log("RecheckRecordForm.text:", this.RecheckRecordForm.text);
         console.log("RecheckForm.text[this.RecheckIndex]:", this.RecheckForm.text[this.RecheckIndex]);