瀏覽代碼

权益卡【强制销卡】功能调整

gcz 1 月之前
父節點
當前提交
1bc876311c
共有 1 個文件被更改,包括 62 次插入7 次删除
  1. 62 7
      src/views/tourism/membershipManagement/equityCard/equityCardManage.vue

+ 62 - 7
src/views/tourism/membershipManagement/equityCard/equityCardManage.vue

@@ -137,7 +137,9 @@
                       <el-dropdown-item command="handletUseList" icon="el-icon-circle-check"
                       v-hasPermi="configPermi.useList">使用记录</el-dropdown-item>
                       <el-dropdown-item command="handletSellingCards" icon="el-icon-circle-check"
-                      v-hasPermi="configPermi.sellingCards">强制销卡</el-dropdown-item>
+                      v-hasPermi="configPermi.sellingCards">删除</el-dropdown-item>
+                      <el-dropdown-item command="handletForceSellingCards" icon="el-icon-circle-check"
+                      v-hasPermi="configPermi.forceSellingCards">强制销卡</el-dropdown-item>
                   </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -160,6 +162,24 @@
 
     <!--  详情 -->
     <useList ref="useList" @refresh="getList"/>
+
+    <!--  强制销卡弹窗 -->
+    <el-dialog title="强制销卡" :visible.sync="forceSellingCardsVisible" width="500px" append-to-body>
+      <el-form ref="forceSellingCardsForm" :model="forceSellingCardsForm" :rules="forceSellingCardsRules">
+        <el-form-item label="销卡原因" prop="cancelReason">
+          <el-input
+            v-model="forceSellingCardsForm.cancelReason"
+            type="textarea"
+            placeholder="请输入销卡原因"
+            :rows="4"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="forceSellingCardsVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForceSellingCards">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -168,6 +188,7 @@ import {
   listTableApi, 
   delTableParamsApi,
   updateTableApi,
+  publicByPutApi,
   addTableApi
 } from "@/api/CURD";
 import addAndEdit from "./formBox/equityCardManagementForm.vue"
@@ -191,7 +212,8 @@ export default {
         AuthRole: ['equityCard:equityCardManagement:AuthRole'],// 设置审核
         Password: ['equityCard:equityCardManagement:Password'], // 重置密码
         useList: ['equityCard:equityCardManagement:uselist'], // 重置密码
-        sellingCards: ['equityCard:equityCardManagement:sellingCards'] // 强制退卡
+        forceSellingCards: ['equityCard:equityCardManagement:forceSellingCards'], // 强制退卡
+        sellingCards: ['equityCard:equityCardManagement:sellingCards'] // 删除
       },
       configUrl: {
         list: '/merchant/memberEquityCard/pageList', // 列表地址
@@ -202,7 +224,8 @@ export default {
         updateStatus: '/merchant/memberEquityCard/updateStatus', // 禁用/启用
         resetPassword: '/merchant/memberEquityCard/resetPwd', //重置密码
         listCopy: '/merchant/equityCard', // 卡种
-        sellingCards: '/merchant/memberEquityCard/deleteById'
+        sellingCards: '/merchant/memberEquityCard/deleteById',
+        forceSellingCards: '/merchant/memberEquityCard/cancelCard'
       },
       // 遮罩层
       loading: true,
@@ -236,7 +259,18 @@ export default {
         { key: 10, label: `禁用/启用`, visible: true },
         { key: 11, label: `最近消费时间`, visible: true },
       ],
-      tableListCopy: []// 权益卡类型
+      tableListCopy: [],// 权益卡类型
+      // 强制销卡表单
+      forceSellingCardsVisible: false,
+      forceSellingCardsForm: {
+        id: null,
+        cancelReason: ''
+      },
+      forceSellingCardsRules: {
+        cancelReason: [
+          { required: true, message: '请输入销卡原因', trigger: 'blur' }
+        ]
+      }
     };
   },
   created() {
@@ -376,16 +410,16 @@ export default {
         console.error("失败====",e)
       });
     },
-    /**  强制销卡   */
+    /**  删除   */
     handletSellingCards(row){
-      this.$modal.confirm(`请问是否要进行退卡,退卡后该卡将不能使用?`).then( () => {
+      this.$modal.confirm(`请问是否要进行删卡,删卡后该卡将不能使用?`).then( () => {
         return delTableParamsApi(this.configUrl.sellingCards,{
           id: row.id,
           status: 0
         });
       }).then(() => {
         this.getList();
-        this.$modal.msgSuccess(`退卡成功`);
+        this.$modal.msgSuccess(`卡成功`);
       }).catch((e) => {
         console.error("失败====",e)
       });
@@ -414,6 +448,7 @@ export default {
             break;
             case "handletUseList": this.handletUseList(row); break;
             case "handletSellingCards": this.handletSellingCards(row); break;
+            case "handletForceSellingCards": this.handletForceSellingCards(row); break;
             default:
             break;
         }
@@ -430,6 +465,26 @@ export default {
           return '--'
         }
       },
+      /** 强制销卡 */
+      handletForceSellingCards(row) {
+        this.forceSellingCardsForm.id = row.id;
+        this.forceSellingCardsForm.cancelReason = '';
+        this.forceSellingCardsVisible = true;
+      },
+      /** 提交强制销卡 */
+      submitForceSellingCards() {
+        this.$refs.forceSellingCardsForm.validate(valid => {
+          if (valid) {
+            this.$modal.confirm('确认要强制销卡吗?').then(() => {
+              return publicByPutApi(this.configUrl.forceSellingCards, this.forceSellingCardsForm);
+            }).then(() => {
+              this.forceSellingCardsVisible = false;
+              this.getList();
+              this.$modal.msgSuccess('强制销卡成功');
+            }).catch(() => {});
+          }
+        });
+      }
   }
 };
 </script>