Commit 38bcf14c by 前端

Merge branch 'SAAS+V4.48-0103' into 'SAAS+V4.49.0-0121'

上线合并

See merge request !355
2 parents 9a18b0d6 17f878c3
Showing 38 changed files with 1285 additions and 752 deletions
// import api from './request.js'
import api from "~/utils/request/request.js";
import api from '~/utils/request/request.js'
module.exports = {
/**微信登录 */
wxLogin(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.jscode.login", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.jscode.login', data)
},
/**微信登录 */
ssoLogin(data) {
return api.post(
"scrm.api.sso.weapp.jscode.getOpenId",
'scrm.api.sso.weapp.jscode.getOpenId',
data,
[],
"/rop-scrm-sso/router",
"scrm",
'/rop-scrm-sso/router',
'scrm',
false
);
)
},
/**微信手机号登录 */
authPhone(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.auth.phone", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.auth.phone', data)
},
/**账号登录 */
accountAndPwd(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.login.accountAndPwd", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.login.accountAndPwd', data)
},
/**验证码 */
getSMS(data) {
return api.post("dj.api.smartcarlife.sms.get.code", data);
return api.post('dj.api.smartcarlife.sms.get.code', data)
},
/** 免登录 */
noLogin(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.sms.not.code.login", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.not.code.login', data)
},
/** 免登录 */
loginLogAdd(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.login.log.add", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.login.log.add', data)
},
/** 记录登录设置类型 */
reNoSignIn(data) {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.sms.noSignIn.login", data);
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.noSignIn.login', data)
},
/**手机验证码登录 /1.0.0 */
smsLogin(data = {}) {
data.source = "MINIAPP";
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.sms.login", data);
data.source = 'MINIAPP'
data.productCode = 'PC00c2'
return api.post('dj.api.smartcarlife.sms.login', data)
},
/**获取账号列表 */
getListSelectAccount() {
return api.post("dj.api.smartcarlife.workWechat.listSelectAccount");
return api.post('dj.api.smartcarlife.workWechat.listSelectAccount')
},
selectAccountLogin(data) {
return api.post("dj.api.smartcarlife.workWechat.selectAccountLogin", data);
return api.post('dj.api.smartcarlife.workWechat.selectAccountLogin', data)
},
/** 车品牌 */
getBrandList(data) {
return api.post("dj.api.get.car.brandList", data);
return api.post('dj.api.get.car.brandList', data)
},
/**获取当前登录账号能查看的园区店列表 */
getYQList() {
return api.post("dj.api.smartcarlife.serviceMerchant.curYqList");
return api.post('dj.api.smartcarlife.serviceMerchant.curYqList')
},
/** 根据商户号获取员工列表信息(转化人员) */
getConversionEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
// data.sceneList = [1]
return api.post("dj.api.smartcarlife.employee.getByMerchantId", data);
return api.post('dj.api.smartcarlife.employee.getByMerchantId', data)
},
getEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
// data.sceneList = [1]
return api.post(
'dj.api.smartcarlife.employee.onTheJob.getByMerchantId',
data
)
// return api.post("dj.api.smartcarlife.employee.getByMerchantId", data);
},
/** 根据园区店商户号获取绑定4S店列表 */
getServiceMerchantList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.list", data);
return api.post('dj.api.smartcarlife.serviceMerchant.list', data)
},
/** 根据4S店商户号获取二级流量方列表 */
getSubShopMerchantList(data) {
return api.post(
"dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef",
'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
data
);
)
},
/**商品类型 */
getGoodsTypeList(data) {
return api.post("dj.api.goods.type.list", data);
return api.post('dj.api.goods.type.list', data)
},
/**客户优惠券 */
getCustomerCouponList(data) {
return api.post("dj.api.customer.coupon.list", data);
return api.post('dj.api.customer.coupon.list', data)
},
/**礼券列表 */
getCouponList(data) {
return api.post("dj.api.smartCarLife.merchant.coupon.list", data);
return api.post('dj.api.smartCarLife.merchant.coupon.list', data)
},
/**上传图片 /1.0.0*/
uploadImg(data) {
return api.post("dj.api.smartcarlife.common.uploadImg", data, ["file"]);
return api.post('dj.api.smartcarlife.common.uploadImg', data, ['file'])
},
/** ocr图片识别功能 */
ocr(data) {
return api.post("dj.api.common.ocr.recognition", data);
return api.post('dj.api.common.ocr.recognition', data)
},
/** 不升级常用字符列表 */
getConfigList(data) {
return api.post("dj.api.smartcarlife.config.list", data);
return api.post('dj.api.smartcarlife.config.list', data)
},
/** 获取指定商户指定日期范围的邀约统计 */
getInviteDateList(data) {
return api.post("dj.api.smartcarlife.inviteStat.merchant.list", data);
return api.post('dj.api.smartcarlife.inviteStat.merchant.list', data)
},
/** 获取WebSocket地址 */
getWsUrl() {
return api.post("dj.api.smartcarlife.getWsUrl");
return api.post('dj.api.smartcarlife.getWsUrl')
},
/**根据sceneId 查参数 */
getSceneById(data) {
return api.post("dj.api.smartcarlife.common.getSceneById", data);
return api.post('dj.api.smartcarlife.common.getSceneById', data)
},
// 生成生成小程序码
createQrcodeImage(data) {
// dj.api.smartcarlife.serviceMerchant.getByMerchantId
return api.post("dj.api.smartcarlife.common.createWeappQrcode", data);
return api.post('dj.api.smartcarlife.common.createWeappQrcode', data)
},
/** 获取商户生效的财务结算规则 */
merchantSettleAccountRule(data) {
return api.post("dj.api.smartcarlife.merchantSettleAccountRule.get", data);
return api.post('dj.api.smartcarlife.merchantSettleAccountRule.get', data)
},
/** 获取商户业务指定生效日期的结算规则 */
merchantSettleAccountRuleGetByEffectDate(data) {
return api.post(
"dj.api.smartcarlife.merchantSettleAccountRule.getByEffectDate",
'dj.api.smartcarlife.merchantSettleAccountRule.getByEffectDate',
data
);
)
},
/** 获取商户订单设置 */
getMerchantRecordingSettings(data) {
return api.post(
"dj.api.smartcarlife.recordingSettings.getMerchantRecordingSettings",
'dj.api.smartcarlife.recordingSettings.getMerchantRecordingSettings',
data
);
)
},
/** 设置商户订单设置 */
setMerchantRecordingSettings(data) {
return api.post(
"dj.api.smartcarlife.recordingSettings.insertOrUpdateSettings",
'dj.api.smartcarlife.recordingSettings.insertOrUpdateSettings',
data
);
)
},
/**补录订单 */
waitinputorder(data) {
data.inputStatus = 0;
data.inputStatus = 0
// data.payType = 1
return api.post("dj.api.smartcarlife.weapp.waitinputorder.page", data);
return api.post('dj.api.smartcarlife.weapp.waitinputorder.page', data)
},
/** 获取转化员上一笔订单的销售顾问 */
getLastUserOrderInfo(data) {
return api.post("dj.api.smartcarlife.order.getLastUser", data);
return api.post('dj.api.smartcarlife.order.getLastUser', data)
},
// 获取订单信息
getWorkList(data) {
let params = data || {};
params.sceneType = 1;
return api.post("dj.api.smartcarlife.order.search", params);
let params = data || {}
params.sceneType = 1
return api.post('dj.api.smartcarlife.order.search', params)
},
/**搜索订单(含套餐) */
getWorkPackageGoodsList(data) {
......@@ -185,118 +194,114 @@ module.exports = {
pageSize: 10,
...params
})
},
// 获取园区店开通的场景入口
getYqMerchantSceneConfigAPI(data) {
return api.post("dj.api.smartcarlife.select.openScene.info", data);
return api.post('dj.api.smartcarlife.select.openScene.info', data)
},
// 获取园区店下的4s店
getSceneMerchantRefStoreList(data) {
// 校验session
return api.post("dj.api.scenemerchantref.query4SRefByYqShopByLogin", data);
return api.post('dj.api.scenemerchantref.query4SRefByYqShopByLogin', data)
// 不校验session
// return api.post('dj.api.scenemerchantref.query4SRefByYqShop', data)
},
// 获取门店下的员工(推荐人)众筹场景
getStaffListByMerchantAPI(data) {
let params = data || {};
params.sceneList = [3];
return api.post("dj.api.smartcarlife.employee.getByMerchantId", params);
let params = data || {}
params.sceneList = [3]
return api.post('dj.api.smartcarlife.employee.getByMerchantId', params)
},
// 获取园区店配置
getYqStoreConfig(data) {
return api.get("dj.api.smarcarlife.yqMerchantConfig.detail", data);
return api.get('dj.api.smarcarlife.yqMerchantConfig.detail', data)
},
//插入埋点记录
burialPointRecord(data) {
return api.get("dj.api.smartcarlife.common.insertRecord", data);
return api.get('dj.api.smartcarlife.common.insertRecord', data)
},
// 获取精品升级场景 太阳膜类商品部位数据
getPositionList(data) {
return api.post("dj.api.smartcarlife.goodsPosition.list", data);
return api.post('dj.api.smartcarlife.goodsPosition.list', data)
},
// 选择4s店和场景
selectMerchantScene(data) {
return api.post("dj.api.smartcarlife.selectMerchantScene", data);
return api.post('dj.api.smartcarlife.selectMerchantScene', data)
},
// 按客户查找门店工单/预约
searchOrderCustomer(data) {
return api.post("dj.api.smartcarlife.order.searchOrderCustomer", data);
return api.post('dj.api.smartcarlife.order.searchOrderCustomer', data)
},
// 获取服务商库存管理模式(是否使用膜卷号)
getServiceFilmRollSetting(data) {
return api.post("dj.api.smarcarlife.stock.management.mode", data);
return api.post('dj.api.smarcarlife.stock.management.mode', data)
},
/**退出*/
logout() {
return api.post("dj.api.smartcarlife.logout");
return api.post('dj.api.smartcarlife.logout')
},
// 分页获取场景值关联园区店数据
getYqMerchantListPage(data) {
return api.post("dj.api.scenemerchantref.listYqShopByRef.page", data);
return api.post('dj.api.scenemerchantref.listYqShopByRef.page', data)
},
// 获取超管及区域督导账号侧边栏的4S店列表
serviceMerchantCurshopList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.curShopList", data);
return api.post('dj.api.smartcarlife.serviceMerchant.curShopList', data)
},
// 分页获取场景值关联4s店数据
getMerchantListPage(data) {
return api.post("dj.api.scenemerchantref.listShop4sByRef.page", data);
return api.post('dj.api.scenemerchantref.listShop4sByRef.page', data)
},
/** 查询员工或园区店商户是否开启了工资绩效 */
isBusinessSchoolEnableCurrentUser(data) {
return api.post(
"dj.api.businessSchool.isBusinessSchoolEnable.currentUser",
'dj.api.businessSchool.isBusinessSchoolEnable.currentUser',
data
);
)
},
/**
* 客户线索新增客户提醒 */
getCustomerClueRemind(params = {}) {
return api.post("dj.api.smartcarlife.customer.clue.tips.newCount", params);
return api.post('dj.api.smartcarlife.customer.clue.tips.newCount', params)
},
/** 获取驻店员工目标任务 */
getStaffTargetTaskApi(data) {
return api.post(
"dj.api.smartcarlife.staffTargetCheck.getTargetCheck",
data
);
return api.post('dj.api.smartcarlife.staffTargetCheck.getTargetCheck', data)
},
/** 查询员工待办事项列表 */
getStaffRemindList(data) {
return api.post("dj.api.smartcarlife.staff.reminder.list", data);
return api.post('dj.api.smartcarlife.staff.reminder.list', data)
},
/** 关闭员工待办事项 */
shutDownTaskApi(data) {
return api.post("dj.api.smartcarlife.staff.reminder.shutdown", data);
return api.post('dj.api.smartcarlife.staff.reminder.shutdown', data)
},
/** 将当前门店的员工目标任务弹窗标记为已弹起过 */
setTaskDialog(data) {
return api.post("dj.api.smartcarlife.staffTargetCheck.promptYes", data);
return api.post('dj.api.smartcarlife.staffTargetCheck.promptYes', data)
},
/**
* 获取客户档案列表
*/
getCustomerFileList(data) {
return api.post(
"dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page",
'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.page',
data
);
)
},
/**
......@@ -305,24 +310,24 @@ module.exports = {
loginRecordSave(data, name) {
// console.log(name, 'loginRecordSave');
// debugger
return api.post("dj.api.smartcarlife.staff.login.record.save", data);
return api.post('dj.api.smartcarlife.staff.login.record.save', data)
//selectMerchantScene
},
// 获取侧边栏切换门店4s店列表
getCurShopList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.curShopList", data);
return api.post('dj.api.smartcarlife.serviceMerchant.curShopList', data)
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post("dj.api.smartcarlife.staff.daily.report.popup.need", data);
return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data)
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post("dj.api.smartcarlife.clock.in.config.phone", data);
return api.post('dj.api.smartcarlife.clock.in.config.phone', data)
},
// 获取积分审批列表数据
......@@ -334,4 +339,4 @@ module.exports = {
approvedPointsAPI(data) {
return api.post('dj.api.smartcarlife.staff.motivation.audit', data)
}
};
}
......@@ -14,10 +14,11 @@ Component({
},
carSeriesId: {
type: Number,
// observer: function (n) {
// console.log('carSeriesId')
// if (n) this.init()
// }
observer: function (n) {
let { storageData, equityFlag } = this.data
// 数字报价单获取详情接口, carSeriesId通过接口获取会出现慢的情况,重新整理车型数据将已选值置为选中状态
if (equityFlag && n && storageData?.length) this.setCar(storageData, true)
}
},
merchantId: {
type: Number,
......@@ -26,6 +27,9 @@ Component({
if (n) this.init(n, true);
},
},
equityFlag: {
type: Boolean
}
},
/**
......@@ -356,18 +360,20 @@ Component({
});
},
confirm() {
let { chooseItem } = this.data;
let { chooseItem, equityFlag } = this.data;
let thisPage = wx.$router.getPageInstance();
let {
orderObj: { customer },
} = thisPage.data;
customer = {
...customer,
...chooseItem,
};
thisPage.setData({
["orderObj.customer"]: customer,
});
if (!equityFlag) {
let {
orderObj: { customer },
} = thisPage.data;
customer = {
...customer,
...chooseItem,
};
thisPage.setData({
["orderObj.customer"]: customer,
});
}
this.setData({
show: false,
});
......
......@@ -2,7 +2,7 @@
title="选择车型"
show="{{show}}"
bindconfirm="confirm"
height="90%">
height="{{ equityFlag ? '85%' : '90%' }}">
<view class="car-brands-box">
<search-input bindsearch="searchCar" />
<view class="car-brands">
......
......@@ -33,13 +33,14 @@
padding-left: var(--fontSize32);
font-size: var(--fontSize32);
font-weight: 700;
color: #323436;
}
.child {
font-weight: normal;
padding-left: var(--fontSize96);
font-size: var(--fontSize28);
color: #888888;
color: #323436;
position: relative;
}
......
......@@ -6,12 +6,11 @@
<view class="box">
<block wx:for="{{customerCouponList}}" wx:key="index">
<block wx:if="{{!item.flag}}">
<view class="item {{item.active?'active':''}}" data-key="customerCouponId" bindtap="choose"
data-index="{{index}}" data-item="{{item}}">
<view class="item {{item.active?'active':''}} " data-key="customerCouponId" bindtap="choose" data-index="{{index}}" data-item="{{item}}">
<view class="text-hide">
{{item.couponName}}{{item.customerCouponCode}}(客户拥有的券)
</view>
<view class="icon">
<view class="iconCoupon">
<image src="../images/choose.png"></image>
</view>
</view>
......@@ -24,12 +23,11 @@
<view class="title">{{item.title}}</view>
<view class="box">
<block wx:for="{{item.list}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item {{i.active?'active':''}} {{i.disabled?'disabled':''}}" bindtap="choose"
data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}" data-key="merchantCouponId">
<view class="item {{i.active?'active':''}} {{i.disabled?'disabled':''}}" bindtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}" data-key="merchantCouponId">
<view class="text-hide">
{{i.couponName}}{{i.merchantCouponCode}}
</view>
<view class="icon">
<view class="iconCoupon">
<image src="../images/choose.png"></image>
</view>
</view>
......
......@@ -21,7 +21,8 @@
height: var(--fontSize88);
box-sizing: border-box;
}
.text-center{
.text-center {
text-align: center;
}
......@@ -34,15 +35,18 @@
color: #888888;
position: relative;
}
.item.disabled{
.item.disabled {
color: #ccc;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item .icon{
.item .iconCoupon {
display: none;
width: var(--fontSize32);
height: var(--fontSize32);
......@@ -51,13 +55,16 @@
left: calc(-1 * var(--fontSize52));
transform: translateY(-50%);
}
.item.active{
.item.active {
color: #347BFF;
}
.item.active .icon{
.item.active .iconCoupon {
display: block;
}
.nothing{
.nothing {
padding: var(--fontSize100);
text-align: center;
color: #999;
......
Component({
options: {
styleIsolation: 'isolated',//表示样式隔离,默认隔离
},
/**
* 组件的属性列表
*/
......
......@@ -28,7 +28,7 @@
max-width: 85%;
}
.item .value .name .warning_text{
.item .value .name .warning_text {
color: #F24724;
margin-left: var(--fontSize10);
font-size: var(--fontSize22);
......@@ -78,20 +78,40 @@
opacity: 0.4;
}
.item .icon {
display: block;
.choose {
width: var(--fontSize32);
height: var(--fontSize32);
margin: 0 var(--fontSize32);
// position: absolute;
// top: 50%;
// left: calc(-1 * var(--fontSize52));
// transform: translateY(-50%);
.arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
}
.item .icon .arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.nothing {
padding: var(--fontSize100);
text-align: center;
color: #999;
}
.box {
padding-left: 0;
}
.itemBox {
display: flex;
align-items: center;
.item {
flex: 1;
}
}
\ No newline at end of file
<wxs src="index.wxs" module="filter" />
<popup show="{{show}}" title="选择商品" bindconfirm="confirm" bindcancel="cancel">
<view class="coupon-box">
<search-input bindsearch="searchGoods" value="{{keyWord}}" />
<scroll-view class="coupon" scroll-y>
<block wx:if="{{goodsList.length > 0}}">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="title">
{{item.goodsTypeName}}
<text class="tips">|建议价</text>
</view>
<view class="box">
<block
wx:for="{{item.upgradeGoodsList}}"
wx:key="ind"
wx:for-index="ind"
wx:for-item="i">
<view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }}">
<!-- {{i.shopMinPrice}} -->
<view
class="value {{i.active?'labelWidth':''}}"
catchtap="choose"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
<view class="name text-hide {{i.active?'textWidth':''}}">
<text>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</text>
<view class="coupon-box">
<search-input bindsearch="searchGoods" value="{{keyWord}}" />
<scroll-view class="coupon" scroll-y>
<block wx:if="{{goodsList.length > 0}}">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="title">
{{item.goodsTypeName}}
<text class="tips">|建议价</text>
</view>
<view class="box">
<view class="itemBox" wx:for="{{item.upgradeGoodsList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="choose" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<image src="{{filter.getImageSrc(i.active)}}" />
</view>
<view class="item {{minPrice?(minPrice/100)>= i.shopMinPrice ?'':'disableSelect':'' }}">
<view class="value {{i.active?'labelWidth':''}}" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<view class="name text-hide {{i.active?'textWidth':''}}">
<text>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</text>
<text wx:if="{{i.merchantGoodsPosition && (i.goodsInfo.goodsType == 1 || i.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)}}">{{'「' + i.positionStr+'」'}}</text>
<text class="warning_text" wx:if="{{!i.merchantGoodsPosition && (i.goodsInfo.goodsType == 1 || i.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)}}">无部位</text>
</view>
<view class="last" wx:if="{{!i.active}}">
<!-- | -->
<text class="price">¥{{i.upgradePrice}}</text>
</view>
</view>
<block wx:if="{{i.active}}">
<view class="control">
<view
class="minus"
catchtap="addCount"
data-count="{{-1}}"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
-
</view>
<input
type="number"
catchtap="noScroll"
class="input"
value="{{i.count || 1}}"
catchinput="input"
data-index="{{index}}"
data-ind="{{ind}}" />
<view
class="add"
catchtap="addCount"
data-count="{{1}}"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
+
</view>
</view>
</block>
<view
class="icon"
catchtap="choose"
data-index="{{index}}"
data-ind="{{ind}}"
data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="../images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:else>
<view class="nothing">暂无数据</view>
</block>
</scroll-view>
</view>
</popup>
</view>
<view class="last" wx:if="{{!i.active}}">
<text class="price">¥{{i.upgradePrice}}</text>
</view>
</view>
<block wx:if="{{i.active}}">
<view class="control">
<view class="minus" catchtap="addCount" data-count="{{-1}}" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
-
</view>
<input type="number" catchtap="noScroll" class="input" value="{{i.count || 1}}" catchinput="input" data-index="{{index}}" data-ind="{{ind}}" />
<view class="add" catchtap="addCount" data-count="{{1}}" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
+
</view>
</view>
</block>
<!-- <view class=" choose" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}">
<block wx:if="{{i.active}}">
<image src="../images/radio.png" />
</block>
<block wx:else>
<view class="arc" />
</block>
</view> -->
</view>
</view>
</view>
</block>
</block>
<block wx:else>
<view class="nothing">暂无数据</view>
</block>
</scroll-view>
</view>
</popup>
\ No newline at end of file
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
return item?item.replace(reg, ' '):''
return item ? item.replace(reg, ' ') : ''
}
var getImageSrc = function (active) {
var baseImagePath = active ? '../images/radio.png' : '../images/radio_icon.png';
var timestamp = Date.now(); // 使用 Date.now() 获取当前时间戳
return baseImagePath + '?t=' + timestamp; // 使用字符串拼接
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText
replaceItemText: replaceItemText,
getImageSrc: getImageSrc
}
......@@ -2,11 +2,24 @@
import api from "../../api/api";
// import util from '../../utils/util.js'
Component({
// options: {
// styleIsolation: 'shared'
// },
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
show: {
type: Boolean,
observer: function (n) {
// console.log('userInfo', n)
// 先请求导流方接口
if (n) this.setData({
keyWord: ''
});
this.getMerchantList()
},
},
title: String,
subTitle: String,
userInfo: {
......@@ -46,6 +59,7 @@ Component({
this.getMerchantList();
this.setData({
sellerUserId: id,
keyWord: ''
});
}
},
......@@ -61,12 +75,25 @@ Component({
isFirst: true,
sellerUserId: "",
orderSellerInfo: "",
keyWord: ''
},
/**
* 组件的方法列表
*/
methods: {
search(e) {
let { detail: { value } } = e
this.setData({
keyWord: value
})
let { orderObj } = this.data
this.getConversionEmployeeList(orderObj.merchantId, true);
},
changSelectList(e) {
// let {value:text} = e.currentTarget
// let {selesList} =
},
showMoreMerchant() {
this.setData({
moreMerchant: !this.data.moreMerchant,
......@@ -84,7 +111,6 @@ Component({
let { orderObj } = thisPage.data;
let isSellerInfo, orderSellerInfo;
// console.log('orderObj', orderObj)
let callBackName =
type == 1 ? "getSceneMerchantRefStoreList" : "getYQList";
// debugger
......@@ -95,10 +121,10 @@ Component({
api[callBackName](
type == 1
? {
merchantId: userInfo.merchantId,
scene,
staffUUID: orderObj.sellerUserId,
}
merchantId: userInfo.merchantId,
scene,
staffUUID: orderObj.sellerUserId,
}
: {}
).then(async (res) => {
// let userInfo = wx.$util.getUserInfo()
......@@ -134,8 +160,6 @@ Component({
let result = await api.getLastUserOrderInfo({
sellerUserId: userInfo.subLoginUser.uuid,
});
// let {data} = result
if (
result.data &&
result.data.merchantId == userInfo?.shopMerchantId
......@@ -198,14 +222,16 @@ Component({
orderObj: comOrderObj,
orderSellerInfo,
scene,
keyWord
} = this.data;
let thisPage = wx.$router.getPageInstance();
let { orderObj } = thisPage.data;
api
.getConversionEmployeeList({
.getEmployeeList({
merchantId,
sceneList: type == 1 ? [scene] : "",
name: keyWord
})
.then(async (res) => {
wx.$util.hideLoading();
......@@ -242,6 +268,7 @@ Component({
thisPage.data.orderCreateType,
"thisPage.data.orderCreateType"
);
// debugger
if (type == 1 && isFirst) {
// debugger
// console.log(merchantId)
......@@ -324,9 +351,9 @@ Component({
// 还要订单不是回显的
console.log(
type == 1 &&
merchantList.length == 1 &&
!orderObj.merchantId &&
!orderObj.merchantName
merchantList.length == 1 &&
!orderObj.merchantId &&
!orderObj.merchantName
);
if (
type == 1 &&
......@@ -348,11 +375,11 @@ Component({
selesList = selesList.length
? selesList
: [
{
uuid: -1,
staffName: "系统",
},
];
{
uuid: -1,
staffName: "系统",
},
];
selesList.forEach((element, index) => {
if (index == 0) {
element.active = true;
......
......@@ -4,8 +4,7 @@
<view class="sub-title">{{title}}</view>
<view class="merchant-box" style="max-height:{{moreMerchant?merchantList.length * 100 :''}}rpx">
<block wx:for="{{merchantList}}" wx:key="index">
<view class="merchantList {{item.active?'active':''}}" bindtap="changeMerchant" data-item="{{item}}"
data-index="{{index}}">
<view class="merchantList {{item.active?'active':''}}" bindtap="changeMerchant" data-item="{{item}}" data-index="{{index}}">
<view class="text-hide">{{item.merchantName}}</view>
</view>
</block>
......@@ -15,14 +14,16 @@
<image src="../images/open.png" class="icon {{moreMerchant ? 'hide':''}}"></image>
</view>
</block>
<view class="sub-title">{{subTitle}}</view>
<view class="sub-title">{{subTitle}}
</view>
<search-input styleValue=" border-bottom:none" wx:if="{{type == 1 }}" value="{{keyWord}}" bindsearch="search" placeholder="请输入" />
<view class="seles-list">
<block wx:for="{{selesList}}" wx:key="index">
<view class="seles text-center {{item.active?'active':''}}" bindtap="changeSelesMan" data-index="{{index}}"
data-item="{{item}}">
<view class="seles text-center {{item.active?'active':''}}" bindtap="changeSelesMan" data-index="{{index}}" data-item="{{item}}">
{{item.staffName}}
</view>
</block>
<view class="center " wx:if="{{type == 1&&keyWord&&selesList.length == 0 }}">暂无数据</view>
</view>
</view>
</scroll-view>
......
/* components/Merchant-Seles/Merchant-Seles.wxss */
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-center{
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.seles-box{
.seles-list .center {
width: 100%;
text-align: center;
}
.seles-box {
height: 100%;
width: calc(100% + var(--fontSize64));
transform: translateX(calc(-1 * var(--fontSize32)));
}
.box{
.box {
padding: 0 var(--fontSize32);
}
.merchant-box{
.merchant-box {
max-height: var(--fontSize300);
overflow: hidden;
transition: all .25s;
}
.merchantList {
width: calc(100% - var(--fontSize50));
height: var(--fontSize98);
......@@ -55,12 +65,14 @@
text-align: center;
margin: var(--fontSize28) auto 0;
}
.more .icon{
.more .icon {
width: var(--fontSize24);
height: var(--fontSize22);
transition: all .25s;
}
.more .icon.hide{
.more .icon.hide {
transform: rotate(-180deg);
}
......@@ -81,7 +93,7 @@
display: flex;
flex-wrap: wrap;
flex-direction: row;
padding-bottom: var(--fontSize40);
}
......@@ -94,8 +106,13 @@
height: var(--fontSize60);
margin: 0 var(--fontSize40) var(--fontSize20) 0;
}
.seles.active{
background: rgba(53,130,238,0.08);
.seles.active {
background: rgba(53, 130, 238, 0.08);
color: #347BFF;
border-color: #347BFF;
}
.search-input search-input {
border: none;
}
\ No newline at end of file
// components/SearchInput/SearchInput.js
Component({
// options: {
// styleIsolation: 'shared'
// },
/**
* 组件的属性列表
*/
......@@ -14,6 +17,10 @@ Component({
filterEmoji: {
type: Boolean,
value: true
},
styleValue: {
type: String,
value: ''
}
},
......@@ -60,7 +67,7 @@ Component({
},
emit(e) {
let {
detail:{
detail: {
value
},
type
......
<view class="search-box">
<view class="search-box" style="{{styleValue}}">
<view class="search-input">
<block wx:if="{{!edit}}">
<view class="input {{value?'':'placeholder'}}" bindtap="open">
......@@ -12,7 +12,7 @@
</view>
</block>
<block wx:else>
<input type="text" maxlength="{{maxlength}}" class="input" value='{{value}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm"/>
<input type="text" maxlength="{{maxlength}}" class="input" value='{{value}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm" />
</block>
</view>
</view>
\ No newline at end of file
......@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布
* 5cdptest
*/
let index = 2;
let index = 1;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......
......@@ -97,7 +97,7 @@
<picker
wx:if="{{item.type == 'pickerTime'}}"
mode="date"
value="{{formData[name]}}"
value="{{formData[name] || formData[item.name]}}"
start="{{item.start || ''}}"
end="{{item.end || ''}}"
bindchange="handleTimeChange"
......
......@@ -55,6 +55,7 @@ Component({
formRule: constantData.formRule,
energyFormRule: constantData.energyFormRule,
oilFormRule: constantData.oilFormRule,
extendServiceFormRule: constantData.extendServiceFormRule,
isShowObj: {
car: true,
customer: true,
......@@ -138,6 +139,16 @@ Component({
formData
})
},
// 切换排量/功率
changeType(e) {
let { type, index } = e.currentTarget.dataset
let idName = 'extendService'
let childCom = this.selectComponent('#' + idName + index)
childCom.parentSetData('displacementPowerFlag', type)
this.setData({
[`serviceInfo.goodInfoList[${index}].displacementPowerFlag`]: type
})
},
onClickShow(e) {
const { type } = e.target.dataset
this.setData({ imgShow: true, imgType: type })
......@@ -197,7 +208,7 @@ Component({
let { value } = e.detail
let formData = this.getPageData()
let curitem = formData.goodInfoList[popObj.idx]
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : 'energy'
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : (curitem.itemsCode == 'YB0001' || curitem.itemsCode == 'YB0002') ? 'energy' : 'extendService'
let childCom = this.selectComponent('#' + idName + popObj.idx)
childCom.parentSetData(popObj.attr, value)
this.setData({
......@@ -249,7 +260,7 @@ Component({
})
},
handleConfirm(e) {
var { formRule, serviceInfo, imgObj, imgToInfo, energyFormRule, oilFormRule,retrofitInfo } = this.data
var { formRule, serviceInfo, imgObj, imgToInfo, energyFormRule, oilFormRule,retrofitInfo, extendServiceFormRule } = this.data
let formData = this.getPageData()
let validObj = fn.checkRequired(formData, formRule)
if (validObj) {
......@@ -286,7 +297,7 @@ Component({
// 延保产品-验证
if (item.printType == 2) {
// itemsCode标识:YB0001-延保-6大件,YB0002-延保-3电,YB0003-延保-油车
let subValidObj = fn.checkRequired(item, item.itemsCode == 'YB0003' ? oilFormRule : energyFormRule)
let subValidObj = fn.checkRequired(item, item.itemsCode == 'YB0003' ? oilFormRule : (item.itemsCode == 'YB0001' || item.itemsCode == 'YB0002') ? energyFormRule : extendServiceFormRule)
if (subValidObj) {
wx.$util.showToast(subValidObj.message)
return
......@@ -330,7 +341,7 @@ Component({
number += `.${decimal}`
value = number
}
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : 'energy'
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : (curitem.itemsCode == 'YB0001' || curitem.itemsCode == 'YB0002') ? 'energy' : 'extendService'
let childCom = this.selectComponent('#' + idName + idx)
childCom.parentSetData(attr, value)
this.setData({
......
......@@ -146,7 +146,7 @@
</view>
</gl-form>
<gl-form
wx:else
wx:if="{{ item.itemsCode == 'YB0001' || item.itemsCode == 'YB0002' }}"
id="{{ 'energy' + index }}"
background="#F4F5F7"
formData="{{ item }}"
......@@ -190,6 +190,39 @@
<text class="input-suffix">万公里</text>
</view>
</gl-form>
<gl-form
wx:if="{{ item.itemsCode != 'YB0001' && item.itemsCode != 'YB0002' && item.itemsCode != 'YB0003' }}"
id="{{ 'extendService' + index }}"
background="#F4F5F7"
formData="{{ item }}"
dataAttrName="{{ 'serviceInfo.goodInfoList[' + index +']' }}"
formDataList="{{ secondObj.productFormList[0].extendServiceFormList }}">
<view slot="displacementPower" class="displacementPower">
<view class="tab-box">
<view class="tab-item {{item.displacementPowerFlag == 0 ? 'active' : ''}}" data-type="0" data-index="{{index}}" bindtap="changeType">排量</view>
<view class="tab-item {{item.displacementPowerFlag == 1 ? 'active' : ''}}" data-type="1" data-index="{{index}}" bindtap="changeType">功率</view>
</view>
<view class="value">
<van-field
class="textarea between"
custom-style="width: var(--fontSize100);font-size: var(--fontSize28); padding: var(--fontSize30) 0; background: #F4F5F7;"
border="{{ false }}"
value="{{ item.displacementPowerValue }}"
input-align="right"
autosize
hold-keyboard
type="number"
placeholder="请输入"
maxlength="140"
data-attr="displacementPowerValue"
data-idx="{{ index }}"
data-curitem="{{ item }}"
bindinput="handleWarrantyInput"
/>
<text class="input-suffix">{{item.displacementPowerFlag == 0 ? 'L' : 'KW'}}</text>
</view>
</view>
</gl-form>
</view>
<gl-form
wx:else
......
......@@ -377,4 +377,41 @@
.pay-type .cell {
padding-left: var(--fontSize20) !important;
}
.displacementPower {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.displacementPower .tab-box{
width: var(--fontSize192);
height: var(--fontSize52);
background: #F3F3F5;
border-radius: var(--fontSize8);
display: flex;
align-items: center;
border: var(--fontSize2) solid #3582EE;
}
.displacementPower .tab-box .tab-item{
width: var(--fontSize96);
height: var(--fontSize52);
text-align: center;
line-height: var(--fontSize52);
border-radius: var(--fontSize8);
transition: all .25s;
color: #3582EE;
}
.displacementPower .tab-box .tab-item.active {
background-color: #3582EE;
color: #fff;
}
.displacementPower .value {
display: flex;
justify-content: flex-end;
align-items: center;
}
\ No newline at end of file
......@@ -190,6 +190,44 @@ const oilFormRule = {
]
}
const extendServiceFormRule = {
servicePeriod: [{ required: true, message: '服务年限不能为空' }],
displacementPowerValue: [
{ required: true, message: '排量或功率不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '排量或功率请输入仅有两位小数的数字' }
}
}
],
buyDate: [{ required: true, message: '购车发票日期不能为空' }],
qualityBeginDate: [{ required: true, message: '原厂质保开始日期不能为空' }],
warrantyPeriod: [
{ required: true, message: '原厂质保年限不能为空' },
{
validator: (rule, value) => {
return /^\d+$/.test(value) ? null : { message: '原厂质保年限请输入整数' }
}
}
],
warrantyKm: [
{ required: true, message: '原厂质保公里不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '原厂质保公里请输入仅有两位小数的数字' }
}
}
],
mileage: [
{ required: true, message: '合同购买时的公里数不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '合同购买时的公里数请输入仅有两位小数的数字' }
}
}
]
}
const secondObj = {
carFormList: [
{
......@@ -466,6 +504,70 @@ const secondObj = {
noCellHeight: true,
cellStyle: 'height: var(--fontSize90); border-bottom: 0;'
}
],
// 延保配置服务项目
extendServiceFormList: [
{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true,
suffix: '年',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);'
},
{
label: '',
name: 'displacementPower',
type: 'slot',
noCellHeight: true,
cellBoxStyle: 'width: 100%;',
labelWidth: '0px',
labelStyle: 'display: none;'
},
{
label: '购车发票日期',
name: 'buyDate',
type: 'pickerTime',
end: Util.tsFormatTime(new Date(), 'Y-M-D'),
labelWidth: 'var(--fontSize220)',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);',
haveArrow: true
},
{
label: '原厂质保开始日期',
name: 'qualityBeginDate',
type: 'pickerTime',
labelWidth: 'var(--fontSize240)',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);',
haveArrow: true
},
{
label: '原厂质保年限',
name: 'warrantyPeriod',
type: 'input',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);',
labelWidth: 'var(--fontSize220)',
},
{
label: '原厂质保公里(万公里)',
name: 'warrantyKm',
type: 'input',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);',
labelWidth: 'var(--fontSize340)',
},
{
label: '合同购买时的公里数',
name: 'mileage',
type: 'input',
noCellHeight: true,
cellStyle: 'height: var(--fontSize90);',
labelWidth: 'var(--fontSize280)',
}
]
},
// {
......@@ -503,6 +605,10 @@ const secondObj = {
label: '',
name: 'tireRule',
type: 'otherSlot',
isShowObj: {
attr: 'tireFlag',
list: ['1']
},
list: [
{
label: '轮胎规格',
......@@ -519,6 +625,10 @@ const secondObj = {
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true,
isShowObj: {
attr: 'tireFlag',
list: ['1']
},
tireObj: {
tire: ''
},
......@@ -650,7 +760,7 @@ const secondObj = {
maxlength: '100'
}
],
retrofitList:[{
retrofitList: [{
label: ' ',
name: 'upload',
type: 'slot',
......@@ -665,5 +775,6 @@ export default {
formRule,
energyFormRule,
oilFormRule,
secondObj
secondObj,
extendServiceFormRule
}
......@@ -100,6 +100,12 @@ Page({
if (item.vehicleRegistrationDate) {
item.vehicleRegistrationDate = new Date(item.vehicleRegistrationDate).format('yyyy-MM-dd')
}
if (item.buyDate) {
item.buyDate = new Date(item.buyDate).format('yyyy-MM-dd')
}
if (item.qualityBeginDate) {
item.qualityBeginDate = new Date(item.qualityBeginDate).format('yyyy-MM-dd')
}
if (item.itemsCode == 'YB0003') {
item.gearbox = item.gearbox || ''
item.vehicleNature = typeof item.vehicleNature == 'number' ? item.vehicleNature : 1
......@@ -186,6 +192,9 @@ Page({
this.getInterestCardSetting(data.goodId)
}
// data.attachmentList = data.attachmentList
data?.goodInfoList?.forEach(val => {
if (val.printType == 2 && !['YB0001', 'YB0002', 'YB0003'].includes(val.itemsCode)) val.displacementPowerFlag = val.displacementPowerFlag || 0 // 默认是选中排量
})
this.setData({
serviceInfo: data,
['serviceInfo.attachmentList']:data?.attachmentList||[],
......
......@@ -148,6 +148,9 @@ Component({
// 获取推荐人列表
getEmployee() {
let userInfo = wx.$util.getStorageSync('dj_boutique_user_info')
this.setData({
userInfo
})
let params = {
merchantId: userInfo.default4SStoreInfo.merchantId
}
......@@ -241,7 +244,25 @@ Component({
},
// 品牌车型
handleJumpBrand(e) {
wx.$router.go('packageEquity.carBrands')
// wx.$router.go('packageEquity.carBrands')
this.setData({
showCarBrands: true, // 选择时再加载车型组件
carBrandBox: true
})
},
chooseCar(e) {
let { dataAttrName } = this.data
let { carBrand, carBrandId, carChildsBrandId, carChildsBrandName, carSeriesId, carSeriesName } = e.detail
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + 'carBrand']: carBrand,
[dataAttrName + '.' + 'carBrandId']: carBrandId,
[dataAttrName + '.' + 'carChildsBrandId']: carChildsBrandId,
[dataAttrName + '.' + 'carChildsBrandName']: carChildsBrandName,
[dataAttrName + '.' + 'carSeriesId']: carSeriesId,
[dataAttrName + '.' + 'carSeriesName']: carSeriesName
})
},
/**获取园区配置 */
async getYqStoreConfig() {
......
......@@ -4,6 +4,7 @@
"gl-form": "/packageEquity/components/GLForm/GLForm",
"Gl-Button-Group": "../../../../components/GlButtonGroup/GlButtonGroup",
"store-referrer-picker": "../storeReferrerPicker/storeReferrerPicker",
"customerInfo": "/components/CustomerInfo/CustomerInfo"
"customerInfo": "/components/CustomerInfo/CustomerInfo",
"car-brands": "/components/CarBrands/CarBrands"
}
}
......@@ -49,7 +49,7 @@
<gl-form disable="{{disable}}" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bind:inputEvent="inputEvent" formDataList="{{first.carFormList}}">
<view slot="brands" class="brand" bindtap="handleJumpBrand">
<view wx:if="{{serviceInfo.carBrandId}}">
{{serviceInfo.carBrand || ''}}/{{serviceInfo.carChildsBrandName || ''}}/{{serviceInfo.carSeriesName || ''}}
{{serviceInfo.carBrand || ''}}-{{serviceInfo.carChildsBrandName || ''}}-{{serviceInfo.carSeriesName || ''}}
</view>
<view wx:else class="placeholder-class">请选择</view>
</view>
......@@ -59,4 +59,6 @@
</view>
<store-referrer-picker bindconfirm="handleSalesChange" show="{{referrerPicker}}" referrerId="{{orderInfo.referrerId}}" pickerListAll="{{employeeList}}" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" apiType="2" />
\ No newline at end of file
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" apiType="2" />
<car-brands show="{{ carBrandBox }}" bindconfirm="chooseCar" carSeriesId="{{ serviceInfo.carSeriesId || '' }}" equityFlag="true" merchantId="{{ userInfo.default4SStoreInfo.merchantId || undefined }}" />
\ No newline at end of file
......@@ -293,7 +293,7 @@ Component({
name = c.goods.goodsAlias || c.goods.upgradeGoodsName || c.goods.goodsName
}
if (c.packageGoods) {
name = c.packageGoods.packageName
name = c.packageGoods.packageAlias || c.packageGoods.packageName
}
if (name.indexOf(value) != -1) {
arr.push(c)
......
......@@ -28,7 +28,7 @@
<view class="childbox">
<view class="item">
<view class="name text-hide ">
<view>{{i.packageGoods.packageName}}</view>
<view>{{i.packageGoods.packageAlias || i.packageGoods.packageName}}</view>
</view>
<view class="last">
<text class="price">¥{{i.packageGoods.sellPrice}}</text>
......
......@@ -39,7 +39,7 @@
<view class="deleteicon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="./images/del.png" />
</view>
<view class="name text-hide">{{item.packageGoods.packageName}}</view>
<view class="name text-hide">{{item.packageGoods.packageAlias || item.packageGoods.packageNameAlias || item.packageGoods.packageName}}</view>
<view class="package-price">¥{{item.price}}</view>
<!-- <view class="count" catchtap="showPopup" data-show-name="goodsBox">x{{item.count||1}}</view> -->
</view>
......
......@@ -440,6 +440,7 @@ Page({
let obj = {
packageId: item.packageCode,
packageName: item.packageName,
packageNameAlias: item.packageAlias || item.packageNameAlias,
goodsId: ele.merchantGoodsId || ele.upgradeGoodsId,
goodsName: ele.upgradeGoodsName || ele.goodsName,
goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias,
......
......@@ -222,6 +222,7 @@ Page({
let obj = {
packageId: item.packageCode,
packageName: item.packageName,
packageNameAlias: item.packageAlias || item.packageNameAlias,
goodsId: ele.merchantGoodsId || ele.upgradeGoodsId,
goodsName: ele.upgradeGoodsName || ele.goodsName,
goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias,
......@@ -292,6 +293,7 @@ Page({
let obj = {
packageId: packageGoods.packageCode,
packageName: packageGoods.packageName,
packageNameAlias: packageGoods.packageAlias || pachageGoods.packageNameAlias,
goodsId: ele.goodsId,
goodsName: ele.goodsName,
goodsNameAlias: ele.goodsNameAlias,
......
......@@ -294,6 +294,7 @@ Page({
let obj = {
packageId: item.packageCode,
packageName: item.packageName,
packageNameAlias: item.packageAlias || item.packageNameAlias,
goodsId: ele.merchantGoodsId || ele.upgradeGoodsId,
goodsName: ele.upgradeGoodsName || ele.goodsName,
goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias,
......@@ -364,6 +365,7 @@ Page({
let obj = {
packageId: packageGoods.packageCode,
packageName: packageGoods.packageName,
packageNameAlias: packageGoods.packageAlias || packageGoods.packageNameAlias,
goodsId: ele.goodsId,
goodsName: ele.goodsName,
goodsNameAlias: ele.goodsNameAlias,
......
......@@ -372,6 +372,17 @@ export const getPositionList = options => {
api.getPositionList({}).then(res => {
let { code, data } = res
if (code == 0) {
// const namReplaceobj = {
// 2: '前侧窗玻璃',
// 3: '后侧窗玻璃',
// 4: '后挡'
// }
// data = data.map(item => {
// if (namReplaceobj[item.positionValue]) {
// item.positionName = namReplaceobj[item.positionValue]
// }
// return item;
// })
app.globalData.positionTypeList = data
}
resolve(app.globalData.positionTypeList)
......
......@@ -26,6 +26,8 @@ Page({
skylight: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/skylight.png",
tricorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/tricorn.png",
windshield: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/windshield.png",
sideIcorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/sideIcon.png",
afterIcorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/afterIcon.png",
scanIcon:
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png",
selectIcon:
......@@ -97,6 +99,8 @@ Page({
frontGearArr: [], // 前挡
sideRearGearArr: [], // 侧后挡
skylightArr: [], // 天窗
sideBeforeRearGearArr: [], // 前侧窗玻璃
sideAfterRearGearArr: [], // 后档
baseConfigData: {},
showSource: false,
Sourcecolumns: [
......@@ -213,7 +217,8 @@ Page({
orderObj: { selectPayType },
baseConfigData,
} = this.data;
let { showName, type } = e.currentTarget.dataset;
let { showName, type, positionnnum: positionNum } = e.currentTarget.dataset;
console.log(positionNum, 'positionNum');
let arr = [];
if (showName == "goodsBox") {
// type 产品类型 1前挡 2侧后挡 3天窗 4其它精品 根据类型过滤显示商品弹窗数据
......@@ -248,9 +253,10 @@ Page({
)
arr[i].upgradeGoodsList = arr2;
}
console.log([positionNum], [positionNum].includes(subVal.merchantGoodsPosition));
if (
type == 2 &&
[2, 3, 4].includes(subVal.merchantGoodsPosition)
[Number(positionNum)].includes(subVal.merchantGoodsPosition)
) {
arr2.push(subVal);
if (
......@@ -452,8 +458,11 @@ Page({
setGoodsTotal(goodsList) {
let total = 0;
goodsList.forEach((i) => {
console.log(i.shopMinPrice, i.price, i.shopMinPrice > i.price, ' i.shopMinPrice > i.price');
if (i.validMinSellPrice == 'Y' && i.shopMinPrice > i.price) {
i.errorTarget = true
} else {
i.errorTarget = false
}
if (i.goodsList) {
i.goodsList.forEach((item) => {
......@@ -1020,7 +1029,9 @@ Page({
first,
orderObj,
frontGearArr, // 前挡
sideBeforeRearGearArr, // 前侧窗玻璃
sideRearGearArr, // 侧后挡
sideAfterRearGearArr, // 后档
skylightArr, // 天窗
} = this.data;
let { subOrderList } = orderObj;
......@@ -1040,7 +1051,7 @@ Page({
})
.then((res) => {
let { code, data, message } = res;
console.log(subOrderList, 'subOrderList')
console.log(subOrderList, res, 'subOrderList')
if (code == 0) {
wx.hideLoading();
data?.forEach((val) => {
......@@ -1049,9 +1060,16 @@ Page({
if ([1].includes(subVal.merchantGoodsPosition)) {
frontGearArr.push(subVal);
}
if ([2, 3, 4].includes(subVal.merchantGoodsPosition)) {
if ([2].includes(subVal.merchantGoodsPosition)) {
sideBeforeRearGearArr.push(subVal);
}
if ([3,].includes(subVal.merchantGoodsPosition)) {
sideRearGearArr.push(subVal);
}
if ([4].includes(subVal.merchantGoodsPosition)) {
sideAfterRearGearArr.push(subVal);
}
if ([5, 6, 7].includes(subVal.merchantGoodsPosition)) {
skylightArr.push(subVal);
}
......@@ -1063,8 +1081,10 @@ Page({
subV.upgradeGoodsPosition &&
subVal.merchantGoodsPosition != subV.upgradeGoodsPosition &&
subVal.upgradeGoodsId == subV.upgradeGoodsId
)
) {
debugger
subV.upgradeGoodsPosition = subVal.merchantGoodsPosition;
}
});
}
});
......@@ -1124,6 +1144,8 @@ Page({
copyGoodsData: goodsData,
goodsList: subOrderList,
frontGearArr,
sideBeforeRearGearArr,
sideAfterRearGearArr,
sideRearGearArr,
skylightArr,
// orderObj
......
......@@ -111,7 +111,7 @@
<gl-cell border valueAlign="right" label="精品礼券" labelWidth="var(--fontSize140)" haveArrow requiredAfter required value="{{ (orderObj.couponName || '') + (orderObj.customerCouponCode || '') }}" placeholder="点击选择" bindclick="showPopup" data-show-name="couponBox" disabled="{{ orderObj.orderSource == 5 }}" />
<!-- class="{{orderObj.selectPayType ==0?'item-disabled':''}}" -->
<view class="goods_box">
<view class="label" style="margin-bottom: {{ !frontGearArr.length && !sideRearGearArr.length && !skylightArr.length ? 'var(--fontSize40)' : '' }};">
<view class="label" style="margin-bottom: {{ !frontGearArr.length && !sideRearGearArr.length && !skylightArr.length&&!sideBeforeRearGearArr.length&&!sideAfterRearGearArr.length ? 'var(--fontSize40)' : '' }};">
请选择产品
<text class="required">*</text>
</view>
......@@ -148,13 +148,79 @@
</view>
</block>
</block>
<block wx:if="{{ sideBeforeRearGearArr.length }}">
<gl-cell border valueAlign="right" label="前侧窗玻璃" logoSrc="{{ tricorn }}" labelWidth="var(--fontSize180)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-type="2" data-positionnnum="2" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 前侧窗玻璃 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [2]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="../../images/del.png" />
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{ sideRearGearArr.length }}">
<gl-cell border valueAlign="right" label="侧后挡" logoSrc="{{ tricorn }}" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-type="2" />
<gl-cell border valueAlign="right" label="后侧窗玻璃" logoSrc="{{ sideIcorn }}" labelWidth="var(--fontSize180)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-type="2" data-positionnnum="3" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 后侧窗玻璃 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [3]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="../../images/del.png" />
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{ sideAfterRearGearArr.length }}">
<gl-cell border valueAlign="right" label="后档" logoSrc="{{ afterIcorn }}" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-type="2" data-positionnnum="4" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 侧后挡 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [2, 3, 4]) }}">
<!-- 后档 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [4]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
......
// tabWorkOrder/pages/defeatOrder/defeatOrder.js
import api from "../../api";
import api2 from "~/api/api.js";
import { getYQorderInfo, getPositionList, setConfigInfo } from "~/store/index";
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
const app = getApp();
import api from '../../api'
import api2 from '~/api/api.js'
import { getYQorderInfo, getPositionList, setConfigInfo } from '~/store/index'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const app = getApp()
let toastList = {
employeeName: "销售顾问不能为空",
subShopMerchantId: "二级流量方不能为空",
sellerUserId: "转化人员不能为空",
refusalReason: "拒升理由不能为空",
};
import { ImgUrl } from "~/config";
employeeName: '销售顾问不能为空',
subShopMerchantId: '二级流量方不能为空',
sellerUserId: '转化人员不能为空',
refusalReason: '拒升理由不能为空'
}
import { ImgUrl } from '~/config'
Page({
/**
* 页面的初始数据
......@@ -18,8 +18,13 @@ Page({
data: {
IMG_URL: ImgUrl,
scanIcon:
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png",
name: "createdOrder",
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png',
skylight: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/skylight.png",
tricorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/tricorn.png",
windshield: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/windshield.png",
sideIcorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/sideIcon.png",
afterIcorn: "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/afterIcon.png",
name: 'createdOrder',
shortcutList: [],
phoneShow: false,
orderObj: {},
......@@ -28,25 +33,25 @@ Page({
notUpgradeOrderList: [
{
customer: {
customerName: "",
customerPhone: "",
standNo: "",
plateNumber: "",
customerName: '',
customerPhone: '',
standNo: '',
plateNumber: '',
customerSex: 1,
experienceFlag: "Y",
experienceFlag: 'Y'
},
confirmIndex: false,
subOrderList: [],
},
subOrderList: []
}
],
dateObj: {
beforeDay: "",
today: "",
nextDay: "",
maxDate: "",
todayShow: "",
beforeDay: '',
today: '',
nextDay: '',
maxDate: '',
todayShow: ''
},
toView: "",
toView: '',
typeIndx: 0,
isPlateNumber: false,
isStandNo: false,
......@@ -55,66 +60,71 @@ Page({
isShowSubShopMerchant: false,
requiredList: [],
tipsProps: {
tipsText: "本表单用于快速生成战败客户订单",
tipsText: '本表单用于快速生成战败客户订单',
showTips: false,
type: 1,
type: 1
},
selectCustomIndex: 0, // 选择产品对应客户
copyGoodsData: [],
frontGearArr: [],
sideRearGearArr: [],
skylightArr: [],
frontGearArr: [], // 前挡
sideRearGearArr: [], // 侧后挡
skylightArr: [], // 天窗
sideBeforeRearGearArr: [], // 前侧窗玻璃
sideAfterRearGearArr: [], // 后档
customerInfoBox: false,
baseConfigData: {},
baseConfigData: {}
},
routerBack() {
wx.$router.back();
wx.$router.back()
},
reWrite(type, data) {
let { notUpgradeOrderList, typeIndx } = this.data;
notUpgradeOrderList[typeIndx][type] = data;
let { notUpgradeOrderList, typeIndx } = this.data
notUpgradeOrderList[typeIndx][type] = data
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
},
navOcr(e) {
let { type, index } = e.currentTarget.dataset;
let { type, index } = e.currentTarget.dataset
this.setData({
typeIndx: index,
});
wx.$router.go(`ocr?type=${type}`);
typeIndx: index
})
wx.$router.go(`ocr?type=${type}`)
},
changeExperience(e) {
// let { gender, index } = e.currentTarget.dataset
let { experience, index } = e.currentTarget.dataset;
let prop = `notUpgradeOrderList[${index}].customer.experienceFlag`;
let { experience, index } = e.currentTarget.dataset
let prop = `notUpgradeOrderList[${index}].customer.experienceFlag`
this.setData({
[prop]: experience,
});
[prop]: experience
})
// console.log(experience)
wx.vibrateShort();
wx.vibrateShort()
// this.setData({
// ['orderObj.customer.experienceFlag']: experience
// })
},
// 选择产品确定
chooseGoods(e) {
let { selectCustomIndex } = this.data;
let arr = e.detail || [];
let subOrderListProp = `notUpgradeOrderList[${selectCustomIndex}].subOrderList`;
let { selectCustomIndex } = this.data
let arr = e.detail || []
let subOrderListProp = `notUpgradeOrderList[${selectCustomIndex}].subOrderList`
this.setData({
[subOrderListProp]: arr,
});
[subOrderListProp]: arr
})
},
chooseCustomerInfo(e) {
let { detail } = e;
let { selectCustomIndex } = this.data;
let prop = `notUpgradeOrderList[${selectCustomIndex}].customer`;
let { detail } = e
console.log(detail, 'detail')
let { selectCustomIndex } = this.data
let propCustomer = `notUpgradeOrderList[${selectCustomIndex}].customer`
let prop = `notUpgradeOrderList[${selectCustomIndex}]`
this.setData({
[prop]: {
[propCustomer]: {
customerName: detail.customer.customerName,
customerSex: detail.customer.customerSex,
customerPhone: detail.customer.customerPhone,
carBrandId: detail.customer.carBrandId,
carBrand: detail.customer.carBrand,
carChildsBrandId: detail.customer.carChildsBrandId,
......@@ -123,153 +133,156 @@ Page({
carSeriesName: detail.customer.carSeriesName,
standNo: detail.customer.standNo,
plateNumber: detail.customer.plateNumber,
experienceFlag: detail.customer.experienceFlag || 'Y'
},
});
[prop + '.customerCouponCode']: detail.customerCoupon?.customerCouponCode,
[prop + '.customerCouponId']: detail?.customerCouponId, // 客户券id
})
},
showCustomPop(e) {
let { index } = e.currentTarget.dataset;
let { index } = e.currentTarget.dataset
this.setData({
customerInfoBox: true,
selectCustomIndex: index,
});
selectCustomIndex: index
})
},
addUserItem() {
let { notUpgradeOrderList, copyGoodsData, shortcutList } = this.data;
if (notUpgradeOrderList.length >= 10) return;
let { notUpgradeOrderList, copyGoodsData, shortcutList } = this.data
if (notUpgradeOrderList.length >= 10) return
notUpgradeOrderList.push({
customer: {
customerName: "",
customerPhone: "",
standNo: "",
customerName: '',
customerPhone: '',
standNo: '',
customerSex: 1,
plateNumber: "",
experienceFlag: "Y",
plateNumber: '',
experienceFlag: 'Y'
},
shortcutList: wx.$util.deepClone(shortcutList),
});
shortcutList: wx.$util.deepClone(shortcutList)
})
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
// if (copyGoodsData.length == 1 && copyGoodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(notUpgradeOrderList.length - 1);
this.defaultChoose(notUpgradeOrderList.length - 1)
// }
setTimeout(() => {
this.setData({
toView: "addBtn",
});
}, 0);
toView: 'addBtn'
})
}, 0)
},
/**设置日期 */
setTimeList(dateNum) {
let maxDate = new Date().format("yyyy-MM-dd");
let today = dateNum || new Date().format("yyyy-MM-dd");
let maxDate = new Date().format('yyyy-MM-dd')
let today = dateNum || new Date().format('yyyy-MM-dd')
/**
* 根据日期字符串获取星期几
* @param dateString 日期字符串(如:2020-05-02)
* @returns {String}
*/
var dateArray = today.split("-");
let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
let todayShow = " 周" + "日一二三四五六".charAt(date.getDay());
var dateArray = today.split('-')
let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2])
let todayShow = ' 周' + '日一二三四五六'.charAt(date.getDay())
todayShow =
dateArray[0] +
"年" +
'年' +
dateArray[1] +
"月" +
'月' +
dateArray[2] +
"日 " +
todayShow;
'日 ' +
todayShow
this.setData({
dateObj: {
today,
maxDate,
todayShow,
},
});
todayShow
}
})
},
chooseCar(e) {
let { selectCustomIndex, notUpgradeOrderList } = this.data;
let { selectCustomIndex, notUpgradeOrderList } = this.data
notUpgradeOrderList[selectCustomIndex] = {
...notUpgradeOrderList[selectCustomIndex],
customer: {
...notUpgradeOrderList[selectCustomIndex].customer,
...e.detail,
},
};
...e.detail
}
}
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
},
dateChange(e) {
let { type } = e.currentTarget.dataset;
let { dateObj } = this.data;
this.calendar = this.selectComponent("#calender");
if (type == "before") {
this.setTimeList(dateObj.beforeDay);
let { type } = e.currentTarget.dataset
let { dateObj } = this.data
this.calendar = this.selectComponent('#calender')
if (type == 'before') {
this.setTimeList(dateObj.beforeDay)
} else {
this.setTimeList(dateObj.nextDay);
this.setTimeList(dateObj.nextDay)
}
this.calendar.resetData(
type == "before" ? dateObj.beforeDay : dateObj.nextDay
);
type == 'before' ? dateObj.beforeDay : dateObj.nextDay
)
},
// 获取选中天数
rangeSelect(e) {
let { date } = e.detail;
this.setTimeList(date);
let { date } = e.detail
this.setTimeList(date)
},
delBtn(e) {
let ind = e.currentTarget.dataset.ind;
let { notUpgradeOrderList } = this.data;
let ind = e.currentTarget.dataset.ind
let { notUpgradeOrderList } = this.data
notUpgradeOrderList.splice(ind, 1);
notUpgradeOrderList.splice(ind, 1)
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
},
touchE: function (e) {
var that = this;
var that = this
if (e.changedTouches.length == 1) {
//手指移动结束后触摸点位置的X坐标
var endX = e.changedTouches[0].clientX;
var endX = e.changedTouches[0].clientX
//触摸开始与结束,手指移动的距离
var disX = that.data.startX - endX;
var delBtnWidth = that.data.delBtnWidth;
var disX = that.data.startX - endX
var delBtnWidth = that.data.delBtnWidth
//如果距离小于删除按钮的1/2,不显示删除按钮
var txtStyle =
disX > delBtnWidth / 2 ? "left:-" + delBtnWidth + "rpx" : "left:0";
disX > delBtnWidth / 2 ? 'left:-' + delBtnWidth + 'rpx' : 'left:0'
//获取手指触摸的是哪一项
var index = e.currentTarget.dataset.index;
var ind = e.currentTarget.dataset.ind;
var notUpgradeOrderList = that.data.notUpgradeOrderList;
notUpgradeOrderList[index].txtStyle = txtStyle;
var index = e.currentTarget.dataset.index
var ind = e.currentTarget.dataset.ind
var notUpgradeOrderList = that.data.notUpgradeOrderList
notUpgradeOrderList[index].txtStyle = txtStyle
//更新列表的状态
that.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
}
},
//手指触摸动作开始 记录起点X坐标
touchstart: function (e) {
//开始触摸时 重置所有删除
this.data.notUpgradeOrderList.forEach((item) => {
item.isTouchMove = false;
item.confirmIndex = false;
});
this.data.notUpgradeOrderList.forEach(item => {
item.isTouchMove = false
item.confirmIndex = false
})
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
notUpgradeOrderList: this.data.notUpgradeOrderList,
});
notUpgradeOrderList: this.data.notUpgradeOrderList
})
},
//滑动事件处理
touchmove: function (e) {
let { notUpgradeOrderList } = this.data;
let { notUpgradeOrderList } = this.data
// 为1就不能再删除了
if (notUpgradeOrderList.length == 1) return;
if (notUpgradeOrderList.length == 1) return
var that = this,
// index = e.currentTarget.dataset.index, //当前索引
......@@ -282,29 +295,29 @@ Page({
angle = that.angle(
{
X: startX,
Y: startY,
Y: startY
},
{
X: touchMoveX,
Y: touchMoveY,
Y: touchMoveY
}
);
)
notUpgradeOrderList.forEach(function (v, i) {
v.isTouchMove = false;
v.isTouchMove = false
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (Math.abs(angle) > 30) return
if (i == ind) {
if (touchMoveX > startX)
//右滑
v.isTouchMove = false;
v.isTouchMove = false
//左滑
else v.isTouchMove = true;
else v.isTouchMove = true
}
});
})
//更新数据
that.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
},
/**
* 计算滑动角度
......@@ -313,15 +326,15 @@ Page({
*/
angle: function (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y;
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI);
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI)
},
showPopup(e) {
let { copyGoodsData, baseConfigData } = this.data;
let { showName, index, type } = e.currentTarget.dataset;
let arr = [];
if (showName == "goodsBox") {
let { copyGoodsData, baseConfigData } = this.data
let { showName, index, type, positionnnum: positionNum } = e.currentTarget.dataset
let arr = []
if (showName == 'goodsBox') {
// type 产品类型 1前挡 2侧后挡 3天窗 根据类型过滤显示商品弹窗数据
copyGoodsData?.forEach((val, index) => {
if (
......@@ -331,8 +344,8 @@ Page({
arr.push({
goodsType: val.goodsType,
goodsTypeName: val.goodsTypeName,
upgradeGoodsList: [],
});
upgradeGoodsList: []
})
for (var i = 0; i < arr?.length; i++) {
let arr2 = [];
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
......@@ -344,9 +357,10 @@ Page({
)
arr[i].upgradeGoodsList = arr2;
}
console.log([positionNum], [positionNum].includes(subVal.merchantGoodsPosition));
if (
type == 2 &&
[2, 3, 4].includes(subVal.merchantGoodsPosition)
[Number(positionNum)].includes(subVal.merchantGoodsPosition)
) {
arr2.push(subVal);
if (
......@@ -369,121 +383,172 @@ Page({
});
if (!arr[i]?.upgradeGoodsList?.length) arr.splice(i, 1);
}
// for (var i = 0; i < arr?.length; i++) {
// let arr2 = []
// val?.upgradeGoodsList?.forEach((subVal, subInd) => {
// if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
// arr2.push(subVal)
// if (
// subVal?.goodsInfo?.goodsType == arr[i]?.goodsType ||
// subVal?.upgradeGoodsType == arr[i]?.goodsType
// )
// arr[i].upgradeGoodsList = arr2
// }
// if (
// type == 2 &&
// [2, 3, 4].includes(subVal.merchantGoodsPosition)
// ) {
// arr2.push(subVal)
// if (
// subVal?.goodsInfo?.goodsType == arr[i]?.goodsType ||
// subVal?.upgradeGoodsType == arr[i]?.goodsType
// )
// arr[i].upgradeGoodsList = arr2
// }
// if (
// type == 3 &&
// [5, 6, 7].includes(subVal.merchantGoodsPosition)
// ) {
// arr2.push(subVal)
// if (
// subVal?.goodsInfo?.goodsType == arr[i]?.goodsType ||
// subVal?.upgradeGoodsType == arr[i]?.goodsType
// )
// arr[i].upgradeGoodsList = arr2
// }
// })
// if (!arr[i]?.upgradeGoodsList?.length) arr.splice(i, 1)
// }
}
});
})
}
this.setData({
[showName]: true,
goodsData: arr,
selectCustomIndex: index,
});
selectCustomIndex: index
})
},
input(e) {
let { value } = e.detail;
let { name, index } = e.currentTarget.dataset;
let prop = `notUpgradeOrderList[${index}].${name}`;
let { value } = e.detail
let { name, index } = e.currentTarget.dataset
let prop = `notUpgradeOrderList[${index}].${name}`
this.setData({
[prop]: value,
});
[prop]: value
})
},
changeGender(e) {
let { gender, index } = e.currentTarget.dataset;
wx.vibrateShort();
let prop = `notUpgradeOrderList[${index}].customer.customerSex`;
let { gender, index } = e.currentTarget.dataset
wx.vibrateShort()
let prop = `notUpgradeOrderList[${index}].customer.customerSex`
this.setData({
[prop]: gender,
});
[prop]: gender
})
},
// 获取商品
async getOrderBaseGoodsList(merchantId) {
const positionTypeList = (await getPositionList()) || [];
const positionTypeList = (await getPositionList()) || []
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData);
let { frontGearArr, sideRearGearArr, skylightArr } = this.data;
let baseConfigData = await setConfigInfo(app.globalData)
let {
frontGearArr, // 前挡
sideBeforeRearGearArr, // 前侧窗玻璃
sideRearGearArr, // 侧后挡
sideAfterRearGearArr, // 后档
skylightArr // 天窗
} = this.data
this.setData({
positionTypeList,
baseConfigData,
});
baseConfigData
})
api
.getOrderBaseGoodsList({
merchantId,
upradeFlag: "N",
upradeFlag: 'N'
})
.then((res) => {
let { code, data, message } = res;
.then(res => {
let { code, data, message } = res
if (code == 0) {
wx.hideLoading();
wx.hideLoading()
// 筛选出太阳膜商品 goodsType 1太阳膜 自建商品-太阳膜
let arrData = [];
data?.forEach((val) => {
let arrData = []
data?.forEach(val => {
if ([1, baseConfigData?.selfBuildFilmType].includes(val.goodsType))
arrData.push(val);
val?.upgradeGoodsList?.forEach((subVal) => {
subVal.merchantGoodsId = subVal.id;
arrData.push(val)
val?.upgradeGoodsList?.forEach(subVal => {
subVal.merchantGoodsId = subVal.id
if ([1].includes(subVal.merchantGoodsPosition)) {
frontGearArr.push(subVal);
frontGearArr.push(subVal)
}
if ([2, 3, 4].includes(subVal.merchantGoodsPosition)) {
sideRearGearArr.push(subVal);
if ([2].includes(subVal.merchantGoodsPosition)) {
sideBeforeRearGearArr.push(subVal)
}
if ([3].includes(subVal.merchantGoodsPosition)) {
sideRearGearArr.push(subVal)
}
if ([4].includes(subVal.merchantGoodsPosition)) {
sideAfterRearGearArr.push(subVal)
}
if ([5, 6, 7].includes(subVal.merchantGoodsPosition)) {
skylightArr.push(subVal);
skylightArr.push(subVal)
}
});
});
let goodsData = arrData;
})
})
let goodsData = arrData
const filterList = goodsData.reduce((list, item) => {
item.upgradeGoodsList.forEach((val) => {
item.upgradeGoodsList.forEach(val => {
val.positionStr = positionTypeList.filter(
(v) => v.positionValue == val.merchantGoodsPosition
)[0]?.positionName;
});
item.upgradeGoodsList && list.push(...item.upgradeGoodsList);
return list;
}, []);
data.forEach((item) => {
item.upgradeGoodsList.forEach((v) => {
v.price = 0;
v.shopMinPrice = 0;
v.upgradePrice = 0;
v.totalPrice = 0;
v.number = 1;
});
});
v => v.positionValue == val.merchantGoodsPosition
)[0]?.positionName
})
item.upgradeGoodsList && list.push(...item.upgradeGoodsList)
return list
}, [])
data.forEach(item => {
item.upgradeGoodsList.forEach(v => {
v.price = 0
v.shopMinPrice = 0
v.upgradePrice = 0
v.totalPrice = 0
v.number = 1
})
})
this.setData({
goodsData,
frontGearArr,
sideBeforeRearGearArr,
sideAfterRearGearArr,
sideRearGearArr,
skylightArr,
copyGoodsData: goodsData,
});
copyGoodsData: goodsData
})
// 仅有一件商品 默认选中
// if (goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(0);
this.defaultChoose(0)
// }
} else {
wx.$util.showToast(message);
wx.$util.showToast(message)
}
});
})
},
defaultChoose(index) {
let { frontGearArr, sideRearGearArr, skylightArr } = this.data;
let { frontGearArr, sideRearGearArr, skylightArr } = this.data
// 仅有一个商品直接选中
let arr = [].concat(
sideRearGearArr.length == 1 ? sideRearGearArr : [],
frontGearArr.length == 1 ? frontGearArr : [],
skylightArr.length == 1 ? skylightArr : []
);
arr.forEach((val) => {
val.count = 1;
val.active = true;
});
let prop = `notUpgradeOrderList[${index}].subOrderList`;
)
arr.forEach(val => {
val.count = 1
val.active = true
})
let prop = `notUpgradeOrderList[${index}].subOrderList`
this.setData({
[prop]: arr,
});
[prop]: arr
})
},
staffDailyReportMerchantValid(userInfo) {
// let { userInfo } = this.data
......@@ -495,66 +560,65 @@ Page({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1,
sceneType: 1
})
.then((res) => {
.then(res => {
if (res.data) {
// 获取当前日期
let currentDate = new Date();
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1);
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8;
previousDate.setHours(hour);
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0];
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL)
return false;
wx.__HAS_NOREPORT_MODAL = true;
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({
title: "日报提醒",
content: "您有未填写的日报,请点击前往。",
title: '日报提醒',
content: '您有未填写的日报,请点击前往。',
showCancel: false,
// cancelText: '取消', // '取消
cancelColor: "#292D33",
confirmText: "前往填写",
confirmColor: "#347BFF",
cancelColor: '#292D33',
confirmText: '前往填写',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go("tabWorkOrder.upgradeStaffDaily", {
wx.$router.go('tabWorkOrder.upgradeStaffDaily', {
// reportDate: hasNeedReport.date
reportDate: formattedDate,
});
reportDate: formattedDate
})
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false;
}, 2000);
},
});
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
}
})
// return false
resolve(res.data);
resolve(res.data)
} else {
resolve(res.data);
resolve(res.data)
}
})
.catch((err) => {
console.log(err);
});
});
.catch(err => {
console.log(err)
})
})
},
async submit(i) {
let userInfo = wx.$util.getUserInfo();
let userInfo = wx.$util.getUserInfo()
// 校验是否填写昨日日报
let staffCheck = await this.staffDailyReportMerchantValid(userInfo);
if (staffCheck) return false;
this.checkPhoneUseConfig();
let staffCheck = await this.staffDailyReportMerchantValid(userInfo)
if (staffCheck) return false
this.checkPhoneUseConfig()
let {
orderObj,
notUpgradeOrderList,
......@@ -564,171 +628,174 @@ Page({
isPlateNumber,
refusalReason,
isExpiredTraffic
} = this.data;
let key = this.checkRequired(orderObj);
} = this.data
let key = this.checkRequired(orderObj)
if (key) {
this.showToast(toastList[key]);
this.showToast(toastList[key])
wx.pageScrollTo({
selector: `.${key}`,
});
return;
selector: `.${key}`
})
return
}
for (let index = 0; index < notUpgradeOrderList.length; index++) {
if (!notUpgradeOrderList[index].customer.customerName) {
return this.showToast(`请输入第${index + 1}位客户姓名`);
return this.showToast(`请输入第${index + 1}位客户姓名`)
}
if (!phoneRex.test(notUpgradeOrderList[index].customer.customerPhone)) {
this.showToast(`请输入第${index + 1}位客户正确的手机号`);
return;
this.showToast(`请输入第${index + 1}位客户正确的手机号`)
return
}
if (isCarBrand && !notUpgradeOrderList[index].customer.carSeriesName) {
return this.showToast(`请输入第${index + 1}位客户车型`);
return this.showToast(`请输入第${index + 1}位客户车型`)
}
if (isStandNo && !notUpgradeOrderList[index].customer.standNo) {
return this.showToast(`请输入第${index + 1}位客户车架号`);
return this.showToast(`请输入第${index + 1}位客户车架号`)
}
if (isPlateNumber && !notUpgradeOrderList[index].customer.plateNumber) {
return this.showToast(`请输入第${index + 1}位客户车牌号`);
return this.showToast(`请输入第${index + 1}位客户车牌号`)
}
if (!notUpgradeOrderList[index].subOrderList?.length && !isExpiredTraffic) {
return this.showToast(`请选择第${index + 1}位客户产品`);
if (
!notUpgradeOrderList[index].subOrderList?.length &&
!isExpiredTraffic
) {
return this.showToast(`请选择第${index + 1}位客户产品`)
}
if (refusalReason && !notUpgradeOrderList[index].customer.refusalReason) {
return this.showToast(`请输入第${index + 1}位客户拒升理由`);
return this.showToast(`请输入第${index + 1}位客户拒升理由`)
}
}
notUpgradeOrderList?.forEach((val) => {
let arr = [];
val?.subOrderList?.forEach((subVal) => {
notUpgradeOrderList?.forEach(val => {
let arr = []
val?.subOrderList?.forEach(subVal => {
let obj = {
baseGoodsId: subVal.baseGoodsId,
totalPrice: Number(subVal.price) || 0,
number: subVal.count,
merchantGoodsId: subVal.id || subVal.merchantGoodsId,
};
arr.push(obj);
});
val.subOrderList = !isExpiredTraffic ? arr : [];
merchantGoodsId: subVal.id || subVal.merchantGoodsId
}
arr.push(obj)
})
val.subOrderList = !isExpiredTraffic ? arr : []
if (isExpiredTraffic) {
delete val.customer?.['experienceFlag'] // 删除是否体验参数
val['packageGoodsList'] = [] // 删除商品参数
}
});
})
orderObj = {
...orderObj,
notUpgradeOrderList,
createDate: dateObj.today,
};
delete orderObj.customer;
delete orderObj?.packageGoodsList;
delete orderObj?.subOrderList;
console.log(orderObj, "orderObj");
createDate: dateObj.today
}
delete orderObj.customer
delete orderObj?.packageGoodsList
delete orderObj?.subOrderList
console.log(orderObj, 'orderObj')
// return;
wx.$util.showLoading("提交中...");
wx.$util.showLoading('提交中...')
// this.showLoading()
api.notUpgradeOrder({ json: JSON.stringify(orderObj) }).then((res) => {
wx.hideLoading();
let { code, data, message } = res;
api.notUpgradeOrder({ json: JSON.stringify(orderObj) }).then(res => {
wx.hideLoading()
let { code, data, message } = res
if (code == 0) {
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData();
wx.$util.refreshPageData()
wx.$util.showToast({
icon: "success",
title: "提交成功",
});
wx.$router.go("pages.index");
icon: 'success',
title: '提交成功'
})
wx.$router.go('pages.index')
} else {
wx.$util.showToast(message);
wx.$util.showToast(message)
}
});
})
},
checkRequired(obj) {
// 导入动态校验字段
let { requiredList } = this.data;
let target = [...requiredList, "employeeName"];
let { requiredList } = this.data
let target = [...requiredList, 'employeeName']
try {
target.map((key) => {
target.map(key => {
if (!obj[key]) {
throw key;
throw key
}
});
})
} catch (error) {
return error;
return error
}
return false;
return false
},
checkPhoneUseConfig() {
let { phoneShow, orderObj, notUpgradeOrderList } = this.data;
let { phoneShow, orderObj, notUpgradeOrderList } = this.data
if (phoneShow && orderObj.merchantName && orderObj.employeeName) {
let phoneConfig =
phoneShow.find((item) => {
item.shopMerchantId == orderObj.merchantId;
}) || phoneShow.pop();
notUpgradeOrderList.forEach((item) => {
phoneShow.find(item => {
item.shopMerchantId == orderObj.merchantId
}) || phoneShow.pop()
notUpgradeOrderList.forEach(item => {
item.customer.customerPhone =
item.customer.customerPhone || phoneConfig?.phoneNumber;
});
item.customer.customerPhone || phoneConfig?.phoneNumber
})
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
}
},
delGoodsList(e) {
let { index, customIndex } = e.currentTarget.dataset;
let { notUpgradeOrderList } = this.data;
notUpgradeOrderList[customIndex]?.subOrderList?.splice(index, 1);
let { index, customIndex } = e.currentTarget.dataset
let { notUpgradeOrderList } = this.data
notUpgradeOrderList[customIndex]?.subOrderList?.splice(index, 1)
this.setData({
notUpgradeOrderList,
});
notUpgradeOrderList
})
},
blur(e) {
let { liindex } = e.currentTarget.dataset;
console.log(e, liindex);
console.log(e);
let { value } = e.detail;
let { notUpgradeOrderList } = this.data;
value = value.substring(0, 30);
let shortcutList = notUpgradeOrderList[liindex].shortcutList;
let { liindex } = e.currentTarget.dataset
console.log(e, liindex)
console.log(e)
let { value } = e.detail
let { notUpgradeOrderList } = this.data
value = value.substring(0, 30)
let shortcutList = notUpgradeOrderList[liindex].shortcutList
if (!value) {
shortcutList = shortcutList.map((i) => {
i.active = false;
return i;
});
shortcutList = shortcutList.map(i => {
i.active = false
return i
})
}
let prop = `notUpgradeOrderList[${liindex}].shortcutList`;
let prop2 = `notUpgradeOrderList[${liindex}].focus`;
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`;
console.log(value, "value");
let prop = `notUpgradeOrderList[${liindex}].shortcutList`
let prop2 = `notUpgradeOrderList[${liindex}].focus`
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`
console.log(value, 'value')
this.setData({
[prop3]: value,
[prop]: shortcutList,
[prop2]: false,
});
[prop2]: false
})
},
chooseShortcut(e) {
let { item, index, liindex } = e.currentTarget.dataset;
console.log(item, index, liindex);
let { notUpgradeOrderList } = this.data;
let { item, index, liindex } = e.currentTarget.dataset
console.log(item, index, liindex)
let { notUpgradeOrderList } = this.data
// console.log(object);
// debugger
// if (notUpgradeOrderList[liindex].shortcutList[index].active) return
let refusalReason =
notUpgradeOrderList[liindex].customer.refusalReason || "";
refusalReason += item.confValue;
refusalReason = refusalReason.substring(0, 30);
let prop = `notUpgradeOrderList[${liindex}].shortcutList[${index}].active`;
notUpgradeOrderList[liindex].customer.refusalReason || ''
refusalReason += item.confValue
refusalReason = refusalReason.substring(0, 30)
let prop = `notUpgradeOrderList[${liindex}].shortcutList[${index}].active`
// let prop2 = `notUpgradeOrderList[${liindex}].focus`
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`;
let prop3 = `notUpgradeOrderList[${liindex}].customer.refusalReason`
this.setData({
[prop3]: refusalReason,
[prop]: true,
[prop]: true
// [prop2]: true
});
console.log(refusalReason, this.data.notUpgradeOrderList);
})
console.log(refusalReason, this.data.notUpgradeOrderList)
},
getSetting() {
// 动态获取 车型 车架 车牌 是否必填
......@@ -738,217 +805,219 @@ Page({
isCarBrand,
isPlateNumber,
experienceFlag,
refusalReason,
} = this.data;
refusalReason
} = this.data
// app .
getYQorderInfo()
.then((merchantSettingInfo) => {
.then(merchantSettingInfo => {
// let { requiredList } = this.data
if (merchantSettingInfo.carTypeRequiredFlag == "Y") isCarBrand = true; // 车型必填
if (merchantSettingInfo.standNoRequiredFlag == "Y") isStandNo = true; // 车架号必填
if (merchantSettingInfo.plateNumRequiredFlag == "Y")
isPlateNumber = true; // 车牌必填
if (merchantSettingInfo.foEfRequiredFlag == "Y") experienceFlag = true; // 战败订单是否体验
if (merchantSettingInfo.foRrRequiredFlag == "Y") refusalReason = true; // 战败订单拒升理由
if (merchantSettingInfo.carTypeRequiredFlag == 'Y') isCarBrand = true // 车型必填
if (merchantSettingInfo.standNoRequiredFlag == 'Y') isStandNo = true // 车架号必填
if (merchantSettingInfo.plateNumRequiredFlag == 'Y')
isPlateNumber = true // 车牌必填
if (merchantSettingInfo.foEfRequiredFlag == 'Y') experienceFlag = true // 战败订单是否体验
if (merchantSettingInfo.foRrRequiredFlag == 'Y') refusalReason = true // 战败订单拒升理由
this.setData({
isStandNo,
isCarBrand,
isPlateNumber,
experienceFlag,
refusalReason,
phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig),
});
phoneShow: wx.$util.deepClone(merchantSettingInfo.yqPhoneConfig)
})
})
.catch(err => {
console.log(err)
})
.catch((err) => {
console.log(err);
});
api2
.getConfigList({
confGroup: "SMARTCARLIFE_NOT_UPGRADE_LABEL",
confGroup: 'SMARTCARLIFE_NOT_UPGRADE_LABEL'
})
.then((res) => {
console.log(res);
let list = [];
let { code, data } = res;
.then(res => {
console.log(res)
let list = []
let { code, data } = res
if (code == 0) {
list = data;
list = data
}
let prop = `notUpgradeOrderList[0].shortcutList`;
let prop = `notUpgradeOrderList[0].shortcutList`
this.setData({
shortcutList: list,
[prop]: list,
});
});
[prop]: list
})
})
},
init(userInfo) {
let { orderObj, scene } = this.data;
orderObj.sellerMerchantName = userInfo.merchantName;
orderObj.sellerMerchantId = userInfo.merchantId;
orderObj.sellerName = userInfo.name;
orderObj.sellerUserId = userInfo.uuid;
let { orderObj, scene } = this.data
orderObj.sellerMerchantName = userInfo.merchantName
orderObj.sellerMerchantId = userInfo.merchantId
orderObj.sellerName = userInfo.name
orderObj.sellerUserId = userInfo.uuid
this.setData({
orderObj,
});
orderObj
})
if (scene) {
let id = scene.split("=")[1];
let id = scene.split('=')[1]
api
.getCouponDeatil({
id,
id
})
.then((info) => {
let { code, data, message } = info;
.then(info => {
let { code, data, message } = info
if (code == 0) {
if (data.usedFlag == "Y") {
if (data.usedFlag == 'Y') {
wx.showModal({
content: "该礼券已被使用",
confirmText: "知道了",
confirmColor: "#347BFF",
content: '该礼券已被使用',
confirmText: '知道了',
confirmColor: '#347BFF',
showCancel: false,
success(res) {
if (res.confirm) wx.$router.back();
},
});
return;
if (res.confirm) wx.$router.back()
}
})
return
}
this.setOrderObj(data);
this.setOrderObj(data)
api
.getOrderByCustomerCouponId({
customerCouponId: id,
customerCouponId: id
})
.then((res) => {
let { code, data, message } = res;
.then(res => {
let { code, data, message } = res
if (code == 0) {
console.log(data.orderCode, "getOrderByCustomerCouponId");
console.log(data.orderCode, 'getOrderByCustomerCouponId')
this.setData({
["orderObj.orderCode"]: data.orderCode,
});
['orderObj.orderCode']: data.orderCode
})
} else {
this.showToast(message);
this.showToast(message)
}
});
})
} else {
this.showToast(message);
this.showToast(message)
}
});
})
}
},
setOrderObj(options) {
let { scene, userInfo } = this.data;
console.log("setOrderObj", options);
wx.$util.showLoading("加载中...");
let orderObj = {};
Object.keys(options).map((e) => {
let { scene, userInfo } = this.data
console.log('setOrderObj', options)
wx.$util.showLoading('加载中...')
let orderObj = {}
Object.keys(options).map(e => {
if (options[e] != null && options[e] != undefined) {
if (typeof options[e] == "object") {
Object.keys(options[e]).map((key) => {
if (typeof options[e] == 'object') {
Object.keys(options[e]).map(key => {
if (options[e][key] == null || options[e][key] == undefined)
delete options[e][key];
});
delete options[e][key]
})
}
orderObj[e] = options[e];
orderObj[e] = options[e]
}
});
console.log(orderObj);
})
console.log(orderObj)
// 去除优惠券 参数
// delete orderObj.couponName;
delete orderObj.customerCouponId;
delete orderObj.couponName;
// 使用优惠券的merchantId 避免优惠券和店区不一致的情况
if (!orderObj.merchantId)
orderObj.merchantId = orderObj.merchantCoupon.merchantId;
orderObj.merchantId = orderObj.merchantCoupon.merchantId
if (!orderObj.customer) orderObj.customer = orderObj.customerInfo || {};
if (!orderObj.customer) orderObj.customer = orderObj.customerInfo || {}
// 是扫码核销值为3 预录值为2
if (orderObj.selectPayType == null || orderObj.selectPayType == undefined)
orderObj.selectPayType = scene ? 3 : 2;
orderObj.selectPayType = scene ? 3 : 2
// 是再次下单的 就删除优惠券字段 不是就赋值
// || orderObj.associatedOrderCode
if (orderObj.customerCoupon && orderObj.constructionFlag != "Y") {
orderObj.couponName = orderObj.customerCoupon.couponName;
orderObj.customerCouponCode =
orderObj.customerCoupon.customerCouponCode?.split("-")[0];
if (orderObj.couponId) {
orderObj.customerCouponId = orderObj.id;
}
} else {
delete orderObj.merchantCouponId;
}
// if (orderObj.customerCoupon && orderObj.constructionFlag != 'Y') {
// orderObj.couponName = orderObj.customerCoupon.couponName
// orderObj.customerCouponCode =
// orderObj.customerCoupon.customerCouponCode?.split('-')[0]
// if (orderObj.couponId) {
// orderObj.customerCouponId = orderObj.id
// }
// } else {
// delete orderObj.merchantCouponId
// }
if (scene) {
orderObj.customerCouponId = orderObj.id;
orderObj.orderSource = 5;
orderObj.sellerMerchantName = userInfo.merchantName;
orderObj.sellerName = userInfo.name;
orderObj.sellerMerchantId = userInfo.merchantId;
orderObj.sellerUserId = userInfo.uuid;
delete orderObj.remark;
orderObj.customerCouponId = orderObj.id
orderObj.orderSource = 5
orderObj.sellerMerchantName = userInfo.merchantName
orderObj.sellerName = userInfo.name
orderObj.sellerMerchantId = userInfo.merchantId
orderObj.sellerUserId = userInfo.uuid
delete orderObj.remark
} else {
orderObj.orderSource = orderObj.orderSource;
orderObj.orderSource = orderObj.orderSource
}
console.log(orderObj.customer, "orderObj.customer");
if (!orderObj?.customer.customerSex) orderObj.customer.customerSex = 1;
console.log(orderObj.customer, 'orderObj.customer')
if (!orderObj?.customer.customerSex) orderObj.customer.customerSex = 1
if (!orderObj?.customer.experienceFlag)
orderObj.customer.experienceFlag = "N";
orderObj.customer.experienceFlag = 'N'
// 预约工单跳转下单(处理园区店id参数 保证可以拿到园区店的礼券yqMerchantId)
if (options.yqMerchantId && options.isAppointment) {
orderObj.sellerMerchantId = options.yqMerchantId;
orderObj.sellerMerchantId = options.yqMerchantId
}
if (!orderObj.customer.salesType) orderObj.customer.salesType = 0;
console.log(orderObj, "orderObj");
if (!orderObj.customer.salesType) orderObj.customer.salesType = 0
console.log(orderObj, 'orderObj')
if (orderObj.packageGoodsList) {
console.log(orderObj.packageGoodsList);
orderObj.packageGoodsList.forEach((item) => {
item.active = true;
item.isType = "meal";
item.packageGoodsOrderList.forEach((g) => {
g.sellPrice = g.upgradePrice;
console.log(orderObj.packageGoodsList)
orderObj.packageGoodsList.forEach(item => {
item.active = true
item.isType = 'meal'
item.packageGoodsOrderList.forEach(g => {
g.sellPrice = g.upgradePrice
g.price = g.totalPrice
? Number(g.totalPrice) / Number(g.number)
: g.upgradePrice;
});
item.goodsList = item.packageGoodsOrderList;
: g.upgradePrice
})
item.goodsList = item.packageGoodsOrderList
item.upgradePrice = item.goodsList.reduce((prev, cur) => {
return prev + cur.sellPrice;
}, 0);
item.count = item.goodsList.length ? item.goodsList[0].number : 1;
return prev + cur.sellPrice
}, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number);
}, 0);
let total = item.price * item.count;
item.totalPrice = wx.$util.decimal(total, 2);
});
return prev + Number(cur.totalPrice) / Number(cur.number)
}, 0)
let total = item.price * item.count
item.totalPrice = wx.$util.decimal(total, 2)
})
}
let f = "notUpgradeOrderList[" + 0 + "]";
let f = 'notUpgradeOrderList[' + 0 + ']'
this.setData({
currentWordNumber: orderObj?.remark?.length || 0,
orderObj,
[f]: { ...orderObj },
first: true,
flag: true,
});
this.getOrderBaseGoodsList(orderObj.merchantId);
flag: true
})
this.getOrderBaseGoodsList(orderObj.merchantId)
},
initOPtions(res) {
if (res.customerName) {
// 解码
for (const key in res) {
res[key] = decodeURIComponent(res[key]);
res[key] = decodeURIComponent(res[key])
}
let f = "notUpgradeOrderList[" + 0 + "].customerName";
let f = 'notUpgradeOrderList[' + 0 + '].customerName'
this.setData({
[f]: res.customerName,
});
[f]: res.customerName
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (res) {
this.setTimeList();
res && this.initOPtions(res);
this.setTimeList()
res && this.initOPtions(res)
if (res.scene) {
this.setData(res);
this.setData(res)
}
},
/**
......@@ -960,26 +1029,26 @@ Page({
*/
onShow: function (res) { },
onRoute(res) {
console.log(res, "onroute");
this.setData({isExpiredTraffic: res?.isExpiredTraffic})
console.log(res, 'onroute')
this.setData({ isExpiredTraffic: res?.isExpiredTraffic })
if (res.scene) {
let { isAlreadyExistOrder } = this.data;
res.returnFun = true;
let { isAlreadyExistOrder } = this.data
res.returnFun = true
// 扫描核销进入战败工单 不可建档
isAlreadyExistOrder = true;
isAlreadyExistOrder = true
// 修复 res 为...res 解决对象没有拓展的问题
this.setData({
...res,
isAlreadyExistOrder,
});
isAlreadyExistOrder
})
}
// res && this.initOPtions(res);
this.getSetting();
this.getSetting()
if (res.merchantId) {
this.setData({
returnFun: true,
});
this.setOrderObj(res);
returnFun: true
})
this.setOrderObj(res)
}
},
/**
......@@ -1005,5 +1074,5 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
});
onShareAppMessage: function () { }
})
......@@ -75,13 +75,14 @@
<gl-cell wx:if="{{ orderObj.selectPayType !=0 }}" required="{{ isPlateNumber }}" border valueAlign="right" iconSrc="{{ scanIcon }}" bindtitleClick="navOcr" data-type="plateNumber" label="车牌号" requiredAfter labelWidth="var(--fontSize240)">
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" value="{{ li.customer.plateNumber }}" bindinput="input" data-name="customer.plateNumber" data-index="{{ ind }}" maxlength="8" always-embed></input>
</gl-cell>
<view class="goods_box" wx:if="{{!isExpiredTraffic}}">
<view class="goods_box" wx:if="{{ !isExpiredTraffic }}">
<view class="label" style="margin-bottom: {{ !frontGearArr.length && !sideRearGearArr.length && !skylightArr.length ? 'var(--fontSize40)' : '' }};">
请选择产品
<text class="required">*</text>
</view>
<block wx:if="{{ frontGearArr.length }}">
<gl-cell border valueAlign="right" label="前挡" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="1" />
<gl-cell border valueAlign="right" label="前挡" logoSrc="{{ windshield }}" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="1" />
<block wx:if="{{ li.subOrderList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ li.subOrderList }}" wx:key="index">
......@@ -113,13 +114,46 @@
</view>
</block>
</block>
<block wx:if="{{ sideBeforeRearGearArr.length }}">
<gl-cell border valueAlign="right" label="前侧窗玻璃" logoSrc="{{ tricorn }}" labelWidth="var(--fontSize180)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="2" data-positionnnum="2" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 前侧窗玻璃 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [2]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="../../images/del.png" />
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{ sideRearGearArr.length }}">
<gl-cell border valueAlign="right" label="侧后挡" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="2" />
<block wx:if="{{ li.subOrderList.length > 0 }}">
<gl-cell border valueAlign="right" label="后侧窗玻璃" logoSrc="{{ sideIcorn }}" labelWidth="var(--fontSize180)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="2" data-positionnnum="3" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ li.subOrderList }}" wx:key="index">
<!-- 侧后挡 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [2, 3, 4]) }}">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 后侧窗玻璃 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [3]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
......@@ -133,12 +167,45 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ true }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.price < 0 && (orderObj.selectPayType !=0) ? 'error':'' }} 'disabled'" always-embed />
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="2">x{{item.count}}</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}" data-custom-index="{{ ind }}">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="../../images/del.png" />
</view>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{ sideAfterRearGearArr.length }}">
<gl-cell border valueAlign="right" label="后档" logoSrc="{{ afterIcorn }}" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="2" data-positionnnum="4" />
<block wx:if="{{ goodsList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 后档 -->
<view class="goods" wx:if="{{ filter.filterIncludes((item.merchantGoodsPosition || item.upgradeGoodsPosition), [4]) }}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
</view>
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
<text>¥</text>
<input type="digit" value="{{ item.price }}" bindinput="changePrice" disabled="{{ orderObj.selectPayType ==0 }}" data-item="{{ item }}" bindblur="priceBlur" data-index="{{ index }}" class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<image src="../../images/del.png" />
</view>
</view>
......@@ -147,7 +214,7 @@
</block>
</block>
<block wx:if="{{ skylightArr.length }}">
<gl-cell border valueAlign="right" label="天窗" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="3" />
<gl-cell border valueAlign="right" label="天窗" logoSrc="{{ skylight }}" labelWidth="var(--fontSize140)" haveArrow placeholder="点击选择" bindclick="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="3" />
<block wx:if="{{ li.subOrderList.length > 0 }}">
<view class="goods-box">
<block wx:for="{{ li.subOrderList }}" wx:key="index">
......
......@@ -62,7 +62,8 @@ const domain_items = {
// dj: 'http://192.168.1.104:8292', //叶立庆
// dj: "http://192.168.1.169:8292", //蔡远明
// dj: 'http://192.168.1.174:8292',//范富荣
dj: 'http://192.168.1.89:8292', //周杭
// dj: 'http://192.168.1.89:8292', //周杭
dj: 'http://192.168.1.89:8292', //璐琦
// dj: 'http://192.168.1.116:8292',//陈希
// dj: 'http://192.168.1.60:8292',//周立明
// dj: 'http://192.168.148.235:8292',// 熊正顺
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!