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

fix: 修改提示语

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