Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
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
胡宝山
template_vue
Commits
cf526c0c
Commit
cf526c0c
authored
Mar 07, 2024
by
YuY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.调整设备入库页面样式;2.添加操作提示;3.添加“库存管理”按照id删除库存信息按钮
parent
f650796b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
51 deletions
+115
-51
magnagement.js
src/api/magnagement.js
+8
-0
index.vue
src/views/equipment/inventoryManagement/index.vue
+25
-2
index.vue
src/views/equipment/inventoryRecord/index.vue
+1
-0
index.vue
src/views/equipment/warehouse/index.vue
+81
-49
No files found.
src/api/magnagement.js
View file @
cf526c0c
...
...
@@ -108,6 +108,7 @@ export function add(data) {
}
})
}
// 批量添加
export
function
addBatch
(
data
)
{
return
request
({
url
:
'/wbwarehouse-test/add-test'
,
...
...
@@ -118,6 +119,13 @@ export function addBatch(data) {
}
})
}
//根据id删除库存
export
function
deleteWareHouse
(
id
)
{
return
request
({
url
:
'/wbwarehouse-test/deleteWareHouse/'
+
id
,
method
:
'delete'
})
}
// 再利用
export
function
recycle
(
data
)
{
return
request
({
...
...
src/views/equipment/inventoryManagement/index.vue
View file @
cf526c0c
...
...
@@ -81,7 +81,7 @@
<span>
{{
scope
.
row
.
updateDate
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
1
0px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
5
0px"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"mini"
@
click=
"handleDetail(scope.row)"
>
详情
...
...
@@ -92,6 +92,13 @@
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -236,7 +243,7 @@ import {
exportWarehouse
,
importExcel
,
uploadFalseFile
,
importTemplate
importTemplate
,
deleteWareHouse
}
from
'@/api/magnagement'
import
{
resetForm
}
from
'@/utils/common'
...
...
@@ -423,6 +430,22 @@ export default {
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认删除?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
res
=>
{
return
deleteWareHouse
(
id
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
getList
()
}
})
})
},
/** 导出按钮操作 */
handleExport
()
{
...
...
src/views/equipment/inventoryRecord/index.vue
View file @
cf526c0c
...
...
@@ -489,6 +489,7 @@ export default {
/** TODO:查询工序库的出入库记录列表 */
getList
()
{
this
.
loading
=
true
console
.
log
(
this
.
queryParams
)
listLog
(
this
.
queryParams
).
then
(
response
=>
{
this
.
inventoryRecordList
=
response
.
rows
this
.
total
=
response
.
total
...
...
src/views/equipment/warehouse/index.vue
View file @
cf526c0c
<
template
>
<div
class=
"app-container"
>
<div
class=
"title"
>
<span
style=
"color:#333;font-weight: 700;font-size: 16px;"
>
设备入库
</span>
<span>
设备入库
</span>
</div>
<div
class=
"form"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rule"
label-width=
"80px"
>
<el-row
:gutter=
"40"
style=
"padding-left: 8.6%;
"
>
<el-row
:gutter=
"40"
class=
"el-row
"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"pn:"
prop=
"pn"
>
<el-input
...
...
@@ -19,7 +19,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"lot:"
style=
"flex-basis: 50%;"
prop=
"lot"
>
<el-form-item
label=
"lot:"
prop=
"lot"
>
<el-input
ref=
"input2"
v-model=
"form.lot"
...
...
@@ -31,9 +31,9 @@
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"40"
style=
"padding-left: 8.6%;
"
>
<el-row
:gutter=
"40"
class=
"el-row
"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"厚度:"
style=
"flex-basis: 50%;"
prop=
"phd"
>
<el-form-item
label=
"厚度:"
prop=
"phd"
>
<el-input
ref=
"input3"
v-model=
"form.phd"
...
...
@@ -45,7 +45,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
style=
"flex-basis: 50%;"
>
<el-form-item>
<el-button
ref=
"input4"
type=
"primary"
@
click=
"handleConfirm"
>
确认
</el-button>
</el-form-item>
</el-col>
...
...
@@ -54,7 +54,7 @@
</div>
<div
class=
"table"
>
<el-table
border
:data=
"tableData"
:gutter=
"40"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50px"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50px"
/>
<el-table-column
label=
"pn"
prop=
"businessId"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
...
...
@@ -92,23 +92,23 @@
</div>
<div
class=
"form"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rule"
label-width=
"80px"
>
<el-row
style=
"padding-left: 8.6%; padding-top: 1.5%
"
>
<el-row
:gutter=
"40"
class=
"el-row pad-top
"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"位置:"
style=
"flex-basis: 50%;"
prop=
"plocation"
>
<el-form-item
label=
"位置:"
prop=
"plocation"
>
<el-input
v-model=
"form.plocation"
placeholder=
"请输入位置"
:style=
"{ width: '400px', height: '30px' }
"
class=
"input
"
:maxlength=
"100"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"寿命:"
style=
"flex-basis: 50%;"
prop=
"psm"
>
<el-form-item
label=
"寿命:"
prop=
"psm"
>
<el-input
v-model=
"form.psm"
placeholder=
"请输入寿命"
:style=
"{ width: '400px', height: '30px' }
"
class=
"input
"
:maxlength=
"9"
/>
</el-form-item>
...
...
@@ -116,9 +116,9 @@
</el-row>
</el-form>
<el-form
label-width=
"80px"
>
<el-row
style=
"padding-left: 8.6%; padding-top: 1%
"
>
<el-row
class=
"el-row pad-top
"
>
<el-col
:span=
"12"
>
<el-form-item
style=
"flex-basis: 50%;"
>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm"
>
提交
</el-button>
<el-button
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
...
...
@@ -130,7 +130,7 @@
</div>
</template>
<
script
>
import
{
addBatch
}
from
'@/api/magnagement'
import
{
addBatch
}
from
'@/api/magnagement'
export
default
{
data
()
{
...
...
@@ -147,23 +147,23 @@ export default {
},
rule
:
{
pn
:
[
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
],
lot
:
[
{
required
:
true
,
message
:
'请输入lot'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入lot'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
],
plocation
:
[
{
required
:
true
,
message
:
'请输入位置'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入位置'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
[
\u
D800-
\u
DFFF
]
+$/
,
message
:
'不能包含表情符号'
,
trigger
:
'change'
},
{
max
:
100
,
message
:
'输入长度不能超过100个字符'
,
trigger
:
'change'
}
],
psm
:
[
{
required
:
true
,
message
:
'请输入寿命'
,
trigger
:
'blur'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'请输入正整数'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入寿命'
,
trigger
:
'blur'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'请输入正整数'
,
trigger
:
'blur'
}
]
},
tableData
:
[],
...
...
@@ -178,6 +178,11 @@ export default {
sessionStorage
.
setItem
(
'inComeTableData'
,
JSON
.
stringify
(
this
.
tableData
))
next
()
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
input1
.
$refs
.
input
.
focus
()
})
},
created
()
{
sessionStorage
.
getItem
(
'inComeForm'
)
?
this
.
existForm
=
true
:
this
.
existForm
=
false
sessionStorage
.
getItem
(
'inComeTableData'
)
?
this
.
existTableData
=
true
:
this
.
existTableData
=
false
...
...
@@ -187,40 +192,47 @@ export default {
if
(
this
.
existTableData
)
{
this
.
tableData
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'inComeTableData'
))
}
},
methods
:
{
//点击提交,将库存信息加入列表
handleConfirm
()
{
this
.
flag
=
false
const
{
pn
,
lot
}
=
this
.
form
const
{
pn
,
lot
}
=
this
.
form
if
(
!
pn
&&
!
lot
)
{
this
.
$message
.
warning
(
'pn或lot不能为空'
)
return
}
//判断表单的 index 属性是否存在(是否为编辑模式)
if
(
this
.
form
.
index
!==
undefined
)
{
// 若存在 index,则调用 editRow 方法进行数据更新操作
this
.
editRow
()
}
else
{
// 若不存在 index,则调用 addRow 方法进行数据新增操作
this
.
addRow
()
}
},
//添加库存
addRow
()
{
console
.
log
(
'添加'
)
const
{
pn
,
lot
,
phd
}
=
this
.
form
const
{
pn
,
lot
,
phd
}
=
this
.
form
// 重复的下标
const
duplicateIndex
=
this
.
tableData
.
findIndex
(
item
=>
item
.
pn
===
pn
)
if
(
duplicateIndex
!==
-
1
)
{
//有重复下标
this
.
$message
.
warning
(
`与第
${
duplicateIndex
+
1
}
条pn值重复`
)
}
else
if
(
phd
%
1
!==
0
)
{
this
.
$message
.
warning
(
'厚度要为整数'
)
}
else
{
this
.
tableData
.
push
({
pn
,
lot
,
phd
})
this
.
tableData
.
push
({
pn
,
lot
,
phd
})
this
.
resetForm
()
}
},
// 编辑库存信息
editRow
()
{
cons
ole
.
log
(
'编辑'
)
const
{
pn
,
lot
,
phd
,
index
}
=
this
.
form
cons
t
{
pn
,
lot
,
phd
,
index
}
=
this
.
form
// 获取重复的下标
const
duplicateIndex
=
this
.
tableData
.
findIndex
((
item
,
i
)
=>
i
!==
index
&&
item
.
pn
===
pn
)
if
(
duplicateIndex
!==
-
1
)
{
this
.
$message
.
warning
(
`与第
${
duplicateIndex
+
1
}
条pn值重复`
)
...
...
@@ -244,7 +256,7 @@ export default {
},
handleUpdate
(
row
)
{
// 将点击的行数据填充到表单中
this
.
form
=
{
...
row
}
this
.
form
=
{
...
row
}
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
pn
===
row
.
pn
)
{
this
.
form
.
index
=
index
...
...
@@ -255,25 +267,34 @@ export default {
this
.
tableData
=
this
.
tableData
.
filter
(
item
=>
item
!==
row
)
},
submitForm
()
{
if
(
!
this
.
form
.
plocation
)
{
this
.
$message
.
warning
(
'位置不能为空!'
)
}
if
(
this
.
tableData
.
length
===
0
)
{
this
.
$message
.
warning
(
'表格数据不能为空!'
)
this
.
$message
.
warning
(
'请先确定表格数据'
)
return
}
this
.
tableData
.
forEach
(
item
=>
{
item
.
psm
=
this
.
form
.
psm
item
.
plocation
=
this
.
form
.
plocation
})
console
.
log
(
this
.
tableData
)
addBatch
(
this
.
tableData
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'添加成功'
)
this
.
tableData
=
[]
this
.
form
.
plocation
=
''
this
.
form
.
psm
=
undefined
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
tableData
.
forEach
(
item
=>
{
item
.
psm
=
this
.
form
.
psm
item
.
plocation
=
this
.
form
.
plocation
})
this
.
$confirm
(
'是否确认提交库存信息?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
addBatch
(
this
.
tableData
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
'添加成功'
)
this
.
tableData
=
[]
this
.
form
.
plocation
=
''
this
.
form
.
psm
=
undefined
}
})
})
}
})
},
resetQuery
()
{
this
.
form
=
{
...
...
@@ -303,6 +324,17 @@ export default {
align-items
:
center
;
justify-content
:
center
;
span
{
color
:
#333
;
font-weight
:
700
;
font-size
:
16px
;
}
}
.el-row
{
padding-left
:
8
.6%
;
}
.pad-top
{
padding-top
:
1
.5%
}
.form
{
...
...
@@ -313,7 +345,7 @@ export default {
}
.table
{
width
:
91
%
;
width
:
85
.7
%
;
margin-left
:
92px
;
padding-left
:
8
.6%
;
}
...
...
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