Commit bbeba92f authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

Merge branch 'v2-220418' into 20418order

parents 3290a0d8 e0692cf6
...@@ -221,8 +221,11 @@ const IncreaseRequisition: React.FC<{}> = () => { ...@@ -221,8 +221,11 @@ const IncreaseRequisition: React.FC<{}> = () => {
// 自定义组建 // 自定义组建
const RadioNode = () => { const RadioNode = () => {
const value = deliveryTypeList.filter((item) => !item.disabled);
return ( return (
<Radio.Group onChange={changeDeliveryType} defaultValue={id ? deliveryType : ""}> // defaultValue={id ? deliveryType : value ? value.deliveryType : ''}
<Radio.Group onChange={changeDeliveryType} defaultValue={id ? deliveryType : value.length ? value[0].deliveryType : ''}>
<div className={styles.RadioMian}> <div className={styles.RadioMian}>
{ {
deliveryTypeList.map((item) => ( deliveryTypeList.map((item) => (
......
...@@ -10,19 +10,39 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke ...@@ -10,19 +10,39 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import '../index.less' import '../index.less'
import { tableListSchema } from '../constant' import { tableListSchema } from '../constant'
import { getPurchaseRequisitionTransferPurchasePage } from '@/services/PurchaseV2Api' import { getPurchaseRequisitionTransferPurchasePage } from '@/services/PurchaseV2Api'
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { searchOptionEffect } from '../readyAddBill/effect';
import { getMemberUserPage } from '@/services/MemberV2Api';
// 待请购单转采购订单 // 待请购单转采购订单
export interface RequisitionOrderProps {} export interface RequisitionOrderProps { }
const fetchTableData = async (params) => { const fetchTableData = async (params) => {
const { data } = await getPurchaseRequisitionTransferPurchasePage(params) const { data } = await getPurchaseRequisitionTransferPurchasePage(params)
return data return data
} }
const RequisitionOrder:React.FC<RequisitionOrderProps> = () => { const RequisitionOrder: React.FC<RequisitionOrderProps> = () => {
const { columns, ref } = useSelfTable() const { columns, ref } = useSelfTable()
const formActions = createFormActions();
const controllerBtns = null;
const handleSearch = async value => {
if (!value) {
formActions.setFieldState('requisitionerId', fieldState => {
fieldState.props.enum = [];
});
return;
}
const data: any = { name: value, status: '1', pageSize: 10, current: 1 }
const res = await getMemberUserPage(data)
const list = res.data.data.map((item) => { return { label: item.name, value: item.userId } })
formActions.setFieldState('requisitionerId', fieldState => {
fieldState.props.enum = list;
});
};
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
...@@ -30,6 +50,38 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => { ...@@ -30,6 +50,38 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => {
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey="id" rowKey="id"
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
handleSearch,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'requisitionNo',
FORM_FILTER_PATH,
);
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchOptionEffect(actions, 'brandId')
})
}}
schema={tableListSchema()}
components={{
DateRangePickerUnix,
Submit,
}}
/>
}
/>
{/* <StandardTable
fetchTableData={params => fetchTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
...@@ -55,7 +107,7 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => { ...@@ -55,7 +107,7 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => {
span: 24 span: 24
} }
}} }}
/> /> */}
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
......
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