Commit 328623dd authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

修改需求发布, 物流缺少的东西

parent 68a7b01c
......@@ -38,14 +38,14 @@ export default [
{
path: '/memberCenter/tranactionAbility/enquirySubmit/addDemandOrder/add',
name: 'addEnquiry',
component: '@/pages/transaction/enquirySubmit/addDemandOrder',
component: '@/pages/transaction/enquirySubmit/addDemandOrder/addForm',
hideInMenu: true,
},
// 待新增需求单-编辑
{
path: '/memberCenter/tranactionAbility/enquirySubmit/addDemandOrder/edit',
name: 'editEnquiry',
component: '@/pages/transaction/enquirySubmit/addDemandOrder',
component: '@/pages/transaction/enquirySubmit/addDemandOrder/addForm',
hideInMenu: true,
},
// 待新增需求单-编辑
......
......@@ -196,18 +196,18 @@ export const confirmLogisticsOrderSchema: ISchema = {
placeholder: '发货方',
},
},
status: {
type: 'string',
"x-component-props": {
placeholder: '外部状态'
},
enum: [
{ label: '待提交', value: 1 },
{ label: '待确认', value: 2 },
{ label: '不接受物流单', value: 3 },
{ label: '接受物流单', value: 4 },
]
},
// status: {
// type: 'string',
// "x-component-props": {
// placeholder: '外部状态'
// },
// enum: [
// { label: '待提交', value: 1 },
// { label: '待确认', value: 2 },
// { label: '不接受物流单', value: 3 },
// { label: '接受物流单', value: 4 },
// ]
// },
"[invoicesTimeStart,invoicesTimeEnd]": {
type: 'string',
"x-component": "dateSelect",
......@@ -363,21 +363,21 @@ export const confirmLogisticsOrderSearchSchema: ISchema = {
placeholder: '对应订单号',
},
},
status: {
type: 'string',
"x-component-props": {
placeholder: '外部状态',
style: {
width: 160
}
},
enum: [
{ label: '待提交', value: 1 },
{ label: '待确认', value: 2 },
{ label: '不接受物流单', value: 3 },
{ label: '接受物流单', value: 4 },
]
},
// status: {
// type: 'string',
// "x-component-props": {
// placeholder: '外部状态',
// style: {
// width: 160
// }
// },
// enum: [
// { label: '待提交', value: 1 },
// { label: '待确认', value: 2 },
// { label: '不接受物流单', value: 3 },
// { label: '接受物流单', value: 4 },
// ]
// },
companyId: {
type: 'string',
"x-component": 'SearchSelect',
......@@ -497,9 +497,9 @@ export const submitLogisticsOrderSchema: ISchema = {
},
enum: [
{ label: '待提交', value: 1 },
{ label: '待确认', value: 2 },
// { label: '待确认', value: 2 },
{ label: '不接受物流单', value: 3 },
{ label: '接受物流单', value: 4 },
// { label: '接受物流单', value: 4 },
]
},
}
......
......@@ -2,6 +2,7 @@ import React from 'react';
import { Button, Input, Table, Row, Col, Statistic } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons';
import ModalTable from '@/components/ModalTable'
const AddGoods: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
......@@ -15,53 +16,53 @@ const AddGoods: React.FC<{}> = () => {
},
{
title: '品类',
dataIndex: 'productName'
dataIndex: 'categoryName'
},
{
title: '品牌',
dataIndex: 'productName'
dataIndex: 'brandName'
},
{
title: '单位',
dataIndex: 'productName'
dataIndex: 'unitName'
},
{
title: '数量',
dataIndex: 'productName',
render:(text:any, record:any) =>
<Input />
dataIndex: 'amount',
render: (text: any, record: any) =>
<Input />
},
{
title: '箱数',
dataIndex: 'productName',
render:(text:any, record:any) =>
<Input />
dataIndex: 'carton',
render: (text: any, record: any) =>
<Input />
},
{
title: '重量 (KG)',
dataIndex: 'productName',
render:(text:any, record:any) =>
<Input />
dataIndex: 'weight',
render: (text: any, record: any) =>
<Input />
},
{
title: '体积 (M3)',
dataIndex: 'productName',
render:(text:any, record:any) =>
<Input />
dataIndex: 'volume',
render: (text: any, record: any) =>
<Input />
},
{
title: '操作',
dataIndex: 'options',
render:(text:any, record:any) =>
<Input />
render: (text: any, record: any) =>
<Input />
}
]
return (
<>
<Button block type='dashed' style={{marginBottom: '24px'}}><PlusOutlined />添加商品</Button>
<Button block type='dashed' style={{ marginBottom: '24px' }}><PlusOutlined />添加商品</Button>
<Table columns={columns} />
<Row gutter={[24,24]} style={{margin: '0 0 0 65%',width: '35%'}}>
<Row gutter={[24, 24]} style={{ margin: '0 0 0 65%', width: '35%' }}>
<Col span={8}><Statistic title="总箱数(箱)" value={112893} /></Col>
<Col span={8}><Statistic title="总重量(KG)" value={112893} /></Col>
<Col span={8}><Statistic title="总体积(M3)" value={112893} /></Col>
......
......@@ -7,7 +7,8 @@ import { ColumnType } from 'antd/lib/table/interface';
import { CheckSquareOutlined } from '@ant-design/icons'
import { StandardTable } from 'god';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { confirmExternalState, confirmInteriorState, inquiryQuoteOuterState, quoteOrderInternalState } from '../../common/tableStatusList';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
import AuditModal from '../components/auditModel';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
......@@ -186,7 +187,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => confirmExternalState(record.state)
render: (text: any, record: any) => <GeneralExternalState colorType={2} state={text} data={externalState} />
}, {
title: '操作',
key: 'operation',
......@@ -221,7 +222,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => confirmInteriorState(record.state)
render: (text: any, record: any) => <GeneralInteriorState colorType={2} state={text} data={interiorState} />
}, {
title: '操作',
key: 'operation',
......@@ -298,6 +299,31 @@ const Details: React.FC<parmas> = (props) => {
window.location.href = `/api/order/contractTemplate/downloadContract?contractName=${file.name}&contractUrl=${file.url}`
}
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
useEffect(() => {
const external = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi.getOrderProductInquiryExternalStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi.getOrderProductInquiryInteriorStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external, interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
}, [])
return (
<PageHeaderWrapper
className={style.header}
......@@ -353,9 +379,9 @@ const Details: React.FC<parmas> = (props) => {
<div>{item.label}</div>
<div>
{item.name === 'externalState' ?
inquiryQuoteOuterState(item.value) :
<GeneralExternalState colorType={2} state={item.value} data={externalState} /> :
item.name === 'interiorState' ?
quoteOrderInternalState(item.value) :
<GeneralInteriorState colorType={2} state={item.value} data={interiorState} /> :
(item.name === 'voucherTime' || item.name === 'quotationAsTime') ?
format(item.value) :
item.value
......@@ -369,13 +395,12 @@ const Details: React.FC<parmas> = (props) => {
>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<>
<div className={style.mainCol_title}>外部流转</div>
<Tabs>
<TabPane tab="外部流转" key="1">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={1}
current={Number(data.externalState - 1)}
>
{detailData.externalStateStep.items.map((item, index) => {
return (
......@@ -387,44 +412,25 @@ const Details: React.FC<parmas> = (props) => {
);
})}
</Steps>
</>
:
<Tabs>
<TabPane tab="外部流转" key="1">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={1}
>
{detailData.externalStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
<TabPane tab="内部流转" key="2">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={0}
>
{detailData.interiorStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
</Tabs>
</TabPane>
<TabPane tab="内部流转" key="2">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={Number(data.interiorState - 1)}
>
{detailData.interiorStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
</Tabs>
}
</div>
......
......@@ -52,12 +52,12 @@ const ReviewList: React.FC<parmas> = (props) => {
const columns: ColumnType<any>[] = [
...column,
{
title: '价单摘要',
title: '价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
title: '价会员',
key: 'memberName',
dataIndex: 'memberName',
},
......@@ -171,7 +171,7 @@ const ReviewList: React.FC<parmas> = (props) => {
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
......
......@@ -79,7 +79,7 @@ export const commonEnquieryOfferSchema: ISchema = {
memberName:{
type:'string',
"x-component-props":{
placeholder:'价会员'
placeholder:'价会员'
}
},
voucherTime:{
......
......@@ -25,14 +25,14 @@ export const pendingReviewSchema: ISchema = {
children: "{{controllerBtns}}"
}
},
inquiryListNo: {//报价单号
quotationNo: {//报价单号
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: '报价单搜索'
placeholder: '报价单'
}
}
}
......@@ -59,16 +59,22 @@ export const pendingReviewSchema: ISchema = {
inline: true
},
properties: {
inquiryListNo: {
type: 'string',
"x-component-props": {
placeholder: '询价单号'
}
},
details: {
type: 'string',
"x-component-props": {
placeholder: '价单摘要'
placeholder: '价单摘要'
}
},
memberName: {
type: 'string',
"x-component-props": {
placeholder: '被询价会员'
placeholder: '价会员'
}
},
voucherTime: {
......
import React, { useState } from 'react';
import { Form, Radio, Tooltip, Row, Col, Checkbox, Avatar, Space, Button, Table } from 'antd';
import React, { useRef, useState } from 'react';
import { Form, Radio, Tooltip, Row, Col, Checkbox, Avatar, Space, Button, Input } from 'antd';
import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons';
import style from './index.less';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
const layout: any = {
colon: false,
......@@ -17,7 +18,22 @@ export interface faceSetData {
}
const DemandDbutted: React.FC<faceSetData> = (props) => {
const { set, get } = props
const [shopId, setShopId] = useState<Number>(0)
const [shopId, setShopId] = useState<Number>(0);
const ref = useRef<any>({});
const [filterParams, setFilterParams] = useState<any>({});
// 搜索
const handleSearch = (val: string) => {
let obj = { ...filterParams, name: val }
setFilterParams(obj)
ref.current.reload(obj)
}
// 重置
const handleReset = () => {
setFilterParams({})
setTimeout(() => {
ref.current.reload()
}, 500)
}
// 系统匹配表头
const columns: ColumnType<any>[] = [
{
......@@ -102,8 +118,20 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
}
// 请求系统匹配列表数据
const fetchSystemMateData = (params:any) => {
const fetchSystemMateData = (params: any, index: number) => {
if (index === 1) {
} else if (index === 2) {
} else {
return new Promise(resolve => {
PublicApi.getMemberManageUpperProviderPage({ ...filterParams, ...params }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
}
return (
<Form
......@@ -140,7 +168,7 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
<StandardTable
rowSelection={rowSelection}
columns={columns}
// fetchTableData={(params) => fetchSystemMateData(params)}
// fetchTableData={(params) => fetchSystemMateData(params)}
/>
</Form.Item>
}
......@@ -150,9 +178,27 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
<Form.Item noStyle>
{/* <Button type='dashed' block style={{ marginBottom: '24px' }}><PlusOutlined />选择会员</Button> */}
<StandardTable
tableProps={{
rowKey: 'id',
}}
currentRef={ref}
rowSelection={rowSelection}
columns={memberColumns}
// fetchTableData={(params) => fetchSystemMateData(params)}
fetchTableData={(params) => fetchSystemMateData(params, 3)}
controlRender={
<Row>
<Col span={12}>
<Input.Search
style={{ width: '256px', marginRight: '24px', marginBottom: '24px' }}
placeholder='搜索'
value={filterParams.name}
onChange={(e) => setFilterParams({ ...filterParams, name: e.target.value })}
onSearch={(val) => handleSearch(val)}
/>
<Button onClick={handleReset}>重置</Button>
</Col>
</Row>
}
/>
</Form.Item>
}
......
export const setUpdata = {
requisitionFormAddress: [], /** 需求单地址列表 ,RequisitionFormAddresRequest */
requisitionFormProducts: [],/** 商品列表 ,RequisitionFormProductRequest */
demandDockings: [],/** 需求对接-系统匹配列表 ,DemandDockingRequest */
shopIds: [],/** 需求对接-发布至平台 ,Long */
memberIds: [],/** 需求对接-指定会员ID列表 ,Long */
details: '',/** 需求摘要 */
deliveryTime: '',/** 交付日期 */
quotationAsTime: '',/** 报价截止时间 */
voucherTime: '',/** 单据时间 */
defaultAddres: null,/** 适用地市:1.默认全部省市区 0.选中项 */
addres: '',/** 交付地址 */
addresId: null,/** 交付地址Id */
offer: '',/** 报价要求 */
paymentType: '',/** 付款方式 */
taxes: '',/** 税费要求 */
logistics: '',/** 物流要求 */
packRequire: '',/** 包装要求 */
otherRequire: '',/** 其他要求 */
type: null,/** 需求对接类型:1.发布至平台 2.系统匹配 3.指定会员 */
}
\ No newline at end of file
......@@ -238,28 +238,28 @@ const List: React.FC<{}> = () => {
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
// useEffect(() => {
// const external = new Promise(resolve => {
// //查询需求单外部状态枚举列表
// PublicApi.getOrderRequisitionFormExternalStateEnum().then((res: any) => {
// if (res.code === 1000) {
// resolve(res.data)
// }
// })
// })
// const interior = new Promise(resolve => {
// // 查询需求单内部状态枚举列表
// PublicApi.getOrderRequisitionFormInteriorStateEnum().then((res: any) => {
// if (res.code === 1000) {
// resolve(res.data)
// }
// })
// })
// Promise.all([external, interior]).then(res => {
// setExternalState(res[0])
// setInteriorState(res[1])
// })
// }, [])
useEffect(() => {
const external = new Promise(resolve => {
//查询需求单外部状态枚举列表
PublicApi.getOrderRequisitionFormExternalStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 查询需求单内部状态枚举列表
PublicApi.getOrderRequisitionFormInteriorStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external, interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
}, [])
return (
<PageHeaderWrapper>
......
......@@ -35,13 +35,6 @@ const AuditModal: React.FC<Params> = (props) => {
let value = { ...values }
value.id = props.id
switch (props.type) {
case 6:
PublicApi.postOrderInquirySubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 2:
PublicApi.postOrderInquiryDocumentsReview(value).then(res => {
if(res.code === 1000) {
......@@ -56,7 +49,7 @@ const AuditModal: React.FC<Params> = (props) => {
}
})
break;
case 4:
case 6:
PublicApi.postOrderInquiryListSubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
......
......@@ -9,6 +9,8 @@ import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/ta
import AuditModal from '../components/auditModel';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
const { TabPane } = Tabs;
const { Step } = Steps;
......@@ -34,7 +36,7 @@ const Details: React.FC<parmas> = (props) => {
//action: 审核按钮
const { id, page_type, view, action } = props;
const { pathname } = history.location;
const last = pathname.split('/')[pathname.split('/').length - 1];
const last = pathname.split('/')[pathname.split('/').length - 1];
const [headerWrapperData, setheaderWrapperData] = useState<Array<any>>([]);
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
......@@ -57,7 +59,6 @@ const Details: React.FC<parmas> = (props) => {
title: '采购商',
desc: '确认报价单',
},
,
{
title: '完成',
desc: ''
......@@ -126,7 +127,7 @@ const Details: React.FC<parmas> = (props) => {
base: {
title: '交易条件',
leftElem: [
{ title: '交付日期', key: '', value: format(data.deliveryTime)},
{ title: '交付日期', key: '', value: format(data.deliveryTime) },
{ title: '交付地址', key: '', value: data.fullAddress },
{ title: '物流要求', key: '', value: data.logistics }
],
......@@ -169,7 +170,7 @@ const Details: React.FC<parmas> = (props) => {
})
})
}, [])
// 外部流转记录&内部流转记录
const flowRecord = {
external: [{
......@@ -184,7 +185,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => externalTextState(text)
render: (text: any, record: any) => <GeneralExternalState colorType={2} state={text} data={externalState} />
}, {
title: '操作',
key: 'operation',
......@@ -219,7 +220,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => interiorTextState(text)
render: (text: any, record: any) => <GeneralInteriorState colorType={2} state={text} data={interiorState} />
}, {
title: '操作',
key: 'operation',
......@@ -262,42 +263,36 @@ const Details: React.FC<parmas> = (props) => {
}, 1000)
}
/**
* @description: 外部流转记录
* @param {type}
* @return {type}
*/
const externalTextState = (text) => {
let name = ''
console.log(data)
data.externalInquiryListStateResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
/**
* @description: 内部流转记录
* @param {type}
* @return {type}
*/
const interiorTextState = (text) => {
let name = ''
data.interiorInquiryListLogResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
/**下载 */
const onDownload = (file: any) => {
window.location.href = `/api/order/contractTemplate/downloadContract?contractName=${file.name}&contractUrl=${file.url}`
}
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
useEffect(() => {
const external = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi.getOrderProductInquiryExternalStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi.getOrderProductInquiryInteriorStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external, interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
}, [])
return (
<PageHeaderWrapper
className={style.header}
......@@ -316,7 +311,7 @@ const Details: React.FC<parmas> = (props) => {
extra={
<>
{
(last==='details' && (Number(page_type) === 2 || Number(page_type) === 3) && (data.interiorState === 2 || data.interiorState === 3)) &&
(last === 'details' && (Number(page_type) === 2 || Number(page_type) === 3) && (data.interiorState === 2 || data.interiorState === 3)) &&
<>
<Button type='primary' className={style['saveBtn']} onClick={() => { setvisible(true) }}>
<CheckSquareOutlined />单据审核
......@@ -324,7 +319,7 @@ const Details: React.FC<parmas> = (props) => {
</>
}
{
( last==='details' && Number(page_type) === 6 && data.interiorState === 1) &&
(last === 'details' && Number(page_type) === 6 && data.interiorState === 1) &&
<Button className={style['saveBtn']} onClick={() => setvisible(true)}>
<CheckSquareOutlined />提交
</Button>
......@@ -343,10 +338,10 @@ const Details: React.FC<parmas> = (props) => {
<div>{item.label}</div>
<div>
{item.name === 'externalState' ?
inquiryQuoteOuterState(item.value) :
<GeneralExternalState colorType={2} state={item.value} data={externalState} /> :
item.name === 'interiorState' ?
quoteOrderInternalState(item.value) :
item.name === 'voucherTime' ? format(item.value) : item.value}
<GeneralInteriorState colorType={2} state={item.value} data={interiorState} /> :
item.name === 'voucherTime' ? format(item.value) : item.value}
</div>
</div>
))}
......
......@@ -203,6 +203,16 @@ const AddInquiryOrder: React.FC<{}> = () => {
})
},[])
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startDocumentsTime = timeRange(values.voucherTime).st
values.endDocumentsTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
return (
<PageHeaderWrapper>
<Card>
......@@ -215,6 +225,7 @@ const AddInquiryOrder: React.FC<{}> = () => {
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH)
}}
......
......@@ -10,6 +10,8 @@ import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/ta
import AuditModal from '../components/auditModel';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
const { TabPane } = Tabs;
const { Step } = Steps;
......@@ -206,7 +208,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => inquiryQuoteOuterState(record.state)
render: (text: any, record: any) => <GeneralExternalState colorType={2} state={text} data={externalState} />
}, {
title: '操作',
key: 'operation',
......@@ -241,7 +243,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态',
key: 'state',
dataIndex: 'state',
render: (text: any, record: any) => quoteOrderInternalState(record.state)
render: (text: any, record: any) => <GeneralInteriorState colorType={2} state={text} data={interiorState} />
}, {
title: '操作',
key: 'operation',
......@@ -259,7 +261,6 @@ const Details: React.FC<parmas> = (props) => {
}
// 详情请求
useEffect(() => {
console.log(page_type, 10086)
if (type === 'rfq') {
// 代表的是查看询价
setview(1)
......@@ -268,7 +269,7 @@ const Details: React.FC<parmas> = (props) => {
setdata(res.data)
}
})
} else if(type === 'quote') {
} else if (type === 'quote') {
// 代表的是查看报价
setview(2)
PublicApi.getOrderProductQuotationDetails({ id }).then(res => {
......@@ -287,13 +288,13 @@ const Details: React.FC<parmas> = (props) => {
}
}, [])
const fetchData = (params:any) => {
const fetchData = (params: any) => {
return new Promise(resolve => {
PublicApi.getOrderInquiryDetails({...params,id}).then(res => {
PublicApi.getOrderInquiryDetails({ ...params, id }).then(res => {
console.log(res, 10086)
resolve(res.data)
})
})
})
}
useEffect(() => {
......@@ -331,10 +332,10 @@ const Details: React.FC<parmas> = (props) => {
name = format(value);
break;
case 'externalState':
name = quoteOrderInternalState(value);
name = <GeneralExternalState colorType={2} state={value} data={externalState} />;
break;
case 'interiorState':
name = inquiryQuoteOuterState(value);
name = <GeneralInteriorState colorType={2} state={value} data={interiorState} />;
break;
default:
name = value;
......@@ -348,6 +349,31 @@ const Details: React.FC<parmas> = (props) => {
window.location.href = `/api/order/contractTemplate/downloadContract?contractName=${file.name}&contractUrl=${file.url}`
}
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
useEffect(() => {
const external = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi.getOrderProductInquiryExternalStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi.getOrderProductInquiryInteriorStateEnum().then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external, interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
}, [])
return (
<PageHeaderWrapper
className={style.header}
......@@ -366,13 +392,13 @@ const Details: React.FC<parmas> = (props) => {
extra={
<>
{
((page_type === 2 || page_type === 3 || page_type === 6) && show ) &&
((page_type === 2 || page_type === 3 || page_type === 6) && show) &&
<Button type='primary' className={style['saveBtn']} onClick={() => setvisible(true)}>
<CheckSquareOutlined />单据审核
</Button>
}
{
(page_type === 1 && show ) &&
(page_type === 1 && show) &&
<Button className={style['saveBtn']} onClick={() => setvisible(true)}>
<CheckSquareOutlined />提交
</Button>
......@@ -404,70 +430,60 @@ const Details: React.FC<parmas> = (props) => {
}
>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<Tabs>
{
Object.keys(data).length > 0 &&
<>
<div className={style.mainCol_title}>外部流转</div>
<Steps
style={{ padding: '20px 0' }}
progressDot
current={Number(data.externalState - 1)}
>
{detailData.externalStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
{
(type === 'quote' ? data.externalQuotationStateResponses.length > 0 : data.externalInquiryListStateResponses.length > 0)
&&
<TabPane tab="外部流转" key="1">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={data.externalState - 1}
>
{detailData.externalStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
}
{
(type === 'quote' ? data.interiorQuotationStateResponses.length > 0 : data.interiorInquiryListLogResponses.length > 0)
&&
<TabPane tab="内部流转" key="2">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={Number(data.interiorState - 1)}
>
{detailData.interiorStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
}
</>
:
<Tabs>
<TabPane tab="外部流转" key="1">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={1}
>
{detailData.externalStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
<TabPane tab="内部流转" key="2">
<Steps
style={{ padding: '20px 0' }}
progressDot
current={Number(data.interiorState - 1)}
>
{detailData.interiorStateStep.items.map((item, index) => {
return (
<Step
key={index}
title={item.title}
description={item.desc}
/>
);
})}
</Steps>
</TabPane>
</Tabs>
}
}
</Tabs>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 &&
{view === 2 &&
<StandardTable
currentRef={ref}
columns={inquiryGoods}
......@@ -545,7 +561,7 @@ const Details: React.FC<parmas> = (props) => {
</div>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
type === 'rfq' ?
<>
<div className={style.mainCol_title}>外部流转记录</div>
<Table columns={flowRecord.external} rowKey='id' pagination={false} dataSource={data.externalInquiryListLogResponses} />
......
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