Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
problem_rectification
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Yang
problem_rectification
Commits
40f35588
Commit
40f35588
authored
May 27, 2026
by
David Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: demo
parent
8bb072d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
235 additions
and
0 deletions
+235
-0
ProblemRectification.js
src/services/demo/ProblemRectification.js
+235
-0
ProblemRectificationForm.jsx
src/services/demo/ProblemRectificationForm.jsx
+0
-0
No files found.
src/services/demo/ProblemRectification.js
0 → 100644
View file @
40f35588
import
React
from
'react'
import
{
queryRecords
,
batchRemoveRecords
,
createRecord
,
getSubjectView
,
batchUpdateRecords
,
createNotice
,
sendNotice
,
loadUser
,
executeAction
,
updateRecord
,
importRecords
}
from
'./DataService'
import
BaseService
from
'./BaseService'
import
dayjs
from
'dayjs'
import
{
message
}
from
'antd'
import
UserSelectForm
from
'@/pages/app/problem_rectification/UserSelectForm'
import
SheetHelper
from
'@/utils/SheetHelper'
export
class
ProblemRectificationService
extends
BaseService
{
constructor
()
{
super
()
}
// 推送问题整改表
async
shareProblemRectificationFormTable
(
params
,
callbacks
,
options
)
{
const
selectedRowIds
=
callbacks
?.
gridRef
?.
current
?.
getSelectedRows
?.()
const
selectedRecords
=
await
this
.
processSelectedRecords
(
selectedRowIds
,
params
.
node
?.
data
,
options
?.
subjectName
||
''
,
callbacks
)
console
.
log
(
'currentView'
,
callbacks
?.
gridRef
?.
current
?.
getCurrentView
?.())
// 在外层用闭包变量收集选择结果,onOk 时读取
let
selectedFillers
=
[]
let
selectedAuditors
=
[]
callbacks
?.
modalApi
.
confirm
({
title
:
'选择填报人/审核人'
,
content
:
(
<
UserSelectForm
onChangeFillers
=
{
values
=>
{
selectedFillers
=
values
||
[]
}}
onChangeAuditors
=
{
values
=>
{
selectedAuditors
=
values
||
[]
}}
/
>
),
width
:
600
,
onOk
:
async
()
=>
{
// 在这里即可拿到两组用户 _id
if
(
!
selectedFillers
?.
length
||
!
selectedAuditors
?.
length
)
{
message
.
error
(
'请先选择 填报人 和 审核人'
)
return
Promise
.
reject
()
}
console
.
log
(
'填报人 user_id 列表'
,
selectedFillers
)
console
.
log
(
'审核人 user_id 列表'
,
selectedAuditors
)
const
user_id
=
callbacks
?.
userInfo
?.
_id
const
restriction_key
=
'_id'
const
restriction_value
=
selectedRecords
.
map
(
item
=>
item
.
_id
)
const
result
=
await
createRecord
({
subject
:
'message_reference_id'
,
title
:
`推送 问题整改表 填写`
,
metadata
:
{
sender
:
user_id
,
editor
:
selectedFillers
,
auditor
:
selectedAuditors
,
restriction_key
:
restriction_key
,
restriction_value
:
restriction_value
,
view_name
:
callbacks
?.
gridRef
?.
current
?.
getCurrentView
?.()
||
''
,
subject_name
:
'problem_rectification'
}
})
// 创建oa流程
const
progress_id_editor
=
[]
for
(
const
userId
of
selectedFillers
)
{
const
userInfo
=
await
loadUser
(
userId
)
console
.
log
(
'userInfo'
,
userInfo
)
const
oaProcessResult
=
await
executeAction
(
'oa_notice:createProgress'
,
{
title
:
`
${
dayjs
().
format
(
'YYYY-MM-DD'
)}
填写问题整改表`
,
classify
:
'流程待办'
,
contentType
:
'流程待办'
,
receiveUserId
:
userId
,
receiveUserName
:
userInfo
.
username
,
receiveDisplayName
:
userInfo
.
display_name
,
sendUserId
:
user_id
,
sendUserName
:
callbacks
?.
userInfo
?.
username
,
sendDisplayName
:
callbacks
?.
userInfo
?.
display_name
,
returnUrl
:
`
${
location
.
origin
}
/problem_rectification_form?id=
${
result
.
name
}
`
,
})
console
.
log
(
'userId'
,
userId
)
console
.
log
(
'oaProcessResult'
,
oaProcessResult
)
progress_id_editor
.
push
(
oaProcessResult
?.
data
?.
taskId
)
}
console
.
log
(
'progress_id_editor'
,
progress_id_editor
)
// 更新消息通知中填写人oa流程ID
await
updateRecord
(
result
.
_id
,
{
metadata
:
{
progress_id_editor
:
progress_id_editor
}
})
// 批量更新填写人
await
batchUpdateRecords
({
subject
:
'problem_rectification'
,
filter
:
{
'_id'
:
{
$in
:
selectedRecords
.
map
(
item
=>
item
.
_id
)
}
},
data
:
{
'metadata.fill_in_the_people'
:
selectedFillers
}
})
// 给填报人 推送消息通知
const
editorNoticeResult
=
await
createNotice
({
title
:
'推送 问题整改表 填写'
,
content
:
`请点击链接 填写 问题整改表,
${
location
.
origin
}
/problem_rectification_form?id=
${
result
.
name
}
`
,
type
:
'internal'
,
from
:
user_id
,
to
:
selectedFillers
,
settings
:
{}
})
await
sendNotice
(
editorNoticeResult
.
name
)
callbacks
?.
onRefreshGrid
()
message
.
success
(
'已发送消息通知'
)
}
})
}
// 导出问题整改表
async
exportProblemRectificationFormTable
(
params
,
callbacks
,
options
)
{
console
.
log
(
'exportProblemRectificationFormTable'
,
params
,
callbacks
)
const
selectedRowIds
=
callbacks
?.
gridRef
?.
current
?.
getSelectedRows
?.()
||
[]
const
records
=
await
this
.
processSelectedRecords
(
selectedRowIds
,
params
.
node
?.
data
,
options
?.
subjectName
||
''
,
callbacks
)
const
result
=
await
queryRecords
({
subject
:
'problem_rectification'
,
filter
:
{
'_id'
:
{
$in
:
selectedRowIds
}
}
})
const
data
=
result
?.
records
?.
map
(
item
=>
{
return
{
检查项目名称
:
item
.
metadata
.
project_name
,
检查实施单位
:
item
.
metadata
.
inspect_the_implementing_unit
,
检查实施时间
:
item
.
metadata
.
check_the_implementation_time
,
检查报告出具日
:
item
.
metadata
.
inspection_report_date
,
问题简述
:
item
.
metadata
.
problem_brief
,
问题发现情况
:
item
.
metadata
.
problem_discovery_situation
,
责任部门
:
item
.
metadata
.
responsible_department
,
整改进度
:
item
.
metadata
.
rectification_progress
,
整改情况
:
item
.
metadata
.
rectification_situation
,
问题来源
:
item
.
metadata
.
problem_from
,
问题类型
:
item
.
metadata
.
problem_type
,
反馈单位
:
item
.
metadata
.
feedback_unit
,
问题涉及业务领域
:
item
.
metadata
.
related_issue_domain
,
预计整改完成时间
:
item
.
metadata
.
the_time_of_rectification
?
dayjs
(
item
.
metadata
.
the_time_of_rectification
).
format
(
'YYYY-MM-DD'
)
:
''
,
备注
:
item
.
metadata
.
remark
,
}
})
SheetHelper
.
save
(
data
,
`
${
dayjs
().
format
(
'YYYY-MM-DD'
)}
问题整改表.xlsx`
)
message
.
success
(
'导出成功'
)
return
result
}
// 问题整改归档
async
batch_archive
(
params
,
callbacks
,
options
)
{
console
.
log
(
'batch_archive'
,
params
,
callbacks
)
const
selectedRowIds
=
callbacks
?.
gridRef
?.
current
?.
getSelectedRows
?.()
||
[]
const
records
=
await
this
.
processSelectedRecords
(
selectedRowIds
,
params
.
node
?.
data
,
options
?.
subjectName
||
''
,
callbacks
)
const
result
=
await
importRecords
(
'problem_rectification_archive_records'
,
records
.
map
(
item
=>
{
return
{
title
:
item
.
title
||
undefined
,
metadata
:
{
inspect_the_implementing_unit
:
item
.
metadata
.
inspect_the_implementing_unit
,
check_the_implementation_time
:
item
.
metadata
.
check_the_implementation_time
,
inspection_report_date
:
item
.
metadata
.
inspection_report_date
,
problem_discovery_situation
:
item
.
metadata
.
problem_discovery_situation
,
responsible_department
:
item
.
metadata
.
responsible_department
.
join
(
','
),
rectification_progress
:
item
.
metadata
.
rectification_progress
,
rectification_situation
:
item
.
metadata
.
rectification_situation
,
feedback_unit
:
item
.
metadata
.
feedback_unit
,
remark
:
item
.
metadata
.
remark
,
the_time_of_rectification
:
item
.
metadata
.
the_time_of_rectification
,
fill_in_the_people
:
item
.
metadata
.
fill_in_the_people
?
item
.
metadata
.
fill_in_the_people
.
map
(
item
=>
item
.
_id
)
:
undefined
,
review_people
:
item
.
metadata
.
review_people
?
item
.
metadata
.
review_people
.
map
(
item
=>
item
.
_id
)
:
undefined
,
problem_from
:
item
.
metadata
.
problem_from
,
problem_type
:
item
.
metadata
.
problem_type
,
related_issue_domain
:
item
.
metadata
.
related_issue_domain
,
problem_brief
:
item
.
metadata
.
problem_brief
,
audit_status
:
item
.
metadata
.
audit_status
,
final_audit_status
:
item
.
metadata
.
final_audit_status
,
project_name
:
item
.
metadata
.
project_name
,
rectification_proof_materials
:
item
.
metadata
.
rectification_proof_materials
||
undefined
}
}
}))
await
createRecord
({
subject
:
'issue_rectification_archive'
,
title
:
`问题整改归档
${
dayjs
().
format
(
'YYYY-MM-DD'
)}
`
,
metadata
:
{
reference_records
:
Object
.
values
(
result
.
insertedIds
)
}
})
message
.
success
(
'批量归档成功'
)
}
}
export
default
ProblemRectificationService
src/services/demo/ProblemRectificationForm.jsx
0 → 100644
View file @
40f35588
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment