Commit e3b44856 authored by XieZhiXiong's avatar XieZhiXiong
parents 1b710b91 bea0b8fd
...@@ -50,12 +50,14 @@ interface dataInfoType { ...@@ -50,12 +50,14 @@ interface dataInfoType {
totalVolume: number, totalVolume: number,
totalWeight: number, totalWeight: number,
freightPrice: number, freightPrice: number,
settlementWay: string settlementWay: string,
pagetype?: any
} }
const detailInfo: React.FC<{}> = () => { const DetailsInfo: React.FC<dataInfoType> = (props) => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [pagetype, setpagetype] = useState(history.location.query.page_type) const { pagetype } = props;
// const [pagetype, setpagetype] = useState(history.location.query.page_type)
let interiorStateList = [] let interiorStateList = []
let [isextraOption, setIsextraOption] = useState(false) let [isextraOption, setIsextraOption] = useState(false)
const [platType, setplatType] = useState(1) //需求对接类型 const [platType, setplatType] = useState(1) //需求对接类型
...@@ -762,4 +764,4 @@ const detailInfo: React.FC<{}> = () => { ...@@ -762,4 +764,4 @@ const detailInfo: React.FC<{}> = () => {
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
export default detailInfo export default DetailsInfo
\ No newline at end of file \ No newline at end of file
import React from 'react'; import React from 'react';
import DetailsComponents from '../../components/detail';
const EnquiryOneDetail: React.FC = () => { const EnquiryOneDetail: React.FC = () => {
return ( return (
<div> <DetailsComponents
待审核报价单(一级)详情 pagetype={1}
</div> />
); );
}; };
......
import React from 'react'; import React from 'react';
import DetailsComponents from '../../components/detail';
const EnquiryTwoDetail: React.FC = () => { const EnquiryTwoDetail: React.FC = () => {
return ( return (
<div> <DetailsComponents
待审核报价单(二级)详情 pagetype={2}
</div> />
); );
}; };
......
import React from 'react'; import React from 'react';
import DetailsComponents from '../../components/detail';
const ToSubmitDetail: React.FC = () => { const ToSubmitDetail: React.FC = () => {
return ( return (
<div> <DetailsComponents
待提交报价单详情 pagetype={3}
</div> />
); );
}; };
......
...@@ -569,7 +569,7 @@ const Detail: React.FC<{}> = () => { ...@@ -569,7 +569,7 @@ const Detail: React.FC<{}> = () => {
* @description: 收货地址 * @description: 收货地址
* @param {type} * @param {type}
* @return {type} * @return {type}
*/ */
PublicApi.getLogisticsSelectListReceiverAddress().then(res => { PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
let list = [] let list = []
res.data.forEach(item => { res.data.forEach(item => {
...@@ -635,7 +635,7 @@ const Detail: React.FC<{}> = () => { ...@@ -635,7 +635,7 @@ const Detail: React.FC<{}> = () => {
tabForm.resetFields() tabForm.resetFields()
//需求单对接列表 //需求单对接列表
PublicApi.getOrderRequisitionFormDemandDockingList({ id:id }).then(res => { PublicApi.getOrderRequisitionFormDemandDockingList({ id: id }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
let { data } = res.data let { data } = res.data
if (_plattype == 2) {//系统匹配 if (_plattype == 2) {//系统匹配
...@@ -684,8 +684,7 @@ const Detail: React.FC<{}> = () => { ...@@ -684,8 +684,7 @@ const Detail: React.FC<{}> = () => {
setproductSource([...source]) setproductSource([...source])
} }
}) })
setCount('3')
} }
...@@ -790,34 +789,42 @@ const Detail: React.FC<{}> = () => { ...@@ -790,34 +789,42 @@ const Detail: React.FC<{}> = () => {
* @param {type} * @param {type}
* @return {type} * @return {type}
*/ */
const handleSubmitTabForm = () => { const handleSubmitTabForm = async () => {
tabForm.validateFields().then(values => { if (count === '3') {
console.log(values, `扑母早死仔`) const values = await tabForm.validateFields();
if (id) { if (id) {
if (!haschangeCategory) { if (!haschangeCategory) {
//不做处理 //不做处理
} else { } else {
if (values.customerCategoryId && values.customerCategoryId.length > 0) { if (values.customerCategoryId && values.customerCategoryId.length > 0) {
values['productCategory'] = {} values['productCategory'] = {}
values.productCategory.id = values.customerCategoryId[0] const categoryArray: any[] = [];
values.productCategory.key = values.customerCategoryId[0] seletCategoryNameList.forEach(item => {
let NameList = seletCategoryNameList.map((v) => { categoryArray.push({
return v.title id: item.id,
key: item.id,
level: '',
name: item.title,
type: ''
})
}) })
values.productCategory.name = NameList.join('-') values.productCategorys = categoryArray;
delete values.customerCategoryId delete values.customerCategoryId
} }
} }
} else { } else {
if (values.customerCategoryId && values.customerCategoryId.length > 0) { if (values.customerCategoryId && values.customerCategoryId.length > 0) {
values['productCategory'] = {} values['productCategory'] = {}
values.productCategory.id = values.customerCategoryId[0] const categoryArray: any[] = [];
values.productCategory.key = values.customerCategoryId[0] seletCategoryNameList.forEach(item => {
let NameList = seletCategoryNameList.map((v) => { categoryArray.push({
return v.title id: Number(item.id),
key: item.id,
name: item.title,
})
}) })
values.productCategory.name = NameList.join('-') values.productCategorys = categoryArray;
delete values.customerCategoryId delete values.customerCategoryId
} }
} }
...@@ -896,6 +903,10 @@ const Detail: React.FC<{}> = () => { ...@@ -896,6 +903,10 @@ const Detail: React.FC<{}> = () => {
} else { } else {
values['defaultAddres'] = 1 values['defaultAddres'] = 1
} }
// console.log(values)
// return;
if (id) {//修改 if (id) {//修改
values['id'] = id values['id'] = id
PublicApi.postOrderRequisitionFormUpdate(values).then(res => { PublicApi.postOrderRequisitionFormUpdate(values).then(res => {
...@@ -915,8 +926,9 @@ const Detail: React.FC<{}> = () => { ...@@ -915,8 +926,9 @@ const Detail: React.FC<{}> = () => {
} }
}) })
} }
} else {
}) message.error('有必填字段没选择,请检查!');
}
} }
/** /**
...@@ -946,10 +958,10 @@ const Detail: React.FC<{}> = () => { ...@@ -946,10 +958,10 @@ const Detail: React.FC<{}> = () => {
item[key] = values[key] item[key] = values[key]
}) })
} }
// 获得key // 获得key
for(let k in item) { for (let k in item) {
console.log(k, k ) console.log(k, k)
} }
list.push(item) list.push(item)
...@@ -995,6 +1007,13 @@ const Detail: React.FC<{}> = () => { ...@@ -995,6 +1007,13 @@ const Detail: React.FC<{}> = () => {
}} /> }} />
} }
// 用于判断新增点击保存没有添加交易条件就提交
const [count, setCount] = useState<string>('1');
const handleClick = (key: string) => {
if (key === '3') {
setCount(key)
}
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -1020,7 +1039,7 @@ const Detail: React.FC<{}> = () => { ...@@ -1020,7 +1039,7 @@ const Detail: React.FC<{}> = () => {
requisitionFormAddress: requisitionFormAddress requisitionFormAddress: requisitionFormAddress
}} }}
> >
<Tabs defaultActiveKey='1'> <Tabs defaultActiveKey='1' onTabClick={handleClick}>
<TabPane tab="基本信息" key='1'> <TabPane tab="基本信息" key='1'>
<Row> <Row>
<Col span={12}> <Col span={12}>
...@@ -1314,7 +1333,6 @@ const Detail: React.FC<{}> = () => { ...@@ -1314,7 +1333,6 @@ const Detail: React.FC<{}> = () => {
</TabPane> </TabPane>
</Tabs> </Tabs>
</Form> </Form>
</Col> </Col>
......
...@@ -32,6 +32,7 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -32,6 +32,7 @@ const AddQuotes: React.FC<{}> = () => {
useEffect(() => { useEffect(() => {
if (id) { if (id) {
handleGetDetails(); handleGetDetails();
setCount('3');
} }
}, []) }, [])
//提交 //提交
......
...@@ -54,8 +54,8 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -54,8 +54,8 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
const columnsSetMember: any[] = [ const columnsSetMember: any[] = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'commodityId', dataIndex: 'id',
key: 'commodityId', key: 'id',
}, },
{ {
title: '商品名称', title: '商品名称',
......
...@@ -157,6 +157,9 @@ const AddEnquiryOrder: React.FC<{}> = () => { ...@@ -157,6 +157,9 @@ const AddEnquiryOrder: React.FC<{}> = () => {
/**批量审核 */ /**批量审核 */
const handleSubmitAll = (ids: number[]) => { const handleSubmitAll = (ids: number[]) => {
if(selectedRowKeys.length === 0) {
return message.error('请选择要审核的询价单')
}
PublicApi.postOrderInquiryListSubmitAll({ ids: ids }).then(res => { PublicApi.postOrderInquiryListSubmitAll({ ids: ids }).then(res => {
ref.current.reload() ref.current.reload()
}) })
...@@ -197,17 +200,7 @@ const AddEnquiryOrder: React.FC<{}> = () => { ...@@ -197,17 +200,7 @@ const AddEnquiryOrder: React.FC<{}> = () => {
} }
}) })
} }
//批量提交审核
const handleBatchAudit = () => {
if(selectedRowKeys.length === 0) {
return message.error('请选择要审核的询价单')
}
PublicApi.postOrderInquiryListSubmitAll({ids: selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref.current.reload();
}
})
}
const handleModalOK = () => { const handleModalOK = () => {
setvisible(false) setvisible(false)
setTimeout(() => { setTimeout(() => {
...@@ -215,6 +208,16 @@ const AddEnquiryOrder: React.FC<{}> = () => { ...@@ -215,6 +208,16 @@ const AddEnquiryOrder: React.FC<{}> = () => {
}, 1000) }, 1000)
} }
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
...@@ -227,6 +230,7 @@ const AddEnquiryOrder: React.FC<{}> = () => { ...@@ -227,6 +230,7 @@ const AddEnquiryOrder: React.FC<{}> = () => {
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH) useStateFilterSearchLinkageEffect($, actions, 'quotationNo', FORM_FILTER_PATH)
}} }}
......
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