Browse Source

店铺流水,提现,审核

YY 2 years ago
parent
commit
8779128723

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

@@ -298,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: `申请售后成功` });

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

@@ -108,6 +108,12 @@ export const adminMenu = [
         name: '提现审核',
         index: '4-3',
       },
+      {
+        icon: 'icon-rencai',
+        path: '/platfinance/shopCash',
+        name: '店铺提现审核',
+        index: '4-3',
+      },
     ],
   },
   {

+ 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'),
   },
 ];

+ 4 - 2
src/store/index.js

@@ -11,8 +11,9 @@ 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';
@@ -100,7 +101,7 @@ export default new Vuex.Store({
     platformAct,
     goodsJoinAct,
     goodsRate,
-    getBill,
+    shopInBill,
     outBill,
     admins,
     cashOut,
@@ -115,5 +116,6 @@ export default new Vuex.Store({
     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,
+};

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

@@ -0,0 +1,167 @@
+<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' },
+        // { label: '删除', method: 'delete', confirm: true, type: 'danger' },
+      ],
+      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 {};

+ 15 - 5
src/views/platmanag/storeAcc/index.vue

@@ -18,13 +18,14 @@
           :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>
@@ -39,6 +40,7 @@
         </el-col>
       </el-row>
     </template>
+    <shopInBill v-if="view === 'bill'" :id="id" @toBack="toBackList"></shopInBill>
   </div>
 </template>
 
@@ -51,7 +53,9 @@ const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: {
+    shopInBill: () => import('./shopInBill.vue'),
+  },
   data: function () {
     return {
       loadings: true,
@@ -77,6 +81,7 @@ export default {
       ],
       opera: [
         { label: '修改', method: 'edit' },
+        { label: '流水', method: 'cash' },
         { label: '账号管理', method: 'manage' },
         { label: '删除', method: 'del', confirm: true, type: 'danger' },
       ],
@@ -101,6 +106,7 @@ export default {
       form: {},
       // 店铺状态列表
       statusList: [],
+      id: '',
     };
   },
   created() {
@@ -125,6 +131,10 @@ export default {
       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 } });
@@ -169,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>

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

@@ -0,0 +1,111 @@
+<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" @dataChange="dataChange">
+            <template #money>
+              <el-input v-model="form.money" type="number" placeholder="请输入提现金额"></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;
+    },
+
+    dataChange({ model, value }) {
+      if (model == 'money') {
+        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>

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

@@ -2,154 +2,101 @@
   <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">
+              <el-button type="success" @click="toCash()"> 提现 </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>
       </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'),
+  },
   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' },
+      // 账户流水
+      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' },
       ],
-      afterSalefields: [
-        { label: '订单号', model: 'no', showTip: false },
-        { label: '商品', model: 'goods', showTip: false },
-        { label: '规格', model: 'spec', showTip: false },
-        { label: '退款时间', model: 'end_time' },
-        { label: '退款金额', model: 'money' },
-      ],
-      // 多选值
-      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);
+      let arr = await this.bill(this.user.shop.id);
+      if (this.$checkRes(arr)) {
+        this.$set(this, `info`, arr.data);
       }
-      for (const val of data_one) {
-        worksheet_one.addRow(val);
+      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);
       }
-      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);
-      }
-      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: `对账成功` });
-      });
+    },
+    // 执行返回
+    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 +115,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;