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