Bläddra i källkod

修改提现记录

silent 4 år sedan
förälder
incheckning
98d57b0881

+ 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/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();
+  }
+}

+ 144 - 4
src/views/ldt_bills/platformbills.vue

@@ -19,6 +19,34 @@
                @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="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: '宋体'">
           用户付款费用总额:
@@ -44,14 +72,19 @@
 </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 {mapGetters} from "vuex";
+  import moment from "_moment@2.29.1@moment";
+  import FileUtil from "@/util/fileUtil"
 
   export default {
     data() {
       return {
         form: {},
-        query: {},
+        query: {
+          createTime: -1,
+          createTimeRange: [],
+        },
         censusPrice:{},
         loading: true,
         page: {
@@ -73,6 +106,8 @@
           delBtn: false,
           viewBtn: true,
           selection: true,
+          searchBtn: false,
+          emptyBtn: false,
           dialogClickModal: false,
           column: [
             {
@@ -124,7 +159,6 @@
             },
             {
               label: "交易类型",
-              search: true,
               prop: "type",
               type: "select",
               dicData:[{
@@ -174,12 +208,25 @@
               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: []
@@ -203,6 +250,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();
     },
@@ -335,7 +436,46 @@
             this.censusPrice[ele.type] = parseFloat(ele.price);
           })
         });
-      }
+      },
+      //搜索状态改变
+      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>

+ 93 - 63
src/views/ldt_bills/withdrawrec.vue

@@ -28,28 +28,23 @@
       <!--        </el-button>-->
       <!--      </template>-->
       <template slot-scope="{type,size}" slot="createTimeSearch">
-        <el-row>
-          <el-col span="10">
-            <el-radio-group v-model="query.createTime" :size="size">
-              <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>
-          </el-col>
-          <el-col span="14">
-            <avue-date v-model="query.createTimeRange" type="daterange" format="yyyy年MM月dd日 hh:mm:ss" value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
-                       :size="size"
-                       @change="searchStateChange"
-                       style="width: 280px;margin: 1px"
-                       range-separator="-"
-                       start-placeholder="开始日期"
-                       end-placeholder="结束日期"></avue-date>
-          </el-col>
-        </el-row>
+        <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">
@@ -66,22 +61,26 @@
         </el-radio-group>
       </template>
       <template slot-scope="{type,size}" slot="keySearch">
-        <el-input type="text" placeholder="姓名/银行卡号/易宝商户号" v-model="query.key" :size="size" style="width: 200px;margin: 1px 5px 1px 0;">
-          <el-button type="primary" :size="size" icon="el-icon-search" slot="append" @click="searchStateChange"></el-button>
+        <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">生成列表</el-button>
-        <el-button type="primary" :size="size">导出已生成列表</el-button>
+        <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 ;">
+          <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 ;">
+          <span
+            style="background-color: #a9c985;color: white; border-radius: 5px; margin:10px; padding:0 10px 0 10px ;">
             {{ censusPrice.merchantsSum }}
           </span>
         </span>&nbsp;
@@ -92,8 +91,9 @@
 
 <script>
 import moment from "moment";
-import {add, censusPrice, getDetail, getList, remove, update} from "@/api/ldt_bills/withdrawrec";
+import {add, censusPrice, generateList, getDetail, getList, remove, update} from "@/api/ldt_bills/withdrawrec";
 import {mapGetters} from "vuex";
+import FileUtil from "@/util/fileUtil"
 
 export default {
   data() {
@@ -120,7 +120,7 @@ export default {
         searchShow: true,
         searchMenuSpan: 6,
         searchLabelWidth: 80,
-        searchSpan:4,
+        searchSpan: 4,
         border: true,
         index: true,
         addBtn: false,
@@ -128,7 +128,7 @@ export default {
         delBtn: false,
         viewBtn: true,
         selection: true,
-        searchBtn:false,
+        searchBtn: false,
         menu: false,
         emptyBtn: false,
         dialogClickModal: false,
@@ -205,8 +205,9 @@ export default {
             label: "提现状态",
             search: true,
             type: "select",
-            searchslot:true,
-            searchSpan:24,
+            searchslot: true,
+            searchSpan: 24,
+            searchOrder: 1,
             dicData: [{
               label: "待确定",
               value: "1"
@@ -236,9 +237,10 @@ export default {
           {
             label: "提现方式",
             prop: "channel",
-            searchslot:true,
+            searchslot: true,
             search: true,
-            searchSpan:24,
+            searchSpan: 24,
+            searchOrder: 2,
             rules: [{
               required: true,
               message: "请输入提现渠道:yeePay(易宝支付)",
@@ -254,15 +256,15 @@ export default {
               trigger: "blur"
             }]
           },
-          // {
-          //   label: "接收人真实姓名",
-          //   prop: "receiverAccountName",
-          //   rules: [{
-          //     required: true,
-          //     message: "请输入接收人真实姓名",
-          //     trigger: "blur"
-          //   }]
-          // },
+          {
+            label: "接收人真实姓名",
+            prop: "receiverAccountName",
+            rules: [{
+              required: true,
+              message: "请输入接收人真实姓名",
+              trigger: "blur"
+            }]
+          },
           // {
           //   label: "接收人的银行账号",
           //   prop: "receiverAccountNo",
@@ -305,12 +307,13 @@ 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:24,
-            searchslot:true,
+            searchSpan: 24,
+            searchslot: true,
+            searchOrder: 0,
             rules: [{
               required: true,
               message: "请输入通知时间",
@@ -323,7 +326,8 @@ export default {
             hide: true,
             search: true,
             searchslot: true,
-            searchSpan: 12,
+            searchOrder: 3,
+            searchSpan: 24,
             editDisplay: false,
           },
         ]
@@ -349,14 +353,14 @@ export default {
       return ids.join(",");
     }
   },
-  watch:{
+  watch: {
     //监听创建时间变化
-    "query.createTime":{
-      handler(value){
+    "query.createTime": {
+      handler(value) {
         //防止重复调用
-        if(value!==undefined){
+        if (value !== undefined) {
           this.query.createTimeRange = [];
-          switch (value){
+          switch (value) {
             case -1:
               this.query.createTimeStart = undefined;
               this.query.createTimeEnd = undefined;
@@ -392,10 +396,10 @@ export default {
       }
     },
     //监听创建时间变化
-    "query.createTimeRange":{
-      handler(value){
+    "query.createTimeRange": {
+      handler(value) {
         //防止重复调用
-        if(value.length===2){
+        if (value.length === 2) {
           this.query.createTimeStart = value[0];
           this.query.createTimeEnd = value[1];
           this.query.createTime = undefined;
@@ -527,18 +531,44 @@ export default {
       });
     },
     //搜索状态改变
-    searchStateChange(){
-      setTimeout(()=>{
+    searchStateChange() {
+      setTimeout(() => {
         const newQuery = {};
         this.page.currentPage = 1;
-        for(const item in this.query){
-          if(this.query[item]!==undefined && this.query[item]!==-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);
-    }
+        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>