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
mes
mes-ui
Commits
b9c211e9
Commit
b9c211e9
authored
Mar 31, 2025
by
tanjunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 领料相关细节优化
parent
bc772af0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
24 deletions
+144
-24
arrange.js
src/api/mes/pro/arrange.js
+9
-0
requestItem.vue
src/components/request/requestItem.vue
+1
-1
request.js
src/utils/request.js
+45
-0
index.vue
src/views/mes/pro/scheduleList/index.vue
+15
-6
indexApply.vue
src/views/mes/pro/workorder/indexApply.vue
+70
-13
index.vue
src/views/mes/wm/issue/index.vue
+2
-2
line.vue
src/views/mes/wm/issue/line.vue
+2
-2
No files found.
src/api/mes/pro/arrange.js
View file @
b9c211e9
...
...
@@ -85,3 +85,12 @@ export function delArrange2(arrangeId) {
method
:
'delete'
})
}
// 校验是否有编排规则
export
function
checkArrangeRulesApi
(
data
)
{
return
request
({
url
:
'/pro/arrange/checkArrangeRules'
,
method
:
'post'
,
data
:
data
})
}
src/components/request/requestItem.vue
View file @
b9c211e9
...
...
@@ -32,12 +32,12 @@
<el-table-column
label=
"生产工单"
align=
"center"
prop=
"workorderCode"
width=
"200"
/>
<el-table-column
label=
"申请单号"
align=
"center"
prop=
"applyNo"
width=
"200"
/>
<el-table-column
label=
"领用数量"
align=
"center"
prop=
"applyNum"
width=
"200"
/>
<el-table-column
label=
"已发放数量"
align=
"center"
prop=
"grantNum"
width=
"150"
/>
<el-table-column
label=
"发料状态"
align=
"center"
prop=
"grantNumType"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.pro_grant_num_type"
:value=
"scope.row.grantNumType"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"已发放数量"
align=
"center"
prop=
"grantNum"
width=
"150"
/>
<el-table-column
label=
"操作"
width=
"150"
align=
"center"
class-name=
"small-padding fixed-width"
fixed=
"right"
>
<
template
v-slot=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"handleView(scope.row)"
...
...
src/utils/request.js
View file @
b9c211e9
...
...
@@ -7,6 +7,40 @@ import { tansParams, blobValidate } from "@/utils/ruoyi";
import
cache
from
'@/plugins/cache'
import
{
saveAs
}
from
'file-saver'
// 全局变量对象,专门存放所有请求的cancel方法
window
.
pendingRequest
=
new
Map
()
// 生成request的唯一的标识
const
generateRequestKey
=
(
config
=
{})
=>
{
// 通过url,method,params,data生成唯一key,用于判断是否重复请求
// params为get请求参数,data为post请求参数
const
{
url
,
method
}
=
config
if
(
method
==
'get'
)
{
return
[
url
,
method
].
join
(
'&'
)
}
return
[
url
,
method
].
join
(
'&'
)
}
// 将重复请求添加到pendingRequest中
const
addPendingRequest
=
(
config
)
=>
{
const
key
=
generateRequestKey
(
config
)
if
(
!
pendingRequest
.
has
(
key
))
{
config
.
cancelToken
=
new
axios
.
CancelToken
(
cancel
=>
{
pendingRequest
.
set
(
key
,
cancel
)
})
}
}
// 取消重复请求
const
cancelRepeatRequest
=
(
config
)
=>
{
const
key
=
generateRequestKey
(
config
)
if
(
pendingRequest
.
has
(
key
))
{
const
cancelToken
=
pendingRequest
.
get
(
key
)
cancelToken
(
key
)
// 取消之前发送的请求
pendingRequest
.
delete
(
key
)
// 请求对象中删除requestKey
}
}
let
downloadLoadingInstance
;
// 是否显示重新登录
export
let
isRelogin
=
{
show
:
false
};
...
...
@@ -22,6 +56,12 @@ const service = axios.create({
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
if
(
config
.
method
==
"post"
&&
config
.
url
.
includes
(
"/mes/pro/taskWorkunit/list?"
))
{
// 取消重复请求
cancelRepeatRequest
(
config
)
// 添加请求到队列
addPendingRequest
(
config
)
}
// 是否需要设置 token
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
// 是否需要防止数据重复提交
...
...
@@ -110,6 +150,11 @@ service.interceptors.response.use(res => {
},
error
=>
{
console
.
log
(
'err'
+
error
)
if
(
error
==
"Cancel: /mes/pro/taskWorkunit/list?pageNum=1&pageSize=10&post"
)
{
// 取消请求队列中该请求
cancelRepeatRequest
(
error
.
config
||
{})
return
}
let
{
message
}
=
error
;
if
(
message
==
"Network Error"
)
{
message
=
"后端接口连接异常"
;
...
...
src/views/mes/pro/scheduleList/index.vue
View file @
b9c211e9
...
...
@@ -720,7 +720,8 @@ export default {
form
:
{},
// 表单校验
rules
:
{
}
},
timestamp
:
0
};
},
created
()
{
...
...
@@ -806,7 +807,12 @@ export default {
this
.
queryWorkunitParams
.
workstationId
=
res
[
0
].
workstationId
?
res
[
0
].
workstationId
:
this
.
workstationList
[
0
].
workstationId
this
.
hanldeGettaskWorkunitList
()
}
this
.
getList
()
if
(
!
this
.
queryWorkunitParams
.
workshopId
)
{
this
.
queryWorkunitParams
.
workshopId
=
this
.
workshopList
[
0
].
workshopId
;
this
.
queryWorkunitParams
.
workstationId
=
this
.
workstationList
[
0
].
workstationId
;
this
.
hanldeGettaskWorkunitList
();
}
this
.
getList
();
});
},
async
hanldeGetworkshopList
()
{
...
...
@@ -913,9 +919,9 @@ export default {
},
/** 查询要维护刀模版列表 */
async
getList
()
{
if
(
this
.
loading
)
{
return
this
.
$modal
.
msgWarning
(
"正在查询中,待查询结果返回后再查询!"
);
}
//
if(this.loading) {
//
return this.$modal.msgWarning("正在查询中,待查询结果返回后再查询!");
//
}
this
.
queryParams
.
workCenterId
=
this
.
queryWorkunitParams
.
workstationId
this
.
queryParams
.
workshopId
=
this
.
queryWorkunitParams
.
workshopId
this
.
loading
=
true
;
...
...
@@ -993,7 +999,10 @@ export default {
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
if
(
new
Date
().
getTime
()
-
this
.
timestamp
>
1000
)
{
this
.
timestamp
=
new
Date
().
getTime
();
this
.
getList
();
}
},
/** 重置按钮操作 */
resetQuery
()
{
...
...
src/views/mes/pro/workorder/indexApply.vue
View file @
b9c211e9
...
...
@@ -623,7 +623,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import
{
getToken
}
from
"@/utils/auth"
;
import
{
addCombination
,
batchAddCombination
,
batchAddCombinations
}
from
"@/api/mes/pro/combination"
;
import
CombinationInfos
from
"@/views/mes/pro/combination/infos.vue"
;
import
{
batchAddArrange
,
delArrange
,
delArrange2
}
from
"@/api/mes/pro/arrange"
;
import
{
batchAddArrange
,
delArrange
,
delArrange2
,
checkArrangeRulesApi
}
from
"@/api/mes/pro/arrange"
;
import
ArrangeInfo
from
"@/views/mes/pro/arrange/info.vue"
;
import
CommandList
from
"./commandList.vue"
;
import
dayjs
from
'dayjs'
;
...
...
@@ -933,7 +933,6 @@ export default {
return
}
// status: "COMBINED"
let
params
=
[]
// for(const item in this.selectedRows)
{
// if (item.arrangeCode != '' && item.arrangeCode != null)
{
// this.$modal.msgWarning(`$
{
item
.
workorderCode
}生产单已绑定编排单,不能再绑定!
`);
...
...
@@ -951,21 +950,79 @@ export default {
this.$modal.msgWarning(`
$
{
workorderCode
[
0
]
}只允许操作单据状态为已组合数据!
`);
return
}
const cparams = []
this.selectedRows.forEach((item, index) => {
params.push({
arrangeSort: index + 1,
cparams.push({
workorderId: item.workorderId,
workorderCode: item.workorderCode,
arrangeCode: null
}
)
}
);
batchAddArrange(params).then(response => {
this.arrangeOpen2 = true;
this.groupCode = response;
this.$modal.msgSuccess("新增编排单成功");
this.getList();
}
);
checkArrangeRulesApi(cparams).then(res => {
if(res.msg) {
const list = res.msg.split(',');
this.$confirm(
`
工单编号
:
$
{
res
.
msg
}产品分类未设置编排规则,是否继续编排
`,
'提示',
{
distinguishCancelAndClose: true,
confirmButtonText: '是',
cancelButtonText: '否',
}
).then(() => {
let params = [];
this.selectedRows.forEach((item, index) => {
params.push({
arrangeSort: index + 1,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
arrangeCode: null
}
)
}
);
batchAddArrange(params).then(response => {
this.arrangeOpen2 = true;
this.groupCode = response;
this.$modal.msgSuccess("新增编排单成功");
this.getList();
}
);
}
).catch((action) => {
if (action === 'cancel') {
let params = [];
this.selectedRows.forEach((item, index) => {
if(!list.includes(item.workorderCode)) {
params.push({
arrangeSort: index + 1,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
arrangeCode: null
}
)
}
}
);
if(params.length > 0) {
batchAddArrange(params).then(response => {
this.arrangeOpen2 = true;
this.groupCode = response;
this.$modal.msgSuccess("新增编排单成功");
this.getList();
}
);
}
}
}
)
}
else {
let params = [];
this.selectedRows.forEach((item, index) => {
params.push({
arrangeSort: index + 1,
workorderId: item.workorderId,
workorderCode: item.workorderCode,
arrangeCode: null
}
)
}
);
batchAddArrange(params).then(response => {
this.arrangeOpen2 = true;
this.groupCode = response;
this.$modal.msgSuccess("新增编排单成功");
this.getList();
}
);
}
}
)
}
,
async handleCombination(type) {
if(type === 'del') {
...
...
src/views/mes/wm/issue/index.vue
View file @
b9c211e9
...
...
@@ -136,8 +136,8 @@
>
{{
scope
.
row
.
issueCode
}}
</el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"工序"
align=
"center"
prop=
"processName"
/>
<el-table-column
label=
"编排单号"
align=
"center"
prop=
"arrangeCode"
/>
<el-table-column
label=
"创建人"
align=
"center"
prop=
"createBy"
/>
<el-table-column
label=
"领料日期"
align=
"center"
prop=
"issueDate"
width=
"180"
>
<!-- <template slot-scope="scope">width="180"
...
...
src/views/mes/wm/issue/line.vue
View file @
b9c211e9
...
...
@@ -42,11 +42,11 @@
<el-table-column
label=
"产品物料名称"
width=
"120px"
align=
"center"
prop=
"itemName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"生产工单"
align=
"center"
prop=
"workorderCode"
/>
<el-table-column
label=
"申请单号"
align=
"center"
prop=
"applyNo"
/>
<el-table-column
label=
"批次号"
align=
"center"
prop=
"batchCode"
/>
<el-table-column
width=
"200"
label=
"PL号"
align=
"center"
prop=
"plNum"
/>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"specification"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"单位"
align=
"center"
prop=
"unitOfMeasure"
/>
<el-table-column
label=
"领料数量"
align=
"center"
prop=
"quantityIssued"
/>
<el-table-column
label=
"批次号"
align=
"center"
prop=
"batchCode"
/>
<el-table-column
width=
"200"
label=
"PL号"
align=
"center"
prop=
"plNum"
/>
<el-table-column
label=
"仓库名称"
align=
"center"
prop=
"warehouseName"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"操作"
align=
"center"
v-if=
"optType != 'view'"
width=
"100px"
class-name=
"small-padding fixed-width"
>
...
...
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