Browse Source

审核记录

fuyou 4 months ago
parent
commit
34203664f1
1 changed files with 71 additions and 42 deletions
  1. 71 42
      check-ui/src/views/business/proofread/topage.vue

+ 71 - 42
check-ui/src/views/business/proofread/topage.vue

@@ -31,6 +31,10 @@
             <div class="record-content">
               <el-input v-model="RecheckForm.text[index]"></el-input>
             </div>
+            <!-- 审核按钮 -->
+            <div class="record-action">
+              <el-button type="primary" @click="confirmCheck_Re(index)">审核</el-button>
+            </div>
             <!-- 复核通过按钮 -->
             <div class="record-action">
               <el-button type="primary" @click="confirmRecheck(index)">复核通过</el-button>
@@ -115,26 +119,6 @@
         </el-form-item>
       </el-form>
     </el-dialog>
-    <!-- 分页组件 -->
-    <!--    <el-pagination-->
-    <!--      v-if="totalpage > 0"-->
-    <!--      :current-page="currentPage"-->
-    <!--      :page-size="pageSize"-->
-    <!--      :total="totalpage"-->
-    <!--      @current-change="handlePageChange"-->
-    <!--      layout="total, prev, pager, next, jumper"-->
-    <!--    ></el-pagination>-->
-
-    <!--    <div class="pagination">-->
-    <!--      <el-pagination-->
-    <!--        background-->
-    <!--        layout="total, prev, pager, next, jumper"-->
-    <!--        :current-page="currentPage"-->
-    <!--        :page-size="pageSize"-->
-    <!--        :total="totalpage"-->
-    <!--        @current-change="handlePageChange"-->
-    <!--      />-->
-    <!--    </div>-->
 
     <div class="top-container">
       <!-- 分页器 -->
@@ -264,28 +248,6 @@
               </div>
             </div>
             <div class="item-buttons">
-              <!--              <el-button-->
-              <!--                type="primary"-->
-              <!--                size="medium"-->
-              <!--                @click="handleCheck(item.itemGuid, item.itemText)"-->
-              <!--              >-->
-              <!--                审核-->
-              <!--              </el-button>-->
-              <!--              <el-button-->
-              <!--                type="primary"-->
-              <!--                size="medium"-->
-              <!--                @click="handleReCheck(item.itemGuid, item.taskGuid)"-->
-              <!--              >-->
-              <!--                复核-->
-              <!--              </el-button>-->
-              <!--              <el-button-->
-              <!--                type="primary"-->
-              <!--                size="medium"-->
-              <!--                @click="handleCheck(item.itemGuid, item.itemText)"-->
-              <!--                :disabled="item.status === '已复核'"-->
-              <!--              >-->
-              <!--                审核保存通过-->
-              <!--              </el-button>-->
               <el-button
                 type="primary"
                 size="medium"
@@ -452,6 +414,8 @@ export default {
       taskGuid: null,
       checkText: null,
       pageGuid: null,
+      // 复核中审核的索引
+      RCindex: null,
     };
   },
   created() {
@@ -639,6 +603,43 @@ export default {
     //   })
     // }
     //
+    async confirmCheck_Re(index) {
+      try {
+        this.RCindex = index;
+        // 检查 index 是否有效
+        if (index === undefined || index < 0 || index >= this.filteredItems.length) {
+          throw new Error("无效的索引");
+        }
+
+        // 获取当前条目
+        const item = this.filteredItems[index];
+        if (!item) {
+          throw new Error("未找到对应的条目");
+        }
+        // 弹出确认对话框
+        await this.$confirm('确定要审核通过吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        });
+
+        // 用户点击“确定”后执行审核逻辑
+        // const item = this.filteredItems[index]; // 获取当前条目
+        //await this.handleCheck(item.itemGuid, item.itemText); // 调用审核逻辑
+        await this.handleCheck_Re()
+      } catch (error) {
+        // 用户点击“取消”时的处理
+        if (error !== 'cancel') {
+          console.error("审核失败:", error);
+          this.$message.error("审核失败,请重试!");
+        } else {
+          this.$message({
+            type: 'info',
+            message: '已取消审核'
+          });
+        }
+      }
+    },
     async confirmCheck(index) {
       try {
         // 检查 index 是否有效
@@ -730,7 +731,35 @@ export default {
         this.$message.error("审核失败,请重试!");
       }
     },
+    async handleCheck_Re() {
+      try {
+        // 记录操作日志
+        this.RecordForm.userGuid = this.$store.state.user.name;
+        this.RecordForm.target1 = this.itemGuid;
+        this.RecordForm.target2 = this.RecheckForm.text[this.RCindex];
+        this.RecordForm.code = "A01";
+        console.log(this.RecordForm)
+        await addLog(this.RecordForm);
 
+        // 获取任务信息
+        const res = await getByItemId(this.itemGuid);
+        this.TaskForm.taskGuid = res.data.taskGuid;
+        this.TaskForm.itemGuid = this.itemGuid;
+        this.TaskForm.status = "已审核";
+        this.TaskForm.itemText = this.RecheckForm.text[this.RCindex];
+
+        // 更新任务状态
+        await updateTask(this.TaskForm);
+        this.$message.success("审核成功");
+
+        // 更新前端 UI
+        // const item = this.filteredItems.find(i => i.itemGuid === itemGuid);
+        // if (item) item.status = "已审核";
+      } catch (error) {
+        console.error("审核失败:", error);
+        this.$message.error("审核失败,请重试!");
+      }
+    },
     // handleReCheck(itemId,taskId){
     //   this.itemGuid = itemId
     //   this.taskGuid = taskId