Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes-ui
Commits
5241e95b
Commit
5241e95b
authored
Jun 09, 2026
by
chicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工序支持修改、手动推送
parent
69d850fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
19 deletions
+139
-19
feedback.js
src/api/mes/pro/feedback.js
+17
-0
index.vue
src/views/mes/pro/feedback/index.vue
+122
-19
No files found.
src/api/mes/pro/feedback.js
View file @
5241e95b
...
...
@@ -59,6 +59,23 @@ export function execute(recordId){
})
}
// 批量推送 SAP(末道工序推生产入库,非末道工序推生产转移单)
export
function
syncSapBatch
(
recordIds
)
{
return
request
({
url
:
'/mes/pro/feedback/syncSap'
,
method
:
'post'
,
data
:
recordIds
})
}
// 报工修改记录
export
function
listModifyRecord
(
recordId
)
{
return
request
({
url
:
'/mes/pro/feedback/modifyRecord/'
+
recordId
,
method
:
'get'
})
}
// 查询生产报工记录列表
export
function
listNextProcess
(
query
)
{
...
...
src/views/mes/pro/feedback/index.vue
View file @
5241e95b
...
...
@@ -79,6 +79,8 @@
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-printer"
size=
"mini"
:disabled=
"single"
@
click=
"handleQrcode"
v-hasPermi=
"['mes:pro:feedback:edit']"
>
{{
$t
(
'打印二维码'
)
}}
</el-button>
<el-button
type=
"success"
plain
icon=
"el-icon-upload2"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleSyncSap"
v-hasPermi=
"['mes:pro:feedback:edit']"
>
{{
$t
(
'推送SAP'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleExport"
>
{{
$t
(
'导出'
)
}}
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
...
...
@@ -110,19 +112,26 @@
<el-table-column
:label=
"$t('合格数量')"
width=
"100"
align=
"center"
prop=
"quantityQualify"
/>
<el-table-column
:label=
"$t('不合格数量')"
width=
"100"
align=
"center"
prop=
"quantityUnqualify"
/>
<el-table-column
:label=
"$t('报工人')"
width=
"100"
align=
"center"
prop=
"nickName"
/>
<el-table-column
:label=
"$t('SAP推送')"
width=
"90"
align=
"center"
prop=
"sapPushStatus"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.sapPushStatus === '1' ? 'success' : 'info'"
size=
"mini"
>
{{
scope
.
row
.
sapPushStatus
===
'1'
?
$t
(
'已推送'
)
:
$t
(
'未推送'
)
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('报工时间')"
align=
"center"
prop=
"feedbackTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
feedbackTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
:
label
=
"$t('common.option')"
align
=
"center"
fixed
=
"right"
width
=
"
16
0px"
class
-
name
=
"small-padding fixed-width"
>
<
el
-
table
-
column
:
label
=
"$t('common.option')"
align
=
"center"
fixed
=
"right"
width
=
"
22
0px"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-query"
@
click
=
"handleView(scope.row)"
v
-
hasPermi
=
"['mes:pro:feedback:query']"
>
{{
$t
(
'查看'
)
}}
<
/el-button
>
<
!--
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)
"
v
-
hasPermi
=
"['mes:pro:feedback:edit']"
>
{{
$t
(
'common.edit'
)
}}
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-d
elete"
@
click
=
"handleDelete
(scope.row)"
v
-
hasPermi
=
"['mes:pro:feedback:
remove']"
>
{{
$t
(
'common.del'
)
}}
<
/el-button> --
>
<
el
-
button
v
-
if
=
"scope.row.sapPushStatus !== '1'"
size
=
"mini"
type
=
"text"
icon
=
"el-icon-edit
"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['mes:pro:feedback:edit']"
>
{{
$t
(
'common.edit'
)
}}
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-d
ocument"
@
click
=
"handleModifyRecord
(scope.row)"
v
-
hasPermi
=
"['mes:pro:feedback:
query']"
>
{{
$t
(
'修改记录'
)
}}
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -136,7 +145,7 @@
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('报工类型')"
prop
=
"feedbackType"
>
<
el
-
select
v
-
model
=
"form.feedbackType"
@
change
=
"handleFeedbackTypeChange"
>
<
el
-
select
v
-
model
=
"form.feedbackType"
:
disabled
=
"optType === 'edit' || optType === 'view'"
@
change
=
"handleFeedbackTypeChange"
>
<
el
-
option
v
-
for
=
"dict in dict.type.mes_feedback_type"
:
key
=
"dict.value"
:
label
=
"dict.label"
:
value
=
"dict.value"
><
/el-option
>
<
/el-select
>
...
...
@@ -164,9 +173,8 @@
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('生产工单')"
prop
=
"workorderCode"
>
<
el
-
input
:
disabled
=
"form.feedbackType == 'ASSIST_PROCESS'"
v
-
model
=
"form.workorderCode"
>
<
el
-
button
:
disabled
=
"form.feedbackType == 'ASSIST_PROCESS'"
slot
=
"append"
icon
=
"el-icon-search"
<
el
-
input
:
disabled
=
"isWorkorderTaskDisabled"
v
-
model
=
"form.workorderCode"
>
<
el
-
button
:
disabled
=
"isWorkorderTaskDisabled"
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"handleWorkorderSelect"
><
/el-button
>
<
/el-input
>
<
/el-form-item
>
...
...
@@ -174,8 +182,8 @@
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('生产任务')"
prop
=
"taskCode"
>
<
el
-
input
:
disabled
=
"
form.feedbackType == 'ASSIST_PROCESS'
"
v
-
model
=
"form.taskCode"
>
<
el
-
button
:
disabled
=
"
form.feedbackType == 'ASSIST_PROCESS'
"
slot
=
"append"
icon
=
"el-icon-search"
<
el
-
input
:
disabled
=
"
isWorkorderTaskDisabled
"
v
-
model
=
"form.taskCode"
>
<
el
-
button
:
disabled
=
"
isWorkorderTaskDisabled
"
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"handleTaskSelect"
><
/el-button
>
<
/el-input
>
<
/el-form-item
>
...
...
@@ -215,13 +223,13 @@
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('良品报工')"
prop
=
"quantityQualify"
>
<
el
-
input
-
number
:
min
=
"0"
@
change
=
"handleQuantityChanged"
v
-
model
=
"form.quantityQualify"
<
el
-
input
-
number
:
min
=
"0"
:
disabled
=
"optType === 'view'"
@
change
=
"handleQuantityChanged"
v
-
model
=
"form.quantityQualify"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('不良品报工')"
prop
=
"quantityUnqualify"
>
<
el
-
input
-
number
:
min
=
"0"
@
change
=
"handleQuantityChanged"
v
-
model
=
"form.quantityUnqualify"
<
el
-
input
-
number
:
min
=
"0"
:
disabled
=
"optType === 'view'"
@
change
=
"handleQuantityChanged"
v
-
model
=
"form.quantityUnqualify"
/>
<
/el-form-item
>
<
/el-col
>
...
...
@@ -229,13 +237,13 @@
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('加工工时')"
prop
=
"machineTime"
>
<
el
-
input
-
number
:
min
=
"0"
v
-
model
=
"form.machineTime"
/>
<
el
-
input
-
number
:
min
=
"0"
:
disabled
=
"optType === 'view'"
v
-
model
=
"form.machineTime"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('报工人')"
prop
=
"nickName"
>
<
el
-
input
v
-
model
=
"form.nickName"
>
<
el
-
button
slot
=
"append"
@
click
=
"handleUserSelect"
icon
=
"el-icon-search"
><
/el-button
>
<
el
-
input
v
-
model
=
"form.nickName"
:
disabled
=
"optType === 'edit' || optType === 'view'"
>
<
el
-
button
slot
=
"append"
:
disabled
=
"optType === 'edit' || optType === 'view'"
@
click
=
"handleUserSelect"
icon
=
"el-icon-search"
><
/el-button
>
<
/el-input
>
<
/el-form-item
>
<
UserSingleSelect
v
-
if
=
"open"
ref
=
"userSelect"
@
onSelected
=
"onUserSelected"
><
/UserSingleSelect
>
...
...
@@ -243,7 +251,7 @@
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
:
label
=
"$t('报工时间')"
prop
=
"feedbackTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.feedbackTime"
type
=
"datetime"
value
-
format
=
"yyyy-MM-dd HH:mm:ss"
>
:
disabled
=
"optType === 'edit' || optType === 'view'"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
...
...
@@ -251,7 +259,7 @@
<
el
-
row
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
:
label
=
"$t('common.remark')"
prop
=
"remark"
>
<
el
-
input
v
-
model
=
"form.remark"
type
=
"textarea"
/>
<
el
-
input
v
-
model
=
"form.remark"
type
=
"textarea"
:
disabled
=
"optType === 'view'"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
...
...
@@ -265,13 +273,26 @@
<
el
-
button
@
click
=
"cancel"
>
{{
$t
(
'common.cancel'
)
}}
<
/el-button
>
<
/div
>
<
/el-dialog
>
<!--
修改记录
-->
<
el
-
dialog
:
title
=
"$t('修改记录')"
:
visible
.
sync
=
"modifyRecordOpen"
width
=
"900px"
append
-
to
-
body
>
<
el
-
table
v
-
loading
=
"modifyRecordLoading"
:
data
=
"modifyRecordList"
size
=
"small"
>
<
el
-
table
-
column
:
label
=
"$t('修改时间')"
prop
=
"createTime"
width
=
"160"
/>
<
el
-
table
-
column
:
label
=
"$t('修改人')"
prop
=
"createBy"
width
=
"100"
/>
<
el
-
table
-
column
:
label
=
"$t('修改内容')"
min
-
width
=
"400"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
formatModifyBody
(
scope
.
row
.
requestBody
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listFeedback
,
getFeedback
,
delFeedback
,
addFeedback
,
updateFeedback
,
execute
,
listNextProcess
}
from
"@/api/mes/pro/feedback"
;
import
{
listFeedback
,
getFeedback
,
delFeedback
,
addFeedback
,
updateFeedback
,
execute
,
syncSapBatch
,
listModifyRecord
,
listNextProcess
}
from
"@/api/mes/pro/feedback"
;
import
WorkorderSelect
from
"@/components/workorderSelect/single.vue"
import
WorkstationSelect
from
"@/components/workstationSelect/simpletableSingle.vue"
import
UserSingleSelect
from
"@/components/userSelect/single.vue"
...
...
@@ -307,6 +328,9 @@ export default {
title
:
""
,
// 是否显示弹出层
open
:
false
,
modifyRecordOpen
:
false
,
modifyRecordLoading
:
false
,
modifyRecordList
:
[],
// 查询参数
queryParams
:
{
pageNum
:
1
,
...
...
@@ -375,6 +399,11 @@ export default {
}
}
;
}
,
computed
:
{
isWorkorderTaskDisabled
()
{
return
this
.
form
.
feedbackType
===
'ASSIST_PROCESS'
||
this
.
optType
===
'edit'
||
this
.
optType
===
'view'
}
}
,
created
()
{
this
.
getList
();
}
,
...
...
@@ -493,6 +522,10 @@ export default {
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
if
(
row
.
sapPushStatus
===
'1'
)
{
this
.
$modal
.
msgWarning
(
this
.
$t
(
'该报工记录已推送ERP,不允许修改'
))
return
}
this
.
reset
();
const
recordId
=
row
.
recordId
||
this
.
ids
getFeedback
(
recordId
).
then
(
response
=>
{
...
...
@@ -505,6 +538,40 @@ export default {
this
.
optType
=
"edit"
;
}
);
}
,
handleModifyRecord
(
row
)
{
this
.
modifyRecordOpen
=
true
this
.
modifyRecordLoading
=
true
this
.
modifyRecordList
=
[]
listModifyRecord
(
row
.
recordId
).
then
(
res
=>
{
this
.
modifyRecordList
=
res
.
data
||
[]
}
).
finally
(()
=>
{
this
.
modifyRecordLoading
=
false
}
)
}
,
formatModifyBody
(
body
)
{
if
(
!
body
)
return
''
try
{
const
obj
=
JSON
.
parse
(
body
)
const
before
=
obj
.
before
||
{
}
const
after
=
obj
.
after
||
{
}
const
parts
=
[]
if
(
before
.
quantityQualify
!==
after
.
quantityQualify
)
{
parts
.
push
(
`合格: ${before.quantityQualify
}
→ ${after.quantityQualify
}
`
)
}
if
(
before
.
quantityUnqualify
!==
after
.
quantityUnqualify
)
{
parts
.
push
(
`不合格: ${before.quantityUnqualify
}
→ ${after.quantityUnqualify
}
`
)
}
if
(
before
.
machineTime
!==
after
.
machineTime
)
{
parts
.
push
(
`工时: ${before.machineTime || '-'
}
→ ${after.machineTime || '-'
}
`
)
}
if
(
before
.
remark
!==
after
.
remark
)
{
parts
.
push
(
`备注: ${before.remark || '-'
}
→ ${after.remark || '-'
}
`
)
}
return
parts
.
length
?
parts
.
join
(
';'
)
:
body
}
catch
(
e
)
{
return
body
}
}
,
// 查询明细按钮操作
handleView
(
row
)
{
this
.
reset
();
...
...
@@ -587,6 +654,42 @@ export default {
}
).
catch
(()
=>
{
}
);
}
,
/** 批量推送 SAP */
handleSyncSap
()
{
if
(
!
this
.
ids
||
this
.
ids
.
length
===
0
)
{
this
.
$modal
.
msgWarning
(
this
.
$t
(
'请选择要推送的报工记录'
))
return
}
const
pushedRows
=
this
.
selectRow
.
filter
(
row
=>
row
.
sapPushStatus
===
'1'
)
const
recordIds
=
this
.
selectRow
.
filter
(
row
=>
row
.
sapPushStatus
!==
'1'
).
map
(
row
=>
row
.
recordId
)
if
(
pushedRows
.
length
>
0
&&
recordIds
.
length
===
0
)
{
this
.
$modal
.
msgWarning
(
this
.
$t
(
'所选记录均已推送SAP,不能重复推送'
))
return
}
if
(
pushedRows
.
length
>
0
)
{
this
.
$modal
.
msgWarning
(
this
.
$t
(
'已跳过'
)
+
pushedRows
.
length
+
this
.
$t
(
'条已推送记录'
))
}
if
(
recordIds
.
length
===
0
)
{
return
}
this
.
$modal
.
confirm
(
this
.
$t
(
'确认将选中的报工记录推送至SAP?末道工序推生产入库,非末道工序推生产转移单。'
)).
then
(()
=>
{
this
.
loading
=
true
return
syncSapBatch
(
recordIds
)
}
).
then
(
response
=>
{
const
result
=
response
.
data
||
{
}
const
messages
=
result
.
messages
||
[]
const
summary
=
`成功 ${result.successCount || 0
}
条,失败 ${result.failCount || 0
}
条`
if
(
result
.
failCount
>
0
)
{
this
.
$alert
([
summary
,
...
messages
].
join
(
'
\
n'
),
this
.
$t
(
'推送结果'
),
{
confirmButtonText
:
this
.
$t
(
'确定'
)
}
)
}
else
{
this
.
$modal
.
msgSuccess
(
summary
)
}
this
.
getList
()
}
).
catch
(()
=>
{
}
).
finally
(()
=>
{
this
.
loading
=
false
}
)
}
,
/** 二维码打印 */
handleQrcode
()
{
let
workunitName
=
''
;
...
...
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