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
25b5680b
Commit
25b5680b
authored
Jun 03, 2021
by
季圣华
Browse files
给商品页面增加非空判断
parent
faf57101
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/views/material/MaterialList.vue
View file @
25b5680b
...
@@ -187,7 +187,7 @@
...
@@ -187,7 +187,7 @@
title
:
'
操作
'
,
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
dataIndex
:
'
action
'
,
align
:
"
center
"
,
align
:
"
center
"
,
width
:
1
0
0
,
width
:
1
2
0
,
fixed
:
'
right
'
,
fixed
:
'
right
'
,
scopedSlots
:
{
customRender
:
'
action
'
},
scopedSlots
:
{
customRender
:
'
action
'
},
}
}
...
...
jshERP-web/src/views/material/modules/MaterialModal.vue
View file @
25b5680b
<
template
>
<
template
>
<a-modal
<a-modal
:title=
"title"
:title=
"title"
:width=
"1
0
00"
:width=
"1
2
00"
:visible=
"visible"
:visible=
"visible"
:confirmLoading=
"confirmLoading"
:confirmLoading=
"confirmLoading"
@
ok=
"handleOk"
@
ok=
"handleOk"
...
@@ -188,53 +188,24 @@
...
@@ -188,53 +188,24 @@
dataSource
:
[],
dataSource
:
[],
columns
:
[
columns
:
[
{
{
title
:
'
条码
'
,
title
:
'
条码
'
,
key
:
'
barCode
'
,
width
:
'
30%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
key
:
'
barCode
'
,
width
:
'
30%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
validateRules
:
[{
required
:
true
,
message
:
'
${title}不能为空
'
}]
validateRules
:
[{
required
:
true
,
message
:
'
${title}不能为空
'
}]
},
},
{
{
title
:
'
单位
'
,
title
:
'
单位
'
,
key
:
'
commodityUnit
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
,
key
:
'
commodityUnit
'
,
validateRules
:
[{
required
:
true
,
message
:
'
${title}不能为空
'
}]
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
},
},
{
{
title
:
'
采购价
'
,
title
:
'
采购价
'
,
key
:
'
purchaseDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
key
:
'
purchaseDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
},
},
{
{
title
:
'
零售价
'
,
title
:
'
零售价
'
,
key
:
'
commodityDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
key
:
'
commodityDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
},
},
{
{
title
:
'
销售价
'
,
title
:
'
销售价
'
,
key
:
'
wholesaleDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
key
:
'
wholesaleDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
},
},
{
{
title
:
'
最低售价
'
,
title
:
'
最低售价
'
,
key
:
'
lowDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
key
:
'
lowDecimal
'
,
width
:
'
12%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
}
}
]
]
},
},
...
@@ -243,18 +214,10 @@
...
@@ -243,18 +214,10 @@
dataSource
:
[],
dataSource
:
[],
columns
:
[
columns
:
[
{
{
title
:
'
仓库
'
,
title
:
'
仓库
'
,
key
:
'
name
'
,
width
:
'
15%
'
,
type
:
FormTypes
.
normal
key
:
'
name
'
,
width
:
'
15%
'
,
type
:
FormTypes
.
normal
},
},
{
{
title
:
'
库存数量
'
,
title
:
'
库存数量
'
,
key
:
'
initStock
'
,
width
:
'
15%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
key
:
'
initStock
'
,
width
:
'
15%
'
,
type
:
FormTypes
.
input
,
defaultValue
:
''
,
placeholder
:
'
请输入${title}
'
}
}
]
]
},
},
...
@@ -267,6 +230,11 @@
...
@@ -267,6 +230,11 @@
{
min
:
2
,
max
:
30
,
message
:
'
长度在 2 到 30 个字符
'
,
trigger
:
'
blur
'
},
{
min
:
2
,
max
:
30
,
message
:
'
长度在 2 到 30 个字符
'
,
trigger
:
'
blur
'
},
{
validator
:
this
.
validateMaterialName
}
{
validator
:
this
.
validateMaterialName
}
]
]
},
unit
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入单位!
'
}
]
}
}
},
},
url
:
{
url
:
{
...
@@ -368,11 +336,9 @@
...
@@ -368,11 +336,9 @@
}).
then
(
allValues
=>
{
}).
then
(
allValues
=>
{
let
formData
=
this
.
classifyIntoFormData
(
allValues
)
let
formData
=
this
.
classifyIntoFormData
(
allValues
)
formData
.
sortList
=
[];
formData
.
sortList
=
[];
if
(
this
.
unitChecked
){
if
(
formData
.
unit
===
undefined
)
{
formData
.
unit
=
''
}
formData
.
unit
=
''
if
(
formData
.
unitId
===
undefined
)
{
formData
.
unitId
=
''
}
}
else
{
if
(
this
.
unitChecked
)
{
formData
.
unit
=
''
}
else
{
formData
.
unitId
=
''
}
formData
.
unitId
=
''
}
// 发起请求
// 发起请求
return
this
.
requestAddOrEdit
(
formData
)
return
this
.
requestAddOrEdit
(
formData
)
}).
catch
(
e
=>
{
}).
catch
(
e
=>
{
...
@@ -395,6 +361,14 @@
...
@@ -395,6 +361,14 @@
},
},
/** 发起新增或修改的请求 */
/** 发起新增或修改的请求 */
requestAddOrEdit
(
formData
)
{
requestAddOrEdit
(
formData
)
{
if
(
formData
.
unit
===
''
&&
formData
.
unitId
===
''
)
{
this
.
$message
.
warning
(
'
抱歉,单位为必填项!
'
);
return
;
}
if
(
formData
.
meList
.
length
===
0
)
{
this
.
$message
.
warning
(
'
抱歉,请输入条码信息!
'
);
return
;
}
let
url
=
this
.
url
.
add
,
method
=
'
post
'
let
url
=
this
.
url
.
add
,
method
=
'
post
'
if
(
this
.
model
.
id
)
{
if
(
this
.
model
.
id
)
{
url
=
this
.
url
.
edit
url
=
this
.
url
.
edit
...
@@ -405,12 +379,13 @@
...
@@ -405,12 +379,13 @@
httpAction
(
url
,
formData
,
method
).
then
((
res
)
=>
{
httpAction
(
url
,
formData
,
method
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
){
if
(
res
.
code
===
200
){
that
.
$emit
(
'
ok
'
);
that
.
$emit
(
'
ok
'
);
that
.
confirmLoading
=
false
that
.
close
();
}
else
{
}
else
{
that
.
$message
.
warning
(
res
.
data
.
message
);
that
.
$message
.
warning
(
res
.
data
.
message
);
that
.
confirmLoading
=
false
}
}
}).
finally
(()
=>
{
}).
finally
(()
=>
{
that
.
confirmLoading
=
false
that
.
close
();
})
})
},
},
validateMaterialName
(
rule
,
value
,
callback
){
validateMaterialName
(
rule
,
value
,
callback
){
...
...
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