MONSTER-ygh 5 hónapja
szülő
commit
ca6ae7b97f

+ 29 - 3
src/views/tourism/membershipManagement/physicalCard/physicalCardManagement.vue

@@ -95,11 +95,21 @@
               class-name="small-padding fixed-width"
             >
               <template slot-scope="scope" >
-                <span v-if="scope.row.status == 0" style="margin-right: 10px;">
+                <span v-if="scope.row.delFlag == 0" style="margin-right: 10px;">
                   <el-button
                     size="mini"
                     type="text"
                     icon="el-icon-delete"
+                    @click="handleDelFlag(scope.row)"
+                    v-hasPermi="configPermi.delFlag"
+                  >销卡</el-button>
+                </span>
+                <span v-if="scope.row.delFlag == 1" style="margin-right: 10px;">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    style="color: #f56c6c;"
                     @click="handleDelete(scope.row)"
                     v-hasPermi="configPermi.delect"
                   >删除</el-button>
@@ -164,16 +174,18 @@
           export: [''],// 导出权限
           print: ['physicalCard:physicalCardManagement:print'],// 打印
           updateStatus: ['physicalCard:physicalCardManagement:updateStatus'],
+          delFlag: ['physicalCard:physicalCardManagement:delFlag']
         },
         configUrl: {
           list: '/merchant/memberEntitycard/pageList', // 列表地址
           delect: '/merchant/memberEntitycard/deleteById', // 删除地址
-          updateStatus: '/merchant/memberEntitycard/updateStatus', // 销卡
+          updateStatus: '/merchant/memberEntitycard/updateStatus', // 启用/禁用
           upload: '',// 导入地址
           download:'', // 下载模板地址
           export: '',// 导出地址
           resetPassword: '/merchant/merchantEntitycard/resetPassword',
-          listCopy: '/merchant/merchantEntitycardConfig/pageList'
+          listCopy: '/merchant/merchantEntitycardConfig/pageList',
+          delFlag: '/merchant/memberEntitycard/updateDelFlag' //
         },
         // 遮罩层
         loading: true,
@@ -271,6 +283,20 @@
           this.$refs.detailsBox.initData(this.title + '详情', "EDITInit",{...row})
         }
       },
+      /** 销卡按钮操作 */
+      handleDelFlag(row) {
+        const ids = row.id || this.ids;
+        this.$modal.confirm('是否要销除该卡吗?').then( () => {
+          return delTableParamsApi(this.configUrl.delFlag,{
+            id: ids
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("销卡成功");
+        }).catch((e) => {
+          console.error("销卡失败====",e)
+        });
+      },
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;