Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
de26b2d7
Commit
de26b2d7
authored
Jun 20, 2021
by
季圣华
Browse files
给商品条码增加重复校验
parent
be3a882d
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/api/api.js
View file @
de26b2d7
...
@@ -129,6 +129,7 @@ const checkMaterial = (params)=>getAction("/material/checkIsNameExist",params);
...
@@ -129,6 +129,7 @@ const checkMaterial = (params)=>getAction("/material/checkIsNameExist",params);
const
getMaterialBySelect
=
(
params
)
=>
getAction
(
"
/material/findBySelect
"
,
params
);
const
getMaterialBySelect
=
(
params
)
=>
getAction
(
"
/material/findBySelect
"
,
params
);
const
getSerialMaterialBySelect
=
(
params
)
=>
getAction
(
"
/material/getMaterialEnableSerialNumberList
"
,
params
);
const
getSerialMaterialBySelect
=
(
params
)
=>
getAction
(
"
/material/getMaterialEnableSerialNumberList
"
,
params
);
const
getMaterialByBarCode
=
(
params
)
=>
getAction
(
"
/material/getMaterialByBarCode
"
,
params
);
const
getMaterialByBarCode
=
(
params
)
=>
getAction
(
"
/material/getMaterialByBarCode
"
,
params
);
const
checkMaterialBarCode
=
(
params
)
=>
getAction
(
"
/materialsExtend/checkIsBarCodeExist
"
,
params
);
//序列号
//序列号
const
addSerialNumber
=
(
params
)
=>
postAction
(
"
/serialNumber/add
"
,
params
);
const
addSerialNumber
=
(
params
)
=>
postAction
(
"
/serialNumber/add
"
,
params
);
const
editSerialNumber
=
(
params
)
=>
putAction
(
"
/serialNumber/update
"
,
params
);
const
editSerialNumber
=
(
params
)
=>
putAction
(
"
/serialNumber/update
"
,
params
);
...
@@ -249,6 +250,7 @@ export {
...
@@ -249,6 +250,7 @@ export {
getMaterialBySelect
,
getMaterialBySelect
,
getSerialMaterialBySelect
,
getSerialMaterialBySelect
,
getMaterialByBarCode
,
getMaterialByBarCode
,
checkMaterialBarCode
,
addSerialNumber
,
addSerialNumber
,
editSerialNumber
,
editSerialNumber
,
checkSerialNumber
,
checkSerialNumber
,
...
...
jshERP-web/src/views/material/modules/MaterialModal.vue
View file @
de26b2d7
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
import
pick
from
'
lodash.pick
'
import
pick
from
'
lodash.pick
'
import
JEditableTable
from
'
@/components/jeecg/JEditableTable
'
import
JEditableTable
from
'
@/components/jeecg/JEditableTable
'
import
{
FormTypes
,
VALIDATE_NO_PASSED
,
getRefPromise
,
validateFormAndTables
}
from
'
@/utils/JEditableTableUtil
'
import
{
FormTypes
,
VALIDATE_NO_PASSED
,
getRefPromise
,
validateFormAndTables
}
from
'
@/utils/JEditableTableUtil
'
import
{
queryMaterialCategoryTreeList
,
addMaterial
,
edit
Material
,
checkMaterial
}
from
'
@/api/api
'
import
{
queryMaterialCategoryTreeList
,
check
Material
,
checkMaterial
BarCode
}
from
'
@/api/api
'
import
{
httpAction
,
getAction
}
from
'
@/api/manage
'
import
{
httpAction
,
getAction
}
from
'
@/api/manage
'
import
JDate
from
'
@/components/jeecg/JDate
'
import
JDate
from
'
@/components/jeecg/JDate
'
import
Vue
from
'
vue
'
import
Vue
from
'
vue
'
...
@@ -191,7 +191,8 @@
...
@@ -191,7 +191,8 @@
title
:
'
条码
'
,
key
:
'
barCode
'
,
width
:
'
30%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
title
:
'
条码
'
,
key
:
'
barCode
'
,
width
:
'
30%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
validateRules
:
[{
required
:
true
,
message
:
'
${title}不能为空
'
},
validateRules
:
[{
required
:
true
,
message
:
'
${title}不能为空
'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'
请输入零以上的正整数
'
},
{
pattern
:
/^
[
1-9
]\d
*$/
,
message
:
'
请输入零以上的正整数
'
},
{
pattern
:
/^
\d{4,13}
$/
,
message
:
'
4到13位数字
'
}]
{
pattern
:
/^
\d{4,13}
$/
,
message
:
'
4到13位数字
'
},
{
handler
:
this
.
validateBarCode
}]
},
},
{
{
title
:
'
单位
'
,
key
:
'
commodityUnit
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
title
:
'
单位
'
,
key
:
'
commodityUnit
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
...
@@ -372,7 +373,6 @@
...
@@ -372,7 +373,6 @@
return
;
return
;
}
}
//进一步校验单位
//进一步校验单位
debugger
let
manyUnitselected
=
''
let
manyUnitselected
=
''
if
(
formData
.
unitId
)
{
if
(
formData
.
unitId
)
{
for
(
let
i
=
0
;
i
<
this
.
unitList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
unitList
.
length
;
i
++
)
{
...
@@ -453,6 +453,23 @@
...
@@ -453,6 +453,23 @@
}
}
});
});
},
},
validateBarCode
(
type
,
value
,
row
,
column
,
callback
,
target
)
{
let
params
=
{
barCode
:
value
,
id
:
row
.
id
.
length
==
20
?
0
:
row
.
id
};
checkMaterialBarCode
(
params
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
!
res
.
data
.
status
){
callback
(
true
);
}
else
{
callback
(
false
,
'
该条码已经存在
'
);
}
}
else
{
callback
(
false
,
res
.
data
);
}
});
},
loadTreeData
(){
loadTreeData
(){
let
that
=
this
;
let
that
=
this
;
let
params
=
{};
let
params
=
{};
...
...
Write
Preview
Supports
Markdown
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