Răsfoiți Sursa

废除按钮修改

duy 7 luni în urmă
părinte
comite
f8e91562d0

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

@@ -49,4 +49,12 @@ export default {
             params: { id },
         })
     },
+    //废除
+    async annul(form) {
+        return HcApi({
+            url: '/api/blade-business/entrustinfo/annul',
+            method: 'get',
+            params: form,
+        })
+    },
 }

+ 32 - 0
src/views/tentative/detect/commission.vue

@@ -30,6 +30,12 @@
                         <span>新增</span>
                     </el-button>
                 </hc-tooltip>
+               
+                <el-button hc-btn type="danger" :disabled="tableCheckedKeys.length <= 0" @click="repealFormData">
+                    <hc-icon name="arrow-go-back" />
+                    <span>废除</span>
+                </el-button>
+              
                 <hc-tooltip keys="tentative_detect_commission_del">
                     <el-button v-del-com:[delModalClick] :disabled="tableCheckedKeys.length <= 0" hc-btn type="danger">
                         <hc-icon name="delete-bin-2" />
@@ -611,6 +617,32 @@ const hideReport = () => {
 const printerNull = () => {
 
 }
+
+//废除
+const repealFormData = async ()=>{
+    const rows = tableCheckedKeys.value
+    if (rows.length <= 0) {
+        window.$message.warning('请先勾选需要废除的数据')
+        return
+    }
+       //判断是否满足条件
+       const result = rows.every(({ status, expCount }) => {
+            return status === 2 && expCount === 0 || status === 2 && expCount === null
+
+        })
+        if (!result) return window.$message.warning('所选择的数据不能进行废除操作')
+        
+     
+        
+    const { error, code, msg } = await mainApi.annul({ id:arrToId(rows) })
+ 
+    if (!error && code === 200) {
+        window.$message.success(msg)
+        getTableData().then()
+    } else {
+        window.$message.error(msg || '删除失败')
+    }
+}
 </script>
 
 <style lang="scss">