Commit e8b38b09 authored by guang.wu's avatar guang.wu

fix: 修改提示语

parent 98e6d4fb
...@@ -12,6 +12,7 @@ const UpdatePriceStock = options => { ...@@ -12,6 +12,7 @@ const UpdatePriceStock = options => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [specArr, setSpecArr] = useState([]); // 规格列 const [specArr, setSpecArr] = useState([]); // 规格列
const [form] = Form.useForm(); const [form] = Form.useForm();
const [errorMsg, setErrorMsg] = useState([]); // 错误信息
const onSubmit = async () => { const onSubmit = async () => {
const value = await form.validateFields(); const value = await form.validateFields();
...@@ -21,11 +22,15 @@ const UpdatePriceStock = options => { ...@@ -21,11 +22,15 @@ const UpdatePriceStock = options => {
skus: value.data, skus: value.data,
}; };
setLoading(true); setLoading(true);
setErrorMsg([]);
const res = await apiProductBiddingUpdate(params); const res = await apiProductBiddingUpdate(params);
setLoading(false); setLoading(false);
if (res?.success) { if (res?.success) {
options.refresh(); options.refresh();
options.onCancel(); options.onCancel();
} else {
const msg = res?.msg || '修改失败';
setErrorMsg(msg.split(';'));
} }
}; };
...@@ -87,6 +92,13 @@ const UpdatePriceStock = options => { ...@@ -87,6 +92,13 @@ const UpdatePriceStock = options => {
/> />
</EditableContext.Provider> </EditableContext.Provider>
</Form> </Form>
{errorMsg && (
<div className={styles.errorMsg}>
{errorMsg.map(item => (
<div key={item}>{item}</div>
))}
</div>
)}
</Modal> </Modal>
); );
}; };
......
...@@ -22,3 +22,7 @@ ...@@ -22,3 +22,7 @@
.button { .button {
margin: 0 5px; margin: 0 5px;
} }
.errorMsg {
padding: 10px 25px;
color: red;
}
...@@ -409,7 +409,8 @@ export async function apiProductBiddingUpdate(params) { ...@@ -409,7 +409,8 @@ export async function apiProductBiddingUpdate(params) {
return request.post('/api/merchants/products/bidding/edit', { return request.post('/api/merchants/products/bidding/edit', {
prefix: goodsApi, prefix: goodsApi,
data: params, data: params,
duration: 8, duration: null,
notTip: true,
}); });
} }
......
...@@ -139,7 +139,7 @@ request.interceptors.response.use(async (response, options) => { ...@@ -139,7 +139,7 @@ request.interceptors.response.use(async (response, options) => {
if (data.businessCode && data.businessCode !== '0000' && !options.notTip) { if (data.businessCode && data.businessCode !== '0000' && !options.notTip) {
notification.warning({ notification.warning({
message: data.detail || data.msg || '操作失败', message: data.detail || data.msg || '操作失败',
duration: options.duration || 4.5, duration: typeof options.duration === 'undefined' ? 4.5 : options.duration,
}); });
} }
return response; return response;
......
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