导出待发货订单

master
mabo 2021-07-02 09:10:53 +08:00
parent 6100f1e39a
commit be2280907e
3 changed files with 27 additions and 20 deletions

View File

@ -90,7 +90,7 @@
<template v-if="detail.goodsParamsDTOList && detail.goodsParamsDTOList.length"> <template v-if="detail.goodsParamsDTOList && detail.goodsParamsDTOList.length">
<div class="goods-params" v-for="item in detail.goodsParamsDTOList" :key="item.groupId"> <div class="goods-params" v-for="item in detail.goodsParamsDTOList" :key="item.groupId">
<span class="ml_10">{{item.groupName}}</span> <span class="ml_10">{{item.groupName}}</span>
<table class="mt_10" cellpadding='0' cellspacing="0" > <table class="mb_10" cellpadding='0' border="1" cellspacing="0" >
<tr v-for="param in item.goodsParamsItemDTOList" :key="param.paramId"> <tr v-for="param in item.goodsParamsItemDTOList" :key="param.paramId">
<td style="text-align:right">{{param.paramName}}</td><td>{{param.paramValue}}</td> <td style="text-align:right">{{param.paramName}}</td><td>{{param.paramValue}}</td>
</tr> </tr>
@ -489,16 +489,17 @@ export default {
color: $theme_color; color: $theme_color;
} }
table{ table{
border-color: #eee; border-color:#efefef;
color: #999; color: #999;
width: 50%; min-width: 30%;
margin-left: 10px; margin-left: 10px;
font-size: 12px;
tr{ tr{
td:nth-child(1){ td:nth-child(1){
width: 100px; min-width: 70px;
} }
td:nth-child(2){ td:nth-child(2){
padding-left: 20px; padding-left: 10px;
} }
} }
td{ td{

View File

@ -12,7 +12,7 @@ export const verificationCode = verificationCode => {
export const downLoadDeliverExcel = params => { export const downLoadDeliverExcel = params => {
return getRequest(`/orders/downLoadDeliverExcel`, params, 'blob'); return getRequest(`/orders/downLoadDeliverExcel`, params, 'blob');
}; };
// 下载待发货的订单列表 // 导出待发货订单
export const queryExportOrder = params => { export const queryExportOrder = params => {
return getRequest(`/orders/queryExportOrder`, params); return getRequest(`/orders/queryExportOrder`, params);
}; };

View File

@ -30,8 +30,7 @@
<Button type="primary" class="export" @click="expressOrderDeliver"> <Button type="primary" class="export" @click="expressOrderDeliver">
批量发货 批量发货
</Button> </Button>
<download-excel
<!-- <download-excel
style="display:inline-block;" style="display:inline-block;"
:data="data" :data="data"
:fields="excelColumns" :fields="excelColumns"
@ -41,7 +40,7 @@
<Button type="success"> <Button type="success">
导出待发货订单 导出待发货订单
</Button> </Button>
</download-excel> --> </download-excel>
</div> </div>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"></Table> <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
@ -56,6 +55,7 @@
import * as API_Order from "@/api/order"; import * as API_Order from "@/api/order";
import { verificationCode } from "@/api/order"; import { verificationCode } from "@/api/order";
import JsonExcel from "vue-json-excel"; import JsonExcel from "vue-json-excel";
import Cookies from "js-cookie";
export default { export default {
name: "orderList", name: "orderList",
components: { components: {
@ -87,8 +87,6 @@ export default {
endTime: "", endTime: "",
billPrice: "", billPrice: "",
}, },
//
formValidate: {},
submitLoading: false, // submitLoading: false, //
columns: [ columns: [
{ {
@ -195,9 +193,9 @@ export default {
excelColumns: { // excel excelColumns: { // excel
'编号': 'index', '编号': 'index',
'订单号': 'sn', '订单号': 'sn',
'收货人': 'memberName', '收货人': 'consigneeName',
'收货人联系电话': 'memberName', '收货人联系电话': 'consigneeMobile',
'收货地址': 'memberName', '收货地址': 'consigneeAddress',
} }
}; };
}, },
@ -274,21 +272,29 @@ export default {
}, },
// //
async exportOrder () { async exportOrder () {
let userInfo = JSON.parse(Cookies.get("userInfo"));
console.log(userInfo);
const params = { const params = {
// //
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 100, //
sort: "", // sort: "startDate", //
order: "", // order: "desc", //
startDate: "", // startDate: "", //
endDate: "", // endDate: "", //
orderSn: "", orderSn: "",
buyerName: "", buyerName: "",
orderStatus: "UNDELIVERED", tag: "WAIT_ROG",
orderType: "NORMAL", orderType: "NORMAL",
storeId: userInfo.id
} }
const res = await API_Order.getOrderList(params) const res = await API_Order.queryExportOrder(params)
return res.result.records for (let i=0; i<res.result.length; i++) {
res.result[i].index = i+1;
res.result[i].consigneeAddress =
res.result[i].consigneeAddressPath.replace(/,/g, "") + res.result[i].consigneeDetail
}
return res.result
}, },
// //
detail(v) { detail(v) {