2023-3-27

This commit is contained in:
2023-03-27 18:24:21 +08:00
parent 75a7a53ef5
commit f2a3c1daf9
6 changed files with 181 additions and 87 deletions

View File

@@ -239,7 +239,8 @@
closeOrder,
deleteOrder,
orderData,
exportExcel
exportExcel,
newDeliveryOrder
} from '@/api/order';
import {
formatDate
@@ -544,14 +545,22 @@
this.closeOrder.orderIds = [row.id];
},
handleDeliveryOrder(index, row) {
let listItem = this.covertOrder(row);
console.log("listItem", listItem)
this.$router.push({
path: '/oms/deliverOrderList',
query: {
list: [listItem]
}
// let listItem = this.covertOrder(row);
// console.log("listItem", listItem)
// this.$router.push({
// path: '/oms/deliverOrderList',
// query: {
// list: [listItem]
// }
// });
let idList = []
idList.push({
orderId: row.id
});
this.sendGoods("是否确认发货", idList);
},
handleViewLogistics(index, row) {
this.logisticsDialogVisible = true;
@@ -769,6 +778,48 @@
// 批量发货
doBatch() {
if (this.multipleSelection.length == 0) {
this.$message({
message: '暂无数据可导出!',
type: 'warning',
duration: 1000
});
return
}
let idList = []
this.multipleSelection.forEach(row => {
idList.push({
orderId: row.id
})
});
this.sendGoods("是否确认批量发货?", idList);
},
// 发货
sendGoods(str, idList) {
this.$confirm(str, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
newDeliveryOrder(idList).then(response => {
this.$message({
type: 'success',
message: '发货成功!'
});
this.getList();
this.orderDatas(this.listQuery.status);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消发货'
});
});
},
// 导出
doExport() {
@@ -781,24 +832,24 @@
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
// const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// })
this.listQuery = {
status: 0,
orderSn: '00382',
receiverPhone: '',
createTimeStart: '',
createTimeEnd: ''
const data = {
status: this.listQuery.status == null ? "" : this.listQuery.status,
orderSn: this.listQuery.orderSn == null ? "" : this.listQuery.orderSn,
receiverPhone: this.listQuery.receiverPhone == null ? "" : this.listQuery.receiverPhone,
createTimeStart: this.listQuery.createTimeStart == null ? "" : this.listQuery.createTimeStart,
createTimeEnd: this.listQuery.createTimeEnd == null ? "" : this.listQuery.createTimeEnd,
}
exportExcel(this.listQuery).then((resp) => {
// loading.close()
exportExcel(data).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel;charset=utf-8'
type: 'application/vnd.ms-excel;charset=UTF-8'
})
const fileName = '订单列表' + '.xls'
const elink = document.createElement('a')
@@ -810,7 +861,7 @@
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
// loading.close()
loading.close()
})
},

View File

@@ -400,6 +400,14 @@
},
// 导出
doExport() {
if (this.list.length == 0) {
this.$message({
message: '暂无数据可导出!',
type: 'warning',
duration: 1000
});
return
}
const loading = this.$loading({
lock: true,
@@ -407,7 +415,14 @@
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
exportExcel(this.listQuery).then((resp) => {
const data = {
status: this.listQuery.status == null ? "" : this.listQuery.status,
receiverPhone: this.listQuery.receiverPhone == null ? "" : this.listQuery.receiverPhone,
valueszd: this.listQuery.valueszd == null ? "" : this.listQuery.valueszd,
valueqhd: this.listQuery.valueqhd == null ? "" : this.listQuery.valueqhd,
}
exportExcel(data).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'