Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_pda_Web
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_pda_Web
Commits
afc415a6
Commit
afc415a6
authored
Mar 21, 2024
by
Hagsn3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改入库
parent
acfb5ddd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
435 additions
and
38 deletions
+435
-38
incomeWmsBox.js
src/api/incomeWmsBox.js
+83
-0
incomeWmsLabel.js
src/api/incomeWmsLabel.js
+75
-0
enterbound.vue
src/views/setup/enterbound.vue
+277
-38
No files found.
src/api/incomeWmsBox.js
0 → 100644
View file @
afc415a6
import
request
from
'@/utils/request'
import
Qs
from
'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询库存管理列表
export
function
listIncomeWmsBox
(
query
)
{
return
request
({
url
:
'/incomewmsbox/list'
,
method
:
'get'
,
params
:
query
})
}
// 2. 查询库存管理详细信息
export
function
getIncomeWmsBox
(
businessId
)
{
return
request
({
url
:
'/incomewmsbox/detail/'
+
businessId
,
method
:
'get'
})
}
// 3. 新增库存管理
export
function
addIncomeWmsBox
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmsbox/add'
,
method
:
'post'
,
data
:
data
})
}
// 4. 修改库存管理
export
function
updateIncomeWmsBox
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmsbox/update/'
+
businessId
,
method
:
'put'
,
data
})
}
// 5. 逻辑删除库存管理
export
function
delIncomeWmsBox
(
businessId
)
{
return
request
({
url
:
'/incomewmsbox/deleteLogical/'
+
businessId
,
method
:
'delete'
})
}
// 6. 导出库存管理
export
function
exportIncomeWmsBox
(
query
)
{
return
request
({
url
:
'/incomewmsbox/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
// 7.获取单号
export
function
getJcCode
()
{
return
request
({
url
:
'/incomewmsbox/getJcCode'
,
method
:
'get'
})
}
// 8. 查询满足条件的条数
export
function
queryPass
(
lot
)
{
return
request
({
url
:
'/incomewmsbox/queryPass/'
+
lot
,
method
:
'get'
})
}
src/api/incomeWmsLabel.js
0 → 100644
View file @
afc415a6
import
request
from
'@/utils/request'
import
Qs
from
'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询标签管理列表
export
function
listIncomeWmsLabel
(
query
)
{
return
request
({
url
:
'/incomewmslabel/list'
,
method
:
'get'
,
params
:
query
})
}
// 2. 查询标签管理详细信息
export
function
getIncomeWmsLabel
(
businessId
)
{
return
request
({
url
:
'/incomewmslabel/detail/'
+
businessId
,
method
:
'get'
})
}
// 2. 查询标签管理详细信息
export
function
findByLocation
(
location
)
{
return
request
({
url
:
'/incomewmslabel/findByLocation/'
+
location
,
method
:
'get'
})
}
// 3. 新增标签管理
export
function
addIncomeWmsLabel
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmslabel/add'
,
method
:
'post'
,
data
:
data
})
}
// 4. 修改标签管理
export
function
updateIncomeWmsLabel
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmslabel/update/'
+
businessId
,
method
:
'put'
,
data
})
}
// 5. 逻辑删除标签管理
export
function
delIncomeWmsLabel
(
businessId
)
{
return
request
({
url
:
'/incomewmslabel/deleteLogical/'
+
businessId
,
method
:
'delete'
})
}
// 6. 导出标签管理
export
function
exportIncomeWmsLabel
(
query
)
{
return
request
({
url
:
'/incomewmslabel/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/views/setup/enterbound.vue
View file @
afc415a6
...
@@ -2,43 +2,62 @@
...
@@ -2,43 +2,62 @@
<div
class=
"enterBound"
>
<div
class=
"enterBound"
>
<div
class=
"enterForm"
>
<div
class=
"enterForm"
>
<div
class=
"search"
>
<div
class=
"search"
>
<el-form
:model=
"queryForm
"
label-width=
"40px"
>
<el-form
ref=
"queryForm"
:model=
"queryForm"
:rules=
"rules
"
label-width=
"40px"
>
<el-form-item
label=
"XX:"
>
<el-form-item
label=
"XX:"
prop=
"value1"
>
<el-input
ref=
"input1"
v-model=
"queryForm.value1"
clearable
@
keyup
.
enter
.
native=
"handelTab(1,$event)"
></el-input
>
<el-input
ref=
"input1"
v-model=
"queryForm.value1"
clearable
@
keyup
.
enter
.
native=
"handelTab(1,$event)"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"YY:"
>
<el-form-item>
<el-input
ref=
"input2"
v-model=
"queryForm.value2"
clearable
@
keyup
.
enter
.
native=
"addList"
></el-input>
<div>
<span>
location:
{{
queryForm
.
location
}}
</span>
</div>
</el-form-item>
<el-form-item
label=
"YY:"
prop=
"value2"
>
<el-input
ref=
"input2"
v-model=
"queryForm.value2"
clearable
@
keyup
.
enter
.
native=
"addList"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<div
class=
"showPn"
>
<span
class=
"pnFont"
>
YYpn:
{{
incomeWmsBoxList
.
pn
}}
</span>
</div>
<div
class=
"showPn"
>
<span
class=
"pnFont"
>
数据库pn:
{{
incomeWmsLabelList
.
pn
}}
</span>
</div>
<div
class=
"enterTable"
>
<div
class=
"enterTable"
>
<el-table
:data=
"enterTable"
>
<el-table
:data=
"enterTable"
>
<el-table-column
label=
"
XX
"
min-width=
"80"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
lot
"
min-width=
"80"
:show-overflow-tooltip=
"true"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
value1
}}
</span>
<span>
{{
scope
.
row
.
lot
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
XX
"
min-width=
"38"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
qty
"
min-width=
"38"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
value2
}}
</span>
<span>
{{
scope
.
row
.
qty
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
XX
"
min-width=
"38"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"
rank
"
min-width=
"38"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
value3
}}
</span>
<span>
{{
scope
.
row
.
rank
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
min-width=
"20"
:show-overflow-tooltip=
"true"
>
<el-table-column
min-width=
"20"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<i
@
click=
"handleDelte(scope.$index)"
class=
"el-icon-delete-solid"
style=
"font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px"
></i
>
<i
class=
"el-icon-delete-solid"
style=
"font-size: 26px;margin-left: -10px;color: #46BCF3; margin-top: 7px"
@
click=
"handleDelte(scope.$index)"
/
>
<!--
<span>
{{
scope
.
row
.
value3
}}
</span>
-->
<!--
<span>
{{
scope
.
row
.
value3
}}
</span>
-->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
<div
class=
"tableTotal"
>
<span
style=
"color: red"
>
条数:{{ enterTable.length }}
</span>
</div>
<div
class=
"buttonRegion"
>
<div
class=
"buttonRegion"
>
<el-button
class=
"button_rowBtn"
type=
"primary"
>
保存
</el-button>
<el-button
class=
"button_rowBtn"
type=
"primary"
@
click=
"SubmitForm"
>
保存
</el-button>
<el-button
class=
"button_rowBtn"
type=
"primary"
>
提交
</el-button>
<el-button
class=
"button_rowBtn"
type=
"danger"
@
click=
"clearForm($event)"
>
清空
</el-button>
</div>
<!-- 中间文本-->
<div
class=
"BottomContent"
>
<div
class=
"fontSp"
>
单号: {{ incomeWmsBoxList.order_code }}
</div>
<div
class=
"loginUser"
>
操作人: {{ userList.nickName }}
</div>
</div>
</div>
</div>
</div>
...
@@ -46,27 +65,130 @@
...
@@ -46,27 +65,130 @@
</template>
</template>
<
script
>
<
script
>
import
{
addIncomeWmsBox
,
getJcCode
,
queryPass
}
from
'@/api/incomeWmsBox'
import
{
findByLocation
,
updateIncomeWmsLabel
}
from
'@/api/incomeWmsLabel'
import
{
getInfo
}
from
'@/api/login'
export
default
{
export
default
{
name
:
"enterbound"
,
name
:
'EnterBound'
,
data
()
{
data
()
{
return
{
return
{
queryForm
:
{
queryForm
:
{
location
:
''
,
// 假设 location 的值为 'A1'
pn
:
''
,
// 假设 pn 的值为 'ABC'
value1
:
''
,
value1
:
''
,
value2
:
''
value2
:
''
,
lot
:
''
,
qty
:
''
,
rank
:
''
},
},
enterTable
:
[
// 库存管理表格数据
{
incomeWmsBoxList
:
{
value1
:
'xxxx-xxxx-xxx-xxx'
,
order_code
:
''
,
value2
:
'1000'
,
pn
:
''
value3
:
'1000'
},
}
form
:
{},
enterTable
:
[],
incomeWmsLabelList
:
{},
userList
:
{
nickName
:
''
},
// 表单校验
rules
:
{
value1
:
[
{
required
:
true
,
message
:
'请输入barcode的值'
,
trigger
:
'blur'
},
{
pattern
:
/^
[
a-zA-Z0-9
]
+,
[
a-zA-Z0-9
]
+$/
,
message
:
'输入值必须是两个值以逗号分隔'
,
trigger
:
'blur'
}
],
value2
:
[
{
required
:
true
,
message
:
'请输入Value2的值'
,
trigger
:
'blur'
},
{
pattern
:
/^
[^
:
]
+:
[^
:
]
+:
[^
:
]
+:
\d
+$/
,
message
:
'输入格式错误,必须以4个冒号分隔,前三个任意值,第四个必须为十进制整数'
,
trigger
:
'blur'
}
]
]
}
}
}
},
},
created
()
{
created
()
{
this
.
focusing
()
this
.
focusing
()
this
.
getOrderCode
()
this
.
getLoginUser
()
},
},
methods
:
{
methods
:
{
/**
* 清空按钮
* @param e
*/
clearForm
(
e
)
{
this
.
queryForm
=
{
queryForm
:
{
location
:
''
,
// 假设 location 的值为 'A1'
pn
:
''
,
// 假设 pn 的值为 'ABC'
value1
:
''
,
value2
:
''
,
lot
:
''
,
qty
:
''
,
rank
:
''
}
}
this
.
incomeWmsLabelList
.
pn
=
''
this
.
incomeWmsBoxList
.
pn
=
''
this
.
enterTable
=
[]
const
that
=
this
that
.
$nextTick
(()
=>
{
e
.
target
.
blur
()
that
.
$refs
[
'input1'
].
focus
()
})
},
/**
* 保存
*/
SubmitForm
()
{
const
insertItem
=
async
(
index
)
=>
{
if
(
index
<
this
.
enterTable
.
length
)
{
try
{
await
addIncomeWmsBox
(
this
.
enterTable
[
index
])
// 插入成功后继续下一条
await
insertItem
(
index
+
1
)
}
catch
(
error
)
{
console
.
error
(
'插入失败:'
,
error
)
// 处理插入失败的情况
}
}
else
{
this
.
msgSuccess
(
'新增成功'
)
}
}
this
.
$refs
.
queryForm
.
validate
(
valid
=>
{
if
(
valid
&&
this
.
enterTable
.
length
>
0
)
{
insertItem
(
0
)
// 从第一条开始插入
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
input1
.
focus
()
})
this
.
clearForm
()
}
else
{
this
.
$message
.
error
(
'列表的数据不能为空'
)
}
})
},
/** 获取当前登录用户**/
getLoginUser
()
{
getInfo
().
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
userList
.
nickName
=
response
.
data
.
user
.
nickName
}
})
},
/**
* 获取单号
*/
// 获取单号
getOrderCode
()
{
getJcCode
().
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
incomeWmsBoxList
.
order_code
=
response
.
data
}
})
},
/**
/**
* @description: 监听输入框回车事件,如果回车焦点聚集到下一个输入框
* @description: 监听输入框回车事件,如果回车焦点聚集到下一个输入框
* @author: gaoyu
* @author: gaoyu
...
@@ -78,11 +200,69 @@ export default {
...
@@ -78,11 +200,69 @@ export default {
if
(
!
that
.
$refs
[
'input'
+
i
])
{
if
(
!
that
.
$refs
[
'input'
+
i
])
{
return
return
}
}
const
inputValues
=
this
.
queryForm
.
value1
.
split
(
','
)
if
(
inputValues
.
length
===
2
)
{
// 输入值必须是两个值以逗号分隔
// 允许字母和数字的组合
const
isValidFormat
=
/^
[
a-zA-Z0-9
]
+$/
.
test
(
inputValues
[
0
].
trim
())
&&
/^
[
a-zA-Z0-9
]
+$/
.
test
(
inputValues
[
1
].
trim
())
if
(
isValidFormat
)
{
this
.
queryForm
.
location
=
inputValues
[
0
].
trim
()
this
.
queryForm
.
pn
=
inputValues
[
1
].
trim
()
console
.
log
(
'location'
,
this
.
queryForm
.
location
)
findByLocation
(
this
.
queryForm
.
location
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
console
.
log
(
'resDate'
,
res
.
data
)
if
(
res
.
data
!=
null
)
{
if
(
res
.
data
.
pn
!==
null
&&
res
.
data
.
pn
!==
''
)
{
if
(
res
.
data
.
pn
!==
this
.
queryForm
.
pn
)
{
res
.
data
.
pn
=
this
.
queryForm
.
pn
updateIncomeWmsLabel
(
res
.
data
).
then
(
response
=>
{
this
.
incomeWmsLabelList
=
response
.
data
this
.
getOrderCode
()
this
.
msgSuccess
(
'修改成功'
)
that
.
$nextTick
(()
=>
{
that
.
$nextTick
(()
=>
{
e
.
target
.
blur
()
e
.
target
.
blur
()
const
index
=
i
+
1
const
index
=
i
+
1
that
.
$refs
[
'input'
+
index
].
focus
()
that
.
$refs
[
'input'
+
index
].
focus
()
})
})
})
}
else
{
this
.
incomeWmsLabelList
=
res
.
data
this
.
getOrderCode
()
that
.
$nextTick
(()
=>
{
e
.
target
.
blur
()
const
index
=
i
+
1
that
.
$refs
[
'input'
+
index
].
focus
()
})
}
}
else
{
res
.
data
.
pn
=
this
.
queryForm
.
pn
console
.
log
(
res
.
data
)
updateIncomeWmsLabel
(
res
.
data
).
then
(
response
=>
{
this
.
incomeWmsLabelList
=
response
.
data
this
.
getOrderCode
()
this
.
msgSuccess
(
'修改成功'
)
that
.
$nextTick
(()
=>
{
e
.
target
.
blur
()
const
index
=
i
+
1
that
.
$refs
[
'input'
+
index
].
focus
()
})
})
}
}
else
{
this
.
$message
.
error
(
'数据库中无对应数据'
)
}
}
})
// 输入值符合格式要求,执行相应的逻辑
}
else
{
// 输入值不符合格式要求,进行报错处理
this
.
$message
.
error
(
'输入值不符合格式要求,请输入格式为"字母或数字,字母或数字"'
)
}
}
else
{
// 输入值不符合格式要求,进行报错处理
this
.
$message
.
error
(
'输入值不符合格式要求,请输入两个值以逗号分隔'
)
}
},
},
/**
/**
* @description: 一开始将焦点聚焦到第一个输入框下
* @description: 一开始将焦点聚焦到第一个输入框下
...
@@ -90,7 +270,7 @@ export default {
...
@@ -90,7 +270,7 @@ export default {
* @param:
* @param:
* @return:
* @return:
**/
**/
focusing
(){
focusing
()
{
this
.
$nextTick
().
then
(()
=>
{
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
input1
.
focus
()
this
.
$refs
.
input1
.
focus
()
})
})
...
@@ -102,12 +282,51 @@ export default {
...
@@ -102,12 +282,51 @@ export default {
* @return:
* @return:
**/
**/
addList
()
{
addList
()
{
const
inputPattern
=
/.+:.+:.+:
\d
+/
if
(
inputPattern
.
test
(
this
.
queryForm
.
value2
))
{
const
values
=
this
.
queryForm
.
value2
.
split
(
':'
)
// 校验第三个值是否为整数
if
(
/^
\d
+$/
.
test
(
values
[
3
]))
{
const
obj
=
{
const
obj
=
{
value1
:
this
.
queryForm
.
value1
,
lot
:
values
[
0
],
value2
:
this
.
queryForm
.
value2
,
pn
:
values
[
1
],
value3
:
'1000'
qty
:
parseInt
(
values
[
3
]),
rank
:
values
[
2
],
labelId
:
this
.
incomeWmsLabelList
.
businessId
}
}
this
.
incomeWmsBoxList
.
pn
=
values
[
1
]
if
(
this
.
incomeWmsLabelList
.
pn
!==
''
&&
this
.
incomeWmsLabelList
.
pn
!==
undefined
)
{
if
(
obj
.
pn
!==
this
.
incomeWmsLabelList
.
pn
)
{
this
.
$message
.
error
(
'输入的pn值不相等,已更改pn值'
)
obj
.
pn
=
this
.
incomeWmsLabelList
.
pn
this
.
incomeWmsBoxList
.
pn
=
obj
.
pn
this
.
queryForm
.
value2
=
obj
.
lot
+
':'
+
obj
.
pn
+
':'
+
obj
.
rank
+
':'
+
obj
.
qty
queryPass
(
obj
.
lot
).
then
(
lotResponse
=>
{
if
(
lotResponse
.
data
>
0
)
{
this
.
enterTable
.
push
(
obj
)
this
.
enterTable
.
push
(
obj
)
}
})
}
else
{
queryPass
(
obj
.
lot
).
then
(
lotResponse
=>
{
if
(
lotResponse
.
code
===
200
&&
lotResponse
.
data
>
0
)
{
this
.
enterTable
.
push
(
obj
)
}
})
}
}
else
{
this
.
$message
.
error
(
'数据库中无对应数据'
)
}
this
.
getOrderCode
()
}
else
{
this
.
$message
.
error
(
'qty的值必须为整数!'
)
}
}
else
{
// 输入格式不符合要求,进行相应处理1
this
.
$message
.
error
(
'输入格式不符合要求,请重新输入'
)
}
console
.
log
(
'this.queryForm.lot'
,
this
.
queryForm
.
lot
)
console
.
log
(
'this.queryForm.rank'
,
this
.
queryForm
.
rank
)
console
.
log
(
'this.queryForm.qty'
,
this
.
queryForm
.
qty
)
},
},
/**
/**
* @description: 删除数据中元素
* @description: 删除数据中元素
...
@@ -116,8 +335,8 @@ export default {
...
@@ -116,8 +335,8 @@ export default {
* @return:
* @return:
**/
**/
handleDelte
(
index
)
{
handleDelte
(
index
)
{
this
.
enterTable
.
splice
(
index
,
1
)
this
.
enterTable
.
splice
(
index
,
1
)
}
,
}
}
}
}
}
</
script
>
</
script
>
...
@@ -128,7 +347,19 @@ export default {
...
@@ -128,7 +347,19 @@ export default {
justify-content
:
center
;
justify-content
:
center
;
.enterForm
{
.enterForm
{
width
:
96%
;
width
:
96%
;
.showPn
{
width
:
100%
;
height
:
30px
;
margin-bottom
:
2%
;
.pnFont
{
margin-left
:
3%
;
}
}
.tableTotal
{
margin-top
:
2%
;
}
}
}
.buttonRegion
{
.buttonRegion
{
margin-top
:
20px
;
margin-top
:
20px
;
display
:
flex
;
display
:
flex
;
...
@@ -138,5 +369,13 @@ export default {
...
@@ -138,5 +369,13 @@ export default {
width
:
120px
;
width
:
120px
;
}
}
}
}
.BottomContent
{
display
:
flex
;
justify-content
:
space-between
;
margin-top
:
2%
;
.loginUser
{
margin-right
:
13%
;
}
}
}
}
</
style
>
</
style
>
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