Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pda-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
pda
pda-ui
Commits
8d838949
Commit
8d838949
authored
Feb 18, 2024
by
何远江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加工装夹具领用单新增修改功能
parent
67c2ea8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
322 additions
and
253 deletions
+322
-253
tmToolRequestUse.js
src/api/mes/tm/tmToolRequestUse.js
+9
-0
single.vue
src/components/toolRequest/single.vue
+25
-20
index.vue
src/views/mes/tm/toolrequestuse/index.vue
+288
-233
No files found.
src/api/mes/tm/tmToolRequestUse.js
View file @
8d838949
...
...
@@ -17,6 +17,15 @@ export function getTmToolRequestUse(toolRequestUseId) {
})
}
// 通过申请单id查询申请单刀模板数据
export
function
getTmToolRequestList
(
toolRequestId
)
{
return
request
({
url
:
'tm/tmToolRequestUse/getToolsBytoolRequestId/'
+
toolRequestId
,
method
:
'get'
})
}
// 新增刀模板领用单
export
function
addTmToolRequestUse
(
data
)
{
return
request
({
...
...
src/components/toolRequest/single.vue
View file @
8d838949
...
...
@@ -18,22 +18,24 @@
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"作业单元"
prop=
"workunitName"
>
<el-input
v-model=
"queryParams.workunitName"
placeholder=
"请输入作业单元"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"申请时间"
prop=
"requestDate"
>
<el-date-picker
clearable
v-model=
"queryParams.requestDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择申请时间"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"作业单元"
prop=
"workunitName"
>
<el-input
v-model=
"queryParams.workunitName"
placeholder=
"请输入作业单元"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"申请时间"
prop=
"requestDate"
>
<el-date-picker
clearable
v-model=
"queryParams.requestDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择申请时间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
...
...
@@ -144,7 +146,7 @@
</template>
<
script
>
import
{
listTmToolRequest
Use
}
from
"@/api/mes/tm/tmToolRequestUse
"
;
import
{
listTmToolRequest
}
from
"@/api/mes/tm/tmToolRequest
"
;
export
default
{
name
:
"TmRequestSelectSingle"
,
components
:
{},
...
...
@@ -152,7 +154,7 @@ export default {
return
{
showFlag
:
false
,
// 选中数组
selected
Brand
Id
:
undefined
,
selected
ToolRequest
Id
:
undefined
,
selectedRows
:
[],
// 非单个禁用
single
:
true
,
...
...
@@ -213,7 +215,7 @@ export default {
/** 查询品牌列表 */
getList
()
{
this
.
loading
=
true
;
listTmToolRequest
Use
(
this
.
queryParams
).
then
((
response
)
=>
{
listTmToolRequest
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
toolRequestList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
...
...
@@ -249,7 +251,10 @@ export default {
},
//确定选中
confirmSelect
()
{
if
(
this
.
selectedToolRequestId
==
null
||
this
.
selectedToolRequestId
==
0
)
{
if
(
this
.
selectedToolRequestId
==
null
||
this
.
selectedToolRequestId
==
0
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
...
...
src/views/mes/tm/toolrequestuse/index.vue
View file @
8d838949
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<!--
<el-form-item
label=
"领用单编码"
prop=
"toolRequestUseCode"
>
<el-input
v-model=
"queryParams.toolRequestUseCode"
placeholder=
"请输入领用单编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"申请单id"
prop=
"toolRequestId"
>
<el-input
v-model=
"queryParams.toolRequestId"
placeholder=
"请输入申请单id"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"工序id"
prop=
"processId"
>
<el-input
v-model=
"queryParams.processId"
placeholder=
"请输入工序id"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
-->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"作业单元"
prop=
"workunitName"
>
<el-input
v-model=
"queryParams.workunitName"
...
...
@@ -34,56 +17,26 @@
/>
</el-form-item>
<el-form-item
label=
"申请时间"
prop=
"requestDate"
>
<el-date-picker
clearable
<el-date-picker
clearable
v-model=
"queryParams.requestDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择申请时间"
>
placeholder=
"请选择申请时间"
>
</el-date-picker>
</el-form-item>
<!--
<el-form-item
label=
"预计开始时间"
prop=
"startTime"
>
<el-date-picker
clearable
v-model=
"queryParams.startTime"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择预计开始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"预计结束时间"
prop=
"endTime"
>
<el-date-picker
clearable
v-model=
"queryParams.endTime"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择预计结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"申请数量"
prop=
"requestNum"
>
<el-input
v-model=
"queryParams.requestNum"
placeholder=
"请输入申请数量"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"物品存放位置"
prop=
"location"
>
<el-input
v-model=
"queryParams.location"
placeholder=
"请输入物品存放位置"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"编排单号"
prop=
"arrangeCode"
>
<el-input
v-model=
"queryParams.arrangeCode"
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-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>
...
...
@@ -96,7 +49,8 @@
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['tm:tmToolRequestUse:add']"
>
新增
</el-button>
>
新增
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -107,7 +61,8 @@
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['tm:tmToolRequestUse:edit']"
>
修改
</el-button>
>
修改
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -118,7 +73,8 @@
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['tm:tmToolRequestUse:remove']"
>
删除
</el-button>
>
删除
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -128,35 +84,70 @@
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['tm:tmToolRequestUse: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=
"tmToolRequestUseList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"tmToolRequestUseList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"领用单编码"
align=
"center"
prop=
"toolRequestUseCode"
/>
<el-table-column
label=
"申请单编码"
align=
"center"
prop=
"toolRequestCode"
/>
<el-table-column
label=
"领用单编码"
align=
"center"
prop=
"toolRequestUseCode"
/>
<el-table-column
label=
"申请单编码"
align=
"center"
prop=
"toolRequestCode"
/>
<el-table-column
label=
"工序"
align=
"center"
prop=
"processName"
/>
<el-table-column
label=
"作业单元"
align=
"center"
prop=
"workunitName"
/>
<el-table-column
label=
"申请时间"
align=
"center"
prop=
"requestDate"
width=
"180"
>
<el-table-column
label=
"申请时间"
align=
"center"
prop=
"requestDate"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
requestDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<span>
{{
parseTime
(
scope
.
row
.
requestDate
,
"{y
}
-{m
}
-{d
}
"
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"预计开始时间"
align
=
"center"
prop
=
"startTime"
width
=
"180"
>
<
el
-
table
-
column
label
=
"预计开始时间"
align
=
"center"
prop
=
"startTime"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
startTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
span
>
{{
parseTime
(
scope
.
row
.
startTime
,
"{y
}
-{m
}
-{d
}
"
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"预计结束时间"
align
=
"center"
prop
=
"endTime"
width
=
"180"
>
<
el
-
table
-
column
label
=
"预计结束时间"
align
=
"center"
prop
=
"endTime"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
endTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
span
>
{{
parseTime
(
scope
.
row
.
endTime
,
"{y
}
-{m
}
-{d
}
"
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"申请数量"
align
=
"center"
prop
=
"requestNum"
/>
<!--
<
el
-
table
-
column
label
=
"编排单号"
align
=
"center"
prop
=
"arrangeCode"
/>
-->
<
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"
...
...
@@ -164,20 +155,22 @@
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['tm:tmToolRequestUse:edit']"
>
修改
<
/el-button
>
>
修改
<
/el-butto
n
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
v
-
hasPermi
=
"['tm:tmToolRequestUse:remove']"
>
删除
<
/el-button
>
>
删除
<
/el-butto
n
>
<
/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"
...
...
@@ -185,103 +178,132 @@
/>
<!--
添加或修改刀模板领用单对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"1080px"
append
-
to
-
body
>
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"1080px"
append
-
to
-
body
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"100px"
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"领用单编码"
prop
=
"toolRequestUseCode"
>
<
el
-
input
v
-
model
=
"form.toolRequestUseCode"
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)"
>
<
/el-switch
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"领用单编码"
prop
=
"toolRequestUseCode"
>
<
el
-
input
readonly
v
-
model
=
"form.toolRequestUseCode"
placeholder
=
"请输入领用单编码"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"6"
>
<
el
-
form
-
item
label
=
"申请单"
prop
=
"toolRequestId"
>
<
el
-
input
v
-
model
=
"form.toolRequestCode"
readonly
=
"readonly"
>
<
el
-
button
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"申请单"
prop
=
"toolRequestId"
>
<
el
-
input
v
-
model
=
"form.toolRequestCode"
readonly
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"handleToolRequestSelect"
@
click
=
"$refs.ToolRequestSelectRef.showFlag = true"
><
/el-button
>
<
/el-input
>
<
/el-form-item
>
<
ToolRequestSelect
ref
=
"
trSelect
"
<
/el-input
>
<
/el-form-item
>
<
ToolRequestSelect
ref
=
"
ToolRequestSelectRef
"
@
onSelected
=
"onToolRequestSelected"
><
/ToolRequestSelect
>
<
/el-col
>
><
/ToolRequestSelect
>
<
/el-col
>
<
el
-
col
:
span
=
"6
"
>
<
el
-
form
-
item
label
=
"工序"
prop
=
"processId"
>
<
el
-
input
v
-
model
=
"form.processId"
placeholder
=
"请输入工序"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8
"
>
<
el
-
form
-
item
label
=
"工序"
prop
=
"processId"
>
<
el
-
input
v
-
model
=
"form.processId"
placeholder
=
"请输入工序"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"作业单元"
prop
=
"workunitId"
>
<
el
-
input
v
-
model
=
"form.workunitId"
placeholder
=
"作业单元"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"作业单元"
prop
=
"workunitId"
>
<
el
-
input
v
-
model
=
"form.workunitId"
placeholder
=
"作业单元"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"申请时间"
prop
=
"requestDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.requestDate"
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
=
"requestDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.requestDate"
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
=
"startTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.startTime"
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
=
"startTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.startTime"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择预计开始时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"预计结束时间"
prop
=
"endTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.endTime"
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
=
"endTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.endTime"
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
=
"requestNum"
>
<
el
-
input
v
-
model
=
"form.requestNum"
placeholder
=
"请输入申请数量"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"申请数量"
prop
=
"requestNum"
>
<
el
-
input
v
-
model
=
"form.requestNum"
placeholder
=
"请输入申请数量"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"编排单号"
prop
=
"arrangeCode"
>
<
el
-
input
v
-
model
=
"form.arrangeCode"
placeholder
=
"请输入编排单号"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
span
=
"8"
>
<
el
-
form
-
item
label
=
"编排单号"
prop
=
"arrangeCode"
>
<
el
-
input
v
-
model
=
"form.arrangeCode"
placeholder
=
"请输入编排单号"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
/el-form
>
<
el
-
divider
content
-
position
=
"left"
>
申请单刀模版具数据
<
/el-divider
>
<
el
-
table
:
data
=
"tmToolRequestList"
>
<
el
-
table
-
column
label
=
"itemName"
prop
=
"itemName"
/>
<
el
-
table
-
column
label
=
"allQuantity"
prop
=
"allQuantity"
/>
<
el
-
table
-
column
label
=
"tmToolList"
>
<
template
slot
-
scope
=
"{ row
}
"
>
<
el
-
select
v
-
model
=
"row.isCheck"
clearable
>
<
el
-
option
v
-
for
=
"item in row.tmToolList"
:
label
=
"item.toolName"
:
key
=
"item.toolId"
:
value
=
"item.toolId"
><
/el-option
>
<
/el-select
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
...
...
@@ -291,15 +313,22 @@
<
/template
>
<
script
>
import
{
listTmToolRequestUse
,
getTmToolRequestUse
,
delTmToolRequestUse
,
addTmToolRequestUse
,
updateTmToolRequestUse
}
from
"@/api/mes/tm/tmToolRequestUse"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
listTmToolRequestUse
,
getTmToolRequestUse
,
delTmToolRequestUse
,
addTmToolRequestUse
,
updateTmToolRequestUse
,
getTmToolRequestList
,
}
from
"@/api/mes/tm/tmToolRequestUse"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
ToolRequestSelect
from
"@/components/toolRequest/single.vue"
;
export
default
{
name
:
"TmToolRequestUse"
,
components
:
{
ToolRequestSelect
}
,
data
()
{
return
{
autoGenFlag
:
false
,
components
:
{
ToolRequestSelect
}
,
autoGenFlag
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
...
...
@@ -322,25 +351,25 @@ export default {
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
toolRequestUseCode
:
null
,
toolRequestId
:
null
,
processId
:
null
,
workunitId
:
null
,
requestDate
:
null
,
startTime
:
null
,
endTime
:
null
,
requestNum
:
null
,
location
:
null
,
arrangeCode
:
null
,
toolRequestCode
:
null
,
processName
:
null
,
workunitName
:
null
,
}
,
toolRequestUseCode
:
null
,
toolRequestId
:
null
,
processId
:
null
,
workunitId
:
null
,
requestDate
:
null
,
startTime
:
null
,
endTime
:
null
,
requestNum
:
null
,
location
:
null
,
arrangeCode
:
null
,
toolRequestCode
:
null
,
processName
:
null
,
workunitName
:
null
,
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
}
rules
:
{
}
,
tmToolRequestList
:
[],
}
;
}
,
created
()
{
...
...
@@ -350,7 +379,7 @@ export default {
/** 查询刀模板领用单列表 */
getList
()
{
this
.
loading
=
true
;
listTmToolRequestUse
(
this
.
queryParams
).
then
(
response
=>
{
listTmToolRequestUse
(
this
.
queryParams
).
then
(
(
response
)
=>
{
this
.
tmToolRequestUseList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
...
...
@@ -364,26 +393,26 @@ export default {
// 表单重置
reset
()
{
this
.
form
=
{
toolRequestUseId
:
null
,
toolRequestUseCode
:
null
,
toolRequestId
:
null
,
processId
:
null
,
workunitId
:
null
,
requestDate
:
null
,
startTime
:
null
,
endTime
:
null
,
requestNum
:
null
,
location
:
null
,
arrangeCode
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
toolRequestUseId
:
null
,
toolRequestUseCode
:
null
,
toolRequestId
:
null
,
processId
:
null
,
workunitId
:
null
,
requestDate
:
null
,
startTime
:
null
,
endTime
:
null
,
requestNum
:
null
,
location
:
null
,
arrangeCode
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
toolRequestCode
:
null
,
processName
:
null
,
workunitName
:
null
}
;
this
.
resetForm
(
"form"
);
toolRequestCode
:
null
,
processName
:
null
,
workunitName
:
null
,
}
;
this
.
tmToolRequestList
=
[]
}
,
/** 搜索按钮操作 */
handleQuery
()
{
...
...
@@ -392,43 +421,55 @@ export default {
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
toolRequestUseId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
this
.
ids
=
selection
.
map
(
(
item
)
=>
item
.
toolRequestUseId
);
this
.
single
=
selection
.
length
!==
1
;
this
.
multiple
=
!
selection
.
length
;
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加刀模板领用单"
;
this
.
handleAutoGenChange
(
true
);
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
toolRequestUseId
=
row
.
toolRequestUseId
||
this
.
ids
getTmToolRequestUse
(
toolRequestUseId
).
then
(
response
=>
{
const
toolRequestUseId
=
row
.
toolRequestUseId
||
this
.
ids
;
getTmToolRequestUse
(
toolRequestUseId
).
then
(
(
response
)
=>
{
this
.
form
=
response
.
data
;
this
.
tmToolRequestList
=
res
.
tmToolRequestUseItemList
this
.
open
=
true
;
this
.
title
=
"修改刀模板领用单"
;
}
);
}
,
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
this
.
$refs
[
"form"
].
validate
(
(
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
form
.
toolRequestUseId
!=
null
)
{
updateTmToolRequestUse
(
this
.
form
).
then
(
response
=>
{
updateTmToolRequestUse
(
this
.
form
).
then
(
(
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
else
{
addTmToolRequestUse
(
this
.
form
).
then
(
response
=>
{
const
params
=
{
...
this
.
form
,
tmToolRequestItemList
:
this
.
tmToolRequestList
.
map
((
item
)
=>
{
return
{
...
item
,
tmToolList
:
item
.
tmToolList
.
filter
((
v
)
=>
{
return
item
.
isCheck
==
v
.
toolId
;
}
),
}
;
}
),
}
;
addTmToolRequestUse
(
params
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
...
...
@@ -440,32 +481,38 @@ export default {
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
toolRequestUseIds
=
row
.
toolRequestUseId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除刀模板领用单编号为"'
+
toolRequestUseIds
+
'"的数据项?'
).
then
(
function
()
{
return
delTmToolRequestUse
(
toolRequestUseIds
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
this
.
$modal
.
confirm
(
'是否确认删除刀模板领用单编号为"'
+
toolRequestUseIds
+
'"的数据项?'
)
.
then
(
function
()
{
return
delTmToolRequestUse
(
toolRequestUseIds
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'tm/tmToolRequestUse/export'
,
{
...
this
.
queryParams
}
,
`tmToolRequestUse_${new Date().getTime()
}
.xlsx`
)
this
.
download
(
"tm/tmToolRequestUse/export"
,
{
...
this
.
queryParams
,
}
,
`tmToolRequestUse_${new Date().getTime()
}
.xlsx`
);
}
,
//自动生成编码
handleAutoGenChange
(
autoGenFlag
){
if
(
autoGenFlag
)
{
genCode
(
'TOOL_REQUEST_USE_CODE'
).
then
(
response
=>
{
//自动生成编码
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
genCode
(
"TOOL_REQUEST_USE_CODE"
).
then
((
response
)
=>
{
this
.
form
.
toolRequestUseCode
=
response
;
}
);
}
else
{
}
else
{
this
.
form
.
toolRequestUseCode
=
null
;
}
}
,
//选择申请单
handleToolRequestSelect
()
{
this
.
$refs
.
trSelect
.
showFlag
=
true
;
}
,
onToolRequestSelected
(
row
)
{
if
(
row
!=
undefined
&&
row
!=
null
)
{
...
...
@@ -478,8 +525,16 @@ export default {
this
.
form
.
endTime
=
row
.
endTime
;
this
.
form
.
requestNum
=
row
.
requestNum
;
this
.
form
.
scope
=
row
.
scope
;
this
.
queryToolList
(
row
.
toolRequestId
);
}
}
,
}
queryToolList
(
toolRequestId
)
{
getTmToolRequestList
(
toolRequestId
).
then
((
res
)
=>
{
this
.
tmToolRequestList
=
res
.
data
;
}
);
}
,
}
,
}
;
<
/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