Commit 232a66d9 by 张立顺

fix bug修复

1 parent 92efb70a
...@@ -81,6 +81,7 @@ Component({ ...@@ -81,6 +81,7 @@ Component({
this.getMinuteList(days, hours) this.getMinuteList(days, hours)
}, },
getMinuteList(days, hours) { getMinuteList(days, hours) {
console.log(days, hours, 'days, hours');
const minutes = []; const minutes = [];
const today = new Date() const today = new Date()
for (let minute = 0; minute < today.getMinutes() + 1; minute++) { for (let minute = 0; minute < today.getMinutes() + 1; minute++) {
...@@ -121,14 +122,23 @@ Component({ ...@@ -121,14 +122,23 @@ Component({
this.currentDate = days[index] this.currentDate = days[index]
// 选择过去时间需要重新初始化时分 // 选择过去时间需要重新初始化时分
const today = new Date().format('yyyy/MM/dd') const today = new Date().format('yyyy/MM/dd')
const timeType = this.currentDate != today?1:0 const timeType = this.currentDate != today ? 1 : 0
this.getAllTimeOrPartTime(timeType) this.getAllTimeOrPartTime(timeType)
}, },
changeHour(e) { changeHour(e) {
const { hours } = this.data const { hours, days, dateValues } = this.data
const { value } = e.detail const { value } = e.detail
const index = value[0] const index = value[0]
this.currentHour = hours[index] this.currentHour = hours[index]
// 处理当前天切换别的小时,别的分不能选后面分到60的问题
const dayIndex = dateValues[0]
this.currentDate = days[dayIndex]
const today = new Date().format('yyyy/MM/dd')
const timeType = this.currentDate != today ? 1 : 0
console.log(timeType, 'timeType');
this.getAllTimeOrPartTimeMinute(timeType)
// this.getMinuteList()
}, },
changeMinutes(e) { changeMinutes(e) {
const { minutes } = this.data const { minutes } = this.data
...@@ -164,6 +174,20 @@ Component({ ...@@ -164,6 +174,20 @@ Component({
hours, hours,
minutes, minutes,
}) })
},
getAllTimeOrPartTimeMinute(type) {
const today = new Date()
const hours = [], minutes = [], hour_len = type == 1 ? 24 : today.getHours() + 1, minute_len = type == 1 ? 60 : today.getMinutes() + 1;
// for (let hour = 0; hour < hour_len; hour++) {
// hours.push(hour.toString().padStart(2, '0'));
// }
for (let minute = 0; minute < minute_len; minute++) {
minutes.push(minute.toString().padStart(2, '0'));
}
this.setData({
// hours,
minutes,
})
} }
}, },
//组件的生命周期 //组件的生命周期
......
...@@ -17,19 +17,19 @@ Page({ ...@@ -17,19 +17,19 @@ Page({
orderInfo: {}, orderInfo: {},
showTips: true, showTips: true,
artificerSelectObj: {}, artificerSelectObj: {},
successDate:'', successDate: '',
showDateSelect:false, showDateSelect: false,
isErrorOrder:false isErrorOrder: false
}, },
getSelectDate(e){ getSelectDate(e) {
this.setData({ this.setData({
successDate:e.detail, successDate: e.detail,
showDateSelect:false showDateSelect: false
}) })
}, },
toshowDateModal(){ toshowDateModal() {
this.setData({ this.setData({
showDateSelect:true showDateSelect: true
}) })
}, },
closeTips() { closeTips() {
...@@ -126,7 +126,7 @@ Page({ ...@@ -126,7 +126,7 @@ Page({
_this.createPayOrder() _this.createPayOrder()
} }
} else { } else {
if(!successDate&&!isErrorOrder)return wx.$util.showToast('请选择门店付款时间') if (!successDate && !isErrorOrder) return wx.$util.showToast('请选择门店付款时间')
this.setData({ this.setData({
showPopup: true showPopup: true
}) })
...@@ -147,7 +147,7 @@ Page({ ...@@ -147,7 +147,7 @@ Page({
orderCode, orderCode,
payType: selectPayType payType: selectPayType
} }
if(selectPayType==2&&!isErrorOrder){ if (selectPayType == 2 && !isErrorOrder) {
obj.successDate = new Date(successDate).format('yyyy-MM-dd hh:mm:ss') obj.successDate = new Date(successDate).format('yyyy-MM-dd hh:mm:ss')
} }
if (payVoucherList?.length && outTradeNo) { if (payVoucherList?.length && outTradeNo) {
...@@ -203,7 +203,7 @@ Page({ ...@@ -203,7 +203,7 @@ Page({
}) })
.then(res => { .then(res => {
console.log(res) console.log(res)
// 状态更新 需刷新工单列表和预约管理列表 // 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData() wx.$util.refreshPageData()
let { let {
code, code,
...@@ -252,17 +252,19 @@ Page({ ...@@ -252,17 +252,19 @@ Page({
onRoute(options) { onRoute(options) {
if (options.orderCode) { if (options.orderCode) {
wx.$util.showLoading('加载中...') wx.$util.showLoading('加载中...')
this.getDetail(options.orderCode) if (options.isErrorOrder) {
if(options.isErrorOrder){
this.setData({ this.setData({
isErrorOrder:true isErrorOrder: true
}) })
} }
this.getDetail(options.orderCode)
} }
}, },
async getDetail(orderCode) { async getDetail(orderCode) {
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
let { isErrorOrder } = this.data
const positionTypeList = await getPositionList() || [] const positionTypeList = await getPositionList() || []
api api
.getOrderDetail({ .getOrderDetail({
...@@ -336,6 +338,10 @@ Page({ ...@@ -336,6 +338,10 @@ Page({
// if (data?.technicianConfigDTOList?.length > 0) { // if (data?.technicianConfigDTOList?.length > 0) {
// this.isArtificer(data) // this.isArtificer(data)
// } // }
// 是门店收款并且不是错误订单 自动打开门店收款弹窗
if (!isErrorOrder && data.selectPayType == 2) {
this.toshowDateModal()
}
// 获取园区店技师配置信息 // 获取园区店技师配置信息
api.getQYTechnicianList({ api.getQYTechnicianList({
yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId yqMerchantId: wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
...@@ -456,17 +462,17 @@ Page({ ...@@ -456,17 +462,17 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () {}, onReady: function () { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () {}, onShow: function () { },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () {}, onHide: function () { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
...@@ -479,17 +485,17 @@ Page({ ...@@ -479,17 +485,17 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {}, onPullDownRefresh: function () { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}, onReachBottom: function () { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () { },
// 返回 // 返回
goBack: function () { goBack: function () {
......
...@@ -51,7 +51,9 @@ Page({ ...@@ -51,7 +51,9 @@ Page({
wx.$router.go('constructionOrderDetail', item) wx.$router.go('constructionOrderDetail', item)
} else { } else {
// console.log(item) // console.log(item)
wx.$router.go(name, item) // 解决错单能切换支付方式的问题
// wx.$router.go(name, { ...item, associateOrderType: true })
wx.$router.go(name, { ...item })
} }
} }
}) })
......
...@@ -58,7 +58,7 @@ Page({ ...@@ -58,7 +58,7 @@ Page({
plateNumber: '', plateNumber: '',
customerSex: 1, customerSex: 1,
experienceFlag: 'Y', experienceFlag: 'Y',
salesType:0 salesType: 0
}, },
// selectPayType: 0, // selectPayType: 0,
selectPayType: 2, selectPayType: 2,
...@@ -73,7 +73,7 @@ Page({ ...@@ -73,7 +73,7 @@ Page({
isErrorOrder: false, isErrorOrder: false,
isAlreadyExistOrder: false, isAlreadyExistOrder: false,
showTips: false, showTips: false,
associateOrderType: false,
tipsProps: { tipsProps: {
tipsText: '本表单用于太阳膜类产品录单', tipsText: '本表单用于太阳膜类产品录单',
showTips: true, showTips: true,
...@@ -87,13 +87,13 @@ Page({ ...@@ -87,13 +87,13 @@ Page({
sideRearGearArr: [], // 侧后挡 sideRearGearArr: [], // 侧后挡
skylightArr: [], // 天窗 skylightArr: [], // 天窗
baseConfigData: {}, baseConfigData: {},
showSource:false, showSource: false,
Sourcecolumns:[{ Sourcecolumns: [{
type:0, type: 0,
name:'售前' name: '售前'
},{ }, {
type:1, type: 1,
name:'售后' name: '售后'
}], }],
}, },
...@@ -420,7 +420,7 @@ Page({ ...@@ -420,7 +420,7 @@ Page({
submitStatus, submitStatus,
} = this.data } = this.data
orderObj = wx.$util.deepClone(orderObj) orderObj = wx.$util.deepClone(orderObj)
// 如果是错单补录 禁用掉保存功能 或待跟进订单/预约订单 禁用建档 // 如果是错单补录 禁用掉保存功能 或待跟进订单/预约订单 禁用建档
if ((isErrorOrder && save) || (isAlreadyExistOrder && save)) return if ((isErrorOrder && save) || (isAlreadyExistOrder && save)) return
...@@ -534,7 +534,7 @@ Page({ ...@@ -534,7 +534,7 @@ Page({
} else { } else {
// 状态更新 需刷新工单列表和预约管理列表 // 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData() wx.$util.refreshPageData()
if(this.data.isErrorOrder)data.isErrorOrder = true if (this.data.isErrorOrder) data.isErrorOrder = true
wx.$router.redirectTo('confirmOrder', data) wx.$router.redirectTo('confirmOrder', data)
} }
} else { } else {
...@@ -613,7 +613,7 @@ Page({ ...@@ -613,7 +613,7 @@ Page({
return true return true
} }
} }
try { try {
target.map(key => { target.map(key => {
if (!obj[key]) { if (!obj[key]) {
...@@ -648,6 +648,7 @@ Page({ ...@@ -648,6 +648,7 @@ Page({
userInfo, userInfo,
isErrorOrder, isErrorOrder,
showTips, showTips,
associateOrderType,
isAlreadyExistOrder, isAlreadyExistOrder,
subShopMerchantList subShopMerchantList
} = this.data } = this.data
...@@ -702,13 +703,19 @@ Page({ ...@@ -702,13 +703,19 @@ Page({
if (!orderObj.customer.customerSex) orderObj.customer.customerSex = 1 if (!orderObj.customer.customerSex) orderObj.customer.customerSex = 1
if (!orderObj.customer.experienceFlag) orderObj.customer.experienceFlag = 'N' if (!orderObj.customer.experienceFlag) orderObj.customer.experienceFlag = 'N'
if (orderObj.associateOrderCode) { if (orderObj.associateOrderCode || orderObj.associateOrderType) {
// if (orderObj.oldOrderCode) { // if (orderObj.oldOrderCode) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '修正订单' title: '修正订单'
}) })
isErrorOrder = true if (orderObj.associateOrderCode) {
isErrorOrder = true
} else {
associateOrderType = true
}
showTips = true showTips = true
// 默认添加离开弹框 提交成功后取消 // 默认添加离开弹框 提交成功后取消
wx.enableAlertBeforeUnload && wx.enableAlertBeforeUnload &&
wx.enableAlertBeforeUnload({ wx.enableAlertBeforeUnload({
...@@ -726,7 +733,7 @@ Page({ ...@@ -726,7 +733,7 @@ Page({
if (options.yqMerchantId && options.isAppointment) { if (options.yqMerchantId && options.isAppointment) {
orderObj.sellerMerchantId = options.yqMerchantId orderObj.sellerMerchantId = options.yqMerchantId
} }
if(!orderObj.customer.salesType) orderObj.customer.salesType = 0 if (!orderObj.customer.salesType) orderObj.customer.salesType = 0
console.log(orderObj, 'orderObj'); console.log(orderObj, 'orderObj');
this.setData({ this.setData({
currentWordNumber: orderObj?.remark?.length || 0, currentWordNumber: orderObj?.remark?.length || 0,
...@@ -734,6 +741,7 @@ Page({ ...@@ -734,6 +741,7 @@ Page({
first: true, first: true,
flag: true, flag: true,
isErrorOrder, isErrorOrder,
associateOrderType,
showTips showTips
}) })
this.getOrderBaseGoodsList(orderObj.merchantId) this.getOrderBaseGoodsList(orderObj.merchantId)
...@@ -1084,7 +1092,7 @@ Page({ ...@@ -1084,7 +1092,7 @@ Page({
isAlreadyExistOrder isAlreadyExistOrder
} = this.data } = this.data
if (Object.keys(res).length > 0) { if (Object.keys(res).length > 0) {
if (res.associateOrderCode) { if (res.associateOrderCode || res.associateOrderType) {
tipsProps.showTips = true tipsProps.showTips = true
tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。' tipsProps.tipsText = '原订单录入信息有误,请重新提交正确的订单信息。'
} else if (res.orderCode || res.againOrder) { } else if (res.orderCode || res.againOrder) {
...@@ -1127,22 +1135,22 @@ Page({ ...@@ -1127,22 +1135,22 @@ Page({
} }
this.getSetting() this.getSetting()
}, },
toSelectCustomerSource(){ toSelectCustomerSource() {
this.setData({ this.setData({
showSource:true showSource: true
}) })
}, },
onChangeSource(e){ onChangeSource(e) {
console.log(e); console.log(e);
const {type} = e.detail.value const { type } = e.detail.value
this.setData({ this.setData({
showSource:false, showSource: false,
'orderObj.customer.salesType':type 'orderObj.customer.salesType': type
}) })
}, },
onCloseSource(){ onCloseSource() {
this.setData({ this.setData({
showSource:false showSource: false
}) })
}, },
......
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
</block> </block>
</view> </view>
</block> </block>
<gl-cell border label="支付方式" valueAlign="right" wx:if="{{ !isErrorOrder && orderObj.selectPayType != 0 }}" labelWidth="var(--fontSize152)"> <gl-cell border label="支付方式" valueAlign="right" wx:if="{{ !associateOrderType && !isErrorOrder && orderObj.selectPayType != 0 }}" labelWidth="var(--fontSize152)">
<view class="payType-box"> <view class="payType-box">
<block wx:for="{{ showPayList }}" wx:key="index"> <block wx:for="{{ showPayList }}" wx:key="index">
<view <view
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!