Jelajahi Sumber

Merge branch 'master' of http://git.cc-lotus.info/pointToNetwork/web-admin

zs 2 tahun lalu
induk
melakukan
7616248f02
73 mengubah file dengan 19243 tambahan dan 515 penghapusan
  1. 17376 89
      package-lock.json
  2. 1 0
      package.json
  3. 1 1
      public/index.html
  4. 6 1
      src/App.vue
  5. 15 3
      src/components/orderParts/card-1.vue
  6. 15 3
      src/components/orderParts/card-2.vue
  7. 1 0
      src/components/orderParts/card-3.vue
  8. 1 0
      src/components/orderParts/card-4.vue
  9. 1 0
      src/components/orderParts/detail/detail_order.vue
  10. 1 0
      src/components/orderParts/detail/detail_orderDetail.vue
  11. 1 0
      src/components/orderParts/detail/detail_sales_order.vue
  12. 1 0
      src/components/orderParts/detail/detail_sales_orderDetail.vue
  13. 1 0
      src/components/orderParts/detail/group_order.vue
  14. 4 5
      src/components/orderParts/detail/group_sales.vue
  15. 1 0
      src/components/orderParts/detail/parts/card-1.vue
  16. 1 0
      src/components/orderParts/detail/parts/card-2.vue
  17. 1 0
      src/components/orderParts/detail/parts/card-3.vue
  18. 1 0
      src/components/orderParts/detail/parts/card-4.vue
  19. 15 2
      src/components/orderParts/parts/detail-1.vue
  20. 1 0
      src/components/orderParts/parts/detail-2.vue
  21. 14 2
      src/components/orderParts/parts/detail-3.vue
  22. 3 3
      src/components/orderParts/parts/detail-4.vue
  23. 1 0
      src/components/orderParts/search-1.vue
  24. 1 0
      src/components/orderParts/search-2.vue
  25. 1 0
      src/components/orderParts/search-3.vue
  26. 1 3
      src/components/salesParts/detail.vue
  27. 10 6
      src/components/salesParts/guide_detail.vue
  28. 20 2
      src/components/usual/c-table.vue
  29. 12 0
      src/layout/data/menu.js
  30. 7 5
      src/router/guard.js
  31. 18 12
      src/router/module/platfinance.js
  32. 6 0
      src/router/module/platmanag.js
  33. 9 2
      src/store/index.js
  34. 1 1
      src/store/module/statistics/getBill.js
  35. 48 0
      src/store/module/statistics/shopInBill.js
  36. 44 0
      src/store/module/user/msgList.js
  37. 44 0
      src/store/module/user/notice.js
  38. 49 0
      src/util/computed.js
  39. 7 9
      src/views/dev/role/index.vue
  40. 41 62
      src/views/login.vue
  41. 29 8
      src/views/platActivi/act/index.vue
  42. 16 5
      src/views/platActivi/actTags/index.vue
  43. 7 5
      src/views/platActivi/actTags/parts/search-1.vue
  44. 10 10
      src/views/platActivi/coupon/detail.vue
  45. 17 5
      src/views/platActivi/coupon/index.vue
  46. 2 3
      src/views/platActivi/coupon/parts/search-1.vue
  47. 16 2
      src/views/platGroup/goods/detail.vue
  48. 20 1
      src/views/platGroup/goods/index.vue
  49. 28 5
      src/views/platGroup/group/index.vue
  50. 13 3
      src/views/platGroup/order/index.vue
  51. 1 0
      src/views/platGroup/sales/index.vue
  52. 5 0
      src/views/platSettings/config/index.vue
  53. 164 0
      src/views/platfinance/shopCash/index.vue
  54. 11 12
      src/views/selfShop/bill/parts/search-1.vue
  55. 16 2
      src/views/platfinance/withdrawal/index.vue
  56. 5 0
      src/views/platfinance/withdrawal/parts/search-1.vue
  57. 30 6
      src/views/platmanag/goods/index.vue
  58. 5 0
      src/views/platmanag/goods/parts/search-1.vue
  59. 4 24
      src/views/platmanag/goods/spec.vue
  60. 147 0
      src/views/platmanag/notice/detail.vue
  61. 139 0
      src/views/platmanag/notice/index.vue
  62. 184 0
      src/views/platmanag/notice/notice.vue
  63. 17 19
      src/views/platmanag/order/index.vue
  64. 32 19
      src/views/platmanag/storeAcc/detail.vue
  65. 47 20
      src/views/platmanag/storeAcc/index.vue
  66. 133 0
      src/views/platmanag/storeAcc/shopInBill.vue
  67. 108 0
      src/views/selfShop/bill/detail.vue
  68. 93 121
      src/views/selfShop/bill/index.vue
  69. 105 0
      src/views/selfShop/bill/record.vue
  70. 43 9
      src/views/selfShop/goods/index.vue
  71. 4 25
      src/views/selfShop/goods/spec.vue
  72. 5 0
      src/views/selfShop/info/index.vue
  73. 5 0
      vue.config.js

File diff ditekan karena terlalu besar
+ 17376 - 89
package-lock.json


+ 1 - 0
package.json

@@ -14,6 +14,7 @@
     "@wangeditor/editor-for-vue": "^1.0.2",
     "axios": "^0.27.2",
     "core-js": "^3.6.5",
+    "decimal.js": "^10.4.3",
     "echarts": "^5.4.0",
     "element-ui": "^2.15.10",
     "exceljs": "^4.3.0",

+ 1 - 1
public/index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=0.1">
     <link rel="icon" href="https://broadcast.waityou24.cn/files/point/indexModule/20221010124133.png">
     <title>天恩活泉</title>
   </head>

+ 6 - 1
src/App.vue

@@ -4,4 +4,9 @@
   </div>
 </template>
 
-<style lang="less"></style>
+<style lang="less">
+.w_1200 {
+  max-width: 1200px;
+  margin: 0 auto;
+}
+</style>

+ 15 - 3
src/components/orderParts/card-1.vue

@@ -1,11 +1,13 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 平台订单待付款列表 -->
       <el-col :span="24" class="main">
         <el-col :span="24" class="one">
-          <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+          <search-1 :form="searchForm" @onSubmit="toSearch" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
         </el-col>
-        <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales"> </data-table>
+        <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales">
+        </data-table>
       </el-col>
     </el-row>
   </div>
@@ -39,6 +41,8 @@ export default {
         { label: '商品数量', model: 'buy_num_total' },
       ],
       shopList: [],
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -47,6 +51,11 @@ export default {
   methods: {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -56,10 +65,13 @@ export default {
         delete condition.buy_time;
       }
       info.status = '0';
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
     },
     getAddress(i) {

+ 15 - 3
src/components/orderParts/card-2.vue

@@ -1,11 +1,13 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 自营订单待付款列表 -->
       <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
         <el-col :span="24" class="one">
-          <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+          <search-1 :form="searchForm" @onSubmit="toSearch" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
         </el-col>
-        <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales"> </data-table>
+        <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetail" @sales="toSales">
+        </data-table>
       </el-col>
     </el-row>
   </div>
@@ -41,6 +43,8 @@ export default {
       shopList: [],
       skip: 0,
       loadings: true,
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -49,6 +53,11 @@ export default {
   methods: {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -59,10 +68,13 @@ export default {
       }
       info.status = '0';
       info.shop = this.user.shop.id;
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },

+ 1 - 0
src/components/orderParts/card-3.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 平台订单待发货列表 -->
       <el-col :span="24" class="main">
         <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></detail-1>
         <detail-2 v-else-if="num == '2'" :deliverList="list" @toBack="toBack"></detail-2>

+ 1 - 0
src/components/orderParts/card-4.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 团购订单待发货 -->
       <el-col :span="24" class="main">
         <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></detail-1>
         <detail-2 v-else-if="num == '2'" :deliverList="list" @toBack="toBack"></detail-2>

+ 1 - 0
src/components/orderParts/detail/detail_order.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="form-1">
     <el-row>
+      <!-- 待付款订单详情 -->
       <el-col
         :span="24"
         class="main animate__animated animate__backInRight"

+ 1 - 0
src/components/orderParts/detail/detail_orderDetail.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="form-1">
+    <!-- 订单详情 -->
     <el-row>
       <el-col :span="24" class="top-btn">
         <el-button type="primary" size="mini" @click="toBack()">返回</el-button>

+ 1 - 0
src/components/orderParts/detail/detail_sales_order.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="form-1">
     <el-row>
+      <!-- 待付款申请售后 -->
       <el-col
         :span="24"
         class="main animate__animated animate__backInRight"

+ 1 - 0
src/components/orderParts/detail/detail_sales_orderDetail.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="form-1">
     <el-row>
+      <!-- 申请售后 -->
       <el-col
         :span="24"
         class="main animate__animated animate__backInRight"

+ 1 - 0
src/components/orderParts/detail/group_order.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="form-1">
+    <!-- 团购订单详情 -->
     <el-row>
       <el-col :span="24" class="top-btn">
         <el-button type="primary" size="mini" @click="toBack()">返回</el-button>

+ 4 - 5
src/components/orderParts/detail/group_sales.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="form-1">
+    <!-- 团购订单申请售后 -->
     <el-row>
       <el-col
         :span="24"
@@ -236,11 +237,8 @@ export default {
       if (this.$checkRes(res)) this.$set(this, 'shop_transport_typeList', res.data);
     },
     toUrl(url) {
-      if (url) {
-        window.open(url, '_blank');
-      } else {
-        this.$message.error('该商品还未添加来源网址,无法跳转');
-      }
+      if (url) window.open(url, '_blank');
+      else this.$message.error('该商品还未添加来源网址,无法跳转');
     },
     // 选择商品
     getFile(value) {
@@ -300,6 +298,7 @@ export default {
           }).then(async () => {
             let form = this.form;
             form.order = this.id;
+            form.shop = this.shop._id;
             let res = await this.create(form);
             if (this.$checkRes(res)) {
               this.$message({ type: `success`, message: `申请售后成功` });

+ 1 - 0
src/components/orderParts/detail/parts/card-1.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 自营店铺订单详情--商品详情 -->
       <el-col :span="24" class="main">
         <el-col :span="12" class="main_one">
           <el-col :span="24" class="add">

+ 1 - 0
src/components/orderParts/detail/parts/card-2.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-2">
     <el-row>
+      <!-- 自营店铺订单详情--物流信息 -->
       <el-col :span="24" class="main">
         <el-col :span="9" class="one">
           <!-- 快递列表 -->

+ 1 - 0
src/components/orderParts/detail/parts/card-3.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 团购订单详情--商品详情 -->
       <el-col :span="24" class="main">
         <el-col :span="12" class="main_one">
           <el-col :span="24" class="add">

+ 1 - 0
src/components/orderParts/detail/parts/card-4.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-2">
     <el-row>
+      <!-- 团购订单详情--物流信息 -->
       <el-col :span="24" class="main">
         <el-col :span="9" class="one">
           <!-- 快递列表 -->

+ 15 - 2
src/components/orderParts/parts/detail-1.vue

@@ -1,16 +1,18 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 自营店铺订单待发货列表 -->
       <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
         <el-col :span="24" v-if="num == '1'">
           <el-col :span="24" class="one">
-            <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+            <search-1 :form="searchForm" @onSubmit="toSearch" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
           </el-col>
           <el-col :span="24" class="one">
             <el-button type="primary" size="mini" @click="toDeliver()">生成发货清单</el-button>
             <p>(发货清单里不显示售后的订单)</p>
           </el-col>
           <data-table
+            ref="dataTable"
             :select="true"
             :selected="selected"
             @handleSelect="handleSelect"
@@ -69,6 +71,8 @@ export default {
       // 发货清单
       deliverList: [],
       deliver: '0',
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -77,6 +81,11 @@ export default {
   methods: {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -86,10 +95,14 @@ export default {
         delete condition.buy_time;
       }
       info.status = '1';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
+      info.shop = this.user.shop.id;
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },

+ 1 - 0
src/components/orderParts/parts/detail-2.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="form-1">
     <el-row>
+      <!-- 自营店铺订单待发货--发货清单 -->
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col class="top_btn"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
         <el-col :span="24" class="one"> <span>发货清单</span> </el-col>

+ 14 - 2
src/components/orderParts/parts/detail-3.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="card-1">
     <el-row>
+      <!-- 团购订单待发货列表 -->
       <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
         <el-col :span="24" v-if="num == '1'">
           <el-col :span="24" class="one">
@@ -8,7 +9,7 @@
               :form="searchForm"
               :shopList="shopList"
               :goodsList="goodsList"
-              @onSubmit="search"
+              @onSubmit="toSearch"
               @querySearch="querySearch"
               @toReset="toClose"
               @goodsSearch="goodsSearch"
@@ -20,6 +21,7 @@
             <p>(发货清单里不显示售后的订单)</p>
           </el-col>
           <data-table
+            ref="dataTable"
             :select="true"
             :selected="selected"
             @handleSelect="handleSelect"
@@ -83,6 +85,8 @@ export default {
       // 发货清单
       deliverList: [],
       deliver: '0',
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -92,6 +96,11 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...goods({ goodsQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -101,10 +110,13 @@ export default {
         delete condition.buy_time;
       }
       info.status = '1';
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },

+ 3 - 3
src/components/orderParts/parts/detail-4.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="form-1">
     <el-row>
+      <!-- 团购订单待发货--发货清单 -->
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col class="top_btn"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
         <el-col :span="24" class="one"> <span>发货清单</span> </el-col>
@@ -84,9 +85,8 @@ export default {
     // 选中要导出的商品
     handleSelect(goodsList, address) {
       let fileList = this.fileList;
-      if (fileList.length == 0) {
-        fileList.push({ goodsList, address });
-      } else {
+      if (fileList.length == 0) fileList.push({ goodsList, address });
+      else {
         if (goodsList.length > 0) {
           for (const val of fileList) {
             if (address._id == val.address._id) val.goodsList = goodsList;

+ 1 - 0
src/components/orderParts/search-1.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="search-1">
+    <!-- 平台订单查询 -->
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">

+ 1 - 0
src/components/orderParts/search-2.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="search-1">
+    <!-- 自营店铺订单查询 -->
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">

+ 1 - 0
src/components/orderParts/search-3.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="search-1">
+    <!-- 团购订单查询 -->
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">

+ 1 - 3
src/components/salesParts/detail.vue

@@ -17,9 +17,7 @@
             <el-col :span="20"> {{ customers.name }},{{ customers.phone }} </el-col>
           </el-col>
           <el-col :span="24" class="add">
-            <el-col :span="2">
-              <i class="el-icon-location"></i>
-            </el-col>
+            <el-col :span="2"><i class="el-icon-location"></i></el-col>
             <el-col :span="22">
               <el-col :span="24"> {{ address.name }},{{ address.phone }} </el-col>
               <el-col :span="24"> {{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }} </el-col>

+ 10 - 6
src/components/salesParts/guide_detail.vue

@@ -17,9 +17,7 @@
             <el-col :span="20"> {{ customers.name }},{{ customers.phone }} </el-col>
           </el-col>
           <el-col :span="24" class="add">
-            <el-col :span="2">
-              <i class="el-icon-location"></i>
-            </el-col>
+            <el-col :span="2"><i class="el-icon-location"></i></el-col>
             <el-col :span="22">
               <el-col :span="24"> {{ address.name }},{{ address.phone }} </el-col>
               <el-col :span="24"> {{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }} </el-col>
@@ -45,7 +43,11 @@
           </el-col>
           <el-col :span="24">
             <el-col :span="6">实付金额</el-col>
-            <el-col :span="18" class="other" style="color: red; font-size: 20px">{{ info.pay }}</el-col>
+            <el-col :span="18" class="other" style="color: red">{{ info.pay }}元</el-col>
+          </el-col>
+          <el-col :span="24" v-if="info.leader_suggest">
+            <el-col :span="6">团长意见</el-col>
+            <el-col :span="18" class="other">{{ info.leader_suggest == true ? '同意' : '不同意' }}</el-col>
           </el-col>
           <el-col :span="24">
             <el-col :span="6">申请时间</el-col>
@@ -61,7 +63,7 @@
           </el-col>
           <el-col :span="24" v-if="info.type == '1' || info.type == '2' || info.type == '4' || info.type == '5'">
             <el-col :span="6">退款金额</el-col>
-            <el-col :span="18" class="other" style="color: red">{{ info.money || '' }}</el-col>
+            <el-col :span="18" class="other" style="color: red; font-size: 20px">{{ info.money || '' }}</el-col>
           </el-col>
           <el-col :span="24">
             <el-col :span="6">售后状态</el-col>
@@ -302,6 +304,7 @@ export default {
         }
       });
     },
+    // 换货、退货
     async exam_one(status) {
       this.$confirm('是否确认不填写单号修改售后状态', '提示', {
         confirmButtonText: '确定',
@@ -362,9 +365,10 @@ export default {
     // 查询其他信息
     async searchOther() {
       let res;
-      // 类型
+      // 售后类型
       res = await this.dictQuery({ code: 'afterSale_type' });
       if (this.$checkRes(res)) this.$set(this, `typeList`, res.data);
+      // 售后状态
       res = await this.dictQuery({ code: 'afterSale_status' });
       if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
     },

+ 20 - 2
src/components/usual/c-table.vue

@@ -78,9 +78,10 @@
     <el-row type="flex" align="middle" justify="end" style="padding-top: 1rem" v-if="usePage">
       <el-col :span="24" style="text-align: right">
         <el-pagination
+          v-if="showPageView"
           background
           layout="sizes,total, prev, pager, next"
-          :page-sizes="[1, 10, 50, 100, 150, 200]"
+          :page-sizes="[10, 50, 100, 150, 200]"
           :total="total"
           :page-size="limit"
           :current-page.sync="currentPage"
@@ -117,8 +118,9 @@ export default {
   data: function () {
     return {
       pageSelected: [],
-      currentPage: 1,
+      currentPage: 0,
       limit: this.$limit,
+      showPageView: true,
     };
   },
   created() {},
@@ -281,6 +283,22 @@ export default {
     minComputed(data) {
       return _.min(data);
     },
+
+    resetPage() {
+      this.currentPage = 1;
+      this.skip = 0;
+    },
+    getPageConfig() {
+      return { skip: (this.currentPage - 1) * this.limit, limit: this.limit, currentPage: this.currentPage };
+    },
+    setPage({ skip, limit }) {
+      let currentPage = skip / limit + 1;
+      this.$set(this, 'currentPage', currentPage);
+      this.showPageView = false;
+      setTimeout(() => {
+        this.showPageView = true;
+      }, 1000);
+    },
   },
 };
 </script>

+ 12 - 0
src/layout/data/menu.js

@@ -49,6 +49,12 @@ export const adminMenu = [
         name: '售后管理',
         index: '2-6',
       },
+      {
+        icon: 'icon-rencai',
+        path: '/platmanag/notice',
+        name: '系统消息管理',
+        index: '2-7',
+      },
     ],
   },
   {
@@ -102,6 +108,12 @@ export const adminMenu = [
         name: '提现审核',
         index: '4-3',
       },
+      {
+        icon: 'icon-rencai',
+        path: '/platfinance/shopCash',
+        name: '店铺提现审核',
+        index: '4-3',
+      },
     ],
   },
   {

+ 7 - 5
src/router/guard.js

@@ -37,11 +37,13 @@ export default (router) => {
     if (can_in) next();
     else {
       const keys = Object.keys(menu).filter((f) => f !== 'mode');
-      let toPath = '';
-      if (keys.includes('/')) toPath = '/';
-      else toPath = _.head(keys);
-      next(toPath);
-      Message.error('您无权限访问该页面');
+      const r = keys.find((f) => to.path.includes(f));
+      if (r) {
+        next();
+      } else {
+        next(from.path);
+        Message.error('您无权限访问该页面');
+      }
     }
   });
 };

+ 18 - 12
src/router/module/platfinance.js

@@ -1,20 +1,26 @@
 export default [
   {
-    path: "/platfinance/statistics",
-    name: "platfinance_statistics",
-    meta: { title: "平台管理-统计" },
-    component: () => import("@/views/platfinance/statistics/index.vue"),
+    path: '/platfinance/statistics',
+    name: 'platfinance_statistics',
+    meta: { title: '平台管理-统计' },
+    component: () => import('@/views/platfinance/statistics/index.vue'),
   },
   {
-    path: "/platfinance/bill",
-    name: "platfinance_bill",
-    meta: { title: "平台管理-账单管理" },
-    component: () => import("@/views/platfinance/bill/index.vue"),
+    path: '/platfinance/bill',
+    name: 'platfinance_bill',
+    meta: { title: '平台管理-账单管理' },
+    component: () => import('@/views/platfinance/bill/index.vue'),
   },
   {
-    path: "/platfinance/withdrawal",
-    name: "platfinance_withdrawal",
-    meta: { title: "平台管理-提现审核" },
-    component: () => import("@/views/platfinance/withdrawal/index.vue"),
+    path: '/platfinance/withdrawal',
+    name: 'platfinance_withdrawal',
+    meta: { title: '平台管理-提现审核' },
+    component: () => import('@/views/platfinance/withdrawal/index.vue'),
+  },
+  {
+    path: '/platfinance/shopCash',
+    name: 'platfinance_shopCash',
+    meta: { title: '平台管理-店铺提现审核' },
+    component: () => import('@/views/platfinance/shopCash/index.vue'),
   },
 ];

+ 6 - 0
src/router/module/platmanag.js

@@ -53,4 +53,10 @@ export default [
     meta: { title: '平台管理-售后管理' },
     component: () => import('@/views/platmanag/sales/index.vue'),
   },
+  {
+    path: '/platmanag/notice',
+    name: 'platmanag_notice',
+    meta: { title: '平台管理-系统消息管理' },
+    component: () => import('@/views/platmanag/notice/index.vue'),
+  },
 ];

+ 9 - 2
src/store/index.js

@@ -5,11 +5,15 @@ import * as umutations from './module/user/mutations';
 import admin from './module/user/action';
 // 用户
 import users from './module/user/users';
+// 系统消息
+import notice from './module/user/notice';
+import msgList from './module/user/msgList';
 
 import todo from './module/statistics/todo';
 import sellTotal from './module/statistics/sellTotal';
-import getBill from './module/statistics/getBill';
+import shopInBill from './module/statistics/shopInBill';
 import outBill from './module/statistics/outBill';
+import shopCashOut from './module/statistics/shopCashOut';
 
 import dictIndex from './module/dev/dictIndex';
 import dictData from './module/dev/dictData';
@@ -97,7 +101,7 @@ export default new Vuex.Store({
     platformAct,
     goodsJoinAct,
     goodsRate,
-    getBill,
+    shopInBill,
     outBill,
     admins,
     cashOut,
@@ -110,5 +114,8 @@ export default new Vuex.Store({
     group,
     groupTransport,
     salesTransport,
+    notice,
+    msgList,
+    shopCashOut,
   },
 });

+ 1 - 1
src/store/module/statistics/getBill.js

@@ -3,7 +3,7 @@ import Vuex from 'vuex';
 const _ = require('lodash');
 Vue.use(Vuex);
 const api = {
-  url: '/point/v1/api/statistics/bill/getBill',
+  url: '/point/v1/api/shopCashOut',
 };
 
 const state = () => ({});

+ 48 - 0
src/store/module/statistics/shopInBill.js

@@ -0,0 +1,48 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+const _ = require('lodash');
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/shopInBill',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async bill({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}/total/${payload}`);
+    return res;
+  },
+  async update({ commit }, payload) {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 44 - 0
src/store/module/user/msgList.js

@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+const _ = require('lodash');
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/notice/msgList',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async update({ commit }, payload) {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 44 - 0
src/store/module/user/notice.js

@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+const _ = require('lodash');
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/notice',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async update({ commit }, payload) {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 49 - 0
src/util/computed.js

@@ -0,0 +1,49 @@
+'use strict';
+const Decimal = require('decimal.js');
+const _ = require('lodash');
+// Decimal.set({ precision: 2 });
+module.exports = {
+  turnDecimal(n) {
+    if (_.isObject(n)) {
+      n = JSON.parse(JSON.stringify(n));
+      if (_.isObject(n)) n = _.get(n, '$numberDecimal');
+    }
+    return new Decimal(n);
+  },
+  // 加法
+  plus(n1 = 0, n2 = 0) {
+    const number1 = this.turnDecimal(n1);
+    const number2 = this.turnDecimal(n2);
+    const result = number1.add(number2).toFixed(2, Decimal.ROUND_DOWN);
+    return this.toNumber(result);
+  },
+  // 减法
+  minus(n1 = 0, n2 = 0) {
+    const number1 = this.turnDecimal(n1);
+    const number2 = this.turnDecimal(n2);
+    const result = number1.minus(number2).toFixed(2, Decimal.ROUND_DOWN);
+    return this.toNumber(result);
+  },
+  // 乘法
+  multiply(n1 = 0, n2 = 0) {
+    const number1 = this.turnDecimal(n1);
+    const number2 = this.turnDecimal(n2);
+    const result = number1.mul(number2).toFixed(2, Decimal.ROUND_DOWN);
+    return this.toNumber(result);
+  },
+  // 除法
+  divide(n1 = 0, n2 = 0) {
+    const number1 = this.turnDecimal(n1);
+    const number2 = this.turnDecimal(n2);
+    const result = number1.div(number2).toFixed(2, Decimal.ROUND_DOWN);
+    return this.toNumber(result);
+  },
+
+  toNumber(num) {
+    if (_.isObject(num)) {
+      num = JSON.parse(JSON.stringify(num));
+      if (_.isObject(num)) num = _.get(num, '$numberDecimal');
+    }
+    return new Decimal(num).toNumber();
+  },
+};

+ 7 - 9
src/views/dev/role/index.vue

@@ -6,7 +6,7 @@
           <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1>
         </el-col>
         <el-col :span="24" class="two">
-          <btn-1 table="role" @toAdd="toAdd" :ids="selected" @search="search"></btn-1>
+          <data-btn :fields="btnList" @add="toAdd"></data-btn>
         </el-col>
         <el-col :span="24" class="thr">
           <data-table
@@ -35,19 +35,21 @@
 </template>
 
 <script>
-import btn1 from '@/layout/btn-1.vue';
 import search1 from './parts/search-1.vue';
 import form1 from './parts/form-1.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('role');
 const { mapActions: menu } = createNamespacedHelpers('menus');
-// const { mapActions: sysdictdata } = createNamespacedHelpers('dictData');
 export default {
   name: 'index',
   props: {},
-  components: { search1, form1, btn1 },
+  components: {
+    search1,
+    form1,
+  },
   data: function () {
     return {
+      btnList: [{ label: '添加', method: 'add' }],
       // 列表
       opera: [
         { label: '修改', method: 'edit' },
@@ -84,7 +86,6 @@ export default {
   },
   methods: {
     ...menu({ menuQuery: 'query' }),
-    // ...sysdictdata({ sQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
@@ -145,10 +146,7 @@ export default {
     // 查询其他信息
     async searchOther() {
       let res = await this.menuQuery({ status: '0' });
-      if (this.$checkRes(res)) {
-        let data = res.data;
-        this.$set(this, `menuList`, res.data);
-      }
+      if (this.$checkRes(res)) this.$set(this, `menuList`, res.data);
     },
   },
   computed: {

+ 41 - 62
src/views/login.vue

@@ -4,37 +4,28 @@
       <el-col :span="24" class="main">
         <div class="w_1200">
           <el-col :span="24" class="one">
-            <el-col :span="24" class="one_1">
-              <el-col :span="24" class="txt"><h3>商城管理登陆</h3></el-col>
-              <el-col :span="24" class="form">
-                <el-form :model="form" :rules="rules" ref="form">
-                  <el-form-item label="" prop="account">
-                    <el-input placeholder="账号" v-model="form.account" @keyup.enter.native="onSubmit('form')">
-                      <i slot="prefix" class="el-input__icon el-icon-user-solid"></i>
-                    </el-input>
-                  </el-form-item>
-                  <el-form-item label="" prop="password">
-                    <el-input placeholder="密码" v-model="form.password" type="password" auto-complete="off" @keyup.enter.native="onSubmit('form')">
-                      <i slot="prefix" class="el-input__icon el-icon-lock"></i>
-                    </el-input>
-                  </el-form-item>
-                  <!-- <el-form-item label="" prop="code">
-                    <el-input placeholder="验证码" v-model="form.code" style="width: 75%" @keyup.enter.native="onSubmit('form')" disabled>
-                      <i slot="prefix" class="el-input__icon el-icon-folder-checked"></i>
-                    </el-input>
-                    <el-image :src="img" class="yzm"></el-image>
-                  </el-form-item> -->
-                  <el-form-item class="btn">
-                    <el-button type="primary" @click="onSubmit('form')">登录</el-button>
-                  </el-form-item>
-                  <el-col :span="24" style="text-align: center">
-                    <el-button type="text" style="color: blue; font-size: 14px" @click="toReset()">忘记密码?</el-button>
-                  </el-col>
-                </el-form>
-              </el-col>
+            <el-col :span="24" class="txt">商城管理登陆</el-col>
+            <el-col :span="24" class="form">
+              <el-form :model="form" :rules="rules" ref="form">
+                <el-form-item label="" prop="account">
+                  <el-input placeholder="账号" v-model="form.account" @keyup.enter.native="onSubmit('form')">
+                    <i slot="prefix" class="el-input__icon el-icon-user-solid"></i>
+                  </el-input>
+                </el-form-item>
+                <el-form-item label="" prop="password">
+                  <el-input placeholder="密码" v-model="form.password" type="password" auto-complete="off" @keyup.enter.native="onSubmit('form')">
+                    <i slot="prefix" class="el-input__icon el-icon-lock"></i>
+                  </el-input>
+                </el-form-item>
+                <el-form-item class="btn">
+                  <el-button type="primary" @click="onSubmit('form')">登录</el-button>
+                </el-form-item>
+              </el-form>
+            </el-col>
+            <el-col :span="24" class="other">
+              <el-button type="text" style="color: blue; font-size: 14px" @click="toReset()">忘记密码?</el-button>
             </el-col>
           </el-col>
-          <el-col :span="24" class="two"> </el-col>
         </div>
       </el-col>
     </el-row>
@@ -42,11 +33,10 @@
 </template>
 
 <script>
-const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: maU } = createNamespacedHelpers('admin');
 const { mapActions: admins } = createNamespacedHelpers('admins');
-
+const _ = require('lodash');
 export default {
   name: 'login',
   props: {},
@@ -57,10 +47,7 @@ export default {
       rules: {
         account: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
         password: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
-        code: [{ required: false, message: '验证码不能为空', trigger: 'blur' }],
       },
-      // 验证码
-      img: require('@a/yzm.gif'),
     };
   },
   created() {},
@@ -121,43 +108,35 @@ export default {
 
 <style lang="less" scoped>
 .main {
-  background: url('~@/assets/login-background.jpg');
+  display: flex;
+  flex-direction: column;
+  width: 100%;
   height: 100vh;
   overflow: hidden;
+  background: url('~@/assets/login-background.jpg');
+  background-repeat: no-repeat;
+  background-size: 100%;
   .one {
-    .one_1 {
-      width: 400px;
-      padding: 25px 25px 5px 25px;
-      border-radius: 6px;
-      background: #fff;
-      margin: 35vh 75vh;
-      .txt {
-        text-align: center;
-        color: #707070;
-        margin: 0 0 15px 0;
-      }
-      .yzm {
-        float: right;
-        width: 80px;
-        height: 37px;
-      }
+    background-color: #ffffff;
+    border-radius: 5px;
+    padding: 10px 20px;
+    margin: 70% 0 0 0;
+    .txt {
+      text-align: center;
+      font-size: 20px;
+      font-weight: bold;
+      margin: 15px 0;
+    }
+    .form {
       .btn {
+        text-align: center;
         .el-button {
           width: 100%;
         }
       }
     }
-  }
-  .two {
-    text-align: center;
-    p {
-      position: absolute;
-      bottom: 15px;
-      width: 1200px;
-      color: #fff;
-      font-family: Arial;
-      font-size: 12px;
-      letter-spacing: 1px;
+    .other {
+      text-align: center;
     }
   }
 }

+ 29 - 8
src/views/platActivi/act/index.vue

@@ -11,13 +11,23 @@
         <span v-show="view === 'list'">
           <el-col :span="24" class="one"> <span>活动标题</span> </el-col>
           <el-col :span="24" class="two">
-            <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1>
+            <search-1 :form="searchForm" @onSubmit="toSearch" @toReset="toClose"></search-1>
           </el-col>
           <el-col :span="24" class="thr">
             <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
           </el-col>
           <el-col :span="24" class="four">
-            <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel" @manage="toManage">
+            <data-table
+              ref="dataTable"
+              :fields="fields"
+              :opera="opera"
+              @query="search"
+              :data="list"
+              :total="total"
+              @edit="toEdit"
+              @del="toDel"
+              @manage="toManage"
+            >
             </data-table>
           </el-col>
         </span>
@@ -91,22 +101,32 @@ export default {
       id: '',
       // type: '',
       act_typeList: [],
+      // 查询条件
+      searchQuery: {},
     };
   },
-  async created() {
-    await this.searchOther();
-    await this.search();
+  created() {
+    this.searchOther();
+    this.search();
   },
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
       const condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...others };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
@@ -123,6 +143,7 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     // 商品管理
     async toManage({ data }) {
@@ -133,7 +154,7 @@ export default {
       let res = await this.delete(data._id);
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `刪除信息成功` });
-        this.search();
+        this.search(this.searchQuery);
       }
     },
     // 重置

+ 16 - 5
src/views/platActivi/actTags/index.vue

@@ -11,13 +11,13 @@
         <span v-show="view === 'list'">
           <el-col :span="24" class="one"> <span>活动标签</span> </el-col>
           <el-col :span="24" class="two">
-            <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1>
+            <search-1 :form="searchForm" @onSubmit="toSearch" @toReset="toClose" :statusList="statusList"></search-1>
           </el-col>
           <el-col :span="24" class="thr">
             <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
           </el-col>
           <el-col :span="24" class="four">
-            <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
+            <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
           </el-col>
         </span>
         <detail v-if="view === 'info'" :id="id" @toBack="toBack"></detail>
@@ -88,6 +88,8 @@ export default {
       // 是否使用
       statusList: [],
       id: '',
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -97,13 +99,21 @@ export default {
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
       const condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...others };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
@@ -120,13 +130,14 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     // 删除
     async toDel({ data }) {
       let res = await this.delete(data._id);
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `刪除信息成功` });
-        this.search();
+        this.search(this.searchQuery);
       }
     },
     // 重置

+ 7 - 5
src/views/platActivi/actTags/parts/search-1.vue

@@ -4,13 +4,15 @@
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">
           <el-col :span="6">
-            <el-form-item label="活动标签" prop="label">
-              <el-input v-model="form.label" placeholder="请输入活动标签" size="small"></el-input>
+            <el-form-item label="编码" prop="value">
+              <el-input v-model="form.value" placeholder="请输入编码" size="small"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="编码" prop="value">
-              <el-input v-model="form.value" placeholder="请输入编码" size="small"></el-input>
+            <el-form-item label="是否使用" prop="status">
+              <el-select v-model="form.status" clearable filterable placeholder="请选择" style="width: 100%" size="small">
+                <el-option v-for="i in statusList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="24" class="btn">
@@ -27,7 +29,7 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'search-1',
-  props: { form: { type: Object } },
+  props: { form: { type: Object }, statusList: { type: Array } },
   components: {},
   data: function () {
     return {};

+ 10 - 10
src/views/platActivi/coupon/detail.vue

@@ -20,7 +20,7 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="24">
+            <!-- <el-col :span="24">
               <el-form-item label="店铺" prop="shop" style="display: none">
                 <el-select
                   v-model="form.shop"
@@ -35,7 +35,7 @@
                   <el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :span="24">
               <el-form-item label="优惠券名称" prop="name">
                 <el-input v-model="form.name" placeholder="请输入优惠券名称" size="small"></el-input>
@@ -220,14 +220,14 @@ export default {
           data.tags = _.get(data, 'use_limit_config.tags');
           data.time = _.get(data, 'expire_config.fixed');
           data.days = _.get(data, 'expire_config.days');
-          if (data.shop) {
-            let list = [];
-            let res = await this.shopFetch(data.shop);
-            if (this.$checkRes(res)) {
-              list.push(res.data);
-              this.$set(this, 'shopList', list);
-            }
-          }
+          // if (data.shop) {
+          //   let list = [];
+          //   let res = await this.shopFetch(data.shop);
+          //   if (this.$checkRes(res)) {
+          //     list.push(res.data);
+          //     this.$set(this, 'shopList', list);
+          //   }
+          // }
           this.$set(this, `form`, data);
         }
       } else this.$set(this, `form`, { status: '0' });

+ 17 - 5
src/views/platActivi/coupon/index.vue

@@ -14,7 +14,7 @@
             <search-1
               :form="searchForm"
               :statusList="statusList"
-              @onSubmit="search"
+              @onSubmit="toSearch"
               @toReset="toClose"
               @querySearch="querySearch"
               :shopList="shopList"
@@ -26,6 +26,7 @@
           </el-col>
           <el-col :span="24" class="four">
             <data-table
+              ref="dataTable"
               :select="true"
               :selected="selected"
               @handleSelect="handleSelect"
@@ -119,6 +120,8 @@ export default {
       // 减免方式
       discount_typeList: [],
       id: '',
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -129,13 +132,21 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info });
+    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
+      const condition = _.cloneDeep(this.searchForm);
+      let query = { skip, limit, ...others };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
@@ -147,6 +158,7 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     toGrant({ data }) {
       this.$set(this, `id`, data.id);
@@ -162,7 +174,7 @@ export default {
       let res = await this.delete(data._id);
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `刪除信息成功` });
-        this.search();
+        this.search(this.searchQuery);
       }
     },
     toClose() {

+ 2 - 3
src/views/platActivi/coupon/parts/search-1.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">
-          <el-col :span="6">
+          <!-- <el-col :span="6">
             <el-form-item label="店铺名称" prop="type">
               <el-select
                 v-model="form.shop"
@@ -18,7 +18,7 @@
                 <el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="6">
             <el-form-item label="优惠券名称" prop="name">
               <el-input v-model="form.name" placeholder="请输入优惠券名称" size="small"></el-input>
@@ -31,7 +31,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-
           <el-col :span="6">
             <el-form-item label="是否使用" prop="status">
               <el-select v-model="form.status" clearable filterable placeholder="请选择" style="width: 100%" size="small">

+ 16 - 2
src/views/platGroup/goods/detail.vue

@@ -6,7 +6,7 @@
           <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
         </el-col>
         <el-col :span="24">
-          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
+          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave" @dataChange="dataChange">
             <template #goods>
               <el-select
                 v-model="form.goods"
@@ -24,7 +24,7 @@
               <p style="color: red">输入商品名称查询</p>
             </template>
             <template #spec>
-              <el-option v-for="i in specList" :key="i._id" :label="i.name" :value="i._id"></el-option>
+              <el-option v-for="item in specList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
             </template>
           </data-form>
         </el-col>
@@ -35,6 +35,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+import * as util from '@/util/computed';
 const { mapActions: goodsConfig } = createNamespacedHelpers('goodsConfig');
 const { mapActions: goods } = createNamespacedHelpers('goods');
 const { mapActions: goodsSpec } = createNamespacedHelpers('goodsSpec');
@@ -83,8 +84,10 @@ export default {
       if (this.id) {
         const res = await this.fetch(this.id);
         if (this.$checkRes(res)) {
+          // 商品
           let arr = await this.goodsFetch(res.data.goods);
           if (this.$checkRes(arr)) this.goodsList.push(arr.data);
+          // 规格
           let aee = await this.specFetch(res.data.spec);
           if (this.$checkRes(aee)) this.specList.push(aee.data);
           this.$set(this, `form`, res.data);
@@ -107,6 +110,17 @@ export default {
       let res = await this.specQuery({ goods: value });
       if (this.$checkRes(res)) this.$set(this, 'specList', res.data);
     },
+    dataChange({ model, value }) {
+      if (model == 'spec') {
+        let info = this.specList.find((f) => f._id == value);
+        if (info) this.$set(this.form, 'freight', info.freight);
+        if (info && info.leader_price) this.$set(this.form, 'leader_price', info.leader_price);
+      }
+      if (this.form.leader_price && this.form.price) {
+        let price = util.minus(this.form.price, this.form.leader_price);
+        this.$set(this.form, 'leader_get', price);
+      }
+    },
     // 保存
     async toSave({ data }) {
       let res;

+ 20 - 1
src/views/platGroup/goods/index.vue

@@ -9,6 +9,7 @@
         element-loading-spinner="el-icon-loading"
       >
         <span v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>团购商品管理</span> </el-col>
           <data-search :fields="searchFields" v-model="searchInfo" @query="search">
             <template #goods>
               <el-select
@@ -165,4 +166,22 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+  .thr {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 28 - 5
src/views/platGroup/group/index.vue

@@ -9,8 +9,9 @@
         element-loading-spinner="el-icon-loading"
       >
         <span v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>团购管理</span> </el-col>
           <data-search :fields="searchFields" v-model="searchInfo" @query="search">
-            <template #goods>
+            <!-- <template #goods>
               <el-select v-model="searchInfo.goods" filterable clearable remote :remote-method="querySearch" placeholder="请选择商品名称" :loading="loading">
                 <el-option v-for="item in goodsList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
               </el-select>
@@ -19,6 +20,9 @@
               <el-select v-model="searchInfo.leader" filterable clearable remote :remote-method="leaderSearch" placeholder="请选择团长名称" :loading="loading">
                 <el-option v-for="item in leaderList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
               </el-select>
+            </template> -->
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
             </template>
           </data-search>
           <data-btn :fields="btnList" @add="toAdd"></data-btn>
@@ -75,12 +79,13 @@ export default {
       ],
       opera: [
         { label: '修改', method: 'edit' },
-        { label: '删除', method: 'delete', confirm: true, type: 'danger' },
+        // { label: '删除', method: 'delete', confirm: true, type: 'danger' },
       ],
       btnList: [{ label: '添加', method: 'add' }],
       searchFields: [
-        { label: '商品名称', model: 'goods', custom: true },
-        { label: '团长', model: 'leader', custom: true },
+        // { label: '商品名称', model: 'goods', custom: true },
+        // { label: '团长', model: 'leader', custom: true },
+        { label: '状态', model: 'status', type: 'select' },
       ],
       searchInfo: {},
       list: [],
@@ -162,4 +167,22 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+  .thr {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 13 - 3
src/views/platGroup/order/index.vue

@@ -27,14 +27,14 @@
                     :form="searchForm"
                     :shopList="shopList"
                     :goodsList="goodsList"
-                    @onSubmit="search"
+                    @onSubmit="toSearch"
                     @querySearch="querySearch"
                     @toReset="toClose"
                     @goodsSearch="goodsSearch"
                   >
                   </search-1>
                 </el-col>
-                <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
+                <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
                   <template #is_afterSale="{ row }">
                     <span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
                       {{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
@@ -102,6 +102,8 @@ export default {
         { label: '购买数量', model: 'num' },
         { label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
       ],
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -113,6 +115,11 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...goods({ goodsQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -126,10 +133,13 @@ export default {
       else if (this.activeName == '3') info.status = '2';
       else if (this.activeName == '4') info.status = '3';
       else if (this.activeName == '5') info.status = '-1';
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },

+ 1 - 0
src/views/platGroup/sales/index.vue

@@ -71,6 +71,7 @@ export default {
         { label: '售后处理人', model: 'deal_person.name' },
         { label: '申请时间', model: 'apply_time' },
         { label: '结束时间', model: 'end_time' },
+        { label: '团长意见', model: 'leader_suggest', format: (i) => (i == true ? '同意' : i == false ? '不同意' : '') },
       ],
       typeList: [],
       statusList: [],

+ 5 - 0
src/views/platSettings/config/index.vue

@@ -10,6 +10,10 @@
           <el-input v-model="form.autoCloseOrder" type="number" placeholder="请输入自动关闭订单时间"></el-input>
           <p style="color: #999">关闭订单时间小于等于0时不自动关闭</p>
         </template>
+        <template #reward_day>
+          <el-input v-model="form.reward_day" type="number" placeholder="请输入提现日期"></el-input>
+          <p style="color: #999">该天数是 从 收货后开始计算 x 天后 可提取</p>
+        </template>
         <template #agree>
           <editor v-model="form.agree" url="/files/point/config/upload" />
         </template>
@@ -56,6 +60,7 @@ export default {
         { label: 'logo', model: 'logo', type: 'upload', limit: 1, url: '/files/point/config/upload' },
         { label: '购物赠送积分', model: 'buyPoint', custom: true },
         { label: '自动关闭订单时间', model: 'autoCloseOrder', custom: true },
+        { label: '提现日期', model: 'reward_day', custom: true },
         { label: '底部文字', model: 'bottom_title' },
         { label: '底部菜单', model: 'bottom_menu', custom: true },
         { label: '分享图片', model: 'share', type: 'upload', limit: 1, url: '/files/point/config/upload' },

+ 164 - 0
src/views/platfinance/shopCash/index.vue

@@ -0,0 +1,164 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-col :span="24" class="one"> <span>提现审核</span> </el-col>
+        <el-col :span="24" class="two">
+          <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClos"> </search-1>
+        </el-col>
+        <el-col :span="24" class="four">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam" @delete="toDelete"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+    <e-dialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <data-form :span="24" :fields="fieldsForm" :rules="fieldRules" v-model="fieldform" labelWidth="150px" @save="onSubmit">
+          <template #status>
+            <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
+          </template>
+        </data-form>
+      </template>
+    </e-dialog>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('shopCashOut');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+export default {
+  name: 'card-1',
+  props: {},
+  components: { search1: () => import('./parts/search-1.vue') },
+  data: function () {
+    const that = this;
+    return {
+      loadings: true,
+      searchForm: {},
+      list: [],
+      total: 0,
+      opera: [{ label: '审核', method: 'exam' }],
+      fields: [
+        { label: '申请店铺', model: 'shop.name' },
+        { label: '提现金额', model: 'money' },
+        { label: '银行卡号', model: 'card', showTip: false },
+        { label: '银行卡所属', model: 'card_name' },
+        { label: '所属银行', model: 'card_bank' },
+        { label: '申请时间', model: 'apply_time' },
+        {
+          label: '审核状态',
+          model: 'status',
+          format: (i) => {
+            let data = this.statusList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '审核处理人', model: 'deal_person.name' },
+        { label: '审核时间', model: 'exam_time' },
+      ],
+      statusList: [],
+      // 弹框
+      dialog: { title: '信息管理', show: false, type: '1' },
+      fieldform: {},
+      fieldsForm: [
+        { label: '是否通过', model: 'status', type: 'select' },
+        { label: '审核理由', model: 'exam_reason', type: 'textarea' },
+      ],
+      fieldRules: {
+        status: [{ required: true, message: '请选择是否通过', trigger: 'change' }],
+        exam_reason: [{ required: true, message: '请输入审核理由', trigger: 'blur' }],
+      },
+    };
+  },
+  async created() {
+    await this.search();
+    await this.searchOther();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+      let condition = _.cloneDeep(this.searchForm);
+      let res = await this.query({ skip, limit, ...condition, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+      this.loadings = false;
+    },
+    toExam({ data }) {
+      this.$set(this, 'fieldform', data);
+      this.dialog = { title: '信息管理', show: true, type: '1' };
+    },
+    // 删除
+    async toDelete({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `刪除信息成功` });
+        this.search();
+      }
+    },
+    // 保存
+    async onSubmit({ data }) {
+      data.exam_time = moment().format('YYYY-MM-DD HH:mm:ss');
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.toClose();
+      }
+    },
+    // 关闭
+    toClose() {
+      this.fieldform = {};
+      this.dialog = { title: '信息管理', show: false, type: '1' };
+      this.search();
+    },
+    toClos() {
+      this.searchForm = {};
+      this.search();
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 提现审核状态
+      res = await this.dictQuery({ code: 'withdrawal_exam_status' });
+      if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.one {
+  margin: 0 0 10px 0;
+}
+.two {
+  margin: 0 0 10px 0;
+}
+</style>

+ 11 - 12
src/views/selfShop/bill/parts/search-1.vue

@@ -3,17 +3,16 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" ref="form" label-width="130px">
-          <el-col :span="7">
-            <el-form-item label="日期" prop="buy_time">
-              <el-date-picker
-                v-model="form.buy_time"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                value-format="yyyy-MM-dd"
-              >
-              </el-date-picker>
+          <el-col :span="6">
+            <el-form-item label="审核状态" prop="status">
+              <el-select v-model="form.status" clearable filterable placeholder="请选择" style="width: 100%" size="small">
+                <el-option v-for="i in statusList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="银行卡所属" prop="card_name">
+              <el-input v-model="form.card_name" clearable type="text" placeholder="请输入银行卡所属"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24" class="btn">
@@ -30,7 +29,7 @@
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'search-1',
-  props: { form: { type: Object } },
+  props: { form: { type: Object }, statusList: { type: Array } },
   components: {},
   data: function () {
     return {};

+ 16 - 2
src/views/platfinance/withdrawal/index.vue

@@ -13,7 +13,7 @@
           <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClos"> </search-1>
         </el-col>
         <el-col :span="24" class="four">
-          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam" @delete="toDelete"> </data-table>
         </el-col>
       </el-col>
     </el-row>
@@ -46,10 +46,16 @@ export default {
       searchForm: {},
       list: [],
       total: 0,
-      opera: [{ label: '审核', method: 'exam' }],
+      opera: [
+        { label: '审核', method: 'exam' },
+        // { label: '删除', method: 'delete', confirm: true, type: 'danger' },
+      ],
       fields: [
         { label: '申请人姓名', model: 'customer.name' },
         { label: '提现金额', model: 'money' },
+        { label: '银行卡号', model: 'card', showTip: false },
+        { label: '银行卡所属', model: 'card_name' },
+        { label: '所属银行', model: 'card_bank' },
         { label: '申请时间', model: 'apply_time' },
         {
           label: '审核状态',
@@ -99,6 +105,14 @@ export default {
       this.$set(this, 'fieldform', data);
       this.dialog = { title: '信息管理', show: true, type: '1' };
     },
+    // 删除
+    async toDelete({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `刪除信息成功` });
+        this.search();
+      }
+    },
     // 保存
     async onSubmit({ data }) {
       data.exam_time = moment().format('YYYY-MM-DD HH:mm:ss');

+ 5 - 0
src/views/platfinance/withdrawal/parts/search-1.vue

@@ -10,6 +10,11 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="银行卡所属" prop="card_name">
+              <el-input v-model="form.card_name" clearable type="text" placeholder="请输入银行卡所属"></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="24" class="btn">
             <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>

+ 30 - 6
src/views/platmanag/goods/index.vue

@@ -11,7 +11,7 @@
         >
           <search-1
             :form="searchInfo"
-            @onSubmit="search"
+            @onSubmit="toSearch"
             @querySearch="querySearch"
             @toReset="toClose"
             @changeTags="changeTags"
@@ -32,7 +32,13 @@
             @delete="toDelete"
             @spec="toSpec"
             @copy="toCopy"
-          ></data-table>
+          >
+            <template #source="{ row }">
+              <span style="color: blue" @click="toUrl(row.url)">
+                {{ row.source }}
+              </span>
+            </template>
+          </data-table>
         </el-col>
       </el-row>
     </span>
@@ -128,6 +134,7 @@ export default {
         { label: '商品分类', model: 'tags', format: (i) => this.getTags(i), showTip: false },
         { label: '活动标签', model: 'act_tags', format: (i) => this.getAct_tags(i) },
         { label: '商品状态', model: 'status', format: (i) => this.getStatus(i) },
+        { label: '供应商', model: 'source', custom: true },
         { label: '排序', model: 'sort' },
       ],
       opera: [
@@ -180,11 +187,18 @@ export default {
       statusList: [],
       // 返现金额类型
       typeList: [{ label: '固定金额' }, { label: '百分比' }],
+      searchQuery: {},
     };
   },
   created() {
     this.searchOthers();
-    this.search();
+    let route = JSON.parse(sessionStorage.getItem(this.$route.path));
+    if (route) {
+      this.search(route);
+      this.$nextTick(() => {
+        this.$refs.dataTable.setPage(route);
+      });
+    } else this.search();
   },
   methods: {
     ...dictData({ getDict: 'query' }),
@@ -193,6 +207,11 @@ export default {
     ...shop({ shopQuery: 'query', shopFetch: 'fetch' }),
     ...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
     ...methodsUtil,
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...others } = {}) {
       let query = { skip, limit, ...others };
@@ -201,9 +220,14 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
+    toUrl(url) {
+      if (url) window.open(url, '_blank');
+      else this.$message.error('该商品还未添加来源网址,无法跳转');
+    },
     // 去编辑
     async toEdit({ data }) {
       const res = await this.fetch(data._id);
@@ -265,7 +289,6 @@ export default {
         if (this.$checkRes(res)) {
           this.$message({ type: `success`, message: `复制成功` });
           this.toBack();
-          this.search();
         }
       });
     },
@@ -335,13 +358,13 @@ export default {
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `维护信息成功` });
         this.toBack();
-        this.search();
       }
     },
     // 执行返回
     toBack() {
       this.form = {};
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     // 上架
     async toPuton({ data }) {
@@ -355,11 +378,12 @@ export default {
         let res;
         if (data._id) res = await this.update(data);
         if (this.$checkRes(res)) this.$message({ type: `success`, message: `修改成功` });
-        this.search();
+        this.search(this.searchQuery);
       });
     },
     // 库存管理
     toSpec({ data }) {
+      sessionStorage.setItem(this.$route.path, JSON.stringify(this.searchQuery));
       this.$router.push({ path: `/platmanag/spec/${data._id}` });
     },
   },

+ 5 - 0
src/views/platmanag/goods/parts/search-1.vue

@@ -42,6 +42,11 @@
               ></el-cascader>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="供应商" prop="source">
+              <el-input v-model="form.source" placeholder="请输入供应商" size="small"></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="24" class="btn">
             <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>

+ 4 - 24
src/views/platmanag/goods/spec.vue

@@ -66,18 +66,8 @@ export default {
         { label: '实际销售价格', model: 'sell_money' },
         { label: '划掉销售价格', model: 'flow_money' },
         { label: '运费', model: 'freight' },
+        { label: '团长价格', model: 'leader_price' },
         { label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
-        {
-          label: '是否可以团购',
-          model: 'can_group',
-          format: (i) => {
-            let data = this.tfList.find((f) => f.value == i);
-            if (data) return data.label;
-            else return '暂无';
-          },
-        },
-        { label: '团购金额', model: 'group_config.money' },
-        { label: '开团人数', model: 'group_config.need_person' },
         { label: '排序', model: 'sort' },
       ],
       opera: [
@@ -103,9 +93,7 @@ export default {
         { label: '运费', model: 'freight', type: 'number' },
         { label: '排序', model: 'sort', type: 'number' },
         { label: '状态', model: 'status', type: 'select' },
-        { label: '是否可以团购', model: 'can_group', type: 'select' },
-        { label: '团购金额', model: 'money', type: 'number' },
-        { label: '开团人数', model: 'need_person', type: 'number' },
+        { label: '团长价格', model: 'leader_price', type: 'number' },
         { label: '图片', model: 'file', type: 'upload', url: '/files/point/goodsSpec/upload' },
       ],
       rules: {
@@ -139,7 +127,7 @@ export default {
     ...methodUtil,
     // 添加自定义
     initAddData() {
-      const obj = { goods: this.goods, status: '0', can_group: '1', freight: 0 };
+      const obj = { goods: this.goods, status: '0', freight: 0 };
       this.$set(this, 'form', obj);
     },
     // 面包屑
@@ -172,10 +160,6 @@ export default {
     },
     // 保存
     async toSave({ data }) {
-      let group_config = {};
-      group_config.money = data.money;
-      group_config.need_person = data.need_person;
-      data.group_config = group_config;
       let res;
       if (data.id) res = await this.update(data);
       else res = await this.create(data);
@@ -189,11 +173,7 @@ export default {
     async toEdit({ data }) {
       const res = await this.fetch(data._id);
       if (this.$checkRes(res)) {
-        let data = res.data;
-        const group_config = _.get(data, 'group_config', {});
-        data = { ...data, ...group_config };
-        delete data.group_config;
-        this.$set(this, `form`, data);
+        this.$set(this, `form`, res.data);
         this.view = 'info';
       } else this.$message.error('未找到指定数据');
     },

+ 147 - 0
src/views/platmanag/notice/detail.vue

@@ -0,0 +1,147 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
+        <el-col :span="24" style="margin: 0 0 10px 0">
+          <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+        </el-col>
+        <el-col :span="24">
+          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
+            <template #customer>
+              <el-select
+                v-model="form.customer"
+                filterable
+                multiple
+                remote
+                placeholder="请选择用户"
+                :remote-method="querySearch"
+                :loading="loading"
+                style="width: 100%"
+              >
+                <el-option v-for="item in customerList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
+              </el-select>
+            </template>
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #source>
+              <el-option v-for="i in sourceList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: users } = createNamespacedHelpers('users');
+const { mapActions: dictData } = createNamespacedHelpers('dictData'); // 字典
+const { mapActions: notice } = createNamespacedHelpers('notice'); // 消息
+export default {
+  name: 'detail',
+  props: { id: { type: String } },
+  components: {},
+  data: function () {
+    return {
+      loadings: true,
+      // info部分
+      infoFields: [
+        { label: '用户', model: 'customer', custom: true },
+        { label: '信息来源', model: 'source', type: 'select', readonly: true },
+        { label: '发送时间', model: 'time', type: 'datetime' },
+        { label: '内容', model: 'content', type: 'textarea' },
+        { label: '状态', model: 'status', type: 'select' },
+      ],
+      rules: {
+        customer: [{ required: true, message: '用户', trigger: 'change' }],
+        time: [{ required: true, message: '发送时间', trigger: 'change' }],
+      },
+      form: {},
+      // 加载
+      loading: false,
+      // 远程搜索团长列表
+      customerList: [],
+      // 状态列表
+      statusList: [],
+      // 来源列表
+      sourceList: [],
+    };
+  },
+  created() {
+    this.searchOthers();
+    this.search();
+  },
+  methods: {
+    ...users({ usersQuery: 'query', usersFetch: 'fetch' }),
+    ...dictData({ dictQuery: 'query' }),
+    ...notice(['query', 'delete', 'fetch', 'update', 'create']),
+    // 查询
+    async search() {
+      if (this.id) {
+        const res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          let list = [];
+          list.push(res.data.customer);
+          res.data.customer = list;
+          this.$set(this, `form`, res.data);
+        }
+      } else {
+        let obj = { status: '0', source: '0' };
+        this.$set(this, 'form', obj);
+      }
+      this.loadings = false;
+    },
+    // 远程查询
+    async querySearch(value) {
+      this.loading = true;
+      let res = await this.usersQuery({ name: value, is_leader: '0' });
+      if (this.$checkRes(res)) this.$set(this, 'customerList', res.data);
+      this.loading = false;
+    },
+    // 保存
+    async toSave({ data }) {
+      let res;
+      if (data._id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.toBack();
+      }
+    },
+    // 返回
+    toBack() {
+      this.$emit('goBack');
+    },
+    // 查询其他信息
+    async searchOthers() {
+      let res;
+      // 信息状态
+      res = await this.dictQuery({ code: 'notice_status' });
+      if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
+      // 信息来源
+      res = await this.dictQuery({ code: 'notice_source' });
+      if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
+      // 团长列表
+      res = await this.usersQuery({ is_leader: '0' });
+      if (this.$checkRes(res)) this.$set(this, `customerList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 139 - 0
src/views/platmanag/notice/index.vue

@@ -0,0 +1,139 @@
+<template>
+  <div id="goods">
+    <el-row>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <span v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>系统消息管理</span> </el-col>
+          <data-search :fields="searchFields" v-model="searchInfo" @query="search">
+            <template #source>
+              <el-option v-for="i in sourceList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </data-search>
+          <data-btn :fields="btnList" @add="toAdd"></data-btn>
+          <el-col :span="24" class="two">
+            <data-table ref="dataTable" :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView"></data-table>
+          </el-col>
+        </span>
+        <notice v-if="view === 'info'" :id="id" @toBack="toBack"></notice>
+        <detail v-if="view === 'infos'" :id="id" @goBack="toBack"></detail>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: msgList } = createNamespacedHelpers('msgList');
+const { mapActions: notice } = createNamespacedHelpers('notice');
+const { mapActions: dictData } = createNamespacedHelpers('dictData'); // 字典
+
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    notice: () => import('./notice.vue'),
+    detail: () => import('./detail.vue'),
+  },
+  data: function () {
+    return {
+      loadings: true,
+      loading: false,
+      view: 'list',
+      fields: [
+        { label: '发送时间', model: 'time' },
+        { label: '来源id', model: '_id' },
+        {
+          label: '信息来源',
+          model: 'source',
+          format: (i) => {
+            let data = this.sourceList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+      ],
+      btnList: [{ label: '添加', method: 'add' }],
+      opera: [{ label: '查看', method: 'view' }],
+      searchFields: [{ label: '信息来源', model: 'source', type: 'select' }],
+      searchInfo: {},
+      list: [],
+      total: 0,
+      id: '',
+      // 信息来源
+      sourceList: [],
+    };
+  },
+  created() {
+    this.searchOthers();
+    this.search();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...notice(['query', 'delete', 'fetch', 'update', 'create']),
+    ...msgList({ msgQuery: 'query' }),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
+      let query = { skip, limit, ...others };
+      if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
+      const res = await this.msgQuery(query);
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+      this.loadings = false;
+    },
+    // 新增
+    toAdd() {
+      let id = '';
+      this.$set(this, `id`, id);
+      this.$set(this, `view`, 'infos');
+    },
+    // 查看
+    async toView({ data }) {
+      this.$set(this, `id`, data._id);
+      this.$set(this, `view`, 'info');
+    },
+    // 执行返回
+    toBack() {
+      this.view = 'list';
+    },
+    // 查询其他信息
+    async searchOthers() {
+      let res;
+      // 信息来源
+      res = await this.dictQuery({ code: 'notice_source' });
+      if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 20px 0 10px 0;
+  }
+  .thr {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 184 - 0
src/views/platmanag/notice/notice.vue

@@ -0,0 +1,184 @@
+<template>
+  <div id="goods">
+    <el-row>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <span v-if="view === 'list'">
+          <el-row>
+            <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+          </el-row>
+          <el-col :span="24" class="one"> <span>系统消息管理</span> </el-col>
+          <data-search :fields="searchFields" v-model="searchInfo" @query="search">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #source>
+              <el-option v-for="i in sourceList" :key="i.label" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </data-search>
+          <data-btn :fields="btnList" @add="toAdd"></data-btn>
+          <data-table
+            ref="dataTable"
+            :fields="fields"
+            :opera="opera"
+            :data="list"
+            :total="total"
+            @query="search"
+            @edit="toEdit"
+            @delete="toDelete"
+          ></data-table>
+        </span>
+        <detail v-if="view === 'info'" :id="ids" @goBack="goBack"></detail>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: msgList } = createNamespacedHelpers('msgList');
+const { mapActions: notice } = createNamespacedHelpers('notice');
+const { mapActions: dictData } = createNamespacedHelpers('dictData'); // 字典
+
+export default {
+  name: 'index',
+  props: { id: { type: String } },
+  components: {
+    detail: () => import('./detail.vue'),
+  },
+  data: function () {
+    return {
+      loadings: true,
+      loading: false,
+      view: 'list',
+      fields: [
+        { label: '用户', model: 'customer.name', showTip: false },
+        { label: '发送时间', model: 'time' },
+        { label: '来源id', model: 'source_id' },
+        {
+          label: '信息来源',
+          model: 'source',
+          format: (i) => {
+            let data = this.sourceList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        {
+          label: '状态',
+          model: 'status',
+          format: (i) => {
+            let data = this.statusList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'delete', confirm: true, type: 'danger' },
+      ],
+      btnList: [{ label: '添加', method: 'add' }],
+      searchFields: [
+        { label: '状态', model: 'status', type: 'select' },
+        { label: '信息来源', model: 'source', type: 'select' },
+      ],
+      searchInfo: {},
+      list: [],
+      total: 0,
+      ids: '',
+      // 状态
+      statusList: [],
+      // 信息来源
+      sourceList: [],
+    };
+  },
+  created() {
+    this.searchOthers();
+
+    this.search();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...notice(['query', 'delete', 'fetch', 'update', 'create']),
+    ...msgList({ msgQuery: 'query' }),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
+      let query = { skip, limit, ...others };
+      if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
+      if (this.id) query.source_id = this.id;
+      const res = await this.query(query);
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+      this.loadings = false;
+    },
+
+    // 新增
+    toAdd() {
+      let id = '';
+      this.$set(this, `ids`, id);
+      this.$set(this, `view`, 'info');
+    },
+    // 修改
+    async toEdit({ data }) {
+      this.$set(this, `ids`, data._id);
+      this.$set(this, `view`, 'info');
+    },
+    // 删除
+    async toDelete({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `刪除信息成功` });
+        this.search();
+      }
+    },
+    // 返回
+    toBack(data) {
+      this.$emit('toBack');
+    },
+    goBack() {
+      this.view = 'list';
+    },
+    // 查询其他信息
+    async searchOthers() {
+      let res;
+      res = await this.dictQuery({ code: 'notice_status' });
+      if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
+      // 信息来源
+      res = await this.dictQuery({ code: 'notice_source' });
+      if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+  .thr {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 17 - 19
src/views/platmanag/order/index.vue

@@ -25,23 +25,11 @@
               <el-col :span="24" v-if="activeName == '1'">
                 <card-1 :statusList="statusList" @toDetail="toDetail" @toSales="toSales"></card-1>
               </el-col>
-              <el-col
-                :span="24"
-                v-else-if="
-                  activeName == '2' ||
-                  activeName == '3' ||
-                  activeName == '4' ||
-                  activeName == '5' ||
-                  activeName == '6' ||
-                  activeName == '7' ||
-                  activeName == '8' ||
-                  activeName == '9'
-                "
-              >
+              <el-col :span="24" v-else-if="activeName != '1'">
                 <el-col :span="24" class="one">
-                  <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+                  <search-1 :form="searchForm" @onSubmit="toSearch" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
                 </el-col>
-                <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
+                <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
                   <template #is_afterSale="{ row }">
                     <span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
                       {{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
@@ -79,7 +67,6 @@ export default {
     search1: () => import('@/components/orderParts/search-1.vue'),
   },
   data: function () {
-    const that = this;
     return {
       loadings: true,
       view: 'list',
@@ -90,8 +77,9 @@ export default {
       shopList: [],
       order_id: '',
       sales_id: '',
+      // 状态
       status: '',
-
+      // 查询
       searchForm: {},
       list: [],
       total: 0,
@@ -108,6 +96,8 @@ export default {
         { label: '商品数量', model: 'buy_num_total' },
         { label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
       ],
+      // 查询条件
+      searchQuery: {},
     };
   },
   async created() {
@@ -118,6 +108,11 @@ export default {
     ...dictData({ dictQuery: 'query' }),
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
@@ -134,14 +129,16 @@ export default {
       else if (this.activeName == '7') info.status = '-2';
       else if (this.activeName == '8') info.status = '-3';
       else if (this.activeName == '9') info.status = '-4';
-      let res = await this.query({ skip, limit, ...condition, ...info });
+      let query = { skip, limit, ...info };
+      if (Object.keys(condition).length > 0) query = { ...query, ...condition };
+      let res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
+        this.$set(this, `searchQuery`, query);
       }
       this.loadings = false;
     },
-
     // 未付款
     toDetail(val) {
       this.$set(this, `order_id`, val);
@@ -167,6 +164,7 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     getAddress(i) {
       let name = i.name + ',' + i.phone;

+ 32 - 19
src/views/platmanag/storeAcc/detail.vue

@@ -1,24 +1,32 @@
 <template>
   <div id="goods">
     <template v-if="view === 'list'">
-      <el-row>
-        <el-col :span="24" style="padding: 10px">
-          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
-        </el-col>
-      </el-row>
-      <data-search :fields="searchFields" v-model="searchInfo" @query="search"> </data-search>
-      <data-btn :fields="btnList" @add="toAdd"></data-btn>
-      <data-table
-        ref="dataTable"
-        :fields="fields"
-        :opera="opera"
-        :data="list"
-        :total="total"
-        @query="search"
-        @edit="toEdit"
-        @del="toDel"
-        @reset="toReset"
-      ></data-table>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-row>
+          <el-col :span="24" style="padding: 10px">
+            <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+          </el-col>
+        </el-row>
+        <data-search :fields="searchFields" v-model="searchInfo" @query="search"> </data-search>
+        <data-btn :fields="btnList" @add="toAdd"></data-btn>
+        <data-table
+          ref="dataTable"
+          :fields="fields"
+          :opera="opera"
+          :data="list"
+          :total="total"
+          @query="search"
+          @edit="toEdit"
+          @del="toDel"
+          @reset="toReset"
+        ></data-table>
+      </el-col>
     </template>
     <template v-else>
       <el-row>
@@ -53,6 +61,7 @@ export default {
   components: {},
   data: function () {
     return {
+      loadings: true,
       view: 'list',
       fields: [
         { label: '名称', model: 'name' },
@@ -101,6 +110,7 @@ export default {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       }
+      this.loadings = false;
     },
     // 添加自定义
     initAddData() {
@@ -155,7 +165,10 @@ export default {
     // 查询其他信息
     async searchOthers() {
       let res = await this.roleQuery();
-      if (this.$checkRes(res)) this.$set(this, `roleList`, res.data);
+      if (this.$checkRes(res)) {
+        let info = res.data.filter((f) => f.code != 'sadmin');
+        if (info) this.$set(this, `roleList`, info);
+      }
     },
     // 返回
     toBack() {

+ 47 - 20
src/views/platmanag/storeAcc/index.vue

@@ -1,31 +1,46 @@
 <template>
   <div id="goods">
     <template v-if="view === 'list'">
-      <el-col :span="24" class="one"> <span>店铺管理</span> </el-col>
-      <data-search :fields="searchFields" v-model="searchInfo" @query="search"> </data-search>
-      <data-btn :fields="btnList" @add="toAdd"></data-btn>
-      <data-table
-        ref="dataTable"
-        :fields="fields"
-        :opera="opera"
-        :data="list"
-        :total="total"
-        @query="search"
-        @manage="toManage"
-        @edit="toEdit"
-        @del="toDel"
-      ></data-table>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-col :span="24" class="one"> <span>店铺管理</span> </el-col>
+        <data-search :fields="searchFields" v-model="searchInfo" @query="search"> </data-search>
+        <data-btn :fields="btnList" @add="toAdd"></data-btn>
+        <data-table
+          ref="dataTable"
+          :fields="fields"
+          :opera="opera"
+          :data="list"
+          :total="total"
+          @query="search"
+          @cash="toCash"
+          @manage="toManage"
+          @edit="toEdit"
+          @del="toDel"
+        ></data-table>
+      </el-col>
     </template>
-    <template v-else>
+    <template v-else-if="view == 'info'">
       <el-row>
         <el-col :span="24">
           <el-button type="primary" size="mini" @click="toBackList()">返回</el-button>
         </el-col>
         <el-col :span="24">
-          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave"> </data-form>
+          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
+            <template #cut>
+              <el-col :span="3"> <el-input v-model="form.cut" type="number" placeholder="请输入抽成比例"></el-input></el-col>
+              <el-col :span="2" style="color: red; margin: 0 0 0 10px">%</el-col>
+            </template>
+          </data-form>
         </el-col>
       </el-row>
     </template>
+    <shopInBill v-if="view === 'bill'" :id="id" @toBack="toBackList"></shopInBill>
   </div>
 </template>
 
@@ -38,15 +53,19 @@ const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: {
+    shopInBill: () => import('./shopInBill.vue'),
+  },
   data: function () {
     return {
+      loadings: true,
       view: 'list',
       fields: [
         { label: '店铺编号', model: 'code' },
         { label: '店铺名称', model: 'name' },
         { label: '店主', model: 'person' },
         { label: '联系电话', model: 'phone' },
+        { label: '抽成比例(%)', model: 'cut' },
         { label: '服务评分', model: 'service_score' },
         { label: '发货评分', model: 'send_score' },
         { label: '商品评分', model: 'goods_score' },
@@ -62,6 +81,7 @@ export default {
       ],
       opera: [
         { label: '修改', method: 'edit' },
+        { label: '流水', method: 'cash' },
         { label: '账号管理', method: 'manage' },
         { label: '删除', method: 'del', confirm: true, type: 'danger' },
       ],
@@ -80,11 +100,13 @@ export default {
         { label: '地址', model: 'address' },
         { label: '证件照片', model: 'file', type: 'upload', url: '/files/point/shopFile/upload' },
         { label: '店铺二维码', model: 'qrcode', type: 'upload', url: '/files/point/shopFile/upload' },
+        { label: '抽成比例', model: 'cut', custom: true },
       ],
       rules: {},
       form: {},
       // 店铺状态列表
       statusList: [],
+      id: '',
     };
   },
   created() {
@@ -103,11 +125,16 @@ export default {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       }
+      this.loadings = false;
     },
     initAddData() {
       const obj = { status: '1' };
       this.$set(this, 'form', obj);
     },
+    toCash({ data }) {
+      this.$set(this, `id`, data._id);
+      this.$set(this, `view`, 'bill');
+    },
     // 账号管理
     async toManage({ data }) {
       this.$router.push({ path: '/platmanag/storeAcc/detail', query: { id: data._id } });
@@ -152,9 +179,9 @@ export default {
     },
   },
   computed: {
-    id() {
-      return this.$route.query.id;
-    },
+    // id() {
+    //   return this.$route.query.id;
+    // },
   },
 };
 </script>

+ 133 - 0
src/views/platmanag/storeAcc/shopInBill.vue

@@ -0,0 +1,133 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" style="margin: 0 0 10px 0">
+          <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+        </el-col>
+        <el-col :span="24" class="one">
+          <el-col :span="24">
+            <p>
+              账户余额:<span>{{ info.total }}</span>
+            </p>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-table :fields="fields" @query="search" :data="list" :total="total"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('shopInBill');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+export default {
+  name: 'card-1',
+  props: {
+    id: { type: String },
+  },
+  components: {},
+  data: function () {
+    return {
+      // 账户余额
+      info: {},
+      // 账户流水
+      list: [],
+      // 来源列表
+      sourceList: [],
+      fields: [
+        {
+          label: '来源',
+          model: 'source',
+          format: (i) => {
+            let data = this.sourceList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '净金额', model: 'receipts' },
+        { label: '总金额', model: 'total' },
+        { label: '抽成比例(%)', model: 'cut' },
+        { label: '时间', model: 'time' },
+      ],
+      total: 0,
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'fetch', 'create', 'update', 'delete', 'bill']),
+    ...dictData({ dictQuery: 'query' }),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+      let arr = await this.bill(this.id);
+      if (this.$checkRes(arr)) {
+        this.$set(this, `info`, arr.data);
+      }
+      let res = await this.query({ skip, limit, ...info, shop: this.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res = await this.dictQuery({ code: 'cashBack_source' });
+      if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  text-align: center;
+}
+.one {
+  margin: 0 0 10px 0;
+  p {
+    font-size: 24px;
+    font-weight: 700;
+    span {
+      color: red;
+    }
+  }
+}
+.two {
+  span {
+    color: red;
+  }
+  .sp1 {
+    font-size: 18px;
+    font-weight: 500;
+  }
+}
+.title {
+  text-align: center;
+}
+.el-col {
+  margin: 10px 0;
+}
+</style>

+ 108 - 0
src/views/selfShop/bill/detail.vue

@@ -0,0 +1,108 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
+        <el-col :span="24" style="margin: 0 0 10px 0">
+          <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+        </el-col>
+        <el-col :span="24">
+          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
+            <template #money>
+              <el-input v-model="form.money" type="number" placeholder="请输入提现金额" @change="onChange"></el-input>
+              <p style="color: red">可提现金额为:{{ canGet || 0 }}</p>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const moment = require('moment');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: shopCashOut } = createNamespacedHelpers('shopCashOut');
+export default {
+  name: 'detail',
+  props: { canGet: { type: Number } },
+  components: {},
+  data: function () {
+    return {
+      loadings: true,
+      // info部分
+      infoFields: [
+        { label: '提现金额', model: 'money', custom: true },
+        { label: '银行卡号', model: 'card' },
+        { label: '银行卡所属', model: 'card_name' },
+        { label: '所属银行', model: 'card_bank' },
+      ],
+      rules: {
+        money: [{ required: true, message: '提现金额', trigger: 'blur' }],
+        card: [{ required: true, message: '银行卡号', trigger: 'blur' }],
+        card_name: [{ required: true, message: '银行卡所属', trigger: 'blur' }],
+        card_bank: [{ required: true, message: '所属银行', trigger: 'blur' }],
+      },
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...shopCashOut(['query', 'delete', 'fetch', 'update', 'create']),
+    // 查询
+    async search() {
+      if (this.id) {
+        const res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      } else {
+        const obj = { shop: _.get(this.user.shop, '_id'), status: '0' };
+        this.$set(this, 'form', obj);
+      }
+      this.loadings = false;
+    },
+    onChange(value) {
+      if (value > this.canGet) {
+        this.$message({ type: `warning`, message: `可提现金额为${this.canGet}` });
+        this.$set(this.form, 'money', 0);
+      }
+    },
+    // 保存
+    async toSave({ data }) {
+      data.apply_time = moment().format('YYYY-MM-DD HH:mm:ss');
+      let res;
+      if (data._id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.toBack();
+      }
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  text-align: left;
+}
+</style>

+ 93 - 121
src/views/selfShop/bill/index.vue

@@ -2,154 +2,112 @@
   <div id="card-1">
     <el-row>
       <el-col :span="24" class="main">
-        <el-col :span="24" class="one">
-          <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1>
-        </el-col>
-        <el-col :span="24" v-if="afterSaleList.length != '0' || orderList.length != '0'">
-          <el-button type="primary" @click="toFile()">对账</el-button>
-        </el-col>
-        <el-col :span="24" class="two">
-          净销售额:<span>{{ info.total || '0' }}</span> 元
-        </el-col>
-        <el-col :span="24">
-          <el-tabs type="border-card">
-            <el-tab-pane label="订单">
-              <data-table :fields="orderfields" @query="search" :data="orderList" :usePage="false" rowKey="key"> </data-table>
-            </el-tab-pane>
-            <el-tab-pane label="售后单">
-              <data-table :fields="afterSalefields" @query="search" :data="afterSaleList" :usePage="false"> </data-table>
-            </el-tab-pane>
-          </el-tabs>
-        </el-col>
+        <span v-if="view === 'list'">
+          <el-col :span="24" class="one">
+            <el-col :span="24">
+              <p>
+                账户余额:<span>{{ info.total }}</span
+                >元
+              </p>
+            </el-col>
+            <el-col :span="24">
+              可提现金额:<span style="color: red">{{ info.canGet }}</span
+              >元
+            </el-col>
+            <el-col :span="24">
+              <el-button type="success" @click="toCash()"> 提现 </el-button>
+              <el-button type="success" @click="toRecord()"> 申请记录 </el-button>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="two">
+            <data-table :fields="fields" @query="search" :data="list" :total="total"> </data-table>
+          </el-col>
+        </span>
+        <detail v-if="view === 'info'" :canGet="canGet" @toBack="toBack"></detail>
+        <record v-if="view === 'record'" @toBack="toBack"></record>
       </el-col>
     </el-row>
   </div>
 </template>
-
 <script>
 const _ = require('lodash');
-import FileSaver from 'file-saver';
-const ExcelJS = require('exceljs');
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('getBill');
-const { mapActions: outBill } = createNamespacedHelpers('outBill');
+const { mapActions } = createNamespacedHelpers('shopInBill');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
   name: 'card-1',
   props: {},
-  components: { search1: () => import('./parts/search-1.vue') },
+  components: {
+    detail: () => import('./detail.vue'),
+    record: () => import('./record.vue'),
+  },
   data: function () {
     return {
-      searchForm: {},
+      view: 'list',
+      // 账户余额
       info: {},
-      afterSaleList: [],
-      orderList: [],
-      orderfields: [
-        { label: '订单号', model: 'no', showTip: false },
-        { label: '订单类型', model: 'type' },
-        { label: '支付时间', model: 'pay_time' },
-        { label: '商品', model: 'goods', showTip: false },
-        { label: '规格', model: 'spec', showTip: false },
-        { label: '购买数量', model: 'buy_num' },
-        { label: '单价', model: 'price' },
-        { label: '优惠金额', model: 'discount' },
-        { label: '运费', model: 'freight' },
-        { label: '总价', model: 'total' },
-      ],
-      afterSalefields: [
-        { label: '订单号', model: 'no', showTip: false },
-        { label: '商品', model: 'goods', showTip: false },
-        { label: '规格', model: 'spec', showTip: false },
-        { label: '退款时间', model: 'end_time' },
-        { label: '退款金额', model: 'money' },
+      // 账户流水
+      list: [],
+      // 来源列表
+      sourceList: [],
+      fields: [
+        {
+          label: '来源',
+          model: 'source',
+          format: (i) => {
+            let data = this.sourceList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '净金额', model: 'receipts' },
+        { label: '总金额', model: 'total' },
+        { label: '抽成比例(%)', model: 'cut' },
+        { label: '时间', model: 'time' },
       ],
-      // 多选值
-      selected: [],
+      canGet: 0,
+      total: 0,
     };
   },
   async created() {
-    await this.search();
     await this.searchOther();
+    await this.search();
   },
   methods: {
-    ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
-    ...outBill({ outQuery: 'query', outCreate: 'create' }),
+    ...mapActions(['query', 'fetch', 'create', 'update', 'delete', 'bill']),
+    ...dictData({ dictQuery: 'query' }),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let condition = _.cloneDeep(this.searchForm);
-      if (condition.buy_time) {
-        condition[`start`] = _.head(condition.buy_time);
-        condition[`end`] = _.last(condition.buy_time);
-        delete condition.buy_time;
-        let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
-        if (this.$checkRes(res)) {
-          const orderList = res.data.orderList.map((i) => ({ ...i, key: `${i.no}-${i.spec_id}` }));
-          this.$set(this, 'info', res.data);
-          this.$set(this, 'afterSaleList', res.data.afterSaleList);
-          this.$set(this, 'orderList', res.data.orderList);
-        }
-      }
-    },
-    toClose() {
-      this.searchForm = {};
-      this.search();
-    },
-    // 导出清单
-    toFile() {
-      const workbook = new ExcelJS.Workbook();
-      let orderList = this.orderList;
-      const worksheet_one = workbook.addWorksheet('订单');
-      let data_one = [['订单号', '订单类型', '支付时间', '商品', '规格', '购买数量', '单价', '优惠金额', '总价']];
-      for (const p1 of orderList) {
-        let p2 = [[p1.no, p1.type, p1.pay_time, p1.goods, p1.spec, p1.buy_num, p1.price, p1.discount, p1.total]];
-        data_one.push(...p2);
-      }
-      for (const val of data_one) {
-        worksheet_one.addRow(val);
+      let arr = await this.bill(this.user.shop.id);
+      if (this.$checkRes(arr)) {
+        this.$set(this, `info`, arr.data);
       }
-      let afterSaleList = this.afterSaleList;
-      const worksheet_two = workbook.addWorksheet('售后单');
-      let data_two = [['订单号', '商品', '规格', '退款时间', '退款金额']];
-      for (const p1 of afterSaleList) {
-        let p2 = [[p1.no, p1.goods, p1.spec, p1.end_time, p1.money]];
-        data_two.push(...p2);
+      let res = await this.query({ skip, limit, ...info, shop: this.user.shop._id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
       }
-      for (const val of data_two) {
-        worksheet_two.addRow(val);
+    },
+    toCash() {
+      this.$set(this, `canGet`, this.info.canGet);
+      if (this.info.canGet > 0) {
+        this.$set(this, `view`, 'info');
+      } else {
+        this.$message({ type: `warning`, message: `您没有可提现金额` });
       }
-      worksheet_one.columns.forEach(function (column, i) {
-        column.width = 20;
-      });
-      worksheet_two.columns.forEach(function (column, i) {
-        column.width = 20;
-      });
-      workbook.xlsx.writeBuffer().then((buffer) => {
-        FileSaver.saveAs(
-          new Blob([buffer], {
-            type: 'application/octet-stream',
-          }),
-          `对账单.xlsx`
-        );
-      });
-      this.$confirm('是否确认对账?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      }).then(async () => {
-        let order = [];
-        for (const p1 of this.orderList) {
-          order.push(p1._id);
-        }
-        let afterSale = [];
-        for (const p1 of this.afterSaleList) {
-          afterSale.push(p1._id);
-        }
-        let res;
-        res = await this.outCreate({ order, afterSale });
-        if (this.$checkRes(res)) this.$message({ type: `success`, message: `对账成功` });
-      });
+    },
+    toRecord() {
+      this.$set(this, `view`, 'record');
+    },
+    // 执行返回
+    toBack() {
+      this.view = 'list';
     },
     // 查询其他信息
-    async searchOther() {},
+    async searchOther() {
+      let res = await this.dictQuery({ code: 'cashBack_source' });
+      if (this.$checkRes(res)) this.$set(this, `sourceList`, res.data);
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -168,13 +126,27 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.main {
+  text-align: center;
+}
 .one {
   margin: 0 0 10px 0;
+  p {
+    font-size: 24px;
+    font-weight: 700;
+    span {
+      color: red;
+    }
+  }
 }
 .two {
   span {
     color: red;
   }
+  .sp1 {
+    font-size: 18px;
+    font-weight: 500;
+  }
 }
 .title {
   text-align: center;

+ 105 - 0
src/views/selfShop/bill/record.vue

@@ -0,0 +1,105 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" style="margin: 0 0 10px 0">
+          <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+        </el-col>
+        <el-col :span="24" class="four">
+          <data-table :fields="fields" @query="search" :data="list" :total="total"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('shopCashOut');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+export default {
+  name: 'card-1',
+  props: {},
+  components: {},
+  data: function () {
+    const that = this;
+    return {
+      list: [],
+      total: 0,
+      fields: [
+        { label: '申请店铺', model: 'shop.name' },
+        { label: '提现金额', model: 'money' },
+        { label: '银行卡号', model: 'card', showTip: false },
+        { label: '银行卡所属', model: 'card_name' },
+        { label: '所属银行', model: 'card_bank' },
+        { label: '申请时间', model: 'apply_time' },
+        {
+          label: '审核状态',
+          model: 'status',
+          format: (i) => {
+            let data = this.statusList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+        { label: '审核处理人', model: 'deal_person.name' },
+        { label: '审核时间', model: 'exam_time' },
+      ],
+      statusList: [],
+    };
+  },
+  async created() {
+    await this.search();
+    await this.searchOther();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+      let condition = _.cloneDeep(this.searchForm);
+      info.shop = this.user.shop._id;
+      let res = await this.query({ skip, limit, ...condition, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 提现审核状态
+      res = await this.dictQuery({ code: 'withdrawal_exam_status' });
+      if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.one {
+  margin: 0 0 10px 0;
+}
+.two {
+  margin: 0 0 10px 0;
+}
+</style>

+ 43 - 9
src/views/selfShop/goods/index.vue

@@ -9,7 +9,7 @@
           element-loading-text="拼命加载中"
           element-loading-spinner="el-icon-loading"
         >
-          <data-search :fields="searchFields" v-model="searchInfo" @query="search">
+          <data-search :fields="searchFields" v-model="searchInfo" @query="toSearch">
             <template #status>
               <el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
             </template>
@@ -38,13 +38,24 @@
             @delete="toDelete"
             @spec="toSpec"
             @copy="toCopy"
-          ></data-table> </el-col
-      ></el-row>
+          >
+            <template #source="{ row }">
+              <span style="color: blue" @click="toUrl(row.url)">
+                {{ row.source }}
+              </span>
+            </template>
+          </data-table>
+        </el-col>
+      </el-row>
     </span>
     <el-row v-if="view === 'info'">
       <el-col :span="24" style="margin: 0 0 10px 0">
-        <el-col :span="2"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
-        <el-col :span="2"><el-button type="primary" size="mini" @click="toSave(form)">保存</el-button></el-col>
+        <el-col :span="2">
+          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+        </el-col>
+        <el-col :span="2">
+          <el-button type="primary" size="mini" @click="toSave(form)">保存</el-button>
+        </el-col>
       </el-col>
       <el-col :span="24">
         <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
@@ -100,6 +111,7 @@ const { mapActions: goods } = createNamespacedHelpers('goods');
 const { mapActions: goodsTags } = createNamespacedHelpers('goodsTags');
 const { mapActions: dictData } = createNamespacedHelpers('dictData');
 const { mapActions: actTags } = createNamespacedHelpers('actTags');
+
 export default {
   name: 'index',
   props: {},
@@ -116,6 +128,7 @@ export default {
         { label: '商品分类', model: 'tags', format: (i) => this.getTags(i) },
         { label: '活动标签', model: 'act_tags', format: (i) => this.getAct_tags(i) },
         { label: '商品状态', model: 'status', format: (i) => this.getStatus(i) },
+        { label: '供应商', model: 'source', custom: true },
         { label: '排序', model: 'sort' },
       ],
       opera: [
@@ -132,6 +145,7 @@ export default {
         { label: '规格名称', model: 'spec_name' },
         { label: '商品状态', model: 'status', type: 'select' },
         { label: '商品分类', model: 'tags', custom: true },
+        { label: '供应商', model: 'source' },
       ],
       searchInfo: {},
       list: [],
@@ -167,18 +181,32 @@ export default {
       statusList: [],
       // 返现金额类型
       typeList: [{ label: '固定金额' }, { label: '百分比' }],
+      // 查询条件
+      searchQuery: {},
     };
   },
   created() {
     this.searchOthers();
-    this.search();
+    let route = JSON.parse(sessionStorage.getItem(this.$route.path));
+    if (route) {
+      this.search(route);
+      this.$nextTick(() => {
+        this.$refs.dataTable.setPage(route);
+      });
+    } else this.search();
   },
+
   methods: {
     ...dictData({ getDict: 'query' }),
     ...actTags({ actQuery: 'query' }),
     ...goodsTags(['tree']),
     ...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
     ...methodsUtil,
+    toSearch() {
+      this.$refs.dataTable.resetPage();
+      let res = this.$refs.dataTable.getPageConfig();
+      this.search(res);
+    },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...others } = {}) {
       let query = { skip, limit, ...others, shop: this.user.shop.id };
@@ -187,9 +215,15 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
+        this.$set(this, `searchQuery`, query);
+        sessionStorage.removeItem(this.$route.path);
       }
       this.loadings = false;
     },
+    toUrl(url) {
+      if (url) window.open(url, '_blank');
+      else this.$message.error('该商品还未添加来源网址,无法跳转');
+    },
     // 去编辑
     async toEdit({ data }) {
       const res = await this.fetch(data._id);
@@ -221,7 +255,6 @@ export default {
         if (this.$checkRes(res)) {
           this.$message({ type: `success`, message: `复制成功` });
           this.toBack();
-          this.search();
         }
       });
     },
@@ -243,13 +276,13 @@ export default {
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `维护信息成功` });
         this.toBack();
-        this.search();
       }
     },
     // 执行返回
     toBack() {
       this.form = {};
       this.view = 'list';
+      this.search(this.searchQuery);
     },
     // 上架
     async toPuton({ data }) {
@@ -263,11 +296,12 @@ export default {
         let res;
         if (data._id) res = await this.update(data);
         if (this.$checkRes(res)) this.$message({ type: `success`, message: `修改成功` });
-        this.search();
+        this.search(this.searchQuery);
       });
     },
     // 库存管理
     toSpec({ data }) {
+      sessionStorage.setItem(this.$route.path, JSON.stringify(this.searchQuery));
       this.$router.push({ path: `/selfShop/spec/${data._id}` });
     },
     // 查询其他信息

+ 4 - 25
src/views/selfShop/goods/spec.vue

@@ -67,18 +67,8 @@ export default {
         { label: '实际销售价格', model: 'sell_money' },
         { label: '划掉销售价格', model: 'flow_money' },
         { label: '运费', model: 'freight' },
+        { label: '团长价格', model: 'leader_price' },
         { label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
-        {
-          label: '是否可以团购',
-          model: 'can_group',
-          format: (i) => {
-            let data = this.tfList.find((f) => f.value == i);
-            if (data) return data.label;
-            else return '暂无';
-          },
-        },
-        { label: '团购金额', model: 'group_config.money' },
-        { label: '开团人数', model: 'group_config.need_person' },
         { label: '排序', model: 'sort' },
       ],
       opera: [
@@ -104,9 +94,7 @@ export default {
         { label: '排序', model: 'sort', type: 'number' },
         { label: '运费', model: 'freight', type: 'number' },
         { label: '状态', model: 'status', type: 'select' },
-        { label: '是否可以团购', model: 'can_group', type: 'select' },
-        { label: '团购金额', model: 'money', type: 'number' },
-        { label: '开团人数', model: 'need_person', type: 'number' },
+        { label: '团长价格', model: 'leader_price', type: 'number' },
         { label: '图片', model: 'file', type: 'upload', url: '/files/point/goodsSpec/upload' },
       ],
       rules: {
@@ -136,11 +124,10 @@ export default {
     ...dictData({ getDict: 'query' }),
     ...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
     ...goods({ goodsFetch: 'fetch' }),
-
     ...methodUtil,
     // 添加自定义
     initAddData() {
-      const obj = { goods: this.goods, status: '0', can_group: '1', freight: 0 };
+      const obj = { goods: this.goods, status: '0', freight: 0 };
       this.$set(this, 'form', obj);
     },
     async toData(row) {
@@ -172,10 +159,6 @@ export default {
     },
     // 保存
     async toSave({ data }) {
-      let group_config = {};
-      group_config.money = data.money;
-      group_config.need_person = data.need_person;
-      data.group_config = group_config;
       let res;
       if (data.id) res = await this.update(data);
       else res = await this.create(data);
@@ -189,11 +172,7 @@ export default {
     async toEdit({ data }) {
       const res = await this.fetch(data._id);
       if (this.$checkRes(res)) {
-        let data = res.data;
-        const group_config = _.get(data, 'group_config', {});
-        data = { ...data, ...group_config };
-        delete data.group_config;
-        this.$set(this, `form`, data);
+        this.$set(this, `form`, res.data);
         this.view = 'info';
       } else this.$message.error('未找到指定数据');
     },

+ 5 - 0
src/views/selfShop/info/index.vue

@@ -4,6 +4,10 @@
       <template #status>
         <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
       </template>
+      <template #cut>
+        <el-col :span="3"> <el-input v-model="form.cut" readonly type="number" placeholder="请输入抽成比例"></el-input></el-col>
+        <el-col :span="2" style="color: red; margin: 0 0 0 10px">%</el-col>
+      </template>
     </data-form>
   </div>
 </template>
@@ -25,6 +29,7 @@ export default {
         { label: '地址', model: 'address' },
         { label: '证件照片', model: 'file', type: 'upload', url: '/files/point/shopFile/upload' },
         { label: '店铺二维码', model: 'qrcode', type: 'upload', url: '/files/point/shopFile/upload' },
+        { label: '抽成比例', model: 'cut', custom: true },
       ],
       rules: {},
       form: {},

+ 5 - 0
vue.config.js

@@ -30,6 +30,11 @@ module.exports = {
         changeOrigin: true,
         ws: false,
       },
+      '/point/group/v1/api': {
+        target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
+        changeOrigin: true,
+        ws: false,
+      },
       '/dev/point/group/v1/api': {
         target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
         changeOrigin: true,