Commit e85d3cab authored by Bill's avatar Bill

fix:修改加工搜索

parent ad67cfef
......@@ -14,8 +14,8 @@ import { ColumnsType } from 'antd/es/table';
import { timeRange } from '@/utils';
import { Link, history } from 'umi'
import { DOC_TYPE_PROCESS_INVOICE, DEPENDENT_DOC_PRODUCTION, DOC_TYPE_PROCESS_RECEIPT } from '@/constants';
import {
PROCESS_TITLE,
import {
PROCESS_TITLE,
PENDING_ADD_PROCESS_PATH,
PROCESSING_INVOICE_TO_BE_ADD_PATH,
PENDING_ADD_LOGISTICS_PATH,
......@@ -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,15 +101,15 @@ const processStock: React.FC<{}> = () => {
const postData = {
startTime: st,
endTime: et,
...rest
...rest,
}
const res = await SERVICE_MAPS[pathname](postData)
return res.data;
}, [pathname]);
const columns: ColumnsType = [
{
title: '通知单号',
{
title: '通知单号',
dataIndex: 'noticeNo',
render: (text, record: any) => {
return (
......@@ -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',
......@@ -124,7 +130,7 @@ const processStock: React.FC<{}> = () => {
},
{ title: '发货批次', dataIndex: 'deliveryBatch'},
{
title: () => pathname == PENDING_ADD_PROCESS_PATH ? '入库单号' : '发货单号',
title: () => pathname == PENDING_ADD_PROCESS_PATH ? '入库单号' : '发货单号',
dataIndex: 'deliveryNo',
render: (text, record: any) => {
if(!text) {
......@@ -139,8 +145,8 @@ const processStock: React.FC<{}> = () => {
},
{ title: '外部状态', dataIndex: 'outerStatusName'},
{ title: '内部状态', dataIndex: 'innerStatusName'},
{
title: '操作',
{
title: '操作',
dataIndex: 'action',
render: (text, record: any) => {
// 这里暂时不知道status的状态, 先用内部状态判断, 审核的先不处理, 感觉应该用入库单号去判断吧
......@@ -148,7 +154,7 @@ const processStock: React.FC<{}> = () => {
const innerStatus = record.innerStatus;
const MAP = {
[OuterAndInnerStatus.pending_add_process]: (
<Link
<Link
to={`${ADD_PROCESS_PATH}?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PROCESS_INVOICE}&relevanceInvoices=${DEPENDENT_DOC_PRODUCTION}`}
>
新增加工发货单
......@@ -172,7 +178,7 @@ const processStock: React.FC<{}> = () => {
[OuterAndInnerStatus.pending_confirm_logistics]: <a>查看</a>,
[OuterAndInnerStatus.pending_confirm_deliver]: <Link to={`${PENDING_DELIVERD_PATH}/detail?id=${record.id}`}>发货</Link>,
[OuterAndInnerStatus.pending_add_process_in_warehouse]: (
<Link
<Link
to={`${ADD_DELIVERY_PATH}?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_PROCESS_RECEIPT}&relevanceInvoices=${DEPENDENT_DOC_PRODUCTION}`}
>
新增加工入库单
......@@ -226,16 +232,18 @@ const processStock: React.FC<{}> = () => {
/**
* 查询
* @params values 表单字段
* @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}
/>
......@@ -283,4 +296,4 @@ const processStock: React.FC<{}> = () => {
)
}
export default processStock
\ No newline at end of file
export default processStock
......@@ -18,8 +18,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -35,8 +35,8 @@ export const schema: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名',
allowClear: true,
placeholder: '',
allowClear: true,
},
},
summary: {
......@@ -50,11 +50,11 @@ export const schema: ISchema = {
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......
......@@ -19,7 +19,7 @@ import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { ColumnsType } from 'antd/es/table';
import { DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { querySchema, tobeAddQuerySchema, pendingFirstQuerySchema } from './schema';
import {
import {
ASSIGN_QUERY,
ASSIGN_TO_BE_ADD_QUERY,
ASSIGN_PENDING_FIRST,
......@@ -84,9 +84,9 @@ const Query: React.FC<{}> = (props) => {
const menu = (
<Menu >
<Menu.Item
key="BatchDelete"
onClick={() => handleSubmitToReviewOrDelete({type: 'delete'})}
<Menu.Item
key="BatchDelete"
onClick={() => handleSubmitToReviewOrDelete({type: 'delete'})}
icon={<DeleteOutlined />}
>
批量删除
......@@ -114,7 +114,7 @@ const Query: React.FC<{}> = (props) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
{
title: '外部状态',
dataIndex: 'outerStatusName',
render: (text, record: any) => {
......@@ -143,7 +143,7 @@ const Query: React.FC<{}> = (props) => {
[ASSIGN_PENDING_SECOND]: <Link to={`${url}?id=${record.id}`}>审核</Link>,
[ASSIGN_PENDING_SUBMIT]: (<Spin spinning={submitLoadingID === record.id}><a onClick={() => handleUpdateOrDelete('review', {id: record.id})}>{"提交通知单"}</a></Spin>),
// [PENDING_RECEIVE]: <Link to={`${url}?id=${record.id}`}>收货</Link>
}
}
return (
<Space>
{
......@@ -162,8 +162,8 @@ const Query: React.FC<{}> = (props) => {
const controllerBtns = () => (
<Space>
<Button
type="primary"
<Button
type="primary"
onClick={() => { history.push('/memberCenter/handling/assign/tobeAddQuery/add') }}
>
<PlusOutlined /> 新建
......@@ -186,8 +186,8 @@ const Query: React.FC<{}> = (props) => {
pathname == ASSIGN_PENDING_SUBMIT
? '批量提交'
: '批量提交审核'
}
</Button>
}
</Button>
</div>
)
......@@ -202,8 +202,8 @@ const Query: React.FC<{}> = (props) => {
let getParamsAndService = {
[ASSIGN_TO_BE_ADD_QUERY]: () => {
return {
service: type == 'review'
? PublicApi.postEnhanceSupplierToBeAddBatchSubmitExam
service: type == 'review'
? PublicApi.postEnhanceSupplierToBeAddBatchSubmitExam
: PublicApi.postEnhanceSupplierToBeAddBatchDelete,
params: {
idList: selectedRowKeys,
......@@ -249,15 +249,15 @@ const Query: React.FC<{}> = (props) => {
/**
* 提交审核或者是删除, 用type做标识
* @param values
* @param values
*/
const handleUpdateOrDelete = (type: string, {id}) => {
let getParamsAndService = {
[ASSIGN_TO_BE_ADD_QUERY]: () => {
return {
///enhance/supplier/toBeAdd/submitExam
service: type == 'review'
? PublicApi.postEnhanceSupplierToBeAddSubmitExam
service: type == 'review'
? PublicApi.postEnhanceSupplierToBeAddSubmitExam
: PublicApi.postEnhanceSupplierToBeAddDelete,
params: {
id: id,
......@@ -287,7 +287,7 @@ const Query: React.FC<{}> = (props) => {
}
/**
* 查询
* @params values 表单字段
* @params values 表单字段
*/
const handleSearch = useCallback((values: any) => {
const {docTime, ...rest} = values;
......
......@@ -3,7 +3,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
// import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME, PENDING_FIRST_AND_SECOND_NOTICE } from './contants';
import { docTime } from '../../common';
/**
/**
* @author: Bill
* @description: 指派生产通知单查询页 schema - 生产通知单查询
*/
......@@ -19,8 +19,8 @@ export const querySchema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号s进行搜索',
align: 'flex-left',
tip: '输入通知单号s进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -33,11 +33,11 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名',
allowClear: true,
placeholder: '加工企业名',
allowClear: true,
},
},
docTime: {
......@@ -45,8 +45,8 @@ export const querySchema: ISchema = {
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
......@@ -54,8 +54,8 @@ export const querySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
......@@ -63,8 +63,8 @@ export const querySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -126,11 +126,11 @@ export const tobeAddQuerySchema: ISchema = {
},
},
properties: {
memberName: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名称',
allowClear: true,
allowClear: true,
},
},
docTime: {
......@@ -138,8 +138,8 @@ export const tobeAddQuerySchema: ISchema = {
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
......@@ -147,8 +147,8 @@ export const tobeAddQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
......@@ -156,8 +156,8 @@ export const tobeAddQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -220,11 +220,11 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
name: {
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业名称',
allowClear: true,
placeholder: '加工企业名称',
allowClear: true,
},
},
docTime: {
......@@ -232,8 +232,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
......@@ -241,8 +241,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
......@@ -250,8 +250,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
......
......@@ -37,7 +37,7 @@ const formActions = createFormActions();
* 待审核(二级),
* 待确认生产通知单
* 根据他们的菜单路径获取schema, 获取列表页的service, 以及根据pathname跳到各自的详情页
*
*
*/
// 根据 菜单路径, 获取相对应的schema
export const SCHEMAS = {
......@@ -57,7 +57,7 @@ const SERVICES = {
[CONFIRM_PENDING_CONFIRM]: PublicApi.getEnhanceProcessToBeConfirmList,
}
const Query: React.FC<{}> = (props) => {
const Query: React.FC<{}> = (props) => {
const pathname = history.location.pathname;
const [selectRow, selectRowFns] = useRowSelectionTable({ customKey: 'id' });
const [batchLoading, setBatchLoading] = useState(false)
......@@ -98,7 +98,7 @@ const Query: React.FC<{}> = (props) => {
}
},
{ title: '通知单摘要', dataIndex: 'summary'},
{ title: '加工企业名称', dataIndex: 'processName'},
{ title: '供应会员', dataIndex: 'supplierName'},
{
title: '单据时间',
dataIndex: 'createTime',
......@@ -106,7 +106,7 @@ const Query: React.FC<{}> = (props) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
{
title: '外部状态',
dataIndex: 'outerStatusName',
render: (text, record: any) => {
......@@ -135,7 +135,7 @@ const Query: React.FC<{}> = (props) => {
[CONFIRM_PENDING_FIRST]: <Link to={`${url}?id=${record.id}`}>审核</Link>,
[CONFIRM_PENDING_SECOND]: <Link to={`${url}?id=${record.id}`}>审核</Link>,
[CONFIRM_PENDING_CONFIRM]: <Link to={`${url}?id=${record.id}`}>确认通知单</Link>,
}
}
return (
<Space>
{
......@@ -152,7 +152,7 @@ const Query: React.FC<{}> = (props) => {
<div>
<Button loading={batchLoading} onClick={() => handleSubmitToReviewOrDelete()}>
批量审核通过
</Button>
</Button>
</div>
)
......@@ -167,7 +167,7 @@ const Query: React.FC<{}> = (props) => {
// }).then(({code, data}) => {
// formActions.submit();
// })
// }
/**
......@@ -191,14 +191,14 @@ const Query: React.FC<{}> = (props) => {
setBatchLoading(false);
if(code === 1000) {
formActions.submit();
}
}
})
}
}
/**
* 查询
* @params values 表单字段
* @params values 表单字段
*/
const handleSearch = useCallback((values: any) => {
const {docTime, ...rest} = values;
......@@ -208,7 +208,7 @@ const Query: React.FC<{}> = (props) => {
startTime: st,
endTtime: et
}
ref.current.reload(searchData)
}, [ref])
......@@ -242,7 +242,7 @@ const Query: React.FC<{}> = (props) => {
}
/>
</Card>
</PageHeaderWrapper>
)
}
......
......@@ -3,7 +3,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
// import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME, PENDING_FIRST_AND_SECOND_NOTICE } from './contants';
import { docTime } from '../../common';
/**
/**
* @author: Bill
* @description: 指派生产通知单查询页 schema - 生产通知单查询
*/
......@@ -19,8 +19,8 @@ export const querySchema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -33,11 +33,11 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
placeholder: '供应会员',
allowClear: true,
},
},
docTime: {
......@@ -45,8 +45,8 @@ export const querySchema: ISchema = {
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
......@@ -54,8 +54,8 @@ export const querySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
......@@ -63,8 +63,8 @@ export const querySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -99,8 +99,8 @@ export const basicSchema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
align: 'flex-left',
tip: '输入通知单号进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -113,11 +113,11 @@ export const basicSchema: ISchema = {
columns: 6,
},
properties: {
memberName: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
placeholder: '供应会员',
allowClear: true,
},
},
summary: {
......@@ -132,8 +132,8 @@ export const basicSchema: ISchema = {
default: 0,
enum: docTime,
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
submit: {
......@@ -196,11 +196,11 @@ export const pendingFirstQuerySchema: ISchema = {
},
},
properties: {
name: {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
placeholder: '供应会员',
allowClear: true,
},
},
docTime: {
......@@ -208,8 +208,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '单据时间(全部)',
allowClear: true,
placeholder: '单据时间(全部)',
allowClear: true,
},
},
outerStatus: {
......@@ -217,8 +217,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
......@@ -226,8 +226,8 @@ export const pendingFirstQuerySchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '内部状态(全部)',
allowClear: true,
},
},
submit: {
......
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