|
|
@ -121,9 +121,14 @@ |
|
|
|
<el-card class="operate-container" shadow="never"> |
|
|
|
<i class="el-icon-tickets"></i> |
|
|
|
<span>数据列表</span> |
|
|
|
|
|
|
|
<el-button style="margin-top: -5px;" type="primary" class="btn-add" @click="doExport()" size="small"> |
|
|
|
导出Excel |
|
|
|
</el-button> |
|
|
|
<el-button v-show="status==0||status==2" style="margin-top: -5px;" type="primary" class="btn-add" |
|
|
|
@click="doBatch()" size="small"> |
|
|
|
批量发货 |
|
|
|
</el-button> |
|
|
|
</el-card> |
|
|
|
<!-- <div class="batch-operate-container"> |
|
|
|
<el-checkbox v-model="printChecked" @change="batchSelection" |
|
|
@ -233,7 +238,8 @@ |
|
|
|
fetchList, |
|
|
|
closeOrder, |
|
|
|
deleteOrder, |
|
|
|
orderData |
|
|
|
orderData, |
|
|
|
exportExcel |
|
|
|
} from '@/api/order'; |
|
|
|
import { |
|
|
|
formatDate |
|
|
@ -493,7 +499,37 @@ |
|
|
|
this.orderDatas(this.listQuery.status); |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
|
|
|
|
console.log("val》》》》》", val) |
|
|
|
|
|
|
|
for (var i = 0; i < val.length; i++) { |
|
|
|
|
|
|
|
if (val[i].status != 2) { |
|
|
|
this.$message({ |
|
|
|
message: '请选择待发货状态的订单', |
|
|
|
type: 'warning', |
|
|
|
duration: 1000 |
|
|
|
}); |
|
|
|
|
|
|
|
let index = this.list.findIndex((item) => { |
|
|
|
|
|
|
|
return item.id === val[i].id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
console.log("index》》》》》", index) |
|
|
|
//dom更新完才执行nextTick回调 |
|
|
|
this.$refs.orderTable.toggleRowSelection(this.list[index], false); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
handleViewOrder(index, row) { |
|
|
|
this.$router.push({ |
|
|
@ -729,9 +765,22 @@ |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 批量发货 |
|
|
|
doBatch() { |
|
|
|
|
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
doExport() { |
|
|
|
if (this.list.length == 0) { |
|
|
|
this.$message({ |
|
|
|
message: '暂无数据可导出!', |
|
|
|
type: 'warning', |
|
|
|
duration: 1000 |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// const loading = this.$loading({ |
|
|
|
// lock: true, |
|
|
@ -739,24 +788,30 @@ |
|
|
|
// spinner: 'el-icon-loading', |
|
|
|
// background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
// }) |
|
|
|
// exportExcel(this.listQuery).then((resp) => { |
|
|
|
this.listQuery = { |
|
|
|
status: 0, |
|
|
|
orderSn: '00382', |
|
|
|
receiverPhone: '', |
|
|
|
createTimeStart: '', |
|
|
|
createTimeEnd: '' |
|
|
|
} |
|
|
|
exportExcel(this.listQuery).then((resp) => { |
|
|
|
// loading.close() |
|
|
|
// const blob = new Blob([resp], { |
|
|
|
// type: 'application/vnd.ms-excel' |
|
|
|
// }) |
|
|
|
// const fileName = '订单列表' + '.xls' |
|
|
|
// const elink = document.createElement('a') |
|
|
|
// elink.download = fileName |
|
|
|
// elink.style.display = 'nonde' |
|
|
|
// elink.href = URL.createObjectURL(blob) |
|
|
|
// document.body.appendChild(elink) |
|
|
|
// elink.click() |
|
|
|
// URL.revokeObjectURL(elink.href) |
|
|
|
// document.body.removeChild(elink) |
|
|
|
// }).catch(() => { |
|
|
|
const blob = new Blob([resp], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}) |
|
|
|
const fileName = '订单列表' + '.xls' |
|
|
|
const elink = document.createElement('a') |
|
|
|
elink.download = fileName |
|
|
|
elink.style.display = 'nonde' |
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(elink) |
|
|
|
elink.click() |
|
|
|
URL.revokeObjectURL(elink.href) |
|
|
|
document.body.removeChild(elink) |
|
|
|
}).catch(() => { |
|
|
|
// loading.close() |
|
|
|
// }) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
handleExportOption(val) { |
|
|
|