|
@@ -15,9 +15,12 @@
|
|
|
</el-select>
|
|
|
<el-date-picker
|
|
|
v-model="dataRange"
|
|
|
- clearable value-format="timestamp" format="yyyy-MM-dd"
|
|
|
- type="datetimerange" range-separator="至"
|
|
|
- start-placeholder="开始日期" end-placeholder="结束日期" style="width:260px;"
|
|
|
+ clearable
|
|
|
+ value-format="timestamp"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择日期"
|
|
|
+ type="date"
|
|
|
+ style="width:260px;"
|
|
|
@focus="hFocusDate"
|
|
|
:disabled="isDisabled"></el-date-picker>
|
|
|
<el-button style="margin-left:10px;" type="primary" @click="onSearch" :loading="searchLoading">查询</el-button>
|
|
@@ -32,20 +35,48 @@
|
|
|
<el-table-column align="center" prop="sendCount" label="充值中订单数"></el-table-column>
|
|
|
<el-table-column align="center" prop="refill_amounts" label="总充值金额"></el-table-column>
|
|
|
<el-table-column align="center" prop="mch_amounts" label="总扣款金额"></el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table :data="exportOrderList" border style="width: 100%;font-size:13px;margin-top:20px;" v-loading="isLoading">
|
|
|
+ <el-table-column align="center" prop="title" label="标题" width="600" />
|
|
|
+ <el-table-column align="center" prop="state" label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag type="info" v-if="scope.row.state == 1">待处理</el-tag>
|
|
|
+ <el-tag v-if="scope.row.state == 2">处理中</el-tag>
|
|
|
+ <el-tag type="success" v-if="scope.row.state == 3">已处理</el-tag>
|
|
|
+ <el-tag type="danger" v-if="scope.row.state == 4">处理错误</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" prop="errorCount" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" disabled v-if="scope.row.state != 3">下载</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="downloadfile(scope.row.file_path)">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-row style="margin-top:10px;" type="flex" justify="end">
|
|
|
+ <el-pagination background layout="prev, pager, next" :page-count="total" @current-change="onPageChange" :current-page="curpage"></el-pagination>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
// getRec-对账管理
|
|
|
-import { getRec,getExportOrder } from '@/api'
|
|
|
+import { getRec,getExportOrder,getExportOrderList } from '@/api'
|
|
|
import { RecTime } from '@/utils/constants'
|
|
|
export default {
|
|
|
name: 'reconciliation',
|
|
|
data () {
|
|
|
return {
|
|
|
- dataRange: [],
|
|
|
+ dataRange: '',
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
value: '',
|
|
@@ -67,10 +98,14 @@ export default {
|
|
|
isDisabled: false,
|
|
|
tableData: [],
|
|
|
isLoading: false,
|
|
|
- searchLoading: false
|
|
|
+ searchLoading: false,
|
|
|
+ exportOrderList: [],
|
|
|
+ curpage:1,
|
|
|
+ total:5
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getExportOrderList();
|
|
|
},
|
|
|
// 监听器
|
|
|
watch: {
|
|
@@ -94,6 +129,24 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onPageChange(page){
|
|
|
+ if(page == this.curpage) return;
|
|
|
+ this.curpage = page;
|
|
|
+ this.getExportOrderList();
|
|
|
+ },
|
|
|
+ async getExportOrderList(){
|
|
|
+ this.isLoading = true;
|
|
|
+ const res = await getExportOrderList(this.curpage);
|
|
|
+ this.isLoading = false;
|
|
|
+ if(res && res.code == 200) {
|
|
|
+ console.log('getExportOrderList',res.datas);
|
|
|
+ this.exportOrderList = res.datas.data;
|
|
|
+ this.total = res.datas.total;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$message.warning('获取导出列表失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
async onExportOrder(){
|
|
|
try {
|
|
|
if (!this.value) {
|
|
@@ -107,23 +160,24 @@ export default {
|
|
|
}
|
|
|
this.searchLoading = true
|
|
|
this.isLoading = true
|
|
|
- this.startTime = this.dataRange[0]/1000
|
|
|
- this.endTime = this.dataRange[1]/1000
|
|
|
+ console.log('this.dataRange',this.dataRange);
|
|
|
+ this.startTime = this.dataRange/1000
|
|
|
+ this.endTime = (this.dataRange+86400000)/1000
|
|
|
let param = new URLSearchParams()
|
|
|
param.append('time_type', this.value)
|
|
|
param.append('start_time', this.startTime)
|
|
|
param.append('end_time', this.endTime)
|
|
|
let res = await getExportOrder(param)
|
|
|
- console.log('导出订单', res);
|
|
|
+
|
|
|
if (res && res.code == 200) {
|
|
|
- this.recForm = res.datas
|
|
|
- if (!this.tableData.length) {
|
|
|
- this.tableData.push(res.datas)
|
|
|
- } else {
|
|
|
- const obj = this.tableData[0]
|
|
|
- // console.log('obj', obj);
|
|
|
- this.tableData[0] = Object.assign(obj, res.datas)
|
|
|
- }
|
|
|
+ console.log('导出订单', res.datas.file_path);
|
|
|
+ if(res.datas.file_path) {
|
|
|
+ this.downloadfile(res.datas.file_path)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$message.warning('暂无导出订单')
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
this.isLoading = false
|
|
|
this.searchLoading = false
|
|
@@ -133,6 +187,15 @@ export default {
|
|
|
this.searchLoading = false
|
|
|
}
|
|
|
},
|
|
|
+ downloadfile(file_path){
|
|
|
+ const a = document.createElement('a');
|
|
|
+ a.href = file_path;
|
|
|
+ a.download = '导出订单';
|
|
|
+ a.style.display = 'none';
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ },
|
|
|
// 查询
|
|
|
async onSearch() {
|
|
|
try {
|
|
@@ -147,8 +210,8 @@ export default {
|
|
|
}
|
|
|
this.searchLoading = true
|
|
|
this.isLoading = true
|
|
|
- this.startTime = this.dataRange[0]/1000
|
|
|
- this.endTime = this.dataRange[1]/1000
|
|
|
+ this.startTime = this.dataRange/1000
|
|
|
+ this.endTime = (this.dataRange+86400000)/1000
|
|
|
let param = new URLSearchParams()
|
|
|
param.append('time_type', this.value)
|
|
|
param.append('start_time', this.startTime)
|