Commit 221da183 authored by Bill's avatar Bill

Merge branch 'dev' into test

parents 9ac4a889 ba817cdb
/* /*
* @Author: Bill * @Author: Bill
* @Date: 2020-10-12 09:45:20 * @Date: 2020-10-12 09:45:20
* @LastEditTime: 2020-10-12 16:48:05 * @LastEditTime: 2020-10-15 10:18:54
* @Description: 加工能力路由 * @Description: 加工能力路由
*/ */
...@@ -22,21 +22,21 @@ const HandlingRoute = { ...@@ -22,21 +22,21 @@ const HandlingRoute = {
{ {
path: '/memberCenter/handling/assign/All', path: '/memberCenter/handling/assign/All',
name: 'assignProductionAll', name: 'assignProductionAll',
key: 'assignProductionAll', icon: 'smile',
component: '@/pages/handling/assign/all', component: '@/pages/handling/assign/all',
}, },
// 指派生产通知单 -> 待新增生产通知单 // 指派生产通知单 -> 待新增生产通知单
{ {
path: '/memberCenter/handling/assign/ToBeAdd', path: '/memberCenter/handling/assign/ToBeAdd',
name: 'assignProductionToBeAdd', name: 'assignProductionToBeAdd',
key: 'assignProductionToBeAdd', icon: 'smile',
component: '@/pages/handling/assign/tobeAdd' component: '@/pages/handling/assign/tobeAdd'
}, },
// 指派生产通知单 -> 新增成产通知单(新建) // 指派生产通知单 -> 新增成产通知单(新建)
{ {
path: '/memberCenter/handling/assign/add', path: '/memberCenter/handling/assign/add',
name: 'assignProductionAdd', name: 'assignProductionAdd',
key: 'assignProductionAdd', icon: 'smile',
component: '@/pages/handling/assign/add', component: '@/pages/handling/assign/add',
// hideInMenu: true // hideInMenu: true
}, },
...@@ -44,9 +44,16 @@ const HandlingRoute = { ...@@ -44,9 +44,16 @@ const HandlingRoute = {
{ {
path: '/memberCenter/handling/assign/detail', path: '/memberCenter/handling/assign/detail',
name: 'assignProductionDetail', name: 'assignProductionDetail',
key: 'assignProductionDetail', icon: 'smile',
component: '@/pages/handling/assign/detail' component: '@/pages/handling/assign/detail'
} },
// 指派生产通知单 -> 待审核通知单(一级)
// {
// path: '/memberCenter/handling/assign/examineFirst',
// name: 'examineFirst',
// icon: 'smile',
// component: '@/page/'
// }
] ]
} }
......
...@@ -270,6 +270,62 @@ const TranactionRoute = { ...@@ -270,6 +270,62 @@ const TranactionRoute = {
] ]
}, },
/** /**
* @description: 商品询价
* @param {type}
* @return {type}
*/
{
path:'/memberCenter/tranactionAbility/goodsOffer',
name:'goodsOffer',
key:'goodsOffer',
routes:[
// 询价单查询
{
path: '/memberCenter/tranactionAbility/goodsOffer/enquiryOrder',
name: 'enquiryOrder',
component: '@/pages/transaction/goodsOffer/enquiryOrder'
},
// 待新增询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder',
name: 'addEnquiryOrder',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder'
},
// 新建报价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add'
},
// 待审核询价单(一级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne',
name: 'pendingReviewOne',
component: '@/pages/transaction/goodsOffer/pendingReviewOne'
},
// 待审核询价单(二级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo',
name: 'pendingReviewTwo',
component: '@/pages/transaction/goodsOffer/pendingReviewTwo'
},
// 待提交询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/goodsOffer/pendingSubmit'
},
// 详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/components/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
}
]
},
/**
* @description: 询价报价 * @description: 询价报价
* @param {type} * @param {type}
* @return {type} * @return {type}
...@@ -310,62 +366,61 @@ const TranactionRoute = { ...@@ -310,62 +366,61 @@ const TranactionRoute = {
hideInMenu: true, hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details' component: '@/pages/transaction/inquiryQuote/components/details'
}, },
// 待提交报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/inquiryQuote/pendingSubmit'
},
] ]
}, },
/** /**
* @description: 商品询 * @description: 确认询价报
* @param {type} * @param {type}
* @return {type} * @return {type}
*/ */
{ {
path:'/memberCenter/tranactionAbility/goodsOffer', path:'/memberCenter/tranactionAbility/confirmInquiryQuote',
name:'goodsOffer', name:'confirmInquiryQuote',
key:'goodsOffer', key:'confirmInquiryQuote',
routes:[ routes: [
// 询价单查询 // 报价单查询
{
path: '/memberCenter/tranactionAbility/goodsOffer/enquiryOrder',
name: 'enquiryOrder',
component: '@/pages/transaction/goodsOffer/enquiryOrder'
},
// 待新增询价单
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder', path: '/memberCenter/tranactionAbility/confirmInquiryQuote/quoteOrder',
name: 'addEnquiryOrder', name: 'quoteOrder',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder' component: '@/pages/transaction/confirmInquiryQuote/quoteOrder'
}, },
// 新建报价单 // 待提交审核报价单
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add', path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingSubmitReview',
name: 'add', name: 'pendingSubmitReview',
hideInMenu: true, component: '@/pages/transaction/confirmInquiryQuote/pendingSubmitReview'
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add'
}, },
// 待审核询价单(一级) // 待审核询价单(一级)
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne', path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingReviewOne',
name: 'pendingReviewOne', name: 'pendingReviewOne',
component: '@/pages/transaction/goodsOffer/pendingReviewOne' component: '@/pages/transaction/confirmInquiryQuote/pendingReviewOne'
}, },
// 待审核询价单(二级) // 待审核询价单(二级)
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo', path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingReviewTwo',
name: 'pendingReviewTwo', name: 'pendingReviewTwo',
component: '@/pages/transaction/goodsOffer/pendingReviewTwo' component: '@/pages/transaction/confirmInquiryQuote/pendingReviewTwo'
},
// 待提交询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/goodsOffer/pendingSubmit'
}, },
// 详情 // 详情
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/components/details', path: '/memberCenter/tranactionAbility/confirmInquiryQuote/components/details',
name: 'details', name: 'details',
hideInMenu: true, hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details' component: '@/pages/transaction/confirmInquiryQuote/components/details'
} },
// 待提交报价单
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/confirmInquiryQuote/pendingSubmit'
},
] ]
}, },
// 采购订单 // 采购订单
......
...@@ -120,16 +120,24 @@ export default { ...@@ -120,16 +120,24 @@ export default {
'menu.tranactionAbility.electronicContracts.classSearch': '合同模板参数查询', 'menu.tranactionAbility.electronicContracts.classSearch': '合同模板参数查询',
'menu.tranactionAbility.electronicContracts.template': '合同模板', 'menu.tranactionAbility.electronicContracts.template': '合同模板',
'menu.tranactionAbility.electronicContracts.addContract': '新建合同模板', 'menu.tranactionAbility.electronicContracts.addContract': '新建合同模板',
// 询价报价 // 确认询价报价
'menu.tranactionAbility.confirmInquiryQuote': '确认询价报价',
'menu.tranactionAbility.confirmInquiryQuote.quoteOrder': '报价单查询',
'menu.tranactionAbility.confirmInquiryQuote.details': '新建询价单',
'menu.tranactionAbility.confirmInquiryQuote.pendingSubmitReview': '待提交审核报价单',
'menu.tranactionAbility.confirmInquiryQuote.pendingReviewOne': '待审核询价单(一级)',
'menu.tranactionAbility.confirmInquiryQuote.pendingReviewTwo': '待审核询价单(二级)',
'menu.tranactionAbility.confirmInquiryQuote.pendingSubmit': '待提交询价单',
// 商品询价
'menu.tranactionAbility.goodsOffer': '商品询价', 'menu.tranactionAbility.goodsOffer': '商品询价',
'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询', 'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询',
'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增价单', 'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增价单',
'menu.tranactionAbility.goodsOffer.add': '新建价单', 'menu.tranactionAbility.goodsOffer.add': '新建价单',
'menu.tranactionAbility.goodsOffer.details': '新建询价单', 'menu.tranactionAbility.goodsOffer.details': '新建询价单',
'menu.tranactionAbility.goodsOffer.pendingReviewOne': '待审核价单(一级)', 'menu.tranactionAbility.goodsOffer.pendingReviewOne': '待审核价单(一级)',
'menu.tranactionAbility.goodsOffer.pendingReviewTwo': '待审核价单(二级)', 'menu.tranactionAbility.goodsOffer.pendingReviewTwo': '待审核价单(二级)',
'menu.tranactionAbility.goodsOffer.pendingSubmit': '待提交价单', 'menu.tranactionAbility.goodsOffer.pendingSubmit': '待提交价单',
// 商品询 // 询价报
'menu.tranactionAbility.inquiryQuote': '询价报价', 'menu.tranactionAbility.inquiryQuote': '询价报价',
'menu.tranactionAbility.inquiryQuote.enquiryOrder': '询价单查询', 'menu.tranactionAbility.inquiryQuote.enquiryOrder': '询价单查询',
'menu.tranactionAbility.inquiryQuote.quoteOrder': '报价单查询', 'menu.tranactionAbility.inquiryQuote.quoteOrder': '报价单查询',
......
import React, { useState } from 'react'; import React, { useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons'; import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Input, Modal } from 'antd'; import { Button, Card, Select, DatePicker } from 'antd';
import { history } from 'umi'; 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';
...@@ -10,50 +10,44 @@ import addSchema from '../../schema/addSchema'; ...@@ -10,50 +10,44 @@ import addSchema from '../../schema/addSchema';
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 {WrapUploadFile} from '../../components/UploadFile';
/* /*
* @Author: Bill * @Author: Bill
* @Date: 2020-10-12 11:36:38 * @Date: 2020-10-12 11:36:38
* @Description: 新增生产通知单 * @Description: 新增生产通知单
*/ */
const CustomModal = ({visible, cancel}) => {
return (
<Modal visible={visible} onCancel={cancel} >
Hello World
</Modal>
)
}
const formActions = createFormActions(); const formActions = createFormActions();
const Add: React.FC<{}> = () => { const Add: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false); const [submitLoading, setSubmitLoading] = useState<boolean>(false);
// 加工企业
const [modalEnterPriseVisible, setEnterPriseModalVisible] = useState<boolean>(false);
// 加工商品
const [modalProducVisible, setModalProductVisible] = useState<boolean>(false);
// 选择加工企业 modal 层 // 选择加工企业 modal 层
const connectProduct = ( const connectProduct = (
<div> <div>
<ModalContainer> <div onClick={() => setEnterPriseModalVisible(true)} >
{ <LinkOutlined style={{marginRight: 4}}/>
({visible, show, cancel}) => ( 选择
<> </div>
<EnterPrise visible={visible} cancel={cancel} ></EnterPrise>
<div onClick={show}>
<LinkOutlined style={{marginRight: 4}}/>
选择
</div>
</>
)
}
</ModalContainer>
</div> </div>
) )
const tableAddButton = ( const tableAddButton = (
<Button <div>
style={{marginBottom: 16}} <Button
block onClick={() => setModalProductVisible(true)}
icon={<PlusOutlined/>} style={{marginBottom: 16}}
type='dashed' block
>选择指定会员</Button> icon={<PlusOutlined/>}
type='dashed'
>
选择指定会员
</Button>
</div>
) )
return ( return (
...@@ -75,23 +69,25 @@ const Add: React.FC<{}> = () => { ...@@ -75,23 +69,25 @@ const Add: React.FC<{}> = () => {
> >
<Card> <Card>
<NiceForm <NiceForm
// onSubmit={handleSubmit}
schema={addSchema} schema={addSchema}
actions={formActions} actions={formActions}
components={{WrapUploadFile, DatePicker, Select}}
expressionScope={{ expressionScope={{
connectProduct, connectProduct,
tableAddButton tableAddButton
}} }}
// effects={($, actions) => {
// onFormInputChange$().subscribe(() => {
// if (!unsaved) {
// setUnsaved(true);
// }
// });
// }}
/>
/>
{/* 加工企业 Modal 框 */}
<EnterPrise
visible={modalEnterPriseVisible}
cancel={() => setEnterPriseModalVisible(false)}
></EnterPrise>
{/* 加工商品Modal框 */}
<ProcessProducts
visible={modalProducVisible}
cancel={() => setModalProductVisible(false)}
></ProcessProducts>
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
...@@ -91,6 +91,7 @@ const Detail: React.FC<{}> = () => { ...@@ -91,6 +91,7 @@ const Detail: React.FC<{}> = () => {
</Tabs> </Tabs>
</Card> </Card>
</div> </div>
<ProcessDetail />
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
......
/** import React, { useState } from 'react';
* 选择加工企业 Modal 组件 import { Modal} from 'antd';
*/
import React, { useRef, useEffect } from 'react';
import { Card, Space, Button, Select } from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'; import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import { createFormActions, FormEffectHooks } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import processProductSchema from '../../schema/processProductSchema';
import ModalTable from '@/components/ModalTable'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
const formActions = createFormActions();
const actions = createFormActions();
const columns = [ const columns = [
{ {
title: '会员ID', title: '会员ID',
...@@ -39,99 +30,50 @@ const columns = [ ...@@ -39,99 +30,50 @@ const columns = [
} }
] ]
const schema = { const tableSchema = {
type: 'object', table: {
properties: { type: "object",
name: { name: "table",
type: 'string', "x-component": "Table",
'x-component': 'ModalSearch', "x-component-props": {
'x-component-props': { "columns": columns,
placeholder: '请输入会员名字', "rowKey": "id",
align: 'flex-left', "pagination":false,
style: { "rowSelection": "{{rowSelection}}"
width: '180px'
}
},
},
[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',
"x-component": 'Select',
"x-component-props": {
options: [],
style: {width: '160px'},
placeholder: '请选择会员角色'
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
} }
} },
} }
const schema = processProductSchema(tableSchema);
const EnterPrisesModal = ({visible, cancel}) => { const EnterPrise = ({visible, cancel, ...restProps}) => {
const ref = useRef<any>({}) const [selectRow, setSelectRow] = useState({});
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 handleOkAddMember = () => { const rowSelection = {
onSelect: (record, selectRow, selected) => {
setSelectRow(record);
}
} }
return ( return (
<ModalTable <Modal
modalTitle='选择会员' title="选择加工商品"
confirm={handleOkAddMember} width={704}
cancel={cancel}
visible={visible} visible={visible}
columns={columns} onCancel={cancel}
// rowSelection={memberRowSelection} >
fetchTableData={params => fetchData(params)} <SearchForm
formilyProps={ schema={schema}
{ actions={actions}
ctx: { expressionScope={{rowSelection: rowSelection}}
schema: schema, ></SearchForm>
components: { ModalSearch: Search, SearchSelect, Submit, Select } ,
effects: ($, actions) => { </Modal>
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
}
}
}
}
tableProps={{
rowKey: 'memberId'
}}
/>
) )
} }
export default EnterPrisesModal
\ No newline at end of file export default EnterPrise
\ No newline at end of file
import React from 'react';
import {
SchemaForm,
registerVirtualBox,
SchemaField,
} from '@formily/antd';
import { Row, Col } from 'antd';
const renderCol = (schema) => {
const { flexcol = {}, } = schema && schema['x-component-props'] || {};
const flexProps = schema['x-flex-props'] || {}
return <Col {...flexcol} {...flexProps} key={schema.path}>
<SchemaField schema={schema.toJSON()} path={schema.path}/>
</Col>
}
registerVirtualBox('CustomFlexRowLayout', (props) => {
const schemaProps = props;
const childProperties = schemaProps.schema && schemaProps.schema.getOrderProperties() || [];
const { justify = "start", align = "top" } = schemaProps && schemaProps.props && schemaProps.props['x-component-props'] || {}
return (
<Row justify={justify} align={align}>
{
childProperties.map((v, i, arr) => renderCol(v.schema))
}
</Row>
)
})
const FlexColumnLayoutStyle = {
'display': 'flex',
'flexDirection': 'column'
}
registerVirtualBox('CustomFlexColumnLayout', (props) => {
const schemaProps = props;
const childProperties = schemaProps.schema && schemaProps.schema.getOrderProperties() || [];
const { style } = schemaProps && schemaProps.props && schemaProps.props['x-component-props'] || {};
return (
<div style={{...FlexColumnLayoutStyle, ...style}}>
{
childProperties.map((v) => {
const { flexCol = {} } = v.schema && v.schema['x-component-props'] || {};
return (
<div {...flexCol} key={v.schema.path}>
<SchemaField schema={v.schema.toJSON()} path={v.schema.path}/>
</div>
)
})
}
</div>
)
})
const SearchForm = (props) => {
const { actions, schema, components, ...rest } = props;
return (
<div>
<SchemaForm
components={components}
actions={actions}
schema={schema}
{...rest}
>
</SchemaForm>
</div>
)
}
export default SearchForm;
\ No newline at end of file
import React from 'react';
import BasicForm from './BasicForm'
import TablePagination from './TablePagination';
import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd';
import { UpOutlined, DownOutlined } from '@ant-design/icons'
import { Select, Input, Button, Table } from 'antd';
const Search = Input.Search;
const { onFormInit$, onFieldValueChange$ } = FormEffectHooks
const actions = createFormActions();
const SearchForm = (props) => {
const { schema, components, actions, effects, expressionScope } = props;
const effectInstance = () => () => {
onFormInit$().subscribe(() => {
actions.setFieldState('FILTERS', state => {
state.visible = false;
})
})
onFieldValueChange$('pagination').subscribe((state) => {
// handleSearch({...state.value})
})
!!effects && effects();
}
return (
<BasicForm
schema={schema}
components={{Select, Input, Button, Search, TablePagination, Table, ...components}}
actions={actions}
effects={effectInstance()}
expressionScope={{
HIGHT_FILTER_BTN: (
<div>高级搜索 <DownOutlined /></div>
),
reset: () => {
},
search: (value) => {
},
toggleFilters: () => {
actions.setFieldState('FILTERS', state => {
const visible = !state.visible;
state.visible = visible;
actions.setFieldState('HIGHT_FILTER_BTN', (state) => {
//@ts-ignore
state.props['x-component-props'].children = (
<div>高级搜索 {visible ? <UpOutlined /> : <DownOutlined /> }</div>
)
})
});
},
...expressionScope
}}
></BasicForm>
)
}
export default SearchForm
\ No newline at end of file
import React from 'react';
import { Pagination } from 'antd';
const TablePagination = (props) => {
const componentProps = props.props["x-component-props"];
const total = componentProps.total;
const parentStyle = props.props['x-style'];
const handleChange = (page, pageSize) => {
props.mutators.change({current: page, pageSize});
}
return (
<div style={parentStyle}>
<Pagination {...componentProps} current={props.value?.current || 1} onChange={handleChange} ></Pagination>
</div>
)
}
TablePagination.isFieldComponent = true
export default TablePagination
\ No newline at end of file
import React from 'react';
import { Modal } from 'antd';
const WrapModal = () => {
return (
<div></div>
)
}
export default WrapModal;
\ No newline at end of file
import BasicForm from './BasicForm';
import TablePagination from './TablePagination';
import SearchForm from './SearchForm';
export {
BasicForm,
TablePagination,
SearchForm
}
\ No newline at end of file
import React, { useState } from 'react';
import { Modal} from 'antd';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import { createFormActions } from '@formily/antd';
import processProductSchema from '../../schema/processProductSchema';
const actions = createFormActions();
const columns = [
{
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 ProcessProducts = ({visible, cancel, ...restProps}) => {
const [selectRow, setSelectRow] = useState({});
const fetchData = async (params: any) => {
let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data;
};
const rowSelection = {
onSelect: (record, selectRow, selected) => {
setSelectRow(record);
}
}
return (
<Modal
title="选择加工商品"
width={704}
visible={visible}
onCancel={cancel}
>
<SearchForm
schema={schema}
actions={actions}
expressionScope={{rowSelection: rowSelection}}
></SearchForm>
</Modal>
)
}
export default ProcessProducts
\ No newline at end of file
import React, { useState } from 'react';
import styles from './index.less';
import { Upload, Button, message } from 'antd';
import { DeleteOutlined, UploadOutlined } from '@ant-design/icons'
import { UPLOAD_TYPE } from '@/constants'
import pdf_icon from '@/assets/imgs/pdf_icon.png';
const UploadFile = (props) => {
const { fileList = [], onChange, fileMaxSize = 20 } = props
const [loading, setLoading] = useState<boolean>(false)
const beforeUpload = (file) => {
const isSizeLimit = file.size / 1024 < fileMaxSize;
if (!isSizeLimit) {
message.error(`上传文件不超过${fileMaxSize}K!`);
}
return isSizeLimit;
}
const uploadProps = {
name: 'file',
action: '/api/file/file/upload',
headers: {},
data: {
fileType: UPLOAD_TYPE
},
disabled: loading,
showUploadList: false,
onChange(info) {
if (info.file.status === 'uploading') {
setLoading(true)
return;
}
if (info.file.status === 'done') {
// 图片回显
const { code, data } = info.file.response
if (code === 1000) {
console.log('upload success')
const temp = fileList.push(data);
onChange(temp)
}
setLoading(false)
}
},
beforeUpload
};
const removeFile = (key) => {
const res = fileList.filter((item) => item != key);
console.log(res);
onChange(res);
}
return (
<div className={styles.upload_file_container}>
<div className={styles.fileList}>
{
fileList.map((item, key) => {
return (
<div className={styles.item} key={item}>
<div className={styles.icon}>
<img src={pdf_icon} className={styles.img} />
</div>
<div className={styles.fileName}>交付要求</div>
<div className={styles.remove} onClick={() => removeFile(item)}>
<DeleteOutlined />
</div>
</div>
)
})
}
</div>
<Upload {...uploadProps}>
<Button icon={<UploadOutlined />} loading={loading}>上传文件</Button>
</Upload>
<div className={styles.tips}>一次上传一个文件,每个附件大小不能超过{fileMaxSize}M</div>
</div>
)
}
export default UploadFile;
\ No newline at end of file
import UploadFile from './UploadFile';
const WrapUpload = (props) => {
const { mutators } = props
const uploadProps = props.props['x-component-props'] || {}
console.log(props.value);
return (
<UploadFile
fileList = {props.value}
onChange={data => {
// 这里能拿到change后的data值
mutators.change(data)
}}
{...uploadProps}
/>
)
}
WrapUpload.isFieldComponent = true
export default WrapUpload
\ No newline at end of file
.upload_file_container {
display: flex;
flex-direction: column;
.fileList {
display: flex;
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 {
color: #909399;
font-size: 12px;
}
}
\ No newline at end of file
import UploadFile from './UploadFile';
import WrapUploadFile from './WrapUploadFile';
export {
UploadFile,
WrapUploadFile
}
\ No newline at end of file
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-10-12 13:37:06 * @Date: 2020-10-12 13:37:06
* @LastEditTime: 2020-10-12 16:04:41 * @LastEditTime: 2020-10-14 17:05:52
* @Description: 新建生产通知单 schema * @Description: 新建生产通知单 schema
*/ */
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: {
desc: {
title: '通知单摘要',
type: 'string',
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 60
}
],
'x-component-props': {
placeholder: '最长60个字符,30个汉字'
}
},
handleBusiness: {
type: 'string',
title: '加工企业',
"x-component-props": {
disabled: true,
addonAfter: "{{connectProduct}}"
},
"x-rules": [
{
required: true,
message: '请选择商品'
}
],
},
source: {
type: 'radio',
title: '通知单来源',
required: true,
enum: [
{
label: '订单加工',
value: 1
},
{
label: '商品加工',
value: 2
}
],
default: 1
},
time: {
type: 'string',
title: '交期',
'x-component': 'DatePicker',
'x-rules': [
{
required: true,
message: '请选择交期'
}
]
},
method: {
type: 'string',
title: '配送方式',
'x-component': 'Select',
'x-component-props': {
options: [
{label: '物流', value: 1},
{label: '自提', value: 2}
]
},
'x-rules': [
{
required: true,
message: '请选择物流方式'
}
]
},
address: {
type: 'string',
title: '收货地址',
'x-component': 'Select',
'x-rules': [
{
required: true,
message: '请选择收货地址'
}
]
},
docNo: {
type: 'string',
title: '通知单号',
'x-component': 'Text'
},
docTime: {
type: 'string',
title: '单据时间',
'x-component': 'Text'
},
status: {
type: 'string',
title: '外部状态',
'x-component': 'Text',
'x-component-props': {
children: '待提交通知单'
}
},
status2: {
type: 'string',
title: '内部状态',
'x-component': 'Text',
'x-component-props': {
children: '待提交审核'
}
}
}
}
}
}
}
/** /**
* 通知单明细 * 通知单明细
*/ */
...@@ -21,7 +153,7 @@ const detailTab = { ...@@ -21,7 +153,7 @@ const detailTab = {
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
labelCol: 4, labelCol: 4,
wrapperCol: 8, wrapperCol: 24,
labelAlign: 'left' labelAlign: 'left'
}, },
properties: { properties: {
...@@ -67,7 +199,7 @@ const otherRequired = { ...@@ -67,7 +199,7 @@ const otherRequired = {
type: 'object', type: 'object',
'x-component': 'tabpane', 'x-component': 'tabpane',
'x-component-props': { 'x-component-props': {
tab: '通知单明细' tab: '其他要求'
}, },
properties: { properties: {
layout: { layout: {
...@@ -161,8 +293,11 @@ const enclosure = { ...@@ -161,8 +293,11 @@ const enclosure = {
}, },
properties: { properties: {
enclosure: { enclosure: {
type: 'string', type: 'object',
title: '附件', title: '附件',
'x-component': 'WrapUploadFile',
'x-component-props': {
}
} }
} }
} }
...@@ -194,92 +329,7 @@ const addSchema = { ...@@ -194,92 +329,7 @@ const addSchema = {
type: 'card' type: 'card'
}, },
properties: { properties: {
'tab-1': { ...basicTab,
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: {
desc: {
title: '通知单摘要',
type: 'string',
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 60
}
],
'x-component-props': {
placeholder: '最长60个字符,30个汉字'
}
},
handleBusiness: {
type: 'string',
title: '加工企业',
"x-mega-props": {
full: true
},
"x-component-props": {
disabled: true,
addonAfter: "{{connectProduct}}"
},
"x-rules": [
{
required: true,
message: '请选择商品'
}
],
},
source: {
type: 'radio',
title: '通知单来源',
required: true,
enum: [
{
label: '订单加工',
value: 1
},
{
label: '商品加工',
value: 2
}
],
default: 1
},
no: {
type: 'string',
title: '通知单号',
'x-component': 'Text',
},
time: {
type: 'string',
title: '单据时间',
'x-component': 'Text',
},
status: {
type: 'string',
title: '外部状态',
'x-component': 'Text',
},
status2: {
type: 'string',
title: '内部状态',
'x-component': 'Text',
}
}
}
}
},
...detailTab, ...detailTab,
...otherRequired, ...otherRequired,
...enclosure, ...enclosure,
......
/*
* @Author: Bill
* @Date: 2020-10-14 18:45:31
* @LastEditTime: 2020-10-14 18:56:00
* @desc 选择加工商品schema
* 这里其实就是两个flex 布局加一个table, 通过expressScrope 注入代码
*/
const schema = (others) => {
return {
type: 'object',
properties: {
layout: {
type: 'object',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between',
align: 'center'
},
properties: {
'right-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexColumnLayout',
properties: {
controllers: {
type: 'object',
name: 'controllers',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'end',
},
properties: {
search: {
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: {
columns: {
name: 'columns',
type: 'string',
'x-component': 'Select',
'x-component-props': {
placeholder: '请选择栏目',
style: {
width: '160px'
}
}
},
status: {
name: 'status',
type: 'string',
'x-component': 'Select',
'x-component-props': {
options: [
{label: '全部', value: '0'},
{label: '待上架', value: '1'},
{label: '已上架',value: '2'},
{label: '已下架',value: '3'},
],
placeholder: '请选择状态',
style: {
width: '160px',
margin: '0 15px'
}
}
},
}
}
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
simple: true
}
}
}
},
...others
}
}
}
export default schema
...@@ -142,7 +142,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -142,7 +142,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
// 会员选择后的表格 // 会员选择后的表格
const handleDeleteTable = (id) => { const handleDeleteTable = (id) => {
const value = addSchemaAction.getFieldValue('applyMember') const value = addSchemaAction.getFieldValue('applyMember')
addSchemaAction.setFieldValue('applyMember', findItemAndDelete(value, id)) const res = value.filter((item) => item.memberId != id);
addSchemaAction.setFieldValue('applyMember', res)
} }
const handleAddMemberBtn = () => { const handleAddMemberBtn = () => {
...@@ -183,7 +184,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -183,7 +184,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
{ dataIndex: 'memberId', title: 'ID', align: 'center' }, { dataIndex: 'memberId', title: 'ID', align: 'center' },
{ dataIndex: 'name', align: 'center', title: '会员名称', render: (_, record) => <EyePreview url={`/memberCenter/memberAbility/manage/addMember?id=${record.memberId}&preview=1`}>{_}</EyePreview> }, { dataIndex: 'name', align: 'center', title: '会员名称', render: (_, record) => <EyePreview url={`/memberCenter/memberAbility/manage/addMember?id=${record.memberId}&preview=1`}>{_}</EyePreview> },
{ dataIndex: 'memberTypeName', title: '会员类型', align: 'center' }, { dataIndex: 'memberTypeName', title: '会员类型', align: 'center' },
{ dataIndex: 'ctl', title: '操作', align: 'center', render: (_, record) => <Button type='link' onClick={() => handleDeleteTable(record.id)}>删除</Button> } { dataIndex: 'ctl', title: '操作', align: 'center', render: (_, record) => <Button type='link' onClick={() => handleDeleteTable(record.memberId)}>删除</Button> }
] ]
...@@ -494,6 +495,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => { ...@@ -494,6 +495,7 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
|| (CANAL.includes(prev) && BUSINESS_INTEGRATE.includes(parentState.value)) || (CANAL.includes(prev) && BUSINESS_INTEGRATE.includes(parentState.value))
) { ) {
setFieldState('applyMember', (state) => { setFieldState('applyMember', (state) => {
console.log("applyMember")
state.value = [] state.value = []
}) })
} }
......
import React, { Component,ReactNode } from 'react'; import React, { Component,ReactNode } from 'react';
import {Badge} from 'antd' import {Badge, Tag} from 'antd'
import statuStyle from './colorTag' import statuStyle from './colorTag'
/****** *********************** 需求单 ************************** */ /****** *********************** 需求单 ************************** */
/** /**
...@@ -136,8 +136,21 @@ export const enquiryOfferConfirmSearchInteriorState = (text:any) => { ...@@ -136,8 +136,21 @@ export const enquiryOfferConfirmSearchInteriorState = (text:any) => {
export const quoteOrderInternalState = (text:any) => { export const quoteOrderInternalState = (text:any) => {
let component: ReactNode = null; let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />: text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 2 ? component = <Badge status='default' text="待审核" />: text === 2 ? component = <Badge status='warning' text="待审核" />:
text === 3 ? component = <Badge status='default' text="审核通过" />: text === 3 ? component = <Badge status='success' text="审核通过" />:
component = <Badge status='processing' text="审核不通过" /> component = <Badge status='error' text="审核不通过" />
return component;
}
/**
* @description: 确认询价报价-报价单查询-外部状态查询
* @param {type}
* @return {type} 外
*/
export const inquiryQuoteOuterState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Tag color="processing">待确认</Tag>:
text === 2 ? component = <Tag color="success">接受报价</Tag>:
component = <Tag color="error">不接受报价</Tag>
return component; return component;
} }
\ No newline at end of file
import React from 'react';
import { Modal } from 'antd';
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api';
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks;
export interface Params {
id: number | string;
type: number | string; //1.待提交报价单,2.待审核报价单一级,3.待审核报价单二级
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
}
const AuditModal: React.FC<Params> = (props) => {
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
switch (props.type) {
case 1:
PublicApi.postOrderProductQuotationtToSubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 2:
PublicApi.postOrderProductQuotationtAuditSubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 3:
PublicApi.postOrderProductQuotationtAuditSubmitTwo(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
}
}
/**操作 */
return (
<Modal
title='单据审核'
width={576}
visible={props.dialogVisible}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText={`取消`}
>
<SchemaForm
layout="vertical"
labelCol={6}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
state: 1
}}
>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
<Field
title='审核不通过原因'
name="cause"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</SchemaForm>
</Modal>
)
}
export default AuditModal
\ No newline at end of file
@import "../../../member/components/index.less";
.item_wrap {
margin-bottom: 24px;
background-color: #FFF;
border-radius: 8px;
&:last-child {
margin-bottom: 0px;
}
.mainCol_title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #303133;
padding: 0px 0 20px;
}
:global {
.ant-tabs-nav {
&::before {
border-bottom-color: #FFF;
}
}
}
}
.header {
:global {
.ant-page-header {
padding: 24px 24px !important;
}
}
}
.upload_item {
width: 498px;
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #00B37A;
cursor: pointer;
:global {
.anticon-link {
color: #00B37A;
font-size: 16px;
margin-right: 8px;
}
}
}
}
\ No newline at end of file
import React, { useRef, useState, useEffect } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/tableStatusList';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import AuditModal from './auditModel';
import EyePreview from '@/components/EyePreview';
const formActions = createFormActions();
export interface parmas {
fetchData?: Function,
selectAll?: Function,
batchAction?: Function,
reloadRef?: any,
type?: number,
}
const ReviewList: React.FC<parmas> = (props) => {
const ref = useRef<any>({});
const { fetchData, selectAll, batchAction, reloadRef, type } = props;
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]);
const [id, setId] = useState<number>();
const [visible, setvisible] = useState<boolean>(false);
useEffect(() => {
if (reloadRef) {
const userAction = {
reload: () => ref.current.reload()
}
if (reloadRef && typeof reloadRef === 'function') {
reloadRef(userAction);
}
if (reloadRef && typeof reloadRef !== 'function') {
reloadRef.current = userAction;
}
}
})
const columns: ColumnType<any>[] = [
{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=${type}&view=2`}>{text}</EyePreview>
},
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=${type}&view=1`}>{text}</EyePreview>
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button type='link' disabled={record.interiorState === 1} onClick={()=>{setId(record.id);setvisible(true);}}>审核</Button>
},
]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
selectAll(selectedRowKeys) // 返回给父级
},
}
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button onClick={() => batchAction()}>批量提交审核</Button>
</Col>
</Row>
// 单个审核
const handleModalOK = () => {
setvisible(false)
setTimeout(()=> {
ref.current.reload()
},1000)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
<AuditModal
id={id}
type={type}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={ handleModalOK}
/>
</PageHeaderWrapper>
)
}
export default ReviewList
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
const PendingReviewOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const data = { // 模拟的数据
totalCount: 6,
data: [{
id: 1,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
memberId: 10,
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 2
}, {
id: 2,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125LIP',
details: '模拟的数据10086',
memberName: '打喷嚏',
memberId: 1,
quotationAsTime: '2020-10-14 23:59:00',
voucherTime: '2020-10-12 13:59:00',
externalState: 1,
interiorState: 1
}]
}
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
// PublicApi.getOrderAuditProductQuotationList({...params}).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={2}
/>
)
}
export default PendingReviewOne
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
const PendingReviewTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const data = { // 模拟的数据
totalCount: 6,
data: [{
id: 1,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
memberId: 10,
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 1
}, {
id: 2,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125LIP',
details: '模拟的数据10086',
memberName: '打喷嚏',
memberId: 1,
quotationAsTime: '2020-10-14 23:59:00',
voucherTime: '2020-10-12 13:59:00',
externalState: 1,
interiorState: 1
}]
}
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
// PublicApi.getOrderAuditProductQuotationListTwo({...params}).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={3}
/>
)
}
export default PendingReviewTwo
\ No newline at end of file
import React, { useRef, useState, useEffect } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { history, Link } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=1&view=2`}>{text}</EyePreview>
}, {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=1&view=1`}>{text}</EyePreview>
}, {
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
}, {
title: '询价会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='inquiry' />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button type='link'><Link to={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=1&view=1`}>提交报价单</Link></Button>
}]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
</Col>
</Row>
/**列表数据 */
const data = {
totalCount: 2,
data: [{
id: 1,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
memberId: 10,
deliveryTime: '2020-10-13 13:59:00',
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 1
}]
}
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
// PublicApi.getOrderToSubmitProductQuotationList({ ...params }).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
})
}
/**搜索 */
const handleSumbit = (values: any) => {
if (values.voucherTime) {
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values', values)
ref.current.reload(values)
}
/**批量审核 */
const handleSubmitAll = (ids: number[]) => {
PublicApi.postOrderProductQuotationtToSubmitAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default PendingSubmit
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { history, Link } from 'umi';
import { Button, Card, Space, Row, Col, Dropdown, Menu, Popconfirm } from 'antd';
import { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import {
interiorState, interiorStateTwo,
quoteOrderInternalState, enquirySearchexternalState,
inquiryQuoteOuterState
} from '../../common/tableStatusList';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { timeRange } from '@/utils/index';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { commonEnquieryOfferSchema } from '../schema';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const PendingSubmitReview: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=5&view=2`}>{text}</EyePreview>
},{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=5&view=1`}>{text}</EyePreview>
}, {
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
}, {
title: '询价会员',
key: 'memberName',
dataIndex: 'memberName',
},{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
},{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button type='link'><Link to={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=1&view=1`}>提交审核</Link></Button>
}];
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button>批量提交审核</Button>
</Space>
</Col>
</Row>
// 列表数据
const data = { // 模拟的数据
totalCount: 6,
data: [{
id: 1,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
memberId: 10,
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 1
}, {
id: 2,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125LIP',
details: '模拟的数据10086',
memberName: '打喷嚏',
memberId: 1,
quotationAsTime: '2020-10-14 23:59:00',
voucherTime: '2020-10-12 13:59:00',
externalState: 1,
interiorState: 1
}]
}
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(data)
}, 500)
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={commonEnquieryOfferSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default PendingSubmitReview
\ No newline at end of file
import React, { useRef, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Button } from 'antd';
import { StandardTable } from 'god';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { quoteFormSearch } from '../schema';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { searchSelectGetSelectCategoryOptionEffect } from '../../effect/index'
import { ColumnType } from 'antd/lib/table/interface';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState,inquiryQuoteOuterState } from '../../common/tableStatusList';
import EyePreview from '@/components/EyePreview';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const EnquiryOrder: React.FC<{}> = (props) => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=5&view=2`}>{text}</EyePreview>
},{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/confirmInquiryQuote/components/details?id=${record.id}&type=5&view=1`}>{text}</EyePreview>
}, {
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
}, {
title: '询价会员',
key: 'memberName',
dataIndex: 'memberName',
},{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
}];
//交易能力 询价报价 询价单查询
const data = {
totalCount: 1,
data: [{
id: 91,
quotationNo: 'BPTY12',
inquiryListNo: 'SD2015PPLJ',
details: '阿珍爱上阿强',
memberName: 'wutiaoren',
memberId: 5,
quotationAsTime: '2020-10-13 15:37:00',
voucherTime: '2020-10-13 15:37:00',
externalState: 1,
interiorState: 2
}]
}
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
// PublicApi.getOrderProductQuotationList({...params}).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 1000)
})
}
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
}}
schema={quoteFormSearch}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default EnquiryOrder;
\ No newline at end of file
This diff is collapsed.
import { ISchema} from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import {TimeList} from '../../common/statusList'
import TranactionRoute from 'config/routes/tranactionRoute'
/**
* @description: 待审核询价单
* @param {type}
* @return {type}
*/
export const pendingReviewSchema: ISchema = {
type:'object',
properties:{
megalayout:{
type:'object',
"x-component":'mega-layout',
"x-component-props":{
grid:true
},
properties:{
ctl:{
type:'object',
"x-component":"Children",
"x-component-props":{
children:"{{controllerBtns}}"
}
},
inquiryListNo:{//报价单号
type:'string',
"x-component":"Search",
"x-mega-props":{
},
"x-component-props":{
placeholder:'报价单搜索'
}
}
}
},
[FORM_FILTER_PATH]:{
type:'object',
"x-component":"flex-layout",
"x-component-props":{
rowStyle:{
flexWrap:'nowrap'
},
colStyle:{
marginLeft: 20
}
},
properties:{
PRO_LAYOUT:{
type:'object',
"x-component":'mega-layout',
"x-mega-props":{
span: 5
},
"x-component-props":{
inline: true
},
properties:{
details:{
type:'string',
"x-component-props":{
placeholder:'询价单摘要'
}
},
memberName:{
type:'string',
"x-component-props":{
placeholder:'被询价会员'
}
},
voucherTime:{
type:'string',
default: 0,
"x-component-props":{
placeholder:'请选择单据时间'
},
enum: TimeList
},
}
},
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span:1
},
"x-component-props":{
children:'查询'
}
}
}
}
}
}
...@@ -11,7 +11,7 @@ const actions = createFormActions() ...@@ -11,7 +11,7 @@ const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks; const { onFieldChange$ } = FormEffectHooks;
export interface Params { export interface Params {
id: number | string; id: number | string;
type: number | string; //1是待提交询价单 2是一级 3是二级 type: number | string; //1.待提交报价单,2.待审核报价单一级,3.待审核报价单二级
dialogVisible: boolean; dialogVisible: boolean;
onCancel: Function; onCancel: Function;
onOK?: Function; onOK?: Function;
...@@ -36,7 +36,7 @@ const AuditModal: React.FC<Params> = (props) => { ...@@ -36,7 +36,7 @@ const AuditModal: React.FC<Params> = (props) => {
value.id = props.id value.id = props.id
switch (props.type) { switch (props.type) {
case 1: case 1:
PublicApi.postOrderInquirySubmit(value).then(res => { PublicApi.postOrderProductQuotationtToSubmit(value).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
props.onOK() props.onOK()
} }
......
...@@ -22,4 +22,35 @@ ...@@ -22,4 +22,35 @@
} }
} }
} }
}
.header {
:global {
.ant-page-header {
padding: 24px 24px !important;
}
}
}
.upload_item {
width: 498px;
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #00B37A;
cursor: pointer;
:global {
.anticon-link {
color: #00B37A;
font-size: 16px;
margin-right: 8px;
}
}
}
} }
\ No newline at end of file
...@@ -55,13 +55,15 @@ const ReviewList: React.FC<parmas> = (props) => { ...@@ -55,13 +55,15 @@ const ReviewList: React.FC<parmas> = (props) => {
title: '报价单号', title: '报价单号',
key: 'quotationNo', key: 'quotationNo',
dataIndex: 'quotationNo', dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=${type}&view=2`}>{text}</EyePreview>
}, },
{ {
title: '询价单号', title: '询价单号',
key: 'inquiryListNo', key: 'inquiryListNo',
dataIndex: 'inquiryListNo', dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}`}>{text}</EyePreview> url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=${type}&view=1`}>{text}</EyePreview>
}, },
{ {
title: '询价单摘要', title: '询价单摘要',
...@@ -105,7 +107,7 @@ const ReviewList: React.FC<parmas> = (props) => { ...@@ -105,7 +107,7 @@ const ReviewList: React.FC<parmas> = (props) => {
title: '操作', title: '操作',
key: 'options', key: 'options',
dataIndex: 'options', dataIndex: 'options',
render: (text: any, record: any) => <Button type='link' onClick={()=>{setId(record.id);setvisible(true);}}>审核</Button> render: (text: any, record: any) => <Button type='link' disabled={record.interiorState === 1} onClick={()=>{setId(record.id);setvisible(true);}}>审核</Button>
}, },
] ]
const format = (text) => { const format = (text) => {
......
...@@ -24,7 +24,7 @@ const EnquiryOrder: React.FC<{}> = (props) => { ...@@ -24,7 +24,7 @@ const EnquiryOrder: React.FC<{}> = (props) => {
key: 'inquiryListNo', key: 'inquiryListNo',
dataIndex: 'inquiryListNo', dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}`}>{text}</EyePreview> url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=4&view=1`}>{text}</EyePreview>
}, { }, {
title: '询价单摘要', title: '询价单摘要',
key: 'details', key: 'details',
......
import React, { useRef, useState, useEffect } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { history, Link } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import EyePreview from '@/components/EyePreview';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=1&view=2`}>{text}</EyePreview>
}, {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=1&view=1`}>{text}</EyePreview>
}, {
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
}, {
title: '询价会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='inquiry' />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button type='link'><Link to={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=1&view=1`}>提交报价单</Link></Button>
}]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
</Col>
</Row>
/**列表数据 */
const data = {
totalCount: 2,
data: [{
id: 1,
quotationNo: 'BPTY12',
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
memberId: 10,
deliveryTime: '2020-10-13 13:59:00',
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 1
}]
}
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
// PublicApi.getOrderToSubmitProductQuotationList({ ...params }).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
})
}
/**搜索 */
const handleSumbit = (values: any) => {
if (values.voucherTime) {
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values', values)
ref.current.reload(values)
}
/**批量审核 */
const handleSubmitAll = (ids: number[]) => {
PublicApi.postOrderProductQuotationtToSubmitAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default PendingSubmit
\ No newline at end of file
...@@ -23,12 +23,14 @@ const EnquiryOrder: React.FC<{}> = (props) => { ...@@ -23,12 +23,14 @@ const EnquiryOrder: React.FC<{}> = (props) => {
title: '报价单号', title: '报价单号',
key: 'quotationNo', key: 'quotationNo',
dataIndex: 'quotationNo', dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=5&view=2`}>{text}</EyePreview>
},{ },{
title: '询价单号', title: '询价单号',
key: 'inquiryListNo', key: 'inquiryListNo',
dataIndex: 'inquiryListNo', dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}`}>{text}</EyePreview> url={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&type=5&view=1`}>{text}</EyePreview>
}, { }, {
title: '询价单摘要', title: '询价单摘要',
key: 'details', key: 'details',
......
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