YY 2 gadi atpakaļ
vecāks
revīzija
f617d241f8
2 mainītis faili ar 117 papildinājumiem un 1 dzēšanām
  1. 12 1
      src/views/selfShop/bill/index.vue
  2. 105 0
      src/views/selfShop/bill/record.vue

+ 12 - 1
src/views/selfShop/bill/index.vue

@@ -6,11 +6,17 @@
           <el-col :span="24" class="one">
             <el-col :span="24">
               <p>
-                账户余额:<span>{{ info.total }}</span>
+                账户余额:<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">
@@ -18,6 +24,7 @@
           </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>
@@ -32,6 +39,7 @@ export default {
   props: {},
   components: {
     detail: () => import('./detail.vue'),
+    record: () => import('./record.vue'),
   },
   data: function () {
     return {
@@ -88,6 +96,9 @@ export default {
         this.$message({ type: `warning`, message: `您没有可提现金额` });
       }
     },
+    toRecord() {
+      this.$set(this, `view`, 'record');
+    },
     // 执行返回
     toBack() {
       this.view = 'list';

+ 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>