订单列表添加分类展示,名医精彩导出
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<el-tab-pane label="电子书" name="1"> </el-tab-pane>
|
||||
<el-tab-pane label="充值订单" name="2"></el-tab-pane>
|
||||
</el-tabs> -->
|
||||
<div style=" display: flex; margin-bottom: 15px;">
|
||||
<div style=" display: flex; margin-bottom: 15px; position: relative;">
|
||||
<el-radio-group size="mini" v-model="tabChange.tabActiveName">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">待付款</el-radio-button>
|
||||
@@ -15,14 +15,18 @@
|
||||
<el-radio-button label="3">已完成</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<div class="order_type_block" style=" display: none;">
|
||||
<div class="order_type_block">
|
||||
<span>订单类型</span>
|
||||
<el-select v-model="orderType" placeholder="请选择" style=" padding-left: 10px;">
|
||||
<el-option label="VIP订单" value="1">VIP订单</el-option>
|
||||
<el-option label="名医精彩订单" value="2">名医精彩订单</el-option>
|
||||
<el-option label="普通订单" value="3">普通订单</el-option>
|
||||
<el-option label="名医精彩" value="mingyijingcai">名医精彩</el-option>
|
||||
<el-option label="VIP" value="vip">VIP</el-option>
|
||||
|
||||
<el-option label="普通" value="order">普通</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-button type="primary" style="padding: 5px 20px; font-size: 12px; margin-left: 10px;" @click=" pageIndex = 1; getDataList();">查询</el-button>
|
||||
<el-button v-if="daochuStatus" type="primary" style="position: absolute; right: 0; top: 0;" @click="handleExport()">导出</el-button>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 10px;">
|
||||
@@ -367,8 +371,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="productList" header-align="center" align="center" label="下单商品" width="450">
|
||||
<template slot-scope="scope">
|
||||
<!-- {{scope.row.goodsList}} -->
|
||||
<div v-for="(item, index) in scope.row.productList" :key="index">
|
||||
|
||||
<div v-if="scope.row.orderType=='order'" v-for="(item, index) in scope.row.productList" :key="index">
|
||||
<div class="flexbox" style="align-items:center; margin-bottom:10px">
|
||||
<div class="img">
|
||||
<img style="padding: 2px; border:1px solid #f1f1f1; margin-right: 5px;" :src="item.product.productImages"
|
||||
@@ -381,6 +385,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="scope.row.orderType=='relearn'" style=" text-align: left;">
|
||||
<span style="color:red;">复读:</span><span>{{ scope.row.remark }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="scope.row.orderType=='vip'">
|
||||
<span>{{ scope.row.vipBuyConfigEntity.title }}<b style="color:red;">({{ scope.row.vipBuyConfigEntity.year }}年)</b></span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="shippingTime" header-align="center" align="center" label="发货时间">
|
||||
@@ -572,7 +584,7 @@
|
||||
sheetVisible: false,
|
||||
dataList: [],
|
||||
tabChange: {
|
||||
tabActiveName: '1', // tab筛选默认all全部 0:待付款 1:待发货 2:已发货 3:已完成
|
||||
tabActiveName: '', // tab筛选默认all全部 0:待付款 1:待发货 2:已发货 3:已完成
|
||||
isPrint: 0, // 已发货列表筛选 0:显示订单 1:显示可打印列表,
|
||||
orderName: '0', //订单名称筛选 all:全部 0:健康超市 1:电子书 2:充值订单
|
||||
sheetCode: 2, // 面单状态2 未打印,1 已打印 0全部
|
||||
@@ -672,6 +684,7 @@
|
||||
booksShow: false, // 展示包含书籍信息
|
||||
currBookLIst: [],
|
||||
orderType: '', //订单类型
|
||||
daochuStatus: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -737,7 +750,7 @@
|
||||
|
||||
|
||||
changeFilterPresale(){
|
||||
this.pageIndex = 1
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
seeBooks(arr) {
|
||||
@@ -967,21 +980,10 @@ this.pageIndex = 1
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/buyOrder/list'),
|
||||
url: this.$http.adornUrl('/book/buyOrder/orderList'),
|
||||
method: 'post',
|
||||
// params: this.$http.adornParams({
|
||||
// 'page': this.pageIndex,
|
||||
// 'limit': this.pageSize,
|
||||
// 'key': this.dataForm.key,
|
||||
// 'startTime': this.dataForm.time[0],
|
||||
// 'endTime': this.dataForm.time[1],
|
||||
// 'orderStatus': this.tabChange.tabActiveName, // 订单状态参数
|
||||
// 'isPrint': this.tabChange.isPrint,
|
||||
// 'orderorderType': this.tabChange.orderName,
|
||||
// }),
|
||||
data: this.$http.adornData({
|
||||
"searchKeyWord": this.dataForm.key,
|
||||
"productName": this.dataForm.productName,
|
||||
@@ -991,10 +993,9 @@ this.pageIndex = 1
|
||||
"pageIndex": this.pageIndex,
|
||||
"pageSize": this.pageSize,
|
||||
"filterPresale": this.dataForm.filterPresale?1:0,
|
||||
"orderType": this.orderType
|
||||
})
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
}).then(({data}) => {
|
||||
// console.log(data,'列表数据')
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.result.records
|
||||
@@ -1002,6 +1003,12 @@ this.pageIndex = 1
|
||||
if (this.tabChange.tabActiveName === '1') { // 判断可选按钮是否可用
|
||||
this.isMultipleDisabled()
|
||||
}
|
||||
//如果是名医精彩 出现导出按钮
|
||||
if(this.orderType=='mingyijingcai'){
|
||||
this.daochuStatus = true;
|
||||
}else{
|
||||
this.daochuStatus = false;
|
||||
}
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
@@ -1009,10 +1016,6 @@ this.pageIndex = 1
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 作废面单
|
||||
// deleteVoid(sheetId) {
|
||||
// console.log('作废面单:传值:面单号+快递订单号+快递公司编码')
|
||||
// },
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
@@ -1041,7 +1044,6 @@ this.pageIndex = 1
|
||||
// 面单批量选择
|
||||
SheetSelectionChangeHandle(val) {
|
||||
this.SheetSelectionList = val
|
||||
// console.log(this.SheetSelectionList,'选中的打印列表')
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
@@ -1133,7 +1135,6 @@ this.pageIndex = 1
|
||||
},
|
||||
// 批量/单个打印面单
|
||||
printHandle(id, row) {
|
||||
// console.log(id, row)
|
||||
// 如果是传了id
|
||||
if (id) {
|
||||
// console.log(id, '传了')
|
||||
@@ -1145,11 +1146,6 @@ this.pageIndex = 1
|
||||
this.SheetSelectionList = [row]
|
||||
let SheetList = this.SheetSelectionList.map(item => item.printString)
|
||||
this.selectedPrintList = SheetList
|
||||
// console.log(this.selectedPrintList, 'this.selectedPrintList')
|
||||
//遍历数组列表
|
||||
// this.PrintSheetList.map(item => {
|
||||
// if(item.expressOrderSn == id){ return this.selectedPrintList = [item.printTemplate]}
|
||||
// console.log(this.selectedPrintList,'this.selectedPrintList待打印列表')
|
||||
setTimeout(() => {
|
||||
this.handlePrintSheet()
|
||||
}, 1000);
|
||||
@@ -1213,7 +1209,6 @@ this.pageIndex = 1
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
var printids = this.SheetSelectionList.map(item => item.id)
|
||||
// console.log(printids,'printids打印的isd',)
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/express/printTemplate'),
|
||||
method: 'post',
|
||||
@@ -1237,15 +1232,6 @@ this.pageIndex = 1
|
||||
console.log(e, 'e')
|
||||
loading.close()
|
||||
})
|
||||
|
||||
// setTimeout(() => {
|
||||
// this.selectedPrintList = []
|
||||
// this.SheetSelectionList = []
|
||||
// }, 1000);
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '删除成功!'
|
||||
// });
|
||||
}).catch(() => {
|
||||
console.log('打印出错了')
|
||||
});
|
||||
@@ -1345,6 +1331,45 @@ this.pageIndex = 1
|
||||
handleCheckedChange(val) {
|
||||
console.log(val)
|
||||
this.checkedOrders = val
|
||||
},
|
||||
//名医精彩-导出
|
||||
handleExport(){
|
||||
this.dataListLoading = true;
|
||||
try {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/buyOrder/exportMingyijingcaiOrder"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
searchKeyWord: this.dataForm.key,
|
||||
productName: this.dataForm.productName,
|
||||
orderType: this.orderType
|
||||
}),
|
||||
responseType: "blob"
|
||||
}).then(res => {
|
||||
const blob = new Blob([res.data], {
|
||||
type:
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
});
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = '名医精彩订单数据文件';
|
||||
link.click();
|
||||
|
||||
window.URL.revokeObjectURL(link.href); // 释放内存
|
||||
this.dataListLoading = false;
|
||||
this.$message({
|
||||
message: "名医精彩订单数据文件下载完成,请注意查看!",
|
||||
type: "success",
|
||||
duration: 3000,
|
||||
showClose: true
|
||||
});
|
||||
|
||||
});
|
||||
} catch (err) {
|
||||
this.$message.error("文件下载失败!");
|
||||
this.dataListLoading = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
Reference in New Issue
Block a user