Selaa lähdekoodia

Merge branch 'update_bills' of lianghanqiang/ldt-manger-web into dev

July 4 vuotta sitten
vanhempi
commit
13636959de

+ 13 - 0
src/api/ldt_bills/balancebills.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/balancebills/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const censusPrice = ( params) => {
   return request({
     url: '/api/ldt_bills/balancebills/censusPrice',

+ 13 - 0
src/api/ldt_bills/bills.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/bills/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const censusPrice = ( params) => {
   return request({
     url: '/api/ldt_bills/bills/censusPrice',

+ 13 - 0
src/api/ldt_bills/platformbills.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/platformbills/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const censusPrice = ( params) => {
   return request({
     url: '/api/ldt_bills/platformbills/censusPrice',

+ 13 - 0
src/api/ldt_bills/pointbills.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/pointbills/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/ldt_bills/pointbills/detail',

+ 13 - 0
src/api/ldt_bills/transferrec.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/transferrec/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/ldt_bills/transferrec/detail',

+ 13 - 0
src/api/ldt_bills/withdrawrec.js

@@ -12,6 +12,19 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const generateList = (current, size, params) => {
+  return request({
+    url: '/api/ldt_bills/withdrawrec/generateList',
+    method: 'post',
+    responseType:"blob",
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/ldt_bills/withdrawrec/detail',

+ 36 - 0
src/util/fileUtil.js

@@ -0,0 +1,36 @@
+import FileUtil from './fileUtil'
+
+export default {
+  /**
+   * 创建下载
+   * @param data 数据
+   * @param options 选项
+   * @returns {string}
+   */
+  createDownloadUrl(data, options) {
+    let blob = new Blob([data], options);
+    return FileUtil.createObjectURL(blob);
+  },
+  /**
+   * 创建下载链接
+   * @param obj
+   * @returns {string}
+   */
+  createObjectURL(obj){
+    return window.URL.createObjectURL(obj);
+  },
+  /**
+   * 下载文件
+   * @param data
+   * @param options
+   * @param filename
+   */
+  download(data, options, filename){
+    const url = FileUtil.createDownloadUrl(data,options);
+    const a = document.createElement("a");
+    a.target = "_black";
+    a.download = filename;
+    a.href = url;
+    a.click();
+  }
+}

+ 220 - 47
src/views/ldt_bills/balancebills.vue

@@ -18,40 +18,73 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="payStatusSearch">
+        <el-radio-group v-model="query.payStatus" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='payStatus';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="typeSearch">
+        <el-radio-group v-model="query.type" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='type';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
       <template slot="menuLeft">
-        <span type="info" style="font-family: '宋体'">
-          用户付款总金额:
-          <span style="background-color: #d50e71;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(parseFloat(censusPrice.PAY_CONSUMER!==undefined?censusPrice.PAY_CONSUMER:0)  + parseFloat(censusPrice.WECHAT_PAY!==undefined?censusPrice.WECHAT_PAY:0)).toFixed(2)}}
-          </span>
-        </span>
-        <span style="font-family: '宋体'">
-          商场交易总金额:
-          <span style="background-color: #8c70b6;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.MALL_SEND!==undefined?censusPrice.MALL_SEND:0).toFixed(2)}}
-          </span>
-        </span>&nbsp;
-        <span type="warning" style="font-family: '宋体'">
-          商户交易总金额:
-          <span style="background-color: #a9c985;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.SHOP_SEND!==undefined?censusPrice.SHOP_SEND:0).toFixed(2)}}
-          </span>
-        </span>&nbsp;
+        <IconFontComp :option="censusOption"></IconFontComp>
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, censusPrice, add, update, remove} from "@/api/ldt_bills/balancebills";
+  import {getList, generateList, getDetail, censusPrice, add, update, remove} from "@/api/ldt_bills/balancebills";
+  import IconFontComp from "./comps/iconfont";
   import {mapGetters} from "vuex";
+  import moment from "moment";
+  import FileUtil from "@/util/fileUtil";
 
   export default {
+    components:{IconFontComp},
     data() {
       return {
         form: {},
-        query: {},
-        censusPrice:{},
+        query: {
+          createTime: -1,
+          createTimeRange: [],
+          type: -1,
+          payStatus: -1,
+        },
         loading: true,
         page: {
           pageSize: 10,
@@ -73,6 +106,9 @@
           editBtn: false,
           viewBtn: true,
           selection: true,
+          searchBtn: false,
+          emptyBtn: false,
+          searchSize: "mini",
           dialogClickModal: false,
           column: [
             {
@@ -115,7 +151,7 @@
             {
               label: "交易方式",
               prop: "title",
-              search: true,
+              search: false,
               rules: [{
                 required: true,
                 message: "请输入交易方式",
@@ -152,10 +188,15 @@
             },
             {
               label: "交易状态",
-              search: true,
               prop: "payStatus",
-              type: "select",
+              search: true,
+              searchslot: true,
+              searchSpan: 24,
+              searchOrder: 3,
               dicData:[{
+                label:"全部",
+                value: -1
+              },{
                 label:"待付款",
                 value:"待付款"
               },{
@@ -176,10 +217,15 @@
             },
             {
               label: "交易类型",
-              search: true,
               prop: "type",
-              type: "select",
+              search: true,
+              searchslot: true,
+              searchSpan: 24,
+              searchOrder: 4,
               dicData:[{
+                label:"全部",
+                value: -1
+              },{
                 label:"用户付款",
                 value:"PAY_CONSUMER"
               },{
@@ -205,13 +251,25 @@
               addDisplay: false,
               editDisplay: false,
               search: true,
-              searchSpan:6,
+              searchSpan: 24,
+              searchOrder: 0,
+              searchslot: true,
               rules: [{
                 required: true,
                 message: "请输入通知时间",
                 trigger: "blur"
               }]
             },
+            {
+              label: "关键字",
+              prop: "key",
+              hide: true,
+              search: true,
+              searchslot: true,
+              searchOrder: 5,
+              searchSpan: 24,
+              editDisplay: false,
+            },
             {
               label: "交易说明",
               prop: "billDesc",
@@ -223,7 +281,36 @@
             }
           ]
         },
-        data: []
+        data: [],
+        censusOption: {
+          span: ()=>24/this.censusOption.data.length,
+          data: [
+            {
+              title: '用户付款',
+              prop: ["PAY_CONSUMER","WECHAT_PAY"],
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-s-custom',
+              color: '0, 167, 208',
+            },
+            {
+              title: '商场交易',
+              prop: "MALL_SEND",
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-paperclip',
+              color: '27, 201, 142',
+            },
+            {
+              title: '商户交易',
+              prop: "SHOP_SEND",
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-s-shop',
+              color: '230, 71, 88',
+            }
+          ]
+        }
       };
     },
     computed: {
@@ -244,6 +331,60 @@
         return ids.join(",");
       }
     },
+    watch: {
+      //监听创建时间变化
+      "query.createTime": {
+        handler(value) {
+          //防止重复调用
+          if (value !== undefined) {
+            this.query.createTimeRange = [];
+            switch (value) {
+              case -1:
+                this.query.createTimeStart = undefined;
+                this.query.createTimeEnd = undefined;
+                break;
+              case 1: //今天
+                this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 2: //昨天
+                this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+                break;
+              case 3: //近7天
+                this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 4: //近30天
+                this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 5: //本月
+                this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              case 6: //本年
+                this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              default:
+                break;
+            }
+          }
+        }
+      },
+      //监听创建时间变化
+      "query.createTimeRange": {
+        handler(value) {
+          //防止重复调用
+          if (value.length === 2) {
+            this.query.createTimeStart = value[0];
+            this.query.createTimeEnd = value[1];
+            this.query.createTime = undefined;
+          }
+        }
+      },
+    },
     created() {
       this.getCensusPrice();
     },
@@ -348,21 +489,16 @@
         this.onLoad(this.page, this.query);
       },
       onLoad(page, params = {}) {
-        const {createTime} = this.query;
-        let values = {
-          ...params,
-        };
-        if (createTime) {
-          values = {
-            ...params,
-            createTimeStart: createTime[0],
-            createTimeEnd: createTime[1],
-            ...this.query
-          };
-          values.createTime = null;
+        let values = {};
+        for (const item in params) {
+          if (params[item] !== undefined && params[item] !== -1) {
+            values[item] = params[item];
+          }
         }
+        values.createTime = null;
+        values.createTimeRange = null;
         this.loading = true;
-        getList(page.currentPage, page.pageSize, Object.assign(params, values)).then(res => {
+        getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
@@ -370,13 +506,50 @@
           this.selectionClear();
         });
       },
-      getCensusPrice(){
-        censusPrice().then(res=>{
-          res.data.data.forEach(ele=>{
-            this.censusPrice[ele.type] = ele.price;
-          })
+      getCensusPrice() {
+        censusPrice().then(res => {
+          res.data.data.forEach(ele => {
+            const find = this.censusOption.data.find(ele2=>{
+              return ele2.prop.indexOf(ele.type)!==-1;
+            });
+            if(find && ele.price){
+              find.count = find.count + parseFloat(ele.price);
+            }
+          });
         });
-      }
+      },
+      //搜索状态改变
+      searchStateChange() {
+        setTimeout(() => {
+          this.onLoad(this.page, this.query);
+        }, 100);
+      },
+      //生成列表并到处
+      generateListAndDownload() {
+        const newQuery = {};
+        for (const item in this.query) {
+          if (this.query[item] !== undefined && this.query[item] !== -1) {
+            newQuery[item] = this.query[item];
+          }
+        }
+        newQuery.createTime = null;
+        newQuery.createTimeRange = null;
+        //获取列表键值对
+        newQuery.keyValue = {};
+        this.option.column.forEach(ele=>{
+          newQuery.keyValue[ele.prop] = ele.label;
+        });
+        newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+        this.loading = true;
+        //生成列表
+        generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+          FileUtil.download(res.data,{
+            type: "application/vnd.ms-excel"
+          },`生成余额账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+        }).finally(()=>{
+          this.loading = false;
+        });
+      },
     }
   };
 </script>

+ 639 - 462
src/views/ldt_bills/bills.vue

@@ -18,499 +18,676 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="typeSearch">
+        <el-radio-group v-model="query.type" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='type';
+          }).dicData" :key="index">{{ select.label }}
+          </el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="payStatusSearch">
+        <el-radio-group v-model="query.payStatus" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='payStatus';
+          }).dicData" :key="index">{{ select.label }}
+          </el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
       <template slot="menuLeft">
-        <span style="font-family: '宋体'">
-          用户付款总额:
-          <span style="background-color: #8c70b6;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(parseFloat(censusPrice.USER_PAY!==undefined?censusPrice.USER_PAY:0) + parseFloat(censusPrice.WECHAT_PAY!==undefined?censusPrice.WECHAT_PAY:0)).toFixed(2)}}
-          </span>
-        </span>&nbsp;
-        <span type="warning" style="font-family: '宋体'">
-          代理充值总额:
-          <span style="background-color: #a9c985;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.AGENT_CHARGE!==undefined?censusPrice.AGENT_CHARGE:0).toFixed(2)}}
-          </span>
-        </span>&nbsp;
-        <span type="info" style="font-family: '宋体'">
-          商场充值总额:
-          <span style="background-color: #d50e71;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.MALL_RECHARGE!==undefined?censusPrice.MALL_RECHARGE:0).toFixed(2)}}
-          </span>
-        </span>
+        <IconFontComp :option="censusOption"></IconFontComp>
       </template>
-<!--      <template slot-scope="scope" slot="dataInfo">-->
-<!--        <div v-if="scope.row.payStatus==='付款成功'">-->
-<!--          优惠金额:-->
-<!--          <div-->
-<!--            style="background-color: #0baaee;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ; display:inline;">-->
-<!--            {{parseFloat(scope.row.totalPrice-scope.row.price).toFixed(2)}}-->
-<!--          </div>-->
-<!--        </div>-->
-<!--      </template>-->
+      <!--      <template slot-scope="scope" slot="dataInfo">-->
+      <!--        <div v-if="scope.row.payStatus==='付款成功'">-->
+      <!--          优惠金额:-->
+      <!--          <div-->
+      <!--            style="background-color: #0baaee;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ; display:inline;">-->
+      <!--            {{parseFloat(scope.row.totalPrice-scope.row.price).toFixed(2)}}-->
+      <!--          </div>-->
+      <!--        </div>-->
+      <!--      </template>-->
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, censusPrice, getDetail, add, update, remove} from "@/api/ldt_bills/bills";
-  import {mapGetters} from "vuex";
+import {getList, censusPrice, getDetail, add, update, remove, generateList} from "@/api/ldt_bills/bills";
+import IconFontComp from "./comps/iconfont";
+import {mapGetters} from "vuex";
+import moment from "moment";
+import FileUtil from "@/util/fileUtil";
 
-  export default {
-    data() {
+export default {
+  components:{IconFontComp},
+  data() {
+    return {
+      form: {},
+      query: {
+        createTime: -1,
+        createTimeRange: [],
+        payStatus: -1,
+        type: -1,
+      },
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      selectionList: [],
+      option: {
+        height: 'auto',
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        addBtn: false,
+        delBtn: false,
+        editBtn: false,
+        viewBtn: true,
+        selection: true,
+        searchBtn: false,
+        emptyBtn: false,
+        searchSize: "mini",
+        dialogClickModal: false,
+        column: [
+          {
+            label: "付款方",
+            prop: "payId",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入付款方",
+              trigger: "blur"
+            }]
+          },
+          /*{
+            prop: "dataInfo",
+            slot: true,
+            width: 250,
+            display: false,
+            label: "数据统计"
+          },*/
+          {
+            label: "付款方",
+            prop: "payerName",
+            rules: [{
+              required: true,
+              message: "请输入付款方",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "收款方",
+            hide: true,
+            prop: "receiveId",
+            rules: [{
+              required: true,
+              message: "请输入收款方",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "收款方",
+            prop: "receiverName",
+            rules: [{
+              required: true,
+              message: "请输入收款方",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "金额原价",
+            prop: "cost",
+            rules: [{
+              required: true,
+              message: "请输入金额原价",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "折扣",
+            prop: "discount",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入折扣",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "实付金额",
+            prop: "price",
+            rules: [{
+              required: true,
+              message: "请输入实付金额",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "总金额",
+            prop: "totalPrice",
+            rules: [{
+              required: true,
+              message: "请输入实付金额",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "交易类型",
+            prop: "type",
+            search: true,
+            searchSpan: 24,
+            searchslot: true,
+            searchOrder: 1,
+            dicData: [{
+              label: "全部",
+              value: -1
+            }, {
+              label: "用户付款",
+              value: "USER_PAY"
+            }, {
+              label: "代理充值",
+              value: "AGENT_CHARGE"
+            }, {
+              label: "微信充值",
+              value: "WECHAT_PAY"
+            }, {
+              label: "商家充值",
+              value: "MALL_RECHARGE"
+            }],
+            rules: [{
+              required: true,
+              message: "请输入交易类型(用户付款,代理充值,商场充值)",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "付款方式",
+            prop: "payway",
+            rules: [{
+              required: true,
+              message: "请输入付款方式",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "付款插件",
+            prop: "payPlugin",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入付款插件",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "渠道积分id",
+            prop: "channelId",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入渠道积分id",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "支付状态",
+            prop: "payStatus",
+            type: "select",
+            search: true,
+            searchSpan: 24,
+            searchslot: true,
+            searchOrder: 2,
+            dicData: [{
+              label: "全部",
+              value: -1
+            }, {
+              label: "待付款",
+              value: "待付款"
+            }, {
+              label: "付款成功",
+              value: "付款成功"
+            }, {
+              label: "已完结",
+              value: "已完结"
+            }, {
+              label: "取消付款",
+              value: "取消付款"
+            }],
+            rules: [{
+              required: true,
+              message: "请输入待付款,付款成功,取消付款",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "订单标题",
+            prop: "title",
+            rules: [{
+              required: true,
+              message: "请输入订单标题",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "订单描述",
+            prop: "billDesc",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入订单描述",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "订单超时时间",
+            prop: "exTime",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入订单超时时间",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "appid",
+            prop: "appid",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入appid",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "openid",
+            prop: "openid",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入openid",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "消耗积分",
+            prop: "pointNum",
+            rules: [{
+              required: true,
+              message: "请输入消耗积分",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "消耗余额",
+            prop: "balanceNum",
+            rules: [{
+              required: true,
+              message: "请输入消耗余额",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "第三方平台订单号",
+            prop: "thirdOrderId",
+            hide: true,
+            rules: [{
+              required: true,
+              message: "请输入第三方平台订单号",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "收取的服务费",
+            prop: "fee",
+            rules: [{
+              required: true,
+              message: "请输入收取的服务费",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "积分交易费",
+            prop: "pointFee",
+            rules: [{
+              required: true,
+              message: "请输入积分交易费",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "创建时间",
+            prop: "createTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            searchRange: true,
+            addDisplay: false,
+            editDisplay: false,
+            search: true,
+            searchSpan: 24,
+            searchOrder: 0,
+            searchslot: true,
+            rules: [{
+              required: true,
+              message: "请输入通知时间",
+              trigger: "blur"
+            }]
+          },
+          {
+            label: "关键字",
+            prop: "key",
+            hide: true,
+            search: true,
+            searchslot: true,
+            searchOrder: 5,
+            searchSpan: 24,
+            editDisplay: false,
+          },
+        ]
+      },
+      data: [],
+      censusOption: {
+        span: ()=>24/this.censusOption.data.length,
+        data: [
+          {
+            title: '用户付款',
+            prop: ["USER_PAY","WECHAT_PAY"],
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-custom',
+            color: '0, 167, 208',
+          },
+          {
+            title: '代理充值',
+            prop: "AGENT_CHARGE",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-paperclip',
+            color: '27, 201, 142',
+          },
+          {
+            title: '商场充值',
+            prop: "MALL_RECHARGE",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-shop',
+            color: '230, 71, 88',
+          }
+        ]
+      }
+    };
+  },
+  computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
       return {
-        form: {},
-        query: {},
-        loading: true,
-        censusPrice:{},
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
-        },
-        selectionList: [],
-        option: {
-          height:'auto',
-          calcHeight: 30,
-          tip: false,
-          searchShow: true,
-          searchMenuSpan: 6,
-          border: true,
-          index: true,
-          addBtn:false,
-          delBtn:false,
-          editBtn:false,
-          viewBtn: true,
-          selection: true,
-          dialogClickModal: false,
-          column: [
-            {
-              label: "付款方",
-              prop: "payId",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入付款方",
-                trigger: "blur"
-              }]
-            },
-            /*{
-              prop: "dataInfo",
-              slot: true,
-              width: 250,
-              display: false,
-              label: "数据统计"
-            },*/
-            {
-              label: "付款方",
-              prop: "payerName",
-              rules: [{
-                required: true,
-                message: "请输入付款方",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "收款方",
-              hide: true,
-              prop: "receiveId",
-              rules: [{
-                required: true,
-                message: "请输入收款方",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "收款方",
-              prop: "receiverName",
-              rules: [{
-                required: true,
-                message: "请输入收款方",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "金额原价",
-              prop: "cost",
-              rules: [{
-                required: true,
-                message: "请输入金额原价",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "折扣",
-              prop: "discount",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入折扣",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "实付金额",
-              prop: "price",
-              rules: [{
-                required: true,
-                message: "请输入实付金额",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "总金额",
-              prop: "totalPrice",
-              rules: [{
-                required: true,
-                message: "请输入实付金额",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "交易类型",
-              search: true,
-              prop: "type",
-              type: "select",
-              dicData:[{
-                label:"用户付款",
-                value:"USER_PAY"
-              },{
-                label:"代理充值",
-                value:"AGENT_CHARGE"
-              },{
-                label:"微信充值",
-                value:"WECHAT_PAY"
-              },{
-                label:"商家充值",
-                value:"MALL_RECHARGE"
-              }],
-              rules: [{
-                required: true,
-                message: "请输入交易类型(用户付款,代理充值,商场充值)",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "付款方式",
-              prop: "payway",
-              rules: [{
-                required: true,
-                message: "请输入付款方式",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "付款插件",
-              prop: "payPlugin",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入付款插件",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "渠道积分id",
-              prop: "channelId",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入渠道积分id",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "支付状态",
-              search: true,
-              prop: "payStatus",
-              type: "select",
-              dicData:[{
-                label:"待付款",
-                value:"待付款"
-              },{
-                label:"付款成功",
-                value:"付款成功"
-              },{
-                label:"已完结",
-                value:"已完结"
-              },{
-                label:"取消付款",
-                value:"取消付款"
-              }],
-              rules: [{
-                required: true,
-                message: "请输入待付款,付款成功,取消付款",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "订单标题",
-              prop: "title",
-              rules: [{
-                required: true,
-                message: "请输入订单标题",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "订单描述",
-              prop: "billDesc",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入订单描述",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "订单超时时间",
-              prop: "exTime",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入订单超时时间",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "appid",
-              prop: "appid",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入appid",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "openid",
-              prop: "openid",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入openid",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "消耗积分",
-              prop: "pointNum",
-              rules: [{
-                required: true,
-                message: "请输入消耗积分",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "消耗余额",
-              prop: "balanceNum",
-              rules: [{
-                required: true,
-                message: "请输入消耗余额",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "第三方平台订单号",
-              prop: "thirdOrderId",
-              hide: true,
-              rules: [{
-                required: true,
-                message: "请输入第三方平台订单号",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "收取的服务费",
-              prop: "fee",
-              rules: [{
-                required: true,
-                message: "请输入收取的服务费",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "积分交易费",
-              prop: "pointFee",
-              rules: [{
-                required: true,
-                message: "请输入积分交易费",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "创建时间",
-              prop: "createTime",
-              type: "datetime",
-              format: "yyyy-MM-dd hh:mm:ss",
-              valueFormat: "yyyy-MM-dd hh:mm:ss",
-              searchRange:true,
-              addDisplay: false,
-              editDisplay: false,
-              search: true,
-              rules: [{
-                required: true,
-                message: "请输入通知时间",
-                trigger: "blur"
-              }]
-            },
-          ]
-        },
-        data: []
+        addBtn: this.vaildData(this.permission.bills_add, false),
+        viewBtn: this.vaildData(this.permission.bills_view, false),
+        delBtn: this.vaildData(this.permission.bills_delete, false),
+        editBtn: this.vaildData(this.permission.bills_edit, false)
       };
     },
-    computed: {
-      ...mapGetters(["permission"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.bills_add, false),
-          viewBtn: this.vaildData(this.permission.bills_view, false),
-          delBtn: this.vaildData(this.permission.bills_delete, false),
-          editBtn: this.vaildData(this.permission.bills_edit, false)
-        };
-      },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
-        });
-        return ids.join(",");
+    ids() {
+      let ids = [];
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    }
+  },
+  watch: {
+    //监听创建时间变化
+    "query.createTime": {
+      handler(value) {
+        //防止重复调用
+        if (value !== undefined) {
+          this.query.createTimeRange = [];
+          switch (value) {
+            case -1:
+              this.query.createTimeStart = undefined;
+              this.query.createTimeEnd = undefined;
+              break;
+            case 1: //今天
+              this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 2: //昨天
+              this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+              break;
+            case 3: //近7天
+              this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 4: //近30天
+              this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 5: //本月
+              this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            case 6: //本年
+              this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            default:
+              break;
+          }
+        }
+      }
+    },
+    //监听创建时间变化
+    "query.createTimeRange": {
+      handler(value) {
+        //防止重复调用
+        if (value.length === 2) {
+          this.query.createTimeStart = value[0];
+          this.query.createTimeEnd = value[1];
+          this.query.createTime = undefined;
+        }
       }
     },
-    created() {
-      this.getCensusPrice();
+  },
+  created() {
+    this.getCensusPrice();
+  },
+  methods: {
+    rowSave(row, done, loading) {
+      add(row).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        loading();
+        window.console.log(error);
+      });
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(() => {
+        this.onLoad(this.page);
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        done();
+      }, error => {
+        loading();
+        console.log(error);
+      });
     },
-    methods: {
-      rowSave(row, done, loading) {
-        add(row).then(() => {
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          done();
-        }, error => {
-          loading();
-          window.console.log(error);
         });
-      },
-      rowUpdate(row, index, done, loading) {
-        update(row).then(() => {
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          done();
-        }, error => {
-          loading();
-          console.log(error);
+          this.$refs.crud.toggleSelection();
         });
-      },
-      rowDel(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then(res => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      let values = {};
+      for (const item in params) {
+        if (params[item] !== undefined && params[item] !== -1) {
+          values[item] = params[item];
         }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
-          });
-      },
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDetail(this.form.id).then(res => {
-            this.form = res.data.data;
+      }
+      values.createTime = null;
+      values.createTimeRange = null;
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, values).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+    getCensusPrice() {
+      censusPrice().then(res => {
+        res.data.data.forEach(ele => {
+          const find = this.censusOption.data.find(ele2=>{
+            return ele2.prop.indexOf(ele.type)!==-1;
           });
-        }
-        done();
-      },
-      searchReset() {
-        this.query = {};
-        this.onLoad(this.page);
-      },
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, params);
-        done();
-      },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      selectionClear() {
-        this.selectionList = [];
-        this.$refs.crud.toggleSelection();
-      },
-      currentChange(currentPage){
-        this.page.currentPage = currentPage;
-      },
-      sizeChange(pageSize){
-        this.page.pageSize = pageSize;
-      },
-      refreshChange() {
+          if(find && ele.price){
+            find.count = find.count + parseFloat(ele.price);
+          }
+        });
+      });
+    },
+    //搜索状态改变
+    searchStateChange() {
+      setTimeout(() => {
         this.onLoad(this.page, this.query);
-      },
-      onLoad(page, params = {}) {
-        const {createTime} = this.query;
-        let values = {
-          ...params,
-        };
-        if (createTime) {
-          values = {
-            ...params,
-            createTimeStart: createTime[0],
-            createTimeEnd: createTime[1],
-            ...this.query
-          };
-          values.createTime = null;
+      }, 100);
+    },
+    //生成列表并到处
+    generateListAndDownload() {
+      const newQuery = {};
+      for (const item in this.query) {
+        if (this.query[item] !== undefined && this.query[item] !== -1) {
+          newQuery[item] = this.query[item];
         }
-        this.loading = true;
-        getList(page.currentPage, page.pageSize, values).then(res => {
-          const data = res.data.data;
-          this.page.total = data.total;
-          this.data = data.records;
-          this.loading = false;
-          this.selectionClear();
-        });
-      },
-      getCensusPrice(){
-        censusPrice().then(res=>{
-          res.data.data.forEach(ele=>{
-            this.censusPrice[ele.type] = ele.price;
-          })
-        });
       }
-    }
-  };
+      newQuery.createTime = null;
+      newQuery.createTimeRange = null;
+      //获取列表键值对
+      newQuery.keyValue = {};
+      this.option.column.forEach(ele => {
+        newQuery.keyValue[ele.prop] = ele.label;
+      });
+      newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+      this.loading = true;
+      //生成列表
+      generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+        FileUtil.download(res.data, {
+          type: "application/vnd.ms-excel"
+        }, `生成付款账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+  }
+};
 </script>
 
 <style>

+ 73 - 0
src/views/ldt_bills/comps/iconfont.vue

@@ -0,0 +1,73 @@
+<template>
+  <el-row style="width: 100%">
+    <el-col :span="option.span" v-for="(data,index) in option.data" :key="index">
+      <div :style="{height: `${height}px`,
+            minWidth:'200px',
+            backgroundColor: 'rgb(245, 247, 249)',
+            borderRadius: '5px',
+            margin: '4px 5px',
+            // boxShadow: '2px 2px 2px 2px rgba(0, 0, 0,0.3)'
+        }">
+        <!-- 图标内容 -->
+        <div :style="{
+            height: '100%',
+            width:'50%',
+            display: 'inline-block',
+            float: 'left'
+         }">
+          <div :style="{
+            width: `${height/3}px`,
+            height: `${height/3}px`,
+            margin: `${height/2 - height/3/2 - height/2/5}px`,
+            lineHeight: `${height/3+height/2/5}px`,
+            boxShadow: `0px 0px 5px 5px rgba(${data.color?data.color:'0,0,0'},0.3)`,
+            textAlign: 'center',
+            border:`${height/2/5}px solid rgb(${data.color?data.color:'0,0,0'})`,
+            borderRadius: '50%',
+            backgroundColor: `rgb(${data.color?data.color:'0,0,0'})`
+          }">
+            <i :class="data.icon" :style="{
+              fontSize: `${height/3}px`,
+              color: 'white',
+            }"></i>
+          </div>
+        </div>
+        <!-- 描述内容 -->
+        <div :style="{
+            height: '100%',
+            width:'50%',
+            display: 'inline-block',
+         }">
+          <h4 :style="{
+            marginTop: `${(height/2-10)/2}px`,
+            marginBottom: '10px',
+          }">{{data.title}}</h4>
+          <p :style="{
+            color:'gary',
+            margin: '10px 0',
+          }">{{data.decimals?parseFloat(data.count).toFixed(2):data.count}}</p>
+        </div>
+      </div>
+    </el-col>
+  </el-row>
+</template>
+
+<script>
+export default {
+  name: "iconfont",
+  props:{
+    option:{
+      type: "Object",
+      default: {}
+    },
+    height:{
+      type:"Number",
+      default: 80
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 203 - 42
src/views/ldt_bills/platformbills.vue

@@ -6,7 +6,6 @@
                :page.sync="page"
                :permission="permissionList"
                :before-open="beforeOpen"
-               :search.sync="query"
                v-model="form"
                ref="crud"
                @row-update="rowUpdate"
@@ -19,39 +18,65 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="typeSearch">
+        <el-radio-group v-model="query.type" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='type';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
       <template slot="menuLeft">
-        <span style="font-family: '宋体'">
-          用户付款费用总额:
-          <span style="background-color: #8c70b6;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(parseFloat(censusPrice.USER_PAY!==undefined?censusPrice.USER_PAY:0) + parseFloat(censusPrice.WECHAT_PAY!==undefined?censusPrice.WECHAT_PAY:0)).toFixed(2)}}
-          </span>
-        </span>&nbsp;
-        <span type="warning" style="font-family: '宋体'">
-          代理充值费用总额:
-          <span style="background-color: #a9c985;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.AGENT_CHARGE!==undefined?censusPrice.AGENT_CHARGE:0).toFixed(2)}}
-          </span>
-        </span>&nbsp;
-        <span type="info" style="font-family: '宋体'">
-          商场充值费用总额:
-          <span style="background-color: #d50e71;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{parseFloat(censusPrice.MALL_RECHARGE!==undefined?censusPrice.MALL_RECHARGE:0).toFixed(2)}}
-          </span>
-        </span>
+        <IconFontComp :option="censusOption"></IconFontComp>
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, censusPrice, getDetail, add, update, remove} from "@/api/ldt_bills/platformbills";
+  import {getList, generateList, censusPrice, getDetail, add, update, remove} from "@/api/ldt_bills/platformbills";
+  import IconFontComp from "./comps/iconfont";
   import {mapGetters} from "vuex";
+  import moment from "moment";
+  import FileUtil from "@/util/fileUtil";
 
   export default {
+    components:{IconFontComp},
     data() {
       return {
         form: {},
-        query: {},
+        query: {
+          createTime: -1,
+          createTimeRange: [],
+          type: -1,
+        },
         censusPrice:{},
         loading: true,
         page: {
@@ -73,6 +98,9 @@
           delBtn: false,
           viewBtn: true,
           selection: true,
+          searchBtn: false,
+          emptyBtn: false,
+          searchSize: "mini",
           dialogClickModal: false,
           column: [
             {
@@ -124,10 +152,15 @@
             },
             {
               label: "交易类型",
-              search: true,
               prop: "type",
-              type: "select",
+              search: true,
+              searchslot: true,
+              searchSpan: 24,
+              searchOrder: 1,
               dicData:[{
+                label: "全部",
+                value: -1
+              },{
                 label:"用户付款",
                 value:"USER_PAY"
               },{
@@ -174,15 +207,57 @@
               addDisplay: false,
               editDisplay: false,
               search: true,
+              searchSpan: 24,
+              searchOrder: 0,
+              searchslot: true,
               rules: [{
                 required: true,
                 message: "请输入通知时间",
                 trigger: "blur"
               }]
             },
+            {
+              label: "关键字",
+              prop: "key",
+              hide: true,
+              search: true,
+              searchslot: true,
+              searchOrder: 5,
+              searchSpan: 24,
+              editDisplay: false,
+            },
           ]
         },
-        data: []
+        data: [],
+        censusOption: {
+          span: ()=>24/this.censusOption.data.length,
+          data: [
+            {
+              title: '用户付款',
+              prop: ["USER_PAY","WECHAT_PAY"],
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-s-custom',
+              color: '0, 167, 208',
+            },
+            {
+              title: '代理充值',
+              prop: "AGENT_CHARGE",
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-paperclip',
+              color: '27, 201, 142',
+            },
+            {
+              title: '商场充值',
+              prop: "MALL_RECHARGE",
+              count: 0,
+              decimals: 2,
+              icon: 'el-icon-s-shop',
+              color: '230, 71, 88',
+            }
+          ]
+        }
       };
     },
     computed: {
@@ -203,6 +278,60 @@
         return ids.join(",");
       }
     },
+    watch: {
+      //监听创建时间变化
+      "query.createTime": {
+        handler(value) {
+          //防止重复调用
+          if (value !== undefined) {
+            this.query.createTimeRange = [];
+            switch (value) {
+              case -1:
+                this.query.createTimeStart = undefined;
+                this.query.createTimeEnd = undefined;
+                break;
+              case 1: //今天
+                this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 2: //昨天
+                this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+                break;
+              case 3: //近7天
+                this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 4: //近30天
+                this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 5: //本月
+                this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              case 6: //本年
+                this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              default:
+                break;
+            }
+          }
+        }
+      },
+      //监听创建时间变化
+      "query.createTimeRange": {
+        handler(value) {
+          //防止重复调用
+          if (value.length === 2) {
+            this.query.createTimeStart = value[0];
+            this.query.createTimeEnd = value[1];
+            this.query.createTime = undefined;
+          }
+        }
+      },
+    },
     created() {
       this.getCensusPrice();
     },
@@ -307,19 +436,14 @@
         this.onLoad(this.page, this.query);
       },
       onLoad(page, params = {}) {
-        const {createTime} = this.query;
-        let values = {
-          ...params,
-        };
-        if (createTime) {
-          values = {
-            ...params,
-            createTimeStart: createTime[0],
-            createTimeEnd: createTime[1],
-            ...this.query
-          };
-          values.createTime = null;
+        let values = {};
+        for (const item in params) {
+          if (params[item] !== undefined && params[item] !== -1) {
+            values[item] = params[item];
+          }
         }
+        values.createTime = null;
+        values.createTimeRange = null;
         this.loading = true;
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;
@@ -329,13 +453,50 @@
           this.selectionClear();
         });
       },
-      getCensusPrice(){
-        censusPrice().then(res=>{
-          res.data.data.forEach(ele=>{
-            this.censusPrice[ele.type] = parseFloat(ele.price);
-          })
+      getCensusPrice() {
+        censusPrice().then(res => {
+          res.data.data.forEach(ele => {
+            const find = this.censusOption.data.find(ele2=>{
+              return ele2.prop.indexOf(ele.type)!==-1;
+            });
+            if(find && ele.price){
+              find.count = find.count + parseFloat(ele.price);
+            }
+          });
         });
-      }
+      },
+      //搜索状态改变
+      searchStateChange() {
+        setTimeout(() => {
+          this.onLoad(this.page, this.query);
+        }, 100);
+      },
+      //生成列表并到处
+      generateListAndDownload() {
+        const newQuery = {};
+        for (const item in this.query) {
+          if (this.query[item] !== undefined && this.query[item] !== -1) {
+            newQuery[item] = this.query[item];
+          }
+        }
+        newQuery.createTime = null;
+        newQuery.createTimeRange = null;
+        //获取列表键值对
+        newQuery.keyValue = {};
+        this.option.column.forEach(ele=>{
+          newQuery.keyValue[ele.prop] = ele.label;
+        });
+        newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+        this.loading = true;
+        //生成列表
+        generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+          FileUtil.download(res.data,{
+            type: "application/vnd.ms-excel"
+          },`生成平台账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+        }).finally(()=>{
+          this.loading = false;
+        });
+      },
     }
   };
 </script>

+ 243 - 59
src/views/ldt_bills/pointbills.vue

@@ -18,42 +18,67 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="isCheakSearch">
+        <el-radio-group v-model="query.isCheak" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='isCheak';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="payStatusSearch">
+        <el-radio-group v-model="query.payStatus" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='payStatus';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="typeSearch">
+        <el-radio-group v-model="query.type" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='type';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="isCheakSearch">
+        <el-radio-group v-model="query.isCheak" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='isCheak';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
       <template slot="menuLeft">
-        <span style="font-family: '宋体',serif" v-if="this.userInfo.role_name !== 'administrator'">
-          余额(易宝):
-          <span
-            style="background-color: #494141;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.accountsPayable }}
-<!--            {{ parseFloat(censusPrice.yeePayBalance | 0).toFixed(2) }}-->
-          </span>
-        </span>&nbsp;
-        <span type="warning" style="font-family: '宋体',serif" v-if="this.userInfo.role_name !== 'administrator'">
-          总金额:
-          <span
-            style="background-color: #967f1e;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.accountsPayable }}
-<!--            {{ parseFloat(censusPrice.accountsPayable | 0).toFixed(2) }}-->
-          </span>
-        </span>&nbsp;
-        <span type="info" style="font-family: '宋体',serif">
-          已核销金额:
-          <span
-            style="background-color: #096e38;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.handledAmount }}
-<!--            {{ parseFloat(censusPrice.handledAmount | 0).toFixed(2) }}-->
-          </span>
-        </span>
-        <span type="info" style="font-family: '宋体',serif">
-          未核销金额:
-          <span
-            style="background-color: #f60824;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.untreatedAmount }}
-<!--            {{ parseFloat(censusPrice.untreatedAmount | 0).toFixed(2) }}-->
-          </span>
-        </span>
+        <IconFontComp :option="censusOption"></IconFontComp>
       </template>
 
-      <template slot="menuLeft" v-if="this.userInfo.role_name !== 'administrator'">
+      <template slot="menuRight" v-if="this.userInfo.role_name !== 'administrator'">
         <el-button type="danger"
                    size="small"
                    icon="el-icon-money"
@@ -66,16 +91,25 @@
 </template>
 
 <script>
-import {add, censusPrice, getDetail, getList, handlePointBills, remove, update} from "@/api/ldt_bills/pointbills";
+import {add, censusPrice, getDetail, getList, handlePointBills, remove, update, generateList} from "@/api/ldt_bills/pointbills";
+import IconFontComp from "./comps/iconfont";
 import {mapGetters} from "vuex";
+import moment from "moment";
+import FileUtil from "@/util/fileUtil";
 
 export default {
+  components:{IconFontComp},
   data() {
     return {
       form: {},
-      query: {},
+      query: {
+        createTime: -1,
+        createTimeRange: [],
+        payStatus: -1,
+        isCheak: -1,
+        type: -1
+      },
       loading: true,
-      censusPrice: {},
       page: {
         pageSize: 10,
         currentPage: 1,
@@ -96,6 +130,9 @@ export default {
         editBtn: false,
         viewBtn: true,
         selection: true,
+        searchBtn: false,
+        searchSize: "mini",
+        emptyBtn: false,
         dialogClickModal: false,
         column: [
           {
@@ -139,7 +176,7 @@ export default {
           {
             label: "交易标题",
             prop: "title",
-            search: true,
+            search: false,
             rules: [{
               required: true,
               message: "请输入交易标题",
@@ -150,8 +187,13 @@ export default {
             label: "交易状态",
             prop: "payStatus",
             search: true,
-            type: "select",
+            searchslot: true,
+            searchOrder: 1,
+            searchSpan: 24,
             dicData: [{
+              label: "全部",
+              value: -1
+            },{
               label: "待付款",
               value: "待付款"
             }, {
@@ -192,8 +234,13 @@ export default {
             label: "交易类型",
             prop: "type",
             search: true,
-            type: "select",
+            searchslot: true,
+            searchOrder: 2,
+            searchSpan: 24,
             dicData: [{
+              label: "全部",
+              value: -1
+            },{
               label: "用户付款",
               value: "PAY_CONSUMER"
             }, {
@@ -251,12 +298,17 @@ export default {
             }]
           },
           {
-            label: "是否已经核销",
+            label: "是否核销",
             prop: "isCheak",
-            labelWidth: "120",
-            type: "switch",
+            search: true,
+            searchslot: true,
+            searchOrder: 3,
+            searchSpan: 24,
             dicData: [
               {
+                label: "全部",
+                value: -1
+              },{
                 label: "否",
                 value: 0
               },
@@ -277,17 +329,29 @@ export default {
             type: "datetime",
             format: "yyyy-MM-dd hh:mm:ss",
             valueFormat: "yyyy-MM-dd hh:mm:ss",
-            searchRange: true,
+            searchRange:true,
             addDisplay: false,
             editDisplay: false,
             search: true,
-            searchSpan: 6,
+            searchSpan: 24,
+            searchOrder: 0,
+            searchslot: true,
             rules: [{
               required: true,
               message: "请输入通知时间",
               trigger: "blur"
             }]
           },
+          {
+            label: "关键字",
+            prop: "key",
+            hide: true,
+            search: true,
+            searchslot: true,
+            searchOrder: 5,
+            searchSpan: 24,
+            editDisplay: false,
+          },
           {
             label: "交易说明",
             prop: "billsDesc",
@@ -300,7 +364,44 @@ export default {
           },
         ]
       },
-      data: []
+      data: [],
+      censusOption: {
+        span: ()=>24/this.censusOption.data.length,
+        data: [
+          {
+            title: '易宝余额',
+            prop: "accountsPayable",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-custom',
+            color: '0, 167, 208',
+          },
+          {
+            title: '应付总额',
+            prop: "accountsPayable",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-paperclip',
+            color: '27, 201, 142',
+          },
+          {
+            title: '已核销',
+            prop: "handleAmount",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-shop',
+            color: '230, 71, 88',
+          },
+          {
+            title: '未核销',
+            prop: "untreatedAmount",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-shop',
+            color: '230, 71, 88',
+          }
+        ]
+      }
     };
   },
   computed: {
@@ -321,6 +422,60 @@ export default {
       return ids.join(",");
     }
   },
+  watch: {
+    //监听创建时间变化
+    "query.createTime": {
+      handler(value) {
+        //防止重复调用
+        if (value !== undefined) {
+          this.query.createTimeRange = [];
+          switch (value) {
+            case -1:
+              this.query.createTimeStart = undefined;
+              this.query.createTimeEnd = undefined;
+              break;
+            case 1: //今天
+              this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 2: //昨天
+              this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+              break;
+            case 3: //近7天
+              this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 4: //近30天
+              this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 5: //本月
+              this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            case 6: //本年
+              this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            default:
+              break;
+          }
+        }
+      }
+    },
+    //监听创建时间变化
+    "query.createTimeRange": {
+      handler(value) {
+        //防止重复调用
+        if (value.length === 2) {
+          this.query.createTimeStart = value[0];
+          this.query.createTimeEnd = value[1];
+          this.query.createTime = undefined;
+        }
+      }
+    },
+  },
   created() {
     this.getCensusPrice();
   },
@@ -447,19 +602,14 @@ export default {
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
-      const {createTime} = this.query;
-      let values = {
-        ...params,
-      };
-      if (createTime) {
-        values = {
-          ...params,
-          createTimeStart: createTime[0],
-          createTimeEnd: createTime[1],
-          ...this.query
-        };
-        values.createTime = null;
+      let values = {};
+      for (const item in params) {
+        if (params[item] !== undefined && params[item] !== -1) {
+          values[item] = params[item];
+        }
       }
+      values.createTime = null;
+      values.createTimeRange = null;
       this.loading = true;
       getList(page.currentPage, page.pageSize, values).then(res => {
         const data = res.data.data;
@@ -471,9 +621,43 @@ export default {
     },
     getCensusPrice() {
       censusPrice().then(res => {
-        this.censusPrice = res.data.data;
+        this.censusOption.data.forEach(ele=>{
+          ele.count = res.data.data[ele.prop]?res.data.data[ele.prop]:0;
+        });
       });
-    }
+    },
+    //搜索状态改变
+    searchStateChange() {
+      setTimeout(() => {
+        this.onLoad(this.page, this.query);
+      }, 100);
+    },
+    //生成列表并到处
+    generateListAndDownload() {
+      const newQuery = {};
+      for (const item in this.query) {
+        if (this.query[item] !== undefined && this.query[item] !== -1) {
+          newQuery[item] = this.query[item];
+        }
+      }
+      newQuery.createTime = null;
+      newQuery.createTimeRange = null;
+      //获取列表键值对
+      newQuery.keyValue = {};
+      this.option.column.forEach(ele=>{
+        newQuery.keyValue[ele.prop] = ele.label;
+      });
+      newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+      this.loading = true;
+      //生成列表
+      generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+        FileUtil.download(res.data,{
+          type: "application/vnd.ms-excel"
+        },`生成积分账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+      }).finally(()=>{
+        this.loading = false;
+      });
+    },
   }
 };
 </script>

+ 202 - 14
src/views/ldt_bills/transferrec.vue

@@ -18,28 +18,62 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.transferrec_delete"
-                   @click="handleDelete">删 除
-        </el-button>
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="transferStatusSearch">
+        <el-radio-group v-model="query.transferStatus" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='transferStatus';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
+      <template slot-scope="{type,size}" slot="menuLeft">
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ldt_bills/transferrec";
+  import {getList, getDetail, add, update, remove,generateList} from "@/api/ldt_bills/transferrec";
   import {mapGetters} from "vuex";
+  import moment from "moment";
+  import FileUtil from "@/util/fileUtil";
 
   export default {
     data() {
       return {
         form: {},
-        query: {},
+        query: {
+          createTime: -1,
+          createTimeRange: [],
+          transferStatus: -1
+        },
         loading: true,
         page: {
           pageSize: 10,
@@ -57,6 +91,12 @@
           index: true,
           viewBtn: true,
           selection: true,
+          searchBtn: false,
+          emptyBtn: false,
+          addBtn: false,
+          delBtn: false,
+          editBtn: false,
+          searchSize: "mini",
           dialogClickModal: false,
           column: [
             {
@@ -114,8 +154,26 @@
               }]
             },
             {
-              label: "转账状态: 转账申请中,转账成功,转账失败",
+              label: "转账状态",
               prop: "transferStatus",
+              dicData:[
+                {
+                  label: "全部",
+                  value: -1
+                },
+                {
+                  label:"转账申请中",
+                  value: "REQUEST_RECEIVE"
+                },
+                {
+                  label: "转账已完成",
+                  value: "DONE",
+                },
+                {
+                  label: "转账失败",
+                  value: "FAIL",
+                }
+              ],
               rules: [{
                 required: true,
                 message: "请输入转账状态: 转账申请中,转账成功,转账失败",
@@ -123,8 +181,11 @@
               }]
             },
             {
-              label: "转账渠道:yeePay(易宝支付)",
+              label: "转账渠道",
               prop: "channel",
+              dicData: [
+
+              ],
               rules: [{
                 required: true,
                 message: "请输入转账渠道:yeePay(易宝支付)",
@@ -185,6 +246,35 @@
                 trigger: "blur"
               }]
             },
+            {
+              label: "创建时间",
+              prop: "createTime",
+              type: "datetime",
+              format: "yyyy-MM-dd hh:mm:ss",
+              valueFormat: "yyyy-MM-dd hh:mm:ss",
+              searchRange:true,
+              addDisplay: false,
+              editDisplay: false,
+              search: true,
+              searchSpan: 24,
+              searchOrder: 0,
+              searchslot: true,
+              rules: [{
+                required: true,
+                message: "请输入通知时间",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "关键字",
+              prop: "key",
+              hide: true,
+              search: true,
+              searchslot: true,
+              searchOrder: 1,
+              searchSpan: 24,
+              editDisplay: false,
+            },
           ]
         },
         data: []
@@ -208,6 +298,60 @@
         return ids.join(",");
       }
     },
+    watch: {
+      //监听创建时间变化
+      "query.createTime": {
+        handler(value) {
+          //防止重复调用
+          if (value !== undefined) {
+            this.query.createTimeRange = [];
+            switch (value) {
+              case -1:
+                this.query.createTimeStart = undefined;
+                this.query.createTimeEnd = undefined;
+                break;
+              case 1: //今天
+                this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 2: //昨天
+                this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+                this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+                break;
+              case 3: //近7天
+                this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 4: //近30天
+                this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+                this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+                break;
+              case 5: //本月
+                this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              case 6: //本年
+                this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+                this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+                break;
+              default:
+                break;
+            }
+          }
+        }
+      },
+      //监听创建时间变化
+      "query.createTimeRange": {
+        handler(value) {
+          //防止重复调用
+          if (value.length === 2) {
+            this.query.createTimeStart = value[0];
+            this.query.createTimeEnd = value[1];
+            this.query.createTime = undefined;
+          }
+        }
+      },
+    },
     methods: {
       rowSave(row, done, loading) {
         add(row).then(() => {
@@ -309,15 +453,59 @@
         this.onLoad(this.page, this.query);
       },
       onLoad(page, params = {}) {
+        let values = {
+          ...params,
+        };
+        values.createTime = null;
+        values.createTimeRange = null;
         this.loading = true;
-        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+        getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
           this.loading = false;
           this.selectionClear();
         });
-      }
+      },
+      //搜索状态改变
+      searchStateChange() {
+        setTimeout(() => {
+          const newQuery = {};
+          this.page.currentPage = 1;
+          for (const item in this.query) {
+            if (this.query[item] !== undefined && this.query[item] !== -1) {
+              newQuery[item] = this.query[item];
+            }
+          }
+          this.onLoad(this.page, newQuery);
+        }, 100);
+      },
+      //生成列表并到处
+      generateListAndDownload() {
+        const newQuery = {};
+        for (const item in this.query) {
+          if (this.query[item] !== undefined && this.query[item] !== -1) {
+            newQuery[item] = this.query[item];
+          }
+        }
+        newQuery.createTime = null;
+        newQuery.createTimeRange = null;
+        //获取列表键值对
+        newQuery.keyValue = {};
+        this.option.column.forEach(ele=>{
+          newQuery.keyValue[ele.prop] = ele.label;
+        });
+        newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+        this.loading = true;
+        //生成列表
+        generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+          FileUtil.download(res.data,{
+            type: "application/vnd.ms-excel"
+          },`生成转账记录-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+        }).finally(()=>{
+          this.loading = false;
+        });
+      },
     }
   };
 </script>

+ 280 - 103
src/views/ldt_bills/withdrawrec.vue

@@ -27,35 +27,75 @@
       <!--                   @click="handleDelete">删 除-->
       <!--        </el-button>-->
       <!--      </template>-->
+      <template slot-scope="{type,size}" slot="createTimeSearch">
+        <el-radio-group v-model="query.createTime" :size="size" style="float: left">
+          <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
+          <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
+        </el-radio-group>
+        <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
+                   value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
+                   :size="size"
+                   @change="searchStateChange"
+                   style="width: 280px;margin-left:5px;float: left"
+                   range-separator="-"
+                   start-placeholder="开始日期"
+                   end-placeholder="结束日期"></avue-date>
+      </template>
+      <template slot-scope="{type,size}" slot="withdrawStatusSearch">
+        <el-radio-group v-model="query.withdrawStatus" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='withdrawStatus';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="channelSearch">
+        <el-radio-group v-model="query.channel" :size="size" @change="searchStateChange">
+          <el-radio-button :label="select.value" v-for="(select,index) in option.column.find(ele=>{
+            return ele.prop==='channel';
+          }).dicData" :key="index">{{ select.label }}</el-radio-button>
+        </el-radio-group>
+      </template>
+      <template slot-scope="{type,size}" slot="keySearch">
+        <el-input type="text" placeholder="真实姓名/银行卡号/提现订单号" v-model="query.key" :size="size"
+                  style="width: 300px;margin: 1px 5px 1px 0;">
+          <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
+                     @click="searchStateChange"></el-button>
+        </el-input>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
+      </template>
+
       <template slot="menuLeft">
-        <span style="font-family: '宋体'">
-          代理提现总金额:
-          <span style="background-color: #8c70b6;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.channelAgentSum }}
-          </span>
-        </span>&nbsp;
-        <span type="warning" style="font-family: '宋体'">
-          商户提现总金额:
-          <span style="background-color: #a9c985;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
-            {{ censusPrice.merchantsSum }}
-          </span>
-        </span>&nbsp;
+        <IconFontComp :option="censusOption"></IconFontComp>
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-import {add, censusPrice, getDetail, getList, remove, update} from "@/api/ldt_bills/withdrawrec";
+import moment from "moment";
+import IconFontComp from "./comps/iconfont";
+import {add, censusPrice, generateList, getDetail, getList, remove, update} from "@/api/ldt_bills/withdrawrec";
 import {mapGetters} from "vuex";
+import FileUtil from "@/util/fileUtil";
 
 export default {
+  components:{IconFontComp},
   data() {
     return {
       form: {},
-      query: {},
+      query: {
+        withdrawStatus: -1,
+        createTime: -1,
+        createTimeRange: [],
+        channel: -1
+      },
       loading: true,
-      censusPrice: {},
       page: {
         pageSize: 10,
         currentPage: 1,
@@ -68,8 +108,8 @@ export default {
         tip: false,
         searchShow: true,
         searchMenuSpan: 6,
-        searchLabelWidth: 120,
-        searchSpan:4,
+        searchLabelWidth: 80,
+        searchSpan: 4,
         border: true,
         index: true,
         addBtn: false,
@@ -77,35 +117,37 @@ export default {
         delBtn: false,
         viewBtn: true,
         selection: true,
+        searchBtn: false,
+        emptyBtn: false,
+        searchSize: "mini",
         dialogClickModal: false,
         column: [
+          // {
+          //   label: "提现用户类型",
+          //   prop: "ownerType",
+          //   type: "select",
+          //   dicData: [{
+          //     label: "商家",
+          //     value: "1"
+          //   }],
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入提现用户类型: 1-商家",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
-            label: "提现用户类型",
-            prop: "ownerType",
-            search: true,
-            type: "select",
-            dicData: [{
-              label: "商家",
-              value: "1"
-            }],
-            rules: [{
-              required: true,
-              message: "请输入提现用户类型: 1-商家",
-              trigger: "blur"
-            }]
-          },
-          /*{
-            label: "提现用户id",
-            prop: "ownerId",
+            label: "用户信息",
+            prop: "ownerName",
             rules: [{
               required: true,
               message: "请输入提现用户id: 若owner_type = 1则为商家id",
               trigger: "blur"
             }]
-          },*/
+          },
           {
-            label: "提现用户名",
-            prop: "ownerName",
+            label: "用户UID",
+            prop: "ownerId",
             rules: [{
               required: true,
               message: "请输入提现用户id: 若owner_type = 1则为商家id",
@@ -121,15 +163,15 @@ export default {
               trigger: "blur"
             }]
           },
-          {
-            label: "需扣积分价值",
-            prop: "pointValue",
-            rules: [{
-              required: true,
-              message: "请输入需扣积分价值",
-              trigger: "blur"
-            }]
-          },
+          // {
+          //   label: "需扣积分价值",
+          //   prop: "pointValue",
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入需扣积分价值",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
             label: "实际提现金额",
             prop: "actualPrice",
@@ -139,20 +181,26 @@ export default {
               trigger: "blur"
             }]
           },
-          {
-            label: "提现手续费",
-            prop: "fee",
-            rules: [{
-              required: true,
-              message: "请输入提现手续费",
-              trigger: "blur"
-            }]
-          },
+          // {
+          //   label: "提现手续费",
+          //   prop: "fee",
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入提现手续费",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
             label: "提现状态",
             search: true,
             type: "select",
+            searchslot: true,
+            searchSpan: 24,
+            searchOrder: 1,
             dicData: [{
+              label: "全部",
+              value: -1,
+            },{
               label: "待确定",
               value: "1"
             }, {
@@ -179,8 +227,22 @@ export default {
             }]
           },
           {
-            label: "提现渠道",
+            label: "提现方式",
             prop: "channel",
+            searchslot: true,
+            search: true,
+            searchSpan: 24,
+            searchOrder: 2,
+            dicData: [
+              {
+                label: "全部",
+                value: -1,
+              },
+              {
+                label: "易宝",
+                value: "yeePay"
+              }
+            ],
             rules: [{
               required: true,
               message: "请输入提现渠道:yeePay(易宝支付)",
@@ -199,42 +261,41 @@ export default {
           {
             label: "接收人真实姓名",
             prop: "receiverAccountName",
-            search: true,
             rules: [{
               required: true,
               message: "请输入接收人真实姓名",
               trigger: "blur"
             }]
           },
+          // {
+          //   label: "接收人的银行账号",
+          //   prop: "receiverAccountNo",
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入接收人的银行账号",
+          //     trigger: "blur"
+          //   }]
+          // },
+          // {
+          //   label: "到账类型",
+          //   prop: "receiveType",
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入到账类型,默认实时到账",
+          //     trigger: "blur"
+          //   }]
+          // },
+          // {
+          //   label: "提现到账的金额",
+          //   prop: "receiveAmount",
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入提现到账的金额",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
-            label: "接收人的银行账号",
-            prop: "receiverAccountNo",
-            rules: [{
-              required: true,
-              message: "请输入接收人的银行账号",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "到账类型",
-            prop: "receiveType",
-            rules: [{
-              required: true,
-              message: "请输入到账类型,默认实时到账",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "提现到账的金额",
-            prop: "receiveAmount",
-            rules: [{
-              required: true,
-              message: "请输入提现到账的金额",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "失败原因",
+            label: "拒绝原因",
             prop: "failReason",
             rules: [{
               required: true,
@@ -243,25 +304,58 @@ export default {
             }]
           },
           {
-            label: "创建时间",
+            label: "添加时间",
             prop: "createTime",
             type: "datetime",
             format: "yyyy-MM-dd hh:mm:ss",
             valueFormat: "yyyy-MM-dd hh:mm:ss",
-            searchRange:true,
+            searchRange: true,
             addDisplay: false,
             editDisplay: false,
             search: true,
-            searchSpan:6,
+            searchSpan: 24,
+            searchslot: true,
+            searchOrder: 0,
             rules: [{
               required: true,
               message: "请输入通知时间",
               trigger: "blur"
             }]
           },
+          {
+            label: "关键字",
+            prop: "key",
+            hide: true,
+            search: true,
+            searchslot: true,
+            searchOrder: 3,
+            searchSpan: 24,
+            editDisplay: false,
+          },
         ]
       },
-      data: []
+      data: [],
+      censusOption: {
+        span: ()=>24/this.censusOption.data.length,
+        data: [
+          {
+            title: '代理提现',
+            prop: "channelAgentSum",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-s-custom',
+            color: '0, 167, 208',
+          },
+          {
+            title: '商户提现',
+            prop: "merchantsSum",
+            count: 0,
+            decimals: 2,
+            icon: 'el-icon-paperclip',
+            color: '27, 201, 142',
+          },
+        ]
+      }
     };
   },
   computed: {
@@ -282,6 +376,60 @@ export default {
       return ids.join(",");
     }
   },
+  watch: {
+    //监听创建时间变化
+    "query.createTime": {
+      handler(value) {
+        //防止重复调用
+        if (value !== undefined) {
+          this.query.createTimeRange = [];
+          switch (value) {
+            case -1:
+              this.query.createTimeStart = undefined;
+              this.query.createTimeEnd = undefined;
+              break;
+            case 1: //今天
+              this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 2: //昨天
+              this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
+              this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
+              break;
+            case 3: //近7天
+              this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 4: //近30天
+              this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
+              this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
+              break;
+            case 5: //本月
+              this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            case 6: //本年
+              this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
+              this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
+              break;
+            default:
+              break;
+          }
+        }
+      }
+    },
+    //监听创建时间变化
+    "query.createTimeRange": {
+      handler(value) {
+        //防止重复调用
+        if (value.length === 2) {
+          this.query.createTimeStart = value[0];
+          this.query.createTimeEnd = value[1];
+          this.query.createTime = undefined;
+        }
+      }
+    },
+  },
   created() {
     this.getCensusPrice();
   },
@@ -386,19 +534,14 @@ export default {
       this.onLoad(this.page, this.query);
     },
     onLoad(page, params = {}) {
-      const {createTime} = this.query;
-      let values = {
-        ...params,
-      };
-      if (createTime) {
-        values = {
-          ...params,
-          createTimeStart: createTime[0],
-          createTimeEnd: createTime[1],
-          ...this.query
-        };
-        values.createTime = null;
+      let values = {};
+      for (const item in params) {
+        if (params[item] !== undefined && params[item] !== -1) {
+          values[item] = params[item];
+        }
       }
+      values.createTime = null;
+      values.createTimeRange = null;
       this.loading = true;
       getList(page.currentPage, page.pageSize, values).then(res => {
         const data = res.data.data;
@@ -410,9 +553,43 @@ export default {
     },
     getCensusPrice() {
       censusPrice().then(res => {
-        this.censusPrice = res.data.data;
+        this.censusOption.data.forEach(ele=>{
+          ele.count = res.data.data[ele.prop]?res.data.data[ele.prop]:0;
+        });
       });
-    }
+    },
+    //搜索状态改变
+    searchStateChange() {
+      setTimeout(() => {
+        this.onLoad(this.page, this.query);
+      }, 100);
+    },
+    //生成列表并到处
+    generateListAndDownload() {
+      const newQuery = {};
+      for (const item in this.query) {
+        if (this.query[item] !== undefined && this.query[item] !== -1) {
+          newQuery[item] = this.query[item];
+        }
+      }
+      newQuery.createTime = null;
+      newQuery.createTimeRange = null;
+      //获取列表键值对
+      newQuery.keyValue = {};
+      this.option.column.forEach(ele=>{
+        newQuery.keyValue[ele.prop] = ele.label;
+      });
+      newQuery.keyValue = JSON.stringify(newQuery.keyValue);
+      this.loading = true;
+      //生成列表
+      generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
+        FileUtil.download(res.data,{
+          type: "application/vnd.ms-excel"
+        },`生成提现记录-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
+      }).finally(()=>{
+        this.loading = false;
+      });
+    },
   }
 };
 </script>