ソースを参照

fix:新增删除按钮

Tang 3 年 前
コミット
bd7a69f4da

+ 25 - 1
src/views/2Cport/referralManageMent/tab1/tab1.vue

@@ -50,7 +50,7 @@
                   placement="right"
                   trigger="click"
                 >
-                  <ul style="overflow: auto; max-height: 500px;margin:0px;">
+                  <ul style="overflow: auto; max-height: 500px; margin: 0px">
                     <li
                       v-for="(itm, inds) in scope.row[item.prop]"
                       :key="inds"
@@ -78,6 +78,8 @@
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="editList(scope.row)"
               >修改</el-button
+            ><el-button type="text" size="small" @click="del(scope.row)"
+              >删除</el-button
             >
           </template>
         </el-table-column>
@@ -145,6 +147,7 @@ export default {
         .inquireactivityrecommendList({
           platform: 1,
           type: this.activeName === "first" ? 1 : 2,
+          status:"0,1"
         })
         .then((res) => {
           this.tableData = res.rows;
@@ -162,6 +165,27 @@ export default {
     editList(row) {
       this.$refs.addGL.openBox(0, row.recommendId);
     },
+    del(v) {
+      this.$alert(
+        "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+        }
+      )
+        .then(() => {
+          var data = {
+            recommendId: v.recommendId,
+            status: -1,
+          };
+          this.$api.editactivityrecommend(data).then((res) => {
+            this.$message.success("删除成功");
+            this.search();
+          });
+        })
+        .catch(() => {
+        });
+    },
   },
 };
 </script>

+ 24 - 1
src/views/2Cport/referralManageMent/tab2/tab2.vue

@@ -50,7 +50,7 @@
                   placement="right"
                   trigger="click"
                 >
-                  <ul style="overflow: auto; max-height: 500px;margin:0px;">
+                  <ul style="overflow: auto; max-height: 500px; margin: 0px">
                     <li
                       v-for="(itm, inds) in scope.row[item.prop]"
                       :key="inds"
@@ -78,6 +78,8 @@
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="editList(scope.row)"
               >修改</el-button
+            ><el-button type="text" size="small" @click="del(scope.row)"
+              >删除</el-button
             >
           </template>
         </el-table-column>
@@ -145,6 +147,7 @@ export default {
         .inquireactivityrecommendList({
           platform: 2,
           type: this.activeName === "first" ? 1 : 2,
+          status: "0,1",
         })
         .then((res) => {
           this.tableData = res.rows;
@@ -162,6 +165,26 @@ export default {
     editList(row) {
       this.$refs.addGL.openBox(0, row.recommendId);
     },
+    del(v) {
+      this.$alert(
+        "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+        }
+      )
+        .then(() => {
+          var data = {
+            recommendId: v.recommendId,
+            status: -1,
+          };
+          this.$api.editactivityrecommend(data).then((res) => {
+            this.$message.success("删除成功");
+            this.search();
+          });
+        })
+        .catch(() => {});
+    },
   },
 };
 </script>