Commit 8879b7db authored by 靳野's avatar 靳野

fix:修复价格与库存单位显示问题

parent 5a1ffce2
......@@ -233,6 +233,7 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const editRef = useRef(null);
const packageRef = useRef(null);
const customer = useContext(ServiceContext);
const customerRef = useRef(customer);
const [form] = Form.useForm();
const [specInitValue, setSpecInitValue] = useState(initSpecReced());
......@@ -321,7 +322,9 @@ const FormPriceOrStock = forwardRef((props, ref) => {
const isGoodsManage = window.location.pathname.indexOf('popGoodsManage') < 0;
const dynamicColumns = [
...columsData,
...(isGoodsManage ? StaticColumns(customer) : StaticColumnsPop(customer)),
...(isGoodsManage
? StaticColumns(customerRef.current)
: StaticColumnsPop(customerRef.current)),
];
setDefaultColumns(dynamicColumns);
};
......@@ -444,6 +447,10 @@ const FormPriceOrStock = forwardRef((props, ref) => {
},
}));
useEffect(() => {
customerRef.current = customer;
}, [customer]);
useEffect(() => {
if (customer.isEdit || customer.isUseCache) {
if (!editData) {
......
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