Commit 04614c68 by 张立顺

fix 施工单跳转bug修复

1 parent f9fe5e1d
...@@ -91,6 +91,7 @@ Page({ ...@@ -91,6 +91,7 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.fromMenu = false this.fromMenu = false
this._repairOrderScreeningOpen = false
this.syncUserContext() this.syncUserContext()
}, },
// tab切换 // tab切换
...@@ -299,6 +300,7 @@ Page({ ...@@ -299,6 +300,7 @@ Page({
}, },
// 筛选页面隐藏 // 筛选页面隐藏
back() { back() {
this._repairOrderScreeningOpen = false
this.setData({ this.setData({
show_confirm: false show_confirm: false
}) })
...@@ -306,6 +308,8 @@ Page({ ...@@ -306,6 +308,8 @@ Page({
}, },
// 显示筛选页面 // 显示筛选页面
showConfirm() { showConfirm() {
/** page-container 展示可能触发 onHide,避免误清首页会话导致 fromMenu 变 false、查询被限制在本店 */
this._repairOrderScreeningOpen = true
this.setData({ this.setData({
showRendering: true, showRendering: true,
show_confirm: true show_confirm: true
...@@ -336,9 +340,12 @@ Page({ ...@@ -336,9 +340,12 @@ Page({
*/ */
onShow() { onShow() {
const g = getApp().globalData const g = getApp().globalData
/** 仅首页菜单首次进入时预填当前技师;详情返回等仅带会话标,不重写 technicianUuidList */
let presetTechnicianFromHomeMenu = false
if (g.repairOrderOpenFromHomeMenu) { if (g.repairOrderOpenFromHomeMenu) {
this.fromMenu = true this.fromMenu = true
g.repairOrderListFromHomeSession = true g.repairOrderListFromHomeSession = true
presetTechnicianFromHomeMenu = true
delete g.repairOrderOpenFromHomeMenu delete g.repairOrderOpenFromHomeMenu
} else if (g.repairOrderListFromHomeSession) { } else if (g.repairOrderListFromHomeSession) {
this.fromMenu = true this.fromMenu = true
...@@ -349,7 +356,7 @@ Page({ ...@@ -349,7 +356,7 @@ Page({
const userInfo = this.data.userInfo const userInfo = this.data.userInfo
const uid = userInfo?.subLoginUser?.uuid || userInfo?.uuid const uid = userInfo?.subLoginUser?.uuid || userInfo?.uuid
if ( if (
this.fromMenu && presetTechnicianFromHomeMenu &&
uid && uid &&
wx.$hasPermission.isTechnician(userInfo) wx.$hasPermission.isTechnician(userInfo)
) { ) {
...@@ -358,6 +365,14 @@ Page({ ...@@ -358,6 +365,14 @@ Page({
technicianUuidList: [uid] technicianUuidList: [uid]
} }
this.setData({ searchObj }, () => this.search()) this.setData({ searchObj }, () => this.search())
} else if (!this.fromMenu) {
const searchObj = { ...this.data.searchObj }
if ('technicianUuidList' in searchObj) {
delete searchObj.technicianUuidList
this.setData({ searchObj }, () => this.search())
} else {
this.search()
}
} else { } else {
this.search() this.search()
} }
...@@ -372,6 +387,9 @@ Page({ ...@@ -372,6 +387,9 @@ Page({
this._openingRepairSubPage = false this._openingRepairSubPage = false
return return
} }
if (this._repairOrderScreeningOpen) {
return
}
delete getApp().globalData.repairOrderListFromHomeSession delete getApp().globalData.repairOrderListFromHomeSession
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!