Commit e520d6d0 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !164
2 parents 319d5aee c9daff53
...@@ -62,7 +62,7 @@ Component({ ...@@ -62,7 +62,7 @@ Component({
copyArtificerList.map(i => { copyArtificerList.map(i => {
i.active = false i.active = false
if (i.id == selectedTechnicianId) i.active = true if (i.id == selectedTechnicianId) i.active = true
if (i.technicianName.indexOf(value) != -1) { if (i.staffName.indexOf(value) != -1) {
arr.push(i) arr.push(i)
} }
}) })
...@@ -106,8 +106,9 @@ Component({ ...@@ -106,8 +106,9 @@ Component({
if (!arr.length) { if (!arr.length) {
return wx.$util.showToast('请选择技师') return wx.$util.showToast('请选择技师')
} }
orderInfo.technicianUuid = arr[0]?.uuid || ''
orderInfo.technicianId = arr[0]?.id || '' orderInfo.technicianId = arr[0]?.id || ''
orderInfo.technicianName = arr[0]?.technicianName || '' orderInfo.technicianName = arr[0]?.staffName || ''
this.triggerEvent('confirm', orderInfo) this.triggerEvent('confirm', orderInfo)
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="checked_img"> <view class="checked_img">
<image wx:if="{{item.active}}" src="{{IMG_URL}}checked.png"></image> <image wx:if="{{item.active}}" src="{{IMG_URL}}checked.png"></image>
</view> </view>
<view class="text_box"><view class="text-hide">{{item.technicianName}}</view></view> <view class="text_box"><view class="text-hide">{{item.staffName}}</view></view>
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
......
...@@ -12,6 +12,16 @@ Component({ ...@@ -12,6 +12,16 @@ Component({
} }
} }
}, },
selectPayType: {
type: Number,
observer: function (n) {
// console.log(n,'selectPayType');
if (n == 0) {
this.checkCoupon()
// defaultSelectCoupon()
}
}
},
merchantId: { merchantId: {
type: Number, type: Number,
observer: function (n, o) { observer: function (n, o) {
...@@ -90,7 +100,8 @@ Component({ ...@@ -90,7 +100,8 @@ Component({
api api
.getCouponList({ .getCouponList({
merchantId, merchantId,
yqMerchantId yqMerchantId,
orderByType:9, // 按时间排序
}) })
.then(res => { .then(res => {
let { code, data, message } = res let { code, data, message } = res
...@@ -180,8 +191,9 @@ Component({ ...@@ -180,8 +191,9 @@ Component({
customerCouponList, customerCouponList,
chooseItem chooseItem
}) })
// 追加一个逻辑 订单补录并且不是回显的话 // 追加一个逻辑 订单补录并且不是回显的话 或则订单是战败
if (pageName == 'additionRecordOrder' && !orderObj.couponName && !orderObj.customerCouponCode) { // pageName == 'additionRecordOrder' &&
if ( (pageName == 'additionRecordOrder' || this.data.selectPayType == 0 )&&!orderObj.couponName && !orderObj.customerCouponCode) {
if (couponList.length) { if (couponList.length) {
// couponList.find((item)=>{ // couponList.find((item)=>{
// return item.list.length && // return item.list.length &&
......
...@@ -4,7 +4,21 @@ Component({ ...@@ -4,7 +4,21 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
tabList: Array tabList: Array,
activeIndex: {
type: Number,
observer: function (n) {
console.log(this.data.tabIndex,'activeIndex',n);
console.log(this.data.tabIndex!= n);
if (this.data.tabIndex!= n) {
this.setData({
tabIndex:this.data.activeIndex
})
this.setTab(this.data.tabIndex)
}
}
}
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -14,7 +28,9 @@ Component({ ...@@ -14,7 +28,9 @@ Component({
}, },
lifetimes: { lifetimes: {
ready() { ready() {
this.setTab() console.log('lifetimes',this.data.tabIndex);
console.log('lifetimes',this.data.activeIndex);
this.setTab(this.data.tabIndex)
} }
}, },
/** /**
......
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 3 let index = 2
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
/* packageEquity/pages/carEquity/previewList/previewList.wxss */ /* packageEquity/pages/carEquity/previewList/previewList.wxss */
page { page {
background: #f3f5f7; background: #f3f5f7;
} }
.item_box { .item_box {
box-sizing: border-box; box-sizing: border-box;
padding: 32rpx; padding: 32rpx;
width: 710rpx; width: 710rpx;
height: 120rpx; height: 120rpx;
margin: 20rpx auto 0; margin: 20rpx auto 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 #cdcdd159; box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx; border-radius: 16rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #222222; color: #222222;
} }
.arrow { .arrow {
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
border-top: 2rpx solid transparent; border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc; border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc; border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent; border-left: 2rpx solid transparent;
transform: rotate(-45deg) translateY(-4rpx); transform: rotate(-45deg) translateY(-4rpx);
margin-left: 16rpx; margin-left: 16rpx;
transition: all .3s; transition: all .3s;
} }
.prevIcon { .prevIcon {
margin-left: auto; margin-left: auto;
margin-right: 40rpx; margin-right: 40rpx;
} }
.downloadIcon{ .downloadIcon{
margin-left: 40prx;} margin-left: 40prx;}
.icon { .icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
\ No newline at end of file \ No newline at end of file
/* components/Goods/Goods.wxss */ /* components/Goods/Goods.wxss */
/* @import '../Coupon/Coupon.wxss'; */ /* @import '../Coupon/Coupon.wxss'; */
.coupon-box { .coupon-box {
width: calc(100% + 64rpx); width: calc(100% + 64rpx);
height: 100%; height: 100%;
margin-left: -32rpx; margin-left: -32rpx;
} }
.coupon { .coupon {
height: calc(100% - 104rpx); height: calc(100% - 104rpx);
} }
.box { .box {
border-bottom: 2rpx solid #EBEDF0; border-bottom: 2rpx solid #EBEDF0;
padding-left: 72rpx; padding-left: 72rpx;
} }
.title { .title {
padding: 18rpx 0 0 32rpx; padding: 18rpx 0 0 32rpx;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
height: 88rpx; height: 88rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.text-center{ .text-center{
text-align: center; text-align: center;
} }
.item { .item {
box-sizing: border-box; box-sizing: border-box;
padding: 23rpx 0; padding: 23rpx 0;
border-top: 2rpx solid #EBEDF0; border-top: 2rpx solid #EBEDF0;
/* height: 84rpx; */ /* height: 84rpx; */
display: flex; display: flex;
/* align-items: center; */ /* align-items: center; */
align-items: start; align-items: start;
font-size: 28rpx; font-size: 28rpx;
color: #888888; color: #888888;
position: relative; position: relative;
} }
.item.disabled{ .item.disabled{
color: #ccc; color: #ccc;
} }
.text-hide { .text-hide {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.serveName{ .serveName{
width: 100%; width: 100%;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.item .icon{ .item .icon{
display: none; display: none;
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
position: absolute; position: absolute;
top: 28rpx; top: 28rpx;
left: -52rpx; left: -52rpx;
/* transform: translateY(-50%); */ /* transform: translateY(-50%); */
} }
.item.active{ .item.active{
color: #3582EE; color: #3582EE;
} }
.item.active .icon{ .item.active .icon{
display: block; display: block;
} }
.nothing{ .nothing{
padding: 100rpx; padding: 100rpx;
text-align: center; text-align: center;
color: #999; color: #999;
} }
.item { .item {
justify-content: space-between; justify-content: space-between;
padding-right: 32rpx; padding-right: 32rpx;
} }
.title .tips { .title .tips {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
.item .value { .item .value {
/* width: calc(100% - 180rpx); */ /* width: calc(100% - 180rpx); */
width: 100%; width: 100%;
display: flex; display: flex;
/* flex-direction: ; */ /* flex-direction: ; */
justify-content: space-between; justify-content: space-between;
} }
.item .labelWidth { .item .labelWidth {
width: calc(100% - 180rpx); width: calc(100% - 180rpx);
/* display: flex; */ /* display: flex; */
} }
.item .value .name { .item .value .name {
max-width: 85%; max-width: 85%;
} }
.item .value .name .warning_text{ .item .value .name .warning_text{
color: #F24724; color: #F24724;
margin-left: 10rpx; margin-left: 10rpx;
font-size: 22rpx; font-size: 22rpx;
} }
.item .value .textWidth { .item .value .textWidth {
max-width: 100%; max-width: 100%;
} }
.item .value .last { .item .value .last {
max-width: 15%; max-width: 15%;
} }
.item .value .price { .item .value .price {
/* color: #3582EE; */ /* color: #3582EE; */
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #EB4E4E; color: #EB4E4E;
} }
.item .control { .item .control {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.item .control .minus, .item .control .minus,
.item .control .add { .item .control .add {
width: 44rpx; width: 44rpx;
height: 44rpx; height: 44rpx;
color: #3582EE; color: #3582EE;
background: #F7F7F7; background: #F7F7F7;
border-radius: 6rpx; border-radius: 6rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 32rpx; font-size: 32rpx;
font-weight: 700; font-weight: 700;
} }
.item .control .input { .item .control .input {
width: 72rpx; width: 72rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
margin: 0 5rpx; margin: 0 5rpx;
} }
.disableSelect { .disableSelect {
opacity: 0.4; opacity: 0.4;
} }
.item .icon { .item .icon {
display: block; display: block;
} }
.item .icon .arc { .item .icon .arc {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 2rpx solid #979797; border: 2rpx solid #979797;
border-radius: 100%; border-radius: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.nothing { .nothing {
padding: 100rpx; padding: 100rpx;
text-align: center; text-align: center;
color: #999; color: #999;
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ Page({ ...@@ -8,6 +8,7 @@ Page({
*/ */
data: { data: {
...order_mixins.data, ...order_mixins.data,
activeIndex:0,
orderObj: [ orderObj: [
{ {
label: '销售顾问', label: '销售顾问',
...@@ -358,7 +359,10 @@ Page({ ...@@ -358,7 +359,10 @@ Page({
}) })
e.total_price = e.totalPrice e.total_price = e.totalPrice
e.totalPrice = Number(wx.$util.decimal(e.totalPrice, 2)).toFixed(2) e.totalPrice = Number(wx.$util.decimal(e.totalPrice, 2)).toFixed(2)
let orderType = userInfo.userType == 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1 let orderType = userInfo.userType == 1 && e.status != 9 && e.status != 1 && ![1,3,4].includes(e.selectPayType)
// let orderType = userInfo.userType !== 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1
console.log(userType);
console.log(orderType);
e.repeal = userType && orderType e.repeal = userType && orderType
// 处理subOrderList 商品为空的情况 // 处理subOrderList 商品为空的情况
e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId) e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId)
...@@ -453,6 +457,23 @@ Page({ ...@@ -453,6 +457,23 @@ Page({
// wx.setStorageSync('waitCode', list) // wx.setStorageSync('waitCode', list)
// }) // })
// }, // },
onRoute (options) {
// console.log('activeIndex' in options);
if ('activeIndex' in options) {
// let { searchObj } = this.data
// delete searchObj.inviteStatus
this.setData({
activeIndex:options.activeIndex,
// searchObj.inviteStatusList
})
}
// if (wx.$refresh ) {
// this.search()
// // this.getStatByPeriod()
// // this.getiIviteRecord()
// }
// console.log(options,'options');
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
</view> </view>
</view> </view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" /> <tab-bar tabList="{{tabList}}" bindclick="tabClick" activeIndex="{{activeIndex}}" />
</view> </view>
<!-- 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销 --> <!-- 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销 -->
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
......
...@@ -8,6 +8,7 @@ Page({ ...@@ -8,6 +8,7 @@ Page({
*/ */
data: { data: {
tabIndex: 0, tabIndex: 0,
activeIndex:0,
phoneShow: false, phoneShow: false,
inviteObj: { inviteObj: {
dayInvited: 0, dayInvited: 0,
...@@ -248,6 +249,7 @@ Page({ ...@@ -248,6 +249,7 @@ Page({
}) })
}, },
tabClick(e) { tabClick(e) {
console.log('tabClick',e.detail);
let { searchObj } = this.data let { searchObj } = this.data
delete searchObj.inviteStatus delete searchObj.inviteStatus
this.setData({ this.setData({
...@@ -304,8 +306,8 @@ Page({ ...@@ -304,8 +306,8 @@ Page({
this.setData({ this.setData({
phoneShow: app.globalData.YQorderSetting?.yqPhoneConfig phoneShow: app.globalData.YQorderSetting?.yqPhoneConfig
}) })
this.getStatByPeriod() // this.getStatByPeriod()
this.getiIviteRecord() // this.getiIviteRecord()
}, },
getiIviteRecord() { getiIviteRecord() {
// let params = {} // let params = {}
...@@ -366,6 +368,8 @@ Page({ ...@@ -366,6 +368,8 @@ Page({
} }
if (keyword) obj.keyword = keyword if (keyword) obj.keyword = keyword
if (tabIndex != 0) obj.inviteStatusList = tabIndex == 1 ? [2] : [1, 3] if (tabIndex != 0) obj.inviteStatusList = tabIndex == 1 ? [2] : [1, 3]
console.log(tabIndex,obj);
// debugger
api.getInviteList(obj).then(res => { api.getInviteList(obj).then(res => {
wx.hideLoading() wx.hideLoading()
console.log(obj, res) console.log(obj, res)
...@@ -418,7 +422,6 @@ Page({ ...@@ -418,7 +422,6 @@ Page({
}, },
setInviteDate() { setInviteDate() {
let { dateItem, inviteDateStr } = this.data let { dateItem, inviteDateStr } = this.data
api api
.setInviteDate({ .setInviteDate({
id: dateItem.id, id: dateItem.id,
...@@ -440,6 +443,23 @@ Page({ ...@@ -440,6 +443,23 @@ Page({
} }
}) })
}, },
onRoute (options) {
// console.log('activeIndex' in options);
if ('activeIndex' in options) {
// let { searchObj } = this.data
// delete searchObj.inviteStatus
this.setData({
activeIndex:options.activeIndex,
// searchObj.inviteStatusList
})
}
if (wx.$refresh ) {
this.search()
// this.getStatByPeriod()
// this.getiIviteRecord()
}
console.log(options,'options');
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -449,11 +469,11 @@ Page({ ...@@ -449,11 +469,11 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if (wx.$refresh) { // if (wx.$refresh) {
this.search() // this.search()
this.getStatByPeriod() // // this.getStatByPeriod()
this.getiIviteRecord() // // this.getiIviteRecord()
} // }
}, },
/** /**
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
</view> </view>
</view> </view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" /> <tab-bar tabList="{{tabList}}" bindclick="tabClick" activeIndex="{{activeIndex}}"/>
</view> </view>
<view class="list-bar"> <view class="list-bar">
<view>今日预约 · <span class="txt-blue">{{inviteObj.dayInvited || 0}}</span></view> <view>今日预约 · <span class="txt-blue">{{inviteObj.dayInvited || 0}}</span></view>
......
...@@ -169,6 +169,15 @@ Page({ ...@@ -169,6 +169,15 @@ Page({
}) })
this.tapPicker() this.tapPicker()
}, },
navTabPage (e){
let { item } = e.currentTarget.dataset
if ('activeIndex' in item) {
wx.$refresh = true
wx.$router.go(item.url,{activeIndex:item.activeIndex})
} else {
wx.$router.go(item.url)
}
},
jump(e) { jump(e) {
let { item, type } = e.currentTarget.dataset let { item, type } = e.currentTarget.dataset
let { userInfo } = this.data let { userInfo } = this.data
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</view> </view>
</view> </view>
<view class="customStatistic"> <view class="customStatistic">
<veiw class="customItem" wx:for="{{ totalList }}" wx:key="index"> <veiw class="customItem" wx:for="{{ totalList }}" data-item="{{item}}" bindtap="navTabPage" wx:key="index">
<veiw class="label">{{item.name}}</veiw> <veiw class="label">{{item.name}}</veiw>
<view class="number"> <view class="number">
<text class="unit" wx:if="{{ item.unit }}">{{item.unit}}</text> <text class="unit" wx:if="{{ item.unit }}">{{item.unit}}</text>
...@@ -185,6 +185,17 @@ ...@@ -185,6 +185,17 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{ isNoStaff }}">
<view class="conTitle utils">展业工具</view>
<div class="menu noStaff">
<block wx:for="{{ menu }}" wx:key="index">
<view class="item" bindtap="jump" data-item="{{ item }}" data-type="{{ userInfo.userType }}">
<image src="../../images/tabIcon0{{ index+1 }}.png" />
<view class="label">{{item.name}}</view>
</view>
</block>
</div>
</block>
<!-- 员工不给看统计数据 --> <!-- 员工不给看统计数据 -->
<view class="content" wx:if="{{ userInfo.loginRole&&userInfo.loginRole!=4 }}"> <view class="content" wx:if="{{ userInfo.loginRole&&userInfo.loginRole!=4 }}">
<view class="box table"> <view class="box table">
...@@ -326,17 +337,7 @@ ...@@ -326,17 +337,7 @@
<view class="table-tips">到底了~</view> <view class="table-tips">到底了~</view>
</block> --> </block> -->
</view> </view>
<block wx:if="{{ isNoStaff }}">
<view class="conTitle utils">展业工具</view>
<div class="menu noStaff">
<block wx:for="{{ menu }}" wx:key="index">
<view class="item" bindtap="jump" data-item="{{ item }}" data-type="{{ userInfo.userType }}">
<image src="../../images/tabIcon0{{ index+1 }}.png" />
<view class="label">{{item.name}}</view>
</view>
</block>
</div>
</block>
</view> </view>
</block> </block>
<!-- </scroll-view> --> <!-- </scroll-view> -->
......
...@@ -67,33 +67,43 @@ export default { ...@@ -67,33 +67,43 @@ export default {
{ {
name: '服务客户', name: '服务客户',
itemName: 'totalCustomer', itemName: 'totalCustomer',
index: 1 index: 1,
url: 'tabOperating.index'
}, },
{ {
name: '已预约客户', name: '已预约客户',
itemName: 'totalInvited', itemName: 'totalInvited',
index: 2 index: 2,
url: 'tabDate.index',
activeIndex:1
}, },
{ {
name: '待预约客户', name: '待预约客户',
itemName: 'totalWaitToInvited', itemName: 'totalWaitToInvited',
index: 3 index: 3,
url: 'tabDate.index',
activeIndex:2
}, },
{ {
name: '转化订单', name: '转化订单',
itemName: 'totalUpgrade', itemName: 'totalUpgrade',
index: 4 index: 4,
url:'pages.index',
activeIndex:2
}, },
{ {
name: '战败订单', name: '战败订单',
itemName: 'totalNotUpgrade', itemName: 'totalNotUpgrade',
index: 5 index: 5,
url:'pages.index',
activeIndex:3
}, },
{ {
name: '客单价', name: '客单价',
itemName: 'customerUnitPrice', itemName: 'customerUnitPrice',
unit: '¥', unit: '¥',
index: 6 index: 6,
url: 'tabOperating.index'
} }
// { // {
......
...@@ -132,5 +132,10 @@ module.exports = { ...@@ -132,5 +132,10 @@ module.exports = {
getOrderByCustomerCouponId(data) { getOrderByCustomerCouponId(data) {
// return api.post('dj.api.smartcarlife.order.getOrderByCustomerCouponId ', data) // return api.post('dj.api.smartcarlife.order.getOrderByCustomerCouponId ', data)
return api.get('dj.api.smartcarlife.order.getOrderByCustomerCouponId', data) return api.get('dj.api.smartcarlife.order.getOrderByCustomerCouponId', data)
},
/** 获取园区店配置技师数据 */
getQYTechnicianList(data) {
return api.post('dj.api.smartcarlife.technician.list', data)
} }
} }
...@@ -56,7 +56,7 @@ Page({ ...@@ -56,7 +56,7 @@ Page({
if (!orderInfo?.customer?.orderCode) { if (!orderInfo?.customer?.orderCode) {
delete orderInfo?.customer?.orderCode delete orderInfo?.customer?.orderCode
} }
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianId', 'technicianName'] let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianUuid', 'technicianId', 'technicianName']
let userInfo = {} let userInfo = {}
orderInfo = Object.assign(orderInfo, orderInfo.customer) orderInfo = Object.assign(orderInfo, orderInfo.customer)
paramsList.map(item => { paramsList.map(item => {
...@@ -295,10 +295,16 @@ Page({ ...@@ -295,10 +295,16 @@ Page({
customerObj customerObj
}) })
} }
// 有配置技师 // // 有配置技师
if (data?.technicianConfigDTOList?.length > 0) { // if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) // this.isArtificer(data)
} // }
// 获取园区店技师配置信息
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -329,7 +335,8 @@ Page({ ...@@ -329,7 +335,8 @@ Page({
} }
this.setData({ this.setData({
customerObj, customerObj,
artificerList: orderInfo?.technicianConfigDTOList, artificerList: data, // 园区店配置的技师数据
// artificerList: orderInfo?.technicianConfigDTOList,
orderInfo orderInfo
}) })
}, },
......
...@@ -200,7 +200,7 @@ Page({ ...@@ -200,7 +200,7 @@ Page({
} }
// 处理订单是否显示 操作按钮 支付方式为pos和微信 并且订单状态是 4和6 // 处理订单是否显示 操作按钮 支付方式为pos和微信 并且订单状态是 4和6
// data.failureFlag != 'Y' // data.failureFlag != 'Y'
data.canOperate = [1, 3].includes(data.selectPayType) && [4, 6].includes(data.status) data.canOperate = [1, 3, 4].includes(data.selectPayType) && [4, 6].includes(data.status)
const orderInfo = data const orderInfo = data
console.log(orderInfo); console.log(orderInfo);
const clientSignatureDTOList = orderInfo.clientSignatureDTOList?.[0] || [] const clientSignatureDTOList = orderInfo.clientSignatureDTOList?.[0] || []
...@@ -238,6 +238,12 @@ Page({ ...@@ -238,6 +238,12 @@ Page({
if (data?.technicianConfigDTOList?.length > 0) { if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) this.isArtificer(data)
} }
// 获取园区店技师配置数据 wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -258,6 +264,7 @@ Page({ ...@@ -258,6 +264,7 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
orderInfo.technicianList = data || [] // 技师数据
if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) { if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
......
...@@ -249,6 +249,7 @@ Page({ ...@@ -249,6 +249,7 @@ Page({
this.checkPhoneUseConfig() this.checkPhoneUseConfig()
let { save } = i.currentTarget.dataset let { save } = i.currentTarget.dataset
let { goodsList, orderObj, scene, isErrorOrder, isAlreadyExistOrder } = this.data let { goodsList, orderObj, scene, isErrorOrder, isAlreadyExistOrder } = this.data
orderObj = wx.$util.deepClone(orderObj)
console.log(orderObj) console.log(orderObj)
// 如果是错单补录 禁用掉保存功能 或待跟进订单/预约订单 禁用建档 // 如果是错单补录 禁用掉保存功能 或待跟进订单/预约订单 禁用建档
if ((isErrorOrder && save) || (isAlreadyExistOrder && save)) return if ((isErrorOrder && save) || (isAlreadyExistOrder && save)) return
...@@ -264,18 +265,6 @@ Page({ ...@@ -264,18 +265,6 @@ Page({
return return
} }
if (!phoneRex.test(orderObj.customer.customerPhone)) {
this.showToast('请输入正确的手机号')
return
}
if (orderObj.customer.standNo) {
const vinRex = /[^\w]/g
if (vinRex.test(orderObj.customer.standNo)) {
this.showToast('请输入正确的VIN码')
return
}
}
let subOrderList = [] let subOrderList = []
let priceDisabled = true let priceDisabled = true
let goodsKey = this.checkGoods(save, subOrderList, priceDisabled, goodsList, orderObj) let goodsKey = this.checkGoods(save, subOrderList, priceDisabled, goodsList, orderObj)
...@@ -292,13 +281,22 @@ Page({ ...@@ -292,13 +281,22 @@ Page({
// return console.log(orderObj) // return console.log(orderObj)
// 是订单修正就把错误单号带上 // 是订单修正就把错误单号带上
if (isErrorOrder) orderObj.oldOrderCode = orderObj.associateOrderCode if (isErrorOrder) orderObj.oldOrderCode = orderObj.associateOrderCode
let submitObj = JSON.parse(JSON.stringify(orderObj)) let submitObj = wx.$util.deepClone(orderObj)
if (save) { if (save) {
// 建档删除卡券商品支付方式参数 // 建档删除卡券商品支付方式参数
delete submitObj.subOrderList delete submitObj.subOrderList
delete submitObj.customerCouponCode delete submitObj.customerCouponCode
delete submitObj.selectPayType delete submitObj.selectPayType
} }
if (submitObj.selectPayType == 0) {
const deleteArr = ['plateNumber', 'standNo', 'carBrand']
delete submitObj.remark
submitObj.customer.experienceFlag = 'Y'
deleteArr.forEach(element => {
delete submitObj.customer[element]
})
}
// for (let k = 0; k < goodsList; k++) { // for (let k = 0; k < goodsList; k++) {
// let item = goodsList[k] // let item = goodsList[k]
// try { // try {
...@@ -382,12 +380,32 @@ Page({ ...@@ -382,12 +380,32 @@ Page({
checkRequired(save, obj) { checkRequired(save, obj) {
// 导入动态校验字段 // 导入动态校验字段
let { requiredList } = this.data let { requiredList } = this.data
// console.log(requiredList) ...requiredList, // let target = save ? ['userId', 'merchantId', 'employeeName', ...requiredList, 'customerName', 'customerPhone', 'sellerUserId', 'sellerName', 'sellerMerchantId']
let target = save ? ['userId', 'merchantId', 'employeeName', ...requiredList, 'customerName', 'customerPhone', 'sellerUserId', 'sellerName', 'sellerMerchantId'] : ['userId', 'merchantId', 'employeeName', ...requiredList, 'customerName', 'customerPhone', 'sellerUserId', 'sellerName', 'sellerMerchantId', 'customerCouponCode'] // : ['userId', 'merchantId', 'employeeName', ...requiredList, 'customerName', 'customerPhone', 'sellerUserId', 'sellerName', 'sellerMerchantId', 'customerCouponCode']
let target = ['userId', 'merchantId', 'employeeName', ...requiredList, 'customerName', 'customerPhone', 'sellerUserId', 'sellerName', 'sellerMerchantId']
if (save) {
target.push('customerCouponCode')
}
// 是战败就去除一些无用字段
if (obj.selectPayType == 0) {
target = target.filter(item => !['carBrand', 'standNo', 'plateNumber'].includes(item))
}
obj = { obj = {
...obj, ...obj,
...obj.customer ...obj.customer
} }
if (!phoneRex.test(obj.customer.customerPhone)) {
this.showToast('请输入正确的手机号')
return false
}
if (obj.customer.standNo && obj.selectPayType != 0) {
const vinRex = /[^\w]/g
if (vinRex.test(obj.customer.standNo)) {
this.showToast('请输入正确的VIN码')
return false
}
}
try { try {
target.map(key => { target.map(key => {
if (!obj[key]) { if (!obj[key]) {
......
...@@ -358,7 +358,8 @@ Page({ ...@@ -358,7 +358,8 @@ Page({
}) })
e.total_price = e.totalPrice e.total_price = e.totalPrice
e.totalPrice = Number(wx.$util.decimal(e.totalPrice, 2)).toFixed(2) e.totalPrice = Number(wx.$util.decimal(e.totalPrice, 2)).toFixed(2)
let orderType = userInfo.userType == 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1 // e.selectPayType != 3 && e.selectPayType != 1
let orderType = userInfo.userType == 1 && e.status != 9 && e.status != 1 && ![1,3,4].includes(e.selectPayType)
e.repeal = userType && orderType e.repeal = userType && orderType
// 处理subOrderList 商品为空的情况 // 处理subOrderList 商品为空的情况
e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId) e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId)
......
...@@ -199,10 +199,16 @@ Page({ ...@@ -199,10 +199,16 @@ Page({
customerObj customerObj
}) })
} }
// 门店是否配置技师 // // 门店是否配置技师
if (data?.technicianConfigDTOList?.length > 0) { // if (data?.technicianConfigDTOList?.length > 0) {
this.isArtificer(data) // this.isArtificer(data)
} // }
// 获取园区店技师配置数据 wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
api.getQYTechnicianList({yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId}).then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
})
} else { } else {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
...@@ -223,6 +229,7 @@ Page({ ...@@ -223,6 +229,7 @@ Page({
isArtificer(data) { isArtificer(data) {
let { customerObj, orderInfo } = this.data let { customerObj, orderInfo } = this.data
orderInfo.isOpenArtificer = true orderInfo.isOpenArtificer = true
orderInfo.technicianList = data || [] // 技师数据
if (customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) { if (customerObj.findIndex(val =>val?.key && val.key == 'technicianName') < 0) {
customerObj[customerObj.length] = { customerObj[customerObj.length] = {
label: '选择技师:', label: '选择技师:',
......
...@@ -167,7 +167,7 @@ Page({ ...@@ -167,7 +167,7 @@ Page({
delete orderObj.customer.createdDate delete orderObj.customer.createdDate
this.showLoading('提交中...') this.showLoading('提交中...')
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianId', 'technicianName'] let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianUuid', 'technicianId', 'technicianName']
let userInfo = {} let userInfo = {}
orderObj = Object.assign(orderObj, orderObj.customer) orderObj = Object.assign(orderObj, orderObj.customer)
paramsList.map(item => { paramsList.map(item => {
...@@ -239,7 +239,8 @@ Page({ ...@@ -239,7 +239,8 @@ Page({
orderObj, orderObj,
first: true, first: true,
flag: true, flag: true,
artificerList: orderObj?.technicianConfigDTOList // artificerList: orderObj?.technicianConfigDTOList
artificerList: orderObj?.technicianList
}) })
}, },
getSetting() { getSetting() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!