Commit 31fa7c56 by 杨北旺

Merge branch 'V4.38.1-0422' of 192.168.3.233:saas_plus/dj-car-boutique-work-wechat into V4.38.1-0422

2 parents b501fbbc 01f4bc73
...@@ -205,6 +205,8 @@ Page({ ...@@ -205,6 +205,8 @@ Page({
let { code, data } = res let { code, data } = res
if (code == 0) { if (code == 0) {
if (!data) { if (!data) {
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOREPORT_MODAL = true
wx.showModal({ wx.showModal({
title: '交车目标', title: '交车目标',
content: '您有未填写的交车目标,请点击前往', content: '您有未填写的交车目标,请点击前往',
...@@ -219,6 +221,11 @@ Page({ ...@@ -219,6 +221,11 @@ Page({
} }
}, },
complete: () => { complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOREPORT_MODAL = false
}, 2000)
} }
}) })
} }
...@@ -354,6 +361,7 @@ Page({ ...@@ -354,6 +361,7 @@ Page({
changeTabBar(e) { changeTabBar(e) {
// let { pageShow } = this.data, // let { pageShow } = this.data,
wx.__HAS_NOREPORT_MODAL = false
let tabIndex = e.detail let tabIndex = e.detail
// console.log(pageShow[tabIndex]) // console.log(pageShow[tabIndex])
this.setData({ this.setData({
......
...@@ -95,7 +95,7 @@ Page({ ...@@ -95,7 +95,7 @@ Page({
return false return false
}, },
submit() { submit() {
let { targetInfo } = this.data let { targetInfo, approvedSource } = this.data
let emptyKey = this.checkRequired(targetInfo) let emptyKey = this.checkRequired(targetInfo)
if (emptyKey) { if (emptyKey) {
this.showToast(`${toastList[emptyKey]}不能为空`) this.showToast(`${toastList[emptyKey]}不能为空`)
...@@ -113,7 +113,6 @@ Page({ ...@@ -113,7 +113,6 @@ Page({
return return
} }
targetInfo.targetDate = targetInfo.reportDate targetInfo.targetDate = targetInfo.reportDate
delete targetInfo.reportDate
if (this.data.isSubmit) return if (this.data.isSubmit) return
this.setData({ this.setData({
isSubmit: true isSubmit: true
...@@ -131,15 +130,20 @@ Page({ ...@@ -131,15 +130,20 @@ Page({
confirmText: '我知道了', confirmText: '我知道了',
confirmColor: '#347BFF', confirmColor: '#347BFF',
success(res) { success(res) {
wx.$router.back() if (approvedSource != 3) {
wx.$router.back()
}
} }
}) })
setTimeout(() => { if (approvedSource != 3) {
wx.$router.back() setTimeout(() => {
}, 2000) wx.$router.back()
}, 2000)
}
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
this.getDeliveryTargetWeekList()
}) })
}, },
/** /**
...@@ -203,7 +207,6 @@ Page({ ...@@ -203,7 +207,6 @@ Page({
['targetInfo.reportDate']: date, ['targetInfo.reportDate']: date,
isEditReport: false isEditReport: false
}) })
console.log(this.data.targetInfo)
}, },
editReport() { editReport() {
this.setData({ this.setData({
...@@ -219,25 +222,35 @@ Page({ ...@@ -219,25 +222,35 @@ Page({
wx.$router.back() wx.$router.back()
}, },
initData() { initData() {
let { targetInfo, approvedSource } = this.data let { targetInfo, approvedSource, reportDate, timeBean } = this.data
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
this.setData({ this.setData({
timeBean: util.getWeekDayList(this.data.selectWeek, '', customerDisabled), timeBean: util.getWeekDayList(this.data.selectWeek, '', customerDisabled),
userInfo userInfo
}) })
if (!approvedSource) { if (approvedSource != 3) {
this.setData({ this.setData({
targetInfo: { targetInfo: {
...targetInfo, ...targetInfo,
staffUuid: userInfo.uuid, staffUuid: userInfo?.uuid,
staffName: userInfo.name, staffName: userInfo?.name,
staffPhone: userInfo.phone, staffPhone: userInfo?.phone,
merchantId: userInfo.shopMerchantId, merchantId: userInfo?.shopMerchantId,
merchantName: userInfo.shopMerchantName merchantName: userInfo?.shopMerchantName
} }
}) })
} }
this.setTargetDate() if (reportDate) {
let index = timeBean?.weekDayList?.findIndex(val => val.date == reportDate)
if (index > -1) {
this.setData({
['timeBean.selectDay']: index,
['targetInfo.reportDate']: reportDate
})
}
} else {
this.setTargetDate()
}
this.getTargetInfo() this.getTargetInfo()
this.getDeliveryTargetWeekList() this.getDeliveryTargetWeekList()
}, },
...@@ -332,6 +345,7 @@ Page({ ...@@ -332,6 +345,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let {targetInfo} = this.data
if (options?.scene) { if (options?.scene) {
let id = decodeURIComponent(options.scene).split('=')[1] let id = decodeURIComponent(options.scene).split('=')[1]
return this.qrCodeScene(id) return this.qrCodeScene(id)
...@@ -364,6 +378,8 @@ Page({ ...@@ -364,6 +378,8 @@ Page({
}) })
}, },
onRoute(options) { onRoute(options) {
wx.__HAS_NOREPORT_MODAL = false
let {targetInfo} = this.data
if (options?.scene) { if (options?.scene) {
let id = decodeURIComponent(options.scene).split('=')[1] let id = decodeURIComponent(options.scene).split('=')[1]
if (id) return if (id) return
...@@ -382,7 +398,7 @@ Page({ ...@@ -382,7 +398,7 @@ Page({
} }
if (options.hasOwnProperty('approvedSource')) { if (options.hasOwnProperty('approvedSource')) {
this.setData({ this.setData({
approvedSource: `${options.approvedSource}`, approvedSource: options.approvedSource,
merchantRange: [{ merchantName: options.merchantName, merchantId: options.merhchantid }], merchantRange: [{ merchantName: options.merchantName, merchantId: options.merhchantid }],
targetInfo: { targetInfo: {
...targetInfo, ...targetInfo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!