|
@@ -5,62 +5,61 @@ import { getCompanyList } from '@/api/user'
|
|
let detailArr = []
|
|
let detailArr = []
|
|
let detailData = []
|
|
let detailData = []
|
|
let company = ''
|
|
let company = ''
|
|
|
|
+let invoicePickBeans = []
|
|
// 获取详情
|
|
// 获取详情
|
|
getCompanyLists()
|
|
getCompanyLists()
|
|
function getDetail(id) {
|
|
function getDetail(id) {
|
|
detailArr = []
|
|
detailArr = []
|
|
getDeliverDetail({id}).then(res => {
|
|
getDeliverDetail({id}).then(res => {
|
|
|
|
+ console.log(res.data,'jjj');
|
|
const item = res.data
|
|
const item = res.data
|
|
detailData.push(item)
|
|
detailData.push(item)
|
|
- const table = []
|
|
|
|
- item.invoicePickBeans.length = 5
|
|
|
|
- item.invoicePickBeans.forEach(e => {
|
|
|
|
- table.push({
|
|
|
|
- salesId: e.salesOrderId,
|
|
|
|
- invoiceId: e.invoiceId,
|
|
|
|
- id: e.id,
|
|
|
|
- createTime: e.id ? dateToDayFilter(item.createTime) : '',
|
|
|
|
- enginOrderType: e.enginOrderType == 'HOME' || e.enginOrderType == 'TRADE' ? e.enginOrderNo : e.mainOrderId,
|
|
|
|
- materialName: e.materialName || '',
|
|
|
|
- specification: e.specification || '',
|
|
|
|
- refundableQty: e.refundableQty || 0,
|
|
|
|
- // headerRemark:e.headerRemark,
|
|
|
|
- pjxh1Text: e.pjxh1Text || ''
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- console.log(company);
|
|
|
|
- detailArr.push({
|
|
|
|
- type: item.type,
|
|
|
|
- tiTui:item.type === 2 ? `退货人` : `提货人`,
|
|
|
|
- takerPhone:item.takerPhone || '',
|
|
|
|
- headerRemark:item.remark,
|
|
|
|
- total_num: item.total_num,
|
|
|
|
- company: item.type === 2 ? `${company}销售退货单` : `${company}销售发货单`,
|
|
|
|
- pickOrderWater: item.pickOrderWater,
|
|
|
|
- customerNumber: item.customerNumber,
|
|
|
|
- takerDa:'',
|
|
|
|
- nowDate: nowDate(),
|
|
|
|
- takerName:item.type === 2 ? `退货人:${item.takerName || ''}` : `提货人:${item.takerName || ''}` ,
|
|
|
|
- customerName: item.customerName || '',
|
|
|
|
- correspondName: item.correspondName,
|
|
|
|
- correspondNames:'',
|
|
|
|
- pickCar:item.pickCar || '',
|
|
|
|
- createBy: JSON.parse(
|
|
|
|
- localStorage.getItem("supply_user")
|
|
|
|
- ).nickName,
|
|
|
|
- table
|
|
|
|
- })
|
|
|
|
|
|
+ invoicePickBeans = item.invoicePickBeans
|
|
|
|
+ let len =Math.ceil(invoicePickBeans.length / 5)
|
|
|
|
+ for (let index = 0; index < len; index++) {
|
|
|
|
+ const table = []
|
|
|
|
+ if (invoicePickBeans.length) {
|
|
|
|
+ invoicePickBeans.splice(0,5).forEach(e => {
|
|
|
|
+ table.push({
|
|
|
|
+ salesId: e.salesOrderId,
|
|
|
|
+ invoiceId: e.invoiceId,
|
|
|
|
+ id: e.id,
|
|
|
|
+ createTime: e.id ? dateToDayFilter(item.createTime) : '',
|
|
|
|
+ enginOrderType: e.enginOrderType == 'HOME' || e.enginOrderType == 'TRADE' ? e.enginOrderNo : e.mainOrderId,
|
|
|
|
+ materialName: e.materialName || '',
|
|
|
|
+ specification: e.specification || '',
|
|
|
|
+ refundableQty: e.refundableQty || 0,
|
|
|
|
+ // headerRemark:e.headerRemark,
|
|
|
|
+ pjxh1Text: e.pjxh1Text || ''
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ detailArr.push({
|
|
|
|
+ pageNumber:`${len}/${index+1}`,
|
|
|
|
+ type: item.type,
|
|
|
|
+ tiTui:item.type === 2 ? `退货人` : `提货人`,
|
|
|
|
+ takerPhone:item.takerPhone || '',
|
|
|
|
+ headerRemark:item.remark,
|
|
|
|
+ total_num: item.total_num,
|
|
|
|
+ company: item.type === 2 ? `${company}销售退货单` : `${company}销售发货单`,
|
|
|
|
+ pickOrderWater: item.pickOrderWater,
|
|
|
|
+ customerNumber: item.customerNumber,
|
|
|
|
+ takerDa:'',
|
|
|
|
+ nowDate: nowDate(),
|
|
|
|
+ takerName:item.type === 2 ? `退货人:${item.takerName || ''}` : `提货人:${item.takerName || ''}` ,
|
|
|
|
+ customerName: item.customerName || '',
|
|
|
|
+ correspondName: item.correspondName,
|
|
|
|
+ correspondNames:'',
|
|
|
|
+ pickCar:item.pickCar || '',
|
|
|
|
+ createBy: JSON.parse(
|
|
|
|
+ localStorage.getItem("supply_user")
|
|
|
|
+ ).nickName,
|
|
|
|
+ table
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
- // let filterId =[]
|
|
|
|
- // filterId = newIds.map(k=>{
|
|
|
|
- // return k.id
|
|
|
|
- // })
|
|
|
|
- // filterId = [...new Set(filterId)]
|
|
|
|
- // for (let i = 0; i < filterId.length; i++) {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function nowDate() {
|
|
function nowDate() {
|