Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
regional-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 79770378
authored
Aug 19, 2026
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
事项人员更换评估交互bug修复
1 parent
f90ef17f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
37 deletions
pages/mattersHandle/mattersHandle.js
pages/mattersHandle/mattersHandle.js
View file @
7977037
...
@@ -56,6 +56,8 @@ Page({
...
@@ -56,6 +56,8 @@ Page({
// select-popup 绑定的数组值
// select-popup 绑定的数组值
selectedRecruitDemandValues
:
[],
selectedRecruitDemandValues
:
[],
selectedStaffValues
:
[],
selectedStaffValues
:
[],
// 本次弹窗打开对应的目标选项(未确认时暂存,弹窗确认后覆盖replaceSelectedOption并清空)
pendingReplaceOption
:
""
,
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
@@ -98,6 +100,22 @@ Page({
...
@@ -98,6 +100,22 @@ Page({
const
selectedRecruitDemandText
=
this
.
buildRelatedRecruitDemandText
(
task
);
const
selectedRecruitDemandText
=
this
.
buildRelatedRecruitDemandText
(
task
);
const
selectedStaffText
=
task
.
relatedStaffName
||
task
.
staffName
||
""
;
const
selectedStaffText
=
task
.
relatedStaffName
||
task
.
staffName
||
""
;
// 初始回显replaceSelectedOption:优先从已有数据反推(有招聘文本=招聘类,有驻店=关联驻店),没有则再用task.replaceOption兜底
let
replaceSelectedOption
=
""
;
if
(
selectedStaffText
)
{
replaceSelectedOption
=
"LINK_REPLACEMENT_STAFF"
;
}
else
if
(
selectedRecruitDemandText
)
{
// 发起招聘 vs 关联已有招聘:有recruitId且task里能区分时用replaceOption,否则默认关联已有
const
savedReplaceOption
=
task
.
replaceOption
||
task
.
executionResultCode
||
""
;
if
(
savedReplaceOption
===
"CREATE_RECRUITMENT_DEMAND"
||
savedReplaceOption
===
"LINK_EXISTING_RECRUITMENT_DEMAND"
)
{
replaceSelectedOption
=
savedReplaceOption
;
}
else
{
replaceSelectedOption
=
"LINK_EXISTING_RECRUITMENT_DEMAND"
;
}
}
else
{
replaceSelectedOption
=
task
.
replaceOption
||
""
;
}
this
.
setData
({
this
.
setData
({
task
:
{
task
:
{
...
task
,
...
task
,
...
@@ -111,7 +129,7 @@ Page({
...
@@ -111,7 +129,7 @@ Page({
reply
:
task
.
replyText
||
""
,
reply
:
task
.
replyText
||
""
,
executionResultCode
:
executionResultCode
,
executionResultCode
:
executionResultCode
,
showReplaceOptions
,
showReplaceOptions
,
replaceSelectedOption
:
task
.
replaceOption
||
""
,
replaceSelectedOption
,
selectedRecruitDemand
:
task
.
recruitId
||
""
,
selectedRecruitDemand
:
task
.
recruitId
||
""
,
selectedRecruitDemandValues
:
task
.
recruitId
?
[
task
.
recruitId
]
:
[],
selectedRecruitDemandValues
:
task
.
recruitId
?
[
task
.
recruitId
]
:
[],
selectedRecruitDemandText
,
selectedRecruitDemandText
,
...
@@ -120,6 +138,7 @@ Page({
...
@@ -120,6 +138,7 @@ Page({
selectedStaffText
,
selectedStaffText
,
executionResultCodeOptions
,
executionResultCodeOptions
,
showTaskExecutionResult
,
showTaskExecutionResult
,
pendingReplaceOption
:
""
,
loading
:
false
,
loading
:
false
,
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -303,17 +322,23 @@ Page({
...
@@ -303,17 +322,23 @@ Page({
* 处理人员更换选项变更
* 处理人员更换选项变更
*/
*/
handleReplaceOptionChange
(
value
)
{
handleReplaceOptionChange
(
value
)
{
const
{
selectedRecruitDemandText
,
selectedStaffText
}
=
this
.
data
;
const
{
replaceSelectedOption
}
=
this
.
data
;
// 已选择具体内容后,只能通过右侧编辑/新增按钮修改,选项按钮不再响应
if
(
replaceSelectedOption
===
value
)
{
if
((
selectedRecruitDemandText
||
selectedStaffText
)
&&
this
.
data
.
replaceSelectedOption
==
value
)
{
return
;
return
;
}
}
this
.
setData
({
replaceSelectedOption
:
value
});
this
.
setData
({
pendingReplaceOption
:
value
},
()
=>
{
this
.
openReplaceEditPopupByValue
(
value
);
});
},
/**
* 按值打开对应编辑弹窗
*/
openReplaceEditPopupByValue
(
value
)
{
if
(
value
===
"CREATE_RECRUITMENT_DEMAND"
)
{
if
(
value
===
"CREATE_RECRUITMENT_DEMAND"
)
{
this
.
setData
({
showRecruitPopup
:
true
}
);
this
.
openRecruitPopup
(
);
}
else
if
(
value
===
"LINK_EXISTING_RECRUITMENT_DEMAND"
)
{
}
else
if
(
value
===
"LINK_EXISTING_RECRUITMENT_DEMAND"
)
{
this
.
openLinkRecruitPopup
();
this
.
openLinkRecruitPopup
();
}
else
if
(
value
===
"LINK_REPLACEMENT_STAFF"
)
{
}
else
if
(
value
===
"LINK_REPLACEMENT_STAFF"
)
{
...
@@ -325,21 +350,27 @@ Page({
...
@@ -325,21 +350,27 @@ Page({
* 打开关联已有招聘弹窗
* 打开关联已有招聘弹窗
*/
*/
openLinkRecruitPopup
()
{
openLinkRecruitPopup
()
{
this
.
setData
({
showLinkRecruitPopup
:
true
});
// 打开弹窗时,把当前已选的招聘需求塞到select-popup选中项里,保证默认高亮回显
this
.
loadRecruitDemandList
();
const
selectedRecruitDemandValues
=
this
.
data
.
selectedRecruitDemand
?
[
this
.
data
.
selectedRecruitDemand
]
:
[];
this
.
setData
({
showLinkRecruitPopup
:
true
,
selectedRecruitDemandValues
},
()
=>
{
this
.
loadRecruitDemandList
();
});
},
},
/**
/**
* 关闭关联已有招聘弹窗
* 关闭关联已有招聘弹窗
(未点确认 → 保留上次已确认的选择)
*/
*/
closeLinkRecruitPopup
()
{
closeLinkRecruitPopup
()
{
this
.
setData
({
showLinkRecruitPopup
:
false
});
this
.
setData
({
showLinkRecruitPopup
:
false
,
pendingReplaceOption
:
""
});
},
},
/**
/**
* 打开关联另一个驻店弹窗
* 打开关联另一个驻店弹窗
*/
*/
openLinkStaffPopup
()
{
openLinkStaffPopup
()
{
const
{
selectedStaff
,
selectedStaffDetail
}
=
this
.
data
;
// 编辑已有选择的情况:先用已选员工作为弹窗内的临时选中项
const
presetStaff
=
selectedStaff
&&
selectedStaffDetail
?
selectedStaffDetail
:
null
;
this
.
setData
(
this
.
setData
(
{
{
showLinkStaffPopup
:
true
,
showLinkStaffPopup
:
true
,
...
@@ -347,53 +378,42 @@ Page({
...
@@ -347,53 +378,42 @@ Page({
staffHasMore
:
true
,
staffHasMore
:
true
,
staffSearchKeyword
:
""
,
staffSearchKeyword
:
""
,
staffOptions
:
[],
staffOptions
:
[],
currentSelectedStaff
:
null
,
currentSelectedStaff
:
presetStaff
,
},
},
()
=>
{
()
=>
{
this
.
loadStaffList
(
false
);
this
.
loadStaffList
(
false
,
presetStaff
);
},
},
);
);
},
},
/**
/**
* 关闭关联另一个驻店弹窗
* 关闭关联另一个驻店弹窗
(未点确认 → 保留上次已确认的选择)
*/
*/
closeLinkStaffPopup
()
{
closeLinkStaffPopup
()
{
this
.
setData
({
showLinkStaffPopup
:
false
});
this
.
setData
({
showLinkStaffPopup
:
false
,
currentSelectedStaff
:
null
,
pendingReplaceOption
:
""
});
},
},
/**
/**
* 编辑已选的人员更换选项
* 编辑已选的人员更换选项
(右侧「编辑/新增」按钮)
*/
*/
onEditReplaceOption
()
{
onEditReplaceOption
()
{
const
{
replaceSelectedOption
}
=
this
.
data
;
const
{
replaceSelectedOption
}
=
this
.
data
;
if
(
!
replaceSelectedOption
)
return
;
if
(
replaceSelectedOption
===
"CREATE_RECRUITMENT_DEMAND"
)
{
this
.
openReplaceEditPopupByValue
(
replaceSelectedOption
);
this
.
openRecruitPopup
();
}
else
if
(
replaceSelectedOption
===
"LINK_EXISTING_RECRUITMENT_DEMAND"
)
{
this
.
openLinkRecruitPopup
();
}
else
if
(
replaceSelectedOption
===
"LINK_REPLACEMENT_STAFF"
)
{
this
.
openLinkStaffPopup
();
}
},
},
/**
/**
* 打开发起招聘弹窗
* 打开发起招聘弹窗
*/
*/
openRecruitPopup
()
{
openRecruitPopup
()
{
this
.
setData
({
this
.
setData
({
showRecruitPopup
:
true
});
showRecruitPopup
:
true
,
replaceSelectedOption
:
"CREATE_RECRUITMENT_DEMAND"
,
});
},
},
/**
/**
* 关闭发起招聘弹窗
* 关闭发起招聘弹窗
(未点确认 → 保留上次已确认的选择)
*/
*/
closeRecruitPopup
()
{
closeRecruitPopup
()
{
this
.
setData
({
this
.
setData
({
showRecruitPopup
:
false
,
pendingReplaceOption
:
""
});
showRecruitPopup
:
false
,
});
},
},
/**
/**
...
@@ -404,7 +424,6 @@ Page({
...
@@ -404,7 +424,6 @@ Page({
const
{
task
}
=
this
.
data
;
const
{
task
}
=
this
.
data
;
const
recruitId
=
detail
.
recruitId
||
detail
.
id
||
""
;
const
recruitId
=
detail
.
recruitId
||
detail
.
id
||
""
;
// 构造回显文本:业务类型/招聘类型/招聘时间
const
businessTypeName
=
detail
.
businessTypeName
||
task
?.
businessName
||
""
;
const
businessTypeName
=
detail
.
businessTypeName
||
task
?.
businessName
||
""
;
const
recruitTypeName
=
detail
.
recruitTypeName
||
this
.
data
.
replaceOptions
.
find
((
item
)
=>
item
.
value
===
"CREATE_RECRUITMENT_DEMAND"
)?.
label
||
"人员更换评估"
;
const
recruitTypeName
=
detail
.
recruitTypeName
||
this
.
data
.
replaceOptions
.
find
((
item
)
=>
item
.
value
===
"CREATE_RECRUITMENT_DEMAND"
)?.
label
||
"人员更换评估"
;
const
createTime
=
detail
.
createTime
||
this
.
formatDateTime
(
new
Date
());
const
createTime
=
detail
.
createTime
||
this
.
formatDateTime
(
new
Date
());
...
@@ -412,6 +431,7 @@ Page({
...
@@ -412,6 +431,7 @@ Page({
this
.
setData
({
this
.
setData
({
showRecruitPopup
:
false
,
showRecruitPopup
:
false
,
replaceSelectedOption
:
"CREATE_RECRUITMENT_DEMAND"
,
replaceSelectedOption
:
"CREATE_RECRUITMENT_DEMAND"
,
pendingReplaceOption
:
""
,
selectedRecruitDemand
:
recruitId
,
selectedRecruitDemand
:
recruitId
,
selectedRecruitDemandValues
:
recruitId
?
[
recruitId
]
:
[],
selectedRecruitDemandValues
:
recruitId
?
[
recruitId
]
:
[],
selectedRecruitDetail
:
{
selectedRecruitDetail
:
{
...
@@ -422,6 +442,11 @@ Page({
...
@@ -422,6 +442,11 @@ Page({
displayText
:
`
${
businessTypeName
}
/
${
recruitTypeName
}
/
${
createTime
}
`
,
displayText
:
`
${
businessTypeName
}
/
${
recruitTypeName
}
/
${
createTime
}
`
,
},
},
selectedRecruitDemandText
:
`
${
businessTypeName
}
/
${
recruitTypeName
}
/
${
createTime
}
`
,
selectedRecruitDemandText
:
`
${
businessTypeName
}
/
${
recruitTypeName
}
/
${
createTime
}
`
,
// 切换到招聘类,清空驻店相关数据,避免下方内容不匹配
selectedStaff
:
""
,
selectedStaffValues
:
[],
selectedStaffText
:
""
,
selectedStaffDetail
:
null
,
});
});
},
},
...
@@ -462,15 +487,12 @@ Page({
...
@@ -462,15 +487,12 @@ Page({
/**
/**
* 加载驻店人员列表
* 加载驻店人员列表
*/
*/
async
loadStaffList
(
isLoadMore
=
false
)
{
async
loadStaffList
(
isLoadMore
=
false
,
presetStaff
=
null
)
{
const
{
staffLoading
,
staffHasMore
,
staffCurrentPage
,
staffPageSize
,
staffSearchKeyword
,
staffOptions
}
=
this
.
data
;
const
{
staffLoading
,
staffHasMore
,
staffCurrentPage
,
staffPageSize
,
staffSearchKeyword
,
staffOptions
}
=
this
.
data
;
// 如果正在加载或没有更多数据,直接返回
if
(
staffLoading
||
(
!
isLoadMore
&&
!
staffHasMore
))
{
if
(
staffLoading
||
(
!
isLoadMore
&&
!
staffHasMore
))
{
return
;
return
;
}
}
// 如果是加载更多,但没有更多数据了
if
(
isLoadMore
&&
!
staffHasMore
)
{
if
(
isLoadMore
&&
!
staffHasMore
)
{
return
;
return
;
}
}
...
@@ -490,16 +512,23 @@ Page({
...
@@ -490,16 +512,23 @@ Page({
const
newList
=
res
.
data
?.
records
||
res
.
data
?.
list
||
res
.
data
||
[];
const
newList
=
res
.
data
?.
records
||
res
.
data
?.
list
||
res
.
data
||
[];
const
total
=
res
.
data
?.
total
||
0
;
const
total
=
res
.
data
?.
total
||
0
;
// 如果是加载更多,追加数据;否则替换数据
const
finalList
=
isLoadMore
?
[...
staffOptions
,
...
newList
]
:
newList
;
const
finalList
=
isLoadMore
?
[...
staffOptions
,
...
newList
]
:
newList
;
const
hasMore
=
finalList
.
length
<
total
;
const
hasMore
=
finalList
.
length
<
total
;
// 编辑态:如果传了presetStaff但当前列表内还没找到对应uuid的高亮,则遍历找到第一个匹配的员工
let
nextSelectedStaff
=
this
.
data
.
currentSelectedStaff
||
null
;
if
(
presetStaff
&&
presetStaff
.
staffUuid
)
{
const
found
=
finalList
.
find
((
s
)
=>
(
s
.
staffUuid
||
s
.
id
)
===
(
presetStaff
.
staffUuid
||
presetStaff
.
id
));
if
(
found
)
nextSelectedStaff
=
found
;
}
this
.
setData
({
this
.
setData
({
staffOptions
:
finalList
,
staffOptions
:
finalList
,
staffCurrentPage
:
currentPage
,
staffCurrentPage
:
currentPage
,
staffTotal
:
total
,
staffTotal
:
total
,
staffHasMore
:
hasMore
,
staffHasMore
:
hasMore
,
staffLoading
:
false
,
staffLoading
:
false
,
currentSelectedStaff
:
nextSelectedStaff
,
});
});
}
else
{
}
else
{
wx
.
showToast
({
title
:
res
?.
message
||
"加载失败"
,
icon
:
"none"
});
wx
.
showToast
({
title
:
res
?.
message
||
"加载失败"
,
icon
:
"none"
});
...
@@ -585,11 +614,17 @@ Page({
...
@@ -585,11 +614,17 @@ Page({
this
.
setData
({
this
.
setData
({
showLinkStaffPopup
:
false
,
showLinkStaffPopup
:
false
,
replaceSelectedOption
:
"LINK_REPLACEMENT_STAFF"
,
replaceSelectedOption
:
"LINK_REPLACEMENT_STAFF"
,
pendingReplaceOption
:
""
,
selectedStaff
:
staffUuid
,
selectedStaff
:
staffUuid
,
selectedStaffValues
:
staffUuid
?
[
staffUuid
]
:
[],
selectedStaffValues
:
staffUuid
?
[
staffUuid
]
:
[],
selectedStaffText
:
currentSelectedStaff
.
staffName
||
""
,
selectedStaffText
:
currentSelectedStaff
.
staffName
||
""
,
selectedStaffDetail
:
currentSelectedStaff
,
selectedStaffDetail
:
currentSelectedStaff
,
currentSelectedStaff
:
null
,
currentSelectedStaff
:
null
,
// 切换到驻店,清空招聘类相关数据,避免下方内容不匹配
selectedRecruitDemand
:
""
,
selectedRecruitDemandValues
:
[],
selectedRecruitDemandText
:
""
,
selectedRecruitDetail
:
null
,
});
});
},
},
...
@@ -607,6 +642,7 @@ Page({
...
@@ -607,6 +642,7 @@ Page({
this
.
setData
({
this
.
setData
({
showLinkRecruitPopup
:
false
,
showLinkRecruitPopup
:
false
,
replaceSelectedOption
:
"LINK_EXISTING_RECRUITMENT_DEMAND"
,
replaceSelectedOption
:
"LINK_EXISTING_RECRUITMENT_DEMAND"
,
pendingReplaceOption
:
""
,
selectedRecruitDemand
:
recruitId
,
selectedRecruitDemand
:
recruitId
,
selectedRecruitDemandValues
:
recruitId
?
[
recruitId
]
:
[],
selectedRecruitDemandValues
:
recruitId
?
[
recruitId
]
:
[],
selectedRecruitDemandText
:
selected
.
displayText
||
""
,
selectedRecruitDemandText
:
selected
.
displayText
||
""
,
...
@@ -614,6 +650,11 @@ Page({
...
@@ -614,6 +650,11 @@ Page({
...
selected
,
...
selected
,
displayText
:
selected
.
displayText
,
displayText
:
selected
.
displayText
,
},
},
// 切换到招聘类,清空驻店相关数据,避免下方内容不匹配
selectedStaff
:
""
,
selectedStaffValues
:
[],
selectedStaffText
:
""
,
selectedStaffDetail
:
null
,
});
});
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment