Commit e85d3cab authored by Bill's avatar Bill

fix:修改加工搜索

parent ad67cfef
......@@ -23,6 +23,7 @@ import {
ASSIGN_PENDING_RECEIVE,
PENDING_RECEIPT_PATH,
} from '../../common';
import { action } from 'mobx';
const formActions = createFormActions();
const ADD_PROCESS_PATH = '/memberCenter/tranactionAbility/stockSellStorage/bills/add';
......@@ -44,7 +45,10 @@ const SERVICE_MAPS = {
* 例子 3_15 此时 状态为待审核加工发货单, 那么对应的columns 的render组件是 <a>审核</a>
*/
enum OuterAndInnerStatus {
pending_add_process = '待新增加工发货单',
/**
* 待新增加工发货单
*/
pending_add_process = '3_14',
/**
* 待审核加工发货单
*/
......@@ -89,6 +93,7 @@ const processStock: React.FC<{}> = () => {
const pathname = history.location.pathname;
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const [visibleID, setVisibleID] = useState<null|number>(null);
const isAssign = [PENDING_ADD_PROCESS_PATH, ASSIGN_PENDING_RECEIVE].includes(pathname);
const fetchData = useCallback(async (params: any) => {
const { docTime, ...rest } = params;
......@@ -96,7 +101,7 @@ const processStock: React.FC<{}> = () => {
const postData = {
startTime: st,
endTime: et,
...rest
...rest,
}
const res = await SERVICE_MAPS[pathname](postData)
return res.data;
......@@ -113,8 +118,9 @@ const processStock: React.FC<{}> = () => {
}
},
{ title: '通知单摘要', dataIndex: 'summary'},
{ title: '加工企业名称', dataIndex: 'processName' },
{ title: '供应会员', dataIndex: 'supplierName'},
isAssign
? { title: '加工企业名称', dataIndex: 'processName' }
: { title: '供应会员', dataIndex: 'supplierName'},,
{
title: '单据时间',
dataIndex: 'createTime',
......@@ -229,13 +235,15 @@ const processStock: React.FC<{}> = () => {
* @params values 表单字段
*/
const handleSearch = useCallback((values: any) => {
const {docTime, ...rest} = values;
const {docTime, memberName, ...rest} = values;
const {st, et} = timeRange(docTime);
const others = isAssign ? {processName: memberName} : {supplierName: memberName}
let searchData = {
...rest,
startTime: st,
endTtime: et
endTtime: et,
...others
}
console.log(searchData)
ref.current.reload(searchData)
......@@ -273,6 +281,11 @@ const processStock: React.FC<{}> = () => {
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'noticeNo',FORM_FILTER_PATH);
$('onFormMount').subscribe((fieldState) => {
actions.setFieldState('memberName', state => {
state.props["x-component-props"]["placeholder"] = isAssign ? '加工企业' : '供应会员'
})
})
}}
schema={schema}
/>
......
......@@ -35,7 +35,7 @@ export const schema: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名',
placeholder: '',
allowClear: true,
},
},
......
......@@ -33,7 +33,7 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名',
......@@ -126,7 +126,7 @@ export const tobeAddQuerySchema: ISchema = {
},
},
properties: {
memberName: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名称',
......@@ -220,7 +220,7 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
name: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名称',
......
......@@ -98,7 +98,7 @@ const Query: React.FC<{}> = (props) => {
}
},
{ title: '通知单摘要', dataIndex: 'summary'},
{ title: '加工企业名称', dataIndex: 'processName'},
{ title: '供应会员', dataIndex: 'supplierName'},
{
title: '单据时间',
dataIndex: 'createTime',
......
......@@ -33,7 +33,7 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
......@@ -113,7 +113,7 @@ export const basicSchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
......@@ -196,7 +196,7 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
name: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
......
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