浏览代码

项目目标删除

qymljy 2 年之前
父节点
当前提交
93af595680

+ 36 - 2
src/SManagement/project_target/modules/components/delProject.vue

@@ -1,12 +1,46 @@
 <template>
 <template>
   <div>
   <div>
-    <el-button type="text" size="mini">删除</el-button>
+    <el-button type="text" size="mini" @click="onShow">删除</el-button>
+<!--    <el-popconfirm
+        title="确定删除该项目嘛?"
+    >
+      <el-button type="text" size="mini" @click="onDel">删除</el-button>
+    </el-popconfirm>-->
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 export default {
 export default {
-  name: "delProject"
+  name: "delProject",
+  props:["data"],
+  methods:{
+    onShow(){
+      console.log(this.data)
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.onDel()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    async onDel(){
+      const res = await this.$api.requested({
+        "id": 20220905165302,
+        "content": {
+          "sa_salestargetid": [this.data.sa_salestargetid]
+        },
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit("onDel")
+      })
+    }
+  }
 }
 }
 </script>
 </script>
 
 

+ 4 - 1
src/SManagement/project_target/modules/detailInfo.vue

@@ -53,7 +53,7 @@
         <template v-slot:opreation="scope">
         <template v-slot:opreation="scope">
           <el-button type="text" size="mini" class="inline-16" @click="edit(scope.data)" v-if="editShow ">编辑</el-button>
           <el-button type="text" size="mini" class="inline-16" @click="edit(scope.data)" v-if="editShow ">编辑</el-button>
           <el-button type="text" style="color: #e09a1a" size="mini" class="inline-16" v-if="saveShow && actindex === (scope.data.index + 1)" @click="save(scope.data)">保存</el-button>
           <el-button type="text" style="color: #e09a1a" size="mini" class="inline-16" v-if="saveShow && actindex === (scope.data.index + 1)" @click="save(scope.data)">保存</el-button>
-          <project_del class="inline-16" v-if="editShow "></project_del>
+          <project_del class="inline-16" v-if="editShow " :data="scope.data" @onDel="onProjectSuccess"></project_del>
         </template>
         </template>
       </tableLayout>
       </tableLayout>
       <div>
       <div>
@@ -202,6 +202,9 @@ export default {
     onSuccess(){
     onSuccess(){
       this.queryMainData(this.$route.query.id)
       this.queryMainData(this.$route.query.id)
     },
     },
+    onProjectSuccess(){
+      this.getprojectTargetList()
+    },
     handleSizeChange(val) {
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       // console.log(`每页 ${val} 条`);
       this.params.content.pageSize = val
       this.params.content.pageSize = val