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
1597d5dc
Commit
1597d5dc
authored
Sep 09, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车辆异常单
parent
fa9e288d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
509 additions
and
12 deletions
+509
-12
report.js
src/api/mes/qc/report.js
+15
-0
index.vue
src/views/mes/qc/abnormal/index.vue
+27
-6
index.vue
src/views/mes/qc/report/index.vue
+140
-6
single.vue
src/views/mes/qc/report/single.vue
+327
-0
No files found.
src/api/mes/qc/report.js
View file @
1597d5dc
...
@@ -9,6 +9,21 @@ export function listReport(query) {
...
@@ -9,6 +9,21 @@ export function listReport(query) {
})
})
}
}
// 获取原物料
export
function
getAllBomMaterial
(
id
,
query
)
{
return
request
({
url
:
'/qc/report/getAllBomMaterial/'
+
id
,
method
:
'get'
,
params
:
query
})
}
// 获取原工序
export
function
getAllProcess
(
id
)
{
return
request
({
url
:
'/qc/report/getAllProcess/'
+
id
,
method
:
'get'
})
}
// 查询车间异常单详细
// 查询车间异常单详细
export
function
getReport
(
abnormalReportId
)
{
export
function
getReport
(
abnormalReportId
)
{
return
request
({
return
request
({
...
...
src/views/mes/qc/abnormal/index.vue
View file @
1597d5dc
...
@@ -129,11 +129,16 @@
...
@@ -129,11 +129,16 @@
<!-- 添加或修改异常信息对话框 -->
<!-- 添加或修改异常信息对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<!-- <el-form-item label="异常类型" prop="abnormalType">
<el-form-item
label=
"异常处理人"
prop=
"userId"
>
<el-select v-model="form.abnormalType" placeholder="请选择异常类型">
<el-input
<el-option label="请选择字典生成" value="" />
v-model=
"form.nickName"
</el-select>
placeholder=
"请选择异常处理人"
</el-form-item> -->
clearable
readonly=
"readonly"
>
<el-button
slot=
"append"
@
click=
"userSelectShow"
icon=
"el-icon-search"
></el-button>
</el-input>
</el-form-item>
<el-form-item
label=
"异常类型"
prop=
"abnormalType"
>
<el-form-item
label=
"异常类型"
prop=
"abnormalType"
>
<el-select
style=
"width:100%;"
v-model=
"form.abnormalType"
placeholder=
"请选择异常类型"
>
<el-select
style=
"width:100%;"
v-model=
"form.abnormalType"
placeholder=
"请选择异常类型"
>
<el-option
<el-option
...
@@ -156,15 +161,18 @@
...
@@ -156,15 +161,18 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<UserSingleSelect
ref=
"userSelect"
@
onSelected=
"onUserSelected"
></UserSingleSelect>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listInformation
,
getInformation
,
delInformation
,
addInformation
,
updateInformation
}
from
"@/api/mes/qc/abnormal"
;
import
{
listInformation
,
getInformation
,
delInformation
,
addInformation
,
updateInformation
}
from
"@/api/mes/qc/abnormal"
;
import
UserSingleSelect
from
"@/components/userSelect/single.vue"
export
default
{
export
default
{
dicts
:
[
'pc_abnormal_type'
],
dicts
:
[
'pc_abnormal_type'
],
name
:
"Information"
,
name
:
"Information"
,
components
:{
UserSingleSelect
},
data
()
{
data
()
{
return
{
return
{
// 遮罩层
// 遮罩层
...
@@ -201,6 +209,16 @@ export default {
...
@@ -201,6 +209,16 @@ export default {
this
.
getList
();
this
.
getList
();
},
},
methods
:
{
methods
:
{
//人员选择返回
onUserSelected
(
row
){
this
.
form
.
userName
=
row
.
userName
this
.
form
.
userId
=
row
.
userId
this
.
form
.
nickName
=
row
.
nickName
},
//点击人员选择按钮
userSelectShow
(){
this
.
$refs
.
userSelect
.
showFlag
=
true
;
},
/** 查询异常信息列表 */
/** 查询异常信息列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -220,6 +238,9 @@ export default {
...
@@ -220,6 +238,9 @@ export default {
this
.
form
=
{
this
.
form
=
{
abnormalId
:
null
,
abnormalId
:
null
,
abnormalType
:
null
,
abnormalType
:
null
,
userId
:
null
,
userName
:
null
,
nickName
:
null
,
abnormalReason
:
null
,
abnormalReason
:
null
,
remark
:
null
,
remark
:
null
,
createBy
:
null
,
createBy
:
null
,
...
...
src/views/mes/qc/report/index.vue
View file @
1597d5dc
...
@@ -33,14 +33,14 @@
...
@@ -33,14 +33,14 @@
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<
!--
<el-form-item
label=
"异常时间"
prop=
"abnormalTim
e"
>
<
el-form-item
label=
"车间异常单号"
prop=
"abnormalReportCod
e"
>
<el-input
<el-input
v-model=
"queryParams.abnormal
Tim
e"
v-model=
"queryParams.abnormal
ReportCod
e"
placeholder=
"请输入
异常时间
"
placeholder=
"请输入
车间异常单号
"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
-->
</el-form-item>
<el-form-item
label=
"异常时间"
>
<el-form-item
label=
"异常时间"
>
<el-date-picker
<el-date-picker
v-model=
"daterangePurchaseDate"
v-model=
"daterangePurchaseDate"
...
@@ -122,6 +122,8 @@
...
@@ -122,6 +122,8 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"异常原因"
align=
"center"
prop=
"abnormalReason"
/>
<el-table-column
label=
"异常原因"
align=
"center"
prop=
"abnormalReason"
/>
<el-table-column
label=
"处理建议"
align=
"center"
prop=
"handlingSuggestions"
/>
<el-table-column
label=
"车间异常单号"
align=
"center"
prop=
"abnormalReportCode"
/>
<el-table-column
label=
"异常时间"
align=
"center"
prop=
"abnormalTime"
width=
"180"
>
<el-table-column
label=
"异常时间"
align=
"center"
prop=
"abnormalTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
abnormalTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<span>
{{
parseTime
(
scope
.
row
.
abnormalTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
...
@@ -146,11 +148,13 @@
...
@@ -146,11 +148,13 @@
type
=
"text"
type
=
"text"
icon
=
"el-icon-upload2"
icon
=
"el-icon-upload2"
@
click
=
"0"
@
click
=
"0"
:
disabled
=
"!scope.row.userId"
>
提交
<
/el-button
>
>
提交
<
/el-button
>
<
el
-
button
<
el
-
button
size
=
"mini"
size
=
"mini"
type
=
"text"
type
=
"text"
icon
=
"el-icon-edit"
icon
=
"el-icon-edit"
:
disabled
=
"!scope.row.userId"
@
click
=
"handleUpdate(scope.row)"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['qc:report:edit']"
v
-
hasPermi
=
"['qc:report:edit']"
>
修改
<
/el-button
>
>
修改
<
/el-button
>
...
@@ -220,6 +224,73 @@
...
@@ -220,6 +224,73 @@
<
/el-col
>
<
/el-col
>
<
/el-row
>
<
/el-row
>
<
el
-
row
v
-
if
=
"form.abnormalType === 'PROCESS'"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"原工序"
prop
=
"originalProcessId"
>
<
el
-
select
v
-
model
=
"form.originalProcessId"
placeholder
=
"请选择原工序"
filterable
@
change
=
"changeoriginalProcess"
>
<
el
-
option
v
-
for
=
"item in oldprocessOptions"
:
key
=
"item.processId"
:
label
=
"item.processName"
:
value
=
"item.processId"
><
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"新工序"
prop
=
"newProcessId"
>
<
el
-
select
v
-
model
=
"form.newProcessId"
placeholder
=
"请选择新工序"
filterable
@
change
=
"changenewProcess"
>
<
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-row
>
<
el
-
row
v
-
else
-
if
=
"form.abnormalType === 'MATERIAL'"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"原物料"
prop
=
"originalMaterialName"
>
<
el
-
input
v
-
model
=
"form.originalMaterialName"
readonly
placeholder
=
"请选择原物料"
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"$refs['oldItemSelectRef'].showFlag = true"
><
/el-button
>
<
/el-input
>
<
oldItemSelect
ref
=
"oldItemSelectRef"
:
batchNumber
=
"form.batchNumber"
@
onSelected
=
"onoldItemSelectRef"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"新物料"
prop
=
"newMaterialName"
>
<
el
-
input
v
-
model
=
"form.newMaterialName"
readonly
placeholder
=
"请选择新物料"
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"$refs['ItemSelectRef'].showFlag = true"
><
/el-button
>
<
/el-input
>
<
ItemSelect
ref
=
"ItemSelectRef"
@
onSelected
=
"onItemSelect"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
v
-
else
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
label
=
"异常描述"
prop
=
"errorDesc"
>
<
el
-
input
v
-
model
=
"form.errorDesc"
type
=
"textarea"
:
rows
=
"2"
><
/el-input
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"异常原因"
prop
=
"abnormalReason"
>
<
el
-
form
-
item
label
=
"异常原因"
prop
=
"abnormalReason"
>
...
@@ -257,10 +328,15 @@
...
@@ -257,10 +328,15 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
listReport
,
getReport
,
delReport
,
addReport
,
updateReport
,
completeReport
}
from
"@/api/mes/qc/report"
;
import
{
listReport
,
getReport
,
delReport
,
addReport
,
updateReport
,
completeReport
,
getAllProcess
}
from
"@/api/mes/qc/report"
;
import
{
listAllProcess
}
from
"@/api/mes/pro/process"
;
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
ItemSelect
from
"@/components/itemSelect/single.vue"
;
import
oldItemSelect
from
"./single.vue"
;
export
default
{
export
default
{
dicts
:
[
'qc_submit_status'
,
'pc_abnormal_type'
],
dicts
:
[
'qc_submit_status'
,
'pc_abnormal_type'
],
components
:
[
ItemSelect
,
oldItemSelect
],
name
:
"Report"
,
name
:
"Report"
,
data
()
{
data
()
{
return
{
return
{
...
@@ -278,7 +354,8 @@ export default {
...
@@ -278,7 +354,8 @@ export default {
total
:
0
,
total
:
0
,
// 车间异常单表格数据
// 车间异常单表格数据
reportList
:
[],
reportList
:
[],
processOptions
:
[],
oldprocessOptions
:
[],
daterangePurchaseDate
:
[
dayjs
().
startOf
(
'month'
).
format
(
'YYYY-MM-DD'
),
dayjs
().
endOf
(
'month'
).
format
(
'YYYY-MM-DD'
)],
daterangePurchaseDate
:
[
dayjs
().
startOf
(
'month'
).
format
(
'YYYY-MM-DD'
),
dayjs
().
endOf
(
'month'
).
format
(
'YYYY-MM-DD'
)],
// 弹出层标题
// 弹出层标题
title
:
""
,
title
:
""
,
...
@@ -292,6 +369,7 @@ export default {
...
@@ -292,6 +369,7 @@ export default {
processId
:
null
,
processId
:
null
,
processCode
:
null
,
processCode
:
null
,
processName
:
null
,
processName
:
null
,
abnormalReportCode
:
null
,
workstationId
:
null
,
workstationId
:
null
,
workstationCode
:
null
,
workstationCode
:
null
,
workstationName
:
null
,
workstationName
:
null
,
...
@@ -307,9 +385,22 @@ export default {
...
@@ -307,9 +385,22 @@ export default {
}
;
}
;
}
,
}
,
created
()
{
created
()
{
this
.
getList
();
this
.
getList
();
}
,
}
,
methods
:
{
methods
:
{
//查询工序信息
getProcess
(){
listAllProcess
().
then
(
response
=>
{
this
.
processOptions
=
response
.
data
;
}
);
}
,
//查询工序信息
getoldProcess
(){
getAllProcess
(
this
.
form
.
batchNumber
).
then
(
response
=>
{
this
.
oldprocessOptions
=
response
.
data
;
}
);
}
,
/** 查询车间异常单列表 */
/** 查询车间异常单列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -331,6 +422,34 @@ export default {
...
@@ -331,6 +422,34 @@ export default {
this
.
open
=
false
;
this
.
open
=
false
;
this
.
reset
();
this
.
reset
();
}
,
}
,
changeoriginalProcess
()
{
const
item
=
this
.
oldprocessOptions
.
find
(
v
=>
v
.
processId
===
this
.
form
.
originalProcessId
)
if
(
item
)
{
this
.
form
.
originalProcessCode
=
item
.
processCode
this
.
form
.
originalProcessName
=
item
.
processName
}
}
,
changenewProcess
()
{
const
item
=
this
.
processOptions
.
find
(
v
=>
v
.
processId
===
this
.
form
.
newProcessId
)
if
(
item
)
{
this
.
form
.
newProcessCode
=
item
.
processCode
this
.
form
.
newProcessName
=
item
.
processName
}
}
,
onItemSelect
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
newMaterialId
=
row
.
itemId
;
this
.
form
.
newMaterialName
=
row
.
itemName
;
this
.
form
.
newMaterialCode
=
row
.
itemCode
;
}
}
,
onoldItemSelectRef
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
originalMaterialId
=
row
.
itemId
;
this
.
form
.
originalMaterialName
=
row
.
itemName
;
this
.
form
.
originalMaterialCode
=
row
.
itemCode
;
}
}
,
// 表单重置
// 表单重置
reset
()
{
reset
()
{
this
.
form
=
{
this
.
form
=
{
...
@@ -340,6 +459,19 @@ export default {
...
@@ -340,6 +459,19 @@ export default {
processCode
:
null
,
processCode
:
null
,
processName
:
null
,
processName
:
null
,
workstationId
:
null
,
workstationId
:
null
,
errorDesc
:
null
,
originalMaterialId
:
null
,
originalMaterialCode
:
null
,
originalMaterialName
:
null
,
newMaterialId
:
null
,
newMaterialCode
:
null
,
newMaterialName
:
null
,
originalProcessId
:
null
,
originalProcessCode
:
null
,
originalProcessName
:
null
,
newProcessId
:
null
,
newProcessCode
:
null
,
newProcessName
:
null
,
workstationCode
:
null
,
workstationCode
:
null
,
workstationName
:
null
,
workstationName
:
null
,
abnormalType
:
null
,
abnormalType
:
null
,
...
@@ -382,6 +514,8 @@ export default {
...
@@ -382,6 +514,8 @@ export default {
getReport
(
abnormalReportId
).
then
(
response
=>
{
getReport
(
abnormalReportId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
open
=
true
;
this
.
getoldProcess
()
this
.
getProcess
()
this
.
title
=
"修改车间异常单"
;
this
.
title
=
"修改车间异常单"
;
}
);
}
);
}
,
}
,
...
...
src/views/mes/qc/report/single.vue
0 → 100644
View file @
1597d5dc
<
template
>
<el-dialog
title=
"物料产品选择"
v-if=
"showFlag"
:visible
.
sync=
"showFlag"
:modal=
"true"
width=
"80%"
append-to-body
>
<el-row
:gutter=
"20"
>
<!--分类数据-->
<el-col
:span=
"4"
:xs=
"24"
>
<div
class=
"head-container"
>
<el-input
v-model=
"itemTypeName"
placeholder=
"请输入分类名称"
clearable
size=
"small"
prefix-icon=
"el-icon-search"
style=
"margin-bottom: 20px"
/>
</div>
<div
class=
"head-container"
>
<el-tree
:data=
"itemTypeOptions"
:props=
"defaultProps"
:expand-on-click-node=
"false"
:filter-node-method=
"filterNode"
ref=
"tree"
@
node-click=
"handleNodeClick"
/>
</div>
</el-col>
<!--物料数据-->
<el-col
:span=
"20"
:xs=
"24"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"物料编码"
prop=
"itemCode"
>
<el-input
v-model=
"queryParams.itemCode"
placeholder=
"请输入物料编码"
clearable
style=
"width: 240px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"物料名称"
prop=
"itemName"
>
<el-input
v-model=
"queryParams.itemName"
placeholder=
"请输入物料名称"
clearable
style=
"width: 240px"
@
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=
"itemList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"50"
align=
"center"
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedItemId"
:label=
"scope.row.itemId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
<el-table-column
label=
"物料编码"
width=
"120"
align=
"center"
key=
"itemCode"
prop=
"itemCode"
v-if=
"columns[0].visible"
>
</el-table-column>
<el-table-column
label=
"物料名称"
min-width=
"120"
align=
"left"
key=
"itemName"
prop=
"itemName"
v-if=
"columns[1].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"规格型号"
align=
"left"
key=
"specification"
prop=
"specification"
v-if=
"columns[2].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"单位"
align=
"center"
key=
"unitOfMeasure"
prop=
"unitOfMeasure"
v-if=
"columns[3].visible"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"物料/产品"
align=
"center"
key=
"itemOrProduct"
prop=
"itemOrProduct"
v-if=
"columns[4].visible"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.mes_item_product"
:value=
"scope.row.itemOrProduct"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"所属分类"
align=
"center"
key=
"itemTypeName"
prop=
"itemTypeName"
v-if=
"columns[5].visible"
width=
"120"
/>
<el-table-column
label=
"备注"
align=
"center"
key=
"remark"
prop=
"remark"
v-if=
"columns[7].visible"
:show-overflow-tooltip=
"true"
width=
"160"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
v-if=
"columns[6].visible"
width=
"160"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</el-col>
</el-row>
<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
{
getAllBomMaterial
}
from
"@/api/mes/qc/report"
;
import
{
listAllUnitmeasure
}
from
"@/api/mes/md/unitmeasure"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
treeselect
}
from
"@/api/mes/md/itemtype"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
export
default
{
name
:
"MdItemSingle"
,
dicts
:
[
"sys_yes_no"
,
"mes_item_product"
],
props
:
[
"batchNumber"
],
components
:
{
Treeselect
},
data
()
{
return
{
showFlag
:
false
,
// 选中数组
selectedItemId
:
undefined
,
selectedRows
:
undefined
,
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 物料产品表格数据
itemList
:
null
,
// 部门树选项
itemTypeOptions
:
undefined
,
// 部门名称
itemTypeName
:
undefined
,
defaultProps
:
{
children
:
"children"
,
label
:
"label"
,
},
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
itemCode
:
undefined
,
itemName
:
undefined
,
itemTypeId
:
0
,
},
// 列信息
columns
:
[
{
key
:
0
,
label
:
`物料/产品编码`
,
visible
:
true
},
{
key
:
1
,
label
:
`物料/产品名称`
,
visible
:
true
},
{
key
:
2
,
label
:
`规格型号`
,
visible
:
true
},
{
key
:
3
,
label
:
`单位`
,
visible
:
true
},
{
key
:
4
,
label
:
`物料/产品`
,
visible
:
true
},
{
key
:
5
,
label
:
`物料分类`
,
visible
:
true
},
{
key
:
6
,
label
:
`创建时间`
,
visible
:
true
},
{
key
:
7
,
label
:
`备注`
,
visible
:
true
},
],
};
},
watch
:
{
// 根据名称筛选分类树
itemTypeName
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
},
created
()
{
this
.
getList
();
this
.
getTreeselect
();
},
methods
:
{
/** 查询物料编码列表 */
getList
()
{
this
.
loading
=
true
;
getAllBomMaterial
(
this
.
batchNumber
,
this
.
queryParams
).
then
((
response
)
=>
{
this
.
itemList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
/** 查询分类下拉树结构 */
getTreeselect
()
{
treeselect
().
then
((
response
)
=>
{
this
.
itemTypeOptions
=
response
.
data
;
});
},
// 筛选节点
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
label
.
indexOf
(
value
)
!==
-
1
;
},
// 节点单击事件
handleNodeClick
(
data
)
{
this
.
queryParams
.
itemTypeId
=
data
.
id
;
this
.
handleQuery
();
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
handleCurrent
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
},
// 单选选中数据
handleRowChange
(
row
)
{
debugger
;
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
//确定选中
confirmSelect
()
{
if
(
this
.
selectedItemId
==
null
||
this
.
selectedItemId
==
0
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
message
:
"请至少选择一条数据!"
,
});
return
;
}
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
},
},
};
</
script
>
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