소스 검색

添加批量废除按钮

duy 2 년 전
부모
커밋
0677373f27
2개의 변경된 파일37개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/api/modules/tentative/detect/test.js
  2. 29 0
      src/views/tentative/detect/test.vue

+ 8 - 0
src/api/modules/tentative/detect/test.js

@@ -41,6 +41,14 @@ export default {
             params: form
         }, msg);
     },
+    //自检记录pdf批量废除
+    async batchAbolish(form, msg = true) {
+            return httpApi({
+                url: '/api/blade-business/informationWriteQuery/​batchAbolish',
+                method: 'post',
+                params: form
+            }, msg);
+    },
     //自检记录pdf批量打印空表
     async printNullPdf(form, msg = true) {
         return httpApi({

+ 29 - 0
src/views/tentative/detect/test.vue

@@ -51,6 +51,13 @@
                             <span>批量打印</span>
                         </el-button>
                     </HcTooltip>
+                    <!-- <HcTooltip keys="tentative_detect_test_quit"> -->
+                    <HcTooltip keys="tentative_detect_test_print">
+                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="quitPdfLoading" @click="quitPdfClick">
+                            <HcIcon name="printer"/>
+                            <span>批量废除</span>
+                        </el-button>
+                    </HcTooltip>
                     <HcTooltip keys="tentative_detect_test_null">
                         <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="printNullPdfLoading" @click="printNullPdfClick">
                             <HcIcon name="printer"/>
@@ -490,6 +497,28 @@ const printPdfClick = async () => {
     }
 }
 
+//批量废除
+const quitPdfLoading = ref(false)
+const quitPdfClick = async () => {
+    const rows = tableCheckedKeys.value;
+    if (rows.length > 0) {
+        const ids = rowsToId(rows)
+        //请求数据
+        quitPdfLoading.value = true
+        const { error, code, msg, data } = await dataApi.batchAbolish({
+            ids: ids
+        },false)
+        //处理数据
+           if (!error && code === 200) {
+            window.$message?.success('废除成功')
+            searchClick()
+        } else {
+            window.$message?.error(msg)
+        }
+    } else {
+        window.$message?.warning('请先勾选需要批量打印的记录')
+    }
+}
 //打印空表
 const printNullPdfLoading = ref(false)
 const printNullPdfClick = async () => {