Commit 79bf9a23 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

商品询价单接入接口完善,页面跳转完善

parent 10c01578
......@@ -347,6 +347,19 @@ const TranactionRoute = {
name: 'quoteOrder',
component: '@/pages/transaction/inquiryQuote/quoteOrder'
},
//待新增报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder',
name: 'addInquiryOrder',
component: '@/pages/transaction/inquiryQuote/addInquiryOrder'
},
// 新建报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/add',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/addInquiryOrder/add'
},
// 待审核询价单(一级)
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne',
......
......@@ -131,17 +131,17 @@ export default {
// 商品询价
'menu.tranactionAbility.goodsOffer': '商品询价',
'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询',
'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增价单',
'menu.tranactionAbility.goodsOffer.add': '新建价单',
'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增价单',
'menu.tranactionAbility.goodsOffer.add': '新建价单',
'menu.tranactionAbility.goodsOffer.details': '新建询价单',
'menu.tranactionAbility.goodsOffer.pendingReviewOne': '待审核价单(一级)',
'menu.tranactionAbility.goodsOffer.pendingReviewTwo': '待审核价单(二级)',
'menu.tranactionAbility.goodsOffer.pendingSubmit': '待提交价单',
'menu.tranactionAbility.goodsOffer.pendingReviewOne': '待审核价单(一级)',
'menu.tranactionAbility.goodsOffer.pendingReviewTwo': '待审核价单(二级)',
'menu.tranactionAbility.goodsOffer.pendingSubmit': '待提交价单',
// 询价报价
'menu.tranactionAbility.inquiryQuote': '询价报价',
'menu.tranactionAbility.inquiryQuote.enquiryOrder': '询价单查询',
'menu.tranactionAbility.inquiryQuote.quoteOrder': '报价单查询',
'menu.tranactionAbility.inquiryQuote.addEnquiryOrder': '待新增询价单',
'menu.tranactionAbility.inquiryQuote.addInquiryOrder': '待新增询价单',
'menu.tranactionAbility.inquiryQuote.add': '新建询价单',
'menu.tranactionAbility.inquiryQuote.details': '新建询价单',
'menu.tranactionAbility.inquiryQuote.pendingReviewOne': '待审核询价单(一级)',
......
......@@ -13,24 +13,29 @@ import { PublicApi } from '@/services/api'
const { TabPane } = Tabs;
const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query;
const [count, setCount] = useState<string>('1')
const [count, setCount] = useState<string>('1');
const [memberList, setmemberList] = useState([]); //存放用户信息
const [goodsList, setgoodsList] = useState([]); //存放商品
const basicInfoRef = useRef<any>({});
const tradingConditionsRef = useRef<any>({});
const [editData, setEditData] = useState<any>({});
const [address, setaddress] = useState<any>({});
const [enclosureUrls, setenclosureUrls] = useState<any>([]);
const handleGetDetails = async () => {
await PublicApi.getOrderInquiryListDetails({ id }).then(res => {
if (res.code === 1000) {
console.log(res.data);
setgoodsList(res.data.inquiryListProductRequests);
setEditData(res.data)
}
})
}
useEffect(() => {
if (id) {
PublicApi.getOrderInquiryListDetails({ id }).then(res => {
if (res.code === 1000) {
setEditData(res.data)
}
})
handleGetDetails();
}
}, [])
/************* 页面的一些操作start *************/
//提交
const onSumbit = async (params: any) => {
const basicInfo = await basicInfoRef.current.validateFields();
if (count === '3') {
......@@ -42,15 +47,24 @@ const AddQuotes: React.FC<{}> = () => {
inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest
...basicInfoData,
...tradingConditionsData,
...address,
enclosureUrls,
memberName: memberList[0].name,
memberId: memberList[0].memberId
}
if (id) {
console.log(parmas)
parmas.id = editData.id;
parmas.interiorInquiryListLogResponses = editData.interiorInquiryListLogResponses;
parmas.externalInquiryListLogResponses = editData.externalInquiryListLogResponses;
await PublicApi.postOrderInquiryListUpdate(parmas).then(res => {
if (res.code === 1000) {
history.goBack();
}
})
} else {
await PublicApi.postOrderInquiryListAdd(parmas).then(res => {
if (res.code === 1000) {
console.log(res.data)
history.goBack();
}
})
}
......@@ -69,12 +83,22 @@ const AddQuotes: React.FC<{}> = () => {
const getGoodsList = (list: any) => {
setgoodsList(list)
}
/************* 页面的一些操作end *************/
const handleClick = (key: string) => {
if (key === '3') {
setCount(key)
}
}
// 地址回调
const handleGetAddress = (value: any) => {
setaddress({
fullAddress: value.children,
fullAddressId: value.value
})
}
// 附件回调
const handleGetEnclosureUrls = (data: any) => {
setenclosureUrls(data)
}
return (
<PageHeaderWrapper
......@@ -105,10 +129,14 @@ const AddQuotes: React.FC<{}> = () => {
<TradingConditions
currentRef={tradingConditionsRef}
editData={editData}
getAddress={handleGetAddress}
/>
</TabPane>
<TabPane tab="附件" key="4">
<Attached />
<Attached
editData={editData}
handleGetEnclosureUrls={handleGetEnclosureUrls}
/>
</TabPane>
<TabPane tab="流转记录" key="5">
<FlowRecord
......
......@@ -11,7 +11,13 @@ const layout: any = {
wrapperCol: { span: 9 },
labelAlign: "left"
};
const Attached: React.FC<{}> = () => {
export interface parmas {
handleGetEnclosureUrls?: Function,
editData?: any
}
const Attached: React.FC<parmas> = (props) => {
const { handleGetEnclosureUrls, editData } = props;
const [files, setFiles] = useState([]);
/**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => {
......@@ -25,10 +31,31 @@ const Attached: React.FC<{}> = () => {
const handleChange = ({ fileList }) => {
const arr: any = [];
fileList.forEach(v => {
if(v)
console.log(v)
if (v.response) {
if (v.response.code === 1000) {
arr.push({
name: v.name,
url: v.response.data
})
}
}
})
setFiles(arr)
handleGetEnclosureUrls(arr);
}
// 删除附件
const removeFiles = (index: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
handleGetEnclosureUrls(arr);
}
useEffect(() => {
if(Object.keys(editData).length > 0) {
setFiles(editData.enclosureUrls)
}
}, [editData])
return (
<Form
{...layout}
......@@ -36,13 +63,13 @@ const Attached: React.FC<{}> = () => {
>
<Form.Item label='附件' name='upload'>
<div className={styles.upload_data}>
{files.length > 0 && files.map(v => (
<div className={styles.upload_item}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<LinkOutlined />
<span>验货详情.doc</span>
<span>{v.name}</span>
</div>
<div className={styles.upload_right}>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
</div>
......
......@@ -7,7 +7,7 @@ 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';
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../../common/tableStatusList';
const layout: any = {
colon: false,
......@@ -25,7 +25,6 @@ interface queryProps {
const BasicInfo: React.FC<queryProps> = (props) => {
const [basicform] = Form.useForm();
const { getMemberList, currentRef, editData } = props;
console.log(editData, 10086)
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]);
......@@ -78,35 +77,34 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
}
// 模拟数据
const data = [{
memberId: 6,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
},{
memberId: 7,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
}]
const data = {
totalCount: 2,
data: [{
memberId: 6,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
},{
memberId: 7,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
}]
}
const fetchMemberList = async (params) => {
// const res = await PublicApi.getMemberManageLowerMerchantProviderPage(params)
// return res.data
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.memberId === params.keywords);
// PublicApi.getMemberManageLowerMerchantProviderPage(params).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
resolve(data);
}, 500);
});
}
// 选择会员弹框结束
......@@ -177,10 +175,10 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<span>{Object.keys(editData).length > 0 ? editData.voucherTime : '-'}</span>
</Form.Item>
<Form.Item label='外部状态' name='external'>
<span>{Object.keys(editData).length > 0 ? <StatusColors status={editData.inquiryListNo} type='out' /> : '-'}</span>
<span>{Object.keys(editData).length > 0 ? inquiryQuoteOuterState(editData.externalState) : '-'}</span>
</Form.Item>
<Form.Item label='内部状态' name='internal'>
<span>{Object.keys(editData).length > 0 ? quoteOrderInternalState(editData.inquiryListNo) : '-'}</span>
<span>{Object.keys(editData).length > 0 ? quoteOrderInternalState(editData.interiorState) : '-'}</span>
</Form.Item>
</Form>
{/* 选择会员弹框 */}
......
......@@ -6,7 +6,8 @@ import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any,
editData: any
editData: any,
getAddress?: Function
}
const layout: any = {
colon: false,
......@@ -16,7 +17,7 @@ const layout: any = {
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props;
const { currentRef, editData, getAddress } = props;
const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState([]);
const hadnleValidateFields = () => {
......@@ -67,10 +68,13 @@ const TradingConditions: React.FC<queryProps> = (props) => {
offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime),
fullAddress: editData.fullAddress,
fullAddressId: editData.fullAddressId,
})
}
}, [])
const addressOnChange = (value:any, option:any) => {
getAddress(option)
}
return (
<Form
{...layout}
......@@ -82,8 +86,8 @@ const TradingConditions: React.FC<queryProps> = (props) => {
<Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" />
</Form.Item>
<Form.Item label='交付地址' name='fullAddress' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select>
<Form.Item label='交付地址' name='fullAddressId' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select onChange={addressOnChange}>
{address.map(v => (
<Select.Option key={v.id} value={v.id}>{v.fullAddress}</Select.Option>
))}
......
import React, { useRef, useState } from 'react';
import { history, Link } from 'umi';
import { Button, Card, Space, Row, Col, Dropdown, Menu, Popconfirm } from 'antd';
import { Button, Card, Space, Row, Col, Dropdown, Menu, Popconfirm, message } 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
} from '../../common/tableStatusList';
import { quoteOrderInternalState, 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 { createFormActions } 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';
const formActions = createFormActions();
const AddEnquiryOrder: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const [selectRow, setSelectRow] = useState([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]);
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}&type=6&view=1`}>{text}</EyePreview>
},
{
title: '询价单摘要',
......@@ -74,7 +68,7 @@ const AddEnquiryOrder: React.FC<{}> = () => {
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
render: text => inquiryQuoteOuterState(text)
},
{
title: '内部状态',
......@@ -89,26 +83,31 @@ const AddEnquiryOrder: React.FC<{}> = () => {
{
title: '操作',
key: 'options',
width: 230,
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>
<Button type='link' disabled={record.interiorState !== 1}>提交审核</Button>
<Button type="link" disabled={record.interiorState !== 4 && record.externalState !== 1 }><Link to={`/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add?id=${record.id}`}>编辑</Link></Button>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => handleDelete(record.id)}
disabled={record.interiorState !== 1 && record.externalState !== 1}
>
<Button disabled={record.interiorState !== 1 && record.externalState !== 1} type="link">删除</Button>
</Popconfirm>
</>
)
}
},
]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
//多选
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
......@@ -117,32 +116,41 @@ const AddEnquiryOrder: React.FC<{}> = () => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量删除 */
//列表数据
const data = {
totalCount: 2,
data: [{
id: 100,
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: 2,
interiorState: 2
}]
}
const fetchData = async (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderInquiryList({ ...params }).then(res => {
resolve(res.data)
})
// setTimeout(() => {
// resolve(data)
// }, 500)
})
}
//批量审核&批量删除按钮
const menu = (
<Menu>
<Menu.Item key='1' icon={<DeleteOutlined />}>
批量删除
<span onClick={() => handleBatchDelete()}>批量删除</span>
</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}>
<Space direction="horizontal" size={16}>
......@@ -158,13 +166,37 @@ const AddEnquiryOrder: React.FC<{}> = () => {
</Space>
</Col>
</Row>
/************* 页面的一些操作start *************/
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderInquiryList(params);
return res.data
//单个删除
const handleDelete = (id:number) => {
PublicApi.postOrderInquiryListDelete({id}).then(res => {
if(res.code === 1000) {
message.success('删除成功!')
ref.current.reload();
}
})
}
//批量删除
const handleBatchDelete = () => {
if(selectedRowKeys.length === 0) {
return message.error('请选择要删除的询价单')
}
PublicApi.postOrderInquiryListDeleteAll({ids: selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref.current.reload();
}
})
}
//批量提交审核
const handleBatchAudit = () => {
if(selectedRowKeys.length === 0) {
return message.error('请选择要审核的询价单')
}
PublicApi.postOrderInquiryListSubmitAll({ids: selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref.current.reload();
}
})
}
/************* 页面的一些操作end *************/
return (
<PageHeaderWrapper>
<Card>
......@@ -180,15 +212,12 @@ const AddEnquiryOrder: React.FC<{}> = () => {
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
expressionScope={{ controllerBtns }}
schema={commonEnquieryOfferSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
......
......@@ -58,10 +58,6 @@ const AuditModal: React.FC<Params> = (props) => {
break;
}
}
/**操作 */
return (
<Modal
title='单据审核'
......
@import "../../../member/components/index.less";
.item_wrap {
margin-bottom: 24px;
background-color: #FFF;
......@@ -22,4 +21,36 @@
}
}
}
}
\ No newline at end of file
}
.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;
}
}
}
}
@import "../../../member/components/index.less";
\ No newline at end of file
......@@ -7,15 +7,12 @@ 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 { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
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';
......@@ -56,7 +53,7 @@ const ReviewList: React.FC<parmas> = (props) => {
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}&type=${type}&view=1`}>{text}</EyePreview>
},
{
title: '询价单摘要',
......@@ -90,7 +87,7 @@ const ReviewList: React.FC<parmas> = (props) => {
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
......@@ -105,7 +102,7 @@ const ReviewList: React.FC<parmas> = (props) => {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button type='link' onClick={()=>{setId(record.id);setvisible(true);}}>审核</Button>
render: (text: any, record: any) => <Button disabled={record.interiorState === 1 || record.interiorState === 3} type='link' onClick={()=>{setId(record.id);setvisible(true);}}>审核</Button>
},
]
const format = (text) => {
......@@ -143,7 +140,6 @@ const ReviewList: React.FC<parmas> = (props) => {
},1000)
}
return (
<PageHeaderWrapper>
<Card>
......
......@@ -10,8 +10,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
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 { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/tableStatusList';
import EyePreview from '@/components/EyePreview';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
......@@ -24,7 +23,7 @@ const EnquiryOrder: React.FC<{}> = (props) => {
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}&type=4&view=1`}>{text}</EyePreview>
}, {
title: '询价单摘要',
key: 'details',
......@@ -52,7 +51,7 @@ const EnquiryOrder: React.FC<{}> = (props) => {
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
......
......@@ -16,7 +16,7 @@ const PendingReviewOne: React.FC<{}> = () => {
const data = { // 模拟的数据
totalCount: 6,
data: [{
id: 1,
id: 100,
inquiryListNo: 'SZX125KJS',
details: '模拟的数据',
memberName: '冰红茶',
......@@ -25,7 +25,7 @@ const PendingReviewOne: React.FC<{}> = () => {
quotationAsTime: '2020-10-13 23:59:00',
voucherTime: '2020-10-13 13:59:00',
externalState: 1,
interiorState: 1
interiorState: 2
}, {
id: 2,
inquiryListNo: 'SZX125LIP',
......
......@@ -7,25 +7,22 @@ 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 { createFormActions} 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';
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/tableStatusList';
import AuditModal from '../components/auditModel';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const [id, setId] = useState<any>(0);
const [visible, setvisible] = useState<boolean>(false);
const [selectRow, setSelectRow] = useState([])
const [visible, setvisible] = useState(false)
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
......@@ -33,7 +30,7 @@ const PendingSubmit: React.FC<{}> = () => {
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}&type=1&view=1`}>{text}</EyePreview>
},
{
title: '询价单摘要',
......@@ -67,7 +64,7 @@ const PendingSubmit: React.FC<{}> = () => {
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
render: text => inquiryQuoteOuterState(text)
}, {
title: '内部状态',
key: 'interiorState',
......@@ -82,7 +79,7 @@ const PendingSubmit: React.FC<{}> = () => {
title: '操作',
key: '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' onClick={() => { setId(record.id); setvisible(true)}}>提交询价单</Button>
},
]
const format = (text) => {
......@@ -148,15 +145,12 @@ const PendingSubmit: React.FC<{}> = () => {
ref.current.reload()
})
}
const handleModalOK = () => {
setvisible(false)
setTimeout(() => {
history.goBack()
}, 1000)
}
return (
<PageHeaderWrapper>
<Card>
......@@ -181,7 +175,6 @@ const PendingSubmit: React.FC<{}> = () => {
</NiceForm>
}
>
</StandardTable>
</Card>
<AuditModal
......
import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { Button, Card, Tabs, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
import BasicInfo from './components/basicInfo'; // 基本信息
import EnquiryGoods from './components/enquiryGoods'; // 询价商品
import TradingConditions from './components/tradingConditions'; // 交易条件
import Attached from './components/attached'; // 附件
import FlowRecord from './components/flowRecord'; // 流转记录
import { PublicApi } from '@/services/api'
const { TabPane } = Tabs;
const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query;
const [count, setCount] = useState<string>('1')
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();
if (count === '3') {
const tradingConditions = await tradingConditionsRef.current.validateFields();
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('有必填字段没选择,请检查!');
}
}else {
message.error('有必填字段没选择,请检查!');
}
}
// 获取到会员信息
const getMemberList = (list: any) => {
setmemberList(list);
}
// 获取添加的商品列表
const getGoodsList = (list: any) => {
setgoodsList(list)
}
/************* 页面的一些操作end *************/
const handleClick = (key: string) => {
if (key === '3') {
setCount(key)
}
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title='新建报价单'
extra={
<Button type="primary" onClick={onSumbit}> 保存</Button>
}
>
<Card>
<Tabs onTabClick={handleClick}>
<TabPane tab="基本信息" key="1">
<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">
<Attached />
</TabPane>
<TabPane tab="流转记录" key="5">
<FlowRecord
editData={editData}
/>
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
)
}
export default AddQuotes
\ No newline at end of file
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, LinkOutlined } from '@ant-design/icons';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
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}
className={styles.revise_style}
>
<Form.Item label='附件' name='upload'>
<div className={styles.upload_data}>
{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>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<Button icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
)
}
export default Attached;
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Form, Input, Button } from 'antd';
import styles from './index.less';
import { LinkOutlined } from '@ant-design/icons';
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,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
const { Search } = Input;
interface queryProps {
currentRef?: any,
getMemberList?: Function,
editData: any
}
const BasicInfo: React.FC<queryProps> = (props) => {
const [basicform] = Form.useForm();
const { getMemberList, currentRef, editData } = props;
console.log(editData, 10086)
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const handleOkAddMember = () => {
setVisibleChannelMember(false)
setmemberList(memberRowCtl.selectRow);
getMemberList(memberRowCtl.selectRow); // 回传给父级
}
const handleCancelAddMember = () => {
setVisibleChannelMember(false)
}
const columnsSetMember: any[] = [
{
title: 'ID',
dataIndex: 'memberId',
key: 'memberId',
},
{
title: '会员名称',
dataIndex: 'name',
key: 'name',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
}
]
const formSearch: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
// 模拟数据
const data = [{
memberId: 6,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
},{
memberId: 7,
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
}]
const fetchMemberList = async (params) => {
// const res = await PublicApi.getMemberManageLowerMerchantProviderPage(params)
// return res.data
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.memberId === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
}
// 选择会员弹框结束
useEffect(() => {
if(memberList.length > 0) {
basicform.setFieldsValue({'memberName': memberList[0].name ? memberList[0].name : undefined})
}
},[memberList])
/************* 页面的一些操作start *************/
// 拿到表单数据
const hadnleValidateFields = () => {
return new Promise((resolve) => {
basicform.validateFields().then(values => {
resolve({
state: true,
data: {
details: values.details,
memberName: values.memberName,
}
})
}).catch(errorInfo => {
console.log(errorInfo)
})
})
}
useEffect(() => {
if (currentRef) {
const userAction = {
validateFields: () => hadnleValidateFields()
}
if (currentRef && typeof currentRef === 'function') {
currentRef(userAction);
}
if (currentRef && typeof currentRef !== 'function') {
currentRef.current = userAction;
}
}
},[])
useEffect(() => {
if(Object.keys(editData).length > 0) {
basicform.setFieldsValue({
details: editData.details
})
}
}, [editData])
/************* 页面的一些操作end *************/
return (
<>
<Form
{...layout}
form={basicform}
className={styles.revise_style}
>
<Form.Item label='询价单摘要' name='details' rules={[{ required: true, message: '请输入询价单摘要' }]}>
<Input />
</Form.Item>
<Form.Item label='被询价会员' name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search value={memberList.length > 0 ? memberList[0].name : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} />
<Button type='link'>查看会员详情</Button>
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
</Form.Item>
<Form.Item label='单据时间' name='time'>
<span>{Object.keys(editData).length > 0 ? editData.voucherTime : '-'}</span>
</Form.Item>
<Form.Item label='外部状态' name='external'>
<span>{Object.keys(editData).length > 0 ? <StatusColors status={editData.inquiryListNo} type='out' /> : '-'}</span>
</Form.Item>
<Form.Item label='内部状态' name='internal'>
<span>{Object.keys(editData).length > 0 ? quoteOrderInternalState(editData.inquiryListNo) : '-'}</span>
</Form.Item>
</Form>
{/* 选择会员弹框 */}
<ModalTable
modalTitle='选择会员'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
visible={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
formilyProps={
{
ctx: { schema: formSearch }
}
}
tableProps={{
rowKey: 'memberId',
}}
/>
</>
)
}
export default BasicInfo
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Button, message, Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { ISchema, createAsyncFormActions, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import ModalTable, { ModalTableProps } from '@/components/ModalTable';
import { PublicApi } from '@/services/api';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
interface queryProps extends ModalTableProps {
memberList?: any,
schemaAction?: ISchemaFormActions | ISchemaFormAsyncActions,
getGoodsList: Function,
editData: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { memberList, schemaAction, getGoodsList, editData, ...restProps } = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
setValue(value);
};
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [goodsList, setgoodsList] = useState([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'commodityId' });
const handleOkAddMember = () => {
setVisibleChannelMember(false);
const arr: any[] = []
memberRowCtl.selectRow.forEach((v, i) => {
arr.push({
productId: v.commodityId,
productName: v.name,
inquiryListNo: v.customerCategoryName,
brand: v.brandName,
nuit: v.unitName,
purchaseQuantity: 0
})
setgoodsList(arr)
})
}
const handleCancelAddMember = () => {
setVisibleChannelMember(false)
}
const columnsSetMember: any[] = [
{
title: 'ID',
dataIndex: 'commodityId',
key: 'commodityId',
},
{
title: '商品名称',
dataIndex: 'name',
key: 'name',
},
{
title: '品类',
dataIndex: 'customerCategoryName',
key: 'customerCategoryName',
},
{
title: '品牌',
dataIndex: 'brandName',
key: 'brandName',
}
]
const formSearch: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '商品名称',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
customerCategoryName: {
type: 'string',
"x-component-props": {
placeholder: '请输入品类',
}
},
brandName: {
type: 'string',
"x-component-props": {
placeholder: '请输入品牌',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
/**输入框输入 */
const inputOnchange = (id, e) => {
const {value} = e.target
goodsList.forEach(v => {
if(v.productId === id) {
v.purchaseQuantity = value
}
})
getGoodsList(goodsList) // 返回给父级
setgoodsList(goodsList)
}
const columns: ColumnType<any>[] = [{
title: '序号',
dataIndex: 'productId',
}, {
title: '商品名称',
dataIndex: 'productName',
}, {
title: '品类',
dataIndex: 'inquiryListNo',
}, {
title: '品牌',
dataIndex: 'brand',
}, {
title: '单位',
dataIndex: 'nuit',
}, {
title: '采购数量',
dataIndex: 'purchaseQuantity',
render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.purchaseQuantity}>
<Input
onBlur={(e) => inputOnchange(record.productId, e)}
type='number'
maxLength={25}
/>
</Form.Item>
)
}, {
title: '操作',
dataIndex: 'operation',
render: (text: any, record: any) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
}]
// 模拟数据
const data = [{
commodityId: 1,
name: '进口头层黄牛皮荔枝纹/红色/XXL',
customerCategoryName: '牛皮',
brandName: 'PELLE',
unitName: '个',
}, {
commodityId: 2,
name: '进口头层黄牛皮荔枝纹/红色/XXL',
customerCategoryName: '牛皮',
brandName: 'PELLE',
unitName: '个',
}, {
commodityId: 3,
name: '进口头层黄牛皮荔枝纹/红色/XXL',
customerCategoryName: '牛皮',
brandName: 'PELLE',
unitName: '个',
}, {
commodityId: 4,
name: '进口头层黄牛皮荔枝纹/红色/XXL',
customerCategoryName: '牛皮',
brandName: 'PELLE',
unitName: '个',
}, {
commodityId: 5,
name: '进口头层黄牛皮荔枝纹/红色/XXL',
customerCategoryName: '牛皮',
brandName: 'PELLE',
unitName: '个',
}]
const fetchGoodsList = async (params) => {
// const res = await PublicApi.getMemberManageLowerProviderPage(params)
// return res.data
return new Promise((resolve, reject) => {
console.log(data, params)
setTimeout(() => {
resolve({
code: 200,
message: '',
data: data,
});
}, 1000);
});
}
// 选择会员弹框结束
useEffect(() => {
// 重选会员清掉已选择的商品
setgoodsList([]);
}, [memberList])
// 添加商品
const addGoods = () => {
if (memberList.length > 0 && memberList[0].memberId) {
setVisibleChannelMember(true);
} else {
message.error('请选择被询价会员')
}
}
// 删除
const handleDelete = (record) => {
const newData = [...goodsList];
const colIndex = newData.findIndex(v => v.productId === record.productId)
newData.splice(colIndex, 1)
// 删除选中的项
memberRowCtl.setSelectRow(newData)
memberRowCtl.setSelectedRowKeys(newData.map(v => v.productId))
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>
<Form>
<Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} />
</Form>
{/* 选择商品弹框 */}
<ModalTable
modalTitle='选择商品'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
visible={visibleChannelMember}
resetModal={{ destroyOnClose: true, forceRender: true }}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchGoodsList(params)}
formilyProps={
{
ctx: {
schema: formSearch,
actions: productFormActions,
components: { ModalSearch: Search, SearchSelect, Submit },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
}
}
}
}
tableProps={{
rowKey: 'commodityId'
}}
{...restProps}
/>
</div>
)
}
export default EnquiryGoods
\ No newline at end of file
import React, { useState } from 'react';
import styles from './index.less';
import { Radio } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
export interface parmas {
editData?: any
}
const FlowRecord: React.FC<parmas> = (props) => {
const { editData } = props;
const [radio, setRadio] = useState<string>('outer'); //切换单据
const outerColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'inquiryListId',
}, {
title: '操作角色',
dataIndex: 'roleName',
}, {
title: '状态',
dataIndex: 'state',
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const insideColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'inquiryListId',
}, {
title: '操作人',
dataIndex: 'roleName',
}, {
title: '部门',
dataIndex: 'department',
}, {
title: '职位',
dataIndex: 'position',
}, {
title: '状态',
dataIndex: 'state',
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const onChange = (e: any) => {
setRadio(e.target.value)
}
return (
<div className={styles.revise_style}>
<Radio.Group defaultValue="outer" buttonStyle="solid" onChange={onChange}>
<Radio.Button value="outer">外部单据(0)</Radio.Button>
<Radio.Button value="inside">内部单据(0)</Radio.Button>
</Radio.Group>
{radio === 'outer' ?
<PolymericTable
dataSource={editData.interiorInquiryListLogResponses}
columns={outerColumns}
loading={false}
pagination={null}
/>
:
<PolymericTable
dataSource={editData.externalInquiryListLogResponses}
columns={insideColumns}
loading={false}
pagination={null}
/>
}
</div>
)
}
export default FlowRecord
\ No newline at end of file
.revise_style {
:global {
.ant-form-item-label {
width: 174px;
label {
color:#6B778C
}
}
.ant-form-item-control {
width: 500px;
.ant-form-item-control-input-content {
position: relative;
.ant-btn-link {
position: absolute;
right: -120px;
}
.ant-picker {
width: 100%;
}
}
.ant-input-group-addon {
.ant-input-search-button {
background-color: #6B778C;
border-color: #6B778C;
}
}
}
.ant-radio-group-solid {
.ant-radio-button-wrapper-checked {
background: #6B778C;
border-color: #6B778C;
&:hover {
background: #6B778C;
border-color: #6B778C;
}
}
}
}
.upload_item {
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: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import moment from 'moment';
import { Form, Input, Select, Row, Col, DatePicker } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState([]);
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
resolve({
state: true,
data: {
deliveryTime: moment(values.deliveryTime).unix(),
quotationAsTime: moment(values.quotationAsTime).unix(),
offer: values.offer,
paymentType: values.paymentType,
taxes: values.taxes,
logistics: values.logistics,
packRequire: values.logistics,
otherRequire: values.logistics,
}
})
}).catch(errorInfo => {
console.log(errorInfo)
})
})
}
useEffect(() => {
if (currentRef) {
const userAction = {
validateFields: () => hadnleValidateFields()
}
if (currentRef && typeof currentRef === 'function') {
currentRef(userAction);
}
if (currentRef && typeof currentRef !== 'function') {
currentRef.current = userAction;
}
}
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(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
{...layout}
form={TradingConditionsForm}
className={styles.revise_style}
>
<Row gutter={70}>
<Col span={12}>
<Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" />
</Form.Item>
<Form.Item label='交付地址' name='fullAddress' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select>
{address.map(v => (
<Select.Option key={v.id} value={v.id}>{v.fullAddress}</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" />
</Form.Item>
<Form.Item label='报价要求' name='offer'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='付款方式' name='paymentType'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='税费要求' name='taxes'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='物流要求' name='logistics'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label='包装要求' name='packRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='其他要求' name='otherRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default TradingConditions
\ 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 { quoteOrderInternalState, 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 } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { commonEnquieryOfferSchema } from '../schema';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const AddInquiryOrder: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]);
const [visible, setvisible] = useState<boolean>(false)
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=6&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=6&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) => {
console.log(record.interiorState)
return (
<>
<Button type='link'>提交审核</Button>
<Dropdown
visible={visible}
onVisibleChange={(visible) => onVisibleChange(visible) }
overlay={() => optionmenu(record)}
trigger={['click']}>
<Button type='link'>更多 <DownOutlined /></Button>
</Dropdown>
</>
)
}
}]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const onVisibleChange = (visible:boolean) => {
console.log(visible)
setvisible(visible)
}
//多选
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
//批量删除
const menu = (
<Menu>
<Menu.Item key='1' icon={<DeleteOutlined />}>
批量删除
</Menu.Item>
</Menu>
)
//更多操作
const optionmenu = (record: any) => {
return (
<Menu>
<Menu.Item key='1'><Button type="link" onClick={() => onVisibleChange(false)}>编辑</Button></Menu.Item>
<Menu.Item key='2'>
<Popconfirm
destroyTooltipOnHide
title="确定要删除吗?"
okText="是"
cancelText="否"
>
<Button type="link">删除</Button>
</Popconfirm>
</Menu.Item>
</Menu>
)
}
//列表数据
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 = async (params: any) => {
return new Promise((resolve, reject) => {
// PublicApi.getOrderStayProductQuotationList({ ...params }).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
})
}
//批量审核&批量删除按钮
const controllerBtns = <Row>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/add`)}>新建</Button>
<Button>批量提交审核</Button>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button>
</Space>
</Col>
</Row>
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 AddInquiryOrder
\ No newline at end of file
......@@ -26,9 +26,9 @@ export const HEADER_WRAPPER_TEXTS = {
const Details: React.FC<{}> = () => {
const [visible, setvisible] = useState(false)
//type: 1.待提交报价单,2.待审核报价单1级,3.待审核报价单2级,4.询价单查询,5.报价单查询
//type: 1.待提交报价单,2.待审核报价单1级,3.待审核报价单2级,4.询价单查询,5.报价单查询,6.待新增报价单
//view: 1.询价单号,2.报价单号
const { id, type, view } = history.location.query;
const { id, type, view } = history.location.query;
const [headerWrapperData, setheaderWrapperData] = useState<Array<any>>([]);
// steps 切换
const [detailData, setDetailData] = useState<any>({
......@@ -303,6 +303,13 @@ const Details: React.FC<{}> = () => {
}
})
break;
case 6:
PublicApi.getOrderProductQuotationDetails({ id }).then(res => {
if (res.code === 1000) {
setdata(res.data)
}
})
break;
}
}, [])
......@@ -342,7 +349,7 @@ const Details: React.FC<{}> = () => {
<div className={style['headerTop']}>
<div className={style['headerTop-prefix']}></div>
<div className={style['headerTop-name']}>
{ Number(view) === 1 ? '询价单号' : '报价单号'}{ Number(view) === 1 ? data.inquiryListNo : data.quotationNo}
{Number(view) === 1 ? '询价单号' : '报价单号'}{Number(view) === 1 ? data.inquiryListNo : data.quotationNo}
</div>
<div className={style[`levelIcon${'1'}`]}></div>
</div>
......@@ -362,8 +369,8 @@ const Details: React.FC<{}> = () => {
</>
}
{
(Number(type) === 1 && data.externalState === 1 && data.interiorState === 3) &&
<Button className={style['saveBtn']} onClick={()=>setvisible(true)}>
(Number(type) === 1 && data.externalState === 1 && data.interiorState === 3) &&
<Button className={style['saveBtn']} onClick={() => setvisible(true)}>
<CheckSquareOutlined />提交
</Button>
}
......@@ -387,11 +394,11 @@ const Details: React.FC<{}> = () => {
<div key={item.name} className={style['headerMain-left-option']}>
<div>{item.label}</div>
<div>
{ item.name === 'externalState' ?
{item.name === 'externalState' ?
<StatusColors status={item.value} type='inquiry' /> :
item.name === 'interiorState' ?
quoteOrderInternalState(item.value) :
item.value
item.name === 'interiorState' ?
quoteOrderInternalState(item.value) :
item.value
}
</div>
</div>
......
......@@ -7,13 +7,11 @@ 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 { createFormActions } 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';
......
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