Browse Source

修改界面

silent 4 years ago
parent
commit
427853ae8b

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

+ 6 - 3
src/views/ldt_bills/balancebills.vue

@@ -73,14 +73,17 @@
 <script>
   import {getList, generateList, getDetail, censusPrice, add, update, remove} from "@/api/ldt_bills/balancebills";
   import {mapGetters} from "vuex";
-  import moment from "_moment@2.29.1@moment";
+  import moment from "moment";
   import FileUtil from "@/util/fileUtil";
 
   export default {
     data() {
       return {
         form: {},
-        query: {},
+        query: {
+          createTime: -1,
+          createTimeRange: [],
+        },
         censusPrice:{},
         loading: true,
         page: {
@@ -509,7 +512,7 @@
         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`);
+          },`生成余额账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
         }).finally(_=>{
           this.loading = false;
         });

+ 1 - 1
src/views/ldt_bills/bills.vue

@@ -82,7 +82,7 @@
 <script>
   import {getList, censusPrice, getDetail, add, update, remove, generateList} from "@/api/ldt_bills/bills";
   import {mapGetters} from "vuex";
-  import moment from "_moment@2.29.1@moment";
+  import moment from "moment";
   import FileUtil from "@/util/fileUtil";
 
   export default {

+ 1 - 1
src/views/ldt_bills/platformbills.vue

@@ -74,7 +74,7 @@
 <script>
   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 moment from "moment";
   import FileUtil from "@/util/fileUtil";
 
   export default {

+ 146 - 8
src/views/ldt_bills/pointbills.vue

@@ -18,6 +18,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: '宋体',serif" v-if="this.userInfo.role_name !== 'administrator'">
           余额(易宝):
@@ -66,14 +94,19 @@
 </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 {mapGetters} from "vuex";
+import moment from "moment";
+import FileUtil from "@/util/fileUtil";
 
 export default {
   data() {
     return {
       form: {},
-      query: {},
+      query: {
+        createTime: -1,
+        createTimeRange: [],
+      },
       loading: true,
       censusPrice: {},
       page: {
@@ -139,7 +172,7 @@ export default {
           {
             label: "交易标题",
             prop: "title",
-            search: true,
+            search: false,
             rules: [{
               required: true,
               message: "请输入交易标题",
@@ -149,7 +182,7 @@ export default {
           {
             label: "交易状态",
             prop: "payStatus",
-            search: true,
+            search: false,
             type: "select",
             dicData: [{
               label: "待付款",
@@ -191,7 +224,7 @@ export default {
           {
             label: "交易类型",
             prop: "type",
-            search: true,
+            search: false,
             type: "select",
             dicData: [{
               label: "用户付款",
@@ -277,17 +310,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: 1,
+            searchSpan: 24,
+            editDisplay: false,
+          },
           {
             label: "交易说明",
             prop: "billsDesc",
@@ -321,6 +366,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();
   },
@@ -473,7 +572,46 @@ export default {
       censusPrice().then(res => {
         this.censusPrice = res.data.data;
       });
-    }
+    },
+    //搜索状态改变
+    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>

+ 157 - 2
src/views/ldt_bills/transferrec.vue

@@ -18,6 +18,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">
         <el-button type="danger"
                    size="small"
@@ -34,12 +62,17 @@
 <script>
   import {getList, getDetail, add, update, remove} 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: [],
+        },
         loading: true,
         page: {
           pageSize: 10,
@@ -185,6 +218,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 +270,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(() => {
@@ -317,7 +433,46 @@
           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>