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
214a0b6d
Commit
214a0b6d
authored
Jan 18, 2024
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BOM页面及工艺路线
parent
573cd23a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2097 additions
and
300 deletions
+2097
-300
bom.js
src/api/mes/pro/bom.js
+53
-0
bomItem.js
src/api/mes/pro/bomItem.js
+44
-0
single.vue
src/components/usageSelect/single.vue
+199
-0
simpletableSingle.vue
src/components/workstationSelect/simpletableSingle.vue
+136
-66
index.vue
src/views/mes/md/workstation/index.vue
+287
-137
index.vue
src/views/mes/pro/bom/index.vue
+665
-0
item.vue
src/views/mes/pro/bom/item.vue
+502
-0
content.vue
src/views/mes/pro/process/content.vue
+140
-74
routeprocess.vue
src/views/mes/pro/proroute/routeprocess.vue
+71
-23
No files found.
src/api/mes/pro/bom.js
0 → 100644
View file @
214a0b6d
import
request
from
'@/utils/request'
// 查询生产BOM列表
export
function
listBom
(
query
)
{
return
request
({
url
:
'/mes/pro/bom/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询所有有效生产BOM
export
function
listAllBom
()
{
return
request
({
url
:
'/mes/pro/bom/listAll'
,
method
:
'get'
})
}
// 查询生产BOM详细
export
function
getBom
(
bomId
)
{
return
request
({
url
:
'/mes/pro/bom/'
+
bomId
,
method
:
'get'
})
}
// 新增生产BOM
export
function
addBom
(
data
)
{
return
request
({
url
:
'/mes/pro/bom'
,
method
:
'post'
,
data
:
data
})
}
// 修改生产BOM
export
function
updateBom
(
data
)
{
return
request
({
url
:
'/mes/pro/bom'
,
method
:
'put'
,
data
:
data
})
}
// 删除生产BOM
export
function
delBom
(
bomId
)
{
return
request
({
url
:
'/mes/pro/bom/'
+
bomId
,
method
:
'delete'
})
}
src/api/mes/pro/bomItem.js
0 → 100644
View file @
214a0b6d
import
request
from
'@/utils/request'
// 查询生产BOM组件列表
export
function
listBomItem
(
query
)
{
return
request
({
url
:
'/mes/pro/bomItem/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询生产BOM组件详细
export
function
getBomItem
(
bomItemId
)
{
return
request
({
url
:
'/mes/pro/bomItem/'
+
bomItemId
,
method
:
'get'
})
}
// 新增生产BOM组件
export
function
addBomItem
(
data
)
{
return
request
({
url
:
'/mes/pro/bomItem'
,
method
:
'post'
,
data
:
data
})
}
// 修改生产BOM组件
export
function
updateBomItem
(
data
)
{
return
request
({
url
:
'/mes/pro/bomItem'
,
method
:
'put'
,
data
:
data
})
}
// 删除生产BOM组件
export
function
delBomItem
(
bomItemId
)
{
return
request
({
url
:
'/mes/pro/bomItem/'
+
bomItemId
,
method
:
'delete'
})
}
src/components/usageSelect/single.vue
0 → 100644
View file @
214a0b6d
<
template
>
<el-dialog
title=
"用途选择"
v-if=
"showFlag"
:visible
.
sync=
"showFlag"
:modal=
"false"
width=
"57%"
center
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"用途编码"
prop=
"usageCode"
>
<el-input
v-model=
"queryParams.usageCode"
placeholder=
"请输入用途编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"用途名称"
prop=
"usageName"
>
<el-input
v-model=
"queryParams.usageName"
placeholder=
"请输入用途名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
:data=
"usageList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"200"
align=
"center"
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedusageId"
:label=
"scope.row.usageId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
<el-table-column
label=
"用途编码"
width=
"200"
prop=
"usageCode"
>
</el-table-column>
<el-table-column
label=
"用途名称"
width=
"100"
align=
"center"
prop=
"usageName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"备注"
width=
"400"
align=
"center"
prop=
"remark"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.mes_usage_sourcetype"
:value=
"scope.row.orderSource"
/>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"confirmSelect"
>
确 定
</el-button>
<el-button
@
click=
"showFlag = false"
>
取 消
</el-button>
</div>
</el-dialog>
</template>
<
script
>
import
{
listUsage
}
from
"@/api/mes/pro/usage"
;
export
default
{
name
:
"UsageSelectSingle"
,
components
:
{},
dicts
:
[
"mes_order_status"
,
"mes_workorder_sourcetype"
],
// props:{
// workorder: {
// type: Object,
// default: function(){
// return {'workorderType': 'SELF'}
// }} //外部传入的用途过滤信息
// },
data
()
{
return
{
showFlag
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
selectedUsageId
:
undefined
,
selectedRows
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产用途表格数据
usageList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
usageCode
:
null
,
usageName
:
null
,
},
// 列信息
columns
:
[
{
key
:
0
,
label
:
`用途编码`
,
visible
:
true
},
{
key
:
1
,
label
:
`用途名称`
,
visible
:
true
},
{
key
:
2
,
label
:
`备注`
,
visible
:
true
},
],
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询生产用途列表 */
getList
()
{
this
.
loading
=
true
;
listUsage
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
usageList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
handleCurrent
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
// 单选选中数据
handleRowChange
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
//双击选中
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
},
//确定选中
confirmSelect
()
{
if
(
this
.
selectedUsageId
==
null
||
this
.
selectedUsageId
==
0
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
message
:
"请至少选择一条数据!"
,
});
return
;
}
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
},
},
};
</
script
>
src/components/workstationSelect/simpletableSingle.vue
View file @
214a0b6d
<
template
>
<el-dialog
title=
"工作站选择"
<el-dialog
title=
"工作站选择"
v-if=
"showFlag"
:visible
.
sync=
"showFlag"
:modal=
false
:modal=
"false"
width=
"80%"
center
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"90px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"90px"
>
<el-row>
<el-col
:span=
"7"
>
<el-form-item
label=
"工作站编号"
prop=
"workstationCode"
>
<el-form-item
label=
"工作站编号"
label-width=
"120"
prop=
"workstationCode"
>
<el-input
v-model=
"queryParams.workstationCode"
placeholder=
"请输入工作站编号"
...
...
@@ -19,20 +31,23 @@
</el-form-item>
</el-col>
<el-col
:span=
"7"
>
<el-form-item
label=
"所属工序"
prop=
"process
Name
"
>
<el-form-item
label=
"所属工序"
prop=
"process
Id
"
>
<el-select
v-model=
"queryParams.processId"
placeholder=
"请选择工序"
>
<el-option
v-for=
"item in processOptions"
:key=
"item.processId"
:label=
"item.processName"
:value=
"item.processId"
></el-option>
</el-select>
<el-option
v-for=
"item in processOptions"
:key=
"item.processId"
:label=
"item.processName"
:value=
"item.processId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"7"
>
<el-form-item
label=
"所在车间"
prop=
"workshopName"
>
<el-select
v-model=
"queryParams.workshopId"
placeholder=
"请选择车间"
>
<el-select
v-model=
"queryParams.workshopId"
placeholder=
"请选择车间"
>
<el-option
v-for=
"item in workshopOptions"
:key=
"item.workshopId"
...
...
@@ -44,56 +59,93 @@
</el-col>
<el-col
:span=
"3"
>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
</el-col>
<el-col
:span=
"24"
>
</el-col>
</el-row>
</el-form>
<el-table
v-loading=
"loading"
:data=
"workstationList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"55"
align=
"center"
>
<el-table
v-loading=
"loading"
:data=
"workstationList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"55"
align=
"center"
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedWorkstationId"
:label=
"scope.row.workstationId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio>
<el-radio
v-model=
"selectedWorkstationId"
:label=
"scope.row.workstationId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
<el-table-column
label=
"工作站编号"
align=
"center"
prop=
"workstationCode"
>
<el-table-column
label=
"工作站编号"
align=
"center"
prop=
"workstationCode"
>
</el-table-column>
<el-table-column
label=
"工作站名称"
align=
"center"
prop=
"workstationName"
/>
<el-table-column
label=
"工作站地点"
align=
"center"
prop=
"workstationAddress"
/>
<el-table-column
label=
"所在车间名称"
align=
"center"
prop=
"workshopName"
/>
<el-table-column
label=
"工作站名称"
align=
"center"
prop=
"workstationName"
/>
<el-table-column
label=
"工作站地点"
align=
"center"
prop=
"workstationAddress"
/>
<el-table-column
label=
"所在车间名称"
align=
"center"
prop=
"workshopName"
/>
<el-table-column
label=
"所属工序"
align=
"center"
prop=
"processName"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"标准工时"
align=
"center"
prop=
"stdWorkingTime"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
</el-table>
<pagination
v-show=
"total
>
0"
v-show=
"total
>
0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"confirmSelect"
>
确 定
</el-button>
<el-button
@
click=
"showFlag=
false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"confirmSelect"
>
确 定
</el-button>
<el-button
@
click=
"showFlag =
false"
>
取 消
</el-button>
</div>
</el-dialog>
</template>
<
script
>
import
{
listWorkstation
,
getWorkstation
,
delWorkstation
,
addWorkstation
,
updateWorkstation
}
from
"@/api/mes/md/workstation"
;
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
{
listWorkstation
,
getWorkstation
,
delWorkstation
,
addWorkstation
,
updateWorkstation
,
}
from
"@/api/mes/md/workstation"
;
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
{
listAllWorkshop
}
from
"@/api/mes/md/workshop"
;
export
default
{
name
:
"WorkstationSelect"
,
dicts
:
[
'sys_yes_no'
],
dicts
:
[
"sys_yes_no"
],
data
()
{
return
{
showFlag
:
false
,
// processId: this.processId,
showFlag
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
...
...
@@ -110,9 +162,9 @@ export default {
// 工作站表格数据
workstationList
:
[],
//车间选项
workshopOptions
:[],
workshopOptions
:
[],
//工序选项
processOptions
:[],
processOptions
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
...
...
@@ -127,42 +179,56 @@ export default {
workshopId
:
null
,
workshopCode
:
null
,
workshopName
:
null
,
processId
:
this
.
processId
,
processId
:
null
,
processCode
:
null
,
processName
:
null
,
enableFlag
:
null
,
stdWorkingTime
:
null
,
},
// 表单参数
form
:
{},
};
},
props
:{
processId
:
undefined
//外部传入的工序过滤条件
props
:
{
processId
:
{
type
:
Number
|
undefined
,
default
:
undefined
,
},
//外部传入的工序过滤条件
},
created
()
{
this
.
getList
();
this
.
getWorkshops
();
this
.
getProcess
();
},
watch
:
{
processId
:
{
handler
(
val
)
{
this
.
queryParams
.
processId
=
val
;
this
.
getList
();
},
immediate
:
true
,
},
},
methods
:
{
/** 查询工作站列表 */
getList
()
{
this
.
loading
=
true
;
listWorkstation
(
this
.
queryParams
).
then
(
response
=>
{
listWorkstation
(
this
.
queryParams
).
then
((
response
)
=>
{
console
.
log
(
this
.
queryParams
);
this
.
workstationList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
//查询车间信息
getWorkshops
(){
listAllWorkshop
().
then
(
response
=>
{
getWorkshops
()
{
listAllWorkshop
().
then
(
(
response
)
=>
{
this
.
workshopOptions
=
response
.
data
;
});
},
//查询工序信息
getProcess
(){
listAllProcess
().
then
(
response
=>
{
getProcess
()
{
listAllProcess
().
then
(
(
response
)
=>
{
this
.
processOptions
=
response
.
data
;
});
},
...
...
@@ -184,12 +250,13 @@ export default {
processId
:
null
,
processCode
:
null
,
processName
:
null
,
enableFlag
:
'Y'
,
enableFlag
:
"Y"
,
remark
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
updateTime
:
null
,
stdWorkingTime
:
null
,
};
this
.
resetForm
(
"form"
);
},
...
...
@@ -203,38 +270,41 @@ export default {
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
handleCurrent
(
row
){
if
(
row
)
{
this
.
selectedRows
=
row
;
}
handleCurrent
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
// 单选选中数据
handleRowChange
(
row
)
{
if
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
//双击选中
handleRowDbClick
(
row
){
if
(
row
)
{
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
$emit
(
'onSelected'
,
this
.
selectedRows
);
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
},
//确定选中
confirmSelect
(){
if
(
this
.
selectedWorkstationId
==
null
||
this
.
selectedWorkstationId
==
0
){
this
.
$notify
({
title
:
'提示'
,
type
:
'warning'
,
message
:
'请至少选择一条数据!'
});
return
;
}
this
.
$emit
(
'onSelected'
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
}
confirmSelect
()
{
if
(
this
.
selectedWorkstationId
==
null
||
this
.
selectedWorkstationId
==
0
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
message
:
"请至少选择一条数据!"
,
});
return
;
}
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
},
},
};
</
script
>
src/views/mes/md/workstation/index.vue
View file @
214a0b6d
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"工作站编码"
prop=
"workstationCode"
>
...
...
@@ -24,7 +31,10 @@
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"所在车间名称"
prop=
"workshopName"
>
<el-select
v-model=
"queryParams.workshopId"
placeholder=
"请选择车间"
>
<el-select
v-model=
"queryParams.workshopId"
placeholder=
"请选择车间"
>
<el-option
v-for=
"item in workshopOptions"
:key=
"item.workshopId"
...
...
@@ -39,19 +49,27 @@
<el-col
:span=
"8"
>
<el-form-item
label=
"所属工序"
prop=
"processName"
>
<el-select
v-model=
"queryParams.processId"
placeholder=
"请选择工序"
>
<el-option
v-for=
"item in processOptions"
:key=
"item.processId"
:label=
"item.processName"
:value=
"item.processId"
></el-option>
</el-select>
<el-option
v-for=
"item in processOptions"
:key=
"item.processId"
:label=
"item.processName"
:value=
"item.processId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -66,7 +84,8 @@
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['mes:md:workstation:add']"
>
新增
</el-button>
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -77,7 +96,8 @@
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['mes:md:workstation:edit']"
>
修改
</el-button>
>
修改
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -88,7 +108,8 @@
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['mes:md:workstation:remove']"
>
删除
</el-button>
>
删除
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -98,33 +119,62 @@
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['mes:md:workstation:export']"
>
导出
</el-button>
>
导出
</el-button
>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"workstationList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"workstationList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"工作站编号"
align=
"center"
prop=
"workstationCode"
>
<el-table-column
label=
"工作站编号"
align=
"center"
prop=
"workstationCode"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleView(scope.row)"
v-hasPermi=
"['mes:md:workstation:query']"
>
{{
scope
.
row
.
workstationCode
}}
</el-button>
>
{{
scope
.
row
.
workstationCode
}}
</el-button
>
</
template
>
</el-table-column>
<el-table-column
label=
"工作站名称"
align=
"center"
prop=
"workstationName"
/>
<el-table-column
label=
"工作站地点"
align=
"center"
prop=
"workstationAddress"
/>
<el-table-column
label=
"所在车间名称"
align=
"center"
prop=
"workshopName"
/>
<el-table-column
label=
"工作站名称"
align=
"center"
prop=
"workstationName"
/>
<el-table-column
label=
"工作站地点"
align=
"center"
prop=
"workstationAddress"
/>
<el-table-column
label=
"所在车间名称"
align=
"center"
prop=
"workshopName"
/>
<el-table-column
label=
"所属工序"
align=
"center"
prop=
"processName"
/>
<el-table-column
label=
"是否启用"
align=
"center"
prop=
"enableFlag"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.enableFlag"
/>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.enableFlag"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"标准工时"
align=
"center"
prop=
"stdWorkingTime"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -132,20 +182,22 @@
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['mes:md:workstation:edit']"
>
修改
</el-button>
>
修改
</el-button
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['mes:md:workstation:remove']"
>
删除
</el-button>
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total
>
0"
v-show=
"total
>
0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
...
...
@@ -158,40 +210,52 @@
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"工作站编号"
prop=
"workstationCode"
>
<el-input
v-model=
"form.workstationCode"
placeholder=
"请输入工作站编码"
/>
<el-input
v-model=
"form.workstationCode"
placeholder=
"请输入工作站编码"
/>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item
label-width=
"80"
>
<el-switch
v-model=
"autoGenFlag"
active-color=
"#13ce66"
active-text=
"自动生成"
@
change=
"handleAutoGenChange(autoGenFlag)"
v-if=
"optType != 'view'"
>
<el-form-item
label-width=
"80"
>
<el-switch
v-model=
"autoGenFlag"
active-color=
"#13ce66"
active-text=
"自动生成"
@
change=
"handleAutoGenChange(autoGenFlag)"
v-if=
"optType != 'view'"
>
</el-switch>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"工作站名称"
prop=
"workstationName"
>
<el-input
v-model=
"form.workstationName"
placeholder=
"请输入工作站名称"
/>
<el-input
v-model=
"form.workstationName"
placeholder=
"请输入工作站名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"工作站地点"
prop=
"workstationAddress"
>
<el-input
v-model=
"form.workstationAddress"
placeholder=
"请输入工作站地点"
/>
<el-input
v-model=
"form.workstationAddress"
placeholder=
"请输入工作站地点"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"所在车间"
prop=
"workshopId"
>
<el-select
v-model=
"form.workshopId"
placeholder=
"请选择车间"
>
<el-option
v-for=
"item in workshopOptions"
:key=
"item.workshopId"
:label=
"item.workshopName"
:value=
"item.workshopId"
></el-option>
</el-select>
<el-select
v-model=
"form.workshopId"
placeholder=
"请选择车间"
>
<el-option
v-for=
"item in workshopOptions"
:key=
"item.workshopId"
:label=
"item.workshopName"
:value=
"item.workshopId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -207,22 +271,36 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"标准工时"
prop=
"stdWorkingTime"
>
<el-input
v-model=
"form.stdWorkingTime"
placeholder=
"请输入标准工时"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"是否启用"
prop=
"enableFlag"
>
<el-radio-group
v-model=
"form.enableFlag"
disabled
v-if=
"optType=='view'"
>
<el-radio-group
v-model=
"form.enableFlag"
disabled
v-if=
"optType == 'view'"
>
<el-radio
v-for=
"dict in dict.type.sys_yes_no"
:key=
"dict.value"
:label=
"dict.value"
>
{{dict.label}}
</el-radio>
>
{{ dict.label }}
</el-radio
>
</el-radio-group>
<el-radio-group
v-model=
"form.enableFlag"
v-else
>
<el-radio
v-for=
"dict in dict.type.sys_yes_no"
:key=
"dict.value"
:label=
"dict.value"
>
{{dict.label}}
</el-radio>
>
{{ dict.label }}
</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
...
...
@@ -230,48 +308,90 @@
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider
content-position=
"center"
v-if=
"form.workstationId !=null"
>
工作站资源
</el-divider>
<MachinerySelectSingle
ref=
"machinerySelect"
@
onSelected=
"onMachineryAdd"
></MachinerySelectSingle>
<el-row
v-if=
"form.workstationId !=null"
>
<el-col
:span=
24
>
<el-divider
content-position=
"center"
v-if=
"form.workstationId != null"
>
工作站资源
</el-divider
>
<MachinerySelectSingle
ref=
"machinerySelect"
@
onSelected=
"onMachineryAdd"
></MachinerySelectSingle>
<el-row
v-if=
"form.workstationId != null"
>
<el-col
:span=
"24"
>
<el-carousel
trigger=
"click"
type=
"card"
:autoplay=
"false"
>
<el-carousel-item>
<el-card
shadow=
"always"
style=
"width:450px"
>
<el-card
shadow=
"always"
style=
"width:
450px"
>
<div
slot=
"header"
>
<span>
设备资源
</span>
<el-button
style=
"float:right; padding: 3px 0"
@
click=
"handleMachineryAdd"
v-if=
"optType !='view'"
type=
"text"
>
新增
</el-button>
<el-button
style=
"float: right; padding: 3px 0"
@
click=
"handleMachineryAdd"
v-if=
"optType != 'view'"
type=
"text"
>
新增
</el-button
>
</div>
<WorkStationMachine
ref=
"machineryList"
:optType=
"optType"
:workstationId=
"form.workstationId"
style=
"align:center"
></WorkStationMachine>
<WorkStationMachine
ref=
"machineryList"
:optType=
"optType"
:workstationId=
"form.workstationId"
style=
"align: center"
></WorkStationMachine>
</el-card>
</el-carousel-item>
<el-carousel-item>
<el-card
shadow=
"always"
style=
"width:400px"
>
<el-card
shadow=
"always"
style=
"width:
400px"
>
<div
slot=
"header"
>
<span>
人力资源
</span>
<el-button
style=
"float:right; padding: 3px 0"
@
click=
"handlePostAdd"
v-if=
"optType !='view'"
type=
"text"
>
新增
</el-button>
<el-button
style=
"float: right; padding: 3px 0"
@
click=
"handlePostAdd"
v-if=
"optType != 'view'"
type=
"text"
>
新增
</el-button
>
</div>
<Workstationworker
ref=
"postList"
:optType=
"optType"
:workstationId=
"form.workstationId"
></Workstationworker>
<Workstationworker
ref=
"postList"
:optType=
"optType"
:workstationId=
"form.workstationId"
></Workstationworker>
</el-card>
</el-carousel-item>
<el-carousel-item>
<el-card
shadow=
"always"
style=
"width:400px"
>
<el-card
shadow=
"always"
style=
"width:
400px"
>
<div
slot=
"header"
>
<span>
工装夹具
</span>
<el-button
style=
"float:right; padding: 5px 0"
@
click=
"handleToolTypeAdd"
v-if=
"optType !='view'"
type=
"text"
>
新增
</el-button>
<el-button
style=
"float: right; padding: 5px 0"
@
click=
"handleToolTypeAdd"
v-if=
"optType != 'view'"
type=
"text"
>
新增
</el-button
>
</div>
<WorkStationTool
ref=
"toolList"
:optType=
"optType"
:workstationId=
"form.workstationId"
></WorkStationTool>
<WorkStationTool
ref=
"toolList"
:optType=
"optType"
:workstationId=
"form.workstationId"
></WorkStationTool>
</el-card>
</el-carousel-item>
</el-carousel>
</el-col>
</el-row>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"cancel"
v-if=
"optType =='view'"
>
返回
</el-button>
<el-button
type=
"primary"
@
click=
"cancel"
v-if=
"optType == 'view'"
>
返回
</el-button
>
<el-button
type=
"primary"
@
click=
"submitForm"
v-else
>
保 存
</el-button>
<el-button
@
click=
"cancel"
>
关 闭
</el-button>
</div>
...
...
@@ -280,35 +400,46 @@
</template>
<
script
>
import
{
listWorkstation
,
getWorkstation
,
delWorkstation
,
addWorkstation
,
updateWorkstation
}
from
"@/api/mes/md/workstation"
;
import
{
listWorkstation
,
getWorkstation
,
delWorkstation
,
addWorkstation
,
updateWorkstation
,
}
from
"@/api/mes/md/workstation"
;
//设备资源选择与保存
import
WorkStationMachine
from
"./components/machine"
;
import
MachinerySelectSingle
from
"@/components/machinerySelect/single.vue"
;
import
{
addWorkstationmachine
}
from
"@/api/mes/md/workstationmachine"
;
import
{
addWorkstationmachine
}
from
"@/api/mes/md/workstationmachine"
;
//人力资源选择与保存
import
Workstationworker
from
"./components/worker"
;
//工装夹具资源选择与保存
import
WorkStationTool
from
"./components/tool"
;
import
{
getTreeList
}
from
"@/api/mes/wm/warehouse"
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
getTreeList
}
from
"@/api/mes/wm/warehouse"
;
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
listAllWorkshop
}
from
"@/api/mes/md/workshop"
;
export
default
{
name
:
"Workstation"
,
dicts
:
[
'sys_yes_no'
],
components
:
{
WorkStationMachine
,
MachinerySelectSingle
,
Workstationworker
,
WorkStationTool
},
dicts
:
[
"sys_yes_no"
],
components
:
{
WorkStationMachine
,
MachinerySelectSingle
,
Workstationworker
,
WorkStationTool
,
},
data
()
{
return
{
//自动生成编码
autoGenFlag
:
false
,
autoGenFlag
:
false
,
optType
:
undefined
,
warehouseInfo
:[],
warehouseOptions
:[],
warehouseProps
:{
warehouseInfo
:
[],
warehouseOptions
:
[],
warehouseProps
:
{
multiple
:
false
,
value
:
'pId'
,
label
:
'pName'
,
value
:
"pId"
,
label
:
"pName"
,
},
// 遮罩层
loading
:
true
,
...
...
@@ -325,9 +456,9 @@ export default {
// 工作站表格数据
workstationList
:
[],
//车间选项
workshopOptions
:[],
workshopOptions
:
[],
//工序选项
processOptions
:[],
processOptions
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
...
...
@@ -349,27 +480,31 @@ export default {
locationId
:
null
,
areaId
:
null
,
enableFlag
:
null
,
stdWorkingTime
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
workstationCode
:
[
{
required
:
true
,
message
:
"工作站编号不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"工作站编号不能为空"
,
trigger
:
"blur"
}
,
],
workstationName
:
[
{
required
:
true
,
message
:
"工作站名称不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"工作站名称不能为空"
,
trigger
:
"blur"
}
,
],
enableFlag
:
[
{
required
:
true
,
message
:
"是否启用不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"是否启用不能为空"
,
trigger
:
"blur"
}
,
],
workshopId
:
[
{
required
:
true
,
message
:
"请选择所属车间"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请选择所属车间"
,
trigger
:
"blur"
}
,
],
processId
:
[
{
required
:
true
,
message
:
"请选择所属工序"
,
trigger
:
"blur"
}
]
}
{
required
:
true
,
message
:
"请选择所属工序"
,
trigger
:
"blur"
},
],
stdWorkingTime
:
[
{
required
:
true
,
message
:
"标准工时不能为空"
,
trigger
:
"blur"
},
],
},
};
},
created
()
{
...
...
@@ -382,45 +517,52 @@ export default {
/** 查询工作站列表 */
getList
()
{
this
.
loading
=
true
;
listWorkstation
(
this
.
queryParams
).
then
(
response
=>
{
listWorkstation
(
this
.
queryParams
).
then
(
(
response
)
=>
{
this
.
workstationList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
//查询车间信息
getWorkshops
(){
listAllWorkshop
().
then
(
response
=>
{
getWorkshops
()
{
listAllWorkshop
().
then
(
(
response
)
=>
{
this
.
workshopOptions
=
response
.
data
;
});
},
//查询工序信息
getProcess
(){
listAllProcess
().
then
(
response
=>
{
getProcess
()
{
listAllProcess
().
then
(
(
response
)
=>
{
this
.
processOptions
=
response
.
data
;
});
},
//获取仓库
getWarehouseList
(){
getTreeList
().
then
(
response
=>
{
getWarehouseList
()
{
getTreeList
().
then
(
(
response
)
=>
{
this
.
warehouseOptions
=
response
.
data
;
this
.
warehouseOptions
.
map
(
w
=>
{
w
.
children
.
map
(
l
=>
{
let
lstr
=
JSON
.
stringify
(
l
.
children
).
replace
(
/locationId/g
,
'lId'
).
replace
(
/areaId/g
,
'pId'
).
replace
(
/areaName/g
,
'pName'
);
l
.
children
=
JSON
.
parse
(
lstr
);
this
.
warehouseOptions
.
map
((
w
)
=>
{
w
.
children
.
map
((
l
)
=>
{
let
lstr
=
JSON
.
stringify
(
l
.
children
)
.
replace
(
/locationId/g
,
"lId"
)
.
replace
(
/areaId/g
,
"pId"
)
.
replace
(
/areaName/g
,
"pName"
);
l
.
children
=
JSON
.
parse
(
lstr
);
});
let
wstr
=
JSON
.
stringify
(
w
.
children
).
replace
(
/warehouseId/g
,
'wId'
).
replace
(
/locationId/g
,
'pId'
).
replace
(
/locationName/g
,
'pName'
);
w
.
children
=
JSON
.
parse
(
wstr
);
let
wstr
=
JSON
.
stringify
(
w
.
children
)
.
replace
(
/warehouseId/g
,
"wId"
)
.
replace
(
/locationId/g
,
"pId"
)
.
replace
(
/locationName/g
,
"pName"
);
w
.
children
=
JSON
.
parse
(
wstr
);
});
let
ostr
=
JSON
.
stringify
(
this
.
warehouseOptions
).
replace
(
/warehouseId/g
,
'pId'
).
replace
(
/warehouseName/g
,
'pName'
);
let
ostr
=
JSON
.
stringify
(
this
.
warehouseOptions
)
.
replace
(
/warehouseId/g
,
"pId"
)
.
replace
(
/warehouseName/g
,
"pName"
);
this
.
warehouseOptions
=
JSON
.
parse
(
ostr
);
});
},
//选择默认的仓库、库区、库位
handleWarehouseChanged
(
obj
){
if
(
obj
!=
null
)
{
//选择默认的仓库、库区、库位
handleWarehouseChanged
(
obj
)
{
if
(
obj
!=
null
)
{
this
.
form
.
warehouseId
=
obj
[
0
];
this
.
form
.
locationId
=
obj
[
1
];
this
.
form
.
areaId
=
obj
[
2
];
...
...
@@ -447,12 +589,12 @@ export default {
warehouseId
:
null
,
locationId
:
null
,
areaId
:
null
,
enableFlag
:
'Y'
,
enableFlag
:
"Y"
,
remark
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
updateTime
:
null
,
};
this
.
autoGenFlag
=
false
;
this
.
resetForm
(
"form"
);
...
...
@@ -464,7 +606,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
=
{
this
.
queryParams
=
{
pageNum
:
1
,
pageSize
:
10
,
workstationCode
:
null
,
...
...
@@ -486,9 +628,9 @@ export default {
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
workstationId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
this
.
ids
=
selection
.
map
(
(
item
)
=>
item
.
workstationId
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
...
...
@@ -499,11 +641,11 @@ export default {
this
.
optType
=
"add"
;
},
// 查询明细按钮操作
handleView
(
row
){
handleView
(
row
)
{
this
.
reset
();
this
.
getWorkshops
();
const
workstationId
=
row
.
workstationId
||
this
.
ids
;
getWorkstation
(
workstationId
).
then
(
response
=>
{
getWorkstation
(
workstationId
).
then
(
(
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"查看车间信息"
;
...
...
@@ -514,8 +656,8 @@ export default {
handleUpdate
(
row
)
{
this
.
reset
();
this
.
getWorkshops
();
const
workstationId
=
row
.
workstationId
||
this
.
ids
getWorkstation
(
workstationId
).
then
(
response
=>
{
const
workstationId
=
row
.
workstationId
||
this
.
ids
;
getWorkstation
(
workstationId
).
then
(
(
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改工作站"
;
...
...
@@ -524,16 +666,16 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
this
.
$refs
[
"form"
].
validate
(
(
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
workstationId
!=
null
)
{
updateWorkstation
(
this
.
form
).
then
(
response
=>
{
updateWorkstation
(
this
.
form
).
then
(
(
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addWorkstation
(
this
.
form
).
then
(
response
=>
{
addWorkstation
(
this
.
form
).
then
(
(
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
...
...
@@ -545,51 +687,59 @@ export default {
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
workstationIds
=
row
.
workstationId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除工作站?'
).
then
(
function
()
{
return
delWorkstation
(
workstationIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
this
.
$modal
.
confirm
(
"是否确认删除工作站?"
)
.
then
(
function
()
{
return
delWorkstation
(
workstationIds
);
})
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
})
.
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'mes/md/workstation/export'
,
{
...
this
.
queryParams
},
`workstation_
${
new
Date
().
getTime
()}
.xlsx`
)
this
.
download
(
"mes/md/workstation/export"
,
{
...
this
.
queryParams
,
},
`workstation_
${
new
Date
().
getTime
()}
.xlsx`
);
},
//自动生成编码
handleAutoGenChange
(
autoGenFlag
){
if
(
autoGenFlag
)
{
genCode
(
'WORKSTATION_CODE'
).
then
(
response
=>
{
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
genCode
(
"WORKSTATION_CODE"
).
then
((
response
)
=>
{
this
.
form
.
workstationCode
=
response
;
});
}
else
{
}
else
{
this
.
form
.
workstationCode
=
null
;
}
},
//设备资源选择弹出
handleMachineryAdd
(){
handleMachineryAdd
()
{
this
.
$refs
.
machinerySelect
.
showFlag
=
true
;
},
//设备资源选择回调
onMachineryAdd
(
rows
){
debugger
onMachineryAdd
(
rows
)
{
debugger
;
this
.
loading
=
true
;
rows
.
workstationId
=
this
.
form
.
workstationId
;
addWorkstationmachine
(
rows
).
then
(
response
=>
{
addWorkstationmachine
(
rows
).
then
(
(
response
)
=>
{
this
.
$refs
.
machineryList
.
getList
();
this
.
loading
=
false
;
});
},
//人力资源-岗位新增
handlePostAdd
(){
handlePostAdd
()
{
this
.
$refs
.
postList
.
handleAdd
();
},
//工装夹具资源新增
handleToolTypeAdd
(){
handleToolTypeAdd
()
{
this
.
$refs
.
toolList
.
handleAdd
();
}
}
}
,
}
,
};
</
script
>
src/views/mes/pro/bom/index.vue
0 → 100644
View file @
214a0b6d
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"BOM编码"
prop=
"bomCode"
>
<el-input
v-model=
"queryParams.bomCode"
placeholder=
"请输入BOM编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"产品名称"
prop=
"itemName"
>
<el-input
v-model=
"queryParams.itemName"
placeholder=
"请输入产品名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"用途名称"
prop=
"usageName"
>
<el-input
v-model=
"queryParams.usageName"
placeholder=
"请输入用途名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"是否启用"
prop=
"enableFlag"
>
<el-input
v-model=
"queryParams.enableFlag"
placeholder=
"请输入是否启用"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['mes:pro:bom:add']"
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['mes:pro:bom:edit']"
>
修改
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['mes:pro:bom:remove']"
>
删除
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['mes:pro:bom:export']"
>
导出
</el-button
>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"bomList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"BOM编码"
width=
"130"
align=
"center"
prop=
"bomCode"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleView(scope.row)"
v-hasPermi=
"['mes:pro:bom:query']"
>
{{
scope
.
row
.
bomCode
}}
</el-button
>
</
template
>
</el-table-column>
<el-table-column
label=
"产品名称"
fixed=
"left"
width=
"120"
align=
"center"
prop=
"itemName"
/>
<el-table-column
label=
"生产用途"
align=
"center"
prop=
"usageName"
/>
<el-table-column
label=
"基本数量"
align=
"center"
prop=
"quantity"
/>
<el-table-column
label=
"基本计量单位"
width=
"125"
align=
"center"
prop=
"unitOfMeasure"
/>
<el-table-column
label=
"是否启用"
align=
"center"
prop=
"enableFlag"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.enableFlag"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"有效期开始"
align=
"center"
prop=
"expirationDateStart"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
expirationDateStart
,
"{y
}
-{m
}
-{d
}
"
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"有效期结束"
align
=
"center"
prop
=
"expirationDateEnd"
width
=
"120"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
expirationDateEnd
,
"{y
}
-{m
}
-{d
}
"
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"ECN编码"
width
=
"120"
align
=
"center"
prop
=
"ecnCode"
/>
<
el
-
table
-
column
label
=
"单层厚"
width
=
"120"
align
=
"center"
prop
=
"singleLayerThickness"
/>
<
el
-
table
-
column
label
=
"单重"
width
=
"120"
align
=
"center"
prop
=
"singleWeight"
/>
<
el
-
table
-
column
label
=
"排版行数"
width
=
"120"
align
=
"center"
prop
=
"rowNum"
/>
<
el
-
table
-
column
label
=
"派工倍数"
width
=
"120"
align
=
"center"
prop
=
"dispatchMultiple"
/>
<
el
-
table
-
column
label
=
"是否启用"
width
=
"120"
align
=
"center"
prop
=
"enableFlag"
>
<
template
slot
-
scope
=
"scope"
>
<
dict
-
tag
:
options
=
"dict.type.sys_yes_no"
:
value
=
"scope.row.enableFlag"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"备注"
width
=
"120"
align
=
"center"
prop
=
"remark"
:
show
-
overflow
-
tooltip
=
"true"
/>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
width
=
"130"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
link
size
=
"mini"
type
=
"primary"
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['mes:pro:bom:edit']"
>
修改
<
/el-lin
k
>
<
el
-
link
style
=
"margin-left: 10px"
size
=
"mini"
type
=
"danger"
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
v
-
hasPermi
=
"['mes:pro:bom:remove']"
>
删除
<
/el-lin
k
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total > 0"
:
total
=
"total"
:
page
.
sync
=
"queryParams.pageNum"
:
limit
.
sync
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<!--
添加或修改生产
BOM
对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"960px"
append
-
to
-
body
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"100px"
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"BOM编码"
prop
=
"bomCode"
>
<
el
-
input
v
-
model
=
"form.bomCode"
placeholder
=
"请输入BOM编码"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"3"
>
<
el
-
form
-
item
label
-
width
=
"80"
>
<
el
-
switch
v
-
model
=
"autoGenFlag"
active
-
color
=
"#13ce66"
active
-
text
=
"自动生成"
@
change
=
"handleAutoGenChange(autoGenFlag)"
v
-
if
=
"optType != 'view'"
>
<
/el-switch
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"7"
>
<
el
-
form
-
item
label
=
"物料名称"
prop
=
"itemName"
>
<
el
-
input
v
-
model
=
"form.itemName"
disabled
placeholder
=
"请选择物料信息"
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"handleItemSelect"
><
/el-button
>
<
/el-input
>
<
MdItem
ref
=
"MdItem"
@
onSelected
=
"onItemSelected"
><
/MdItem
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"6"
>
<
el
-
form
-
item
label
=
"是否启用"
prop
=
"enableFlag"
>
<
el
-
radio
-
group
v
-
model
=
"form.enableFlag"
disabled
v
-
if
=
"optType == 'view'"
>
<
el
-
radio
v
-
for
=
"dict in dict.type.sys_yes_no"
:
key
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radi
o
>
<
/el-radio-group
>
<
el
-
radio
-
group
v
-
model
=
"form.enableFlag"
v
-
else
>
<
el
-
radio
v
-
for
=
"dict in dict.type.sys_yes_no"
:
key
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radi
o
>
<
/el-radio-group
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"7"
>
<
el
-
form
-
item
label
=
"用途名称"
prop
=
"usageId"
>
<
el
-
input
v
-
model
=
"form.usageName"
disabled
placeholder
=
"请选择用途"
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"handleUsageSelect()"
><
/el-button
>
<
/el-input
>
<
UsageItem
ref
=
"woSelect"
@
onSelected
=
"onUsageSelected"
><
/UsageItem
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"基本数量"
prop
=
"quantity"
>
<
el
-
input
v
-
model
=
"form.quantity"
placeholder
=
"请输入基本数量"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"基本计量单位"
prop
=
"unitOfMeasure"
>
<
el
-
input
v
-
model
=
"form.unitOfMeasure"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"有效期开始"
prop
=
"expirationDateStart"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.expirationDateStart"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择有效期开始"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"有效期结束"
prop
=
"expirationDateEnd"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.expirationDateEnd"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择有效期结束"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"ECN编码"
prop
=
"ecnCode"
>
<
el
-
input
v
-
model
=
"form.ecnCode"
placeholder
=
"请输入ECN编码"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"单层厚"
prop
=
"singleLayerThickness"
>
<
el
-
input
v
-
model
=
"form.singleLayerThickness"
placeholder
=
"请输入单层厚"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"单重"
prop
=
"singleWeight"
>
<
el
-
input
v
-
model
=
"form.singleWeight"
placeholder
=
"请输入单重"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"排版行数"
prop
=
"rowNum"
>
<
el
-
input
v
-
model
=
"form.rowNum"
placeholder
=
"请输入排版行数"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"派工倍数"
prop
=
"dispatchMultiple"
>
<
el
-
input
v
-
model
=
"form.dispatchMultiple"
placeholder
=
"请输入派工倍数"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
<
el
-
input
v
-
model
=
"form.remark"
type
=
"textarea"
placeholder
=
"请输入内容"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
/el-form
>
<
el
-
divider
content
-
position
=
"center"
v
-
if
=
"form.bomId != null"
>
组件
<
/el-divide
r
>
<
BomItem
v
-
if
=
"form.bomId != null"
:
bomId
=
"form.bomId"
:
optType
=
"optType"
><
/BomItem
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"cancel"
v
-
if
=
"optType == 'view'"
>
返回
<
/el-butto
n
>
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
v
-
else
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listBom
,
getBom
,
delBom
,
addBom
,
updateBom
}
from
"@/api/mes/pro/bom"
;
// import
{
listAllUsage
}
from
"@/api/mes/pro/usage"
;
import
BomItem
from
"./item.vue"
;
import
MdItem
from
"@/components/itemSelect/single.vue"
;
import
UsageItem
from
"@/components/usageSelect/single.vue"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
export
default
{
name
:
"Bom"
,
dicts
:
[
"sys_yes_no"
],
components
:
{
BomItem
,
MdItem
,
UsageItem
}
,
data
()
{
return
{
//自动生成编码
autoGenFlag
:
false
,
optType
:
undefined
,
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产BOM表格数据
bomList
:
[],
// 用途列表
UsageOptions
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
bomCode
:
null
,
usageId
:
null
,
itemId
:
null
,
enableFlag
:
null
,
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
bomCode
:
[
{
required
:
true
,
message
:
"BOM编码不能为空"
,
trigger
:
"blur"
}
,
],
usageName
:
[
{
required
:
true
,
message
:
"用途不能为空"
,
trigger
:
"blur"
}
,
],
itemName
:
[
{
required
:
true
,
message
:
"产品id不能为空"
,
trigger
:
"blur"
}
,
],
enableFlag
:
[
{
required
:
true
,
message
:
"是否启用不能为空"
,
trigger
:
"blur"
}
,
],
usageId
:
[{
required
:
true
,
message
:
"用途不能为空"
,
trigger
:
"blur"
}
],
}
,
}
;
}
,
created
()
{
this
.
getList
();
// this.getUsage();
}
,
methods
:
{
/** 查询生产BOM列表 */
getList
()
{
this
.
loading
=
true
;
listBom
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
bomList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
// 查询物料信息
handleItemSelect
()
{
this
.
$refs
.
MdItem
.
showFlag
=
true
;
}
,
onItemSelected
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
itemId
=
row
.
itemId
;
this
.
form
.
itemCode
=
row
.
itemCode
;
this
.
form
.
itemName
=
row
.
itemName
;
this
.
form
.
itemRemark
=
row
.
itemRemark
;
this
.
form
.
unitOfMeasure
=
row
.
unitOfMeasure
;
}
}
,
// 查询用途信息
handleUsageSelect
()
{
this
.
$refs
.
woSelect
.
showFlag
=
true
;
}
,
onUsageSelected
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
usageId
=
row
.
usageId
;
this
.
form
.
usageCode
=
row
.
usageCode
;
this
.
form
.
usageName
=
row
.
usageName
;
}
}
,
// getUsage()
{
// listAllUsage().then((response) =>
{
// this.UsageOptions = response.data;
//
}
);
//
}
,
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
}
,
// 表单重置
reset
()
{
this
.
form
=
{
bomId
:
null
,
bomCode
:
null
,
itemId
:
null
,
itemName
:
null
,
usageName
:
null
,
usageId
:
null
,
quantity
:
null
,
unitOfMeasure
:
null
,
expirationDateStart
:
null
,
expirationDateEnd
:
null
,
ecnCode
:
null
,
singleLayerThickness
:
null
,
singleWeight
:
null
,
rowNum
:
null
,
dispatchMultiple
:
null
,
enableFlag
:
"Y"
,
remark
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
}
;
this
.
autoGenFlag
=
false
;
this
.
resetForm
(
"form"
);
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
bomId
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加BOM"
;
this
.
optType
=
"add"
;
}
,
// 查询明细按钮操作
handleView
(
row
)
{
this
.
reset
();
const
bomId
=
row
.
bomId
||
this
.
ids
;
getBom
(
bomId
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"查看BOM信息"
;
this
.
optType
=
"view"
;
}
);
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
bomId
=
row
.
bomId
||
this
.
ids
;
getBom
(
bomId
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改BOM"
;
this
.
optType
=
"edit"
;
}
);
}
,
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
bomId
!=
null
)
{
updateBom
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
else
{
addBom
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
}
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
bomIds
=
row
.
bomId
||
this
.
ids
;
this
.
$modal
.
confirm
(
"是否确认删除BOM?"
)
.
then
(
function
()
{
return
delBom
(
bomIds
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/pro/bom/export"
,
{
...
this
.
queryParams
,
}
,
`bom_${new Date().getTime()
}
.xlsx`
);
}
,
//自动生成编码
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
genCode
(
"BOM_CODE"
).
then
((
response
)
=>
{
this
.
form
.
bomCode
=
response
;
}
);
}
else
{
this
.
form
.
bomCode
=
null
;
}
}
,
}
,
}
;
<
/script
>
src/views/mes/pro/bom/item.vue
0 → 100644
View file @
214a0b6d
<
template
>
<div
class=
"app-container"
>
<el-row
v-if=
"optType != 'view'"
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['mes:pro:bom:add']"
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['mes:pro:bom:edit']"
>
修改
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['mes:pro:bom:remove']"
>
删除
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['mes:pro:bom:export']"
>
导出
</el-button
>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"bomItemList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"物料名称"
fixed=
"left"
width=
"120"
align=
"center"
prop=
"itemName"
/>
<el-table-column
label=
"组件数量"
align=
"center"
prop=
"quantity"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"计量单位"
align=
"center"
prop=
"unitOfMeasure"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"报废百分比"
width=
"120"
align=
"center"
prop=
"scrapPercentage"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"是否启用"
align=
"center"
prop=
"enableFlag"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.enableFlag"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"替代组"
align=
"center"
prop=
"alternativeGroup"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"替代优先级"
width=
"120"
align=
"center"
prop=
"alternativePriorities"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"替代策略"
width=
"120"
align=
"center"
prop=
"alternativeStrategy"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"替代使用概率"
width=
"120"
align=
"center"
prop=
"alternativeProbability"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"BOM行备注"
align=
"center"
width=
"120"
prop=
"bomItemRemark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"物料备注"
width=
"150"
align=
"center"
prop=
"itemRemark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"操作"
width=
"150px"
v-if=
"optType != 'view'"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-link
size=
"mini"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['mes:pro:bom:edit']"
>
修改
</el-link
>
<el-link
size=
"mini"
style=
"margin-left: 10px"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['mes:pro:bom:remove']"
>
删除
</el-link
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改生产BOM内容对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"960px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"物料编码"
prop=
"itemCode"
>
<el-input
v-model=
"form.itemCode"
placeholder=
"请选择物料信息"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
@
click=
"handleItemSelect"
></el-button>
</el-input>
<MdItem
ref=
"woSelect"
@
onSelected=
"onItemSelected"
></MdItem>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"物料名称"
prop=
"itemName"
>
<el-input
v-model=
"form.itemName"
placeholder=
"请输入物料名称"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"组件数量"
prop=
"quantity"
>
<el-input
v-model=
"form.quantity"
placeholder=
"请输入组件数量"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"计量单位"
prop=
"unitOfMeasure"
>
<el-input
v-model=
"form.unitOfMeasure"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"报废百分比"
prop=
"scrapPercentage"
>
<el-input
v-model=
"form.scrapPercentage"
placeholder=
"请输入报废百分比"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"替代组"
prop=
"alternativeGroup"
>
<el-input
v-model=
"form.alternativeGroup"
placeholder=
"请输入替代组"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"替代优先级"
prop=
"alternativePriorities"
>
<el-input
v-model=
"form.alternativePriorities"
placeholder=
"请输入替代优先级"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"替代策略"
prop=
"alternativeStrategy"
>
<el-input
v-model=
"form.alternativeStrategy"
placeholder=
"请输入替代策略"
/>
</el-form-item>
</el-col>
<el-col
:span=
"6"
>
<el-form-item
label=
"替代使用概率"
prop=
"alternativeProbability"
>
<el-input
v-model=
"form.alternativeProbability"
placeholder=
"请输入替代使用概率"
/>
</el-form-item>
</el-col>
<el-col
:span=
"6"
>
<el-form-item
label=
"是否启用"
prop=
"enableFlag"
>
<el-radio-group
v-model=
"form.enableFlag"
disabled
v-if=
"optType == 'view'"
>
<el-radio
v-for=
"dict in dict.type.sys_yes_no"
:key=
"dict.value"
:label=
"dict.value"
>
{{ dict.label }}
</el-radio
>
</el-radio-group>
<el-radio-group
v-model=
"form.enableFlag"
v-else
>
<el-radio
v-for=
"dict in dict.type.sys_yes_no"
:key=
"dict.value"
:label=
"dict.value"
>
{{ dict.label }}
</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"BOM行备注"
prop=
"bomItemRemark"
>
<el-input
v-model=
"form.bomItemRemark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"物料备注"
prop=
"itemRemark"
>
<el-input
v-model=
"form.itemRemark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listBomItem
,
getBomItem
,
delBomItem
,
addBomItem
,
updateBomItem
,
}
from
"@/api/mes/pro/bomItem"
;
import
MdItem
from
"@/components/itemSelect/single.vue"
;
import
{
listMdItem
}
from
"@/api/mes/md/mdItem"
;
export
default
{
name
:
"BomItem"
,
dicts
:
[
"sys_yes_no"
],
components
:
{
MdItem
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产BOM内容表格数据
bomItemList
:
[],
// 物料选项
itemOptions
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
bomId
:
this
.
bomId
,
itemId
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
// bomId: [{ required: true, message: "BOM不能为空", trigger: "blur" }],
},
};
},
props
:
{
bomId
:
undefined
,
optType
:
undefined
,
},
created
()
{
this
.
getList
();
// this.getMdItem();
},
methods
:
{
/** 查询生产BOM内容列表 */
getList
()
{
this
.
loading
=
true
;
listBomItem
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
bomItemList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 查询物料信息
getMdItem
()
{
listMdItem
().
then
((
response
)
=>
{
this
.
itemOptions
=
response
.
data
;
});
},
handleItemSelect
()
{
this
.
$refs
.
woSelect
.
showFlag
=
true
;
},
onItemSelected
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
itemId
=
row
.
itemId
;
this
.
form
.
itemCode
=
row
.
itemCode
;
this
.
form
.
itemName
=
row
.
itemName
;
this
.
form
.
itemRemark
=
row
.
itemRemark
;
this
.
form
.
unitOfMeasure
=
row
.
unitOfMeasure
;
}
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
bomItemId
:
null
,
bomId
:
null
,
itemId
:
null
,
itemName
:
null
,
quantity
:
null
,
unitOfMeasure
:
null
,
scrapPercentage
:
null
,
alternativeGroup
:
null
,
alternativePriorities
:
null
,
alternativeStrategy
:
null
,
alternativeProbability
:
null
,
bomItemRemark
:
null
,
itemRemark
:
null
,
enableFlag
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
((
item
)
=>
item
.
bomItemId
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加操作步骤"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
bomItemId
=
row
.
bomItemId
||
this
.
ids
;
getBomItem
(
bomItemId
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改操作步骤"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
bomItemId
!=
null
)
{
updateBomItem
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
const
params
=
{
...
this
.
form
,
bomId
:
this
.
bomId
,
};
addBomItem
(
params
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
bomItemIds
=
row
.
bomItemId
||
this
.
ids
;
this
.
$modal
.
confirm
(
"是否确认删除操作步骤?"
)
.
then
(
function
()
{
return
delBomItem
(
bomItemIds
);
})
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
})
.
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/pro/bomItem/export"
,
{
...
this
.
queryParams
,
},
`bomItem_
${
new
Date
().
getTime
()}
.xlsx`
);
},
},
};
</
script
>
src/views/mes/pro/process/content.vue
View file @
214a0b6d
<
template
>
<div
class=
"app-container"
>
<el-row
v-if=
"optType !='view'"
:gutter=
"10"
class=
"mb8"
>
<el-row
v-if=
"optType !=
'view'"
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
...
...
@@ -9,7 +9,8 @@
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['mes:pro:process:add']"
>
新增
</el-button>
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -20,7 +21,8 @@
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['mes:pro:process:edit']"
>
修改
</el-button>
>
修改
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -31,7 +33,8 @@
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['mes:pro:process:remove']"
>
删除
</el-button>
>
删除
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -41,19 +44,54 @@
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['mes:pro:process:export']"
>
导出
</el-button>
>
导出
</el-button
>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"processcontentList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"processcontentList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"顺序编号"
align=
"center"
prop=
"orderNum"
/>
<el-table-column
label=
"步骤说明"
width=
"400px"
align=
"center"
prop=
"contentText"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"辅助设备"
align=
"center"
prop=
"device"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"辅助材料"
align=
"center"
prop=
"material"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"操作"
width=
"100px"
v-if=
"optType !='view'"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"步骤说明"
width=
"400px"
align=
"center"
prop=
"contentText"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"辅助设备"
align=
"center"
prop=
"device"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"辅助材料"
align=
"center"
prop=
"material"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"操作"
width=
"100px"
v-if=
"optType != 'view'"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -61,20 +99,22 @@
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['mes:pro:process:edit']"
>
修改
</el-button>
>
修改
</el-button
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['mes:pro:process:remove']"
>
删除
</el-button>
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total
>
0"
v-show=
"total
>
0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
...
...
@@ -84,43 +124,55 @@
<!-- 添加或修改生产工序内容对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"960px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-row
>
<el-col
:span=
"12"
>
<el-form-item
label=
"顺序编号"
prop=
"orderNum"
>
<el-input-number
:min=
"1"
v-model=
"form.orderNum"
placeholder=
"请输入顺序编号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"材料URL"
prop=
"docUrl"
>
<el-input
v-model=
"form.docUrl"
placeholder=
"请输入材料URL"
/>
</el-form-item>
</el-col>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"顺序编号"
prop=
"orderNum"
>
<el-input-number
:min=
"1"
v-model=
"form.orderNum"
placeholder=
"请输入顺序编号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"材料URL"
prop=
"docUrl"
>
<el-input
v-model=
"form.docUrl"
placeholder=
"请输入材料URL"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"辅助设备"
prop=
"device"
>
<el-input
v-model=
"form.device"
placeholder=
"请输入辅助设备"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"辅助材料"
prop=
"material"
>
<el-input
v-model=
"form.material"
placeholder=
"请输入辅助材料"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"辅助设备"
prop=
"device"
>
<el-input
v-model=
"form.device"
placeholder=
"请输入辅助设备"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"辅助材料"
prop=
"material"
>
<el-input
v-model=
"form.material"
placeholder=
"请输入辅助材料"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"步骤说明"
prop=
"contentText"
>
<el-input
v-model=
"form.contentText"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"步骤说明"
prop=
"contentText"
>
<el-input
v-model=
"form.contentText"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -132,7 +184,13 @@
</template>
<
script
>
import
{
listProcesscontent
,
getProcesscontent
,
delProcesscontent
,
addProcesscontent
,
updateProcesscontent
}
from
"@/api/mes/pro/processcontent"
;
import
{
listProcesscontent
,
getProcesscontent
,
delProcesscontent
,
addProcesscontent
,
updateProcesscontent
,
}
from
"@/api/mes/pro/processcontent"
;
export
default
{
name
:
"Processcontent"
,
...
...
@@ -172,14 +230,14 @@ export default {
// 表单校验
rules
:
{
processId
:
[
{
required
:
true
,
message
:
"工序不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"工序不能为空"
,
trigger
:
"blur"
}
,
],
}
}
,
};
},
props
:
{
processId
:
undefined
,
optType
:
undefined
props
:
{
processId
:
undefined
,
optType
:
undefined
,
},
created
()
{
this
.
getList
();
...
...
@@ -188,7 +246,7 @@ export default {
/** 查询生产工序内容列表 */
getList
()
{
this
.
loading
=
true
;
listProcesscontent
(
this
.
queryParams
).
then
(
response
=>
{
listProcesscontent
(
this
.
queryParams
).
then
(
(
response
)
=>
{
this
.
processcontentList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
...
...
@@ -213,7 +271,7 @@ export default {
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
updateTime
:
null
,
};
this
.
resetForm
(
"form"
);
},
...
...
@@ -229,9 +287,9 @@ export default {
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
contentId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
this
.
ids
=
selection
.
map
(
(
item
)
=>
item
.
contentId
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
},
/** 新增按钮操作 */
handleAdd
()
{
...
...
@@ -242,8 +300,8 @@ export default {
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
contentId
=
row
.
contentId
||
this
.
ids
getProcesscontent
(
contentId
).
then
(
response
=>
{
const
contentId
=
row
.
contentId
||
this
.
ids
;
getProcesscontent
(
contentId
).
then
(
(
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改操作步骤"
;
...
...
@@ -251,16 +309,16 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
this
.
$refs
[
"form"
].
validate
(
(
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
contentId
!=
null
)
{
updateProcesscontent
(
this
.
form
).
then
(
response
=>
{
updateProcesscontent
(
this
.
form
).
then
(
(
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addProcesscontent
(
this
.
form
).
then
(
response
=>
{
addProcesscontent
(
this
.
form
).
then
(
(
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
...
...
@@ -272,19 +330,27 @@ export default {
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
contentIds
=
row
.
contentId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除操作步骤?'
).
then
(
function
()
{
return
delProcesscontent
(
contentIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
this
.
$modal
.
confirm
(
"是否确认删除操作步骤?"
)
.
then
(
function
()
{
return
delProcesscontent
(
contentIds
);
})
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
})
.
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'mes/pro/processcontent/export'
,
{
...
this
.
queryParams
},
`processcontent_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
this
.
download
(
"mes/pro/processcontent/export"
,
{
...
this
.
queryParams
,
},
`processcontent_
${
new
Date
().
getTime
()}
.xlsx`
);
},
},
};
</
script
>
src/views/mes/pro/proroute/routeprocess.vue
View file @
214a0b6d
...
...
@@ -93,17 +93,17 @@
/>
<!-- 添加或修改工艺组成对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"1100px"
append-to-body
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"1100px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-row>
<el-col
:span=
"
12
"
>
<el-form-item
label=
"序号"
prop=
"orderNum"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"序号"
width=
"120px"
prop=
"orderNum"
>
<el-input-number
:min=
"1"
v-model=
"form.orderNum"
placeholder=
"请输入序号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"
12
"
>
<el-col
:span=
"
8
"
>
<el-form-item
label=
"工序"
prop=
"processId"
>
<el-select
v-model=
"form.processId"
placeholder=
"请选择工序"
>
<el-select
v-model=
"form.processId"
placeholder=
"请选择工序"
@
change=
"changeProcessId"
>
<el-option
v-for=
"item in processOptions"
:key=
"item.processId"
...
...
@@ -113,9 +113,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"与下一道工序关系"
prop=
"linkType"
>
<el-tooltip
effect=
"dark"
placement=
"right"
>
<div
slot=
"content"
>
...
...
@@ -140,12 +138,10 @@
<el-color-picker
v-model=
"form.colorCode"
></el-color-picker>
</el-form-item>
</el-col>
<el-col
:span=
"
7
"
>
<el-input
v-model=
"form.colorCode"
maxlength=
"7"
placeholder=
"请输入颜色编码在左侧选择颜色"
/>
<el-col
:span=
"
2
"
>
<el-input
v-model=
"form.colorCode"
style=
"left: 5px"
maxlength=
"7"
placeholder=
"请输入颜色编码在左侧选择颜色"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-col
:span=
"7"
>
<el-form-item
label=
"是否关键工序"
prop=
"keyFlag"
>
<el-tooltip
effect=
"dark"
placement=
"right"
>
<div
slot=
"content"
>
...
...
@@ -163,7 +159,7 @@
</el-tooltip>
</el-form-item>
</el-col>
<el-col
:span=
"
8
"
>
<el-col
:span=
"
10
"
>
<el-form-item
label=
"是否需要质检确认"
prop=
"isCheck"
>
<el-tooltip
effect=
"dark"
placement=
"right"
>
<div
slot=
"content"
>
...
...
@@ -181,8 +177,6 @@
</el-tooltip>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"准备时间"
prop=
"defaultPreTime"
>
<el-tooltip
effect=
"dark"
content=
"当前系统支持的最小时间粒度为1小时"
placement=
"right"
>
...
...
@@ -195,8 +189,27 @@
<el-input-number
:min=
"0"
:step=
"1"
v-model=
"form.defaultSufTime"
placeholder=
"请输入等待时间"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"工作站"
prop=
"workstationId"
>
<el-input
v-model=
"form.workstationName"
disabled
placeholder=
"请选择工作站信息"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
@
click=
"handleWorkstationSelect"
></el-button>
</el-input>
<WorkstationSelect
ref=
"WorkstationSelect"
:processId=
"form.processId"
@
onSelected=
"onWorkstationSelected"
></WorkstationSelect>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"标准工时"
prop=
"stdWorkingTime"
>
<el-input-number
:min=
"0"
:step=
"0.1"
v-model=
"form.stdWorkingTime"
placeholder=
"请输入标准工时"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
...
...
@@ -216,9 +229,12 @@
<
script
>
import
{
listRouteprocess
,
getRouteprocess
,
delRouteprocess
,
addRouteprocess
,
updateRouteprocess
}
from
"@/api/mes/pro/routeprocess"
;
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
WorkstationSelect
from
"@/components/workstationSelect/simpletableSingle.vue"
;
import
{
log
}
from
'three'
;
export
default
{
name
:
"Routeprocess"
,
dicts
:
[
'mes_link_type'
,
'sys_yes_no'
],
components
:
{
WorkstationSelect
},
data
()
{
return
{
// 遮罩层
...
...
@@ -276,6 +292,9 @@ export default {
],
isCheck
:
[
{
required
:
true
,
message
:
"请指定当前工序是否需要质检确认"
,
trigger
:
"blur"
}
],
workstationId
:
[
{
required
:
true
,
message
:
"请选择工作站"
,
trigger
:
"blur"
}
]
}
};
...
...
@@ -301,9 +320,22 @@ export default {
//查询工序信息
getProcess
(){
listAllProcess
().
then
(
response
=>
{
console
.
log
(
response
.
data
)
this
.
processOptions
=
response
.
data
;
console
.
log
(
this
.
processOptions
.
processId
)
});
},
// 查询工作站信息
handleWorkstationSelect
()
{
this
.
$refs
.
WorkstationSelect
.
showFlag
=
true
;
},
onWorkstationSelected
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
workstationId
=
row
.
workstationId
;
this
.
form
.
workstationName
=
row
.
workstationName
;
this
.
form
.
stdWorkingTime
=
row
.
stdWorkingTime
;
}
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
...
...
@@ -327,14 +359,13 @@ export default {
defaultSufTime
:
0
,
colorCode
:
'#00AEF3'
,
remark
:
null
,
attr1
:
null
,
attr2
:
null
,
attr3
:
null
,
attr4
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
updateTime
:
null
,
workstationId
:
null
,
workstationName
:
null
,
stdWorkingTime
:
null
};
this
.
resetForm
(
"form"
);
},
...
...
@@ -389,6 +420,23 @@ export default {
}
}
});
},
// 工序改变
changeProcessId
(){
this
.
form
.
workstationId
=
''
this
.
form
.
workstationName
=
''
this
.
form
.
stdWorkingTime
=
''
// watch:{
// processId(newValue){
// alert("工序发生改变,请重新选择工作站");
// this.form={
// workstationId : null,
// workstationName: null,
// stdWorkingTime: null
// }
// }
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
...
...
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