Browse Source

主营业务附件删除

caojunjie 2 years ago
parent
commit
e983d70df8

+ 11 - 1
src/api/basicData/configuration.js

@@ -64,6 +64,16 @@ export function corpsbank(data) {
         }
     })
 }
+// 主营业务附件删除
+export function projectFiles(data) {
+  return request({
+    url: '/api/trade-project/project/files/delete',
+    method: 'post',
+    params:{
+      id:data
+    }
+  })
+}
 //客户文件列表删除
 export function corpsfiles(data) {
     return request({
@@ -229,4 +239,4 @@ export function repealPurchase(data) {
         method: 'get',
         params: data
     })
-  }
+  }

+ 31 - 2
src/views/workManagement/main-items/detailsPage.vue

@@ -205,7 +205,7 @@
       <containerTitle title="附件上传"></containerTitle>
       <basic-container style="margin-bottom: 40px">
         <avue-crud :option="upLoadOption" v-model="upLoadForm" :data="upLoadData" @row-save="upLoadSave"
-          @row-update="upLoadUpdate" @row-del="upLoadDel"></avue-crud>
+          @row-update="upLoadUpdate" @row-del="projectFilesfun"></avue-crud>
       </basic-container>
     </div>
 
@@ -315,7 +315,7 @@ import { getList } from "@/api/system/user";
 import { getDeptLazyTree } from "@/api/system/dept";
 
 //上传附件删除
-import { corpsbank } from "@/api/basicData/configuration"
+import {corpsbank, projectFiles} from "@/api/basicData/configuration"
 //事务
 import examineApprove from "@/components/examineApprove/index";
 //对象数组比较
@@ -1349,6 +1349,35 @@ export default {
         }
       })
     },
+      // 附件删除
+      projectFilesfun(row, index){
+          console.log(row,index,1354)
+          this.$confirm("确定将选择数据删除?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+          }).then(() => {
+              if (row.id) {
+                  projectFiles(row.id).then(res => {
+                      if (res.data.success) {
+                          this.$message({
+                              type: "success",
+                              message: "操作成功!"
+                          });
+                          this.upLoadData.splice(index, 1);
+                      }
+                  })
+              } else {
+                  this.$message({
+                      type: "success",
+                      message: "操作成功!"
+                  });
+                  this.upLoadData.splice(index, 1);
+              }
+
+
+          })
+      },
     //服务窗口事件
     serviceNodeClick(data) {
       this.serviceTreeDeptId = data.id;