Commit 5c4ba509 by 杨北旺

Merge branch 'SAAS-V4.37.0' of 192.168.3.233:saas_plus/dj-car-boutique-work-wechat into SAAS-V4.37.0

2 parents 5f9728b4 1fb4b526
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</block> </block>
</view> </view>
<view class="data-value"> <view class="data-value">
{{data[item.key] || '-'}} {{data[item.key] != null ? data[item.key] : '-'}}
<block wx:if="{{item.unit}}"> <block wx:if="{{item.unit}}">
<view class="unit">{{item.unit}}</view> <view class="unit">{{item.unit}}</view>
</block> </block>
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
</view> </view>
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">命中文本</view> <view class="label">命中文本</view>
<view class="value">{{item.hitText || '-'}}</view> <text class="value">{{item.hitText || '-'}}</text>
</view> </view>
<view class="example"> <view class="example">
<view class="label">话术建议</view> <view class="label">话术建议</view>
<view class="value">{{item.suggestions||'-'}}</view> <text class="value">{{item.suggestions||'-'}}</text>
</view> </view>
</view> </view>
</view> </view>
......
import NP from 'number-precision'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -152,7 +153,9 @@ Component({ ...@@ -152,7 +153,9 @@ Component({
c.packageGoods.goodsList = c.packageGoods.goodsList.map(item => { c.packageGoods.goodsList = c.packageGoods.goodsList.map(item => {
x.packageGoods.goodsList.map(ele => { x.packageGoods.goodsList.map(ele => {
if (item.upgradeGoodsId == ele.upgradeGoodsId) { if (item.upgradeGoodsId == ele.upgradeGoodsId) {
console.log(item.price, ele.price);
item.price = ele.price || 0 item.price = ele.price || 0
console.log(item.price, ele.price);
} }
}) })
return item return item
...@@ -164,15 +167,24 @@ Component({ ...@@ -164,15 +167,24 @@ Component({
// else { // else {
// c.goods.price = c.goods.sellPrice || 0 // c.goods.price = c.goods.sellPrice || 0
c.packageGoods.goodsList = c.packageGoods.goodsList.map(ele => { c.packageGoods.goodsList = c.packageGoods.goodsList.map(ele => {
ele.price = ele.price || ele.sellPrice || 0 if (ele?.price !== '' && ele?.price !== null && ele?.price !== undefined) {
ele.price = ele.price
} else {
ele.price = ele.sellPrice || 0
}
// ele.price = ele.price || ele.sellPrice || 0
// console.log(ele, 'ele');
return ele return ele
}) })
// } // }
c.price = c.packageGoods.goodsList.reduce((total, item) => { c.price = c.packageGoods.goodsList.reduce((total, item) => {
total = total + item.price // total = total + item.price
// console.log(item.price, total, 'item.price');
// console.log(NP.plus(0.1, 0.2));
total = NP.plus(item.price, total)
return total return total
}, 0) }, 0)
console.log(c.price, 'c.price ');
chooseList.push(c) chooseList.push(c)
} }
} }
...@@ -226,7 +238,8 @@ Component({ ...@@ -226,7 +238,8 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
let target = `goodsList[${index}].upgradeGoodsList[${ind}].count` let target = `goodsList[${index}].upgradeGoodsList[${ind}].count`
if (!item.count) item.count = 1 if (!item.count) item.count = 1
item.count += count // item.count += count
item.count = NP.plus(item.count, count)
if (item.count < 1) item.count = 1 if (item.count < 1) item.count = 1
if (item.count > 999) item.count = 999 if (item.count > 999) item.count = 999
this.setData({ this.setData({
...@@ -276,14 +289,14 @@ Component({ ...@@ -276,14 +289,14 @@ Component({
arr.push(c) arr.push(c)
} }
}) })
console.log(arr) // console.log(arr)
this.setData({ this.setData({
goodsList: arr goodsList: arr
}) })
}, },
confirm() { confirm() {
let chooseList = this.getChooseList() let chooseList = this.getChooseList()
console.log(chooseList, 'chooseList'); // console.log(chooseList, 'chooseList');
let { let {
goodsList goodsList
} = this.data } = this.data
......
...@@ -4,6 +4,7 @@ import data from '../constant/stepData' ...@@ -4,6 +4,7 @@ import data from '../constant/stepData'
import { import {
priceCounter priceCounter
} from '~/packageEquity/api' } from '~/packageEquity/api'
import NP from 'number-precision'
const defaultLabelWidth = 'var(--fontSize140)' const defaultLabelWidth = 'var(--fontSize140)'
Component({ Component({
options: { options: {
...@@ -199,7 +200,9 @@ Component({ ...@@ -199,7 +200,9 @@ Component({
// } // }
vdQuotationGoodsList[index].packageGoods.goodsList[childind].price = number vdQuotationGoodsList[index].packageGoods.goodsList[childind].price = number
let packagePrice = vdQuotationGoodsList[index].packageGoods.goodsList.reduce((num, item) => { let packagePrice = vdQuotationGoodsList[index].packageGoods.goodsList.reduce((num, item) => {
num = num + parseFloat(item.price || 0) // num = num + parseFloat(item.price || 0)
num = NP.plus(num, parseFloat(item.price || 0))
// num = num + parseFloat(item.price || 0)
return num return num
}, 0) }, 0)
// console.log(packagePrice); // console.log(packagePrice);
...@@ -247,13 +250,15 @@ Component({ ...@@ -247,13 +250,15 @@ Component({
let total = 0 let total = 0
orderInfo.vdQuotationGoodsList.map(i => { orderInfo.vdQuotationGoodsList.map(i => {
if (i.goods) { if (i.goods) {
total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price) // total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price)
total = NP.plus(total, NP.times(parseFloat(i.goods.count || 1), parseFloat(i.goods.price)))
} }
if (i.packageGoods) { if (i.packageGoods) {
console.log(i.packageGoods, 'i.packageGoods'); console.log(i.packageGoods, 'i.packageGoods');
i.packageGoods.goodsList.map(ele => { i.packageGoods.goodsList.map(ele => {
total += parseFloat(ele.count || 1) * parseFloat(ele.price) // total += parseFloat(ele.count || 1) * parseFloat(ele.price)
total = NP.plus(total, NP.times(parseFloat(ele.count || 1), parseFloat(ele.price)))
}) })
} }
}) })
...@@ -535,7 +540,7 @@ Component({ ...@@ -535,7 +540,7 @@ Component({
}) })
} }
}) })
this.setData({orderInfo}) this.setData({ orderInfo })
if (goodsError?.length) return wx.$util.showToast('价格不可低于商品最低价') if (goodsError?.length) return wx.$util.showToast('价格不可低于商品最低价')
if (name == 'confirm') { if (name == 'confirm') {
// 不是修改报价时,需要勾选保险 // 不是修改报价时,需要勾选保险
......
...@@ -322,7 +322,6 @@ ...@@ -322,7 +322,6 @@
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: var(--fontSize64); height: var(--fontSize64);
text-align: end;
min-height: 100%; min-height: 100%;
font-size: var(--fontSize28); font-size: var(--fontSize28);
padding: 0 var(--fontSize16) 0 var(--fontSize50); padding: 0 var(--fontSize16) 0 var(--fontSize50);
......
...@@ -445,7 +445,7 @@ Page({ ...@@ -445,7 +445,7 @@ Page({
wx.$router.redirectTo('CarQuotationPay', obj) wx.$router.redirectTo('CarQuotationPay', obj)
}, },
getOrderInfo() { getOrderInfo() {
let { id, orderInfo } = this.data let { id, orderInfo, quotationGoodsList } = this.data
// 先写死调试 // 先写死调试
getQuotationInfoById({ getQuotationInfoById({
id id
...@@ -468,8 +468,10 @@ Page({ ...@@ -468,8 +468,10 @@ Page({
let obj = { let obj = {
...item, ...item,
upgradeGoodsId: item.goodsId, upgradeGoodsId: item.goodsId,
merchantGoodsId: item.id, merchantGoodsId: item.goodsId,
price: this.divideByHundred(item.goodsPrice) price: this.divideByHundred(item.goodsPrice),
minSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.minSellPrice, // 按商品数据对比补充详情商品最低价
validMinSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
} }
pre.push({ goods: obj, packageGoods: null }) pre.push({ goods: obj, packageGoods: null })
} }
...@@ -478,18 +480,19 @@ Page({ ...@@ -478,18 +480,19 @@ Page({
...item, ...item,
merchantGoodsId: item.goodsId, merchantGoodsId: item.goodsId,
upgradeGoodsId: item.goodsId, upgradeGoodsId: item.goodsId,
price: this.divideByHundred(item.goodsPrice) price: this.divideByHundred(item.goodsPrice),
minSellPrice: quotationGoodsList?.find(val => val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId)?.packageGoods?.goodsList?.find(subV => subV.merchantGoodsId == item.goodsId)?.minSellPrice, // 按商品数据对比补充详情商品最低价
validMinSellPrice: quotationGoodsList?.find(val => val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId)?.packageGoods?.goodsList?.find(subV => subV.merchantGoodsId == item.goodsId)?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
} }
let index = pre.findIndex(ele => { let index = pre.findIndex(ele => {
if (ele.packageGoods) { if (ele.packageGoods) {
return ele.packageGoods.packageId == item.packageId return ele.packageGoods.packageId == item.packageId
} }
}) })
console.log(index, 'index'); // console.log(index, 'index');
if (index != -1) { if (index != -1) {
pre[index].packageGoods.goodsList.push(obj) pre[index].packageGoods.goodsList.push(obj)
pre[index].price += obj.price pre[index].price = NP.plus(pre[index].price, obj.price)
} else { } else {
pre.push({ pre.push({
goods: null, goods: null,
...@@ -517,7 +520,7 @@ Page({ ...@@ -517,7 +520,7 @@ Page({
owner: tableInfo.owner owner: tableInfo.owner
// ...insuranceTypeObj // ...insuranceTypeObj
}) })
this.getQuotationInfo() // this.getQuotationInfo()
} }
}) })
.catch(err => { }) .catch(err => { })
...@@ -530,13 +533,15 @@ Page({ ...@@ -530,13 +533,15 @@ Page({
// orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i?.count || 1) * parseFloat(i.price))) // orderInfo.vdQuotationGoodsList.map(i => (total += parseFloat(i?.count || 1) * parseFloat(i.price)))
orderInfo.vdQuotationGoodsList.map(i => { orderInfo.vdQuotationGoodsList.map(i => {
if (i.goods) { if (i.goods) {
total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price) // total += parseFloat(i.goods.count || 1) * parseFloat(i.goods.price)
total = NP.plus(total, NP.times(parseFloat(i.goods.count || 1), parseFloat(i.goods.price)))
} }
if (i.packageGoods) { if (i.packageGoods) {
console.log(i.packageGoods, 'i.packageGoods') console.log(i.packageGoods, 'i.packageGoods')
i.packageGoods.goodsList.map(ele => { i.packageGoods.goodsList.map(ele => {
total += parseFloat(ele.count || 1) * parseFloat(ele.price) total = NP.plus(total, NP.times(parseFloat(ele.count || 1), parseFloat(ele.price)))
// total += parseFloat(ele.count || 1) * parseFloat(ele.price)
}) })
} }
}) })
...@@ -610,7 +615,8 @@ Page({ ...@@ -610,7 +615,8 @@ Page({
// debugger // debugger
let { let {
owner: { price }, owner: { price },
orderInfo orderInfo,
id
} = this.data } = this.data
quotationGoodsList({ quotationGoodsList({
merchantId: default4SStoreInfo.merchantId, merchantId: default4SStoreInfo.merchantId,
...@@ -660,7 +666,8 @@ Page({ ...@@ -660,7 +666,8 @@ Page({
if (ele.packageGoods) { if (ele.packageGoods) {
let item = ele.packageGoods let item = ele.packageGoods
ele.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => { ele.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => {
pre = pre + item.sellPrice // pre = pre + item.sellPrice
pre = NP.plus(pre, item.sellPrice)
return pre return pre
}, 0) }, 0)
} }
...@@ -671,8 +678,17 @@ Page({ ...@@ -671,8 +678,17 @@ Page({
}) })
// 判断有没有勾选商品,有的话调用一下 // 判断有没有勾选商品,有的话调用一下
orderInfo.vdQuotationGoodsList.length && this.totalFee() orderInfo.vdQuotationGoodsList.length && this.totalFee()
// 获取订单详情
if (id) {
this.getOrderInfo()
}
})
.catch(err => {
// 获取订单详情
if (id) {
this.getOrderInfo()
}
}) })
.catch(err => { })
}, },
// 后面改成全局方法 // 后面改成全局方法
// 除以100保留两位小数点 // 除以100保留两位小数点
...@@ -750,10 +766,9 @@ Page({ ...@@ -750,10 +766,9 @@ Page({
this.setData({ this.setData({
id id
}) })
this.getOrderInfo() // this.getOrderInfo()
} else {
this.getQuotationInfo()
} }
this.getQuotationInfo()
//客户线索回显客户信息 //客户线索回显客户信息
if (customerInfo) this.setCustomerInfo(customerInfo) if (customerInfo) this.setCustomerInfo(customerInfo)
this.setData({ this.setData({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!