Commit 74cb15ec by 张立顺

v4.10.0功能开发

1 parent a1d8fcae
......@@ -283,7 +283,7 @@ Component({
// 保存销售勾选做回显
util.setSellerInfo(this.data.orderObj)
thisPage.getOrderBaseGoodsList(orderObj.merchantId)
thisPage.getOrderBaseGoodsList && thisPage.getOrderBaseGoodsList(orderObj.merchantId)
delete orderObj.couponName
delete orderObj.merchantCouponId
delete orderObj.customerCouponId
......
......@@ -64,7 +64,7 @@
{
"name": "订单完成施工",
"pathName": "tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail",
"query": "orderCode=2207051649233012",
"query": "orderCode=2207052048142703",
"scene": null,
"launchMode": "default"
},
......
......@@ -88,5 +88,10 @@ module.exports = {
/** 订单修正 */
correctionOrder(data) {
return api.post('dj.api.smartcarlife.order.correctionOrder', data)
},
/** 订单修正 */
notUpgradeOrder(data) {
return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data)
}
}
......@@ -15,12 +15,42 @@ Page({
customerService: '',
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
// defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png',
failCustomerService: '../images/kfrefresh.png'
failCustomerService: '../images/kfrefresh.png',
showTip: false
},
// 跳转正确订单
redirectOrder() {
let { orderInfo } = this.data
wx.$router.redirectTo('constructionOrderDetail', { orderCode: orderInfo.associatedOrderCode })
let _this = this
wx.$util.showLoading('加载中...')
api
.getOrderDetail({
orderCode: orderInfo.associatedOrderCode
})
.then(result => {
// 根据不同状态和施工标志做对应跳转
let { code, data: item } = result
if (code == 0) {
item.oldOrderCode = orderInfo.associatedOrderCode
let name = item.status == 3 ? 'confirmOrder' : item.status == 1 ? 'createOrder' : 'orderDetail'
if (item.constructionFlag == 'Y' && item.status != 10) {
wx.$router.go('constructionOrderDetail', item)
} else {
// console.log(item)
wx.$router.go(name, item)
}
}
})
.catch(err => {
console.log(err)
})
// wx.$router.redirectTo('constructionOrderDetail', { orderCode: orderInfo.associatedOrderCode })
},
targetOperate() {
let { showTip } = this.data
this.setData({
showTip: !showTip
})
},
// 确定是否要显示
targetError() {
......@@ -32,7 +62,7 @@ Page({
// 跳转新增订单页面 并带特定参数
let { orderInfo } = this.data
// orderInfo.orderSource = type
orderInfo.associatedOrderCode = orderInfo.orderCode
orderInfo.oldOrderCode = orderInfo.orderCode
delete orderInfo.orderCode
orderInfo.selectPayType = 2
wx.$router.redirectTo('createOrder', orderInfo)
......
......@@ -58,7 +58,14 @@
<view class="box">
<view class="title infoTitle">
<text>工单信息</text>
<text bindtap="targetError" class="operate" wx:if="{{orderInfo.canOperate}}">操作</text>
<view class="operate" wx:if="{{orderInfo.canOperate&&(isYqdSuper||isStaff)}}">
<text bindtap="targetOperate">操作</text>
<view class="tip {{showTip?'':'none'}}" bindtap="targetError">
<view class="tip-trangle-top" />
<image src="../../images/drawingIcon.png" class="drawIcon" />
工单有误?
</view>
</view>
</view>
<block wx:for="{{orderObj}}" wx:key="index">
<view class="cell">
......
......@@ -75,10 +75,59 @@ page {
}
.box .operate {
position: relative;
font-size: 28rpx;
color: #3582EE;
}
.operate .tip.none {
display: none;
}
/*提示框容器*/
.tip {
display: none;
box-sizing: border-box;
/* position: relative; */
position: absolute;
/* margin-left: 20px;
margin-top: 20px; */
left: -100rpx;
top: 50rpx;
display: flex;
align-items: center;
width: 196rpx;
font-size: 28rpx;
/* background: #fff; */
background: rgba(0, 0, 0, 0.8000);
color: #fff;
padding: 20rpx 15rpx;
/* padding-right: 10rpx; */
/*设置圆角*/
-webkit-border-radius: 10rpx;
-moz-border-radius: 10rpx;
border-radius: 10rpx;
}
.drawIcon {
width: 32rpx;
height: 32rpx;
/* margin-right: 5rpx; */
}
/*提示框-上三角*/
.tip-trangle-top {
position: absolute;
top: -10px;
left: 55px;
width: 0;
height: 0;
border-left: 20rpx solid transparent;
border-right: 20rpx solid transparent;
border-bottom: 20rpx solid rgba(0, 0, 0, 0.8000);
}
.box .infoTitle {
display: flex;
justify-content: space-between;
......
......@@ -33,14 +33,14 @@ Page({
standNo: '',
customerSex: 1,
confirmIndex: false
},
{
customerName: '',
customerPhone: '',
standNo: '',
customerSex: 1,
confirmIndex: false
}
// {
// customerName: '',
// customerPhone: '',
// standNo: '',
// customerSex: 1,
// confirmIndex: false
// }
],
dateObj: {
beforeDay: '',
......@@ -290,10 +290,10 @@ Page({
// const element = array[index];
// let
if (!notUpgradeOrderList[index].customerName) {
return this.showToast(`请输入第${index}位客户姓名`)
return this.showToast(`请输入第${index + 1}位客户姓名`)
}
if (!phoneRex.test(item.customerPhone)) {
this.showToast(`请输入第${index}位客户正确的手机号`)
if (!phoneRex.test(notUpgradeOrderList[index].customerPhone)) {
this.showToast(`请输入第${index + 1}位客户正确的手机号`)
return
}
}
......@@ -304,7 +304,9 @@ Page({
}
this.showLoading('提交中...')
api.supplementOrder(orderObj).then(res => {
console.log('orderObj', orderObj)
// return
api.notUpgradeOrder(orderObj).then(res => {
wx.hideLoading()
// console.log(orderObj, res)
let { code, data, message } = res
......@@ -314,6 +316,7 @@ Page({
title: '提交成功'
})
wx.$router.back()
// if (save) {
// wx.showModal({
// title: '温馨提示',
......
......@@ -252,6 +252,9 @@ Page({
this.setGoodsTotal(goodsList)
},
setCorrectionOrder(orderObj) {
// console.log('orderObj', orderObj)
// return
// delete orderObj.associatedOrderCode
api.correctionOrder(orderObj).then(res => {
wx.hideLoading()
// console.log(orderObj, res)
......@@ -273,10 +276,11 @@ Page({
// }
// })
// } else {
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
wx.$refresh = true
// 跳转施工确认页
wx.$router.redirectTo('orderDetail', data)
// wx.$router.redirectTo('orderDetail', data)
wx.$router.redirectTo('confirmOrder', data)
// wx.$router.redirectTo('confirmOrder', data)
// 暂时保留跳转页面
// wx.$router.go('confirmOrder', data)
......@@ -383,15 +387,16 @@ Page({
this.showLoading('提交中...')
// 判断是不是 修改订单 是走另外接口逻辑
if (isErrorOrder) {
return this.setCorrectionOrder(orderObj)
}
api.createWithPay(orderObj).then(res => {
// if (isErrorOrder) {
// return this.setCorrectionOrder(orderObj)
// }
let apiName = isErrorOrder ? 'correctionOrder' : 'createWithPay'
api[apiName](orderObj).then(res => {
wx.hideLoading()
// console.log(orderObj, res)
let { code, data, message } = res
if (code == 0) {
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
if (save) {
wx.showModal({
title: '温馨提示',
......@@ -466,6 +471,7 @@ Page({
if (orderObj.selectPayType == null || orderObj.selectPayType == undefined) orderObj.selectPayType = 3
// debugger
// 是再次下单的 就删除优惠券字段 不是就赋值
// || orderObj.associatedOrderCode
if (orderObj.customerCoupon && orderObj.constructionFlag != 'Y') {
orderObj.couponName = orderObj.customerCoupon.couponName
orderObj.customerCouponCode = orderObj.customerCoupon.customerCouponCode.split('-')[0]
......@@ -489,7 +495,7 @@ Page({
if (!orderObj.customer.customerSex) orderObj.customer.customerSex = 1
if (!orderObj.customer.experienceFlag) orderObj.customer.experienceFlag = 'N'
if (orderObj.associatedOrderCode) {
if (orderObj.oldOrderCode) {
wx.setNavigationBarTitle({
title: '修正订单'
})
......
......@@ -280,6 +280,25 @@
</block>
</view>
</gl-cell>
<gl-cell
border
label="支付方式"
valueAlign="right"
wx:if="{{isErrorOrder}}"
labelWidth="152rpx">
<view class="payType-box">
<!-- <block wx:for="{{showPayList}}" wx:key="index"> data-item="{{item}}"
data-index="{{index}}" -->
<!-- bindtap="changePayType" -->
<view class="item text-center active disabled">
门店收款
<view class="active-icon">
<image src="../../images/active.png" />
</view>
</view>
<!-- </block> -->
</view>
</gl-cell>
</view>
</view>
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
......
......@@ -279,7 +279,7 @@ page {
background-color: #3582EE;
}
.save.disabled {
.btns .save.disabled {
border: 1px solid #DCDEE0;
color: #c0c0cc;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!