|
@@ -22,6 +22,8 @@
|
|
|
:disabled="isDisabled"></el-date-picker>
|
|
|
<el-button style="margin-left:10px;" type="primary" @click="onSearch" :loading="searchLoading">查询</el-button>
|
|
|
<el-button style="margin-left:10px;" type="danger" @click="onReset">重置</el-button>
|
|
|
+ <el-button style="margin-left:10px;" type="primary" @click="onExportOrder">导出订单</el-button>
|
|
|
+
|
|
|
</div>
|
|
|
<el-table :data="tableData" border style="width: 100%;font-size:13px;" v-loading="isLoading">
|
|
|
<el-table-column align="center" prop="count" label="订单总数" />
|
|
@@ -37,7 +39,7 @@
|
|
|
|
|
|
<script>
|
|
|
// getRec-对账管理
|
|
|
-import { getRec } from '@/api'
|
|
|
+import { getRec,getExportOrder } from '@/api'
|
|
|
import { RecTime } from '@/utils/constants'
|
|
|
export default {
|
|
|
name: 'reconciliation',
|
|
@@ -92,6 +94,45 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async onExportOrder(){
|
|
|
+ try {
|
|
|
+ if (!this.value) {
|
|
|
+ if (this.timer) {
|
|
|
+ window.clearTimeout(this.timer)
|
|
|
+ }
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.$message.warning('请选择日期类型')
|
|
|
+ }, 1000)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.searchLoading = true
|
|
|
+ this.isLoading = true
|
|
|
+ this.startTime = this.dataRange[0]/1000
|
|
|
+ this.endTime = this.dataRange[1]/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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.isLoading = false
|
|
|
+ this.searchLoading = false
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.isLoading = false
|
|
|
+ this.searchLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
// 查询
|
|
|
async onSearch() {
|
|
|
try {
|