Эх сурвалжийг харах

Merge branch 'dev' of http://120.79.166.78:19005/zhongzheng-edu/saas_masterPlatform into dev

谢杰标 2 жил өмнө
parent
commit
933b0c0c10

+ 4 - 0
src/api/api.js

@@ -87,11 +87,15 @@ import orderManageList from '../fxApi/orderManageList'//订单管理
 //积分管理
 import integral from "../fxApi/integral"//商户列表
 import vipUser from "../fxApi/vipUser"//会员列表
+import configKey from "../fxApi/configKey"//积分规则
+import merchant from "../fxApi/merchant"//合作商户
 
 
 
 // 导入对应模块------------------------
 export default {
+    ...merchant,
+    ...configKey,
     ...vipUser,
     ...integral,
     ...orderManageList,

+ 17 - 0
src/components/searchBoxNew.vue

@@ -155,6 +155,22 @@
               :value="items.id"
             ></el-option>
           </el-select>
+          <!-- 店铺管理列表 -->
+          <el-select
+            v-else-if="item.scope === 'merList'"
+            v-model="formData[item.prop]"
+            :placeholder="item.placeholder"
+            :size="size"
+            clearable
+            filterable
+          >
+            <el-option
+              v-for="(items, indexs) in merList"
+              :key="indexs"
+              :label="items.merName"
+              :value="items.merId"
+            ></el-option>
+          </el-select>
           <!-- 机构列表 -->
           <el-select
             v-else-if="item.scope === 'systemtenantlist'"
@@ -736,6 +752,7 @@ export default {
       "certificate",
       "systemtenantlist",
       "roleList",
+      "merList",
     ]),
     /**
      * @remarks 过滤选择器列表

+ 27 - 0
src/fxApi/configKey.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request' //引入axios请求及拦截器
+export default {
+    //修改积分规则配置
+    mallstoreupdatePointsRule(data) {
+        return request({
+            url: '/mall/store/updatePointsRule',
+            method: 'post',
+            data
+        })
+    },
+    //获取积分规则配置详情
+    mallstoreconfigKeypointsRule(data) {
+        return request({
+            url: '/mall/store/configKey/pointsRule',
+            method: 'get',
+            params: data
+        })
+    },
+    //查询行为操作历史列表
+    systemloglist(data) {
+        return request({
+            url: '/system/log/list',
+            method: 'get',
+            params: data
+        })
+    },
+}

+ 3 - 11
src/fxApi/integral.js

@@ -31,18 +31,10 @@ export default {
             method: 'get',
         })
     },
-    //商户恢复密码
-    mallstorerestorePwd(data) {
+    //店铺批量删除
+    mallstorebatchRemove(data) {
         return request({
-            url: '/mall/store/restorePwd',
-            method: 'post',
-            data
-        })
-    },
-    //商户修改密码
-    mallstoreupdatePwd(data) {
-        return request({
-            url: '/mall/store/updatePwd',
+            url: '/mall/store/batchRemove',
             method: 'post',
             data
         })

+ 58 - 0
src/fxApi/merchant.js

@@ -0,0 +1,58 @@
+import request from '@/utils/request' //引入axios请求及拦截器
+export default {
+    //新增商户店铺管理
+    addmallmerchant(data) {
+        return request({
+            url: '/mall/merchant',
+            method: 'post',
+            data
+        })
+    },
+    //修改商户店铺管理
+    editmallmerchant(data) {
+        return request({
+            url: '/mall/merchant/edit',
+            method: 'post',
+            data
+        })
+    },
+    //合作商户批量删除
+    batchRemovemallmerchant(data) {
+        return request({
+            url: '/mall/merchant/batchRemove',
+            method: 'post',
+            data
+        })
+    },
+    //查询商户店铺管理列表
+    mallmerchantlist(data) {
+        return request({
+            url: '/mall/merchant/list',
+            method: 'get',
+            params: data
+        })
+    },
+    //获取商户店铺管理详细信息
+    mallmerchantdata(data) {
+        return request({
+            url: `/mall/merchant/` + data,
+            method: 'get',
+        })
+    },
+    //商户恢复密码
+    mallmerchantrestorePwd(data) {
+        return request({
+            url: '/mall/merchant/restorePwd',
+            method: 'post',
+            data
+        })
+    },
+    //商户修改密码
+    mallmerchantupdatePwd(data) {
+        return request({
+            url: '/mall/merchant/updatePwd',
+            method: 'post',
+            data
+        })
+    },
+}

+ 16 - 0
src/fxApi/vipUser.js

@@ -32,6 +32,14 @@ export default {
             data
         })
     },
+    //批量会员充值
+    appuserrechargeBatchVip(data) {
+        return request({
+            url: '/app/user/rechargeBatchVip', 
+            method: 'post',
+            data
+        })
+    },
     //会员用户列表
     appuservipUserList(data) {
         return request({
@@ -40,4 +48,12 @@ export default {
             params: data
         })
     },
+    //会员用户列表导出
+    appuserlistExport(data) {
+        return request({
+            url: '/app/user/listExport',
+            method: 'get',
+            params: data
+        })
+    },
 }

+ 8 - 0
src/store/getters.js

@@ -29,6 +29,14 @@ const getters = {
     }
     return state.dict.indexnum
   },
+  merList(state) {
+    if (!state.dict.merList) {
+      api.mallmerchantlist({ status: 1 }).then(res => {
+        state.dict.merList = res.rows
+      })
+    }
+    return state.dict.merList
+  },
   roleList(state) {
     if (!state.dict.roleList) {
       api.obtainRoleList({ status: 1 }).then(res => {

+ 8 - 1
src/store/modules/dict.js

@@ -31,9 +31,16 @@ const state = {
   beforeList: null,//前培安排过滤
   beforeLists: null,//前培安排
   indexnum: null,//模拟
-  systemtenantlist:null,//机构列表
+  systemtenantlist: null,//机构列表
+  merList: null,//店铺管理列表
 }
 const mutations = {
+  //店铺管理列表
+  MERLIST(state) {
+    api.mallmerchantlist({ status: 1 }).then(res => {
+      state.merList = res.rows
+    })
+  },
   //更新角色列表
   EDICROLELIST(state) {
     api.obtainRoleList({ status: 1 }).then(res => {

+ 2 - 2
src/utils/request.js

@@ -7,9 +7,9 @@ import { paramMate } from "@/utils/common";
 
 axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
 // 创建axios实例
-// export const baseURL = process.env.VUE_APP_BASE_API
+export const baseURL = process.env.VUE_APP_BASE_API
 // export const baseURL = 'https://ptapi.gdzzkj.net/'
-export const baseURL = "http://192.168.1.24:7077/";
+// export const baseURL = "http://192.168.1.24:7077/";
 export const BASE_IMG_URL = process.env.VUE_APP_IMG_API;
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 6 - 1
src/views/financed/orderManageList/index.vue

@@ -521,7 +521,12 @@ export default {
         case 4:
           str = "未通过";
           break;
-
+        case 5:
+          str = "支付中";
+          break;
+        case 6:
+          str = "支付失败";
+          break;
         default:
           break;
       }

+ 30 - 24
src/views/integralManagement/exchangeRules/index.vue

@@ -3,72 +3,72 @@
     <div>
       <h4>积分规则:</h4>
       <div class="dis_fx">
-        <el-checkbox v-model="checked"></el-checkbox> 1、一个自然年自动清零
+        <el-checkbox v-model="formData.yearOverEnable"></el-checkbox>
+        1、一个自然年自动清零
       </div>
-      <el-button type="primary" @click="submit">确定</el-button>
-      <el-button @click="record">修改记录</el-button>
       <el-divider></el-divider>
     </div>
     <div>
       <h4>积分兑换:</h4>
       <div class="dis_fx">
-        <el-checkbox v-model="checked"></el-checkbox> 1、1元 =
+        <el-checkbox v-model="formData.oneExchangeEnable"></el-checkbox> 1、1元
+        =
         <el-input-number
           :controls="false"
-          v-model="formData.a"
+          v-model="formData.oneExchangeValue"
           placeholder="输入积分"
           :min="0"
           :precision="0"
         /><span>积分</span>
       </div>
-      <el-button type="primary" @click="submit">确定</el-button>
-      <el-button @click="record">修改记录</el-button>
       <el-divider></el-divider>
     </div>
     <div>
       <h4>积分奖励:</h4>
       <div class="dis_fx">
-        <el-checkbox v-model="checked"></el-checkbox> 1、下单满<el-input-number
+        <el-checkbox v-model="formData.fullEnable"></el-checkbox>
+        1、下单满<el-input-number
           :controls="false"
-          v-model="formData.a"
+          v-model="formData.fullMoneyValue"
           placeholder="输入金额"
           :min="0"
           :precision="2"
         />元,送<el-input-number
           :controls="false"
-          v-model="formData.a"
+          v-model="formData.fullPointsValue"
           placeholder="输入积分"
           :min="0"
           :precision="0"
         />积分
       </div>
       <div class="dis_fx">
-        <el-checkbox v-model="checked"></el-checkbox>
+        <el-checkbox v-model="formData.uploadCarteEnable"></el-checkbox>
         2、e管证证书上传,送<el-input-number
           :controls="false"
-          v-model="formData.a"
+          v-model="formData.uploadCarteValue"
           placeholder="输入积分"
           :min="0"
           :precision="0"
         />积分
       </div>
       <div class="dis_fx">
-        <el-checkbox v-model="checked"></el-checkbox>
+        <el-checkbox v-model="formData.shareGoodsEnable"></el-checkbox>
         3、分享商品,送<el-input-number
           :controls="false"
-          v-model="formData.a"
+          v-model="formData.shareGoodsValue"
           placeholder="输入积分"
           :min="0"
           :precision="0"
         />积分
       </div>
-      <el-button type="primary" @click="submit">确定</el-button>
-      <el-button @click="record">修改记录</el-button>
+      <div style="text-align: center; margin-top: 40px">
+        <el-button size="small" type="primary" @click="submit">保存</el-button>
+        <el-button size="small" @click="record">修改记录</el-button>
+      </div>
     </div>
     <record
       :dialogVisible.sync="dialogVisible"
       @search="search"
-      :activeData="activeData"
     ></record>
   </div>
 </template>
@@ -80,9 +80,7 @@ export default {
   components: { record },
   data() {
     return {
-      checked: false,
       dialogVisible: false,
-      activeData: {},
       formData: {},
     };
   },
@@ -94,14 +92,22 @@ export default {
       this.$alert("确定更改兑换规则吗?", "提示", {
         dangerouslyUseHTMLString: true,
       })
-        .then(() => {})
+        .then(() => {
+          this.$api.mallstoreupdatePointsRule(this.formData).then((res) => {
+            this.$message.success("保存成功");
+            this.search();
+          });
+        })
         .catch(() => {});
     },
     record() {
-      this.activeData = {};
       this.dialogVisible = true;
     },
-    search() {},
+    search() {
+      this.$api.mallstoreconfigKeypointsRule().then((res) => {
+        this.formData = res.data;
+      });
+    },
   },
 };
 </script>
@@ -124,10 +130,10 @@ export default {
     margin: 0px 6px;
   }
 }
-h4{
+h4 {
   font-weight: bold;
 }
-.el-divider{
+.el-divider {
   margin: 40px 0px;
 }
 </style>

+ 28 - 30
src/views/integralManagement/exchangeRules/record.vue

@@ -7,17 +7,17 @@
       @close="close"
       :confirmStatus="false"
     >
-      <el-timeline>
+      <el-timeline style="max-height: 600px;overflow: auto;">
         <el-timeline-item
           v-for="(item, index) in checkLogVos"
-          :timestamp="$methodsTools.onlyForma(item.checkTime)"
+          :timestamp="$methodsTools.onlyForma(item.createTime)"
           placement="top"
         >
           <el-card>
-            <h4>动作:{{ item.b }}</h4>
-            <p>操作人:{{ item.name }}</p>
-            <p>操作前:{{ item.c }}</p>
-            <p>操作后:{{ item.d }}</p>
+            <h4>动作:{{ getlogAction(item.logAction) }}</h4>
+            <p>操作人:{{ item.operName }}</p>
+            <p>操作前:{{ item.oldContent }}</p>
+            <p>操作后:{{ item.newContent }}</p>
           </el-card>
         </el-timeline-item>
       </el-timeline>
@@ -33,40 +33,38 @@ export default {
       type: Boolean,
       default: false,
     },
-    activeData: {
-      type: Object,
-      default: () => {
-        return {};
-      },
-    },
   },
   data() {
     return {
-      formData: {},
-      checkLogVos: [
-        {
-          checkTime: 1234567891,
-          name: "操作人",
-          b: "充值", //动作,
-          c: "积分500", //操作前
-          d: "积分1000", //操作后
-        },
-        {
-          checkTime: 1234567891,
-          name: "操作人",
-          b: "充值", //动作,
-          c: "积分500", //操作前
-          d: "积分1000", //操作后
-        },
-      ],
+      checkLogVos: [],
     };
   },
   mounted() {},
 
   methods: {
+    getlogAction(i) {
+      var a = "";
+      switch (i) {
+        case 1:
+          a = "新增";
+          break;
+        case 2:
+          a = "修改";
+          break;
+        case 3:
+          a = "删除";
+          break;
+
+        default:
+          break;
+      }
+      return a;
+    },
     close() {},
     init() {
-      this.formData = JSON.parse(JSON.stringify(this.activeData));
+      this.$api.systemloglist().then((res) => {
+        this.checkLogVos = res.rows;
+      });
     },
   },
   computed: {

+ 47 - 17
src/views/integralManagement/membershipCard/dislog.vue

@@ -3,7 +3,7 @@
     <BaseDialog
       width="580px"
       :isShow.sync="isShow"
-      :title="activeData.id ? '会员充值' : '会员充值'"
+      title="会员充值"
       @submit="submitForm"
       @close="close"
     >
@@ -11,28 +11,24 @@
         :model="formData"
         :rules="rules"
         ref="formData"
-        label-width="100px"
+        label-width="120px"
         class="demo-ruleForm"
       >
-        <el-form-item label="充值金额:" prop="a">
+        <el-form-item label="充值金额(元):" prop="rechargeCardMoney">
           <el-input
-            clearable
-            v-model="formData.a"
+            v-model="formData.rechargeCardMoney"
             placeholder="请输入充值金额"
           ></el-input>
         </el-form-item>
-        <el-form-item label="积分:" prop="">
+        <el-form-item label="积分:" prop="pointsValue">
           <el-input
             disabled
             clearable
-            v-model="formData.a"
+            v-model="formData.pointsValue"
             placeholder="积分"
           ></el-input>
         </el-form-item>
       </el-form>
-      <template slot="slotBtn">
-        <el-button type="success">启用</el-button>
-      </template>
     </BaseDialog>
   </div>
 </template>
@@ -54,19 +50,46 @@ export default {
   },
   data() {
     return {
-      formData: {},
+      formData: {
+        rechargeCardMoney: "",
+        pointsValue: "",
+      },
       rules: {
-        tenantName: [
-          { required: true, message: "请输入机构名称", trigger: "blur" },
+        rechargeCardMoney: [
+          { required: true, message: "请输入充值金额", trigger: "blur" },
+          {
+            validator: (rule, value, callback) => {
+              var reg_tel = /^[1-9]*[1-9][0-9]*$/;
+              if (reg_tel.test(value)) {
+                this.$set(
+                  this.formData,
+                  "pointsValue",
+                  parseInt(value) * this.ruleData.oneExchangeValue
+                );
+                return callback();
+              } else {
+                this.$set(this.formData, "pointsValue", "");
+                return callback(new Error("充值金额必须大于0,且必须为整数"));
+              }
+            },
+            // 触发器可以同时用blur和change
+            trigger: ["blur"],
+          },
+        ],
+        pointsValue: [
+          { required: false, message: "请输入积分", trigger: "blur" },
         ],
       },
+      ruleData: {},
     };
   },
   mounted() {},
 
   methods: {
     init() {
-      this.formData = JSON.parse(JSON.stringify(this.activeData));
+      this.$api.mallstoreconfigKeypointsRule().then((res) => {
+        this.ruleData = res.data;
+      });
     },
     close() {
       this.$refs["formData"].resetFields();
@@ -74,9 +97,16 @@ export default {
     submitForm() {
       this.$refs["formData"].validate((valid) => {
         if (valid) {
-          this.$message.success("成功");
-          this.isShow = false;
-          this.$emit("search");
+          this.$api
+            .appuserrechargeBatchVip({
+              userIdList: this.activeData.userIdList,
+              rechargeCardMoney: this.formData.rechargeCardMoney,
+            })
+            .then((res) => {
+              this.$message.success("充值成功");
+              this.isShow = false;
+              this.$emit("search", 3);
+            });
         } else {
           return false;
         }

+ 82 - 24
src/views/integralManagement/membershipCard/index.vue

@@ -22,13 +22,21 @@
         <el-button type="primary" @click="batch(1)"> 会员充值 </el-button>
         <el-button type="primary" @click="batch(2)"> 会员恢复 </el-button>
         <el-button @click="batch(3)"> 注销会员 </el-button>
-        <el-button> 导出excel </el-button>
+        <el-button @click="exportData"> 导出excel </el-button>
       </template>
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="addClick(props.scope.row)"
+        <el-button
+          type="text"
+          @click="addClick([props.scope.row.userId])"
+          :disabled="props.scope.row.vipTag !== 1"
           >充值</el-button
-        ><el-button type="text" @click="cancellation(props.scope.row)"
-          >注销</el-button
+        ><el-button type="text" @click="cancellation(props.scope.row)">{{
+          props.scope.row.vipTag == 1
+            ? "注销"
+            : props.scope.row.vipTag == 2
+            ? "恢复"
+            : ""
+        }}</el-button
         ><el-button type="text" @click="record(props.scope.row)"
           >记录</el-button
         >
@@ -58,6 +66,7 @@
 </template>
 
 <script>
+import { exportFn } from "@/utils/index.js";
 import dislog from "./dislog.vue";
 import vipOpen from "./vipOpen.vue";
 import record from "./record.vue";
@@ -86,10 +95,6 @@ export default {
           placeholder: "会员状态",
           scope: "select",
           options: [
-            {
-              label: "未开通",
-              value: 0,
-            },
             {
               label: "已开通",
               value: 1,
@@ -101,8 +106,12 @@ export default {
           ],
         },
         {
-          prop: "tenantid",
-          placeholder: "输入手机号码/身份证号",
+          prop: "telphone",
+          placeholder: "输入手机号码",
+        },
+        {
+          prop: "idCard",
+          placeholder: "输入身份证号",
         },
       ],
       formData: {},
@@ -113,10 +122,6 @@ export default {
           hidden: true,
           scope: "isOptions",
           options: [
-            {
-              label: "未开通",
-              value: 0,
-            },
             {
               label: "已开通",
               value: 1,
@@ -235,13 +240,42 @@ export default {
     this.search(2);
   },
   methods: {
+    exportData() {
+      this.$api.appuserlistExport(this.formData).then((res) => {
+        if (res.msg) {
+          exportFn(res.msg, `导出数据`);
+        } else {
+          this.$message.error("导出失败");
+        }
+      });
+    },
     batch(i) {
       if (this.$refs.tableList.allCheckData.length === 0) {
         this.$message.error("请勾选数据");
         return;
       }
       if (i == 1) {
+        if (this.$refs.tableList.allCheckData.every((k) => k.vipTag === 1)) {
+          this.addClick(this.$refs.tableList.allCheckData.map((k) => k.userId));
+        } else {
+          this.$message.error("只能对会员状态为已开通的会员进行充值");
+          return;
+        }
       } else if (i == 2 || i == 3) {
+        const alist = this.$refs.tableList.allCheckData.filter((item) => {
+          if (i == 2) {
+            return item.vipTag == 2;
+          }
+          if (i == 3) {
+            return item.vipTag == 1;
+          }
+        });
+        if (alist.length === 0) {
+          this.$message.warning(
+            `选中的数据中不存在可${i == 2 ? "恢复" : "注销"}的会员`
+          );
+          return;
+        }
         this.$confirm(`是否${i == 2 ? "恢复" : "注销"}选中的会员`, "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -251,19 +285,19 @@ export default {
             this.$api[
               i == 2 ? "appuserrestoreBatchVip" : "appusercloseBatchVip"
             ]({
-              userIdList: this.$refs.tableList.allCheckData.map(
-                (k) => k.userId
-              ),
+              userIdList: alist.map((k) => k.userId),
             }).then((res) => {
               this.$message.success("操作成功");
-              this.search(2);
+              this.search(3);
             });
           })
           .catch(() => {});
       }
     },
     addClick(data) {
-      this.activeData = data || {};
+      this.activeData = {
+        userIdList: data,
+      };
       this.dialogVisible = true;
     },
     search(v) {
@@ -277,6 +311,11 @@ export default {
           this.$refs.tableList.clearMoreActive();
         });
       }
+      if (v === 3) {
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+      }
       this.$api
         .appuservipUserList(this.formData)
         .then((res) => {
@@ -291,12 +330,31 @@ export default {
     init() {
       this.search(2);
     },
-    //注销会员
+    //注销/恢复会员
     cancellation(row) {
-      this.$alert("确定注销该会员吗?", "提示", {
-        dangerouslyUseHTMLString: true,
-      })
-        .then(() => {})
+      this.$alert(
+        `确定${
+          row.vipTag === 1 ? "注销" : row.vipTag === 2 ? "恢复" : ""
+        }该会员吗?`,
+        "提示",
+        {
+          dangerouslyUseHTMLString: true,
+        }
+      )
+        .then(() => {
+          this.$api[
+            row.vipTag === 1
+              ? "appusercloseBatchVip"
+              : row.vipTag === 2
+              ? "appuserrestoreBatchVip"
+              : ""
+          ]({
+            userIdList: [row.userId],
+          }).then((res) => {
+            this.$message.success("操作成功");
+            this.search(3);
+          });
+        })
         .catch(() => {});
     },
     record(data) {

+ 18 - 17
src/views/integralManagement/merchantManageMent/dislog.vue

@@ -3,7 +3,7 @@
     <BaseDialog
       width="580px"
       :isShow.sync="isShow"
-      :title="storeId ? '编辑商户' : '添加商户'"
+      :title="merId ? '编辑商户' : '添加商户'"
       @submit="submitForm"
       @close="close"
     >
@@ -14,10 +14,10 @@
         label-width="100px"
         class="demo-ruleForm"
       >
-        <el-form-item label="合作商户:" prop="storeName">
+        <el-form-item label="合作商户:" prop="merName">
           <el-input
             clearable
-            v-model="formData.storeName"
+            v-model="formData.merName"
             placeholder="请输入合作商户"
           ></el-input>
         </el-form-item>
@@ -39,11 +39,11 @@
           <el-input
             disabled
             clearable
-            v-model="formData.storeAccount"
+            v-model="formData.merAccount"
             placeholder="请输入用户名"
           ></el-input>
         </el-form-item>
-        <el-form-item label="密码:" v-if="storeId === 0">
+        <el-form-item label="密码:" v-if="merId === 0">
           <el-input
             disabled
             clearable
@@ -67,7 +67,7 @@ export default {
       type: Boolean,
       default: false,
     },
-    storeId: {
+    merId: {
       type: Number,
       default: 0,
     },
@@ -80,7 +80,7 @@ export default {
       } else if (!reg.test(value)) {
         return callback(new Error("请输入正确手机号码"));
       } else {
-        if (this.storeId === 0) {
+        if (this.merId === 0) {
           this.$set(
             this.formData,
             "initPwd",
@@ -92,20 +92,20 @@ export default {
     };
     return {
       formData: {
-        storeName: "",
+        merName: "",
         contacts: "",
         telphone: "",
-        storeAccount: "",
+        merAccount: "",
         initPwd: "",
       },
       rules: {
-        storeName: [
+        merName: [
           { required: true, message: "请输入合作商户", trigger: "blur" },
         ],
         contacts: [
           { required: true, message: "请输入联系人", trigger: "blur" },
         ],
-        storeAccount: [
+        merAccount: [
           { required: false, message: "请输入用户名", trigger: "blur" },
         ],
         initPwd: [{ required: false, message: "请输入密码", trigger: "blur" }],
@@ -116,17 +116,17 @@ export default {
 
   methods: {
     init() {
-      if (this.storeId) {
-        this.$api.mallstoredata(this.storeId).then((res) => {
+      if (this.merId) {
+        this.$api.mallmerchantdata(this.merId).then((res) => {
           this.formData = res.data;
-          this.formData.storeAccount = res.data.userName;
+          this.formData.merAccount = res.data.userName;
         });
       } else {
         this.formData = {
-          storeName: "",
+          merName: "",
           contacts: "",
           telphone: "",
-          storeAccount: "manager",
+          merAccount: "manager",
           initPwd: "",
         };
       }
@@ -137,12 +137,13 @@ export default {
     submitForm(status) {
       this.$refs["formData"].validate((valid) => {
         if (valid) {
-          this.$api[this.storeId ? "editmallstore" : "addmallstore"]({
+          this.$api[this.merId ? "editmallmerchant" : "addmallmerchant"]({
             status: status ? 1 : 0,
             ...this.formData,
           }).then((res) => {
             this.$message.success("成功");
             this.isShow = false;
+            this.$store.commit("MERLIST");
             this.$emit("search");
           });
         } else {

+ 47 - 17
src/views/integralManagement/merchantManageMent/index.vue

@@ -8,7 +8,7 @@
       @init="init"
     />
     <table-list
-      rowKey="id"
+      rowKey="merId"
       ref="tableList"
       :tableSets="tableSet"
       :tableData="tableData"
@@ -17,7 +17,7 @@
       @addClick="addClick"
     >
       <template slot="customize">
-        <el-button type="warning"> 批量删除 </el-button>
+        <el-button type="warning" @click="remove"> 批量删除 </el-button>
       </template>
       <template slot="status" slot-scope="props">
         <el-switch
@@ -47,7 +47,7 @@
     <dislog
       :dialogVisible.sync="dialogVisible"
       @search="search"
-      :storeId="storeId"
+      :merId="merId"
     ></dislog>
   </div>
 </template>
@@ -68,13 +68,14 @@ export default {
         index: 0,
         ch: "条",
         num: true,
-        choice: false,
+        choice: true,
         addHide: false,
         custom: false,
+        openCheckMore: true,
       },
       formList: [
         {
-          prop: "storeName",
+          prop: "merName",
           placeholder: "输入合作商户",
         },
       ],
@@ -82,7 +83,7 @@ export default {
       tableSet: [
         {
           label: "合作商户",
-          prop: "storeName",
+          prop: "merName",
           hidden: true,
         },
         {
@@ -102,15 +103,39 @@ export default {
       tableData: [],
       total: 0,
       dialogVisible: false,
-      storeId: 0,
+      merId: 0,
     };
   },
   created() {
     this.search(2);
   },
   methods: {
+    remove() {
+      if (this.$refs.tableList.allCheckData.length === 0) {
+        this.$message.error("请勾选数据");
+        return;
+      }
+      this.$confirm("确定批量删除选中的数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$api
+            .batchRemovemallmerchant({
+              merIds: this.$refs.tableList.allCheckData.map((i) => i.merId),
+              status: -1,
+            })
+            .then(() => {
+              this.$message.success("批量删除成功");
+              this.$store.commit("MERLIST");
+              this.search(3);
+            });
+        })
+        .catch(() => {});
+    },
     addClick(data) {
-      this.storeId = data?.storeId || 0;
+      this.merId = data?.merId || 0;
       this.dialogVisible = true;
     },
     search(v) {
@@ -125,8 +150,13 @@ export default {
           this.$refs.tableList.clearMoreActive();
         });
       }
+      if (v === 3) {
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+      }
       this.$api
-        .mallstorelist(this.formData)
+        .mallmerchantlist(this.formData)
         .then((res) => {
           this.tableData = res.rows;
           this.total = res.total;
@@ -138,9 +168,10 @@ export default {
     },
     statusChange(e, row) {
       this.$api
-        .editmallstore({ storeId: row.storeId, status: e })
+        .editmallmerchant({ merId: row.merId, status: e })
         .then((res) => {
           this.$message.success("操作成功");
+          this.$store.commit("MERLIST");
           row.status = e;
         })
         .catch(() => {
@@ -158,12 +189,10 @@ export default {
         type: "warning",
       })
         .then(() => {
-          this.$api
-            .mallstorerestorePwd({ storeId: row.storeId })
-            .then((res) => {
-              this.$message.success("操作成功");
-              this.search();
-            });
+          this.$api.mallmerchantrestorePwd({ merId: row.merId }).then((res) => {
+            this.$message.success("操作成功");
+            this.search();
+          });
         })
         .catch(() => {});
     },
@@ -175,9 +204,10 @@ export default {
       })
         .then(() => {
           this.$api
-            .editmallstore({ storeId: row.storeId, status: -1 })
+            .editmallmerchant({ merId: row.merId, status: -1 })
             .then((res) => {
               this.$message.success("删除成功");
+              this.$store.commit("MERLIST");
               this.search();
             });
         })

+ 150 - 0
src/views/integralManagement/storeManageMent/dislog.vue

@@ -0,0 +1,150 @@
+<template>
+  <div>
+    <BaseDialog
+      width="580px"
+      :isShow.sync="isShow"
+      :title="storeId ? '编辑店铺' : '添加店铺'"
+      @submit="submitForm"
+      @close="close"
+    >
+      <el-form
+        :model="formData"
+        :rules="rules"
+        ref="formData"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <el-form-item label="合作商户:" prop="merId">
+          <el-select
+            v-model="formData.merId"
+            placeholder="请选择合作商户"
+            clearable
+            filterable
+          >
+            <el-option
+              v-for="(items, indexs) in merList"
+              :key="indexs"
+              :label="items.merName"
+              :value="items.merId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="店铺简称:" prop="storeName">
+          <el-input
+            clearable
+            v-model="formData.storeName"
+            placeholder="请输入店铺简称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="店铺地址:" prop="address">
+          <el-input
+            clearable
+            v-model="formData.address"
+            placeholder="请输入店铺地址"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <template slot="slotBtn">
+        <el-button type="success" @click="submitForm(true)">启用</el-button>
+      </template>
+    </BaseDialog>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+export default {
+  name: "",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    storeId: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      formData: {
+        merId: "",
+        storeName: "",
+        address: "",
+      },
+      rules: {
+        merId: [
+          { required: true, message: "请选择合作商户", trigger: "change" },
+        ],
+        storeName: [
+          { required: true, message: "请输入店铺简称", trigger: "blur" },
+        ],
+        address: [
+          { required: false, message: "请输入店铺地址", trigger: "blur" },
+        ],
+      },
+    };
+  },
+
+  methods: {
+    init() {
+      if (this.storeId) {
+        this.$api.mallstoredata(this.storeId).then((res) => {
+          this.formData = res.data;
+        });
+      } else {
+        this.formData = {
+          merId: "",
+          storeName: "",
+          address: "",
+        };
+      }
+      console.log(this.merList, "---merList");
+    },
+    close() {
+      this.$refs["formData"].resetFields();
+    },
+    submitForm(status) {
+      this.$refs["formData"].validate((valid) => {
+        if (valid) {
+          this.$api[this.storeId ? "editmallstore" : "addmallstore"]({
+            status: status ? 1 : 0,
+            ...this.formData,
+          }).then((res) => {
+            this.$message.success("成功");
+            this.isShow = false;
+            this.$emit("search");
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  computed: {
+    ...mapGetters(["merList"]),
+    isShow: {
+      get() {
+        if (this.dialogVisible) {
+          this.init();
+        }
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.el-input {
+  width: 220px;
+  margin-right: 10px;
+}
+.el-select {
+  width: 220px;
+  margin-right: 10px;
+}
+</style>

+ 215 - 0
src/views/integralManagement/storeManageMent/index.vue

@@ -0,0 +1,215 @@
+<template>
+  <div id="">
+    <search-box-new
+      ref="searchBox"
+      :formData="formData"
+      :formList="formList"
+      @search="search"
+      @init="init"
+    />
+    <table-list
+      rowKey="storeId"
+      ref="tableList"
+      :tableSets="tableSet"
+      :tableData="tableData"
+      :navText="navText"
+      :loading="loading"
+      @addClick="addClick"
+    >
+      <template slot="customize">
+        <el-button type="warning" @click="remove"> 批量删除 </el-button>
+      </template>
+      <template slot="status" slot-scope="props">
+        <el-switch
+          v-model="props.scope.row.status"
+          active-color="#13ce66"
+          inactive-color="#ff4949"
+          :active-value="1"
+          :inactive-value="0"
+          @change="statusChange($event, props.scope.row)"
+        >
+        </el-switch>
+      </template>
+      <template slot="btn" slot-scope="props">
+        <el-button type="text" @click="addClick(props.scope.row)"
+          >编辑</el-button
+        ><el-button type="text" @click="del(props.scope.row)">删除</el-button>
+      </template>
+    </table-list>
+    <pagination
+      :total="total"
+      :pageSize.sync="formData.pageSize"
+      :currentPage.sync="formData.pageNum"
+      @search="search"
+    />
+    <dislog
+      :dialogVisible.sync="dialogVisible"
+      @search="search"
+      :storeId="storeId"
+    ></dislog>
+  </div>
+</template>
+
+<script>
+import dislog from "./dislog.vue";
+import searchBoxNew from "@/components/searchBoxNew";
+import tableList from "@/components/tableList";
+import pagination from "@/components/pagination";
+export default {
+  name: "StoreManageMent",
+  components: { searchBoxNew, tableList, pagination, dislog },
+  data() {
+    return {
+      loading: false,
+      navText: {
+        title: "店铺管理",
+        index: 0,
+        ch: "条",
+        num: true,
+        choice: true,
+        addHide: false,
+        custom: false,
+        openCheckMore: true,
+      },
+      formList: [
+        {
+          prop: "merId",
+          placeholder: "请选择合作商户",
+          scope: "merList",
+        },
+        {
+          prop: "storeName",
+          placeholder: "输入店铺简称",
+        },
+      ],
+      formData: {},
+      tableSet: [
+        {
+          label: "店铺简称",
+          prop: "storeName",
+          hidden: true,
+        },
+        {
+          label: "店铺地址",
+          prop: "address",
+          hidden: true,
+        },
+        {
+          label: "合作商户",
+          prop: "merName",
+          hidden: true,
+        },
+        {
+          label: "启用状态",
+          prop: "status",
+          hidden: true,
+          scope: "solt",
+          soltName: "status",
+        },
+        {
+          label: "创建时间",
+          prop: "createTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
+      ],
+      tableData: [],
+      total: 0,
+      dialogVisible: false,
+      storeId: 0,
+    };
+  },
+  created() {
+    this.search(2);
+  },
+  methods: {
+    remove() {
+      if (this.$refs.tableList.allCheckData.length === 0) {
+        this.$message.error("请勾选数据");
+        return;
+      }
+      this.$confirm("确定批量删除选中的数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$api
+            .mallstorebatchRemove({
+              storeIds: this.$refs.tableList.allCheckData.map((i) => i.storeId),
+              status: -1,
+            })
+            .then(() => {
+              this.$message.success("批量删除成功");
+              this.search(3);
+            });
+        })
+        .catch(() => {});
+    },
+    addClick(data) {
+      this.storeId = data?.storeId || 0;
+      this.dialogVisible = true;
+    },
+    search(v) {
+      this.loading = true;
+      if (v === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          status: "0,1",
+        };
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+      }
+      if (v === 3) {
+        this.$nextTick(() => {
+          this.$refs.tableList.clearMoreActive();
+        });
+      }
+      this.$api
+        .mallstorelist(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    statusChange(e, row) {
+      this.$api
+        .editmallstore({ storeId: row.storeId, merId: row.merId, status: e })
+        .then((res) => {
+          this.$message.success("操作成功");
+          row.status = e;
+        })
+        .catch(() => {
+          return (row.status = e ? 0 : 1);
+        });
+    },
+    init() {
+      this.search(2);
+    },
+    del(v) {
+      this.$confirm("确定删除此内容?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$api
+            .editmallmerchant({ storeId: row.storeId, status: -1 })
+            .then((res) => {
+              this.$message.success("删除成功");
+              this.search();
+            });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>