Przeglądaj źródła

贫困生管理、会员推广记录、会员充值记录完成接口

hzj18279462576@163.com 7 miesięcy temu
rodzic
commit
d044f58926

+ 1 - 1
src/router/index.js

@@ -216,7 +216,7 @@ const mainRoutes = {
       path: "/memberRecharge",
       component: _import("coupon/memberRecharge"),
       name: "memberRecharge",
-      meta: { title: "会员充值记录", isTab: true }
+      meta: { title: "会员开通记录", isTab: true }
     },
     {
       path: "/couponList",

+ 1 - 1
src/utils/httpRequest.js

@@ -46,7 +46,7 @@ http.interceptors.response.use(
     }
     // console.log(
     //   decrypt(
-    //     urlSafeBase64Decode("CJd_exM-7HE6UXeV5Ai_gzavMNsUHJLlvQKWNYgNFszSC-Ahieu4OCoM2bqcGCUM")
+    //     urlSafeBase64Decode("j7U0dMykaHkCmLYvoTJ0DQ==")
     //   ),
     //   "11111111111111111111111111"
     // );

+ 42 - 57
src/views/coupon/memberRecharge.vue

@@ -6,14 +6,14 @@
         style="width: 180px;"
         clearable
         placeholder="请输入手机号码"
-        v-model="search.addressDetail"
+        v-model="search.userPhone"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
     <div style="margin:15px 0;display: inline-block;">
       <span>是否暖心用户:</span>
       <el-select
-        v-model="search.status"
+        v-model="search.specialFlag"
         placeholder="请选择"
         style="width:150px;"
       >
@@ -24,7 +24,7 @@
     <div style="margin:15px 0;display: inline-block;">
       <span>支付时间:</span>
       <el-date-picker
-        v-model="search.createTime"
+        v-model="search.time"
         type="datetimerange"
         unlink-panels
         range-separator="-"
@@ -64,7 +64,7 @@
         >导入
       </el-button> -->
       <el-button
-        :disabled="!isAuth('deliveryAddress:export')"
+        :disabled="!isAuth('memberRecharge:export')"
         size="mini"
         type="warning"
         icon="document"
@@ -86,14 +86,20 @@
       <!-- <el-table-column type="selection">  @selection-change="changeFun"
 			</el-table-column> -->
       <!-- <el-table-column prop="id" label="编号" width="80"></el-table-column> -->
-      <el-table-column prop="stationName" label="用户名"> </el-table-column>
-      <el-table-column prop="stationName" label="手机号码"> </el-table-column>
-      <el-table-column prop="stationName" label="充值金额"> </el-table-column>
-      <el-table-column prop="stationName" label="推广码"> </el-table-column>
-      <el-table-column prop="stationName" label="是否暖心用户"> </el-table-column>
-      <el-table-column prop="stationName" label="支付时间"> </el-table-column>
-      <el-table-column prop="province" label="会员到期时间"> </el-table-column>
-      <el-table-column fixed="right" label="操作" width="180">
+      <el-table-column prop="userName" label="用户名"> </el-table-column>
+      <el-table-column prop="userPhone" label="手机号码"> </el-table-column>
+      <el-table-column prop="payAmount" label="充值金额"> </el-table-column>
+      <el-table-column prop="promoCodeId" label="推广码"> </el-table-column>
+      <el-table-column prop="stationName" label="是否暖心用户">
+        <template slot-scope="scope">
+          <span v-if="scope.row.payType == 3">是</span>
+          <span v-else>否</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="createTime" label="支付时间"> </el-table-column>
+      <el-table-column prop="expireTime" label="会员到期时间">
+      </el-table-column>
+      <!-- <el-table-column fixed="right" label="操作" width="180">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -113,7 +119,7 @@
             >删除
           </el-button>
         </template>
-      </el-table-column>
+      </el-table-column> -->
     </el-table>
     <div style="text-align: center;margin-top: 10px;">
       <el-pagination
@@ -130,7 +136,7 @@
 
     <el-dialog :title="addTitle" :visible.sync="addDialog" center width="600px">
       <el-form :model="addForm">
-         <el-form-item label="姓名:" :label-width="formLabelWidth">
+        <el-form-item label="姓名:" :label-width="formLabelWidth">
           <el-input
             v-model="addForm.addressDetail"
             style="width: 250px"
@@ -294,10 +300,9 @@ export default {
       page: 1,
       tableDataLoading: false,
       search: {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        userPhone: "",
+        specialFlag: "",
+        time: ""
       },
       stationList: [],
       tableData: {
@@ -339,21 +344,6 @@ export default {
   },
   methods: {
     switchType() {},
-
-    stationsData() {
-      this.$http({
-        url: this.$http.adornUrl("admin/riderStation/selectStationList"),
-        method: "get",
-        params: this.$http.adornParams({
-          page: 1,
-          size: 1000
-        })
-      }).then(({ data }) => {
-        console.log(data, "骑手站点");
-        let returnData = data.data.list;
-        this.stationList = returnData;
-      });
-    },
     // 多选
     changeFun(val) {},
 
@@ -374,10 +364,9 @@ export default {
     cleans() {
       this.page = 1;
       this.search = {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        userPhone: "",
+        specialFlag: "",
+        time: ""
       };
       this.dataSelect();
     },
@@ -460,19 +449,18 @@ export default {
     dataSelect() {
       this.tableDataLoading = false;
       this.$http({
-        url: this.$http.adornUrl("admin/inside-address/pages"),
+        url: this.$http.adornUrl("admin/vip-promo/record/pages"),
         method: "get",
         params: this.$http.adornParams({
           page: this.page,
           limit: this.limit,
-          addressDetail: this.search.addressDetail,
-          status: this.search.status,
-          stationId: this.search.stationId,
-          startTime: this.search.createTime[0],
-          endTime: this.search.createTime[1]
+          userPhone: this.search.userPhone,
+          startTime: this.search.time[0],
+          endTime: this.search.time[1],
+          specialFlag: this.search.specialFlag // 是否暖心照顾 1是、0否
         })
       }).then(({ data }) => {
-        console.log(data, "收货地址列表");
+        console.log(data, "会员开通记录列表");
         if (data.msg == "success") {
           this.tableDataLoading = false;
           let returnData = data.data;
@@ -678,18 +666,16 @@ export default {
         this.exportVisible = true;
         var userId = this.$cookie.get("userId");
         this.$http({
-          url: this.$http.adornUrl("admin/export/exportShippingAddress"),
+          url: this.$http.adornUrl("admin/export/exportVipPromoRecord"),
           method: "get",
           // responseType: "blob",
           params: this.$http.adornParams({
-            // 'page': page,
-            // 'size': this.size,
-            userId: userId,
-            addressDetail: this.search.addressDetail,
-            status: this.search.status,
-            stationId: this.search.stationId,
-            startTime: this.search.createTime[0],
-            endTime: this.search.createTime[1]
+            page: 1,
+            limit: 5000,
+            userPhone: this.search.userPhone,
+            startTime: this.search.time[0],
+            endTime: this.search.time[1],
+            specialFlag: this.search.specialFlag // 是否暖心照顾 1是、0否
           })
         }).then(({ data }) => {
           console.log(data, "导出");
@@ -702,11 +688,11 @@ export default {
           //     "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           // });
           // if (window.navigator.msSaveOrOpenBlob) {
-          //   navigator.msSaveBlob(blob);
+          //   navigator.msSaveBlob(data);
           // } else {
-          //   let url = window.URL.createObjectURL(blob);
+          //   let url = window.URL.createObjectURL(data);
           //   let elink = document.createElement("a");
-          //   elink.download = "订单列表.xlsx";
+          //   elink.download = "会员开通记录.xlsx";
           //   elink.style.display = "none";
           //   elink.href = url;
           //   document.body.appendChild(elink);
@@ -821,7 +807,6 @@ export default {
   },
   mounted() {
     this.dataSelect();
-    this.stationsData();
   }
 };
 </script>

+ 108 - 214
src/views/coupon/poorStudent.vue

@@ -6,7 +6,7 @@
         style="width: 180px;"
         clearable
         placeholder="请输入姓名"
-        v-model="search.addressDetail"
+        v-model="search.name"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
@@ -16,25 +16,25 @@
         style="width: 180px;"
         clearable
         placeholder="请输入学号"
-        v-model="search.addressDetail"
+        v-model="search.studentNumber"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
     <div style="position: relative;display: inline-block;margin: 10px 0px;">
       <span>认证结果:</span>
       <el-select
-        v-model="search.status"
+        v-model="search.verifyStatus"
         placeholder="请选择"
         style="width:150px;"
       >
-        <el-option label="启用" :value="1"></el-option>
-        <el-option label="禁用" :value="0"></el-option> </el-select
+        <el-option label="已认证" :value="1"></el-option>
+        <el-option label="未认证" :value="0"></el-option> </el-select
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
     <div style="margin:15px 0;display: inline-block;">
       <span>认证时间:</span>
       <el-date-picker
-        v-model="search.createTime"
+        v-model="search.time"
         type="datetimerange"
         unlink-panels
         range-separator="-"
@@ -66,7 +66,7 @@
     </div>
     <div style="margin:5px 0 15px 0;">
       <el-button
-        :disabled="!isAuth('deliveryAddress:import')"
+        :disabled="!isAuth('poorStudent:import')"
         size="mini"
         type="primary"
         icon="document"
@@ -74,7 +74,7 @@
         >导入
       </el-button>
       <el-button
-        :disabled="!isAuth('deliveryAddress:export')"
+        :disabled="!isAuth('poorStudent:export')"
         style="margin-left:15px;"
         size="mini"
         type="warning"
@@ -84,7 +84,7 @@
         导出Excel
       </el-button>
       <el-button
-        :disabled="!isAuth('deliveryAddress:add')"
+        :disabled="!isAuth('poorStudent:add')"
         style="margin-left:15px;"
         size="mini"
         type="primary"
@@ -97,27 +97,25 @@
       <!-- <el-table-column type="selection">  @selection-change="changeFun"
 			</el-table-column> -->
       <!-- <el-table-column prop="id" label="编号" width="80"></el-table-column> -->
-      <el-table-column prop="stationName" label="姓名"> </el-table-column>
-      <el-table-column prop="province" label="学号"> </el-table-column>
+      <el-table-column prop="name" label="姓名"> </el-table-column>
+      <el-table-column prop="studentNumber" label="学号"> </el-table-column>
+      <el-table-column prop="verifyUserName" label="被认证用户">
+      </el-table-column>
+      <el-table-column prop="verifyUserPhone" label="用户手机号">
+      </el-table-column>
       <el-table-column prop="enableFlag" label="认证结果">
         <template slot-scope="scope">
-          <span>{{ scope.row.createtime }}</span>
+          <span>{{ scope.row.verifyStatus == 1 ? "已认证" : "未认证" }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        prop="addressDetail"
-        show-overflow-tooltip
-        label="原因描述"
-      >
-      </el-table-column>
-      <el-table-column prop="createTime" label="认证时间" width="160">
+      <el-table-column prop="lastVerifyTime" label="认证时间" width="160">
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="180">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="primary"
-            :disabled="!isAuth('deliveryAddress:update')"
+            :disabled="!isAuth('poorStudent:update')"
             @click="updates(scope.row)"
             style="margin: 3px;"
             >修改
@@ -125,10 +123,9 @@
           <el-button
             size="mini"
             type="danger"
-            :disabled="!isAuth('deliveryAddress:delete')"
+            :disabled="!isAuth('poorStudent:delete')"
             @click="deleteuser(scope.row)"
             style="margin: 3px;"
-            v-if="scope.row.id != 14"
             >删除
           </el-button>
         </template>
@@ -149,21 +146,21 @@
 
     <el-dialog :title="addTitle" :visible.sync="addDialog" center width="600px">
       <el-form :model="addForm">
-         <el-form-item label="姓名:" :label-width="formLabelWidth">
+        <el-form-item label="姓名:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.addressDetail"
+            v-model="addForm.name"
             style="width: 250px"
             placeholder="请输入姓名"
           ></el-input>
         </el-form-item>
         <el-form-item label="学号:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.lng"
+            v-model="addForm.studentNumber"
             style="width: 250px"
             placeholder="请输入学号"
           ></el-input>
         </el-form-item>
-        <el-form-item label="骑手站点:" :label-width="formLabelWidth">
+        <!-- <el-form-item label="骑手站点:" :label-width="formLabelWidth">
           <el-select
             v-model="addForm.stationId"
             style="width:250px;"
@@ -191,7 +188,7 @@
             style="width: 250px"
             placeholder="请输入套餐内容"
           ></el-input>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <div style="display: flex;flex-direction: row-reverse;">
         <el-button type="primary" @click="amendAddress">确 定</el-button>
@@ -313,10 +310,10 @@ export default {
       page: 1,
       tableDataLoading: false,
       search: {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        name: "",
+        studentNumber: "",
+        verifyStatus: "",
+        time: ""
       },
       stationList: [],
       tableData: {
@@ -330,21 +327,13 @@ export default {
       options: regionData,
       componentKey: 0,
 
-      storeAddre: [],
-      storeAddreStr: "",
-
       province: "",
       city: "", //市
       district: "", //区
       addForm: {
         id: "",
-        stationId: "", //站点id不能为空
-        deliveryFee: "", //配送费用不能小于0
-        addressDetail: "", //地址详情不能为空
-        lng: "", //经度不能为空
-        lat: "", //维度不能为空
-        status: "", //启用状态;1启用、0禁用
-        sort: "" //排序不能为空
+        name: "",
+        studentNumber: ""
       },
 
       // 导出限制
@@ -393,64 +382,27 @@ export default {
     cleans() {
       this.page = 1;
       this.search = {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        name: "",
+        studentNumber: "",
+        verifyStatus: "",
+        time: ""
       };
       this.dataSelect();
     },
-    // 是否启用
-    changeType(flag, row) {
-      console.log(flag, row);
-      this.$http({
-        url: this.$http.adornUrl("admin/inside-address/updateStatus"),
-        method: "post",
-        data: this.$http.adornData({
-          id: row.id,
-          status: flag //启用状态;1启用、0禁用
-        })
-      }).then(({ data }) => {
-        console.log(data, "新增收货地址");
-        if (data.msg == "success") {
-          this.$message({
-            message: "操作成功",
-            type: "success",
-            duration: 1500,
-            onClose: () => {
-              this.dataSelect();
-            }
-          });
-        }
-      });
-    },
-
-    // 获取省市区
-    handleChange(value) {
-      console.log(value);
-
-      value = this.$refs["cascaderAddr"].currentLabels;
-      this.province = value[0];
-      this.city = value[1];
-      this.district = value[2];
-      if (this.city == "市辖区") {
-        this.city = this.province;
-      }
-      console.log(this.$refs["cascaderAddr"].currentLabels);
-    },
 
     // 删除
     deleteuser(row) {
       let delid = [row.id];
-      this.$confirm(`确定删除此收货地址?`, "提示", {
+
+      this.$confirm(`确定删除此贫困生?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       })
         .then(() => {
           this.$http({
-            url: this.$http.adornUrl("admin/inside-address/delete"),
-            method: "post",
+            url: this.$http.adornUrl("admin/special-favor-student"),
+            method: "delete",
             // data: delid
             data: this.$http.adornData(delid)
           }).then(({ data }) => {
@@ -479,19 +431,19 @@ export default {
     dataSelect() {
       this.tableDataLoading = false;
       this.$http({
-        url: this.$http.adornUrl("admin/inside-address/pages"),
+        url: this.$http.adornUrl("admin/special-favor-student/pages"),
         method: "get",
         params: this.$http.adornParams({
           page: this.page,
           limit: this.limit,
-          addressDetail: this.search.addressDetail,
-          status: this.search.status,
-          stationId: this.search.stationId,
-          startTime: this.search.createTime[0],
-          endTime: this.search.createTime[1]
+          name: this.search.name,
+          studentNumber: this.search.studentNumber,
+          verifyStatus: this.search.verifyStatus,
+          startTime: this.search.time[0],
+          endTime: this.search.time[1]
         })
       }).then(({ data }) => {
-        console.log(data, "收货地址列表");
+        console.log(data, "贫困生管理");
         if (data.msg == "success") {
           this.tableDataLoading = false;
           let returnData = data.data;
@@ -508,21 +460,11 @@ export default {
     },
     // 新增收货地址
     addAddress() {
-      this.addTitle = "新增收货地址";
-      this.storeAddreStr = "请选择省市区";
-      this.storeAddre = [];
+      this.addTitle = "新增贫困生";
       this.addForm = {
         id: "",
-        stationId: "", //站点id不能为空
-        deliveryFee: "", //配送费用不能小于0
-        province: "", //省份不能为空
-        city: "", //城市不能为空
-        district: "", //区县不能为空
-        addressDetail: "", //地址详情不能为空
-        lng: "", //经度不能为空
-        lat: "", //维度不能为空
-        status: "", //启用状态;1启用、0禁用
-        sort: "" //排序不能为空
+        name: "",
+        studentNumber: ""
       };
       this.addDialog = true;
     },
@@ -530,94 +472,50 @@ export default {
     // 编辑
     updates(row) {
       console.log(row);
-      this.addTitle = "编辑收货地址";
-      this.storeAddre = [];
+      this.addTitle = "编辑贫困生";
       this.addForm = {
         id: row.id,
-        stationId: row.stationId, //站点id不能为空
-        deliveryFee: row.deliveryFee, //配送费用不能小于0
-        province: row.province, //省份不能为空
-        city: row.city, //城市不能为空
-        district: row.district, //区县不能为空
-        addressDetail: row.addressDetail, //地址详情不能为空
-        lng: row.lng, //经度不能为空
-        lat: row.lat, //维度不能为空
-        status: row.status, //启用状态;1启用、0禁用
-        sort: row.sort //排序不能为空, //排序不能为空
+        name: row.name,
+        studentNumber: row.studentNumber
       };
-      this.province = row.province;
-      this.city = row.city;
-      this.district = row.district;
       this.addDialog = true;
-      this.storeAddreStr = `${row.province}/${row.city}/${row.district}`;
     },
 
     // 确定收货地址
     amendAddress() {
-      if (this.addForm.stationId == "") {
+      if (this.addForm.name == "" || /^\s+$/.test(this.addForm.name)) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "站点不能为空",
+          message: "姓名不能为空",
           type: "warning"
         });
         return;
       }
-      if (this.addForm.deliveryFee == "" && this.addForm.deliveryFee < 0) {
+      if (
+        this.addForm.studentNumber == "" ||
+        /^\s+$/.test(this.addForm.studentNumber)
+      ) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "配送费不能为空且不能小于0",
-          type: "warning"
-        });
-        return;
-      }
-      if (this.addForm.addressDetail == "") {
-        this.$notify({
-          title: "提示",
-          duration: 1800,
-          message: "地址详情不能为空",
-          type: "warning"
-        });
-        return;
-      }
-      if (this.addForm.lng == "") {
-        this.$notify({
-          title: "提示",
-          duration: 1800,
-          message: "经度不能为空",
-          type: "warning"
-        });
-        return;
-      }
-      if (this.addForm.lat == "") {
-        this.$notify({
-          title: "提示",
-          duration: 1800,
-          message: "纬度不能为空",
+          message: "学号不能为空",
           type: "warning"
         });
         return;
       }
+
       if (this.addForm.id) {
         this.$http({
-          url: this.$http.adornUrl("admin/inside-address/update"),
-          method: "post",
+          url: this.$http.adornUrl("admin/special-favor-student"),
+          method: "put",
           data: this.$http.adornData({
             id: this.addForm.id,
-            stationId: this.addForm.stationId, //站点id不能为空
-            deliveryFee: this.addForm.deliveryFee, //配送费用不能小于0
-            province: this.province, //省份不能为空
-            city: this.city, //城市不能为空
-            district: this.district, //区县不能为空
-            addressDetail: this.addForm.addressDetail, //地址详情不能为空
-            lng: this.addForm.lng, //经度不能为空
-            lat: this.addForm.lat, //维度不能为空
-            status: this.addForm.status, //启用状态;1启用、0禁用
-            sort: this.addForm.sort //排序不能为空
+            name: this.addForm.name,
+            studentNumber: this.addForm.studentNumber
           })
         }).then(({ data }) => {
-          console.log(data, "新增收货地址");
+          console.log(data, "编辑贫困生");
           if (data.msg == "success") {
             this.$message({
               message: "操作成功",
@@ -642,22 +540,14 @@ export default {
         });
       } else {
         this.$http({
-          url: this.$http.adornUrl("admin/inside-address/add"),
+          url: this.$http.adornUrl("admin/special-favor-student"),
           method: "post",
           data: this.$http.adornData({
-            stationId: this.addForm.stationId, //站点id不能为空
-            deliveryFee: this.addForm.deliveryFee, //配送费用不能小于0
-            province: this.province, //省份不能为空
-            city: this.city, //城市不能为空
-            district: this.district, //区县不能为空
-            addressDetail: this.addForm.addressDetail, //地址详情不能为空
-            lng: this.addForm.lng, //经度不能为空
-            lat: this.addForm.lat, //维度不能为空
-            status: this.addForm.status, //启用状态;1启用、0禁用
-            sort: this.addForm.sort //排序不能为空
+            name: this.addForm.name,
+            studentNumber: this.addForm.studentNumber
           })
         }).then(({ data }) => {
-          console.log(data, "新增收货地址");
+          console.log(data, "新增贫困生");
           if (data.msg == "success") {
             this.$message({
               message: "操作成功",
@@ -686,7 +576,6 @@ export default {
     exportList() {
       console.log(this.tableData.totalCount, "导出条数");
       this.exportTitle = "导出";
-      // this.exportFlag = 4;
       this.exportVisible = true;
       if (this.tableData.totalCount >= 50000) {
         this.exportTitle = "导出错误";
@@ -695,20 +584,18 @@ export default {
         this.exportTitle = "导出";
         this.exportFlag = 2;
         this.exportVisible = true;
-        var userId = this.$cookie.get("userId");
         this.$http({
-          url: this.$http.adornUrl("admin/export/exportShippingAddress"),
+          url: this.$http.adornUrl("admin/export/exportSpecialFavorStudent"),
           method: "get",
           // responseType: "blob",
           params: this.$http.adornParams({
-            // 'page': page,
-            // 'size': this.size,
-            userId: userId,
-            addressDetail: this.search.addressDetail,
-            status: this.search.status,
-            stationId: this.search.stationId,
-            startTime: this.search.createTime[0],
-            endTime: this.search.createTime[1]
+            page: 1,
+            limit: 5000,
+            name: this.search.name,
+            studentNumber: this.search.studentNumber,
+            verifyStatus: this.search.verifyStatus,
+            startTime: this.search.time[0],
+            endTime: this.search.time[1]
           })
         }).then(({ data }) => {
           console.log(data, "导出");
@@ -721,11 +608,11 @@ export default {
           //     "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           // });
           // if (window.navigator.msSaveOrOpenBlob) {
-          //   navigator.msSaveBlob(blob);
+          //   navigator.msSaveBlob(data);
           // } else {
-          //   let url = window.URL.createObjectURL(blob);
+          //   let url = window.URL.createObjectURL(data);
           //   let elink = document.createElement("a");
-          //   elink.download = "订单列表.xlsx";
+          //   elink.download = "贫困生列表.xlsx";
           //   elink.style.display = "none";
           //   elink.href = url;
           //   document.body.appendChild(elink);
@@ -748,45 +635,52 @@ export default {
     },
     // 导入模板下载
     daoruTemplate() {
-      this.$http({
-        url: this.$http.adornUrl(
-          "admin/inside-address/downloadInsideAddressExcel"
-        ),
-        method: "get",
-        params: this.$http.adornParams()
-      }).then(({ data }) => {
-        console.log(data, "导出");
-        const link = document.createElement("a");
-        link.href = data.data;
-        // link.download = "模板文件.xlsx"; // 设置下载后的文件名
-        link.target = "_blank"; // 在新标签页中打开
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-      });
+      let http =
+        "https://mxys.chuanghai-tech.com/wmfile/template/special-favor-student-import-template.xlsx";
+      const link = document.createElement("a");
+      link.href = http;
+      link.download = "贫困生导入模板.xlsx"; // 设置下载后的文件名
+      link.target = "_blank"; // 在新标签页中打开
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+      // this.$http({
+      //   url: this.$http.adornUrl(
+      //     "admin/inside-address/downloadInsideAddressExcel"
+      //   ),
+      //   method: "get",
+      //   params: this.$http.adornParams()
+      // }).then(({ data }) => {
+      //   console.log(data, "导出");
+      //   const link = document.createElement("a");
+      //   link.href = data.data;
+      //   // link.download = "模板文件.xlsx"; // 设置下载后的文件名
+      //   link.target = "_blank"; // 在新标签页中打开
+      //   document.body.appendChild(link);
+      //   link.click();
+      //   document.body.removeChild(link);
+      // });
     },
     // 确定导入
     daoruAffirm() {
-      console.log(this.daoruFile, "导入收货地址");
-
       let formData = new FormData();
       formData.append("file", this.daoruFile);
       this.$http({
-        url: this.$http.adornUrl("admin/inside-address/import"),
+        url: this.$http.adornUrl("admin/special-favor-student/import"),
         method: "post",
         // headers: {
         //   'Content-Type': 'multipart/form-data'
         // },
         data: formData
       }).then(({ data }) => {
-        console.log(data, "导入收货地址");
+        console.log(data, "导入");
         if (data.code == 0) {
           this.$message({
             message: "操作成功",
             type: "success",
             duration: 1500,
             onClose: () => {
-              this.addDialog = false;
+              this.daoruVisible = false;
               this.dataSelect();
             }
           });
@@ -840,7 +734,7 @@ export default {
   },
   mounted() {
     this.dataSelect();
-    this.stationsData();
+    // this.stationsData();
   }
 };
 </script>

+ 164 - 182
src/views/coupon/promotion.vue

@@ -6,7 +6,7 @@
         style="width: 180px;"
         clearable
         placeholder="请输入推广人"
-        v-model="search.addressDetail"
+        v-model="search.userName"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
@@ -16,7 +16,7 @@
         style="width: 180px;"
         clearable
         placeholder="请输入推广码"
-        v-model="search.addressDetail"
+        v-model="search.promoCode"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
@@ -26,7 +26,7 @@
         style="width: 180px;"
         clearable
         placeholder="请输入手机号码"
-        v-model="search.addressDetail"
+        v-model="search.phone"
       ></el-input
       >&nbsp;&nbsp;&nbsp;&nbsp;
     </div>
@@ -58,7 +58,7 @@
         >导入
       </el-button> -->
       <el-button
-        :disabled="!isAuth('deliveryAddress:export')"
+        :disabled="!isAuth('promotion:export')"
         size="mini"
         type="warning"
         icon="document"
@@ -67,7 +67,7 @@
         导出Excel
       </el-button>
       <el-button
-        :disabled="!isAuth('deliveryAddress:add')"
+        :disabled="!isAuth('promotion:add')"
         style="margin-left:15px;"
         size="mini"
         type="primary"
@@ -80,17 +80,17 @@
       <!-- <el-table-column type="selection">  @selection-change="changeFun"
 			</el-table-column> -->
       <!-- <el-table-column prop="id" label="编号" width="80"></el-table-column> -->
-      <el-table-column prop="stationName" label="推广码"> </el-table-column>
-      <el-table-column prop="stationName" label="推广人"> </el-table-column>
-      <el-table-column prop="stationName" label="身份证号"> </el-table-column>
-      <el-table-column prop="province" label="手机号码"> </el-table-column>
-      <el-table-column prop="province" label="推广人次"> </el-table-column>
+      <el-table-column prop="promoCode" label="推广码"> </el-table-column>
+      <el-table-column prop="userName" label="推广人"> </el-table-column>
+      <el-table-column prop="idCard" label="身份证号"> </el-table-column>
+      <el-table-column prop="phone" label="手机号码"> </el-table-column>
+      <el-table-column prop="promoCount" label="推广人次"> </el-table-column>
       <el-table-column fixed="right" align="center" label="操作" width="260">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="primary"
-            :disabled="!isAuth('deliveryAddress:update')"
+            :disabled="!isAuth('promotion:tuiguang')"
             @click="promotionDetail(scope.row)"
             style="margin: 3px;"
             >推广明细
@@ -98,7 +98,7 @@
           <el-button
             size="mini"
             type="primary"
-            :disabled="!isAuth('deliveryAddress:update')"
+            :disabled="!isAuth('promotion:update')"
             @click="updates(scope.row)"
             style="margin: 3px;"
             >修改
@@ -106,7 +106,7 @@
           <el-button
             size="mini"
             type="danger"
-            :disabled="!isAuth('deliveryAddress:delete')"
+            :disabled="!isAuth('promotion:delete')"
             @click="deleteuser(scope.row)"
             style="margin: 3px;"
             v-if="scope.row.id != 14"
@@ -133,32 +133,35 @@
       <el-form :model="addForm" :rules="rules" ref="ruleForm">
         <el-form-item label="推广码:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.addressDetail"
+            v-model="addForm.promoCode"
             style="width: 250px"
             placeholder="请输入推广码"
           >
-            <el-button style="color: #3e8ef7;" slot="append"
+            <el-button
+              @click="generateVerificationCode"
+              style="color: #3e8ef7;"
+              slot="append"
               >自动生成</el-button
             >
           </el-input>
         </el-form-item>
         <el-form-item label="推广人:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.lng"
+            v-model="addForm.userName"
             style="width: 250px"
             placeholder="请输入推广人"
           ></el-input>
         </el-form-item>
         <el-form-item label="身份证号:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.lat"
+            v-model="addForm.idCard"
             style="width: 250px"
             placeholder="请输入身份证号"
           ></el-input>
         </el-form-item>
         <el-form-item label="手机号码:" :label-width="formLabelWidth">
           <el-input
-            v-model="addForm.deliveryFee"
+            v-model="addForm.phone"
             style="width: 250px"
             placeholder="请输入手机号码"
           ></el-input>
@@ -185,14 +188,14 @@
           style="width: 160px;"
           clearable
           placeholder="请输入手机号码"
-          v-model="search.addressDetail"
+          v-model="promotionSearch.userPhone"
         ></el-input
         >&nbsp;&nbsp;&nbsp;&nbsp;
       </div>
       <div style="margin:15px 0;display: inline-block;">
         <span>开通时间:</span>
         <el-date-picker
-          v-model="search.createTime"
+          v-model="promotionSearch.time"
           type="datetimerange"
           unlink-panels
           range-separator="-"
@@ -208,7 +211,7 @@
           size="mini"
           type="primary"
           icon="document"
-          @click="select"
+          @click="promotionSelect"
           >查询
         </el-button>
         <el-button
@@ -216,25 +219,25 @@
           size="mini"
           type="primary"
           icon="document"
-          @click="cleans"
+          @click="promotionCleans"
           >重置
         </el-button>
       </div>
-      <el-table v-loading="tableDataLoading" :data="tableData.list">
+      <el-table v-loading="tableDataLoading" :data="promotionTable.list">
         <el-table-column prop="id" label="编号" width="80"></el-table-column>
-        <el-table-column prop="stationName" label="用户名"> </el-table-column>
-        <el-table-column prop="stationName" label="手机号码"> </el-table-column>
-        <el-table-column prop="stationName" label="开通时间"> </el-table-column>
+        <el-table-column prop="userName" label="用户名"> </el-table-column>
+        <el-table-column prop="userPhone" label="手机号码"> </el-table-column>
+        <el-table-column prop="createTime" label="开通时间"> </el-table-column>
       </el-table>
       <div style="text-align: center;margin-top: 10px;">
         <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
+          @size-change="promotionSizeChange"
+          @current-change="promotionCurrentChange"
           :page-sizes="[10, 15, 20, 25]"
-          :page-size="limit"
-          :current-page="page"
+          :page-size="promotionLimit"
+          :current-page="promotionPage"
           layout="total,sizes, prev, pager, next"
-          :total="tableData.totalCount"
+          :total="promotionTable.totalCount"
         >
         </el-pagination>
       </div>
@@ -352,10 +355,9 @@ export default {
       page: 1,
       tableDataLoading: false,
       search: {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        userName: "",
+        promoCode: "",
+        phone: ""
       },
       stationList: [],
       tableData: {
@@ -377,13 +379,10 @@ export default {
       district: "", //区
       addForm: {
         id: "",
-        stationId: "", //站点id不能为空
-        deliveryFee: "", //配送费用不能小于0
-        addressDetail: "", //地址详情不能为空
-        lng: "", //经度不能为空
-        lat: "", //维度不能为空
-        status: "", //启用状态;1启用、0禁用
-        sort: "" //排序不能为空
+        promoCode: "",
+        userName: "",
+        idCard: "",
+        phone: ""
       },
       rules: {
         name: [
@@ -397,10 +396,15 @@ export default {
       },
 
       // 推广明细
+      promotionLimit: 10,
+      promotionPage: 1,
+      promoCodeId: "",
       promotionDialog: false,
-      promotionSearch:{
-
+      promotionSearch: {
+        time: "",
+        userPhone: ""
       },
+      promotionTable: "",
 
       // 导出限制
       exportTitle: "导出错误",
@@ -448,64 +452,25 @@ export default {
     cleans() {
       this.page = 1;
       this.search = {
-        addressDetail: "",
-        createTime: "",
-        status: "",
-        stationId: ""
+        userName: "",
+        promoCode: "",
+        phone: ""
       };
       this.dataSelect();
     },
-    // 是否启用
-    changeType(flag, row) {
-      console.log(flag, row);
-      this.$http({
-        url: this.$http.adornUrl("admin/inside-address/updateStatus"),
-        method: "post",
-        data: this.$http.adornData({
-          id: row.id,
-          status: flag //启用状态;1启用、0禁用
-        })
-      }).then(({ data }) => {
-        console.log(data, "新增收货地址");
-        if (data.msg == "success") {
-          this.$message({
-            message: "操作成功",
-            type: "success",
-            duration: 1500,
-            onClose: () => {
-              this.dataSelect();
-            }
-          });
-        }
-      });
-    },
-
-    // 获取省市区
-    handleChange(value) {
-      console.log(value);
-
-      value = this.$refs["cascaderAddr"].currentLabels;
-      this.province = value[0];
-      this.city = value[1];
-      this.district = value[2];
-      if (this.city == "市辖区") {
-        this.city = this.province;
-      }
-      console.log(this.$refs["cascaderAddr"].currentLabels);
-    },
 
     // 删除
     deleteuser(row) {
       let delid = [row.id];
-      this.$confirm(`确定删除此收货地址?`, "提示", {
+      this.$confirm(`确定删除此推广?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       })
         .then(() => {
           this.$http({
-            url: this.$http.adornUrl("admin/inside-address/delete"),
-            method: "post",
+            url: this.$http.adornUrl("admin/vip-promo"),
+            method: "delete",
             // data: delid
             data: this.$http.adornData(delid)
           }).then(({ data }) => {
@@ -534,19 +499,17 @@ export default {
     dataSelect() {
       this.tableDataLoading = false;
       this.$http({
-        url: this.$http.adornUrl("admin/inside-address/pages"),
+        url: this.$http.adornUrl("admin/vip-promo/pages"),
         method: "get",
         params: this.$http.adornParams({
           page: this.page,
           limit: this.limit,
-          addressDetail: this.search.addressDetail,
-          status: this.search.status,
-          stationId: this.search.stationId,
-          startTime: this.search.createTime[0],
-          endTime: this.search.createTime[1]
+          userName: this.search.userName,
+          promoCode: this.search.promoCode,
+          phone: this.search.phone
         })
       }).then(({ data }) => {
-        console.log(data, "收货地址列表");
+        console.log(data, "会员推广列表");
         if (data.msg == "success") {
           this.tableDataLoading = false;
           let returnData = data.data;
@@ -561,23 +524,24 @@ export default {
         }
       });
     },
+    // 获取随机六位数
+    generateVerificationCode() {
+      let code = "";
+      for (let i = 0; i < 6; i++) {
+        code += Math.floor(Math.random() * 10);
+      }
+      this.$set(this.addForm, "promoCode", code);
+      // return code;
+    },
     // 新增收货地址
     addAddress() {
-      this.addTitle = "新增收货地址";
-      this.storeAddreStr = "请选择省市区";
-      this.storeAddre = [];
+      this.addTitle = "新增推广";
       this.addForm = {
         id: "",
-        stationId: "", //站点id不能为空
-        deliveryFee: "", //配送费用不能小于0
-        province: "", //省份不能为空
-        city: "", //城市不能为空
-        district: "", //区县不能为空
-        addressDetail: "", //地址详情不能为空
-        lng: "", //经度不能为空
-        lat: "", //维度不能为空
-        status: "", //启用状态;1启用、0禁用
-        sort: "" //排序不能为空
+        promoCode: "",
+        userName: "",
+        idCard: "",
+        phone: ""
       };
       this.addDialog = true;
     },
@@ -585,94 +549,72 @@ export default {
     // 编辑
     updates(row) {
       console.log(row);
-      this.addTitle = "编辑收货地址";
-      this.storeAddre = [];
+      this.addTitle = "编辑推广";
       this.addForm = {
         id: row.id,
-        stationId: row.stationId, //站点id不能为空
-        deliveryFee: row.deliveryFee, //配送费用不能小于0
-        province: row.province, //省份不能为空
-        city: row.city, //城市不能为空
-        district: row.district, //区县不能为空
-        addressDetail: row.addressDetail, //地址详情不能为空
-        lng: row.lng, //经度不能为空
-        lat: row.lat, //维度不能为空
-        status: row.status, //启用状态;1启用、0禁用
-        sort: row.sort //排序不能为空, //排序不能为空
+        promoCode: row.promoCode,
+        userName: row.userName,
+        idCard: row.idCard,
+        phone: row.phone
       };
-      this.province = row.province;
-      this.city = row.city;
-      this.district = row.district;
       this.addDialog = true;
-      this.storeAddreStr = `${row.province}/${row.city}/${row.district}`;
     },
 
     // 确定收货地址
     amendAddress() {
-      if (this.addForm.stationId == "") {
-        this.$notify({
-          title: "提示",
-          duration: 1800,
-          message: "站点不能为空",
-          type: "warning"
-        });
-        return;
-      }
-      if (this.addForm.deliveryFee == "" && this.addForm.deliveryFee < 0) {
+      if (
+        this.addForm.promoCode == "" ||
+        /^\s+$/.test(this.addForm.promoCode)
+      ) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "配送费不能为空且不能小于0",
+          message: "推广码不能为空",
           type: "warning"
         });
         return;
       }
-      if (this.addForm.addressDetail == "") {
+      if (this.addForm.userName == "" || /^\s+$/.test(this.addForm.userName)) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "地址详情不能为空",
+          message: "推广人不能为空",
           type: "warning"
         });
         return;
       }
-      if (this.addForm.lng == "") {
+      if (this.addForm.idCard == "" || /^\s+$/.test(this.addForm.idCard)) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "经度不能为空",
+          message: "身份证号不能为空",
           type: "warning"
         });
         return;
       }
-      if (this.addForm.lat == "") {
+      if (this.addForm.phone == "" || /^\s+$/.test(this.addForm.phone)) {
         this.$notify({
           title: "提示",
           duration: 1800,
-          message: "纬度不能为空",
+          message: "手机号码不能为空",
           type: "warning"
         });
         return;
       }
+
       if (this.addForm.id) {
         this.$http({
-          url: this.$http.adornUrl("admin/inside-address/update"),
-          method: "post",
+          url: this.$http.adornUrl("admin/vip-promo"),
+          method: "put",
           data: this.$http.adornData({
             id: this.addForm.id,
-            stationId: this.addForm.stationId, //站点id不能为空
-            deliveryFee: this.addForm.deliveryFee, //配送费用不能小于0
-            province: this.province, //省份不能为空
-            city: this.city, //城市不能为空
-            district: this.district, //区县不能为空
-            addressDetail: this.addForm.addressDetail, //地址详情不能为空
-            lng: this.addForm.lng, //经度不能为空
-            lat: this.addForm.lat, //维度不能为空
-            status: this.addForm.status, //启用状态;1启用、0禁用
-            sort: this.addForm.sort //排序不能为空
+            idCard: this.addForm.idCard, //会员卡号不能为空
+            phone: this.addForm.phone, //手机号不能为空
+            promoCode: this.addForm.promoCode,
+            userName: this.addForm.userName
           })
         }).then(({ data }) => {
-          console.log(data, "新增收货地址");
+          console.log(data, "编辑推广");
           if (data.msg == "success") {
             this.$message({
               message: "操作成功",
@@ -697,22 +639,16 @@ export default {
         });
       } else {
         this.$http({
-          url: this.$http.adornUrl("admin/inside-address/add"),
+          url: this.$http.adornUrl("admin/vip-promo"),
           method: "post",
           data: this.$http.adornData({
-            stationId: this.addForm.stationId, //站点id不能为空
-            deliveryFee: this.addForm.deliveryFee, //配送费用不能小于0
-            province: this.province, //省份不能为空
-            city: this.city, //城市不能为空
-            district: this.district, //区县不能为空
-            addressDetail: this.addForm.addressDetail, //地址详情不能为空
-            lng: this.addForm.lng, //经度不能为空
-            lat: this.addForm.lat, //维度不能为空
-            status: this.addForm.status, //启用状态;1启用、0禁用
-            sort: this.addForm.sort //排序不能为空
+            idCard: this.addForm.idCard, //会员卡号不能为空
+            phone: this.addForm.phone, //手机号不能为空
+            promoCode: this.addForm.promoCode,
+            userName: this.addForm.userName
           })
         }).then(({ data }) => {
-          console.log(data, "新增收货地址");
+          console.log(data, "新增会员推广");
           if (data.msg == "success") {
             this.$message({
               message: "操作成功",
@@ -739,15 +675,65 @@ export default {
     },
 
     // 推广明细
+    promotionDetailList() {
+      this.$http({
+        url: this.$http.adornUrl("admin/vip-promo/record/pages"),
+        method: "get",
+        params: this.$http.adornParams({
+          page: this.promotionPage,
+          limit: this.promotionLimit,
+          startTime: this.promotionSearch.time[0],
+          endTime: this.promotionSearch.time[1],
+          userPhone: this.promotionSearch.userPhone,
+          promoCodeId: this.promoCodeId
+        })
+      }).then(({ data }) => {
+        console.log(data, "推广明细列表");
+        if (data.msg == "success") {
+          let returnData = data.data;
+          this.promotionTable = returnData;
+        } else {
+          this.$message({
+            message: data.msg,
+            type: "warning",
+            duration: 1500,
+            onClose: () => {}
+          });
+        }
+      });
+    },
     promotionDetail(row) {
       console.log(row);
       this.promotionDialog = true;
+      this.promoCodeId = row.id;
+      this.promotionDetailList();
+    },
+    promotionSizeChange(val) {
+      this.promotionLimit = val;
+      this.promotionDetailList();
+    },
+    promotionCurrentChange(val) {
+      this.promotionPage = val;
+      this.promotionDetailList();
+    },
+    // 查询
+    promotionSelect() {
+      this.promotionPage = 1;
+      this.promotionDetailList();
+    },
+    // 重置
+    promotionCleans() {
+      this.promotionPage = 1;
+      this.promotionSearch = {
+        time: "",
+        userPhone: ""
+      };
+      this.promotionDetailList();
     },
 
     exportList() {
       console.log(this.tableData.totalCount, "导出条数");
       this.exportTitle = "导出";
-      // this.exportFlag = 4;
       this.exportVisible = true;
       if (this.tableData.totalCount >= 50000) {
         this.exportTitle = "导出错误";
@@ -756,20 +742,16 @@ export default {
         this.exportTitle = "导出";
         this.exportFlag = 2;
         this.exportVisible = true;
-        var userId = this.$cookie.get("userId");
         this.$http({
-          url: this.$http.adornUrl("admin/export/exportShippingAddress"),
+          url: this.$http.adornUrl("admin/export/exportVipPromoRecord"),
           method: "get",
           // responseType: "blob",
           params: this.$http.adornParams({
-            // 'page': page,
-            // 'size': this.size,
-            userId: userId,
-            addressDetail: this.search.addressDetail,
-            status: this.search.status,
-            stationId: this.search.stationId,
-            startTime: this.search.createTime[0],
-            endTime: this.search.createTime[1]
+            page: 1,
+            limit: 5000,
+            userName: this.search.userName,
+            promoCode: this.search.promoCode,
+            phone: this.search.phone
           })
         }).then(({ data }) => {
           console.log(data, "导出");
@@ -782,11 +764,11 @@ export default {
           //     "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           // });
           // if (window.navigator.msSaveOrOpenBlob) {
-          //   navigator.msSaveBlob(blob);
+          //   navigator.msSaveBlob(data);
           // } else {
-          //   let url = window.URL.createObjectURL(blob);
+          //   let url = window.URL.createObjectURL(data);
           //   let elink = document.createElement("a");
-          //   elink.download = "订单列表.xlsx";
+          //   elink.download = "会员推广列表.xlsx";
           //   elink.style.display = "none";
           //   elink.href = url;
           //   document.body.appendChild(elink);
@@ -901,7 +883,7 @@ export default {
   },
   mounted() {
     this.dataSelect();
-    this.stationsData();
+    // this.stationsData();
   }
 };
 </script>

+ 55 - 55
src/views/main-sidebar-sub-menu.vue

@@ -1,55 +1,55 @@
-<template>
-  <el-submenu 
-    v-if="menu.list && menu.list.length >= 1"
-    :index="menu.menuId + ''"
-    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
-    <template slot="title">
-      <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
-      <span>{{ menu.name }}</span>
-    </template>
-    <sub-menu
-      v-for="item in menu.list" 
-      :key="item.menuId"
-      :menu="item"
-      :dynamicMenuRoutes="dynamicMenuRoutes">
-    </sub-menu>
-  </el-submenu>
-  <el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
-    <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
-    <span>{{ menu.name }}</span>
-  </el-menu-item>
-</template>
-
-<script>
-  import SubMenu from './main-sidebar-sub-menu'
-  export default {
-    name: 'sub-menu',
-    props: {
-      menu: {
-        type: Object,
-        required: true
-      },
-      dynamicMenuRoutes: {
-        type: Array,
-        required: true
-      }
-    },
-    components: {
-      SubMenu
-    },
-    computed: {
-      sidebarLayoutSkin: {
-        get () { return this.$store.state.common.sidebarLayoutSkin }
-      }
-    },
-    methods: {
-      // 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
-      gotoRouteHandle (menu) {
-        var route = this.dynamicMenuRoutes.filter(item => item.meta.menuId === menu.menuId)
-        if (route.length >= 1) {
-          this.$router.push({ name: route[0].name })
-        }
-      }
-    }
-  }
-</script>
+<template>
+  <el-submenu
+    v-if="menu.list && menu.list.length >= 1"
+    :index="menu.menuId + ''"
+    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
+    <template slot="title">
+      <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
+      <span>{{ menu.name }}</span>
+    </template>
+    <sub-menu
+      v-for="item in menu.list"
+      :key="item.menuId"
+      :menu="item"
+      :dynamicMenuRoutes="dynamicMenuRoutes">
+    </sub-menu>
+  </el-submenu>
+  <el-menu-item v-else :index="menu.url + ''" @click="gotoRouteHandle(menu)">
+    <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
+    <span>{{ menu.name }}</span>
+  </el-menu-item>
+</template>
+
+<script>
+  import SubMenu from './main-sidebar-sub-menu'
+  export default {
+    name: 'sub-menu',
+    props: {
+      menu: {
+        type: Object,
+        required: true
+      },
+      dynamicMenuRoutes: {
+        type: Array,
+        required: true
+      }
+    },
+    components: {
+      SubMenu
+    },
+    computed: {
+      sidebarLayoutSkin: {
+        get () { return this.$store.state.common.sidebarLayoutSkin }
+      }
+    },
+    methods: {
+      // 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
+      gotoRouteHandle (menu) {
+        var route = this.dynamicMenuRoutes.filter(item => item.meta.menuId === menu.menuId)
+        if (route.length >= 1) {
+          this.$router.push({ name: route[0].name })
+        }
+      }
+    }
+  }
+</script>

+ 84 - 7
src/views/shopsList/shopsList.vue

@@ -41,6 +41,18 @@
             </el-option> </el-select
           >&nbsp;&nbsp;&nbsp;&nbsp;
         </div>
+        <div style="position: relative;display: inline-block;margin: 10px 0px;">
+          <span>是否为会员立减商家:</span>
+          <el-select
+            v-model="vipPromotion"
+            placeholder="请选择"
+            style="width:150px;"
+            @change="shopSelect()"
+          >
+            <el-option label="是" :value="1"></el-option>
+            <el-option label="否" :value="0"></el-option>
+          </el-select>&nbsp;&nbsp;&nbsp;&nbsp;
+        </div>
         <el-button
           style="margin-left:15px;"
           size="mini"
@@ -298,7 +310,31 @@
             </el-switch>
           </template>
         </el-table-column>
-        <el-table-column label="是否参加活动" width="120" fixed="right">
+        <el-table-column
+          label="是否为会员立减商家"
+          align="center"
+          width="150"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <!-- <div v-if="scope.row.vipPromotion == 1">是</div>
+            <div v-else>否</div> -->
+            <el-switch
+              v-model="scope.row.vipPromotion"
+              @change="changeLJ(scope.row)"
+              :active-value="String(openValue)"
+              :inactive-value="String(closeValue)"
+              active-color="#13ce66"
+            >
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="是否参加活动"
+          align="center"
+          width="120"
+          fixed="right"
+        >
           <template slot-scope="scope">
             <div v-if="scope.row.activityId">是</div>
             <div v-else>否</div>
@@ -315,7 +351,12 @@
             </el-button>
           </template>
         </el-table-column>
-        <el-table-column label="是否隐藏商家" width="120" fixed="right">
+        <el-table-column
+          label="是否隐藏商家"
+          align="center"
+          width="120"
+          fixed="right"
+        >
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.isConceal"
@@ -568,7 +609,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess1"
             :before-upload="beforeAvatarUpload"
-             :headers="{ token: token }"
+            :headers="{ token: token }"
           >
             <img
               v-if="shopCover"
@@ -601,7 +642,7 @@
             :show-file-list="false"
             :on-success="handleRemove"
             :on-progress="onprogress1"
-             :headers="{ token: token }"
+            :headers="{ token: token }"
             :before-upload="beforeAvatarUpload"
           >
             <el-progress
@@ -1558,6 +1599,7 @@ export default {
       page11: 1,
       shopName1: "",
       isActivity: "",
+      vipPromotion:"",
       region: "",
       shopId: "",
       userIdList: "",
@@ -2314,7 +2356,8 @@ export default {
           limit: this.limit,
           shopName: this.shopName1,
           region: this.region,
-          isActivity: this.isActivity
+          isActivity: this.isActivity,
+          vipPromotion:this.vipPromotion
         })
       }).then(({ data }) => {
         let canshu = {
@@ -2520,6 +2563,7 @@ export default {
       this.shopName1 = "";
       this.region = "";
       this.isActivity = "";
+      this.vipPromotion="";
       this.dataSelect();
     },
     // 获取分类数据
@@ -3430,6 +3474,37 @@ export default {
         }
       });
     },
+    // 是否为会员立减商家
+    changeLJ(row) {
+      console.log(row);
+      this.$http({
+        url: this.$http.adornUrl(`/admin/goodsShop/vip-promotion/${row.shopId}/${row.vipPromotion}`),
+        method: "put",
+        data: this.$http.adornData({})
+      }).then(({ data }) => {
+        console.log(data,"是否为会员立减商家");
+
+        if (data.code == 0) {
+          this.$message({
+            message: "操作成功",
+            type: "success",
+            duration: 1500,
+            onClose: () => {
+              this.dataSelect();
+            }
+          });
+        } else {
+          this.$message({
+            message: data.msg,
+            type: "warning",
+            duration: 1500,
+            onClose: () => {
+              this.dataSelect();
+            }
+          });
+        }
+      });
+    },
 
     // 是否隐藏商家
     isConcealChange(row) {
@@ -3513,7 +3588,7 @@ export default {
     let flag = sessionStorage.getItem("shopsListFlag");
     console.log(flag, "shopsListFlag");
 
-    if (flag=='true') {
+    if (flag == "true") {
       let parmas = JSON.parse(sessionStorage.getItem("shopsList"));
       this.page = parmas.page;
       this.limit = parmas.limit;
@@ -3526,7 +3601,7 @@ export default {
       this.shopName1 = "";
       this.region = "";
       this.isActivity = "";
-      sessionStorage.removeItem("shopsList")
+      sessionStorage.removeItem("shopsList");
     }
     this.dataSelect();
     this.dataSelect2();
@@ -3621,6 +3696,7 @@ export default {
 .divs img {
   width: 100%;
 }
+
 /* //参与活动 */
 .canquxiao {
   margin-top: 20px;
@@ -3636,6 +3712,7 @@ export default {
   color: rgba(0, 0, 0, 1);
   text-align: center;
 }
+
 .canqueding {
   margin-top: -35px;
   margin-left: 407px;