Commit 5ea7c029 authored by wzy's avatar wzy

feat: 请购人

parent 21096ac7
......@@ -614,6 +614,7 @@ export default {
'purchaseRequisition.qingshuruqinggouDigest': '请输入请购单摘要',
'purchaseRequisition.qingshurugongying': '请输入供应会员名称',
'purchaseRequisition.qingshuruqinggouDepartment': '请输入请购部门',
'purchaseRequisition.qingshuruqinggouPenson': '请输入请购人',
'purchaseRequisition.qingshuruqinggouUse': '请输入请购用途',
'purchaseRequisition.qingxuanzeneibu': '请选择内部状态',
'purchaseRequisition.kaishishijian': '开始时间',
......
......@@ -67,6 +67,18 @@ export const tableSearchListSchema: any = (align?: String, colStyle?: Object) =>
placeholder: intl.formatMessage({ id: 'purchaseRequisition.qingshuruqinggouDepartment', defaultMessage: '请输入请购部门' })
}
},
"qinggouPenson": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({ id: 'purchaseRequisition.qingshuruqinggouPenson', defaultMessage: '请输入请购人' }),
showSearch: true,
// defaultActiveFirstOption: false,
// showArrow: false,
// filterOption: false,
onSearch: '{{handleSearch}}'
},
enum: []
},
"purpose": {
type: 'string',
"x-component-props": {
......@@ -146,6 +158,18 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
placeholder: intl.formatMessage({ id: 'purchaseRequisition.qingshuruqinggouDepartment', defaultMessage: '请输入请购部门' })
}
},
"qinggouPenson": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({ id: 'purchaseRequisition.qingshuruqinggouPenson', defaultMessage: '请输入请购人' }),
showSearch: true,
// defaultActiveFirstOption: false,
// showArrow: false,
// filterOption: false,
onSearch: '{{handleSearch}}'
},
enum: []
},
"purpose": {
type: 'string',
"x-component-props": {
......
import { getProductSelectGetSelectBrand } from "@/services/ProductV2Api"
export const searchOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
getProductSelectGetSelectBrand({ name: state.props['x-component-props'].searchValue }).then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
......@@ -12,6 +12,8 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import '../index.less'
import { tableListSchema } from '../constant'
import { getPurchaseRequisitionCreatePage } from '@/services/PurchaseV2Api'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { searchOptionEffect } from './effect';
// 待新增请购单
......@@ -28,6 +30,15 @@ const ReadyAddBill:React.FC<ReadyAddBillProps> = () => {
const clickAdd = () => {
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/add`)
}
const formActions = createFormActions();
const handleSearch = value => {
if (!value) {
formActions.setFieldState('qinggouPenson', fieldState => {
fieldState.props.enum = [];
});
return;
}
};
return <PageHeaderWrapper>
<Card>
......@@ -50,6 +61,9 @@ const ReadyAddBill:React.FC<ReadyAddBillProps> = () => {
'requisitionNo',
FORM_FILTER_PATH,
);
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchOptionEffect(actions, 'brandId')
})
},
components: {
DateRangePickerUnix,
......
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