Commit 9fc68259 authored by wzy's avatar wzy

feat: 价格库跳转搜索物料

parent 4f716d01
import React, { useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import { Button, Card, Input, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import StandardTable from '@/components/StandardTable';
......@@ -18,6 +18,7 @@ const formActions = createFormActions();
const PriceLibrary: React.FC<{}> = () => {
const intl = useIntl();
const ref = useRef<any>({});
const { code } = history.location.query;
const columns: ColumnType<any>[] = [
{
......@@ -158,10 +159,12 @@ const PriceLibrary: React.FC<{}> = () => {
const fetchData = (params: any) => {
return new Promise(resolve => {
getProductPriceManagementGetGoodsPriceList(params).then(res => {
const { data } = res;
resolve(data);
});
getProductPriceManagementGetGoodsPriceList({ code, ...params }).then(
res => {
const { data } = res;
resolve(data);
},
);
});
};
......@@ -192,6 +195,11 @@ const PriceLibrary: React.FC<{}> = () => {
}
});
};
useEffect(() => {
if (code) {
formActions.setFieldValue('code', code);
}
}, [code]);
return (
<PageHeaderWrapper>
<Card>
......
......@@ -103,11 +103,7 @@ const Bills: React.FC<{}> = () => {
})
.then(res => {
if (res.code !== 1000) {
if(res.code === 9999) {
message.info(res.message)
} else {
message.info(intl.formatMessage({ id: `${res.code}`, defaultMessage: res.message}))
}
message.info(res.message)
return;
}
if (callback) {
......
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