提交 0b8ca1a7 authored 作者: 刘旭's avatar 刘旭

报价单数量价格合并

上级 85718622
...@@ -244,10 +244,6 @@ let lineId = ref() // 产品线id 可以分辨是产品线还是普通商品 ...@@ -244,10 +244,6 @@ let lineId = ref() // 产品线id 可以分辨是产品线还是普通商品
onLoad((options: any) => { onLoad((options: any) => {
if (options.lineId) lineId.value = options.lineId if (options.lineId) lineId.value = options.lineId
orderId.value = options.orderId orderId.value = options.orderId
nextTick(() => {
initQuotationDelivery()
initQuotationPayment()
})
// 判断是否重复报价 // 判断是否重复报价
quotationExist({ orderId: orderId.value }).then((res: any) => { quotationExist({ orderId: orderId.value }).then((res: any) => {
if (res.data.code === 200) { if (res.data.code === 200) {
...@@ -261,6 +257,8 @@ onLoad((options: any) => { ...@@ -261,6 +257,8 @@ onLoad((options: any) => {
initQuotaionData(orderId.value) initQuotaionData(orderId.value)
}, 50) }, 50)
initTax() initTax()
initQuotationDelivery()
initQuotationPayment()
} }
} }
}) })
...@@ -292,7 +290,7 @@ let totlePirce: any = computed(() => { ...@@ -292,7 +290,7 @@ let totlePirce: any = computed(() => {
if (detailData.value) { if (detailData.value) {
detailData.value.map((item: any) => { detailData.value.map((item: any) => {
if (typeof item.unitPrice !== 'undefined') { if (typeof item.unitPrice !== 'undefined') {
totlePic += Number(item.unitPrice); totlePic += Number(item.unitPrice) * Number(item.number);
} }
}); });
} }
...@@ -348,6 +346,7 @@ let submit = () => { ...@@ -348,6 +346,7 @@ let submit = () => {
let data = { let data = {
items: quotationData.value.items, items: quotationData.value.items,
quotation: formData.value, quotation: formData.value,
genesicItems: quotationData.value.genesicItems
}; };
fillQuotation(data).then((res: any) => { fillQuotation(data).then((res: any) => {
if (res.data.code === 200) showModel.value = true if (res.data.code === 200) showModel.value = true
...@@ -434,6 +433,7 @@ let initQuotation = (orderId: number) => { ...@@ -434,6 +433,7 @@ let initQuotation = (orderId: number) => {
}); });
}; };
// 初始化价格数据
let initQuotaionData = (id: number) => { let initQuotaionData = (id: number) => {
// 查询普通商品 // 查询普通商品
orderDetail({ orderId: id }).then((res: any) => { orderDetail({ orderId: id }).then((res: any) => {
...@@ -456,21 +456,33 @@ let initQuotaionData = (id: number) => { ...@@ -456,21 +456,33 @@ let initQuotaionData = (id: number) => {
getProductLineMultipleDetail(lineArr).then((res: any) => { getProductLineMultipleDetail(lineArr).then((res: any) => {
if (res.data.code === 200) { if (res.data.code === 200) {
detailData.value = [] detailData.value = []
for (const key in res.data.data) detailData.value = [...res.data.data[key], ...detailData.value] let data = [] as any
for (const key in res.data.data) data = [...res.data.data[key], ...data]
console.log(data, quotationData.value.items);
quotationData.value.items.forEach((item: any) => {
let flag = true
data.forEach((res: any) => {
if (item.goodsId === res.goodsId && item.entryId === res.id && flag) {
item.specifications = res.specifications
item.picUrl = res.picUrl
flag = false
}
})
})
detailData.value = quotationData.value.items
console.log(quotationData.value.items, 'quotationData.value');
// 从quotationData获取 在detailData中添加 合同报价字段 // 从quotationData获取 在detailData中添加 合同报价字段
if (quotationData.value) { // if (quotationData.value) {
detailData.value.map((detail: any) => { // detailData.value.map((detail: any) => {
detail.unitPrice = undefined // detail.unitPrice = undefined
quotationData.value.items.map((item: any) => { // quotationData.value.items.map((item: any) => {
if (item.goodsName == detail.goodsName) { // if (item.goodsName == detail.goodsName) {
detail.contractQuotation = item.contractQuotation // detail.contractQuotation = item.contractQuotation
} // }
}) // })
}) // })
// console.log(detailData.value); // } else initQuotation(orderId.value)
} else initQuotation(orderId.value)
// console.log(res, '订单详情信息');
} }
}) })
} else { } else {
...@@ -505,7 +517,6 @@ let initQuotationDelivery = () => { ...@@ -505,7 +517,6 @@ let initQuotationDelivery = () => {
label: item.textValue label: item.textValue
}) })
}) })
console.log(paymentList.value, '交货地址');
} }
}) })
} }
...@@ -521,7 +532,6 @@ let initQuotationPayment = () => { ...@@ -521,7 +532,6 @@ let initQuotationPayment = () => {
label: item.textValue label: item.textValue
}) })
}) })
console.log(deliveryList.value, '收款条件');
} }
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论