Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
4d334927
Commit
4d334927
authored
Sep 26, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改价格校验
parent
d1372010
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
24 deletions
+48
-24
env.config.js
config/env.config.js
+10
-10
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+1
-2
FormPackage.jsx
src/pages/ServiceGoods/components/FormPackage.jsx
+3
-3
FormPriceOrStock.jsx
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
+10
-3
FormSettlementOthers.jsx
src/pages/ServiceGoods/components/FormSettlementOthers.jsx
+1
-1
config.js
src/pages/ServiceGoods/config.js
+5
-5
index.jsx
src/pages/ServiceGoods/index.jsx
+1
-0
validator.js
src/utils/validator.js
+17
-0
No files found.
config/env.config.js
View file @
4d334927
...
...
@@ -2,19 +2,19 @@ const isProduction = process.env.NODE_ENV === 'production';
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
envAPi
=
{
api
:
'
https://security-
sc.liangkebang.net
'
,
//'https://security-sc
.liangkebang.net',
kdspOpApi
:
'
https://sc-merchant-api-
sc
.liangkebang.net
'
,
kdspApi
:
'
https://sc-merchant-api-
sc
.liangkebang.net
'
,
goodsApi
:
'
https://sc-merchant-api-
sc
.liangkebang.net
'
,
// kdspOpApi: 'https://kdsp-operation-
sc
.liangkebang.net',
// kdspApi: 'https://sc-op-api-
sc
.liangkebang.net',
// goodsApi: 'https://sc-op-api-
sc
.liangkebang.net',
querysApi
:
'
https://sc-settlement-api-
sc
.liangkebang.net
'
,
api
:
'
https://security-
xyqb.liangkebang.net
'
,
//'https://security-xyqb
.liangkebang.net',
kdspOpApi
:
'
https://sc-merchant-api-
xyqb
.liangkebang.net
'
,
kdspApi
:
'
https://sc-merchant-api-
xyqb
.liangkebang.net
'
,
goodsApi
:
'
https://sc-merchant-api-
xyqb
.liangkebang.net
'
,
// kdspOpApi: 'https://kdsp-operation-
xyqb
.liangkebang.net',
// kdspApi: 'https://sc-op-api-
xyqb
.liangkebang.net',
// goodsApi: 'https://sc-op-api-
xyqb
.liangkebang.net',
querysApi
:
'
https://sc-settlement-api-
xyqb
.liangkebang.net
'
,
// goodsApi: '//192.168.188.111:7000',
prologueDomain
:
'
https://mall-
sc
.liangkebang.net
'
,
prologueDomain
:
'
https://mall-
xyqb
.liangkebang.net
'
,
// qiniuHost: 'https://appsync.lkbang.net',
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
opapiHost
:
'
https://opapi-
sc
.liangkebang.net
'
,
opapiHost
:
'
https://opapi-
xyqb
.liangkebang.net
'
,
};
const
prodApi
=
{
...
...
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
4d334927
...
...
@@ -92,7 +92,6 @@ const FormInformationBasic = forwardRef((props, ref) => {
rules=
{
[{
type
:
'
array
'
,
required
:
true
,
message
:
'
请输入商品类目!
'
}]
}
>
<
Cascader
disabled=
{
customer
.
isService
}
placeholder=
"请选择商品类目!"
showSearch=
{
{
filter
:
filterCategoryOptions
}
}
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
...
...
@@ -127,7 +126,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
{
required
:
true
,
min
:
2
,
message
:
'
请输入最少两个字符的商品名称!
'
,
whitespace
:
true
},
]
}
>
<
Input
disabled=
{
customer
.
isService
}
placeholder=
"请输入商品名称"
/>
<
Input
placeholder=
"请输入商品名称"
/>
</
Form
.
Item
>
</
Popover
>
{
customer
.
isJDGoods
&&
(
...
...
src/pages/ServiceGoods/components/FormPackage.jsx
View file @
4d334927
...
...
@@ -2,7 +2,7 @@ import React, { useState, forwardRef, useEffect, useImperativeHandle } from 'rea
import
{
Form
,
Button
,
Row
,
Col
,
Input
,
Select
,
Modal
,
notification
}
from
'
antd
'
;
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
styles
from
'
../common.less
'
;
import
{
isIntegerNotZero
,
isCheck
NumberPrice
}
from
'
@/utils/validator
'
;
import
{
isIntegerNotZero
,
isCheck
PriceOneDecimal
}
from
'
@/utils/validator
'
;
import
UUID
from
'
@/utils/uuid
'
;
const
{
Option
}
=
Select
;
...
...
@@ -59,7 +59,7 @@ const FormCai = forwardRef((props, ref) => {
name=
{
[
name
,
'
dishName
'
]
}
rules=
{
[{
required
:
true
,
message
:
'
请输入菜名.
'
}]
}
>
<
Input
maxLength=
{
30
}
/>
<
Input
maxLength=
{
10
}
placeholder=
"最多10个字符"
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
2
}
>
...
...
@@ -82,7 +82,7 @@ const FormCai = forwardRef((props, ref) => {
name=
{
[
name
,
'
price
'
]
}
rules=
{
[
{
required
:
true
,
message
:
'
请输入价格.
'
},
{
validator
:
isCheck
NumberPrice
,
message
:
'
请输入正确的价格
'
},
{
validator
:
isCheck
PriceOneDecimal
,
message
:
'
请输入正确的价格
'
},
]
}
>
<
Input
maxLength=
{
10
}
/>
...
...
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
View file @
4d334927
...
...
@@ -202,7 +202,7 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu
fieldNames=
{
{
label
:
'
secondSpecValue
'
,
value
:
'
secondSpecValue
'
}
}
/>
{
formItems
.
concat
(
<
Button
key=
"batch"
type=
"primary"
disabled=
{
customer
.
isService
}
onClick=
{
batchChange
}
>
<
Button
key=
"batch"
type=
"primary"
onClick=
{
batchChange
}
>
批量设置
</
Button
>,
)
}
...
...
@@ -230,7 +230,14 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const
setMealContent
=
await
packageRef
.
current
.
onCheck
();
const
values
=
await
form
.
validateFields
();
const
items
=
await
editRef
.
current
.
onCheck
();
if
(
items
)
{
if
(
!
setMealContent
)
{
notification
.
open
({
message
:
'
提示
'
,
description
:
'
请添加正确的套餐信息!
'
,
});
return
null
;
}
if
(
items
&&
setMealContent
)
{
return
{
...
values
,
items
,
setMealContent
,
temp
:
'
infoSpecData
'
};
}
notification
.
open
({
...
...
@@ -394,7 +401,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
specDataList=
{
specInitValue
.
secondSpecValue
}
/>
<
div
style=
{
{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
marginBottom
:
20
}
}
>
<
Button
type=
"primary"
disabled=
{
customer
.
isService
}
onClick=
{
onFinish
}
>
<
Button
type=
"primary"
onClick=
{
onFinish
}
>
生成商品信息
</
Button
>
</
div
>
...
...
src/pages/ServiceGoods/components/FormSettlementOthers.jsx
View file @
4d334927
...
...
@@ -134,7 +134,7 @@ const FormSettlementOthers = forwardRef((props, ref) => {
<
Form
.
Item
name=
"receptionVolume"
label=
"每日最低接待量"
rules=
{
[{
required
:
true
,
message
:
'
每日最低接待量
'
}]
}
//
rules={[{ required: true, message: '每日最低接待量' }]}
>
<
InputNumber
min=
{
0
}
style=
{
{
width
:
200
}
}
placeholder=
"请输入每日最低接待量"
/>
</
Form
.
Item
>
...
...
src/pages/ServiceGoods/config.js
View file @
4d334927
...
...
@@ -27,7 +27,7 @@ export const TaskList = [
},
detailImageList
:
{
title
:
'
详情图
'
,
//
rule: true,
rule
:
true
,
limit
:
null
,
renderExtra
:
()
=>
'
(图片最大上传2M)
'
,
},
...
...
@@ -165,7 +165,7 @@ export const StaticColumns = customer => [
min
:
0
,
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
isJDGoods
||
customer
.
isService
,
disabeldRender
:
()
=>
customer
.
isJDGoods
,
},
{
title
:
'
佣金费率
'
,
...
...
@@ -188,7 +188,7 @@ export const StaticColumns = customer => [
min
:
0
,
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
isService
,
//
disabeldRender: () => customer.isService,
},
{
title
:
'
销售价
'
,
...
...
@@ -219,7 +219,7 @@ export const StaticColumns = customer => [
precision
:
3
,
max
:
999999.999
,
},
disabeldRender
:
()
=>
customer
.
isService
,
//
disabeldRender: () => customer.isService,
},
{
title
:
'
库存
'
,
...
...
@@ -250,7 +250,7 @@ export const StaticColumns = customer => [
precision
:
0
,
maxLength
:
5
,
},
disabeldRender
:
()
=>
customer
.
isService
,
//
disabeldRender: () => customer.isService,
},
{
title
:
'
商品自编码
'
,
...
...
src/pages/ServiceGoods/index.jsx
View file @
4d334927
...
...
@@ -241,6 +241,7 @@ const ServiceGoods = options => {
title=
{
isEdit
?
'
修改商品
'
:
'
新增商品
'
}
visible=
{
options
.
visible
}
onCancel=
{
()
=>
handleCancel
()
}
destroyOnClose
width=
{
1050
}
maskClosable=
{
false
}
keyboard=
{
false
}
...
...
src/utils/validator.js
View file @
4d334927
...
...
@@ -402,3 +402,20 @@ export function isCheckNumberPrice(rule, value, callback) {
callback
();
}
}
// 验证价格保留小数点1位
export
function
isCheckPriceOneDecimal
(
rule
,
value
,
callback
)
{
const
num
=
+
value
;
const
arr
=
`
${
value
}
`
.
split
(
'
.
'
);
if
(
!
value
)
{
callback
();
}
else
if
(
Number
.
isNaN
(
num
))
{
callback
(
new
Error
(
'
请输入数字
'
));
}
else
if
(
num
<
0
)
{
callback
(
new
Error
(
'
请输入大于0的数字
'
));
}
else
if
(
arr
.
length
===
2
&&
arr
[
1
].
length
>
1
)
{
callback
(
new
Error
(
'
小数点保留1位
'
));
}
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