Commit 9526e17f authored by Bill's avatar Bill

添加加工通用列表页,完善页面,待对接

parent 49a6c51f
...@@ -4,15 +4,7 @@ ...@@ -4,15 +4,7 @@
* @Description: 结算能力 * @Description: 结算能力
*/ */
/* const BalancedRoute = {
* @Author: Bill
* @Date: 2020-10-12 09:45:20
* @LastEditTime: 2020-10-30 15:51:10
* @Description: 加工能力路由
*/
const HandlingRoute = {
path: '/memberCenter/balance', path: '/memberCenter/balance',
name: 'balance', name: 'balance',
icon: 'smile', icon: 'smile',
...@@ -185,4 +177,4 @@ const HandlingRoute = { ...@@ -185,4 +177,4 @@ const HandlingRoute = {
] ]
} }
export default HandlingRoute export default BalancedRoute
\ No newline at end of file \ No newline at end of file
...@@ -39,13 +39,13 @@ const HandlingRoute = { ...@@ -39,13 +39,13 @@ const HandlingRoute = {
hideInMenu: true hideInMenu: true
}, },
// // 指派生产通知单 -> 详情 // // 指派生产通知单 -> 详情
// { {
// path: '/memberCenter/handling/assign/detail', path: '/memberCenter/handling/assign/qeury/detail',
// name: 'assignProductionDetail', name: 'assignProductionDetail',
// icon: 'smile', icon: 'smile',
// component: '@/pages/handling/assign/detail', component: '@/pages/handling/assign/detail',
// hideInMenu: true hideInMenu: true
// }, },
// 指派生产通知单 -> 待审核通知单(一级) // 指派生产通知单 -> 待审核通知单(一级)
{ {
path: '/memberCenter/handling/assign/pendingFirst', path: '/memberCenter/handling/assign/pendingFirst',
...@@ -89,6 +89,90 @@ const HandlingRoute = { ...@@ -89,6 +89,90 @@ const HandlingRoute = {
component: '@/pages/handling/assign/processStock/createProcessStock' component: '@/pages/handling/assign/processStock/createProcessStock'
} }
] ]
},
// 确认生产通知单
{
path: '/memberCenter/handling/confirm',
name: 'confirm',
routes: [
// 确认生产通知单-生产通知单
{
path: '/memberCenter/handling/confirm/query',
name: 'confirmProductionQuery',
icon: 'smile',
component: '@/pages/handling/components/Query',
},
// 确认生产通知单 -> 待提交生产通知单
{
path: '/memberCenter/handling/confirm/pendingSubmit',
name: 'pendingSubmit',
icon: 'smile',
component: '@/pages/handling/components/Query'
},
// 确认生产通知单 -> 待审核通知单(一级)
{
path: '/memberCenter/handling/confirm/pendingFirst',
name: 'pendingFirst',
icon: 'smile',
component: '@/pages/handling/components/Query'
},
// 确认生产通知单 -> 待审核通知单(二级)
{
path: '/memberCenter/handling/confirm/pendingSecond',
name: 'pendingSecond',
icon: 'smile',
component: '@/pages/handling/components/Query'
},
// 确认生产通知单 -> 待确认生产通知单
{
path: '/memberCenter/handling/confirm/pendingConfirm',
name: 'pendingConfirm',
icon: 'smile',
component: '@/pages/handling/components/Query',
},
// 确认生产通知单 -> 待新增加工发货单
{
path: '/memberCenter/handling/confirm/processingInvoiceTobeAdd',
name: 'processingInvoiceTobeAdd',
icon: 'smile',
component: '@/pages/handling/components/Query',
},
// 确认生产通知单 -> 新建加工发货单
{
path: '/memberCenter/handling/confirm/createProcessInvoice',
name: 'createProcessInvoice',
icon: 'smile',
component: '@/pages/handling/confirm/createProcessInvoice'
},
// 确认生产通知单 -> 待新增物流单
{
path: '/memberCenter/handling/confirm/pendingAddLogistics',
name: 'pendingAddLogistics',
icon: 'smile',
component: '@/pages/handling/components/Query',
},
// 确认生产通知单 -> 新建物流单
{
path: '/memberCenter/handling/confirm/createLogisticsOrder',
name: 'createLogisticsOrder',
icon: 'smile',
component: '@/pages/handling/confirm/createLogisticsOrder',
},
// 确认生产通知单 -> 待发货生产通知单
{
path: '/memberCenter/handling/confirm/pendingDelivered',
name: 'pendingDelivered',
icon: 'smile',
component: '@/pages/handling/components/Query',
},
// 确认生产通知单 -> 待确认回单生产通知单
{
path: '/memberCenter/handling/confirm/pendingReceipt',
name: 'pendingReceipt',
icon: 'smile',
component: '@/pages/handling/components/Query'
}
]
} }
......
...@@ -488,6 +488,19 @@ export default { ...@@ -488,6 +488,19 @@ export default {
'menu.handling.assign.processStock': '待新增加工入库单', 'menu.handling.assign.processStock': '待新增加工入库单',
'menu.handling.assign.toBeRecieve': '待收货生产通知单', 'menu.handling.assign.toBeRecieve': '待收货生产通知单',
'menu.handling.assign.createProcessStock': '新建加工入库单', 'menu.handling.assign.createProcessStock': '新建加工入库单',
'menu.handling.confirm': '确认生产通知单',
'menu.handling.confirm.confirmProductionQuery': '生产通知单查询',
'menu.handling.confirm.pendingSubmit': '待提交生产通知单',
'menu.handling.confirm.pendingFirst': '待审核生产通知单(一级)',
'menu.handling.confirm.pendingSecond': '待审核生产通知单(二级)',
'menu.handling.confirm.pendingConfirm': '待确认生产通知单',
'menu.handling.confirm.processingInvoiceTobeAdd': '待新增加工发货单',
'menu.handling.confirm.pendingAddLogistics': '待新增物流单',
'menu.handling.confirm.pendingDelivered': '待发货生产通知单',
'menu.handling.confirm.pendingReceipt': '待确认回单生产通知单',
'menu.handling.confirm.createProcessInvoice': '新建加工发货单',
'menu.handling.confirm.createLogisticsOrder': '新建物流单',
// 售后能力 // 售后能力
'menu.afterService': '售后', 'menu.afterService': '售后',
......
...@@ -6,117 +6,13 @@ import { history } from 'umi'; ...@@ -6,117 +6,13 @@ import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import addSchema from '../../schema/addSchema'; import schema from './schema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons'; import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import ModalContainer from '../../components/ModalContainer'; import ModalContainer from '../../components/ModalContainer';
import EnterPrise from '../../components/EnterPrise'; 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 ModalTable from '@/components/ModalTable';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
export const memberSchema = {
type: 'object',
properties: {
name: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '商品名称',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
roleId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '选择会员角色',
style: {width: '200px'}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
export const memberSchema1 = {
type: 'object',
properties: {
"search_name": {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '商品名称',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
roleId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '选择会员角色',
style: {width: '200px'}
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
/* /*
* @Author: Bill * @Author: Bill
...@@ -125,9 +21,7 @@ export const memberSchema1 = { ...@@ -125,9 +21,7 @@ export const memberSchema1 = {
*/ */
const formActions = createFormActions(); const formActions = createFormActions();
const enterPriseFormActions = createFormActions(); const { onFieldValueChange$ } = FormEffectHooks
const ProcessProductActions = createFormActions()
const { onFormInit$, onFieldValueChange$ } = FormEffectHooks
const Add: React.FC<{}> = () => { const Add: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false); const [submitLoading, setSubmitLoading] = useState<boolean>(false);
...@@ -198,6 +92,12 @@ const Add: React.FC<{}> = () => { ...@@ -198,6 +92,12 @@ const Add: React.FC<{}> = () => {
setActiveSource(value); setActiveSource(value);
} }
}) })
// 设置自提的时候隐藏地址
onFieldValueChange$('Tabs.tab-1.layout.method').subscribe(({value}) => {
formActions.setFieldState('address', state => {
state.visible = value == 1
})
})
} }
// 选择加工商品弹框控制 // 选择加工商品弹框控制
...@@ -210,23 +110,37 @@ const Add: React.FC<{}> = () => { ...@@ -210,23 +110,37 @@ const Add: React.FC<{}> = () => {
} }
} }
/**
* 加工企业modal框 行勾选
* @param rows
*/
const enterPriseOnOk = (rows) => {
console.log(rows.selectRow)
formActions.setFieldValue('Tabs.tab-1.layout.handleBusiness', "123")
}
/**
* 加工商品Modal框 行勾选回调
* @param rows
*/
const processProductSelected = (rows) => { const processProductSelected = (rows) => {
console.log(rows) console.log(rows)
formActions.setFieldValue('Tabs.tab-2.layout.someLists', rows) formActions.setFieldValue('Tabs.tab-2.layout.someLists', rows.selectRow)
} }
const fetchMemberData = async (params) => { /**
console.log(params); * 加工订单Modal框 行勾选回调
return { * @param row
totalCount: 1, */
data: [] const processOrderOnok = (rows) => {
} formActions.setFieldValue('Tabs.tab-2.layout.someLists', rows.selectRow)
} }
const handleOkAddMember = () => { /**
console.log(123); * 提交表单
// formActions.setFieldValue('Tabs.memberTab.someLists', memberRowCtl.selectRow); */
// setVisible(false); const handleSubmit = (values) => {
console.log(values);
} }
/** 逻辑 end */ /** 逻辑 end */
...@@ -250,7 +164,7 @@ const Add: React.FC<{}> = () => { ...@@ -250,7 +164,7 @@ const Add: React.FC<{}> = () => {
> >
<Card> <Card>
<NiceForm <NiceForm
schema={addSchema} schema={schema}
actions={formActions} actions={formActions}
components={{WrapUploadFile, DatePicker, Select, Table}} components={{WrapUploadFile, DatePicker, Select, Table}}
expressionScope={{ expressionScope={{
...@@ -259,87 +173,28 @@ const Add: React.FC<{}> = () => { ...@@ -259,87 +173,28 @@ const Add: React.FC<{}> = () => {
source: source(), source: source(),
RadioBtnGroup: RadioBtnGroup() RadioBtnGroup: RadioBtnGroup()
}} }}
onSubmit={handleSubmit}
effects={formEffects()} effects={formEffects()}
/> />
{/* 加工企业 Modal 框 */} {/* 加工企业 Modal 框 */}
{/* <EnterPrise <EnterPrise
visible={modalEnterPriseVisible} visible={modalEnterPriseVisible}
cancel={() => setEnterPriseModalVisible(false)} cancel={() => setEnterPriseModalVisible(false)}
></EnterPrise> */} onOk={enterPriseOnOk}
></EnterPrise>
{/* 加工商品Modal框 */} {/* 加工商品Modal框 */}
{/* <ProcessProducts <ProcessProducts
visible={modalProductVisible} visible={modalProductVisible}
cancel={() => setModalProductVisible(false)} cancel={() => setModalProductVisible(false)}
onOk={processProductSelected} onOk={processProductSelected}
></ProcessProducts> */} ></ProcessProducts>
<ModalTable
modalTitle='选择加工企业'
confirm={handleOkAddMember}
cancel={() => setEnterPriseModalVisible(false)}
visible={modalEnterPriseVisible}
columns={[]}
// rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberData(params)}
tableProps={{
rowKey: 'memberId',
}}
formilyProps={
{
ctx: {
schema: memberSchema,
actions: formActions,
components: { ModalSearch: Search, SearchSelect, Submit } ,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
)
}
}
}
}
/>
<ModalTable
modalTitle='选择加工企业1'
confirm={handleOkAddMember}
cancel={() => setModalProductVisible(false)}
visible={modalProductVisible}
columns={[]}
// rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberData(params)}
tableProps={{
rowKey: 'memberId',
}}
formilyProps={
{
ctx: {
schema: memberSchema1,
actions: formActions,
components: { ModalSearch: Search, SearchSelect, Submit } ,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search_name',
FORM_FILTER_PATH,
)
}
}
}
}
/>
{/* <ProcessOrder <ProcessOrder
visible={modalOrderVisible} visible={modalOrderVisible}
cancel={() => setModalOrderVisible(false)} cancel={() => setModalOrderVisible(false)}
onOk={processOrderOnok}
> >
</ProcessOrder> */} </ProcessOrder>
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
...@@ -152,13 +152,18 @@ const basicTab = { ...@@ -152,13 +152,18 @@ const basicTab = {
address: { address: {
type: 'string', type: 'string',
title: '收货地址', title: '收货地址',
'x-component': 'Select',
'x-rules': [ 'x-rules': [
{ {
required: true, required: true,
message: '请选择收货地址' message: '请选择收货地址'
} }
] ],
'x-component': 'Select',
'x-component-props': {
options: [
{label: 'test', value: 1}
]
}
}, },
docNo: { docNo: {
type: 'string', type: 'string',
...@@ -173,7 +178,7 @@ const basicTab = { ...@@ -173,7 +178,7 @@ const basicTab = {
status: { status: {
type: 'string', type: 'string',
title: '外部状态', title: '外部状态',
'x-component': 'Text', 'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '待提交通知单' children: '待提交通知单'
} }
...@@ -181,7 +186,7 @@ const basicTab = { ...@@ -181,7 +186,7 @@ const basicTab = {
status2: { status2: {
type: 'string', type: 'string',
title: '内部状态', title: '内部状态',
'x-component': 'Text', 'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '待提交审核' children: '待提交审核'
} }
...@@ -344,6 +349,7 @@ const enclosure = { ...@@ -344,6 +349,7 @@ const enclosure = {
title: '附件', title: '附件',
'x-component': 'WrapUploadFile', 'x-component': 'WrapUploadFile',
'x-component-props': { 'x-component-props': {
fileMaxSize: 20*1024
} }
} }
} }
......
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import AssignAllSchema from '../../schema/assignAll';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '加工企业名称',
dataIndex: 'businessName'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'status',
},
{
title: '内部状态',
dataIndex: 'status2'
}
]
const AssignAll: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
console.log(params);
// let res = await PublicApi.getMemberAbilityInfoPage(params);
// return res.data;
return {}
};
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
return {};
};
return (
<PageHeaderWrapper
title={"生产通知单查询"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'desc',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSelectOptions,
);
}}
schema={AssignAllSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default AssignAll
\ No newline at end of file
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import examineFirstSchema from '../../schema/examineFirstSchema';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons';
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '加工企业名称',
dataIndex: 'role'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'status',
},
{
title: '内部状态',
dataIndex: 'status2'
}
]
const ExamineFirst: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
// let res = await PublicApi.getMemberAbilityInfoPage(params);
// return res.data;
return {}
};
const controllerBtns = (
<Space>
<Button>
批量审核通过
</Button>
</Space>
);
return (
<PageHeaderWrapper
title={"待审核生产通知单(一级)"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={examineFirstSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default ExamineFirst
\ No newline at end of file
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import examineFirstSchema from '../../schema/examineFirstSchema';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons';
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '供应会员',
dataIndex: 'role'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'status',
},
{
title: '内部状态',
dataIndex: 'status2'
}
]
const ExamineSecond: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
// let res = await PublicApi.getMemberAbilityInfoPage(params);
// return res.data;
return {}
};
const controllerBtns = (
<Space>
<Button>
批量审核通过
</Button>
</Space>
);
return (
<PageHeaderWrapper
title={"待审核生产通知单(二级)"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={examineFirstSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default ExamineSecond
\ No newline at end of file
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import toBeRecieveSchema from '../../schema/assignAll';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons';
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '供应会员',
dataIndex: 'role'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'status',
},
{
title: '内部状态',
dataIndex: 'status2'
}
]
const TobeRecieve: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
// let res = await PublicApi.getMemberAbilityInfoPage(params);
// return res.data;
return {}
};
const controllerBtns = (
<Space>
<Button>
批量提交
</Button>
</Space>
);
return (
<PageHeaderWrapper
title={"待收货生产通知单"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
}}
schema={toBeRecieveSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default TobeRecieve
\ No newline at end of file
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import toBeSubmitSchema from '../../schema/examineFirstSchema';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons';
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '供应会员',
dataIndex: 'role'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'status',
},
{
title: '内部状态',
dataIndex: 'status2'
}
]
const toBeSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
// let res = await PublicApi.getMemberAbilityInfoPage(params);
// return res.data;
return {}
};
const controllerBtns = (
<Space>
<Button>
批量提交
</Button>
</Space>
);
return (
<PageHeaderWrapper
title={"待提交生产通知单"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={toBeSubmitSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default toBeSubmit
\ No newline at end of file
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button, Dropdown, Menu} from 'antd';
import NiceForm from '@/components/NiceForm';
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import tobeAddSchema from '../../schema/tobeAddSchema';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { history } from 'umi'
const formActions = createFormActions();
const columns = [
{
title: '通知单号',
dataIndex: 'id',
},
{
title: '通知单摘要',
dataIndex: 'desc',
},
{
title: '加工企业名称',
dataIndex: 'businessName'
},
{
title: '单据时间',
dataIndex: 'create-at',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
},
{
title: '内部状态',
dataIndex: 'innerStatus'
}
]
const TobeAdd: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
console.log(params);
return {}
let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data;
};
const menu = (
<Menu >
<Menu.Item key="BatchDelete" icon={<DeleteOutlined />}>
批量删除
</Menu.Item>
</Menu>
);
const controllerBtns = (
<Space>
<Button
type="primary"
onClick={() => { history.push('/memberCenter/handling/assign/add') }}
>
<PlusOutlined />
新建
</Button>
<Button>批量提交审核</Button>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button>
</Space>
);
return (
<PageHeaderWrapper
title={"待新增生产通知单"}
>
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{
controllerBtns,
}}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={tobeAddSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default TobeAdd
\ No newline at end of file
...@@ -3,10 +3,11 @@ import { Modal} from 'antd'; ...@@ -3,10 +3,11 @@ 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 { createFormActions } from '@formily/antd'; import { createAsyncFormActions } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema'; import processProductSchema from '../../schema/processProductSchema';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const actions = createFormActions(); const actions = createAsyncFormActions();
const columns = [ const columns = [
{ {
title: '会员ID', title: '会员ID',
...@@ -46,16 +47,15 @@ const tableSchema = { ...@@ -46,16 +47,15 @@ const tableSchema = {
const schema = processProductSchema(tableSchema); const schema = processProductSchema(tableSchema);
const EnterPrise = ({visible, cancel, ...restProps}) => { const EnterPrise = ({visible, cancel, ...restProps}) => {
const [selectRow, setSelectRow] = useState({}); const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
let res = await PublicApi.getMemberAbilityInfoPage(params); let res = await PublicApi.getManageContentColumnPage(params);
return res.data; return res;
}; };
const rowSelection = { const onOk = () => {
onSelect: (record, selectRow, selected) => { restProps.onOk(memberRowCtl)
setSelectRow(record); cancel();
}
} }
return ( return (
...@@ -64,11 +64,13 @@ const EnterPrise = ({visible, cancel, ...restProps}) => { ...@@ -64,11 +64,13 @@ const EnterPrise = ({visible, cancel, ...restProps}) => {
width={704} width={704}
visible={visible} visible={visible}
onCancel={cancel} onCancel={cancel}
onOk={onOk}
> >
<SearchForm <SearchForm
request={fetchData}
schema={schema} schema={schema}
actions={actions} actions={actions}
expressionScope={{rowSelection: rowSelection}} expressionScope={{rowSelection: selectRow}}
></SearchForm> ></SearchForm>
</Modal> </Modal>
......
import React from 'react'; import React, { useEffect } from 'react';
import BasicForm from './BasicForm' import BasicForm from './BasicForm'
import TablePagination from './TablePagination'; import TablePagination from './TablePagination';
import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd'; import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd';
...@@ -8,6 +8,7 @@ import { Submit } from '@formily/antd'; ...@@ -8,6 +8,7 @@ import { Submit } from '@formily/antd';
const Search = Input.Search; const Search = Input.Search;
const { onFormInit$, onFieldValueChange$ } = FormEffectHooks const { onFormInit$, onFieldValueChange$ } = FormEffectHooks
const paginationParams = { current: 1, pageSize: 10};
const SearchForm = (props) => { const SearchForm = (props) => {
const { schema, components, actions, effects, expressionScope } = props; const { schema, components, actions, effects, expressionScope } = props;
...@@ -26,10 +27,47 @@ const SearchForm = (props) => { ...@@ -26,10 +27,47 @@ const SearchForm = (props) => {
} }
const handleSubmit = (value) => { const handleSubmit = (value) => {
console.log(value); if(!!props.request) {
props.onSearch(value); fetchRequest({...paginationParams,...value});
}
} }
const fetchRequest = (values) => {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = true;
})
props.request(values).then((res) => {
if(res.code === 1000) {
setTableStatus({dataSource:res.data.data, totalCount: res.data.totalCount})
} else {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = false;
})
}
})
}
const setTableStatus = ({dataSource, totalCount}) => {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = false;
//@ts-ignore
state.props["x-component-props"]["dataSource"] = dataSource;
})
actions.setFieldState('pagination', state => {
//@ts-ignore
state.props["x-component-props"]["total"] = totalCount;
})
}
useEffect(() => {
if(!!props.request) {
fetchRequest(paginationParams)
}
}, [])
return ( return (
<BasicForm <BasicForm
schema={schema} schema={schema}
...@@ -43,11 +81,10 @@ const SearchForm = (props) => { ...@@ -43,11 +81,10 @@ const SearchForm = (props) => {
), ),
reset: () => { reset: () => {
actions.reset(); actions.reset();
actions.submit();
}, },
search: (value) => { search: (value) => {
handleSubmit({search: value}) actions.submit();
// handleSubmit();
// console.log(value);
}, },
toggleFilters: () => { toggleFilters: () => {
actions.setFieldState('FILTERS', state => { actions.setFieldState('FILTERS', state => {
......
...@@ -5,6 +5,7 @@ import EyePreview from '@/components/EyePreview'; ...@@ -5,6 +5,7 @@ import EyePreview from '@/components/EyePreview';
import { BasicForm, TablePagination, SearchForm } from '../ModalForTable' import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema'; import processProductSchema from '../../schema/processProductSchema';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const actions = createFormActions(); const actions = createFormActions();
const columns = [ const columns = [
...@@ -73,23 +74,28 @@ const tableSchema = { ...@@ -73,23 +74,28 @@ const tableSchema = {
const schema = processProductSchema(tableSchema); const schema = processProductSchema(tableSchema);
const ProcessProducts = ({visible, cancel, ...restProps}) => { const ProcessProducts = ({visible, cancel, ...restProps}) => {
const [selectRow, setSelectRow] = useState({}); // const [selectRow, setSelectRow] = useState({});
const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
let res = await PublicApi.getMemberAbilityInfoPage(params); let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data; return res.data;
}; };
const rowSelection = {
onSelect: (record, selectRow, selected) => {
setSelectRow(record);
}
}
const expandable = { const expandable = {
expandedRowRender: record => <Table columns={expandRowColumn} rowKey={"id"} rowSelection={rowSelection} dataSource={data} pagination={false} />, expandedRowRender: record => (
<Table
columns={expandRowColumn}
rowKey={"id"}
// rowSelection={rowSelection}
dataSource={data}
pagination={false}
/>
),
// defaultExpandAllRows: true // defaultExpandAllRows: true
} }
const handleSubmit = () => { const handleSubmit = () => {
restProps.onOk(memberRowCtl)
cancel(); cancel();
} }
...@@ -115,11 +121,12 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -115,11 +121,12 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
} }
> >
<SearchForm <SearchForm
request={fetchData}
components={{Table}} components={{Table}}
schema={schema} schema={schema}
actions={actions} actions={actions}
expressionScope={{ expressionScope={{
rowSelection: rowSelection, rowSelection: selectRow,
expandable: expandable expandable: expandable
}} }}
></SearchForm> ></SearchForm>
......
...@@ -5,7 +5,7 @@ import EyePreview from '@/components/EyePreview'; ...@@ -5,7 +5,7 @@ import EyePreview from '@/components/EyePreview';
import { BasicForm, TablePagination, SearchForm } from '../ModalForTable' import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import { createAsyncFormActions } from '@formily/antd'; import { createAsyncFormActions } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema'; import processProductSchema from '../../schema/processProductSchema';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const actions = createAsyncFormActions(); const actions = createAsyncFormActions();
const columns = [ const columns = [
{ title: 'ID', dataIndex: 'id'}, { title: 'ID', dataIndex: 'id'},
...@@ -29,70 +29,16 @@ const tableSchema = { ...@@ -29,70 +29,16 @@ const tableSchema = {
}, },
} }
const schema = processProductSchema(tableSchema); const schema = processProductSchema(tableSchema);
const paginationParams = { current: 1, pageSize: 10};
const ProcessProducts = ({visible, cancel, ...restProps}) => { const ProcessProducts = ({visible, cancel, ...restProps}) => {
const [selectedRow, setSelectedRow] = useState({}); const [selectRow, setSelectRow] = useRowSelectionTable({ customKey: 'id' });
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
console.log(params);
let res = await PublicApi.getManageContentColumnPage(params); let res = await PublicApi.getManageContentColumnPage(params);
return res.data; return res;
}; };
const setTableStatus = ({dataSource, totalCount}) => {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = false;
//@ts-ignore
state.props["x-component-props"]["dataSource"] = dataSource;
})
actions.setFieldState('pagination', state => {
//@ts-ignore
state.props["x-component-props"]["total"] = totalCount;
})
}
useEffect(() => {
if(visible) {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = true;
})
fetchData(paginationParams).then((data) => {
setTableStatus({dataSource:data.data, totalCount: data.totalCount})
})
}
}, [visible])
const handleSearch = (params) => {
const name = actions.getFieldValue('search');
// const status = actions.getFieldValue('status'); // 状态
const postData = {
name: name || '',
...paginationParams,
...params
}
fetchData(postData).then((data) => {
setTableStatus({dataSource:data.data, totalCount: data.totalCount})
})
}
const rowSelection = {
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
setSelectedRow(selectedRows);
},
onSelectAll: (record, selected, changeRows) => {
const res = selected.filter((item) => item && item.id);
setSelectedRow(res);
}
}
const handleSubmit = (value) => {
console.log(value);
}
const onOk = () => { const onOk = () => {
restProps.onOk(selectedRow) restProps.onOk(setSelectRow)
cancel(); cancel();
} }
...@@ -105,11 +51,10 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -105,11 +51,10 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
onOk={onOk} onOk={onOk}
> >
<SearchForm <SearchForm
request={fetchData}
schema={schema} schema={schema}
actions={actions} actions={actions}
onSearch={handleSearch} expressionScope={{rowSelection: selectRow}}
onSubmit={handleSubmit}
expressionScope={{rowSelection: rowSelection}}
></SearchForm> ></SearchForm>
</Modal> </Modal>
......
...@@ -59,7 +59,7 @@ const columns: ColumnsType = [ ...@@ -59,7 +59,7 @@ const columns: ColumnsType = [
] ]
// 根据 lastTypeParams, 获取相对应的schema // 根据 lastTypeParams, 获取相对应的schema
const schemas = { const SCHEMAS = {
"/query": querySchema, "/query": querySchema,
"/tobeAddQuery": tobeAddQuerySchema, "/tobeAddQuery": tobeAddQuerySchema,
"/pendingFirst": pendingFirstQuerySchema, "/pendingFirst": pendingFirstQuerySchema,
...@@ -70,7 +70,7 @@ const columns: ColumnsType = [ ...@@ -70,7 +70,7 @@ const columns: ColumnsType = [
} }
// 根据 lastTypeParams, 获取对应的高级筛选 name // 根据 lastTypeParams, 获取对应的高级筛选 name
const filterName = { const FILTER_NAMES = {
"/query": QUERY_SEARCH_NAME, "/query": QUERY_SEARCH_NAME,
"/tobeAddQuery": TO_BE_ADD_QUERY_SEARCH_NAME, "/tobeAddQuery": TO_BE_ADD_QUERY_SEARCH_NAME,
"/pendingFirst": PENDING_FIRST_NOTICE, "/pendingFirst": PENDING_FIRST_NOTICE,
...@@ -80,15 +80,21 @@ const filterName = { ...@@ -80,15 +80,21 @@ const filterName = {
"/pendingReceive": PENDING_RECEIVE "/pendingReceive": PENDING_RECEIVE
} }
// 根据 path, 得到对应的列表页 service
const SERVICES = {
"/query": PublicApi.getEnhanceSupplierAllList,
'/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();
const fetchData = async (params: any) => { const fetchData = async (params: any) => {
console.log(params); console.log(params);
// let res = await PublicApi.getMemberAbilityInfoPage(params); const service = SERVICES[lastTypeParams];
// return res.data; const res = await service(params);
return {} return res.data
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
...@@ -150,13 +156,13 @@ const Query: React.FC<{}> = (props) => { ...@@ -150,13 +156,13 @@ const Query: React.FC<{}> = (props) => {
expressionScope={{controllerBtns, batchUpdateBtn}} expressionScope={{controllerBtns, batchUpdateBtn}}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, filterName[lastTypeParams], FORM_FILTER_PATH); useStateFilterSearchLinkageEffect($, actions, FILTER_NAMES[lastTypeParams], FORM_FILTER_PATH);
useAsyncInitSelect( useAsyncInitSelect(
['innerStatus', 'outerStatus'], ['innerStatus', 'outerStatus'],
fetchSelectOptions, fetchSelectOptions,
); );
}} }}
schema={schemas[lastTypeParams]} schema={SCHEMAS[lastTypeParams]}
/> />
} }
/> />
......
.item {
display: flex;
flex-direction: row;
align-items: center;
background-color: #F4F5F7;
padding: 5px 10px;
margin-bottom: 10px;
border-radius: 4px;
cursor: pointer;
.icon {
width: 20px;
height: 20px;
display: flex;
margin-right: 10px;
.img {
width: 100%;
height: 100%;
}
}
.fileName {
color: @main-color;
font-size: 14px;
}
.remove {
margin-left: auto;
}
}
\ No newline at end of file
/**
* @author Bill
* @description 文件李彪
*/
import React from 'react';
import styles from './FileList.less';
import pdf_icon from '@/assets/imgs/pdf_icon.png';
import { DeleteOutlined } from '@ant-design/icons';
interface Iprops {
/**
* 删除回调函数
* @params {name: string} 文件名
*/
removeFile: (name: string) => void,
/**
* 文件名
*/
name: string,
/**
* 图片链接
*/
url: string
}
const FileList: React.FC<Iprops> = (props) => {
const { name, url} = props;
return (
<div className={styles.item} >
<div className={styles.icon}>
<img src={pdf_icon} className={styles.img} />
</div>
<div className={styles.fileName}>交付要求</div>
<div className={styles.remove} onClick={() => props.removeFile(name)}>
<DeleteOutlined />
</div>
</div>
)
}
export default FileList
\ No newline at end of file
import React, { useState } from 'react'; import React, { useState } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Upload, Button, message } from 'antd'; import { Upload, Button, message } from 'antd';
import { DeleteOutlined, UploadOutlined } from '@ant-design/icons' import { UploadOutlined } from '@ant-design/icons'
import { UPLOAD_TYPE } from '@/constants' import { UPLOAD_TYPE } from '@/constants'
import pdf_icon from '@/assets/imgs/pdf_icon.png'; import FileListItem from './FileList';
const UploadFile = (props) => { const UploadFile = (props) => {
const { fileList = [], onChange, fileMaxSize = 20 } = props const { fileList = [], onChange, fileMaxSize = 20 } = props
...@@ -35,7 +35,12 @@ const UploadFile = (props) => { ...@@ -35,7 +35,12 @@ const UploadFile = (props) => {
const { code, data } = info.file.response const { code, data } = info.file.response
if (code === 1000) { if (code === 1000) {
console.log('upload success') console.log('upload success')
const temp = fileList.push(data);
const temp = [...fileList];
temp.push({
name: info.file.name,
url: data
})
onChange(temp) onChange(temp)
} }
setLoading(false) setLoading(false)
...@@ -56,15 +61,12 @@ const UploadFile = (props) => { ...@@ -56,15 +61,12 @@ const UploadFile = (props) => {
{ {
fileList.map((item, key) => { fileList.map((item, key) => {
return ( return (
<div className={styles.item} key={item}> <FileListItem
<div className={styles.icon}> key={item}
<img src={pdf_icon} className={styles.img} /> name={item.name}
</div> url={""}
<div className={styles.fileName}>交付要求</div> removeFile={removeFile}
<div className={styles.remove} onClick={() => removeFile(item)}> />
<DeleteOutlined />
</div>
</div>
) )
}) })
} }
...@@ -72,7 +74,7 @@ const UploadFile = (props) => { ...@@ -72,7 +74,7 @@ const UploadFile = (props) => {
<Upload {...uploadProps}> <Upload {...uploadProps}>
<Button icon={<UploadOutlined />} loading={loading}>上传文件</Button> <Button icon={<UploadOutlined />} loading={loading}>上传文件</Button>
</Upload> </Upload>
<div className={styles.tips}>一次上传一个文件,每个附件大小不能超过{fileMaxSize}M</div> <div className={styles.tips}>一次上传一个文件,每个附件大小不能超过{fileMaxSize / 1024}M</div>
</div> </div>
) )
......
import React from 'react';
import UploadFile from './UploadFile'; import UploadFile from './UploadFile';
const WrapUpload = (props) => { const WrapUpload = (props) => {
...@@ -7,6 +8,7 @@ const WrapUpload = (props) => { ...@@ -7,6 +8,7 @@ const WrapUpload = (props) => {
<UploadFile <UploadFile
fileList = {props.value} fileList = {props.value}
onChange={data => { onChange={data => {
console.log("mutators", data);
// 这里能拿到change后的data值 // 这里能拿到change后的data值
mutators.change(data) mutators.change(data)
}} }}
......
...@@ -6,38 +6,7 @@ ...@@ -6,38 +6,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.item {
display: flex;
flex-direction: row;
align-items: center;
background-color: #F4F5F7;
padding: 5px 10px;
margin-bottom: 10px;
border-radius: 4px;
cursor: pointer;
.icon {
width: 20px;
height: 20px;
display: flex;
margin-right: 10px;
.img {
width: 100%;
height: 100%;
}
}
.fileName {
color: @main-color;
font-size: 14px;
}
.remove {
margin-left: auto;
}
}
} }
.tips { .tips {
......
/**
* @author Bill
* @description 新建物流单
*/
import React, { useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Select, DatePicker, Input, InputNumber } from 'antd';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import schema from './schema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import SelectGoods from '../../components/SelectGoods';
const formActions = createFormActions();
const CreateLogisticsOrder: React.FC = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
// 选择货品
const [modalProducVisible, setModalProductVisible] = useState<boolean>(false);
const tableAddButton = (
<div>
<Button
onClick={() => setModalProductVisible(true)}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
新建单据明细
</Button>
</div>
)
/**单据明细 */
const docDetailColumn = () => {
return [
{ title: '货号', dataIndex: 'no' },
{ title: '货品名称', dataIndex: 'name' },
{ title: '规格/size', dataIndex: 'size' },
{ title: '品类', dataIndex: 'category' },
{ title: '品牌', dataIndex: 'brand' },
{ title: '单位', dataIndex: 'unit' },
{ title: '成本价', dataIndex: 'cost' },
{
title: '加工商品名称',
dataIndex: 'productName',
render: (text, record) => {
const options = [{
lable: 'test',
value: 1
}]
return <Select options={options}></Select>
}
},
{ title: '商品ID', dataIndex: 'productId' },
{ title: '订单号', dataIndex: 'orderId' },
{ title: '单价', dataIndex: 'unitPrice' },
{
title: '入库数量',
dataIndex: 'total',
render: (text, reocrd) => {
return (
<InputNumber />
)
} },
{ title: '入库金额', dataIndex: 'price' },
{ title: '操作', render: (text, record) => (<a>删除</a>)}
];
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title="新建加工发货单"
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>,
]}
>
<Card>
<NiceForm
schema={schema}
actions={formActions}
components={{ DatePicker, Select}}
expressionScope={{
tableAddButton,
tableColumns: docDetailColumn()
}}
/>
{/* 加工商品Modal框 */}
<SelectGoods
visible={modalProducVisible}
cancel={() => setModalProductVisible(false)}
></SelectGoods>
</Card>
</PageHeaderWrapper>
);
}
export default CreateLogisticsOrder
\ No newline at end of file
/**
* @author Bill
* @description 新建物流通知单
*/
import { ISchema } from '@formily/antd';
const basicTab = {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
'tab': '基本信息'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left'
},
properties: {
no: {
title: '物流单号',
type: 'text',
},
desc: {
type: 'string',
title: '单据摘要',
"x-rules": [
{
required: true,
message: '请选择对应仓库'
}
],
},
logisticsServiceProvider: {
type: 'string',
title: '物流服务商',
enum: [],
"x-rules": [
{
required: true,
message: '物流服务商'
},
]
},
processingInvoiceNumber: {
type: 'text',
title: '对应加工发货单号'
},
correspondingProductionNotice: {
type: 'text',
title: '对应生产通知单号'
},
consignee: {
type: 'text',
title: '收货方',
},
shippingAddress: {
type: 'text',
title: '收货地址'
},
deliveryAddress: {
type: 'text',
title: '发货地址'
},
time: {
type: 'text',
title: '单据时间'
},
status: {
type: 'text',
title: '外部状态'
},
}
}
}
}
}
const detailTab = {
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 24,
labelAlign: 'left'
},
properties: {
someLists: {
type: 'array:number',
'x-mega-props': {
wrapperCol: 24,
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'id',
prefix: "{{tableAddButton}}",
columns: "{{tableColumns}}",
}
}
}
}
}
}
}
const costTab = {
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 24,
labelAlign: 'left'
},
properties: {
cost: {
title: '运费',
type: 'text'
},
costMethods: {
title: '结算方式',
type: 'text'
}
}
}
}
}
}
const recordTab = {
'tab-4': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '流转记录'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 24,
labelAlign: 'left'
},
properties: {
recordList: {
type: 'array:number',
'x-mega-props': {
wrapperCol: 24,
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'id',
columns: "{{tableColumns}}",
}
}
}
}
}
}
}
const schema: ISchema = {
type: 'object',
properties: {
'Tabs': {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card'
},
properties: {
...basicTab,
...detailTab,
...costTab,
...recordTab
}
}
}
}
export default schema
\ No newline at end of file
/**
* @author Bill
* @description 新建加工发货单
*/
import React, { useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Select, DatePicker, Input, InputNumber } from 'antd';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import schema from './schema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import SelectGoods from '../../components/SelectGoods'
const formActions = createFormActions();
const createProcessStock: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
// 选择货品
const [modalProducVisible, setModalProductVisible] = useState<boolean>(false);
const tableAddButton = (
<div>
<Button
onClick={() => setModalProductVisible(true)}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
新建单据明细
</Button>
</div>
)
/**单据明细 */
const docDetailColumn = () => {
return [
{ title: '货号', dataIndex: 'no' },
{ title: '货品名称', dataIndex: 'name' },
{ title: '规格/size', dataIndex: 'size' },
{ title: '品类', dataIndex: 'category' },
{ title: '品牌', dataIndex: 'brand' },
{ title: '单位', dataIndex: 'unit' },
{ title: '成本价', dataIndex: 'cost' },
{
title: '加工商品名称',
dataIndex: 'productName',
render: (text, record) => {
const options = [{
lable: 'test',
value: 1
}]
return <Select options={options}></Select>
}
},
{ title: '商品ID', dataIndex: 'productId' },
{ title: '订单号', dataIndex: 'orderId' },
{ title: '单价', dataIndex: 'unitPrice' },
{
title: '入库数量',
dataIndex: 'total',
render: (text, reocrd) => {
return (
<InputNumber />
)
} },
{ title: '入库金额', dataIndex: 'price' },
{ title: '操作', render: (text, record) => (<a>删除</a>)}
];
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title="新建加工发货单"
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>,
]}
>
<Card>
<NiceForm
schema={schema}
actions={formActions}
components={{ DatePicker, Select}}
expressionScope={{
tableAddButton,
tableColumns: docDetailColumn()
}}
/>
{/* 加工商品Modal框 */}
<SelectGoods
visible={modalProducVisible}
cancel={() => setModalProductVisible(false)}
></SelectGoods>
</Card>
</PageHeaderWrapper>
)
}
export default createProcessStock
/**
* @author Bill
* @description 新建加工发货单 schema
*/
import { ISchema } from '@formily/antd';
const basicTab = {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
'tab': '基本信息'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left'
},
properties: {
type: {
title: '单据类型',
type: 'string',
enum: [],
'x-rules': [
{
required: true, // 自定义校验规则
message: '请选择单据类型'
}
],
},
warehouse: {
type: 'string',
title: '对应仓库',
enum: [],
"x-rules": [
{
required: true,
message: '请选择对应仓库'
}
],
},
desc: {
type: 'string',
title: '单据摘要',
"x-rules": [
{
required: true,
message: '请填写单据摘要'
},
{
limitByte: true, // 自定义校验规则
maxByte: 60
}
]
},
time: {
type: 'string',
title: '单据时间',
'x-component': 'DatePicker',
'x-rules': [
{
required: true,
message: '请选择单据时间'
}
]
},
warehousePeople: {
type: 'string',
title: '仓库人员',
'x-rules': [
{
required: true,
message: '请选择单据时间'
}
]
},
correspondingDoc: {
type: 'radio',
title: '对应单据',
required: true,
enum: [
{
label: '生产通知单',
value: 1
}
],
default: 1
},
connectDoc: {
type: 'text',
title: '关联单据'
},
memberName: {
type: 'text',
title: '会员名称'
},
address: {
type: 'text',
title: '收货地址',
},
method: {
type: 'text',
title: '配送方式'
}
}
}
}
}
}
const detailTab = {
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细'
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 24,
labelAlign: 'left'
},
properties: {
someLists: {
type: 'array:number',
'x-mega-props': {
wrapperCol: 24,
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'id',
prefix: "{{tableAddButton}}",
columns: "{{tableColumns}}",
}
}
}
}
}
}
}
const schema: ISchema = {
type: 'object',
properties: {
'Tabs': {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card'
},
properties: {
...basicTab,
...detailTab,
}
}
}
}
export default schema
\ No newline at end of file
...@@ -31,7 +31,7 @@ const schema = (others) => { ...@@ -31,7 +31,7 @@ const schema = (others) => {
justify: 'start', justify: 'start',
}, },
properties: { properties: {
search: { name: {
type: 'string', type: 'string',
name: 'name', name: 'name',
'x-component': 'Search', 'x-component': 'Search',
......
...@@ -9,6 +9,7 @@ import * as SearchApi from './SearchApi' ...@@ -9,6 +9,7 @@ import * as SearchApi from './SearchApi'
import * as OrderApi from './OrderApi' import * as OrderApi from './OrderApi'
import * as SettleApi from './SettleApi' import * as SettleApi from './SettleApi'
import * as AfterService from './AfterServiceApi' import * as AfterService from './AfterServiceApi'
import * as EnhanceApi from './EnhanceApi';
/** /**
* 可在这里写入自定义的接口 * 可在这里写入自定义的接口
...@@ -29,5 +30,6 @@ export const PublicApi = { ...@@ -29,5 +30,6 @@ export const PublicApi = {
...SearchApi, ...SearchApi,
...OrderApi, ...OrderApi,
...SettleApi, ...SettleApi,
...AfterService ...AfterService,
...EnhanceApi
} }
...@@ -11,6 +11,7 @@ const tokenList = [ ...@@ -11,6 +11,7 @@ const tokenList = [
{ name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a' }, //结算服务 { name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a' }, //结算服务
{ name: 'AfterService', token: '39db719680bf1b3db21bc1deda933cde16d17559e9676bf848ec96c1320e68df' }, // '售后服务' { name: 'AfterService', token: '39db719680bf1b3db21bc1deda933cde16d17559e9676bf848ec96c1320e68df' }, // '售后服务'
// { name: '', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' } // 商户会员管理服务 // { name: '', token: 'c0e920f071595a73ba234b6fa6cfe42192d3d740d59f030caa2c7f0f08777d78' } // 商户会员管理服务
{ name: 'Enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251'} // 加工服务
] ]
const getConfigMap = (tokens) => tokens.map(v => ({ const getConfigMap = (tokens) => tokens.map(v => ({
......
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