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
fe05d6c5
Commit
fe05d6c5
authored
Apr 03, 2024
by
Hagsn3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
e27df32c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
28 deletions
+101
-28
income_mat_baseinfo.js
src/api/income_mat_baseinfo.js
+11
-0
enterboundTwo.vue
src/views/setup/enterboundTwo.vue
+90
-28
No files found.
src/api/income_mat_baseinfo.js
0 → 100644
View file @
fe05d6c5
import
request
from
'@/utils/request'
export
function
queryByPnAndType
(
data
)
{
return
request
({
url
:
'/incomematbaseinfo/queryByPnAndType'
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
// 接口修改传参类型
}
})
}
src/views/setup/enterboundTwo.vue
View file @
fe05d6c5
...
...
@@ -2,15 +2,15 @@
<div
class=
"enterboundTwo"
>
<div
class=
"enterForm"
>
<div
class=
"search"
>
<el-form
:model=
"form"
ref=
"fro
m"
:rules=
"rules"
label-width=
"80px"
class=
"formClass"
label-position=
"right"
>
<el-form
ref=
"from"
:model=
"for
m"
:rules=
"rules"
label-width=
"80px"
class=
"formClass"
label-position=
"right"
>
<el-form-item
label=
"仓库:"
prop=
"whId"
>
<el-select
v-model=
"form.whId"
filterable
class=
"normalSelect"
placeholder=
"请选择"
>
<el-option
v-for=
"(item,index) in warehouseList"
:key=
"index"
:label=
"item.dictLabel"
:value=
"item.dictValue"
>
</el-option
>
:value=
"item.dictValue"
/
>
</el-select>
</el-form-item>
<el-form-item
label=
"类型:"
prop=
"ptype"
>
...
...
@@ -19,12 +19,12 @@
v-for=
"(item,index) in typeList"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
>
</el-option
>
:value=
"item.value"
/
>
</el-select>
</el-form-item>
<el-form-item
label=
"XX:"
prop=
"value1"
>
<el-input
ref=
"input1"
v-model=
"form.value1"
clearable
@
keyup
.
enter
.
native=
"handelTab(1,$event)"
/>
<el-input
ref=
"input1"
v-model=
"form.value1"
clearable
@
keyup
.
enter
.
native=
"handelTab(1,$event)"
/>
</el-form-item>
<el-form-item
v-if=
"responsePn"
>
<div>
...
...
@@ -32,10 +32,10 @@
</div>
</el-form-item>
<el-form-item
label=
"pn:"
prop=
"pn"
>
<el-input
ref=
"input2"
v-model=
"form.pn"
clearable
@
keyup
.
enter
.
native=
"handelTab(2,$event)"
/>
<el-input
ref=
"input2"
v-model=
"form.pn"
clearable
@
keyup
.
enter
.
native=
"handelTab(2,$event)"
/>
</el-form-item>
<el-form-item
label=
"数量:"
prop=
"qty"
>
<el-input
ref=
"input3"
v-model=
"form.qty"
:maxlength=
"4"
clearable
@
keyup
.
enter
.
native=
"handelTab(3,$event)"
/>
<el-input
ref=
"input3"
v-model=
"form.qty"
:maxlength=
"4"
clearable
@
keyup
.
enter
.
native=
"handelTab(3,$event)"
/>
</el-form-item>
</el-form>
</div>
...
...
@@ -52,12 +52,13 @@
</
template
>
<
script
>
import
{
getDict
}
from
"@/api/system/dict/data"
;
import
{
addIncomeWmsBox
,
getJcCode
}
from
"@/api/incomeWmsBox"
;
import
{
findByLocation
}
from
"@/api/incomeWmsLabel"
;
import
{
getDict
}
from
'@/api/system/dict/data'
import
{
addIncomeWmsBox
,
getJcCode
}
from
'@/api/incomeWmsBox'
import
{
findByLocation
}
from
'@/api/incomeWmsLabel'
import
{
queryByPnAndType
}
from
'@/api/income_mat_baseinfo'
export
default
{
name
:
"enterboundTwo"
,
name
:
'EnterboundTwo'
,
data
()
{
return
{
responsePn
:
''
,
...
...
@@ -69,7 +70,7 @@ export default {
value
:
'2'
},
{
label
:
'w
b
'
,
label
:
'w
d
'
,
value
:
'3'
},
{
...
...
@@ -94,8 +95,9 @@ export default {
rules
:
{
value1
:
[
{
required
:
true
,
message
:
'请输入XX的值'
,
trigger
:
'blur'
},
{
pattern
:
/^.*,.*/
|
/^.*$/
,
message
:
'输入值不符合格式要求,请重新输入'
,
trigger
:
'blur'
}
],
qty
:
[{
validator
:
this
.
validatorQty
,
trigger
:
'blur'
}]
qty
:
[{
validator
:
this
.
validatorQty
,
trigger
:
'blur'
}]
}
}
},
...
...
@@ -116,7 +118,7 @@ export default {
getDict
(
'WAREHOUSE'
).
then
(
res
=>
{
console
.
log
(
'仓库数据字典'
,
res
)
this
.
warehouseList
=
res
.
data
le
t
whId
=
res
.
data
[
0
].
dictValue
cons
t
whId
=
res
.
data
[
0
].
dictValue
this
.
form
.
whId
=
whId
})
},
...
...
@@ -138,14 +140,11 @@ export default {
* **/
switch
(
i
)
{
case
1
:
this
.
validXX
()
this
.
validXX
(
i
,
e
)
break
case
2
:
that
.
validPn
()
}
e
.
target
.
blur
()
const
index
=
i
+
1
that
.
$refs
[
'input'
+
index
].
focus
()
},
/**
* @description: 如果是1进入校验XX的校验
...
...
@@ -153,18 +152,33 @@ export default {
* @param:
* @return:
**/
validXX
()
{
validXX
(
i
,
e
)
{
const
that
=
this
if
(
!
that
.
$refs
[
'input'
+
i
])
{
return
}
console
.
log
(
'校验xx'
)
/**
* 1.判断xx是否包含,
* 2.如果包含的话判断是否根据,转成数组 取数组中的第一的数据
* **/
// var location = ''
// if (this.form.value1.includes(',')) {
// var list = this.form.value1.split(',')
// console.log(list)
// location = list[0]
// } else {
// location = this.form.value1
// console.log('location',location);
// }
var
location
=
''
if
(
this
.
form
.
value1
.
includes
(
','
))
{
var
list
=
this
.
form
.
value1
.
split
(
','
)
if
(
this
.
form
.
value1
.
includes
(
','
)
||
this
.
form
.
value1
.
includes
(
','
))
{
var
list
=
this
.
form
.
value1
.
split
(
/,|,/
)
console
.
log
(
list
)
location
=
list
[
0
]
}
else
{
location
=
this
.
form
.
value1
console
.
log
(
'location'
,
location
)
}
if
(
location
&&
location
!==
''
)
{
findByLocation
(
location
).
then
(
res
=>
{
...
...
@@ -177,6 +191,13 @@ export default {
if
(
res
.
data
.
location
)
{
this
.
form
.
location
=
res
.
data
.
location
}
that
.
$nextTick
(()
=>
{
e
.
target
.
blur
()
const
index
=
i
+
1
that
.
$refs
[
'input'
+
index
].
focus
()
})
}
else
{
this
.
$message
.
error
(
'数据库中无对应值,请重新输入'
)
}
}
})
...
...
@@ -191,13 +212,51 @@ export default {
* @return:
**/
validPn
()
{
/**
* responsePn:数据库pn
* form.pn:表格pn
*/
if
(
this
.
responsePn
&&
this
.
responsePn
!==
''
&&
this
.
responsePn
!==
undefined
)
{
console
.
log
(
'formPn'
,
this
.
form
.
pn
)
console
.
log
(
'responsePn'
,
this
.
responsePn
)
if
(
this
.
form
.
pn
!==
this
.
responsePn
)
{
this
.
$message
.
error
(
'您输入的pn与返回pn的不一样'
)
return
false
}
else
{
const
obj
=
{
pn
:
this
.
form
.
pn
,
ptype
:
this
.
form
.
ptype
}
queryByPnAndType
(
obj
).
then
(
response
=>
{
if
(
response
.
code
===
200
&&
response
.
data
!==
null
)
{
console
.
log
(
response
)
this
.
form
.
qty
=
response
.
data
.
qty
}
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
input3
.
focus
()
})
})
return
true
}
}
else
{
const
obj
=
{
pn
:
this
.
form
.
pn
,
ptype
:
this
.
form
.
ptype
}
queryByPnAndType
(
obj
).
then
(
response
=>
{
if
(
response
.
code
===
200
&&
response
.
data
)
{
console
.
log
(
response
)
this
.
form
.
qty
=
response
.
data
.
qty
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
input3
.
focus
()
})
}
else
{
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
input3
.
focus
()
})
}
})
return
true
}
return
true
},
/**
* @description: 保存
...
...
@@ -206,13 +265,16 @@ export default {
* @return:
**/
SubmitForm
()
{
console
.
log
(
11111111111
)
this
.
$refs
.
from
.
validate
(
valid
=>
{
if
(
valid
&&
this
.
validPn
())
{
console
.
log
(
2222222222222222222222
)
if
(
valid
&&
this
.
validPn
())
{
this
.
form
.
qty
=
Number
(
this
.
form
.
qty
)
addIncomeWmsBox
(
this
.
form
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
resetForm
()
this
.
$message
.
success
(
'保存成功'
)
this
.
resetForm
()
this
.
getOrderCode
()
}
})
}
...
...
@@ -270,9 +332,9 @@ export default {
this
.
getWarehouseList
()
},
validatorQty
(
rule
,
value
,
callback
)
{
const
reg
=
/^
[
1-9
]\d
*$/
;
// 正整数的正则表达式
const
reg
=
/^
[
1-9
]\d
*$/
// 正整数的正则表达式
if
(
value
&&
value
!==
''
&&
value
!==
undefined
&&
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
'请输入正整数'
))
;
callback
(
new
Error
(
'请输入正整数'
))
}
else
{
callback
()
}
...
...
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