Commit 5d2360d1 by 张立顺

fix 精品套餐联动问题修复和销售顾问场景值错误

1 parent 929f226a
...@@ -85,10 +85,12 @@ Component({ ...@@ -85,10 +85,12 @@ Component({
}, },
// 删除数组重复项 都不保留 // 删除数组重复项 都不保留
removeDuplicates(arr, property) { removeDuplicates(arr, property) {
console.log(arr, 'packageCode');
var uniqueArray = []; var uniqueArray = [];
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var value = arr[i][property]; var value = arr[i][property];
if (!uniqueArray.some((obj) => obj[property] === value)) { // 兼容套餐
if ((!uniqueArray.some((obj) => obj[property] === value) || arr[i]?.packageCode)) {
uniqueArray.push(arr[i]); uniqueArray.push(arr[i]);
} }
} }
...@@ -96,10 +98,12 @@ Component({ ...@@ -96,10 +98,12 @@ Component({
}, },
// 去重保留第二项 // 去重保留第二项
arrayUnique(arr, name) { arrayUnique(arr, name, packageCode = 'packageCode') {
console.log(arr, 'arrayUnique');
var hash = {}; var hash = {};
return arr.reduce(function (acc, cru, index) { return arr.reduce(function (acc, cru, index) {
if (!hash[cru[name]]) { // 兼容套餐逻辑
if (!hash[cru[name]] || !hash[cru[packageCode]]) {
hash[cru[name]] = { index: index }; hash[cru[name]] = { index: index };
acc.push(cru); acc.push(cru);
} else { } else {
...@@ -110,7 +114,9 @@ Component({ ...@@ -110,7 +114,9 @@ Component({
}, },
getChooseList() { getChooseList() {
let { goodsList, chooseGoodsList, isSolarFilm } = this.data; let { goodsList, chooseGoodsList, isSolarFilm } = this.data;
console.log(goodsList, chooseGoodsList, 'goodsList');
let chooseList = []; let chooseList = [];
// debugger
// 太阳膜下单 需保留已选的商品 // 太阳膜下单 需保留已选的商品
if (isSolarFilm) { if (isSolarFilm) {
let upgradeGoodsList = []; let upgradeGoodsList = [];
...@@ -124,10 +130,12 @@ Component({ ...@@ -124,10 +130,12 @@ Component({
} }
if (!selectActiveArr?.length) return wx.$util.showToast("请勾选商品"); if (!selectActiveArr?.length) return wx.$util.showToast("请勾选商品");
// 将已选商品与当前弹窗数据对比处理数据 // 将已选商品与当前弹窗数据对比处理数据
console.log(upgradeGoodsList, chooseGoodsList, 'chooseGoodsList');
let arr = this.removeDuplicates( let arr = this.removeDuplicates(
upgradeGoodsList.concat(chooseGoodsList), upgradeGoodsList.concat(chooseGoodsList),
"id" "id"
); );
console.log(arr, 'arr');
arr?.map((c) => { arr?.map((c) => {
if (c.active) { if (c.active) {
if (!c.count) c.count = 1; if (!c.count) c.count = 1;
...@@ -159,6 +167,7 @@ Component({ ...@@ -159,6 +167,7 @@ Component({
c.price = c.upgradePrice || 0; c.price = c.upgradePrice || 0;
} }
if (!c.price) c.price = c.upgradePrice; if (!c.price) c.price = c.upgradePrice;
console.log(c, 'isSolarFilm');
chooseList.push(c); chooseList.push(c);
} }
}); });
......
...@@ -31,7 +31,6 @@ Component({ ...@@ -31,7 +31,6 @@ Component({
oderType: String, oderType: String,
scene: { scene: {
type: Number, type: Number,
value: 1,
}, },
}, },
// 处理先要调用销售顾问接口再调用转化人员接口的问题 // 处理先要调用销售顾问接口再调用转化人员接口的问题
...@@ -198,6 +197,7 @@ Component({ ...@@ -198,6 +197,7 @@ Component({
isFirst, isFirst,
orderObj: comOrderObj, orderObj: comOrderObj,
orderSellerInfo, orderSellerInfo,
scene
} = this.data; } = this.data;
let thisPage = wx.$router.getPageInstance(); let thisPage = wx.$router.getPageInstance();
...@@ -205,7 +205,7 @@ Component({ ...@@ -205,7 +205,7 @@ Component({
api api
.getConversionEmployeeList({ .getConversionEmployeeList({
merchantId, merchantId,
sceneList: type == 1 ? [0] : "", sceneList: type == 1 ? [scene] : "",
}) })
.then(async (res) => { .then(async (res) => {
wx.$util.hideLoading(); wx.$util.hideLoading();
......
<view class="main"> <view class="main">
<view class="createData"> <view class="createData">
<view class="label">战败时间</view> <view class="label">战败时间</view>
<calendar <calendar id="calender" class="calendar" allowSameDay shortcut bindselect="rangeSelect" rangeAll dateType="single" calenderColor="#347BFF" vertical minDate="2020-10-01" maxDate="{{ dateObj.maxDate }}" isComponents>
id="calender"
class="calendar"
allowSameDay
shortcut
bindselect="rangeSelect"
rangeAll
dateType="single"
calenderColor="#347BFF"
vertical
minDate="2020-10-01"
maxDate="{{ dateObj.maxDate }}"
isComponents
>
<view class="calendarItem text-center dateNum"> <view class="calendarItem text-center dateNum">
{{dateObj.todayShow}} {{dateObj.todayShow}}
<image class="solidArrow" src="/tabIndex/images/arrSolid.png" /> <image class="solidArrow" src="/tabIndex/images/arrSolid.png" />
...@@ -23,73 +10,20 @@ ...@@ -23,73 +10,20 @@
</view> </view>
<view class="wrapper"> <view class="wrapper">
<view class="cell"> <view class="cell">
<gl-cell <gl-cell border valueAlign="right" label="推荐人员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesBox" placeholder="点击选择">
border
valueAlign="right"
label="推荐人员"
requiredAfter
labelWidth="var(--fontSize140)"
required
haveArrow
bindclick="showPopup"
data-show-name="selesBox"
placeholder="点击选择"
>
<view class="between"> <view class="between">
<view class="start text-hide {{ orderObj.employeeName?'':'placeholder-class' }}">{{orderObj.employeeName || '请选择'}}</view> <view class="start text-hide {{ orderObj.employeeName?'':'placeholder-class' }}">{{orderObj.employeeName || '请选择'}}</view>
</view> </view>
</gl-cell> </gl-cell>
</view> </view>
<view class="cell two-cell"> <view class="cell two-cell">
<gl-cell <gl-cell border valueAlign="right" label="车主姓名" titleBtn="客户档案" bindtitleClick="showCustomPop" data-index="{{ ind }}" requiredAfter labelWidth="var(--fontSize390)" required>
border <input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="16" value="{{ customer.customerName }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerName" always-embed></input>
valueAlign="right"
label="车主姓名"
titleBtn="客户档案"
bindtitleClick="showCustomPop"
data-index="{{ ind }}"
requiredAfter
labelWidth="var(--fontSize390)"
required
>
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
maxlength="16"
value="{{ customer.customerName }}"
bindinput="input"
data-index="{{ ind }}"
data-name="customer.customerName"
always-embed
></input>
</gl-cell> </gl-cell>
<gl-cell border valueAlign="right" label="手机号" requiredAfter labelWidth="var(--fontSize140)" required> <gl-cell border valueAlign="right" label="手机号" requiredAfter labelWidth="var(--fontSize140)" required>
<input <input placeholder="点击输入" class="input" type="number" maxlength="11" placeholder-class="placeholder-class" value="{{ customer.customerPhone }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerPhone" always-embed></input>
placeholder="点击输入"
class="input"
type="number"
maxlength="11"
placeholder-class="placeholder-class"
value="{{ customer.customerPhone }}"
bindinput="input"
data-index="{{ ind }}"
data-name="customer.customerPhone"
always-embed
></input>
</gl-cell> </gl-cell>
<gl-cell <gl-cell border valueAlign="right" label="客户来源" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="salesTypeShow" placeholder="点击选择">
border
valueAlign="right"
label="客户来源"
requiredAfter
labelWidth="var(--fontSize140)"
required
haveArrow
bindclick="showPopup"
data-show-name="salesTypeShow"
placeholder="点击选择"
>
<view class="between"> <view class="between">
<view class="start text-hide">{{customer.salesType?'售后':'售前'}}</view> <view class="start text-hide">{{customer.salesType?'售后':'售前'}}</view>
</view> </view>
...@@ -98,14 +32,7 @@ ...@@ -98,14 +32,7 @@
<view class="cell cell-textarea"> <view class="cell cell-textarea">
<view class="label">战败原因</view> <view class="label">战败原因</view>
<view class="inner"> <view class="inner">
<textarea <textarea class="cus-textarea" bindinput="intReason" value="{{ deafeatReason }}" placeholder="请输入" placeholder-class="textarea-placeholder" maxlength="30"></textarea>
class="cus-textarea"
bindinput="intReason"
value="{{ deafeatReason }}"
placeholder="请输入"
placeholder-class="textarea-placeholder"
maxlength="30"
></textarea>
<text class="maxCount">{{deafeatReason.length || 0}}/30</text> <text class="maxCount">{{deafeatReason.length || 0}}/30</text>
</view> </view>
<view class="select-content"> <view class="select-content">
...@@ -120,23 +47,8 @@ ...@@ -120,23 +47,8 @@
</view> </view>
</view> </view>
</view> </view>
<merchant-seles <merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" scene="0" type="1" />
show="{{ selesBox }}"
title="选择合作门店"
sub-title="选择销售顾问"
orderObj="{{ orderObj }}"
userInfo="{{ userInfo }}"
singleSeller="{{ true }}"
scene="0"
type="1"
/>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType"> <van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType">
<van-picker <van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" />
show-toolbar
columns="{{ saleTypesList }}"
value-key="name"
bind:cancel="onCloseSaleType"
bind:confirm="onChangeSaleType"
/>
</van-popup> </van-popup>
\ No newline at end of file \ No newline at end of file
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</block> </block>
</view> </view>
</block> </block>
<merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" /> <merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" scene="0"/>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" /> <customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType"> <van-popup show="{{ salesTypeShow }}" position="bottom" bind:close="onCloseSaleType">
<van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" /> <van-picker show-toolbar columns="{{ saleTypesList }}" value-key="name" bind:cancel="onCloseSaleType" bind:confirm="onChangeSaleType" />
......
...@@ -505,6 +505,7 @@ ...@@ -505,6 +505,7 @@
orderObj="{{orderObj}}" orderObj="{{orderObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" type="1"
scene="1"
oderType="recorder" /> oderType="recorder" />
<sub-shop-merchant <sub-shop-merchant
show="{{subShopMerchantBox}}" show="{{subShopMerchantBox}}"
...@@ -530,6 +531,7 @@ ...@@ -530,6 +531,7 @@
title="选择园区店" title="选择园区店"
sub-title="选择转化人员" sub-title="选择转化人员"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
scene="1"
type="2" /> type="2" />
<coupon <coupon
id="coupon" id="coupon"
......
...@@ -270,8 +270,9 @@ ...@@ -270,8 +270,9 @@
sub-title="选择销售顾问" sub-title="选择销售顾问"
orderObj="{{orderObj}}" orderObj="{{orderObj}}"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
scene="1"
type="1" /> type="1" />
<merchant-seles show="{{ salesmanBox }}" isDefault="{{ isDefault }}" title="选择园区店" sub-title="选择转化人员" userInfo="{{ userInfo }}" type="2" /> <merchant-seles show="{{ salesmanBox }}" isDefault="{{ isDefault }}" title="选择园区店" sub-title="选择转化人员" userInfo="{{ userInfo }}" type="2" scene="1" />
<car-brands <car-brands
show="{{ carBrandBox }}" show="{{ carBrandBox }}"
bindconfirm="chooseCar" bindconfirm="chooseCar"
......
...@@ -356,8 +356,8 @@ ...@@ -356,8 +356,8 @@
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" /> <tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" />
</view> </view>
<recording-order-popup wx:if="{{showOrderpop && !(isErrorOrder)}}" outTradeNo="{{outTradeNo}}" show="{{showOrderpop}}" bind:success="navigator" title="请选择交易参考号" /> <recording-order-popup wx:if="{{showOrderpop && !(isErrorOrder)}}" outTradeNo="{{outTradeNo}}" show="{{showOrderpop}}" bind:success="navigator" title="请选择交易参考号" />
<merchant-seles show="{{ salesmanBox }}" isDefault="{{ isDefault }}" title="选择园区店" sub-title="选择转化人员" userInfo="{{ userInfo }}" type="2" /> <merchant-seles show="{{ salesmanBox }}" isDefault="{{ isDefault }}" title="选择园区店" sub-title="选择转化人员" userInfo="{{ userInfo }}" type="2" scene="1"/>
<merchant-seles show="{{ selesBox }}" title="选择合作门店" orderObj="{{ orderObj }}" sub-title="选择销售顾问" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" /> <merchant-seles show="{{ selesBox }}" title="选择合作门店" orderObj="{{ orderObj }}" sub-title="选择销售顾问" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" scene="1" />
<sub-shop-merchant show="{{ subShopMerchantBox }}" title="选择二级流量方" selectedSelesMerchantId="{{ orderObj.merchantId }}" selectedCustomerInfo="{{ orderObj.customer.customerId }}" selectedSubShopMerchantId="{{ orderObj.subShopMerchantId }}" /> <sub-shop-merchant show="{{ subShopMerchantBox }}" title="选择二级流量方" selectedSelesMerchantId="{{ orderObj.merchantId }}" selectedCustomerInfo="{{ orderObj.customer.customerId }}" selectedSubShopMerchantId="{{ orderObj.subShopMerchantId }}" />
<car-brands show="{{ carBrandBox }}" bindconfirm="chooseCar" carSeriesId="{{ orderObj.customer.carSeriesId || '' }}" merchantId="{{ orderObj.merchantId || undefined }}" /> <car-brands show="{{ carBrandBox }}" bindconfirm="chooseCar" carSeriesId="{{ orderObj.customer.carSeriesId || '' }}" merchantId="{{ orderObj.merchantId || undefined }}" />
<remark-popup wx:if="{{ showRemark }}" show="{{ showRemark }}" bindconfirm="remarkConfirm" placeholder="请填写内容,最多30个字" maxlength="30" value="{{ orderObj.remark }}" /> <remark-popup wx:if="{{ showRemark }}" show="{{ showRemark }}" bindconfirm="remarkConfirm" placeholder="请填写内容,最多30个字" maxlength="30" value="{{ orderObj.remark }}" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!