Commit d7514cfb authored by Bill's avatar Bill

对接待新增生产通知单

parent 57a54c8f
...@@ -45,5 +45,4 @@ export const fetchOptions = (service) => { ...@@ -45,5 +45,4 @@ export const fetchOptions = (service) => {
} }
return []; return [];
} }
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ import EnterPrise from '../../components/EnterPrise'; ...@@ -13,6 +13,7 @@ import EnterPrise from '../../components/EnterPrise';
import ProcessProducts from '../../components/ProcessProducts'; import ProcessProducts from '../../components/ProcessProducts';
import ProcessOrder from '../../components/ProcessOrder'; import ProcessOrder from '../../components/ProcessOrder';
import {WrapUploadFile} from '../../components/UploadFile'; import {WrapUploadFile} from '../../components/UploadFile';
import { PublicApi } from '@/services/api';
/* /*
* @Author: Bill * @Author: Bill
...@@ -21,7 +22,7 @@ import {WrapUploadFile} from '../../components/UploadFile'; ...@@ -21,7 +22,7 @@ import {WrapUploadFile} from '../../components/UploadFile';
*/ */
const formActions = createFormActions(); const formActions = createFormActions();
const { onFieldValueChange$ } = FormEffectHooks const { onFieldValueChange$, onFieldMount$ } = FormEffectHooks
const Add: React.FC<{}> = () => { const Add: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false); const [submitLoading, setSubmitLoading] = useState<boolean>(false);
...@@ -92,10 +93,19 @@ const Add: React.FC<{}> = () => { ...@@ -92,10 +93,19 @@ const Add: React.FC<{}> = () => {
setActiveSource(value); setActiveSource(value);
} }
}) })
// 设置自提的时候隐藏地址 // 当物流为 物流时,那么填充
onFieldValueChange$('Tabs.tab-1.layout.method').subscribe(({value}) => { onFieldMount$('receiveAddress').subscribe((state) => {
formActions.setFieldState('address', state => { PublicApi.getLogisticsReceiverAddressPage({current: '1', pageSize: '10'})
state.visible = value == 1 .then((res) => {
let options = []
if(res.code === 1000) {
options = res.data.data.map((item) => {
return { label: `${item.fullAddress} / ${item.receiverName} / ${item.phone}`, value: item.id }}
)
}
formActions.setFieldState("receiveAddress", (state) => {
state.props["x-component-props"]["options"] = options;
})
}) })
}) })
} }
...@@ -115,8 +125,11 @@ const Add: React.FC<{}> = () => { ...@@ -115,8 +125,11 @@ const Add: React.FC<{}> = () => {
* @param rows * @param rows
*/ */
const enterPriseOnOk = (rows) => { const enterPriseOnOk = (rows) => {
console.log(rows.selectRow) const { memberId, name, roleId } = rows.selectRow[0];
formActions.setFieldValue('Tabs.tab-1.layout.handleBusiness', "123") formActions.setFieldValue('Tabs.tab-1.layout.processName', name);
formActions.setFieldValue('Tabs.tab-1.layout.processMemberId', memberId);
formActions.setFieldValue('Tabs.tab-1.layout.processRoleId', roleId);
} }
/** /**
...@@ -143,6 +156,11 @@ const Add: React.FC<{}> = () => { ...@@ -143,6 +156,11 @@ const Add: React.FC<{}> = () => {
console.log(values); console.log(values);
} }
useEffect(() => {
// 默认情况下选择订单加工,那么此时默认填写通知单摘要为订单商品的第一条数据
formActions.setFieldValue('Tabs.tab-1.layout.summary', "进口头层黄牛皮荔枝纹")
}, [])
/** 逻辑 end */ /** 逻辑 end */
return ( return (
......
...@@ -77,11 +77,15 @@ const basicTab = { ...@@ -77,11 +77,15 @@ const basicTab = {
labelAlign: 'left' labelAlign: 'left'
}, },
properties: { properties: {
desc: { summary: {
title: '通知单摘要', title: '通知单摘要',
type: 'string', type: 'string',
'x-rules': [ 'x-rules': [
{ {
required: true,
message: '请填写通知单摘要'
},
{
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 60
} }
...@@ -90,7 +94,7 @@ const basicTab = { ...@@ -90,7 +94,7 @@ const basicTab = {
placeholder: '最长60个字符,30个汉字' placeholder: '最长60个字符,30个汉字'
} }
}, },
handleBusiness: { processName: {
type: 'string', type: 'string',
title: '加工企业', title: '加工企业',
"x-component-props": { "x-component-props": {
...@@ -104,6 +108,14 @@ const basicTab = { ...@@ -104,6 +108,14 @@ const basicTab = {
} }
], ],
}, },
processMemberId: { //加工企业会员ID
type: 'string',
display: false
},
processRoleId: { //加工企业会员角色ID
type: 'string',
display: false,
},
source: { source: {
type: 'radio', type: 'radio',
title: '通知单来源', title: '通知单来源',
...@@ -121,7 +133,7 @@ const basicTab = { ...@@ -121,7 +133,7 @@ const basicTab = {
default: 1 default: 1
}, },
time: { deliveryDate: {
type: 'string', type: 'string',
title: '交期', title: '交期',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
...@@ -132,7 +144,7 @@ const basicTab = { ...@@ -132,7 +144,7 @@ const basicTab = {
} }
] ]
}, },
method: { deliveryType: {
type: 'string', type: 'string',
title: '配送方式', title: '配送方式',
'x-component': 'Select', 'x-component': 'Select',
...@@ -147,9 +159,16 @@ const basicTab = { ...@@ -147,9 +159,16 @@ const basicTab = {
required: true, required: true,
message: '请选择物流方式' message: '请选择物流方式'
} }
] ],
'x-linkages': [
{
type: 'value:visible',
target: 'receiveAddress',
condition: '{{$value == 1}}'
}
],
}, },
address: { receiveAddress: {
type: 'string', type: 'string',
title: '收货地址', title: '收货地址',
'x-rules': [ 'x-rules': [
...@@ -160,9 +179,7 @@ const basicTab = { ...@@ -160,9 +179,7 @@ const basicTab = {
], ],
'x-component': 'Select', 'x-component': 'Select',
'x-component-props': { 'x-component-props': {
options: [
{label: 'test', value: 1}
]
} }
}, },
docNo: { docNo: {
......
/**
* 时间
*/
export const commonTimeList = [
{ label: '今天', value: 1},
{ label: '一周内', value: 2},
{ label: '一个月内', value: 3},
{ label: '三个月内', value: 4},
{ label: '六个月内', value: 5},
{ label: '一年内', value: 6 },
{ label: '一年前', value: 7}
];
/**
* 单据时间
*/
export const docTime = [{label: '单据时间(全部)', value: 0}].concat(commonTimeList);
...@@ -2,54 +2,17 @@ import React, { useState } from 'react'; ...@@ -2,54 +2,17 @@ import React, { useState } from 'react';
import { Modal} from 'antd'; import { Modal} from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import { BasicForm, TablePagination, SearchForm } from '../ModalForTable' import { SearchForm } from '../ModalForTable'
import { createAsyncFormActions } from '@formily/antd'; import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { schema } from './schema';
const actions = createAsyncFormActions(); const actions = createAsyncFormActions();
const columns = [ const { onFieldInit$ } = FormEffectHooks
{
title: '会员ID',
dataIndex: 'id'
},
{
title: '会员名称',
dataIndex: 'name'
},
{
title: '会员类型',
dataIndex: 'type'
},
{
title: '会员角色',
dataIndex: 'role'
},
{
title: '会员等级',
dataIndex: 'level'
}
]
const tableSchema = {
table: {
type: "object",
name: "table",
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "id",
"pagination":false,
"rowSelection": "{{rowSelection}}"
}
},
}
const schema = processProductSchema(tableSchema);
const EnterPrise = ({visible, cancel, ...restProps}) => { const EnterPrise = ({visible, cancel, ...restProps}) => {
const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' }); const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
let res = await PublicApi.getManageContentColumnPage(params); let res = await PublicApi.getMemberManageLowerPageBynamerole(params);
return res; return res;
}; };
...@@ -58,6 +21,21 @@ const EnterPrise = ({visible, cancel, ...restProps}) => { ...@@ -58,6 +21,21 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
cancel(); cancel();
} }
const effects = () => {
onFieldInit$('roleId').subscribe((fieldState) => {
PublicApi.getMemberManageRoleSubList().then(res => {
let options = []
if(res.code === 1000) {
options = res.data.map((item) => {return { label: item.roleName, value: item.roleId }})
}
actions.setFieldState("roleId", (state) => {
state.props["x-component-props"]["options"] = options;
})
})
})
}
return ( return (
<Modal <Modal
title="选择加工商品" title="选择加工商品"
...@@ -70,6 +48,7 @@ const EnterPrise = ({visible, cancel, ...restProps}) => { ...@@ -70,6 +48,7 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
request={fetchData} request={fetchData}
schema={schema} schema={schema}
actions={actions} actions={actions}
effects={effects}
expressionScope={{rowSelection: selectRow}} expressionScope={{rowSelection: selectRow}}
></SearchForm> ></SearchForm>
......
const columns = [
{
title: '会员ID',
dataIndex: 'memberId'
},
{
title: '会员名称',
dataIndex: 'name'
},
{
title: '会员类型',
dataIndex: 'memberTypeName'
},
{
title: '会员角色',
dataIndex: 'roleName'
},
{
title: '会员等级',
dataIndex: 'levelTag'
}
]
export const schema = {
type: 'object',
properties: {
layout: {
type: 'object',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between',
align: 'center'
},
properties: {
'flex-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexColumnLayout',
properties: {
controllers: {
type: 'object',
name: 'controllers',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start',
},
properties: {
name: {
type: 'string',
name: 'name',
'x-component': 'Search',
'x-component-props': {
placeholder: "请填写标题名称",
"onSearch": "{{search}}",
}
},
'HIGHT_FILTER_BTN': {
type: 'string',
name: 'HIGHT_FILTER_BTN',
'x-component': 'button',
'x-component-props': {
"children": "{{HIGHT_FILTER_BTN}}",
"onClick": "{{toggleFilters}}",
style: {
margin: '0 15px'
}
}
},
reset: {
type: 'string',
name: 'reset',
"x-component": "button",
"x-component-props": {
"onClick": "{{reset}}",
"children": "重置",
}
},
}
},
'FILTERS': {
type: 'object',
name: 'FILTERS',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start'
},
properties: {
roleId: {
name: 'columns',
type: 'string',
'x-component': 'Select',
'x-component-props': {
placeholder: '请选择角色',
allowClear:true,
style: {
width: '200px',
margin: '0 20px 0 0'
}
}
},
queryBtn: {
type: 'string',
'x-component': 'Submit',
"x-component-props": {
"children": "查询",
}
}
}
}
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
simple: true
}
}
}
},
table: {
type: "object",
name: "table",
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "memberId",
"pagination":false,
"rowSelection": "{{rowSelection}}"
}
},
}
}
\ No newline at end of file
...@@ -58,7 +58,7 @@ const SearchForm = (props) => { ...@@ -58,7 +58,7 @@ const SearchForm = (props) => {
}) })
actions.setFieldState('pagination', state => { actions.setFieldState('pagination', state => {
//@ts-ignore //@ts-ignore
state.props["x-component-props"]["total"] = totalCount; state.props["x-component-props"]["total"] = totalCount || 1;
}) })
} }
......
...@@ -3,37 +3,20 @@ import { Modal} from 'antd'; ...@@ -3,37 +3,20 @@ import { Modal} from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import { BasicForm, TablePagination, SearchForm } from '../ModalForTable' import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import { createAsyncFormActions } from '@formily/antd'; import { createAsyncFormActions, FormEffectHooks } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { schema } from './schema';
const { onFieldInit$ } = FormEffectHooks
const actions = createAsyncFormActions(); const actions = createAsyncFormActions();
const columns = [
{ title: 'ID', dataIndex: 'id'},
{ title: '商品名称', dataIndex: 'name'},
{ title: '上架商城', dataIndex: 'shop'},
{ title: '品类', dataIndex: 'type'},
{ title: '品牌', dataIndex: 'brand'}
]
const tableSchema = {
table: {
type: "object",
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "id",
"pagination":false,
// loading: true,
"rowSelection": "{{rowSelection}}"
}
},
}
const schema = processProductSchema(tableSchema);
const ProcessProducts = ({visible, cancel, ...restProps}) => { const ProcessProducts = ({visible, cancel, ...restProps}) => {
const [selectRow, setSelectRow] = useRowSelectionTable({ customKey: 'id' }); const [selectRow, setSelectRow] = useRowSelectionTable({ customKey: 'id' });
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
console.log(params); console.log(params);
let res = await PublicApi.getManageContentColumnPage(params); // /product/commodity/common/getCommodityListByBuyer
let res = await PublicApi.getProductCommodityCommonGetCommodityListByBuyer(params);
return res; return res;
}; };
...@@ -42,10 +25,38 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -42,10 +25,38 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
cancel(); cancel();
} }
const effects = () => {
onFieldInit$('branchId').subscribe((fieldState) => {
///product/select/getSelectBrand
PublicApi.getProductSelectGetSelectBrand({name: ''}).then(res => {
let options = []
if(res.code === 1000) {
options = res.data.map((item) => {return { label: item.name, value: item.id }})
}
actions.setFieldState("branchId", (state) => {
state.props["x-component-props"]["options"] = options;
})
})
});
onFieldInit$('categoryId').subscribe((fieldState) => {
///product/select/getSelectBrand
PublicApi.getProductSelectGetSelectCategory({name: ''}).then(res => {
let options = []
if(res.code === 1000) {
options = res.data.map((item) => {return { label: item.name, value: item.id }})
}
actions.setFieldState("categoryId", (state) => {
state.props["x-component-props"]["options"] = options;
})
})
})
}
return ( return (
<Modal <Modal
title="选择加工商品" title="选择加工商品"
width={704} width={1000}
visible={visible} visible={visible}
onCancel={cancel} onCancel={cancel}
onOk={onOk} onOk={onOk}
...@@ -54,6 +65,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -54,6 +65,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
request={fetchData} request={fetchData}
schema={schema} schema={schema}
actions={actions} actions={actions}
effects={effects}
expressionScope={{rowSelection: selectRow}} expressionScope={{rowSelection: selectRow}}
></SearchForm> ></SearchForm>
......
const columns = [
{ title: 'ID', dataIndex: 'id'},
{ title: '商品名称', dataIndex: 'name'},
{ title: '上架商城', dataIndex: 'shop'},
{ title: '品类', dataIndex: 'type'},
{ title: '品牌', dataIndex: 'brand'}
]
export const schema = {
type: 'object',
properties: {
layout: {
type: 'object',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between',
align: 'center'
},
properties: {
'flex-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexColumnLayout',
properties: {
controllers: {
type: 'object',
name: 'controllers',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start',
},
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: "请填写商品名称",
"onSearch": "{{search}}",
}
},
'HIGHT_FILTER_BTN': {
type: 'string',
'x-component': 'button',
'x-component-props': {
"children": "{{HIGHT_FILTER_BTN}}",
"onClick": "{{toggleFilters}}",
style: {
margin: '0 15px'
}
}
},
reset: {
type: 'string',
name: 'reset',
"x-component": "button",
"x-component-props": {
"onClick": "{{reset}}",
"children": "重置",
}
},
}
},
'FILTERS': {
type: 'object',
name: 'FILTERS',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'start'
},
properties: {
categoryId: {
type: 'string',
'x-component': 'Select',
'x-component-props': {
placeholder: '请选择商品品类',
allowClear:true,
style: {
width: '200px',
margin: '0 20px 0 0'
}
}
},
branchId: {
type: 'string',
'x-component': 'Select',
'x-component-props': {
placeholder: '请选择商品品牌',
allowClear:true,
style: {
width: '200px',
margin: '0 20px 0 0'
}
}
},
queryBtn: {
type: 'string',
'x-component': 'Submit',
"x-component-props": {
"children": "查询",
}
}
}
}
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
simple: true
}
}
}
},
table: {
type: "object",
name: "table",
"x-component": "Table",
"x-component-props": {
"columns": columns,
"rowKey": "memberId",
"pagination":false,
"rowSelection": "{{rowSelection}}"
}
},
}
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 指派生产通知单-生产通知单查询页 * 指派生产通知单-生产通知单查询页
*/ */
export const QUERY_SEARCH_NAME = "desc"; export const QUERY_SEARCH_NAME = "noticeNo";
/** /**
* 指派生产通知单-待新增生产通知单列表页 * 指派生产通知单-待新增生产通知单列表页
...@@ -36,4 +36,23 @@ export const PENDING_ADD_PROCESS = "desc" ...@@ -36,4 +36,23 @@ export const PENDING_ADD_PROCESS = "desc"
* 指派生产通知单-待收货生产通知单 * 指派生产通知单-待收货生产通知单
*/ */
export const PENDING_RECEIVE = "desc" export const PENDING_RECEIVE = "desc"
\ No newline at end of file
/**
* 下面设置各个 path 常量
*/
export const QUERY_PATH = '/query';
const QUERY_TITLE = '生产通知单查询';
/**
* 待新增生产通知单
*/
export const TO_BE_ADD_QUERY_PATH = '/tobeAddQuery';
const TO_BE_ADD_QUERY_TITLE = '待新增生产通知单';
export const TITLE_MAPS = {
[QUERY_PATH]: QUERY_TITLE,
[TO_BE_ADD_QUERY_PATH]: TO_BE_ADD_QUERY_TITLE
}
\ No newline at end of file
...@@ -27,41 +27,45 @@ import { ...@@ -27,41 +27,45 @@ import {
PENDING_SECOND_NOTICE, PENDING_SECOND_NOTICE,
PENDING_TO_SUBMIT, PENDING_TO_SUBMIT,
PENDING_ADD_PROCESS, PENDING_ADD_PROCESS,
PENDING_RECEIVE PENDING_RECEIVE,
TITLE_MAPS,
QUERY_PATH,
TO_BE_ADD_QUERY_PATH,
} from './contants'; } from './contants';
import { timeRange } from '@/utils';
const formActions = createFormActions(); const formActions = createFormActions();
const columns: ColumnsType = [ const columns: ColumnsType = [
{ {
title: '通知单号', title: '通知单号',
dataIndex: 'id', dataIndex: 'noticeNo',
}, },
{ {
title: '通知单摘要', title: '通知单摘要',
dataIndex: 'desc', dataIndex: 'summary',
}, },
{ {
title: '加工企业名称', title: '加工企业名称',
dataIndex: 'businessName' dataIndex: 'processName'
}, },
{ {
title: '单据时间', title: '单据时间',
dataIndex: 'create-at', dataIndex: 'createTime',
}, },
{ {
title: '外部状态', title: '外部状态',
dataIndex: 'status', dataIndex: 'outerStatusName',
}, },
{ {
title: '内部状态', title: '内部状态',
dataIndex: 'status2' dataIndex: 'innerStatusName'
} }
] ]
// 根据 lastTypeParams, 获取相对应的schema // 根据 lastTypeParams, 获取相对应的schema
const SCHEMAS = { const SCHEMAS = {
"/query": querySchema, [QUERY_PATH]: querySchema,
"/tobeAddQuery": tobeAddQuerySchema, [TO_BE_ADD_QUERY_PATH]: tobeAddQuerySchema,
"/pendingFirst": pendingFirstQuerySchema, "/pendingFirst": pendingFirstQuerySchema,
"/pendingSecond": pendingFirstQuerySchema, "/pendingSecond": pendingFirstQuerySchema,
"/pendingSubmit": pendingFirstQuerySchema, "/pendingSubmit": pendingFirstQuerySchema,
...@@ -71,8 +75,8 @@ const columns: ColumnsType = [ ...@@ -71,8 +75,8 @@ const columns: ColumnsType = [
// 根据 lastTypeParams, 获取对应的高级筛选 name // 根据 lastTypeParams, 获取对应的高级筛选 name
const FILTER_NAMES = { const FILTER_NAMES = {
"/query": QUERY_SEARCH_NAME, [QUERY_PATH]: QUERY_SEARCH_NAME,
"/tobeAddQuery": TO_BE_ADD_QUERY_SEARCH_NAME, [TO_BE_ADD_QUERY_PATH]: TO_BE_ADD_QUERY_SEARCH_NAME,
"/pendingFirst": PENDING_FIRST_NOTICE, "/pendingFirst": PENDING_FIRST_NOTICE,
"/pendingSecond": PENDING_SECOND_NOTICE, "/pendingSecond": PENDING_SECOND_NOTICE,
"/pendingSubmit": PENDING_TO_SUBMIT, "/pendingSubmit": PENDING_TO_SUBMIT,
...@@ -86,6 +90,8 @@ const SERVICES = { ...@@ -86,6 +90,8 @@ const SERVICES = {
'/tobeAddQuery': PublicApi.getEnhanceSupplierToBeAddList '/tobeAddQuery': PublicApi.getEnhanceSupplierToBeAddList
} }
const Query: React.FC<{}> = (props) => { const Query: React.FC<{}> = (props) => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const { lastTypeParams } = usePageStatus(); const { lastTypeParams } = usePageStatus();
...@@ -138,14 +144,31 @@ const Query: React.FC<{}> = (props) => { ...@@ -138,14 +144,31 @@ const Query: React.FC<{}> = (props) => {
} }
</div> </div>
) )
/**
* 查询
* @params values 表单字段
*/
const handleSearch = (values: any) => {
const {docTime, ...rest} = values;
const {st, et} = timeRange(docTime);
let searchData = {
...rest,
startTime: st,
endTtime: et
}
ref.current.reload(searchData)
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={"生产通知单查询"} title={TITLE_MAPS[lastTypeParams] || '生产通知单查询'}
> >
<Card> <Card>
<StandardTable <StandardTable
tableProps={{ tableProps={{
rowKey: 'memberId', rowKey: 'id',
}} }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
...@@ -154,7 +177,7 @@ const Query: React.FC<{}> = (props) => { ...@@ -154,7 +177,7 @@ const Query: React.FC<{}> = (props) => {
<NiceForm <NiceForm
actions={formActions} actions={formActions}
expressionScope={{controllerBtns, batchUpdateBtn}} expressionScope={{controllerBtns, batchUpdateBtn}}
onSubmit={values => ref.current.reload(values)} onSubmit={handleSearch}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, FILTER_NAMES[lastTypeParams], FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, FILTER_NAMES[lastTypeParams], FORM_FILTER_PATH);
useAsyncInitSelect( useAsyncInitSelect(
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME } from './contants'; import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME } from './contants';
import { docTime } from '../../common';
/** /**
* @author: Bill * @author: Bill
...@@ -20,7 +21,7 @@ export const querySchema: ISchema = { ...@@ -20,7 +21,7 @@ export const querySchema: ISchema = {
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
align: 'flex-left', align: 'flex-left',
tip: '输入通知单号、通知单摘要进行搜索', tip: '输入通知单号进行搜索',
}, },
}, },
[FORM_FILTER_PATH]: { [FORM_FILTER_PATH]: {
...@@ -33,19 +34,17 @@ export const querySchema: ISchema = { ...@@ -33,19 +34,17 @@ export const querySchema: ISchema = {
columns: 6, columns: 6,
}, },
properties: { properties: {
name: { memberName: {
type: 'string', type: 'string',
default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '加工企业名称(全部)', placeholder: '加工企业名',
allowClear: true, allowClear: true,
}, },
}, },
time: { docTime: {
type: 'string', type: 'string',
default: undefined, default: 0,
enum: [], enum: docTime,
'x-component-props': { 'x-component-props': {
placeholder: '单据时间(全部)', placeholder: '单据时间(全部)',
allowClear: true, allowClear: true,
......
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