浏览代码

订单管理添加导出按钮,通道质量筛选

dujingxian 4 年之前
父节点
当前提交
06a82e934e
共有 4 个文件被更改,包括 51 次插入36 次删除
  1. 21 6
      src/pages/phoneSubPages/phoneOrder.vue
  2. 20 5
      src/pages/subPages/order.vue
  3. 7 22
      src/utils/constants.js
  4. 3 3
      src/utils/export.js

+ 21 - 6
src/pages/phoneSubPages/phoneOrder.vue

@@ -70,10 +70,18 @@
                 </el-option>
             </template>
         </el-select>
+        <el-select v-model="quality" clearable placeholder="--通道质量--" size="small" style="margin-right: 10px;margin-bottom:10px;width: 140px;">
+            <el-option
+                v-for="item in qualityCon"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+            </el-option>
+        </el-select>
         <div>
             <el-button style="margin-right:10px;margin-bottom:20px" size="small" type="primary" @click="queryList">查询</el-button>
-            <el-button style="margin-right:10px;margin-left:0px;margin-bottom:20px" size="small" type="danger" @click="onReset">重置</el-button>
-            <!-- <el-button style="margin-right:10px;margin-left:0px;margin-bottom:20px" type="warning" @click="onExport">导出</el-button> -->
+            <el-button style="margin-right:10px;margin-bottom:20px" size="small" type="danger" @click="onReset">重置</el-button>
+            <el-button style="margin-bottom:20px" type="warning" size="small" @click="onExport">导出</el-button>
         </div>
     </el-header>
    
@@ -117,7 +125,7 @@ import {
     queryList,
     exportList
 } from "@/api";
-import { moneyType, orderState, amountConstant, timeConstant } from '@/utils/constants'
+import { moneyType, orderState, amountConstant, timeConstant, qualityCon } from '@/utils/constants'
 import {JSONToExcelConvertor} from '@/utils/export.js'
 export default {
     name: 'phoneOrder',
@@ -154,7 +162,11 @@ export default {
             // 卡号
             card_no: '',
             // 平台单号
-            order_sn: ''
+            order_sn: '',
+            // 充值质量
+            quality: '',
+            // 充值质量-常量
+            qualityCon
         };
     },
     created () {
@@ -187,8 +199,8 @@ export default {
                 this.startTime = ''
                 this.endTime = ''
             } else {
-                this.startTime =  this.dataRange[0] || ''
-                this.endTime = this.dataRange[1] || ''
+                this.startTime =  this.dataRange[0]/1000 || ''
+                this.endTime = this.dataRange[1]/1000 || ''
             }
             try {
                 let param = new URLSearchParams()
@@ -231,6 +243,7 @@ export default {
                 param.append('time', this.time)
                 param.append('card_no', this.card_no)
                 param.append('order_sn', this.order_sn)
+                param.append('quality', this.quality)
                 // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                 const res = await queryList(param)
                 console.log('查询订单', res);
@@ -255,6 +268,7 @@ export default {
             this.time = ''
             this.card_no = ''
             this.order_sn = ''
+            this.quality = ''
             this.getOrderList();
         },
         // 分页
@@ -282,6 +296,7 @@ export default {
                     param.append('mch_order', this.mch_order)
                     param.append('card_no', this.card_no)
                     param.append('order_sn', this.order_sn)
+                    param.append('quality', this.quality)
                     // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                     const res = await queryList(param)
                     console.log('查询订单', res);

+ 20 - 5
src/pages/subPages/order.vue

@@ -65,10 +65,18 @@
                 </el-option>
             </template>
         </el-select>
+        <el-select v-model="quality" clearable placeholder="--通道质量--" style="margin-right: 10px;margin-bottom:20px;width: 140px;">
+            <el-option
+                v-for="item in qualityCon"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+            </el-option>
+        </el-select>
         <div>
             <el-button style="margin-right:10px;margin-bottom:20px" type="primary" @click="queryList">查询</el-button>
             <el-button style="margin-right:10px;margin-left:0px;margin-bottom:20px" type="danger" @click="onReset">重置</el-button>
-            <!-- <el-button style="margin-right:10px;margin-left:0px;margin-bottom:20px" type="warning" @click="onExport">导出</el-button> -->
+            <el-button style="margin-right:10px;margin-left:0px;margin-bottom:20px" type="warning" @click="onExport">导出</el-button>
         </div>
     </el-header>
    
@@ -112,7 +120,7 @@ import {
     queryList,
     exportList
 } from "@/api";
-import { moneyType, orderState, amountConstant, timeConstant } from '@/utils/constants'
+import { moneyType, orderState, amountConstant, timeConstant, qualityCon } from '@/utils/constants'
 import {JSONToExcelConvertor} from '@/utils/export.js'
 export default {
     name: 'order',
@@ -149,7 +157,11 @@ export default {
             // 卡号
             card_no: '',
             // 平台单号
-            order_sn: ''
+            order_sn: '',
+            // 充值质量
+            quality: '',
+            // 充值质量-常量
+            qualityCon,
         };
     },
     created () {
@@ -182,8 +194,8 @@ export default {
                 this.startTime = ''
                 this.endTime = ''
             } else {
-                this.startTime =  this.dataRange[0] || ''
-                this.endTime = this.dataRange[1] || ''
+                this.startTime =  this.dataRange[0]/1000 || ''
+                this.endTime = this.dataRange[1]/1000 || ''
             }
             try {
                 let param = new URLSearchParams()
@@ -226,6 +238,7 @@ export default {
                 param.append('time', this.time)
                 param.append('card_no', this.card_no)
                 param.append('order_sn', this.order_sn)
+                param.append('quality', this.quality)
                 // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                 const res = await queryList(param)
                 console.log('查询订单', res);
@@ -250,6 +263,7 @@ export default {
             this.time = ''
             this.card_no = ''
             this.order_sn = ''
+            this.quality = ''
             this.getOrderList();
         },
         // 分页
@@ -277,6 +291,7 @@ export default {
                     param.append('mch_order', this.mch_order)
                     param.append('card_no', this.card_no)
                     param.append('order_sn', this.order_sn)
+                    param.append('quality', this.quality)
                     // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                     const res = await queryList(param)
                     console.log('查询订单', res);

+ 7 - 22
src/utils/constants.js

@@ -52,28 +52,13 @@ export const timeConstant = [
   {value: 1, label: '>1小时'}
 ]
 
-// 银行名称
-export const backName = [
-  {value: '中国工商银行'},
-  {value: '中国建设银行'},
-  {value: '中国农业银行'},
-  {value: '中国邮政储蓄银行'},
-  {value: '中国银行'},
-  {value: '招商银行'},
-  {value: '浦发银行'},
-  {value: '广发银行'},
-  {value: '兴业银行'},
-  {value: '富滇银行'},
-]
-// 更多银行
-export const MoreBank =[
-  {value: '上海银行'},
-  {value: '宁波银行'},
-  {value: '中信银行'},
-  {value: '中国光大银行'},
-  {value: '北京农商银行'},
-  {value: '北京银行'},
-  {value: '上海农商银行'},
+// 通道质量
+export const qualityCon = [
+  {value: 1, label: '普充'},
+  {value: 2, label: '快充'},
+  {value: 3, label: '卡密'},
+  {value: 4, label: '三方'},
+  {value: 5, label: '慢充'}
 ]
 
 // 对账管理

+ 3 - 3
src/utils/export.js

@@ -20,10 +20,10 @@ export function JSONToExcelConvertor(JSONData, FileName, ShowLabel) {
     var row = "<tr>"; 
       
     for (var index in arrData[i]) { 
-      var value = arrData[i][index].value === "." ? "" : arrData[i][index].value; 
-      row += '<td>' + value + '</td>'; 
+      var value = arrData[i][index].value === "." ? "" : arrData[i][index].value;
+      // eslint-disable-next-line no-useless-escape
+      row += '<td style='+ 'mso-number-format:"\@"'+ '>' + value + '</td>'; 
     } 
-      
     excel += row + "</tr>"; 
   }