Commit bff8fce3 authored by 卢均锐's avatar 卢均锐

feat: 还原物料查询库存按钮

parent 9075fdac
......@@ -183,9 +183,11 @@ const MaterialQuery = () => {
}
})
} else {
formActions.setFieldValue('customerCategoryId', undefined)
setQuerySchema(getSchema({ showStatus: true }))
const _paths = customerCategoryValues?.map((item) => `customerCategoryId${item.id}`)?.join(',');
_paths && formActions.setFieldValue(`*(${_paths})`,undefined)
_paths && formActions.setFieldValue(`*(${_paths})`, undefined);
setCustomerCategoryValues(undefined)
}
}, [customerCategoryId])
......@@ -251,15 +253,15 @@ const MaterialQuery = () => {
</Menu.Item>
</AuthButton>
),
// (
// // <AuthButton key="priceLibrary" btnCode='material.toPriceLibrary'>
// <Menu.Item key="stockSellStorage">
// <Link to={`/memberCenter/commodityAbility/stockSellStorage/inventory?code=${record.code}`}>
// 库存
// </Link>
// </Menu.Item>
// // </AuthButton>
// ),
(
<AuthButton key="priceLibrary" btnCode='material.toStockSellStorage'>
<Menu.Item key="stockSellStorage">
<Link to={`/memberCenter/commodityAbility/stockSellStorage/inventory?code=${record.code}`}>
{intl.formatMessage({ id: 'commodity.kucun', defaultMessage: '库存' })}
</Link>
</Menu.Item>
</AuthButton>
),
].filter(Boolean);
const menu = (
<Menu>
......@@ -473,7 +475,7 @@ const MaterialQuery = () => {
controlRender={
<NiceForm
components={{ controllerBtns, Cascader }}
schema={querySchema()}
schema={querySchema}
actions={formActions}
onSubmit={handleSearch}
effects={($, actions) => {
......@@ -483,7 +485,13 @@ const MaterialQuery = () => {
useAsyncSelect('brandId', fetchBrand, ["name", "id"])
useAsyncSelect('status', fetchStatus, ["name", "status"])
$('onFieldChange', 'customerCategoryId').subscribe(state => {
setCustomerCategoryId(((state?.value?.length !== undefined || state?.value?.length !== null) && state?.value?.length > 0) ? state?.value[state?.value?.length - 1] : undefined)
const _value = ((state?.value?.length !== undefined || state?.value?.length !== null) && state?.value?.length > 0) ? state?.value[state?.value?.length - 1] : undefined;
if (!_value) {
state.value = undefined;
state.values = [undefined];
state.visibleCacheValue = undefined;
}
setCustomerCategoryId(_value)
})
}}
/>
......
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