|
|
@@ -10,10 +10,12 @@ type Props = {
|
|
|
};
|
|
|
|
|
|
const AddModal: FC<Props> = function ({visible, onClose, onFetch}) {
|
|
|
- const [materialOptions, onMaterialSearch] = useDictionaryWidthCode('物料字典');
|
|
|
- const [supplierOptions, onSupplierSearch] = useDictionaryWidthCode('供应商/客户', {
|
|
|
- findValue: state => state.code,
|
|
|
- });
|
|
|
+ const [{data: materialOptions, isFetching: isMaterialFetching}, onMaterialSearch] =
|
|
|
+ useDictionaryWidthCode('物料字典');
|
|
|
+ const [{data: supplierOptions, isFetching: isSupplierFetching}, onSupplierSearch] =
|
|
|
+ useDictionaryWidthCode('供应商/客户', {
|
|
|
+ findValue: state => state.code,
|
|
|
+ });
|
|
|
const [{control, isLoading}, {onSubmit}] = useFormState({
|
|
|
visible,
|
|
|
onClose,
|
|
|
@@ -42,6 +44,7 @@ const AddModal: FC<Props> = function ({visible, onClose, onFetch}) {
|
|
|
label='物料'
|
|
|
name='materialId'
|
|
|
onSearch={onMaterialSearch}
|
|
|
+ loading={isMaterialFetching}
|
|
|
/>
|
|
|
<ModalSelect data={measUnitOptions} control={control} label='计量单位' name='measUnitId' />
|
|
|
<ModalField name='purchaseCount' label='采购数量' control={control} type='number' />
|
|
|
@@ -54,6 +57,7 @@ const AddModal: FC<Props> = function ({visible, onClose, onFetch}) {
|
|
|
label='供应商'
|
|
|
name='supplierNo'
|
|
|
onSearch={onSupplierSearch}
|
|
|
+ loading={isSupplierFetching}
|
|
|
/>
|
|
|
<ModalSelect data={corporationOptions} control={control} label='公司' name='companyNo' />
|
|
|
<ModalDate control={control} label='订单日期' name='poDate' />
|