Commit 1aa62dc9 authored by chicheng's avatar chicheng

要货区分新老发票

parent fde8664c
......@@ -10,7 +10,7 @@
import {
mapState
} 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 purchaseReceive from '../purchase-receive/purchase-receive'
......@@ -206,14 +206,24 @@
}
},
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]}
const newInvoice = res.data.newInvoice != null && res.data.newInvoice !== ''
? Number(res.data.newInvoice)
: invoiceMeta.newInvoice
// sourceType区分货权转移
this.detail = {
'shuntTypeName': ' ',
'shuntName': ' ',
'channelTypeName': '',
...res.data,
deliveryFlag: invoiceMeta.deliveryFlag,
newInvoice,
isPcj:0,
isPcjName:'否',
significance: 'normal',
......
......@@ -101,7 +101,8 @@
import {
apiPurchaseList,
apiGetUnFinishedInvByPromote
apiGetUnFinishedInvByPromote,
resolveDeliveryInvoiceMeta
} from '@/servers/purchaseList.js'
import timeFormat from '@/uview-ui/libs/function/timeFormat.js'
......@@ -228,6 +229,7 @@
}
const params = {
...row,
...resolveDeliveryInvoiceMeta(row),
demandType: this.sourceType ==='wine' ? '1' : '2'
}
uni.navigateTo({
......@@ -270,6 +272,7 @@
purchaseBtn(item) {
const params = {
...item,
...resolveDeliveryInvoiceMeta(item),
demandType: this.sourceType ==='common' ? '1' : '2'
}
uni.navigateTo({
......
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