Commit a904cacf authored by GuanHua's avatar GuanHua

feat:修改支付参数类型

parents 0d88c8a8 7b7b3ed3
/*
* @Author: Bill
* @Date: 2020-10-12 09:45:20
* @LastEditTime: 2020-10-12 16:48:05
* @Description: 加工能力路由
*/
const HandlingRoute = {
path: '/memberCenter/handling',
name: 'handling',
key: 'handling',
icon: 'smile',
routes: [
//指派生产通知单
{
path: '/memberCenter/handling/assign',
name: 'assign',
key: 'assign',
routes: [
// 指派生产通知单查询
{
path: '/memberCenter/handling/assign/All',
name: 'assignProductionAll',
key: 'assignProductionAll',
component: '@/pages/handling/assign/all',
},
// 指派生产通知单 -> 待新增生产通知单
{
path: '/memberCenter/handling/assign/ToBeAdd',
name: 'assignProductionToBeAdd',
key: 'assignProductionToBeAdd',
component: '@/pages/handling/assign/tobeAdd'
},
// 指派生产通知单 -> 新增成产通知单(新建)
{
path: '/memberCenter/handling/assign/add',
name: 'assignProductionAdd',
key: 'assignProductionAdd',
component: '@/pages/handling/assign/add',
// hideInMenu: true
},
// 指派生产通知单 -> 详情
{
path: '/memberCenter/handling/assign/detail',
name: 'assignProductionDetail',
key: 'assignProductionDetail',
component: '@/pages/handling/assign/detail'
}
]
}
]
}
export default HandlingRoute
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-19 15:39:49
* @LastEditors: Please set LastEditors
* @LastEditTime: 2020-10-12 10:14:50
*/
import CommodityRoute from './commodityRoute' // 商品能力路由
import MemberRoute from './memberRoute' // 会员能力路由
......@@ -13,8 +13,8 @@ import LogisticsRoute from './logisticsRoutes' // 物流能力路由
import PayandSettleRoute from './payandSettle' //支付与结算
import AuthConfigRoute from './authConfigRoute'
import AfterService from './afterServiceRoute' // 售后
const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute]
import HandlingRoute from './handlingRoute'; // 加工能力
const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute, HandlingRoute]
const memberCenterRoute = {
path: '/memberCenter',
......
......@@ -44,8 +44,8 @@ export enum LAYOUT_TYPE {
}
// 本地环境跳过权限校验
// export const isDev = process.env.NODE_ENV === "development"
export const isDev = false
export const isDev = process.env.NODE_ENV === "development"
// export const isDev = false
export const Environment_Status = {
0: "所有",
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-30 17:22:37
* @LastEditors: Please set LastEditors
* @LastEditTime: 2020-10-12 16:49:53
*/
export default {
......@@ -336,5 +336,13 @@ export default {
'menu.systemSetting.collection': '收藏管理',
'menu.systemSetting.accountSetting': '账号安全设置',
'menu.systemSetting.editAccount': '编辑账号信息'
'menu.systemSetting.editAccount': '编辑账号信息',
// 加工能力, assign 指的是 指派生产通知单
'menu.handling': '加工',
'menu.handling.assign': '指派生产通知单',
'menu.handling.assign.assignProductionAll': '生产通知单查询',
'menu.handling.assign.assignProductionToBeAdd': '待新增生产通知单',
'menu.handling.assign.assignProductionAdd': '新建生产通知单',
'menu.handling.assign.assignProductionDetail': '生产通知单详情'
};
\ No newline at end of file
import React, { useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Input } from 'antd';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import addSchema from '../../schema/addSchema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
/*
* @Author: Bill
* @Date: 2020-10-12 11:36:38
* @Description: 新增生产通知单
*/
const formActions = createFormActions();
const Add: React.FC<{}> = () => {
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
const connectProduct = <div className='connectBtn'><LinkOutlined style={{marginRight: 4}}/>选择</div>
const tableAddButton = (
<Button
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>选择指定会员</Button>
)
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
// onSubmit={handleSubmit}
schema={addSchema}
actions={formActions}
expressionScope={{
connectProduct,
tableAddButton
}}
// effects={($, actions) => {
// onFormInputChange$().subscribe(() => {
// if (!unsaved) {
// setUnsaved(true);
// }
// });
// }}
/>
</Card>
</PageHeaderWrapper>
)
}
export default Add
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';
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 AssignAll: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data;
};
const controllerBtns = (
<Space>
<Button
type="primary"
>
<PlusOutlined />
增加会员角色
</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={AssignAllSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default AssignAll
\ No newline at end of file
import React from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import AvatarWrap from '@/components/AvatarWrap';
import { PageHeader, Descriptions, Card, Tabs, Space, Row, Col } from 'antd';
import Circulation from '../../components/Circulation';
import WrapTable from '../../components/WrapTable';
import OtherRequirement from '../../components/OtherRequirement';
import Appendix from '../../components/Appendix';
const { TabPane } = Tabs;
const Detail: React.FC<{}> = () => {
return (
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
name: "通知单号:"
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{"TPTY12"}</span>
)}
/>
}
>
<Descriptions
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="通知单摘要">{"进口头层黄牛皮荔枝纹"}</Descriptions.Item>
<Descriptions.Item label="供应会员:">{"广州白马皮具交易中心"}</Descriptions.Item>
<Descriptions.Item label="单据时间:">{"2020-09-09 12:58:25"}</Descriptions.Item>
<Descriptions.Item label="通知单来源:">{"订单加工"}</Descriptions.Item>
<Descriptions.Item label="外部状态:">{"以完成通知单"}</Descriptions.Item>
<Descriptions.Item label="内部状态:">{"审核通过"}</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<Card bodyStyle={{padding: '5px 24px 15px 24px'}}>
<Circulation />
</Card>
<div style={{marginTop: '20px'}}>
<Card>
<h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1>
<WrapTable />
</Card>
</div>
<div style={{marginTop: '20px'}}style={{marginTop: '20px'}}>
<Card>
<Tabs>
<TabPane tab="收发货统计" key="1">
<WrapTable />
</TabPane>
<TabPane tab="收发货明细" key="2">
<WrapTable />
</TabPane>
</Tabs>
</Card>
</div>
<div style={{marginTop: '20px'}}>
<Row gutter={4}>
<Col span={18}>
<OtherRequirement />
</Col>
<Col span={6}>
<Appendix />
</Col>
</Row>
</div>
</PageHeaderWrapper>
)
}
export default Detail
\ 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 AssignAllSchema 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 TobeAdd: React.FC<{}> = () => {
const ref = useRef<any>({});
const fetchData = async (params: any) => {
console.log(params);
let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data;
};
const controllerBtns = (
<Space>
<Button
type="primary"
>
<PlusOutlined />
增加会员角色
</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={AssignAllSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default TobeAdd
\ No newline at end of file
/*
* @Author: your name
* @Date: 2020-10-12 18:27:56
* @LastEditTime: 2020-10-12 18:42:00
* @Description: 附件
*/
import React from 'react';
import { Card } from 'antd';
const styles = {
display: 'flex',
flexDirection: 'row',
// justifyContent: 'center',
alignItem: 'center',
color: '#00B37A',
backgroundColor: '#F4F5F7',
padding: '10px 15px',
cursor: 'pointer',
}
const AppendixItem = () => {
return (
<div style={styles}>工程技术资料.pdf</div>
)
}
const Appendix = () => {
return (
<div>
<Card title={"附件"}>
<AppendixItem />
</Card>
</div>
)
}
export default Appendix;
\ No newline at end of file
import React from 'react';
import { Tabs, Steps, Popover } from 'antd';
const TabPane = Tabs.TabPane;
const { Step } = Steps;
const customDot = (dot, { status, index }) => (
<span>
{dot}
</span>
);
const Circulation: React.FC<{}> = () => {
return (
<Tabs defaultActiveKey="1" >
<TabPane tab="外部流转" key="1">
<Steps current={1} progressDot={customDot} style={{marginTop: '20px'}}>
<Step title="Finished" description="You can hover on the dot." />
<Step title="In Progress" description="You can hover on the dot." />
<Step title="Waiting" description="You can hover on the dot." />
<Step title="Waiting" description="You can hover on the dot." />
</Steps>
</TabPane>
<TabPane tab="内部流转" key="2">
<Steps current={1} progressDot={customDot} style={{marginTop: '20px'}}>
<Step title="Finished" description="You can hover on the dot." />
<Step title="In Progress" description="You can hover on the dot." />
<Step title="Waiting" description="You can hover on the dot." />
<Step title="Waiting" description="You can hover on the dot." />
</Steps>
</TabPane>
</Tabs>
)
}
export default Circulation
\ No newline at end of file
import React from 'react';
import { Card, Row, Col } from 'antd';
const OtherRequirement = () => {
return (
<Card title="其他要求">
<Row>
<Col span={4}>交付说明</Col>
<Col span={8}>东莞市石龙镇西葫芦53号交付说明</Col>
<Col span={4}>物流说明</Col>
<Col span={8}>东莞市石龙镇西葫芦53号交付说明</Col>
</Row>
<Row style={{margin: '20px 0'}}>
<Col span={4}>付款说明</Col>
<Col span={8}>首付 30%, 收货后70%</Col>
<Col span={4}>包装说明</Col>
<Col span={8}>纸箱</Col>
</Row>
<Row>
<Col span={4}>税收说明</Col>
<Col span={8}>含税</Col>
<Col span={4}>其他说明</Col>
<Col span={8}></Col>
</Row>
</Card>
)
}
export default OtherRequirement;
\ No newline at end of file
import React from 'react'
import { Table } from 'antd'
const WrapTable = () => {
const columns = [
{
title: '订单号',
dataIndex: 'no',
},
{
title: 'ID',
dataIndex: 'id',
},
{
title: '商品名称',
dataIndex: 'name',
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'type',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: '加工数量',
dataIndex: 'number',
},
{
title: '加工单价',
dataIndex: 'price',
},
{
title: '加工费',
dataIndex: 'total',
},
{
title: '交期',
dataIndex: 'time',
},
{
title: '操作',
dataIndex: 'action',
},
];
return (
<Table
columns={columns}
dataSource={[]}
/>
)
}
export default WrapTable
\ No newline at end of file
/*
* @Author: your name
* @Date: 2020-10-12 13:37:06
* @LastEditTime: 2020-10-12 16:04:41
* @Description: 新建生产通知单 schema
*/
/**
* 通知单明细
*/
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: 8,
labelAlign: 'left'
},
properties: {
selectedSource: {
type: 'radio',
title: '选择来源',
required: true,
enum: [
{
label: '加工订单',
value: 1
},
{
label: '加工商品',
value: 2
}
],
default: 1,
},
someLists: {
type: 'array:number',
'x-mega-props': {
wrapperCol: 24,
},
'x-component': 'MultTable',
'x-component-props': {
rowKey: 'id',
prefix: "{{tableAddButton}}"
// columns: "{{tableColumns}}",
}
}
}
}
}
}
}
/**
* 其他要求
*/
const otherRequired = {
'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: 8,
labelAlign: 'left'
},
properties: {
deliveryDesc: {
type: 'string',
title: '交付说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
},
payDesc: {
type: 'string',
title: '付款说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
},
taxDesc: {
type: 'string',
title: '税费说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
},
materialDesc: {
type: 'string',
title: '物资说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
},
packingDesc: {
type: 'string',
title: '包装说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
},
otherDesc: {
type: 'string',
title: '其他说明',
'x-component': 'textarea',
'x-component-props': {
placeholder: '最长100个字符,50个汉字',
rows: 5
}
}
}
}
}
}
}
/**
* 附件
*/
const enclosure = {
'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: 8,
labelAlign: 'left'
},
properties: {
enclosure: {
type: 'string',
title: '附件',
}
}
}
}
}
}
/**
* 流转记录
*/
const historyRecord = {
'tab-5': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '流转记录'
},
}
}
const addSchema = {
type: 'object',
properties: {
'Tabs': {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card'
},
properties: {
'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-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,
...otherRequired,
...enclosure,
...historyRecord
}
}
}
}
export default addSchema
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
/*
* @Author: Bill
* @Date: 2020-10-12 10:46:36
* @LastEditTime: 2020-10-12 11:10:28
* @Description: 指派生产通知单查询页 schema
*/
const schema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '审核状态(全部)',
allowClear: true,
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export default schema
\ No newline at end of file
......@@ -67,7 +67,7 @@ const TransferPayWay: React.FC<TransferPayWayPropsType> = (props) => {
let param = {
id: orderId,
paymentInformationId: payInfo.paymentInformationId,
payOrderUrls: [payOrderUrl]
payOrderUrls: JSON.stringify([payOrderUrl])
}
setConfirmLoading(true)
//@ts-ignore
......
......@@ -91,4 +91,48 @@ export const filterInteriorStateList = [
]
/**
* @description: 商品询价外部状态筛选
* @param {type}
* @return {type} 内
*/
export const filterExternalState = [
{
text: '提交询价单', value: 1
},
{
text: '提交报价单', value: 2
},
{
text: '确认报价单', value: 3
},
{
text: '报价通过', value: 4
},
{
text: '报价不通过', value: 5
}
]
/**
* @description: 商品询价内部状态筛选
* @param {type}
* @return {type} 内
*/
export const filterInternalState = [
{
text: '待提交审核', value: 1
},
{
text: '待审核', value: 2
},
{
text: '审核通过', value: 3
},
{
text: '审核不通过', value: 4
}
]
......@@ -125,4 +125,19 @@ export const enquiryOfferConfirmSearchInteriorState = (text:any) => {
text === 3? component = <Badge status="success" text="二级审核通过" />:
component = <Badge status='processing' text="提交报价单" />
return component;
}
/****** *********************** 待新增询价单 ************************** */
/**
* @description: 内部状态查询
* @param {type}
* @return {type} 外
*/
export const quoteOrderInternalState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 2 ? component = <Badge status='default' text="待审核" />:
text === 3 ? component = <Badge status='default' text="审核通过" />:
component = <Badge status='processing' text="审核不通过" />
return component;
}
\ No newline at end of file
......@@ -56,7 +56,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
})
})
}
return (
<>
......
import React, { useState, useRef } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { Button, Card, Tabs } from 'antd';
import { Button, Card, Tabs, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
import BasicInfo from './components/basicInfo'; // 基本信息
......@@ -12,15 +12,50 @@ import { PublicApi } from '@/services/api'
const { TabPane } = Tabs;
const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query;
const [memberList, setmemberList] = useState([]); //存放用户信息
const [goodsList, setgoodsList] = useState([]); //存放商品
const basicInfoRef = useRef<any>({});
const tradingConditionsRef = useRef<any>({});
const [editData, setEditData] = useState<any>({});
useEffect(() => {
if(id) {
PublicApi.getOrderInquiryListDetails({id}).then(res => {
if(res.code === 1000) {
setEditData(res.data)
}
})
}
},[])
/************* 页面的一些操作start *************/
const onSumbit = async (params: any) => {
const basicInfo = await basicInfoRef.current.validateFields();
const tradingConditions = await tradingConditionsRef.current.validateFields();
console.log(tradingConditions, basicInfo, goodsList, memberList)
const basicInfoData = basicInfo.data;
const tradingConditionsData = tradingConditions.data;
if( basicInfo.state && tradingConditions.state) {
const parmas = {
inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest
...basicInfoData,
...tradingConditionsData,
memberName: memberList[0].name,
memberId: memberList[0].memberId
}
if(id) {
console.log(parmas)
} else {
await PublicApi.postOrderInquiryListAdd(parmas).then(res => {
if(res.code === 1000) {
console.log(res.data)
}
})
}
} else {
message.error('有必填字段没选择,请检查!');
}
}
// 获取到会员信息
const getMemberList = (list: any) => {
......@@ -30,6 +65,7 @@ const AddQuotes: React.FC<{}> = () => {
const getGoodsList = (list:any) => {
setgoodsList(list)
}
/************* 页面的一些操作end *************/
return (
<PageHeaderWrapper
......@@ -46,17 +82,20 @@ const AddQuotes: React.FC<{}> = () => {
<BasicInfo
currentRef={basicInfoRef}
getMemberList={getMemberList}
editData={editData}
/>
</TabPane>
<TabPane tab="询价商品" key="2">
<EnquiryGoods
memberList={memberList}
getGoodsList={getGoodsList}
editData={editData}
/>
</TabPane>
<TabPane tab="交易条件" key="3">
<TradingConditions
currentRef={tradingConditionsRef}
editData={editData}
/>
</TabPane>
<TabPane tab="附件" key="4">
......
import React from 'react';
import { Form, Button, Upload } from 'antd';
import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd';
import { UPLOAD_TYPE } from '@/constants'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import styles from './index.less';
import { UploadOutlined, DeleteOutlined, FileWordFilled } from '@ant-design/icons';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
const layout: any = {
colon: false,
......@@ -11,6 +12,23 @@ const layout: any = {
labelAlign: "left"
};
const Attached: React.FC<{}> = () => {
const [files, setFiles] = useState([]);
/**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
return isLt20M;
}
// 上传回调
const handleChange = ({ fileList }) => {
const arr: any = [];
fileList.forEach(v => {
if(v)
console.log(v)
})
}
return (
<Form
{...layout}
......@@ -18,24 +36,28 @@ const Attached: React.FC<{}> = () => {
>
<Form.Item label='附件'>
<div className={styles.upload_data}>
<div className={styles.upload_item}>
<div className={styles.upload_left}>
<FileWordFilled />
<span>验货详情.doc</span>
{files.length > 0 && files.map(v => (
<div className={styles.upload_item}>
<div className={styles.upload_left}>
<LinkOutlined />
<span>验货详情.doc</span>
</div>
<div className={styles.upload_right}>
<DeleteOutlined />
</div>
</div>
<div className={styles.upload_right}>
<DeleteOutlined />
</div>
</div>
))}
</div>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx'
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<Button icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>支持扩展名:.doc,文件大小不超过 20M</div>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
......
......@@ -6,6 +6,8 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { ISchema } from '@formily/antd';
import ModalTable from '@/components/ModalTable'
import { PublicApi } from '@/services/api'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { quoteOrderInternalState } from '../../../common/tableStatusList';
const layout: any = {
colon: false,
......@@ -16,12 +18,14 @@ const layout: any = {
const { Search } = Input;
interface queryProps {
currentRef?: any,
getMemberList?: Function
getMemberList?: Function,
editData: any
}
const BasicInfo: React.FC<queryProps> = (props) => {
const [basicform] = Form.useForm();
const { getMemberList, currentRef } = props;
const { getMemberList, currentRef, editData } = props;
console.log(editData, 10086)
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]);
......@@ -143,6 +147,14 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
},[])
useEffect(() => {
if(Object.keys(editData).length > 0) {
basicform.setFieldsValue({
details: editData.details
})
}
}, [editData])
/************* 页面的一些操作end *************/
return (
<>
......@@ -159,16 +171,16 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Button type='link'>查看会员详情</Button>
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
</Form.Item>
<Form.Item label='单据时间' name='time'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? editData.voucherTime : '-'}</span>
</Form.Item>
<Form.Item label='外部状态' name='external'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? <StatusColors status={editData.inquiryListNo} type='out' /> : '-'}</span>
</Form.Item>
<Form.Item label='内部状态' name='internal'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? quoteOrderInternalState(editData.inquiryListNo) : '-'}</span>
</Form.Item>
</Form>
{/* 选择会员弹框 */}
......
......@@ -16,11 +16,12 @@ import Submit from '@/components/NiceForm/components/Submit'
interface queryProps extends ModalTableProps {
memberList?: any,
schemaAction?: ISchemaFormActions | ISchemaFormAsyncActions,
getGoodsList: Function
getGoodsList: Function,
editData: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { memberList, schemaAction, getGoodsList, ...restProps } = props
const { memberList, schemaAction, getGoodsList, editData, ...restProps } = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
......@@ -243,6 +244,13 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
setgoodsList(newData)
}
// 编辑时回显的数据
useEffect(() => {
if(Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests);
}
}, [])
return (
<div className={styles.revise_style}>
<Button block type='dashed' onClick={addGoods}><PlusOutlined />添加商品</Button>
......
......@@ -5,7 +5,8 @@ import { Form, Input, Select, Row, Col, DatePicker } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
......@@ -15,9 +16,9 @@ const layout: any = {
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef } = props;
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState<any>([]);
const [address, setAddress] = useState([]);
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
......@@ -51,13 +52,24 @@ const TradingConditions: React.FC<queryProps> = (props) => {
currentRef.current = userAction;
}
}
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(res.data)
console.log(res.data)
})
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
logistics: editData.logistics,
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime),
fullAddress: editData.fullAddress,
})
}
}, [])
return (
<Form
......@@ -72,7 +84,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
</Form.Item>
<Form.Item label='交付地址' name='fullAddress' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select>
{address.lengtn > 0 && address.map(v => (
{address.map(v => (
<Select.Option key={v.id} value={v.id}>{v.fullAddress}</Select.Option>
))}
</Select>
......
import React, { useRef, useState } from 'react';
import { history } from 'umi';
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 { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import {filterInteriorStateList,filterExternalStateList} from './../../common/statusList';
import {interiorState,interiorStateTwo,
enquirySearchInteriorState,enquirySearchexternalState} from '../../common/tableStatusList';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import {
interiorState, interiorStateTwo,
quoteOrderInternalState, enquirySearchexternalState
} from '../../common/tableStatusList';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { timeRange } from '@/utils/index';
......@@ -16,6 +18,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { commonEnquieryOfferSchema } from '../schema';
import StatusColors from '@/pages/transaction/components/StatusColors'
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { PublicApi } from '@/services/api';
......@@ -30,7 +33,8 @@ const AddEnquiryOrder: React.FC<{}> = () => {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any,records: any) => <EyePreview type="button">{text}</EyePreview>
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单摘要',
......@@ -46,41 +50,59 @@ const AddEnquiryOrder: React.FC<{}> = () => {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any) =>
format(text)
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any) =>
format(text)
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any) =>
format(text)
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalStateList,
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: (text: any, reconds) =>
enquirySearchexternalState(text)
render: text => <StatusColors status={text} type='out' />
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInteriorStateList,
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render:(text:any) =>
enquirySearchInteriorState(text)
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => {
console.log(record.interiorState)
return (
<>
<Button type='link'>提交审核</Button>
<Dropdown overlay={() => moreOption(record)}>
<Button type='link'>更多 <DownOutlined /></Button>
</Dropdown>
</>
)
}
},
]
const format = (text) => {
......@@ -98,11 +120,28 @@ const AddEnquiryOrder: React.FC<{}> = () => {
/**批量删除 */
const menu = (
<Menu>
<Menu.Item key='1' icon={<DeleteOutlined/>}>
批量删除
<Menu.Item key='1' icon={<DeleteOutlined />}>
批量删除
</Menu.Item>
</Menu>
)
/**更多操作 */
/**删除 */
const confirmDel = (recode: any) => {
PublicApi.postOrderInquiryListDelete({ id: recode.id }).then(res => {
ref.current.reload()
})
}
const moreOption = (record: any) => {
return (
<Menu>
<Menu.Item key='1'><Link to={`/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add?id=${record.id}`}><Button type="link">编辑</Button></Link></Menu.Item>
<Menu.Item key='2'>
<Button onClick={() => confirmDel(record)} type="link">删除</Button>
</Menu.Item>
</Menu>
)
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={24}>
......
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 actions = createFormActions()
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.postOrderInquirySubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 2:
PublicApi.postOrderInquiryDocumentsReview(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 3:
PublicApi.postOrderInquiryDocumentsReviewTwo(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 React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
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 { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
const formActions = createFormActions();
const ReviewList: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
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>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default ReviewList
\ No newline at end of file
......@@ -9,6 +9,9 @@ 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 } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
......@@ -42,10 +45,19 @@ const EnquiryOrder: React.FC<{}> = (props) => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
}];
//交易能力 询价报价 询价单查询
const fetchData = async (params: any) => {
......
import React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
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 { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import ReviewList from '../components/reviewList';
const formActions = createFormActions();
const PendingReviewOne: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
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>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
<ReviewList />
)
}
......
import React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
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 { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import ReviewList from '../components/reviewList';
const formActions = createFormActions();
const PendingReviewTwo: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
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>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
<ReviewList />
)
}
......
import React, { useRef, useState } from 'react';
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';
......@@ -12,11 +13,18 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
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';
import AuditModal from '../components/auditModel';
const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const [id, setId] = useState<any>(0);
const [selectRow, setSelectRow] = useState([])
const [visible, setvisible] = useState(false)
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
......@@ -53,16 +61,25 @@ const PendingSubmit: React.FC<{}> = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
}, {
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' onClick={() => {setId(record.id);setvisible(true)}}>审核</Button>
},
]
const format = (text) => {
......@@ -77,13 +94,47 @@ const PendingSubmit: React.FC<{}> = () => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button>批量提交审核</Button>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
</Col>
</Row>
</Row>
/**列表数据 */
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderSubmitInquirySheetList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/**搜索 */
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.postOrderInquirySubmitAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
const handleModalOK = () => {
setvisible(false)
setTimeout(()=> {
history.goBack()
},1000)
}
return (
<PageHeaderWrapper>
......@@ -93,9 +144,11 @@ const PendingSubmit: React.FC<{}> = () => {
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)
}}
......@@ -110,6 +163,13 @@ const PendingSubmit: React.FC<{}> = () => {
</StandardTable>
</Card>
<AuditModal
id={id}
type={1}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={ handleModalOK}
/>
</PageHeaderWrapper>
)
}
......
......@@ -98,7 +98,7 @@ export const registerStep0Schema: ISchema = {
}
}
},
}
}
......
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