Commit 1aa62dc9 authored by chicheng's avatar chicheng

要货区分新老发票

parent fde8664c
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
import { initAppWantGoods, getChannelType, findById, generateUUID, queryDirectStore,queryPledgeQuantity } from '@/servers/purchaseList.js' import { initAppWantGoods, getChannelType, findById, generateUUID, queryDirectStore, queryPledgeQuantity, resolveDeliveryInvoiceMeta } from '@/servers/purchaseList.js'
import purchaseMain from '../purchase-main/purchase-main' import purchaseMain from '../purchase-main/purchase-main'
import purchaseReceive from '../purchase-receive/purchase-receive' import purchaseReceive from '../purchase-receive/purchase-receive'
...@@ -206,14 +206,24 @@ ...@@ -206,14 +206,24 @@
} }
}, },
async getDetail(){ async getDetail(){
const res = await initAppWantGoods(this.orderItem) const invoiceMeta = resolveDeliveryInvoiceMeta(this.orderItem)
const initParams = {
...this.orderItem,
...invoiceMeta
}
const res = await initAppWantGoods(initParams)
for(let k in res.data){res.data[k] = res.data[k]===null?'':res.data[k]} for(let k in res.data){res.data[k] = res.data[k]===null?'':res.data[k]}
const newInvoice = res.data.newInvoice != null && res.data.newInvoice !== ''
? Number(res.data.newInvoice)
: invoiceMeta.newInvoice
// sourceType区分货权转移 // sourceType区分货权转移
this.detail = { this.detail = {
'shuntTypeName': ' ', 'shuntTypeName': ' ',
'shuntName': ' ', 'shuntName': ' ',
'channelTypeName': '', 'channelTypeName': '',
...res.data, ...res.data,
deliveryFlag: invoiceMeta.deliveryFlag,
newInvoice,
isPcj:0, isPcj:0,
isPcjName:'否', isPcjName:'否',
significance: 'normal', significance: 'normal',
......
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
import { import {
apiPurchaseList, apiPurchaseList,
apiGetUnFinishedInvByPromote apiGetUnFinishedInvByPromote,
resolveDeliveryInvoiceMeta
} from '@/servers/purchaseList.js' } from '@/servers/purchaseList.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js' import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
...@@ -228,6 +229,7 @@ ...@@ -228,6 +229,7 @@
} }
const params = { const params = {
...row, ...row,
...resolveDeliveryInvoiceMeta(row),
demandType: this.sourceType ==='wine' ? '1' : '2' demandType: this.sourceType ==='wine' ? '1' : '2'
} }
uni.navigateTo({ uni.navigateTo({
...@@ -270,6 +272,7 @@ ...@@ -270,6 +272,7 @@
purchaseBtn(item) { purchaseBtn(item) {
const params = { const params = {
...item, ...item,
...resolveDeliveryInvoiceMeta(item),
demandType: this.sourceType ==='common' ? '1' : '2' demandType: this.sourceType ==='common' ? '1' : '2'
} }
uni.navigateTo({ uni.navigateTo({
......
import apiHelper from './api.helper.js' import apiHelper from './api.helper.js'
/**
* getUnFinishedInv / getUnFinishedInvByPromote 列表行字段 deliveryFlag → 要货单 newInvoice
* deliveryFlag === 'X' 表示新票(与 PC 一致)
*/
export function resolveDeliveryInvoiceMeta(item = {}) {
const deliveryFlag = item.deliveryFlag || ''
return {
deliveryFlag,
newInvoice: deliveryFlag === 'X' ? 1 : 0
}
}
/** /**
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment