Commit 5a18cd76 by zhangxw

创建预录订单接口调试

1 parent 5b97fa80
...@@ -33,10 +33,8 @@ module.exports = { ...@@ -33,10 +33,8 @@ module.exports = {
return api.post('dj.api.smartcarlife.workWechat.selectAccountLogin', data) return api.post('dj.api.smartcarlife.workWechat.selectAccountLogin', data)
}, },
/** 车品牌 */ /** 车品牌 */
getBrandList() { getBrandList(data) {
return api.post('dj.api.get.car.brandList', { return api.post('dj.api.get.car.brandList', data)
needCarSeries: true
})
}, },
/**获取当前登录账号能查看的园区店列表 */ /**获取当前登录账号能查看的园区店列表 */
getYQList() { getYQList() {
......
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
"selectedIconPath": "images/tab-order-active.png" "selectedIconPath": "images/tab-order-active.png"
}, },
{ {
"pagePath": "tabDate/pages/index/index",
"text": "预约",
"iconPath": "images/tab-date.png",
"selectedIconPath": "images/tab-date-active.png"
},
{
"pagePath": "tabMine/pages/index/index", "pagePath": "tabMine/pages/index/index",
"text": "我的", "text": "我的",
"iconPath": "images/tab-mine.png", "iconPath": "images/tab-mine.png",
...@@ -70,7 +76,8 @@ ...@@ -70,7 +76,8 @@
"qr-box": "components/Qrbox/Qrbox", "qr-box": "components/Qrbox/Qrbox",
"switch-popup": "components/switchPopup/switchPopup", "switch-popup": "components/switchPopup/switchPopup",
"order-switchPopup": "components/orderSwitchPopup/orderSwitchPopup", "order-switchPopup": "components/orderSwitchPopup/orderSwitchPopup",
"modal": "components/modal/modal" "modal": "components/modal/modal",
"tips-bottom": "components/tipsBottom/index"
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"permission": { "permission": {
......
...@@ -18,6 +18,13 @@ Component({ ...@@ -18,6 +18,13 @@ Component({
// console.log('carSeriesId') // console.log('carSeriesId')
// if (n) this.init() // if (n) this.init()
// } // }
},
merchantId: {
type: Number,
value: 0,
observer: function (n) {
if (n) this.init(n)
}
} }
}, },
...@@ -39,7 +46,7 @@ Component({ ...@@ -39,7 +46,7 @@ Component({
if (storageData) { if (storageData) {
this.getStorData(storageData) this.getStorData(storageData)
} else { } else {
this.init() // this.init()
} }
}, },
hide: function () {} hide: function () {}
...@@ -61,15 +68,15 @@ Component({ ...@@ -61,15 +68,15 @@ Component({
setTimeout(() => { setTimeout(() => {
// 解决数据过大导致在初始化是影响页面布局问题 // 解决数据过大导致在初始化是影响页面布局问题
this.setData({ storageData: carlist }) this.setData({ storageData: carlist })
this.init() // this.init()
}, 100) }, 100)
}, },
init() { init(num) {
// console.log('getBrandList') // console.log('getBrandList')
let { storageData } = this.data let { storageData } = this.data
// console.log(storageData) // console.log(storageData)
storageData && this.setCar(storageData) storageData && this.setCar(storageData)
api.getBrandList().then(car => { api.getBrandList({merchantId: num, needCarSeries: true}).then(car => {
if (car.code == 0) { if (car.code == 0) {
// console.log(car.data) // console.log(car.data)
// 如果前面用缓存渲染过就不需要再次用接口的渲染 // 如果前面用缓存渲染过就不需要再次用接口的渲染
...@@ -98,11 +105,13 @@ Component({ ...@@ -98,11 +105,13 @@ Component({
// 是最后一个特殊处理 // 是最后一个特殊处理
let saveData = index + 1 == carDateLength ? carData.slice(start) : carData.slice(start, end) let saveData = index + 1 == carDateLength ? carData.slice(start) : carData.slice(start, end)
wx.setStorageSync(stringName, saveData) // 选择车型与流量来源做关联 不做缓存处理
// wx.setStorageSync(stringName, saveData)
// } // }
list.push(stringName) list.push(stringName)
} }
wx.setStorageSync('dj_boutique_brand_list', JSON.stringify(list)) // 选择车型与流量来源做关联 不做缓存处理
// wx.setStorageSync('dj_boutique_brand_list', JSON.stringify(list))
// }) // })
// console.log(size / 1000) // console.log(size / 1000)
// let sizeNum = size / 1000 < 1000 // let sizeNum = size / 1000 < 1000
...@@ -207,12 +216,13 @@ Component({ ...@@ -207,12 +216,13 @@ Component({
searchCar(e) { searchCar(e) {
let { value } = e.detail let { value } = e.detail
let { carBrand } = this.data let { carBrand, merchantId } = this.data
if (!value) { if (!value) {
this.setData({ this.setData({
letter: 'A' letter: 'A'
}) })
this.init() if (!merchantId) return
this.init(merchantId)
// console.log('searchCar') // console.log('searchCar')
return return
} }
......
...@@ -50,9 +50,12 @@ ...@@ -50,9 +50,12 @@
</view> </view>
</block> </block>
</block> </block>
<block wx:else> <block wx:if="{{merchantId && brandList.length <= 0}}">
<view class="nothing">暂无数据</view> <view class="nothing">暂无数据</view>
</block> </block>
<block wx:if="{{!merchantId}}">
<view class="nothing">请先选择流量来源</view>
</block>
</scroll-view> </scroll-view>
<view class="side-bar" id="side-bar"> <view class="side-bar" id="side-bar">
<block wx:for="{{brandList}}" wx:key="index"> <block wx:for="{{brandList}}" wx:key="index">
......
...@@ -386,7 +386,7 @@ Component({ ...@@ -386,7 +386,7 @@ Component({
date: { start, end } date: { start, end }
} = e.detail } = e.detail
data.map(i => (i.active = false)) data.map(i => (i.active = false))
let index = type == 1 ? 3 : 5 let { index } = e.currentTarget.dataset
data[index] = { data[index] = {
name: `${start} 至 ${end}`, name: `${start} 至 ${end}`,
active: true, active: true,
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<view class="list-box"> <view class="list-box">
<block wx:for="{{form.timeList.data}}" wx:key="index"> <block wx:for="{{form.timeList.data}}" wx:key="index">
<block wx:if="{{item.type}}"> <block wx:if="{{item.type}}">
<calendar allowSameDay shortcut bindselect='rangeSelect' rangeAll dateType='range' calenderColor='#3582EE' <calendar allowSameDay shortcut bindselect='rangeSelect' data-index="{{index}}" rangeAll dateType='range' calenderColor='#3582EE'
vertical minDate="2020-10-01" maxDate="{{maxDate}}" isComponents> vertical minDate="2020-10-01" maxDate="{{maxDate}}" isComponents>
<view class="item text-center {{item.active?'active':''}}">{{item.name}}</view> <view class="item text-center {{item.active?'active':''}}">{{item.name}}</view>
</calendar> </calendar>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<block wx:for="{{form.timeList.data}}" wx:key="index"> <block wx:for="{{form.timeList.data}}" wx:key="index">
<block wx:if="{{item.type}}"> <block wx:if="{{item.type}}">
<view class="calendar"> <view class="calendar">
<calendar allowSameDay shortcut bindselect='rangeSelect' rangeAll dateType='range' <calendar allowSameDay shortcut bindselect='rangeSelect' data-index="{{index}}" rangeAll dateType='range'
calenderColor='#3582EE' vertical minDate="{{minDate}}" maxDate="{{maxDate}}" isComponents> calenderColor='#3582EE' vertical minDate="{{minDate}}" maxDate="{{maxDate}}" isComponents>
<view class="item text-center {{item.active?'active':''}}">{{item.name}}</view> <view class="item text-center {{item.active?'active':''}}">{{item.name}}</view>
</calendar> </calendar>
......
...@@ -48,7 +48,7 @@ Component({ ...@@ -48,7 +48,7 @@ Component({
// console.log(thisPage.data) // console.log(thisPage.data)
// console.log(thisPage) // console.log(thisPage)
// 处理组件实例化比页面快用上一个页面数据的问题 // 处理组件实例化比页面快用上一个页面数据的问题
if (thisPage?.data?.name != 'createdOrder') return if (!thisPage?.data?.name) return
let { orderObj } = thisPage.data let { orderObj } = thisPage.data
let isSellerInfo let isSellerInfo
// debugger // debugger
......
...@@ -6,6 +6,18 @@ Page({ ...@@ -6,6 +6,18 @@ Page({
*/ */
data: { data: {
detail: {}, detail: {},
orderObj: {
customer: {
customerName: '',
customerPhone: '',
standNo: '',
plateNumber: '',
customerSex: 1,
experienceFlag: 'Y'
},
remark: '',
selectPayType: 2,
},
customerObj: [ customerObj: [
{ {
label: '客户姓名', label: '客户姓名',
...@@ -233,6 +245,12 @@ Page({ ...@@ -233,6 +245,12 @@ Page({
}) })
} }
}, },
// 去下单
orderSubmit() {
let { detail } = this.data
detail.isAppointment = true
wx.$router.redirectTo('tabWorkOrder.createOrder', detail)
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
<!-- tabDate/pages/detail/detail.wxml --> <!-- tabDate/pages/detail/detail.wxml -->
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<view class="main"> <view class="main {{isFullSucreen?'isFullSucreen':''}}">
<view class="box"> <view class="box">
<view class="title">客户信息</view> <view class="title">客户信息</view>
<view class="customer-list"> <view class="customer-list">
...@@ -107,6 +107,9 @@ ...@@ -107,6 +107,9 @@
<view class="nothing text-center">暂无记录</view> <view class="nothing text-center">暂无记录</view>
</block> </block>
</view> </view>
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn text-center" bindtap="orderSubmit">去下单</view>
</view>
</view> </view>
<date-picker show="{{showDate}}" merchantId="{{detail.merchantCoupon.yqMerchantId}}" /> <date-picker show="{{showDate}}" merchantId="{{detail.merchantCoupon.yqMerchantId}}" />
<remark-popup <remark-popup
......
...@@ -4,7 +4,11 @@ page { ...@@ -4,7 +4,11 @@ page {
} }
.main { .main {
padding: 20rpx 20rpx 60rpx; padding: 20rpx 20rpx 120rpx;
}
.isFullSucreen {
padding-bottom: 102px !important;
} }
.box { .box {
...@@ -294,3 +298,28 @@ page { ...@@ -294,3 +298,28 @@ page {
transform: translateX(-50%); transform: translateX(-50%);
content: ''; content: '';
} }
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.btns {
position: fixed;
z-index: 998;
left: 0;
bottom: 0;
width: 100%;
box-sizing: border-box;
min-height: 100rpx;
background: #FFFFFF;
padding-bottom: 10rpx;
}
.btns .btn {
height: 80rpx;
background: #3582EE;
border-radius: 12rpx;
font-size: 28rpx;
color: #FFFFFF;
margin: 10rpx 32rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
}, },
3: { 3: {
text: '取消预约', text: '取消预约',
color: '#999999' color: '#FF7D12'
}, },
4: { 4: {
text: '已施工', text: '已施工',
...@@ -47,7 +47,7 @@ Page({ ...@@ -47,7 +47,7 @@ Page({
}, },
5: { 5: {
text: '过期到店', text: '过期到店',
color: '#999999' color: '#FF7D12'
} }
}, },
searchObj: {}, searchObj: {},
......
<navigation-bar bindnavbarReady="navbarReady" showBack bindback="back"> <navigation-bar bindnavbarReady="navbarReady" showBack="{{show_confirm}}" bindback="back">
{{!show_confirm?'预约管理':'筛选'}} {{!show_confirm?'预约管理':'筛选'}}
</navigation-bar> </navigation-bar>
<block wx:if="{{navBarHeight > 0}}"> <block wx:if="{{navBarHeight > 0}}">
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
<block wx:if="{{list.length > 0}}"> <block wx:if="{{list.length > 0}}">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item}}" wx:for-item="li" wx:for-index="ind" wx:key="ind"> <block wx:for="{{item}}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view class="item" catchtap="jump" data-name="detail" data-item="{{li}}"> <view class="item list-item" catchtap="jump" data-name="detail" data-item="{{li}}">
<view class="status" style="color:{{status[li.inviteStatus].color}}"> <view class="status" style="color:{{status[li.inviteStatus].color}}">
<block>{{status[li.inviteStatus].text}}</block> <block>{{status[li.inviteStatus].text}}</block>
<block wx:if="{{li.inviteStatus ==1 || li.inviteStatus == 2}}"> <block wx:if="{{li.inviteStatus !==4}}">
<view class="line" style="background-color:{{status[li.inviteStatus].color}};"></view> <view class="line" style="background-color:{{status[li.inviteStatus].color}};"></view>
</block> </block>
</view> </view>
......
...@@ -3,16 +3,23 @@ ...@@ -3,16 +3,23 @@
.list .list-item{
margin: 20rpx;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx;
}
.list .item .status { .list .item .status {
background: none; background: none;
top: 40rpx; top: 40rpx;
text-align: center;
} }
.list .item .status .line { .list .item .status .line {
position: absolute; position: absolute;
top: -40rpx; top: -40rpx;
left: 0; left: 0;
width: 84rpx; width: 100%;
height: 12rpx; height: 12rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
......
...@@ -45,10 +45,16 @@ Page({ ...@@ -45,10 +45,16 @@ Page({
}, },
isStaff: false, isStaff: false,
showOrderpop: false, showOrderpop: false,
waitInputCount: 0 waitInputCount: 0,
tipsProps: {
tipsText: "该门店产生异常订单,请点击补录!",
showTips: true,
type: 2,
typeText: "补录订单"
}
// tableWidth: 606 + 28 // tableWidth: 606 + 28
}, },
showOrderPop() { tipsEvent() {
this.setData({ this.setData({
showOrderpop: true showOrderpop: true
}) })
......
...@@ -233,10 +233,13 @@ ...@@ -233,10 +233,13 @@
</view> </view>
</view> </view>
</block> </block>
<view class="waitOrderCon" wx:if="{{waitInputCount}}"> <!-- <view class="waitOrderCon" wx:if="{{waitInputCount}}">
<image class="tipsIcon" src="../../../images/tips.png" /> <image class="tipsIcon" src="../../../images/tips.png" />
<view class="label">该门店产生异常订单,请点击补录!</view> <view class="label">该门店产生异常订单,请点击补录!</view>
<view class="btn" bindtap="showOrderPop">补录订单</view> <view class="btn" bindtap="showOrderPop">补录订单</view>
</view> -->
<view class="waitOrderCon" wx:if="{{waitInputCount}}">
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}"></tips-bottom>
</view> </view>
</view> </view>
<remark-popup <remark-popup
......
...@@ -48,7 +48,7 @@ page ::-webkit-scrollbar { ...@@ -48,7 +48,7 @@ page ::-webkit-scrollbar {
background-image: linear-gradient(166deg, #65b8f8 0%, #3582ee 100%); background-image: linear-gradient(166deg, #65b8f8 0%, #3582ee 100%);
display: grid; display: grid;
align-items: center; align-items: center;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(3, 1fr);
} }
.menu .item { .menu .item {
...@@ -535,7 +535,7 @@ page ::-webkit-scrollbar { ...@@ -535,7 +535,7 @@ page ::-webkit-scrollbar {
font-size: 24rpx; font-size: 24rpx;
font-weight: 600; font-weight: 600;
color: #3582EE; color: #3582EE;
padding: 0 20rpx; /* padding: 0 20rpx; */
height: 74rpx; height: 74rpx;
background: #EFF5FE; background: #EFF5FE;
z-index: 9; z-index: 9;
......
...@@ -11,14 +11,10 @@ export default { ...@@ -11,14 +11,10 @@ export default {
url: 'tabWorkOrder.createArchives' url: 'tabWorkOrder.createArchives'
}, },
// { // {
// name: '扫码核销', // name: '预约管理',
// wxCallBack: 'scanCode' // url: 'tabDate.index'
// }, // },
{ {
name: '预约管理',
url: 'tabDate.index'
},
{
name: '经营数据', name: '经营数据',
url: 'tabOperating.index' url: 'tabOperating.index'
} }
......
...@@ -93,5 +93,9 @@ module.exports = { ...@@ -93,5 +93,9 @@ module.exports = {
/** 战败订单批量补录 */ /** 战败订单批量补录 */
notUpgradeOrder(data) { notUpgradeOrder(data) {
return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data) return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data)
},
/** 新建预录工单 */
createPrerecordedOrder(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder', data)
} }
} }
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
sub-title="选择销售顾问" sub-title="选择销售顾问"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" /> type="1" />
<car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId || ''}}" /> <car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId || ''}}" merchantId="{{orderObj.merchantId || undefined}}" />
<remark-popup <remark-popup
wx:if="{{showRemark}}" wx:if="{{showRemark}}"
show="{{showRemark}}" show="{{showRemark}}"
......
...@@ -57,7 +57,13 @@ Page({ ...@@ -57,7 +57,13 @@ Page({
userInfo: {}, userInfo: {},
requiredList: [], requiredList: [],
isErrorOrder: false, isErrorOrder: false,
showTips: false isAlreadyExistOrder: false,
showTips: false,
tipsProps: {
tipsText: "填写客户信息可保存为客户预录工单。",
showTips: true,
type: 1,
}
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
...@@ -295,17 +301,17 @@ Page({ ...@@ -295,17 +301,17 @@ Page({
submit(i) { submit(i) {
let { save } = i.currentTarget.dataset let { save } = i.currentTarget.dataset
let { orderDisabled, goodsList, orderObj, scene, isErrorOrder } = this.data let { orderDisabled, goodsList, orderObj, scene, isErrorOrder, isAlreadyExistOrder } = this.data
// 如果是错单补录 禁用掉保存功能 // 如果是错单补录 禁用掉保存功能 或待跟进订单/预约订单 禁用建档
if (isErrorOrder && save) return if ((isErrorOrder && save) || (isAlreadyExistOrder && save)) return
// 判断商户配置财务规则 // 判断商户配置财务规则
// if (!canOrder) { // if (!canOrder) {
// return this.showToast('未设置分润规则 请联系管理员') // return this.showToast('未设置分润规则 请联系管理员')
// } // }
let key = this.checkRequired(orderObj) let key = this.checkRequired(save, orderObj)
console.log(key) console.log(key)
// debugger // debugger
if (key) { if (key) {
...@@ -330,38 +336,17 @@ Page({ ...@@ -330,38 +336,17 @@ Page({
// if (!save) { // if (!save) {
let subOrderList = [] let subOrderList = []
let priceDisabled = true let priceDisabled = true
if (orderObj.selectPayType != 0) { let goodsKey = this.checkGoods(save, subOrderList, priceDisabled, goodsList, orderObj)
if (goodsList) { if (goodsKey) {
goodsList.map(e => { this.showToast(goodsKey)
let obj = {
baseGoodsId: e.baseGoodsId,
upgradeGoodsId: e.id,
totalPrice: Number(e.price),
number: e.count
}
if (e.price < e.shopMinPrice) priceDisabled = false
subOrderList.push(obj)
})
orderObj.subOrderList = subOrderList
}
if (subOrderList.length == 0) {
this.showToast('商品不能为空')
return return
} }
} else {
// 不升级删除商品参数
delete orderObj.subOrderList
}
// else { // else {
// if (!orderObj.customerCouponCode) { // if (!orderObj.customerCouponCode) {
// this.showToast('请选择精品礼券') // this.showToast('请选择精品礼券')
// return // return
// } // }
// } // }
if (!priceDisabled) {
this.showToast('单价不可低于商品最低价')
return
}
// } // }
// console.log(orderObj.subOrderList) // console.log(orderObj.subOrderList)
...@@ -385,18 +370,23 @@ Page({ ...@@ -385,18 +370,23 @@ Page({
// console.log(orderObj) // console.log(orderObj)
// return // return
// return console.log(orderObj) // return console.log(orderObj)
// return let submitObj = JSON.parse(JSON.stringify(orderObj))
if (save) { // 建档删除卡券商品支付方式参数
delete submitObj.subOrderList
delete submitObj.customerCouponCode
delete submitObj.selectPayType
}
this.showLoading('提交中...') this.showLoading('提交中...')
// 判断是不是 修改订单 是走另外接口逻辑 // 判断是不是 修改订单 是走另外接口逻辑
// if (isErrorOrder) { // if (isErrorOrder) {
// return this.setCorrectionOrder(orderObj) // return this.setCorrectionOrder(orderObj)
// } // }
let apiName = isErrorOrder ? 'correctionOrder' : 'createWithPay' let apiName = save && !isErrorOrder ? 'createPrerecordedOrder' : isErrorOrder ? 'correctionOrder' : 'createWithPay'
// 是订单修正就把错误单号带上 // 是订单修正就把错误单号带上
if (isErrorOrder) orderObj.oldOrderCode = orderObj.associateOrderCode if (isErrorOrder) orderObj.oldOrderCode = orderObj.associateOrderCode
api[apiName](orderObj).then(res => { api[apiName](submitObj).then(res => {
wx.hideLoading() wx.hideLoading()
// console.log(orderObj, res) // console.log(orderObj, res)
let { code, data, message } = res let { code, data, message } = res
...@@ -428,11 +418,41 @@ Page({ ...@@ -428,11 +418,41 @@ Page({
} }
}) })
}, },
checkRequired(obj) { checkGoods(save, subOrderList, priceDisabled, goodsList, orderObj) {
if (save) return false
if (orderObj.selectPayType != 0) {
if (goodsList) {
goodsList.map(e => {
let obj = {
baseGoodsId: e.baseGoodsId,
upgradeGoodsId: e.id,
totalPrice: Number(e.price),
number: e.count
}
if (e.price < e.shopMinPrice) priceDisabled = false
subOrderList.push(obj)
})
orderObj.subOrderList = subOrderList
}
if (subOrderList.length == 0) {
return '商品不能为空'
}
} else {
// 不升级删除商品参数
delete orderObj.subOrderList
}
if (!priceDisabled) {
return '单价不可低于商品最低价'
}
// if (orderObj.selectPayType == null) {
// return '请选择支付方式'
// }
},
checkRequired(save, obj) {
// 导入动态校验字段 // 导入动态校验字段
let { requiredList } = this.data let { requiredList } = this.data
// console.log(requiredList) ...requiredList, // console.log(requiredList) ...requiredList,
let target = ['userId', 'merchantId', 'employeeName', 'customerName', 'customerPhone', ...requiredList, 'sellerUserId', 'sellerName', 'sellerMerchantId', 'customerCouponCode'] let target = save ? ['userId', 'merchantId', 'employeeName', 'customerName', 'customerPhone', ...requiredList, 'sellerUserId', 'sellerName', 'sellerMerchantId'] : ['userId', 'merchantId', 'employeeName', 'customerName', 'customerPhone', ...requiredList, 'sellerUserId', 'sellerName', 'sellerMerchantId', 'customerCouponCode']
obj = { obj = {
...obj, ...obj,
...obj.customer ...obj.customer
...@@ -520,6 +540,10 @@ Page({ ...@@ -520,6 +540,10 @@ Page({
} }
}) })
} }
// 预约工单跳转下单(处理园区店id参数 保证可以拿到园区店的礼券yqMerchantId)
if (options.yqMerchantId && options.isAppointment) {
orderObj.sellerMerchantId = options.yqMerchantId
}
this.setData({ this.setData({
orderObj, orderObj,
first: true, first: true,
...@@ -732,15 +756,36 @@ Page({ ...@@ -732,15 +756,36 @@ Page({
// setTimeout(() => { // setTimeout(() => {
// wx.$util.showLoading() // wx.$util.showLoading()
// }, 2000) // }, 2000)
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
}, },
onRoute(res) { onRoute(res) {
// debugger // debugger
// console.log(res) console.log(res)
// console.log() // console.log()
let { tipsProps, isAlreadyExistOrder } = this.data
if (Object.keys(res).length > 0 ) {
if (res.associateOrderCode) {
tipsProps.showTips = true
tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。'
} else if (res.orderCode) { // 以建档(预约列表)/待跟进工单不可建档
isAlreadyExistOrder = true
tipsProps.showTips = false
}
this.setData({
tipsProps,
isAlreadyExistOrder
})
}
if (res.scene) { if (res.scene) {
res.returnFun = true res.returnFun = true
this.setData(res) // 扫描核销进入新建工单 不可建档
isAlreadyExistOrder = true
tipsProps.showTips = false
this.setData({
res,
tipsProps,
isAlreadyExistOrder
})
} else if (res.merchantId) { } else if (res.merchantId) {
this.setData({ this.setData({
returnFun: true returnFun: true
......
<wxs src="index.wxs" module="filter" /> <wxs src="index.wxs" module="filter" />
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<view class="main {{isFullSucreen?'isFullSucreen':''}} {{showTips?'fullSucreen-tips':'' }}"> <view class="main {{isFullSucreen?'isFullSucreen':''}} {{tipsProps.showTips?'fullSucreen-tips':'' }}">
<view class="box"> <view class="box">
<view class="userId"> <view class="userId">
<gl-cell <gl-cell
...@@ -312,20 +312,25 @@ ...@@ -312,20 +312,25 @@
</view> </view>
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<!-- wx:if="{{isErrorOrder}}" --> <!-- wx:if="{{isErrorOrder}}" -->
<view class="tips" wx:if="{{showTips}}"> <!-- <view class="tips" wx:if="{{showTips}}">
<image class=" tipsIcon" src="../../../images/tips.png" /> <image class=" tipsIcon" src="../../../images/tips.png" />
<view class="contentText"> <view class="contentText">
原订单录入信息有误,请重新提交正确的订单信息。 原订单录入信息有误,请重新提交正确的订单信息。 -->
<!-- <view>支付订单号:{{outTradeNo}}</view> <!-- <view>支付订单号:{{outTradeNo}}</view>
<view>支付时间:{{accountDate}}</view> --> <view>支付时间:{{accountDate}}</view> -->
</view> <!-- </view>
<image class="closeIcon" bindtap="closeTips" src="../../images/closeIcon.png" /> <image class="closeIcon" bindtap="closeTips" src="../../images/closeIcon.png" />
</view> </view> -->
<view class="btns-con"> <!-- <view class="btns-con">
<view class="save text-center {{isErrorOrder ?'disabled':''}}" bindtap="submit" data-save> <view class="save text-center {{isErrorOrder ?'disabled':''}}" bindtap="submit" data-save>
保存 保存
</view> </view>
<view class="confirm text-center" bindtap="submit">提交工单</view> <view class="confirm text-center" bindtap="submit">提交工单</view>
</view> -->
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{tipsProps}}"></tips-bottom>
<view class="btns-con">
<view class="save text-center {{isErrorOrder || isAlreadyExistOrder ?'disabled':''}}" bindtap="submit" data-save>建档</view>
<view class="confirm text-center" bindtap="submit">直接下单</view>
</view> </view>
</view> </view>
</block> </block>
...@@ -335,7 +340,7 @@ ...@@ -335,7 +340,7 @@
sub-title="选择销售顾问" sub-title="选择销售顾问"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" /> type="1" />
<car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId || ''}}" /> <car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId || ''}}" merchantId="{{orderObj.merchantId || undefined}}" />
<remark-popup <remark-popup
wx:if="{{showRemark}}" wx:if="{{showRemark}}"
show="{{showRemark}}" show="{{showRemark}}"
......
...@@ -278,8 +278,17 @@ page { ...@@ -278,8 +278,17 @@ page {
box-sizing: border-box; box-sizing: border-box;
} }
.btns .save,
.confirm {
border: 2rpx solid #0075F9;
border-radius: 12rpx;
height: 80rpx;
box-sizing: border-box;
}
.btns .save { .btns .save {
width: 186rpx; width: 186rpx;
margin-right: 20rpx;
color: #3582EE; color: #3582EE;
margin-right: 20rpx; margin-right: 20rpx;
} }
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
wx:for-item="i" wx:for-item="i"
wx:for-index="sindex"> wx:for-index="sindex">
<view class="goods" wx:if="{{sindex < 2}}"> <view class="goods" wx:if="{{sindex < 2}}">
<view class="goods-name text-hide">{{i.upgradeGoodsName}}</view> <view class="goods-name text-hide">{{i.upgradeGoodsName || ''}}</view>
<view class="goods-price"> <view class="goods-price">
¥ ¥
<text>{{i.totalPrice || 0}}</text> <text>{{i.totalPrice || 0}}</text>
......
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
sub-title="选择销售顾问" sub-title="选择销售顾问"
userInfo="{{userInfo}}" userInfo="{{userInfo}}"
type="1" /> --> type="1" /> -->
<car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId}}" /> <car-brands show="{{carBrandBox}}" bindconfirm="chooseCar" carSeriesId="{{orderObj.customer.carSeriesId}}" merchantId="{{orderObj.merchantId || undefined}}" />
<remark-popup <remark-popup
wx:if="{{showRemark}}" wx:if="{{showRemark}}"
show="{{showRemark}}" show="{{showRemark}}"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!