mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
导出
This commit is contained in:
parent
55f1d1f133
commit
47f8d4dab4
18
resources/frontend/src/api/plat.js
vendored
18
resources/frontend/src/api/plat.js
vendored
@ -78,3 +78,21 @@ export function getAfterSaleOrders(params) {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function exportOrder(params) {
|
||||||
|
return http({
|
||||||
|
url: "/api/plat_orders",
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exportAfterOrder(params) {
|
||||||
|
return http({
|
||||||
|
url: "/api/plat_after_sale_orders",
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
||||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,7 +62,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="apply_type" label="申请类型" />
|
<el-table-column prop="apply_type" label="申请类型">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ APPLYTYPE[scope.row.apply_type] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="售后单状态">
|
<el-table-column label="售后单状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ STATUS[scope.row.after_sales_status] }}</span>
|
<span>{{ STATUS[scope.row.after_sales_status] }}</span>
|
||||||
@ -87,7 +91,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAfterSaleOrders } from "@/api/plat"
|
import { getAfterSaleOrders, exportAfterOrder } from "@/api/plat"
|
||||||
import { storeList } from "@/api/shop"
|
import { storeList } from "@/api/shop"
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
@ -129,7 +133,12 @@ export default {
|
|||||||
'7': '待(团长)确认退货',
|
'7': '待(团长)确认退货',
|
||||||
'8': '(顾客)撤销',
|
'8': '(顾客)撤销',
|
||||||
'9': '(系统)关闭'
|
'9': '(系统)关闭'
|
||||||
}
|
},
|
||||||
|
APPLYTYPE: {
|
||||||
|
0: '仅退款',
|
||||||
|
1: '退货退款'
|
||||||
|
},
|
||||||
|
exportLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -176,12 +185,42 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
this.exportLoading = true
|
||||||
let params = {
|
let params = {
|
||||||
...this.filter,
|
...this.filter,
|
||||||
created_at_start: this.addTime ? this.addTime[0] : '',
|
created_at_start: this.addTime ? this.addTime[0] : '',
|
||||||
created_at_end: this.addTime ? this.addTime[1] : ''
|
created_at_end: this.addTime ? this.addTime[1] : '',
|
||||||
|
is_export: 1
|
||||||
|
}
|
||||||
|
// window.open("/api/plat_after_sale_orders?" + this.objectToQueryString(params))
|
||||||
|
exportAfterOrder(params).then((res) => {
|
||||||
|
console.log(res.data)
|
||||||
|
this.downLoadXls(res.data)
|
||||||
|
this.$message({ type: 'success', message: '导出成功!' })
|
||||||
|
this.exportLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.exportLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
downLoadXls(response) {
|
||||||
|
const content = response
|
||||||
|
const blob = new Blob([content])
|
||||||
|
const today = new Date().toLocaleDateString()
|
||||||
|
const fileName = `售后单列表${today}.xlsx`
|
||||||
|
if ('download' in document.createElement('a')) {
|
||||||
|
// 非IE下载
|
||||||
|
const elink = document.createElement('a')
|
||||||
|
elink.download = fileName
|
||||||
|
elink.style.display = 'none'
|
||||||
|
elink.href = URL.createObjectURL(blob)
|
||||||
|
document.body.appendChild(elink)
|
||||||
|
elink.click()
|
||||||
|
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||||
|
document.body.removeChild(elink)
|
||||||
|
} else {
|
||||||
|
// IE10+下载
|
||||||
|
navigator.msSaveBlob(blob, fileName)
|
||||||
}
|
}
|
||||||
window.open("/api/plat_after_sale_orders?" + this.objectToQueryString(params))
|
|
||||||
},
|
},
|
||||||
objectToQueryString(obj) {
|
objectToQueryString(obj) {
|
||||||
return Object.keys(obj)
|
return Object.keys(obj)
|
||||||
|
|||||||
@ -84,15 +84,15 @@
|
|||||||
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||||
<el-button type="primary" @click="print">打印</el-button>
|
<el-button type="primary" @click="print">打印</el-button>
|
||||||
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
|
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
|
||||||
<el-button type="warning" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" style="width: 100%"
|
<el-table v-loading="loading" ref="multipleTable" :data="tableData" style="width: 100%" border
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55">
|
<el-table-column type="selection" width="55" align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="店铺名称">
|
<el-table-column label="店铺名称">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -100,34 +100,33 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="跟团号">
|
<el-table-column label="跟团号" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.is_supplier ? '自卖团: ' : '帮卖团: ' }}
|
{{ scope.row.is_supplier ? '自卖团: ' : '帮卖团: ' }}
|
||||||
{{ scope.row.is_supplier ? scope.row.participate_no : scope.row.supply_participate_no }}
|
{{ scope.row.is_supplier ? scope.row.participate_no : scope.row.supply_participate_no }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="收件人信息" width="160">
|
<el-table-column label="收件人信息" width="240">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p>{{ scope.row.receiver_name }}</p>
|
<p>{{ scope.row.receiver_name }} {{ scope.row.receiver_mobile }}</p>
|
||||||
<p>{{ scope.row.receiver_address_province }} {{ scope.row.receiver_address_city }} {{
|
<p>{{ scope.row.receiver_address_province }}/{{ scope.row.receiver_address_city }}/{{
|
||||||
scope.row.receiver_address_district }}</p>
|
scope.row.receiver_address_district }}</p>
|
||||||
<p>{{ scope.row.receiver_address_detail }}</p>
|
<p>{{ scope.row.receiver_address_detail }}</p>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="shipping_status" label="发货状态"></el-table-column>
|
<el-table-column prop="shipping_status" label="发货状态" align="center"></el-table-column>
|
||||||
<el-table-column prop="cancel_status" label="订单状态"></el-table-column>
|
<el-table-column prop="cancel_status" label="订单状态" align="center"></el-table-column>
|
||||||
<el-table-column prop="after_sales_status" label="售后状态"></el-table-column>
|
<el-table-column prop="after_sales_status" label="售后状态" align="center"></el-table-column>
|
||||||
<el-table-column label="商品信息" width="420">
|
<el-table-column label="商品信息" width="380">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="item in scope.row.items" :key="item.id">
|
<div v-for="item in scope.row.items" :key="item.id">
|
||||||
{{ item.goods_name }}
|
{{ item.goods_name }}
|
||||||
<br />
|
|
||||||
<span style="color: red;">+{{ item.goods_number }}</span>
|
<span style="color: red;">+{{ item.goods_number }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="confirm_at" label="下单时间" width="100"></el-table-column>
|
<el-table-column prop="confirm_at" label="下单时间" width="150" align="center"></el-table-column>
|
||||||
<!-- <el-table-column prop="print_status" label="打印次数"></el-table-column> -->
|
<!-- <el-table-column prop="print_status" label="打印次数"></el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
@ -143,9 +142,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { platOrderList, printOrders, printSuccess } from "../../api/plat";
|
import { platOrderList, printOrders, printSuccess, exportOrder } from "@/api/plat";
|
||||||
import { storeList } from "../../api/shop";
|
import { storeList } from "@/api/shop"
|
||||||
import { goodsSkusList } from "../../api/goods";
|
import { goodsSkusList } from "@/api/goods"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -203,6 +202,7 @@ export default {
|
|||||||
defaultPrinter: null,
|
defaultPrinter: null,
|
||||||
taskIDArray: [],
|
taskIDArray: [],
|
||||||
requestIDGetGlobalConfig: '',
|
requestIDGetGlobalConfig: '',
|
||||||
|
exportLoading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -500,6 +500,7 @@ export default {
|
|||||||
return uuid.join('');
|
return uuid.join('');
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
this.exportLoading = true
|
||||||
let params = {
|
let params = {
|
||||||
...this.form,
|
...this.form,
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -508,7 +509,35 @@ export default {
|
|||||||
confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : '',
|
confirm_at_end: this.confirmAt[1] ? this.confirmAt[1] : '',
|
||||||
is_export: 1
|
is_export: 1
|
||||||
}
|
}
|
||||||
window.open("/api/plat_orders?" + this.objectToQueryString(params))
|
// window.open("/api/plat_orders?" + this.objectToQueryString(params))
|
||||||
|
|
||||||
|
exportOrder(params).then((res) => {
|
||||||
|
this.downLoadXls(res.data)
|
||||||
|
this.$message({ type: 'success', message: '导出成功!' })
|
||||||
|
this.exportLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.exportLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
downLoadXls(response) {
|
||||||
|
const content = response
|
||||||
|
const blob = new Blob([content])
|
||||||
|
const today = new Date().toLocaleDateString()
|
||||||
|
const fileName = `订单列表${today}.xlsx`
|
||||||
|
if ('download' in document.createElement('a')) {
|
||||||
|
// 非IE下载
|
||||||
|
const elink = document.createElement('a')
|
||||||
|
elink.download = fileName
|
||||||
|
elink.style.display = 'none'
|
||||||
|
elink.href = URL.createObjectURL(blob)
|
||||||
|
document.body.appendChild(elink)
|
||||||
|
elink.click()
|
||||||
|
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||||
|
document.body.removeChild(elink)
|
||||||
|
} else {
|
||||||
|
// IE10+下载
|
||||||
|
navigator.msSaveBlob(blob, fileName)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
objectToQueryString(obj) {
|
objectToQueryString(obj) {
|
||||||
return Object.keys(obj)
|
return Object.keys(obj)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user