瀏覽代碼

项目管理进度详细删除文件

Q-ABAB 2 年之前
父節點
當前提交
8ba6aa7448
共有 2 個文件被更改,包括 46 次插入2 次删除
  1. 24 1
      src/views/projectManage/ProjectManagement4.vue
  2. 22 1
      src/views/projectManage/ProjectManagement5.vue

+ 24 - 1
src/views/projectManage/ProjectManagement4.vue

@@ -74,7 +74,8 @@
           >
           <template #default="scope">
               <div class="operations">
-                      <el-button type="primary" class="bt1" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">详情查看</el-button>
+                  <el-button type="primary" class="bt1" size="mini" @click="checkFile(scope.row.url)"  style="background: #477edd">详情查看</el-button>
+                  <el-button type="primary" class="bt1" size="mini" @click="DelFile(scope.$index)"  style="background: #477edd">删除</el-button>
               </div>
           </template>
         </el-table-column>
@@ -152,6 +153,28 @@
           }
         },
         methods:{
+          DelFile(index){
+            this.$confirm("你确定要删除该文件吗?",'删除文件确认').then(res=>{
+              this.tableData.splice(index,1)
+              this.ajax.post(this.$store.state.api+"/AddProjectFile",{
+                uid:this.$store.state.userInfo.userid,
+                cid:JSON.parse(localStorage.getItem('pid')),
+                file:JSON.stringify(this.tableData)
+              }).then(res=>{
+                if(res.data==1){
+                  this.$message.success("删除成功")
+                }else{
+                  this.$message.error("删除失败")
+                }
+                this.getData();
+              }).catch(err=>{
+                console.log(err)
+              })
+            }).catch(err=>{
+              console.log("取消删除文件")
+            })
+   
+          },
           ProgressFormat(value){        //进度条
             return value ==100?'100%':`${value}%`
           },

+ 22 - 1
src/views/projectManage/ProjectManagement5.vue

@@ -72,7 +72,8 @@
           >
           <template #default="scope">
               <div class="operations">
-                      <el-button type="primary"  size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
+                    <el-button type="primary"  size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
+                    <el-button type="primary"  size="mini" @click="DelFile(scope.$index)" style="background: #477edd">删除</el-button>
               </div>
           </template>
         </el-table-column>
@@ -152,6 +153,26 @@
           }
         },
         methods:{
+          DelFile(index){
+            this.$confirm("你确定要删除该文件吗?",'确定文件删除').then(res=>{
+              this.tableData.splice(index,1);
+              this.ajax.post(this.$store.state.api+"/UpdateProjectEndFile",{
+                uid:this.$store.state.userInfo.userid,
+                pid:JSON.parse(localStorage.getItem('pid')),
+                file:JSON.stringify(this.tableData)
+              }).then(res=>{
+                console.log(res)
+                if(res.data==1){
+                  this.$message.success("删除文件成功")
+                }else{
+                  this.$message.error("删除文件失败")
+                }
+                this.getData();
+              })
+            }).catch(err=>{
+              console.log("取消删除文件")
+            })
+          },
           ProgressFormat(value){        //进度条
             return value ==100?'100%':`${value}%`
           },