Commit dd6d6ccb authored by 武广's avatar 武广

Merge branch 'feature/goods-list' of git.quantgroup.cn:ui/merchant-manage-ui...

Merge branch 'feature/goods-list' of git.quantgroup.cn:ui/merchant-manage-ui into feature/20230327_public_takeaway
parents 7925fcf2 1cffc854
...@@ -3,6 +3,7 @@ import { Modal, Form, InputNumber, Checkbox, Switch } from 'antd'; ...@@ -3,6 +3,7 @@ import { Modal, Form, InputNumber, Checkbox, Switch } from 'antd';
import { deepClone } from '@/utils/utils'; import { deepClone } from '@/utils/utils';
import styles from '../../style.less'; import styles from '../../style.less';
import { apiProductStock } from '../../service'; import { apiProductStock } from '../../service';
import { isIntegerNotZero } from '@/utils/validator';
const StockModal = options => { const StockModal = options => {
const [stockType, setStockType] = useState(0); const [stockType, setStockType] = useState(0);
...@@ -81,7 +82,7 @@ const StockModal = options => { ...@@ -81,7 +82,7 @@ const StockModal = options => {
} }
}, [options.visible]); }, [options.visible]);
const maxStockRule = []; const maxStockRule = [{ validator: isIntegerNotZero, message: '请输入大于0的整数' }];
if (isChecked) { if (isChecked) {
maxStockRule.push({ required: true, message: '请输入最大库存!' }); maxStockRule.push({ required: true, message: '请输入最大库存!' });
} }
...@@ -111,7 +112,10 @@ const StockModal = options => { ...@@ -111,7 +112,10 @@ const StockModal = options => {
name="productStock" name="productStock"
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
wrapperCol={{ span: 8 }} wrapperCol={{ span: 8 }}
rules={[{ required: true, message: '请输入剩余库存!' }]} rules={[
{ required: true, message: '请输入剩余库存!' },
{ validator: isIntegerNotZero, message: '请输入大于0的整数' },
]}
> >
<InputNumber <InputNumber
min={0} min={0}
......
...@@ -109,6 +109,7 @@ const Takeaway = options => { ...@@ -109,6 +109,7 @@ const Takeaway = options => {
}; };
setActionLoading(true); setActionLoading(true);
const res = await apiGoodsActionBatch(Object.assign({}, json, params)); const res = await apiGoodsActionBatch(Object.assign({}, json, params));
setActionLoading(false);
if (res.businessCode === '0000' && res.code === '0000') { if (res.businessCode === '0000' && res.code === '0000') {
message.success('处理成功!'); message.success('处理成功!');
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment