瀏覽代碼

Merge remote-tracking branch 'origin/250217外协发出一键选择工序,报工维护修改,分选包装后自动周转' into 250217外协发出一键选择工序,报工维护修改,分选包装后自动周转

guoyujia 4 月之前
父節點
當前提交
ca9bc5fc09
共有 1 個文件被更改,包括 37 次插入8 次删除
  1. 37 8
      src/views/business/outsourceInspectionVerify/index.vue

+ 37 - 8
src/views/business/outsourceInspectionVerify/index.vue

@@ -41,7 +41,8 @@
       <el-form-item>
         <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-        <el-button type="primary" icon="Check" :disabled="ids && ids.length == 0" @click="handlePass">批量通过</el-button>
+        <el-button type="primary" icon="Check" :disabled="ids && ids.length == 0" @click="handlePass"
+          :loading="confirmLoading">批量通过</el-button>
         <el-button type="danger" icon="Close" :disabled="ids && ids.length == 0" @click="handleFail">批量不通过</el-button>
         <el-button type="primary" @click="exportForYear">导出审核列表</el-button>
         <el-button v-if="exportSuccess" type="warning" icon="Download">下载导出excel</el-button>
@@ -98,8 +99,9 @@
           <el-table-column label="备注" align="center" prop="remark" width="120" show-overflow-tooltip />
           <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
             <template #default="scope">
-              <el-button v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2" link type="warning"
-                icon="Check" @click="handleConfirm(scope.row)" v-hasPermi="['business:beforeCheckoutVerify:edit']">
+              <el-button v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2" :loading="confirmLoading" link
+                type="warning" icon="Check" @click="handleConfirm(scope.row)"
+                v-hasPermi="['business:beforeCheckoutVerify:edit']">
                 通过
               </el-button>
               <el-button v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 1" link type="primary"
@@ -145,6 +147,7 @@ const multiple = ref(true);
 const total = ref(0);
 const selections = ref([])
 const printCarriers = ref([]);
+const confirmLoading = ref(false)
 const webHost = import.meta.env.VITE_APP_PRODUCTION_API;
 /** 查询对象 */
 const queryParams = ref({
@@ -189,6 +192,7 @@ function resetQuery() {
 }
 //批量通过
 function handlePass() {
+  confirmLoading.value = true
   checkMultiplyFurnace(selections.value).then((res) => {
     if (res.code === 200) {
       if (res.data.length >= 1) {
@@ -201,6 +205,9 @@ function handlePass() {
           .then(() => {
             confirmInspection(res.data).then((res) => {
               getList();
+              confirmLoading.value = false
+            }).catch(e => {
+              confirmLoading.value = false
             });
           });
       } else {
@@ -213,13 +220,21 @@ function handlePass() {
           .then(() => {
             confirmInspection(res.data).then((res) => {
               getList();
-            });
-          });
+              confirmLoading.value = false
+            }).catch(e => {
+              confirmLoading.value = false
+            })
+          }).catch(e => {
+            confirmLoading.value = false
+          })
       }
     } else {
       proxy.$msgError(res.msg);
+      confirmLoading.value = false
     }
-  });
+  }).catch(e => {
+    confirmLoading.value = false
+  })
 }
 //批量不通过
 function handleFail() {
@@ -248,6 +263,7 @@ function handleSelectionChange(selection) {
 }
 
 function handleConfirm(row) {
+  confirmLoading.value = true
   checkFurnace(row).then((res) => {
     if (res.code === 200) {
       if (res.data.length === 1) {
@@ -260,8 +276,14 @@ function handleConfirm(row) {
           .then(() => {
             confirmInspection(res.data).then((res) => {
               getList();
+              confirmLoading.value = false
+            }).catch(e => {
+              confirmLoading.value = false
             });
-          });
+          })
+          .catch(e => {
+            confirmLoading.value = false
+          })
       } else {
         proxy
           .$confirm("该炉已全部质检,是否全部确认通过?", "提示", {
@@ -271,12 +293,19 @@ function handleConfirm(row) {
           })
           .then(() => {
             confirmInspection(res.data).then((res) => {
+              confirmLoading.value = false
               getList();
-            });
+            }).catch(e => {
+              confirmLoading.value = false
+            })
+          })
+          .catch(e => {
+            confirmLoading.value = false
           });
       }
     } else {
       proxy.$msgError(res.msg);
+      confirmLoading.value = false
     }
   });
 }