Browse Source

删除项目合同

duy 2 years ago
parent
commit
784131d614
2 changed files with 24 additions and 1 deletions
  1. 8 0
      src/api/modules/project/project-contract.js
  2. 16 1
      src/views/project/contract/index.vue

+ 8 - 0
src/api/modules/project/project-contract.js

@@ -57,6 +57,14 @@ export default {
             data: form
         }, msg);
     },
+    //删除合同
+    async deleteContractInfoById(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/contractInfo/deleteContractInfoById',
+            method: 'get',
+            params: form
+        }, msg);
+    },
     //修改合同
     async updateContractInfo(form, msg = true) {
         return httpApi({

+ 16 - 1
src/views/project/contract/index.vue

@@ -47,7 +47,7 @@
             </template>
             <template #action="{row,index}">
                 <el-button plain size="small" type="primary" @click="editRowClick(row)">编辑</el-button>
-                <el-button plain size="small" type="danger">删除</el-button>
+                <el-button plain size="small" type="danger" @click="delRowClick(row)">删除</el-button>
             </template>
         </HcTable>
 
@@ -62,6 +62,7 @@ import {ref,onMounted,onActivated} from "vue";
 import {useRouter} from 'vue-router'
 import contractApi from '~api/project/project-contract.js';
 import {getArrValue} from "js-fast-way"
+import {delMessage} from "~uti/tools";
 
 const router = useRouter()
 onActivated(()=>{
@@ -161,6 +162,20 @@ const editRowClick = (row) => {
     })
 }
 
+//删除
+const delRowClick = ({id}) => {
+    delMessage(async () => {
+        const {error, code, msg} = await contractApi.deleteContractInfoById({id})
+        //判断状态
+        if (!error && code === 200) {
+            window.$message?.success(msg)
+            getTableData().then()
+        } else {
+            window.$message?.error(msg)
+        }
+    })
+}
+
 //合同回款更新
 const updateClick = () => {
     router.push({