|
@@ -1,3 +1,5 @@
|
|
|
+/* eslint-disable no-unused-vars */
|
|
|
+/* eslint-disable no-unused-vars */
|
|
|
<template>
|
|
|
<el-card>
|
|
|
<el-container direction="vertical">
|
|
@@ -20,12 +22,14 @@
|
|
|
<el-date-picker
|
|
|
class="yezi_date"
|
|
|
v-model="dataRange"
|
|
|
+ :disabled="isDisabled"
|
|
|
+ @focus="hFocusDate"
|
|
|
clearable
|
|
|
value-format="timestamp"
|
|
|
- format="yyyy-MM-dd"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
type="datetimerange"
|
|
|
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
- style="margin-bottom:20px;margin-right: 10px;width:260px"></el-date-picker>
|
|
|
+ style="margin-bottom:20px;margin-right: 10px;width:380px"></el-date-picker>
|
|
|
<el-select v-model="RechargeType" clearable placeholder="--充值卡类型--" style="margin-right: 10px;margin-bottom:20px;width: 140px;">
|
|
|
<el-option
|
|
|
v-for="item in moneyType"
|
|
@@ -73,10 +77,12 @@
|
|
|
:value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
+ <p style="float: right;font-size: 13px;color: #909399;margin: 17px 576px 0 0;">仅展示一小时内订单,如需查询历史订单,请输入单号或充值号码</p>
|
|
|
<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="success" @click="onExcopy">复制</el-button>
|
|
|
</div>
|
|
|
</el-header>
|
|
|
|
|
@@ -130,6 +136,7 @@ export default {
|
|
|
pageSize: 50,
|
|
|
pageNumber: 1,
|
|
|
total: 0,
|
|
|
+ isDisabled: false,
|
|
|
// 筛选时间 start_time end_time
|
|
|
dataRange: [],
|
|
|
startTime: '',
|
|
@@ -162,6 +169,7 @@ export default {
|
|
|
quality: '',
|
|
|
// 充值质量-常量
|
|
|
qualityCon,
|
|
|
+ str: ''
|
|
|
};
|
|
|
},
|
|
|
created () {
|
|
@@ -184,7 +192,40 @@ export default {
|
|
|
if (newVal != 30) {
|
|
|
this.time = ''
|
|
|
}
|
|
|
+ },
|
|
|
+ mch_order: {
|
|
|
+ handler(newVal) {
|
|
|
+ // console.log('newVal', newVal);
|
|
|
+ if (!newVal) {
|
|
|
+ this.isDisabled = true
|
|
|
+ } else {
|
|
|
+ this.isDisabled = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ order_sn: {
|
|
|
+ handler(newVal) {
|
|
|
+ // console.log('newVal', newVal);
|
|
|
+ if (!newVal) {
|
|
|
+ this.isDisabled = true
|
|
|
+ } else {
|
|
|
+ this.isDisabled = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ card_no: {
|
|
|
+ handler(newVal) {
|
|
|
+ // console.log('newVal', newVal);
|
|
|
+ if (!newVal) {
|
|
|
+ this.isDisabled = true
|
|
|
+ } else {
|
|
|
+ this.isDisabled = false
|
|
|
}
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取订单列表
|
|
@@ -307,16 +348,43 @@ export default {
|
|
|
},
|
|
|
// 设置默认日期
|
|
|
fetchData() {
|
|
|
- let date = new Date()
|
|
|
+ let date = new Date()
|
|
|
let y = date.getFullYear()
|
|
|
let m = date.getMonth() + 1
|
|
|
let d = date.getDate()
|
|
|
let dEnd = date.getDate() + 1
|
|
|
- let timeStart = (new Date(`${y}/${m}/${d}`)).getTime()
|
|
|
- let timeEnd = (new Date(`${y}/${m}/${dEnd}`)).getTime()
|
|
|
+ let h = date.getHours(); //获取系统时
|
|
|
+ let hend = date.getHours() - 1; //获取系统时
|
|
|
+ let mm = date.getMinutes(); //获取系统时
|
|
|
+ let s = date.getSeconds(); //获取系统时
|
|
|
+ let sEnd = date.getSeconds() + 1; //获取系统时
|
|
|
+ let p = 0
|
|
|
+ // let timeStart = (new Date(`${y}/${m}/${d} ${h}:${mm}:${s}`)).getTime()
|
|
|
+ // let timeEnd = (new Date(`${y}/${m}/${dEnd} ${h}:${mm}:${sEnd}`)).getTime()
|
|
|
+ if (!this.mch_order || !this.order_sn || !this.mch_order) {
|
|
|
+ let timeStart = (new Date(`${y}/${m}/${d} ${hend}:${mm}:${s}`)).getTime()
|
|
|
+ let timeEnd = (new Date(`${p}/${p}/${p} ${p}:${p}:${p}`)).getTime()
|
|
|
this.dataRange[0] = timeStart
|
|
|
this.dataRange[1] = timeEnd
|
|
|
+ } else {
|
|
|
+ let timeStart = (new Date(`${y}/${m}/${d} ${h}:${mm}:${s}`)).getTime()
|
|
|
+ let timeEnd = (new Date(`${y}/${m}/${dEnd} ${h}:${mm}:${sEnd}`)).getTime()
|
|
|
+ this.dataRange[0] = timeStart
|
|
|
+
|
|
|
+ this.dataRange[1] = timeEnd
|
|
|
+ }
|
|
|
},
|
|
|
+ // 时间获取焦点
|
|
|
+ hFocusDate() {
|
|
|
+ if (!this.mch_order && !this.order_sn && !this.card_no) {
|
|
|
+ if (this.timer) {
|
|
|
+ window.clearTimeout(this.timer)
|
|
|
+ }
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.$message.warning('请先输入单号')
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 导出
|
|
|
async onExport() {
|
|
|
if (this.dataRange == null) {
|
|
@@ -346,7 +414,58 @@ export default {
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ //复制
|
|
|
+ async onExcopy() {
|
|
|
+
|
|
|
+ if (this.dataRange == null) {
|
|
|
+ this.startTime = ''
|
|
|
+ this.endTime = ''
|
|
|
+ } else {
|
|
|
+ this.startTime = this.dataRange[0]/1000 || ''
|
|
|
+ this.endTime = this.dataRange[1]/1000 || ''
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ let param = new URLSearchParams()
|
|
|
+
|
|
|
+ param.append('curpage', this.pageNumber)
|
|
|
+ param.append('start_time', this.startTime)
|
|
|
+ param.append('end_time', this.endTime)
|
|
|
+ param.append('card_type', this.RechargeType)
|
|
|
+ param.append('order_state', this.RechargeStatus)
|
|
|
+ param.append('refill_amount', this.amount)
|
|
|
+ param.append('mch_order', this.mch_order)
|
|
|
+ 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(param)
|
|
|
+ console.log('复制', res);
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ this.tableData = res.datas.data
|
|
|
+ this.total = res.datas.total * this.pageSize
|
|
|
+ const { data } = res.datas;
|
|
|
+ console.log("zhu", data);
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ let str = ''
|
|
|
+ data.forEach(i => {
|
|
|
+ // eslint-disable-next-line no-const-assign
|
|
|
+ str += i.order_sn + '\n'
|
|
|
+ })
|
|
|
+ console.log(str);
|
|
|
+ let oInput = document.createElement("textarea");
|
|
|
+ oInput.style.border = "0 none";
|
|
|
+ oInput.style.color = "transparent";
|
|
|
+ oInput.value = str;
|
|
|
+ document.body.appendChild(oInput);
|
|
|
+ oInput.select(); // 选择对象
|
|
|
+ document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
+ oInput.parentNode.removeChild(oInput)
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -372,7 +491,7 @@ export default {
|
|
|
width: 20px;/*no */
|
|
|
}
|
|
|
/deep/.el-date-editor.yezi_date .el-range-input {
|
|
|
- width: 100px;/*no */
|
|
|
+ width: 135px;/*no */
|
|
|
}
|
|
|
/deep/.el-input,
|
|
|
/deep/.el-date-editor.yezi_date .el-range-input,
|