谢杰标 2 лет назад
Родитель
Сommit
070cb2fb29

+ 33 - 0
src/api/order/index.js

@@ -0,0 +1,33 @@
+import request from "@/utils/request";
+
+// 所有订单列表
+export function getOrderList(query) {
+  return request({
+    url: "/store/order/integral/list",
+    method: "get",
+    params: query,
+  });
+}
+// 订单详情
+export function getOrderDetail(id) {
+  return request({
+    url: "/store/order/integral/" + id,
+    method: "get",
+  });
+}
+// 订单导出
+export function orderExport(query) {
+  return request({
+    url: "/store/order/export",
+    method: "get",
+    params: query,
+  });
+}
+// 订单统计
+export function orderStatistics(query) {
+    return request({
+      url: "/store/order/statistics",
+      method: "get",
+      params: query,
+    });
+  }

+ 18 - 0
src/api/order/menber.js

@@ -0,0 +1,18 @@
+import request from "@/utils/request";
+
+// 所有店铺列表
+export function getUserList(query) {
+  return request({
+    url: "/store/order/user/list",
+    method: "get",
+    params: query,
+  });
+}
+// 导出
+export function userExport(query) {
+  return request({
+    url: "/store/order/user/export",
+    method: "get",
+    params: query,
+  });
+}

BIN
src/assets/images/icon_code.png


+ 8 - 1
src/components/tableList.vue

@@ -137,7 +137,9 @@
               ? "--"
               : $methodsTools.onlyForma(scope.row[item.prop], !item.isDiszing)
           }}</span>
-
+          <span v-else-if="item.scope === 'money'">
+            {{ scope.row[item.prop] | formatPrice }}
+          </span>
           <span v-else-if="item.scope === 'time'">{{
             numTime(scope.row[item.prop])
           }}</span>
@@ -215,6 +217,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 export default {
   props: [
     "tableSets",
@@ -256,6 +259,9 @@ export default {
     compTableSet: function () {
       return function (options) {
         var arrays = options.filter((item) => {
+          if (item.isStore && this.isAdmin) {
+            item.hidden = true;
+          }
           return item.hidden !== false;
         });
         return arrays;
@@ -266,6 +272,7 @@ export default {
         return Number(res / 3600).toFixed(2);
       };
     },
+    ...mapGetters(["isAdmin"]),
   },
   created() {
     this.inittableSet = JSON.stringify(this.tableSet);

+ 22 - 9
src/views/components/index/payContain.vue

@@ -104,23 +104,23 @@
       title="请先扫码会员卡"
       :isShow.sync="isShow"
       @submit="submitForm"
+      width="547px"
       confirmName="确 认"
     >
       <el-form :model="this" :rules="rules" ref="ruleForm">
         <el-form-item label=" " prop="cardSn">
           <div class="input-box">
             <el-input
-              placeholder="请扫描会员卡"
+              placeholder="输入手机号码/会员卡号"
               v-model="cardSn"
               :max="8"
               v-int="{ set: 0 }"
             >
-              <img
-                class="dialog-icon"
-                src="../../../assets/images/icon_scan.png"
-                slot="suffix"
-              />
             </el-input>
+            <img
+              class="dialog-icon"
+              src="../../../assets/images/icon_code.png"
+            />
           </div>
         </el-form-item>
       </el-form>
@@ -208,7 +208,7 @@ export default {
         },
       ],
       active: 1,
-      isShow: false,
+      isShow: true,
       cardSn: "1000146902628081",
       rules: {
         cardSn: [{ validator: validateCardSn, trigger: "blur" }],
@@ -505,8 +505,21 @@ export default {
   }
 }
 .input-box {
-  img {
-    margin: 8px 8px 0 0;
+  // img {
+  //   margin: 8px 8px 0 0;
+  // }
+  position: relative;
+  .dialog-icon {
+    position: absolute;
+    top: 50%;
+    margin-top: -22px;
+    right: 26px;
+  }
+  /deep/ {
+    .el-input--medium .el-input__inner {
+      height: 90px;
+      font-size: 18px;
+    }
   }
 }
 .scan_pay_box {

+ 1 - 1
src/views/components/index/scan.vue

@@ -5,7 +5,7 @@
         <div class="input-box">
           <el-input
             @focus="$emit('changeFocusType', 'cardSn')"
-            placeholder="请扫描会员卡"
+            placeholder="输入手机号码/会员卡号"
             v-model="memberInfo.cardSn"
             :max="8"
             v-int="{ set: 0 }"

+ 1 - 0
src/views/goodsMag/classify.vue

@@ -79,6 +79,7 @@ export default {
         {
           label: "所属店铺",
           prop: "storeName",
+          isStore: true,
         },
         {
           label: "启动状态",

+ 45 - 22
src/views/memberMag/index.vue

@@ -1,7 +1,7 @@
 <template>
   <container title="会员管理">
     <template v-slot:btn>
-      <el-button>导出excel</el-button>
+      <el-button @click="handelExport">导出excel</el-button>
     </template>
     <search-box-new
       :formData="formData"
@@ -16,17 +16,6 @@
       :navText="navText"
       :loading="loading"
     >
-      <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="handelClick(2, props.scope.row.tpId)"
-          >复制</el-button
-        >
-        <el-button type="text" @click="handelClick(1, props.scope.row.tpId)"
-          >修改</el-button
-        >
-        <el-button type="text" @click="handelDel(props.scope.row.tpId)"
-          >删除</el-button
-        >
-      </template>
     </table-list>
     <pagination
       :total="total"
@@ -38,9 +27,10 @@
 </template>
 
 <script>
+import { getUserList, userExport } from "@/api/order/menber";
+import { exportFn } from "@/utils/index.js";
 export default {
   name: "SaasMemberRecord",
-
   data() {
     return {
       countList: [
@@ -77,24 +67,30 @@ export default {
         addHide: true,
         openCheckMore: true,
         custom: false,
+        tableHide: true,
       },
       formData: { datePicker: [] },
       tableSet: [
+        {
+          label: "所属店铺",
+          prop: "storeName",
+          isStore: true,
+        },
         {
           label: "卡号",
-          prop: "tpName",
+          prop: "cardSn",
         },
         {
           label: "会员姓名",
-          prop: "tpName",
+          prop: "userName",
         },
         {
           label: "会员手机号",
-          prop: "tpName",
+          prop: "telphone",
         },
         {
           label: "总消费金额(元)",
-          prop: "tpName",
+          prop: "payPriceTotal",
         },
         {
           label: "剩余积分",
@@ -109,21 +105,48 @@ export default {
           scope: "store",
         },
         {
-          prop: "name",
-          placeholder: "请输产品名称",
+          prop: "keyword",
+          placeholder: "请输产手机号码/会员卡号",
         },
       ],
+      formData: {},
     };
   },
 
-  mounted() {},
+  mounted() {
+    this.init();
+  },
 
   methods: {
     search(v) {
-      console.log(this.formData, 789);
+      this.loading = true;
+      if (v === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          status: "0,1",
+        };
+      }
+      getUserList(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     init() {
-      this.search();
+      this.search(2);
+    },
+    handelExport() {
+      userExport(this.formData).then((res) => {
+        if (res.msg) {
+          exportFn(res.msg, "导出会员管理数据");
+        } else {
+          this.$message.error("导出失败");
+        }
+      });
     },
   },
   components: {},

+ 109 - 29
src/views/writeOffMag/record.vue

@@ -2,18 +2,18 @@
   <div class="record-ward">
     <div class="record-ward-top fl_b mb20">
       <div v-for="(item, index) in countList" :key="index">
-        <p>67678</p>
+        <p>{{ item.value || 0 }}</p>
         <p>{{ item.lebel }}</p>
       </div>
     </div>
     <container title="核销管理" height="252">
       <template v-slot:btn>
-        <el-button>导出excel</el-button>
+        <el-button @click="handelExport">导出excel</el-button>
       </template>
       <search-box-new
         :formData="formData"
         :formList="formList"
-        @search="search"
+        @search="init"
         @init="init"
       />
       <table-list
@@ -23,15 +23,20 @@
         :navText="navText"
         :loading="loading"
       >
+        <template slot="payType" slot-scope="props">
+          <div>
+            {{ ["微信", "支付宝", "现金"][props.scope.row.payType - 1] }}
+          </div>
+        </template>
         <template slot="btn" slot-scope="props">
           <el-button type="text" @click="handelClick(2, props.scope.row.tpId)"
-            >复制</el-button
+            >详情</el-button
           >
           <el-button type="text" @click="handelClick(1, props.scope.row.tpId)"
-            >修改</el-button
+            >退款</el-button
           >
           <el-button type="text" @click="handelDel(props.scope.row.tpId)"
-            >删除</el-button
+            >记录</el-button
           >
         </template>
       </table-list>
@@ -46,6 +51,12 @@
 </template>
 
 <script>
+import {
+  getOrderList,
+  getOrderDetail,
+  orderExport,
+  orderStatistics,
+} from "@/api/order/index";
 export default {
   name: "SaasMemberRecord",
 
@@ -54,27 +65,33 @@ export default {
       countList: [
         {
           lebel: "订单金额(元)",
-          key: "",
+          key: "orderPriceTotal",
+          value: 0,
         },
         {
           lebel: "已付金额(元)",
-          key: "",
+          key: "payPriceTotal",
+          value: 0,
         },
         {
           lebel: "抵扣金额(元)",
-          key: "",
+          key: "deductionPriceTotal",
+          value: 0,
         },
         {
           lebel: "抵扣积分",
-          key: "",
+          key: "deductionIntegralTotal",
+          value: 0,
         },
         {
           lebel: "退款金额(元)",
-          key: "",
+          key: "refundMoneyTotal",
+          value: 0,
         },
         {
           lebel: "商品金额(元)",
-          key: "",
+          key: "goodsPriceTotal",
+          value: 0,
         },
       ],
       loading: false,
@@ -89,49 +106,78 @@ export default {
       formData: { datePicker: [] },
       tableSet: [
         {
-          label: "模板名称1",
-          prop: "tpName",
+          label: "所属店铺",
+          prop: "storeName",
+          isStore: true,
         },
         {
           label: "核销日期",
-          prop: "tpName",
+          prop: "createTime",
+          scope: "aTimeList",
         },
         {
           label: "核销人",
-          prop: "tpName",
+          prop: "",
         },
         {
           label: "会员手机号",
-          prop: "tpName",
+          prop: "telphone",
         },
         {
           label: "会员名称",
-          prop: "tpName",
+          prop: "userName",
         },
         {
           label: "订单号",
-          prop: "tpName",
+          prop: "orderSn",
+        },
+        {
+          label: "商品金额(元)",
+          prop: "",
+          scope: "money",
         },
         {
           label: "已付金额(元)",
-          prop: "tpName",
+          prop: "payPrice",
+          scope: "money",
         },
         {
           label: "抵扣金额(元)",
-          prop: "tpName",
+          prop: "deductionIntegral",
+          scope: "money",
         },
         {
           label: "抵扣积分",
-          prop: "tpName",
+          prop: "deductionIntegral",
+        },
+        {
+          label: "积分规则",
+          prop: "integralRule",
         },
         {
           label: "退款金额(元)",
-          prop: "tpName",
+          prop: "payType",
+          scope: "money",
+        },
+        {
+          label: "订单金额(元)",
+          prop: "orderPrice",
+          scope: "money",
+        },
+        {
+          label: "付款方式",
+          prop: "payType",
+          scope: "solt",
+          soltName: "payType",
         },
       ],
       tableData: [],
       total: 0,
       formList: [
+        {
+          prop: "storeId",
+          scope: "store",
+        },
         {
           prop1: "classStartTime",
           prop2: "classEndTime",
@@ -140,21 +186,55 @@ export default {
         },
         {
           lable: "姓名",
-          prop: "name",
-          placeholder: "请输产品名称",
+          prop: "telphone",
+          placeholder: "输入会员手机号",
         },
       ],
     };
   },
 
-  mounted() {},
+  mounted() {
+    this.init();
+  },
 
   methods: {
     search(v) {
-      console.log(this.formData, 789);
+      this.loading = true;
+      if (v === 2) {
+        this.formData = {
+          pageSize: 10,
+          pageNum: 1,
+          status: "0,1",
+        };
+      }
+      getOrderList(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    init(v = 2) {
+      this.search(v);
+      this.orderStatistics();
+    },
+    handelExport() {
+      orderExport(this.formData).then((res) => {
+        if (res.msg) {
+          exportFn(res.msg, "导出会员管理数据");
+        } else {
+          this.$message.error("导出失败");
+        }
+      });
     },
-    init() {
-      this.search();
+    orderStatistics() {
+      orderStatistics(this.formData).then((res) => {
+        this.countList.forEach(
+          (e) => (e.value = res.data ? res.data[e.key] : 0)
+        );
+      });
     },
   },
 };