Commit 3b2f6c0f authored by XieZhiXiong's avatar XieZhiXiong
parents b182316f 85cc0300
...@@ -27,6 +27,13 @@ export default [ ...@@ -27,6 +27,13 @@ export default [
name: 'addEnquiryOrder', name: 'addEnquiryOrder',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder' component: '@/pages/transaction/goodsOffer/addEnquiryOrder'
}, },
// 立即询价 - 从商城跳转而来;
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/rfq',
name: 'rfq',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/rfq'
},
// 新建询价单 // 新建询价单
{ {
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add', path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add',
...@@ -39,7 +46,7 @@ export default [ ...@@ -39,7 +46,7 @@ export default [
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/edit', path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/edit',
name: 'edit', name: 'edit',
hideInMenu: true, hideInMenu: true,
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add' component: '@/pages/transaction/goodsOffer/addEnquiryOrder/edit'
}, },
// 待新增询价单详情 // 待新增询价单详情
{ {
......
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询', 'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询',
'menu.tranactionAbility.goodsOffer.enquiryOrderDetails': '询价单查询详情', 'menu.tranactionAbility.goodsOffer.enquiryOrderDetails': '询价单查询详情',
'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增询价单', 'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增询价单',
'menu.tranactionAbility.goodsOffer.rfq': '立即询价',
'menu.tranactionAbility.goodsOffer.add': '新建询价单', 'menu.tranactionAbility.goodsOffer.add': '新建询价单',
'menu.tranactionAbility.goodsOffer.edit': '编辑询价单', 'menu.tranactionAbility.goodsOffer.edit': '编辑询价单',
'menu.tranactionAbility.goodsOffer.addEnquiryOrderDetails': '待新增询价详情', 'menu.tranactionAbility.goodsOffer.addEnquiryOrderDetails': '待新增询价详情',
......
...@@ -501,7 +501,7 @@ const CommodityDetail = (props) => { ...@@ -501,7 +501,7 @@ const CommodityDetail = (props) => {
} }
const handleInquiry = () => { const handleInquiry = () => {
window.location.href = `/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add?id=${id}&memberId=${memberId}` window.location.href = `/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/rfq?id=${id}&memberId=${memberId}`
} }
/** /**
......
import React, { useState, useRef, useEffect } from 'react'; import React from 'react';
import AddForm from './addForm';
import { history } from 'umi'; import { history } from 'umi';
import { Button, Card, Tabs, message } from 'antd'; const AddEnquiryOrder:React.FC<{}> = () => {
import { PageHeaderWrapper } from '@ant-design/pro-layout'; return(
import ReutrnEle from '@/components/ReturnEle'; <AddForm
import BasicInfo from './components/basicInfo'; // 基本信息 type={1}
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>({});
const [address, setaddress] = useState<any>({});
const [enclosureUrls, setenclosureUrls] = useState<any>([]);
const handleGetDetails = async () => {
await PublicApi.getOrderInquiryListDetails({ id }).then(res => {
if (res.code === 1000) {
setgoodsList(res.data.inquiryListProductRequests);
setEditData(res.data)
}
})
}
useEffect(() => {
console.log(history.location)
if (id) {
handleGetDetails();
setCount('3');
}
}, [])
//提交
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,
...address,
enclosureUrls,
memberName: memberList[0].name,
memberId: memberList[0].memberId
}
if (id) {
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) {
history.goBack();
}
})
}
} else {
message.error('有必填字段没选择,请检查!');
}
}else {
message.error('有必填字段没选择,请检查!');
}
}
// 获取到会员信息
const getMemberList = (list: any) => {
setmemberList(list);
}
// 获取添加的商品列表
const getGoodsList = (list: any) => {
setgoodsList(list)
}
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
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
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}
getAddress={handleGetAddress}
/>
</TabPane>
<TabPane tab="附件" key="4">
<Attached
editData={editData}
handleGetEnclosureUrls={handleGetEnclosureUrls}
/>
</TabPane>
<TabPane tab="流转记录" key="5">
<FlowRecord
editData={editData}
/>
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
) )
} }
export default AddEnquiryOrder;
export default AddQuotes \ No newline at end of file
\ No newline at end of file
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;
export interface parmas {
id?: any,
type?: any, // 1. 新增, 2.编辑, 3.立即询价
}
const AddQuotes: React.FC<parmas> = (props) => {
const {id, type} = props
const [count, setCount] = useState<string>('1');
const [member, setmember] = useState<any>({}); //存放用户信息
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) {
setgoodsList(res.data.inquiryListProductRequests);
setEditData(res.data)
}
})
}
useEffect(() => {
if (id && type === 2) {
handleGetDetails();
setCount('3');
}
}, [])
//提交
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,
...address,
enclosureUrls,
memberName: member.name,
memberId: member.memberId
}
if (id && type === 2) {
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) {
history.goBack();
}
})
}
} else {
message.error('有必填字段没选择,请检查!');
}
}else {
message.error('有必填字段没选择,请检查!');
}
}
// 获取到会员信息
const getMemberList = (list: any) => {
setmember(list);
}
// 获取添加的商品列表
const getGoodsList = (list: any) => {
setgoodsList(list)
}
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([...enclosureUrls,...data]);
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
extra={
<Button type="primary" onClick={onSumbit}> 保存</Button>
}
>
<Card>
<Tabs onTabClick={handleClick}>
<TabPane tab="基本信息" key="1" forceRender>
<BasicInfo
currentRef={basicInfoRef}
getMemberList={getMemberList}
editData={editData}
/>
</TabPane>
<TabPane tab="询价商品" key="2" forceRender>
<EnquiryGoods
member={member}
getGoodsList={getGoodsList}
editData={editData}
/>
</TabPane>
<TabPane tab="交易条件" key="3" forceRender>
<TradingConditions
currentRef={tradingConditionsRef}
editData={editData}
getAddress={handleGetAddress}
/>
</TabPane>
<TabPane tab="附件" key="4" forceRender>
<Attached
editData={editData}
handleGetEnclosureUrls={handleGetEnclosureUrls}
/>
</TabPane>
<TabPane tab="流转记录" key="5" forceRender>
<FlowRecord
editData={editData}
/>
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
)
}
export default AddQuotes
\ No newline at end of file
...@@ -19,6 +19,7 @@ export interface parmas { ...@@ -19,6 +19,7 @@ export interface parmas {
const Attached: React.FC<parmas> = (props) => { const Attached: React.FC<parmas> = (props) => {
const { handleGetEnclosureUrls, editData } = props; const { handleGetEnclosureUrls, editData } = props;
const [files, setFiles] = useState([]); const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
/**判断文件类型和大小 */ /**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => { const beforeDocUpload = (file: UploadFile) => {
const isLt20M = file.size / 1024 / 1024 < 20; const isLt20M = file.size / 1024 / 1024 < 20;
...@@ -28,19 +29,19 @@ const Attached: React.FC<parmas> = (props) => { ...@@ -28,19 +29,19 @@ const Attached: React.FC<parmas> = (props) => {
return isLt20M; return isLt20M;
} }
// 上传回调 // 上传回调
const handleChange = ({ fileList }) => { const handleChange = ({ file }) => {
const arr: any = []; const arr: any = [];
fileList.forEach(v => { setloading(true);
if (v.response) { if (file.response) {
if (v.response.code === 1000) { if (file.response.code === 1000) {
arr.push({ arr.push({
name: v.name, name: file.name,
url: v.response.data url: file.response.data
}) })
} setloading(false);
} }
}) }
setFiles(arr) setFiles([...files, ...arr])
handleGetEnclosureUrls(arr); handleGetEnclosureUrls(arr);
} }
// 删除附件 // 删除附件
...@@ -51,7 +52,7 @@ const Attached: React.FC<parmas> = (props) => { ...@@ -51,7 +52,7 @@ const Attached: React.FC<parmas> = (props) => {
handleGetEnclosureUrls(arr); handleGetEnclosureUrls(arr);
} }
useEffect(() => { useEffect(() => {
if(Object.keys(editData).length > 0) { if (Object.keys(editData).length > 0) {
setFiles(editData.enclosureUrls) setFiles(editData.enclosureUrls)
} }
}, [editData]) }, [editData])
...@@ -83,7 +84,7 @@ const Attached: React.FC<parmas> = (props) => { ...@@ -83,7 +84,7 @@ const Attached: React.FC<parmas> = (props) => {
beforeUpload={beforeDocUpload} beforeUpload={beforeDocUpload}
onChange={handleChange} onChange={handleChange}
> >
<Button icon={<UploadOutlined />}>上传文件</Button> <Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div> <div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload> </Upload>
</Form.Item> </Form.Item>
......
...@@ -27,13 +27,18 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -27,13 +27,18 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const { getMemberList, currentRef, editData } = props; const { getMemberList, currentRef, editData } = props;
// 会员添加弹窗控制 // 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false); const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]); const [memberName, setmemberName] = useState<any>();
const [memberId, setmemberId] = useState<any>();
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' }); const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
console.log(memberRowCtl.selectRow) const memberInfo = {
setmemberList(memberRowCtl.selectRow); name: memberRowCtl.selectRow[0].name,
getMemberList(memberRowCtl.selectRow); // 回传给父级 memberId: memberRowCtl.selectRow[0].memberId
}
setmemberId(memberRowCtl.selectRow[0].memberId)
setmemberName(memberRowCtl.selectRow[0].name);
getMemberList(memberInfo); // 回传给父级
} }
const handleCancelAddMember = () => { const handleCancelAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
...@@ -77,44 +82,21 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -77,44 +82,21 @@ const BasicInfo: React.FC<queryProps> = (props) => {
} }
} }
} }
// 模拟数据 // 请求
// 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 fetchMemberList = async (params) => {
console.log(params) console.log(params)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getMemberManagePlatformProviderPage({...params}).then(res => { PublicApi.getMemberManagePlatformProviderPage({...params}).then(res => {
resolve(res.data) resolve(res.data)
}) })
// setTimeout(() => {
// resolve(data);
// }, 500);
}); });
} }
// 选择会员弹框结束 // 选择会员弹框结束
useEffect(() => { useEffect(() => {
if(memberList.length > 0) { if(memberName) {
basicform.setFieldsValue({'memberName': memberList[0].name ? memberList[0].name : undefined}) basicform.setFieldsValue({'memberId': memberId ? 14 : undefined})
} }
},[memberList]) },[memberName])
/************* 页面的一些操作start *************/ /************* 页面的一些操作start *************/
// 拿到表单数据 // 拿到表单数据
...@@ -125,7 +107,7 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -125,7 +107,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
state: true, state: true,
data: { data: {
details: values.details, details: values.details,
memberName: values.memberName, memberId: values.memberId,
} }
}) })
}).catch(errorInfo => { }).catch(errorInfo => {
...@@ -149,8 +131,10 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -149,8 +131,10 @@ const BasicInfo: React.FC<queryProps> = (props) => {
useEffect(() => { useEffect(() => {
if(Object.keys(editData).length > 0) { if(Object.keys(editData).length > 0) {
console.log(12131)
basicform.setFieldsValue({ basicform.setFieldsValue({
details: editData.details details: editData.details,
memberId: 14
}) })
} }
}, [editData]) }, [editData])
...@@ -166,9 +150,9 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -166,9 +150,9 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Form.Item label='询价单摘要' name='details' rules={[{ required: true, message: '请输入询价单摘要' }]}> <Form.Item label='询价单摘要' name='details' rules={[{ required: true, message: '请输入询价单摘要' }]}>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label='被询价会员' name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}> <Form.Item label='被询价会员' name='memberId' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search value={memberList.length > 0 ? memberList[0].name : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} /> <Search value={memberName ? memberName : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} />
{memberList.length > 0 && <Button type='link'>查看会员详情</Button>} {memberName && <Button type='link'>查看会员详情</Button>}
</Form.Item> </Form.Item>
<Form.Item label='询价单号' name='orderNumber'> <Form.Item label='询价单号' name='orderNumber'>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span> <span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Button, message, Input, Table, Form } from 'antd'; import { Button, message, InputNumber, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
...@@ -14,14 +14,14 @@ import Search from '@/components/NiceForm/components/Search' ...@@ -14,14 +14,14 @@ import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
interface queryProps extends ModalTableProps { interface queryProps extends ModalTableProps {
memberList?: any, member?: any,
schemaAction?: ISchemaFormActions | ISchemaFormAsyncActions, schemaAction?: ISchemaFormActions | ISchemaFormAsyncActions,
getGoodsList: Function, getGoodsList: Function,
editData: any editData: any
} }
const EnquiryGoods: React.FC<queryProps> = (props) => { const EnquiryGoods: React.FC<queryProps> = (props) => {
const { memberList, schemaAction, getGoodsList, editData, ...restProps } = props const { member, schemaAction, getGoodsList, editData, ...restProps } = props
const [value, setValue] = useState<any>('') const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions() const productFormActions = createAsyncFormActions()
const onChange = (value) => { const onChange = (value) => {
...@@ -31,7 +31,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -31,7 +31,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
const [visibleChannelMember, setVisibleChannelMember] = useState(false); const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [goodsList, setgoodsList] = useState([]); const [goodsList, setgoodsList] = useState([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' }); const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const [customerCategory, setcustomerCategory] = useState([]);
const [brand, setbrand] = useState([]);
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false); setVisibleChannelMember(false);
const arr: any[] = [] const arr: any[] = []
...@@ -42,7 +44,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -42,7 +44,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
inquiryListNo: v.customerCategoryName, inquiryListNo: v.customerCategoryName,
brand: v.brandName, brand: v.brandName,
nuit: v.unitName, nuit: v.unitName,
purchaseQuantity: 0 purchaseQuantity: 1
}) })
setgoodsList(arr) setgoodsList(arr)
...@@ -99,17 +101,37 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -99,17 +101,37 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
}, },
}, },
properties: { properties: {
customerCategoryName: { customerCategoryId: {
type: 'string', type: 'string',
"x-component-props": { 'x-component': 'CustomInputSearch',
placeholder: '请输入品类', 'x-component-props': {
} placeholder: '请选择品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
},
enum: customerCategory
}, },
brandName: { brandId: {
type: 'string', type: 'string',
"x-component-props": { 'x-component': 'CustomInputSearch',
placeholder: '请输入品牌', 'x-component-props': {
} placeholder: '请选择品牌',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px', lineHeight: '32px' },
searchValue: null,
dataoption: []
},
enum: brand
}, },
submit: { submit: {
"x-component": 'Submit', "x-component": 'Submit',
...@@ -126,9 +148,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -126,9 +148,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
} }
/**输入框输入 */ /**输入框输入 */
const inputOnchange = (id, e) => { const inputOnchange = (id, e) => {
const {value} = e.target const { value } = e.target
goodsList.forEach(v => { goodsList.forEach(v => {
if(v.productId === id) { if (v.productId === id) {
v.purchaseQuantity = value v.purchaseQuantity = value
} }
}) })
...@@ -156,9 +178,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -156,9 +178,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
dataIndex: 'purchaseQuantity', dataIndex: 'purchaseQuantity',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.purchaseQuantity}> <Form.Item name={record.productId} noStyle initialValue={record.purchaseQuantity}>
<Input <InputNumber
onBlur={(e) => inputOnchange(record.productId, e)} onBlur={(e) => inputOnchange(record.productId, e)}
type='number' min={1}
maxLength={25} maxLength={25}
/> />
</Form.Item> </Form.Item>
...@@ -168,11 +190,11 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -168,11 +190,11 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
dataIndex: 'operation', dataIndex: 'operation',
render: (text: any, record: any) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button> render: (text: any, record: any) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
}] }]
const fetchGoodsList = (params) => { const fetchGoodsList = (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getProductCommodityCommonGetCommodityListByBuyer({...params,priceTypeList: 2,memberId:memberList[0].memberId, shopType: 1 }).then(res => { PublicApi.getProductCommodityCommonGetCommodityListByBuyer({ ...params, priceTypeList: 2, memberId: member.memberId, shopType: 1 }).then(res => {
if(res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
} }
}) })
...@@ -181,14 +203,15 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -181,14 +203,15 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 选择会员弹框结束 // 选择会员弹框结束
useEffect(() => { useEffect(() => {
console.log(member)
// 重选会员清掉已选择的商品 // 重选会员清掉已选择的商品
setgoodsList([]); setgoodsList([]);
memberRowCtl.setSelectRow(goodsList) memberRowCtl.setSelectRow(goodsList)
memberRowCtl.setSelectedRowKeys(goodsList.map(v => v.productId)) memberRowCtl.setSelectedRowKeys(goodsList.map(v => v.productId))
}, [memberList]) }, [member])
// 添加商品 // 添加商品
const addGoods = () => { const addGoods = () => {
if (memberList.length > 0 && memberList[0].memberId) { if (member.name && member.memberId) {
setVisibleChannelMember(true); setVisibleChannelMember(true);
} else { } else {
message.error('请选择被询价会员') message.error('请选择被询价会员')
...@@ -208,11 +231,26 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -208,11 +231,26 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 编辑时回显的数据 // 编辑时回显的数据
useEffect(() => { useEffect(() => {
if(Object.keys(editData).length > 0) { if (Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests); setgoodsList(editData.inquiryListProductRequests);
} }
}, []) }, [])
useEffect(() => {
if (visibleChannelMember) {
PublicApi.getProductSelectGetSelectCustomerCategory({ name }).then(res => {
if (res.code === 1000) {
setcustomerCategory(res.data)
}
})
PublicApi.getProductSelectGetSelectBrand({ name }).then(res => {
if (res.code === 1000) {
setbrand(res.data)
}
})
}
}, [visibleChannelMember])
return ( return (
<div className={styles.revise_style}> <div className={styles.revise_style}>
<Button block type='dashed' onClick={addGoods}><PlusOutlined />添加商品</Button> <Button block type='dashed' onClick={addGoods}><PlusOutlined />添加商品</Button>
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; import styles from './index.less';
import moment from 'moment'; import moment from 'moment';
import { Form, Input, Select, Row, Col, DatePicker } from 'antd'; import { Form, Input, Select, Row, Col, DatePicker, message } from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
interface queryProps { interface queryProps {
...@@ -26,18 +26,18 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -26,18 +26,18 @@ const TradingConditions: React.FC<queryProps> = (props) => {
resolve({ resolve({
state: true, state: true,
data: { data: {
deliveryTime: moment(values.deliveryTime).unix(), deliveryTime: moment(values.deliveryTime).format('x'),
quotationAsTime: moment(values.quotationAsTime).unix(), quotationAsTime: moment(values.quotationAsTime).format('x'),
offer: values.offer, offer: values.offer,
paymentType: values.paymentType, paymentType: values.paymentType,
taxes: values.taxes, taxes: values.taxes,
logistics: values.logistics, logistics: values.logistics,
packRequire: values.logistics, packRequire: values.packRequire,
otherRequire: values.logistics, otherRequire: values.otherRequire,
} }
}) })
}).catch(errorInfo => { }).catch(errorInfo => {
console.log(errorInfo) message.error('有必填字段没选择,请检查!');
}) })
}) })
} }
...@@ -66,8 +66,8 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -66,8 +66,8 @@ const TradingConditions: React.FC<queryProps> = (props) => {
packRequire: editData.packRequire, packRequire: editData.packRequire,
otherRequire: editData.otherRequire, otherRequire: editData.otherRequire,
offer: editData.offer, offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime).format("x"), quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime).format("x"), deliveryTime: moment(editData.deliveryTime),
fullAddressId: editData.fullAddressId, fullAddressId: editData.fullAddressId,
}) })
} }
......
import React from 'react';
import AddForm from './addForm';
import { history } from 'umi';
const EditEnquiryOrder:React.FC<{}> = () => {
const { id } = history.location.query;
console.log(id)
return(
<AddForm
id={id}
type={2}
/>
)
}
export default EditEnquiryOrder;
\ No newline at end of file
import React from 'react';
import AddForm from './addForm';
import { history } from 'umi';
const RfqEnquiryOrder:React.FC<{}> = () => {
const { id } = history.location.query;
console.log(id)
return(
<AddForm
id={id}
type={3}
/>
)
}
export default RfqEnquiryOrder;
\ No newline at end of file
...@@ -86,62 +86,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -86,62 +86,7 @@ const Details: React.FC<parmas> = (props) => {
} }
}) })
// 模拟数据 // 模拟数据
const [data, setdata] = useState<any>({ const [data, setdata] = useState<any>({});
id: 91,
inquiryListNo: 'SD2015PPLJ',
quotationNo: 'BPTY12',
details: '阿珍爱上阿强',
memberName: 'wutiaoren',
deliveryTime: '2020-10-14 15:37:00',
quotationAsTime: '2020-10-13 15:37:00',
voucherTime: '2020-10-13 15:37:00',
externalState: 1,
interiorState: 2,
fullAddress: '东莞市石龙镇西葫芦53号',
offer: '报价要求',
paymentType: '付款方式',
taxes: '税费要求',
logistics: '物流要求',
packRequire: '包装要求',
otherRequire: '其他要求',
minimumOrder: 1000,
inquiryListProductRequests: [{
id: 1,
productId: 10,
productName: 'APPLE Pro Max 12',
inquiryListNo: '智能手机',
brand: 'APPLE',
nuit: '台',
purchaseQuantity: 1,
productQuotationId: 20,
money: 8699,
pric: 8699
}],
externalInquiryListLogResponses: [{
id: 200,
inquiryListId: 63,
roleName: '管理员',
state: 1,
operation: '操作',
operationTime: '2020-10-13 15:37:00',
auditOpinion: '通过'
}],
interiorInquiryListLogResponses: [{
id: 200,
inquiryListId: 63,
roleName: '管理员',
state: 1,
operation: '操作',
operationTime: '2020-10-13 15:37:00',
auditOpinion: '通过',
department: '销售部',
position: '经理'
}],
enclosureUrls: [{
name: '我是附件.doc',
url: 'http://www.hao123.com'
}]
});
// 询价商品 // 询价商品
const inquiryGoods: ColumnType<any>[] = [{ const inquiryGoods: ColumnType<any>[] = [{
title: 'ID', title: 'ID',
...@@ -205,6 +150,16 @@ const Details: React.FC<parmas> = (props) => { ...@@ -205,6 +150,16 @@ const Details: React.FC<parmas> = (props) => {
], ],
}, },
} }
// 详情请求
useEffect(() => {
new Promise((resolve, reject) => {
PublicApi.getOrderInquiryListDetails({ id }).then(res => {
if (res.code === 1000) {
setdata(res.data)
}
})
})
}, [])
// 外部流转记录&内部流转记录 // 外部流转记录&内部流转记录
const flowRecord = { const flowRecord = {
external: [{ external: [{
...@@ -219,6 +174,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -219,6 +174,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态', title: '状态',
key: 'state', key: 'state',
dataIndex: 'state', dataIndex: 'state',
render: (text: any, record: any) => externalTextState(text)
}, { }, {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
...@@ -252,6 +208,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -252,6 +208,7 @@ const Details: React.FC<parmas> = (props) => {
title: '状态', title: '状态',
key: 'state', key: 'state',
dataIndex: 'state', dataIndex: 'state',
render: (text: any, record: any) => interiorTextState(text)
}, { }, {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
...@@ -266,15 +223,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -266,15 +223,7 @@ const Details: React.FC<parmas> = (props) => {
dataIndex: 'auditOpinion', dataIndex: 'auditOpinion',
}], }],
} }
// 详情请求 // 添加商品数据组合
useEffect(() => {
PublicApi.getOrderInquiryListDetails({ id }).then(res => {
if (res.code === 1000) {
setdata(res.data)
}
})
}, [])
useEffect(() => { useEffect(() => {
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
// 组合数据 // 组合数据
...@@ -301,6 +250,37 @@ const Details: React.FC<parmas> = (props) => { ...@@ -301,6 +250,37 @@ const Details: React.FC<parmas> = (props) => {
}, 1000) }, 1000)
} }
/**
* @description: 外部流转记录
* @param {type}
* @return {type}
*/
const externalTextState = (text) => {
let name = ''
console.log(data)
data.externalRequisitionFormStateResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
/**
* @description: 内部流转记录
* @param {type}
* @return {type}
*/
const interiorTextState = (text) => {
let name = ''
data.interiorRequisitionFormStateResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
className={style.header} className={style.header}
...@@ -321,7 +301,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -321,7 +301,7 @@ const Details: React.FC<parmas> = (props) => {
{ {
((Number(page_type) === 2 || Number(page_type) === 3) && (data.interiorState === 2 || data.interiorState === 4)) && ((Number(page_type) === 2 || Number(page_type) === 3) && (data.interiorState === 2 || data.interiorState === 4)) &&
<> <>
<Button type='primary' className={style['saveBtn']} onClick={() => {setvisible(true)}}> <Button type='primary' className={style['saveBtn']} onClick={() => { setvisible(true) }}>
<CheckSquareOutlined />单据审核 <CheckSquareOutlined />单据审核
</Button> </Button>
</> </>
...@@ -348,8 +328,8 @@ const Details: React.FC<parmas> = (props) => { ...@@ -348,8 +328,8 @@ const Details: React.FC<parmas> = (props) => {
{item.name === 'externalState' ? {item.name === 'externalState' ?
inquiryQuoteOuterState(item.value) : inquiryQuoteOuterState(item.value) :
item.name === 'interiorState' ? item.name === 'interiorState' ?
quoteOrderInternalState(item.value) : quoteOrderInternalState(item.value) :
item.value} item.value}
</div> </div>
</div> </div>
))} ))}
...@@ -357,13 +337,13 @@ const Details: React.FC<parmas> = (props) => { ...@@ -357,13 +337,13 @@ const Details: React.FC<parmas> = (props) => {
</div > </div >
} }
> >
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<Tabs> <Tabs>
<TabPane tab="外部流转" key="1"> <TabPane tab="外部流转" key="1">
<Steps <Steps
style={{ padding: '20px 0' }} style={{ padding: '20px 0' }}
progressDot progressDot
current={1} current={Number(data.externalState - 1)}
> >
{detailData.externalStateStep.items.map((item, index) => { {detailData.externalStateStep.items.map((item, index) => {
return ( return (
...@@ -380,7 +360,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -380,7 +360,7 @@ const Details: React.FC<parmas> = (props) => {
<Steps <Steps
style={{ padding: '20px 0' }} style={{ padding: '20px 0' }}
progressDot progressDot
current={0} current={Number(data.interiorState - 1)}
> >
{detailData.interiorStateStep.items.map((item, index) => { {detailData.interiorStateStep.items.map((item, index) => {
return ( return (
...@@ -394,12 +374,12 @@ const Details: React.FC<parmas> = (props) => { ...@@ -394,12 +374,12 @@ const Details: React.FC<parmas> = (props) => {
</Steps> </Steps>
</TabPane> </TabPane>
</Tabs> </Tabs>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>询价商品</div> <div className={style.mainCol_title}>询价商品</div>
<Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} /> <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div> <div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div>
<div className={style['mainCol-rows']}> <div className={style['mainCol-rows']}>
<div className={style['mainCol-rows-cols']}> <div className={style['mainCol-rows-cols']}>
...@@ -449,13 +429,13 @@ const Details: React.FC<parmas> = (props) => { ...@@ -449,13 +429,13 @@ const Details: React.FC<parmas> = (props) => {
)} )}
</div> </div>
</div> </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<div className={style.mainCol_title}>附件</div> <div className={style.mainCol_title}>附件</div>
{/* <div className={style.upload_data}> <div className={style.upload_data}>
{ {
data.enclosureUrls && data.enclosureUrls &&
data.enclosureUrls.map((v,i) => ( data.enclosureUrls.map((v, i) => (
<div key={i} className={style.upload_item}> <div key={i} className={style.upload_item}>
<div className={style.upload_left}> <div className={style.upload_left}>
<LinkOutlined /> <LinkOutlined />
...@@ -464,9 +444,9 @@ const Details: React.FC<parmas> = (props) => { ...@@ -464,9 +444,9 @@ const Details: React.FC<parmas> = (props) => {
</div> </div>
)) ))
} }
</div> */} </div>
</Card> </div>
<Card className={style.item_wrap}> <div className={style.item_wrap}>
<Tabs> <Tabs>
<TabPane tab="外部流转记录" key="1"> <TabPane tab="外部流转记录" key="1">
<Table columns={flowRecord.external} rowKey='id' pagination={false} dataSource={data.externalInquiryListLogResponses} /> <Table columns={flowRecord.external} rowKey='id' pagination={false} dataSource={data.externalInquiryListLogResponses} />
...@@ -475,7 +455,7 @@ const Details: React.FC<parmas> = (props) => { ...@@ -475,7 +455,7 @@ const Details: React.FC<parmas> = (props) => {
<Table columns={flowRecord.interior} rowKey='id' pagination={false} dataSource={data.interiorInquiryListLogResponses} /> <Table columns={flowRecord.interior} rowKey='id' pagination={false} dataSource={data.interiorInquiryListLogResponses} />
</TabPane> </TabPane>
</Tabs> </Tabs>
</Card> </div>
<AuditModal <AuditModal
id={id} id={id}
type={page_type} type={page_type}
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
margin-bottom: 24px; margin-bottom: 24px;
background-color: #FFF; background-color: #FFF;
border-radius: 8px; border-radius: 8px;
padding: 24px;
&:last-child { &:last-child {
margin-bottom: 0px; margin-bottom: 0px;
......
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