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
b70bda47
Commit
b70bda47
authored
Mar 11, 2024
by
张海景
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:修改工装夹具领用单新增和编辑逻辑
parent
95cec0e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
221 additions
and
16 deletions
+221
-16
index.vue
src/views/mes/tm/toolrequestuse/index.vue
+34
-16
selectSn.vue
src/views/mes/tm/toolrequestuse/selectSn.vue
+187
-0
No files found.
src/views/mes/tm/toolrequestuse/index.vue
View file @
b70bda47
...
...
@@ -6,7 +6,7 @@
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"
68
px"
label-width=
"
100
px"
>
<el-form-item
label=
"作业单元"
prop=
"workunitName"
>
<el-input
...
...
@@ -305,19 +305,22 @@
<
el
-
divider
content
-
position
=
"left"
>
申请单刀模版具数据
<
/el-divider
>
<
el
-
table
:
data
=
"tmToolRequestList"
>
<
el
-
table
-
column
label
=
"物料"
prop
=
"itemName"
/>
<
el
-
table
-
column
label
=
"总数量"
prop
=
"allQuantity"
/>
<
el
-
table
-
column
label
=
"工装夹具台账"
>
<
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
>
<
el
-
table
-
column
label
=
"数量"
prop
=
"allQuantity"
/>
<
el
-
table
-
column
label
=
"预计使用寿命"
prop
=
"requestNum"
/>
<
el
-
table
-
column
label
=
"SN码"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
input
v
-
model
=
"scope.row.toolCode"
placeholder
=
"请选择关联台账信息"
disabled
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"$refs['selectSnRef'].showFlag = true, currentInfo = scope.row"
><
/el-button
>
<
/el-input
>
<
SelectSn
ref
=
"selectSnRef"
@
onSelected
=
"onSelectSn"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"剩余寿命"
prop
=
"lifeTime"
/>
<
/el-table
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
...
...
@@ -339,9 +342,10 @@ import {
}
from
"@/api/mes/tm/tmToolRequestUse"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
ToolRequestSelect
from
"@/components/toolRequest/single.vue"
;
import
SelectSn
from
"./selectSn.vue"
;
export
default
{
name
:
"TmToolRequestUse"
,
components
:
{
ToolRequestSelect
}
,
components
:
{
ToolRequestSelect
,
SelectSn
}
,
data
()
{
return
{
autoGenFlag
:
false
,
...
...
@@ -363,6 +367,7 @@ export default {
title
:
""
,
// 是否显示弹出层
open
:
false
,
currentInfo
:
{
}
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
...
...
@@ -435,6 +440,12 @@ export default {
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
onSelectSn
(
row
)
{
console
.
log
(
this
.
currentInfo
,
'rows'
)
this
.
$set
(
this
.
currentInfo
,
'isCheck'
,
row
.
toolId
)
this
.
$set
(
this
.
currentInfo
,
'toolCode'
,
row
.
toolCode
)
this
.
$set
(
this
.
currentInfo
,
'lifeTime'
,
row
.
lifeTime
)
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
handleQuery
();
...
...
@@ -459,15 +470,17 @@ export default {
getTmToolRequestUse
(
toolRequestUseId
).
then
((
response
)
=>
{
const
tmToolRequestUseItemList
=
response
.
data
.
tmToolRequestUseItemList
;
this
.
form
=
response
.
data
;
this
.
tmToolRequestList
=
response
.
data
.
tmToolRequestUseItemList
// 请求申请单
this
.
queryToolList
(
this
.
form
.
toolRequestId
,
()
=>
{
//
this.queryToolList(this.form.toolRequestId, () =>
{
this
.
tmToolRequestList
.
forEach
((
item
)
=>
{
const
flag
=
tmToolRequestUseItemList
.
find
(
(
v
)
=>
v
.
itemId
==
item
.
itemId
);
flag
&&
(
item
.
isCheck
=
flag
.
toolId
);
}
);
}
);
console
.
log
(
this
.
tmToolRequestList
,
'this.tmToolRequestList'
)
//
}
);
this
.
open
=
true
;
this
.
title
=
"修改刀模板领用单"
;
}
);
...
...
@@ -558,7 +571,12 @@ export default {
queryToolList
(
toolRequestId
,
cb
)
{
getTmToolRequestList
(
toolRequestId
).
then
((
res
)
=>
{
this
.
tmToolRequestList
=
res
.
data
;
this
.
tmToolRequestList
=
res
.
data
.
map
(
item
=>
{
return
{
...
item
,
requestNum
:
this
.
form
.
requestNum
}
}
)
cb
&&
cb
();
}
);
}
,
...
...
src/views/mes/tm/toolrequestuse/selectSn.vue
0 → 100644
View file @
b70bda47
<
template
>
<el-dialog
title=
"请选择台账信息"
v-if=
"showFlag"
:visible
.
sync=
"showFlag"
:modal=
"true"
width=
"80%"
append-to-body
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
>
<!--
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"工作单元名称"
prop=
"workunitName"
>
<el-input
v-model=
"queryParams.taskid"
placeholder=
"请输入工作单元名称"
style=
"width:220px;"
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=
"itemList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
@
row-click=
"handleRowChange"
>
<el-table-column
width=
"55"
align=
"center"
>
<template
v-slot=
"scope"
>
<!-- 可以手动的修改label的值,从而控制选择哪一项 -->
<el-radio
class=
"radio"
v-model=
"selectedItemId"
:label=
"scope.row.toolId"
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
<el-table-column
label=
"物料编码"
align=
"center"
prop=
"itemCode"
/>
<el-table-column
label=
"物料名称"
align=
"center"
prop=
"itemName"
/>
<el-table-column
label=
"SN号"
align=
"center"
prop=
"toolCode"
/>
<el-table-column
label=
"剩余寿命"
align=
"center"
prop=
"lifeTime"
/>
<!-- <el-table-column label="型号" align="center" prop="spec" /> -->
<el-table-column
label=
"物料类型"
align=
"center"
prop=
"toolTypeName"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.mes_tool_status"
:value=
"scope.row.status"
/>
</
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
{
getTmToolSnList
}
from
"@/api/mes/tm/tmToolRequestUse"
;
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
:
[
"mes_tool_status"
],
components
:
{
Treeselect
},
data
()
{
return
{
selectedItemId
:
''
,
showFlag
:
false
,
// 选中数组
ids
:
[],
selectedRows
:
{},
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 物料产品表格数据
itemList
:
null
,
// 部门树选项
itemTypeOptions
:
undefined
,
// 部门名称
itemTypeName
:
undefined
,
defaultProps
:
{
children
:
"children"
,
label
:
"label"
,
},
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
typeStr
:
'2'
,
warehouseStr
:
'1'
},
};
},
watch
:
{
// 根据名称筛选分类树
itemTypeName
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
},
created
()
{
},
mounted
()
{
this
.
getList
();
},
methods
:
{
/** 查询物料编码列表 */
getList
()
{
this
.
loading
=
true
;
getTmToolSnList
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
itemList
=
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
;
this
.
selectedItemId
=
row
.
taskId
}
},
// 单选选中数据
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
selectedItemId
=
row
.
taskId
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
},
//确定选中
confirmSelect
(){
if
(
!
this
.
selectedItemId
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
message
:
"请至少选择一条数据!"
,
});
return
;
}
console
.
log
(
this
.
selectedRows
)
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