Commit 69b385e4 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

新增询价报价完善

parent 6b885fc5
...@@ -103,7 +103,7 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -103,7 +103,7 @@ const AddQuotes: React.FC<{}> = () => {
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description="返回" />}
title='新建报价单' title={id ? '编辑询价单' : '新建询价单'}
extra={ extra={
<Button type="primary" onClick={onSumbit}> 保存</Button> <Button type="primary" onClick={onSumbit}> 保存</Button>
} }
......
...@@ -99,7 +99,7 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -99,7 +99,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
// } // }
const fetchMemberList = async (params) => { const fetchMemberList = async (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getMemberManageLowerMerchantProviderPage(params).then(res => { PublicApi.getMemberManagePlatformProviderPage({...params}).then(res => {
resolve(res.data) resolve(res.data)
}) })
// setTimeout(() => { // setTimeout(() => {
...@@ -166,7 +166,7 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -166,7 +166,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
</Form.Item> </Form.Item>
<Form.Item label='被询价会员' name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}> <Form.Item label='被询价会员' name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search value={memberList.length > 0 ? memberList[0].name : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} /> <Search value={memberList.length > 0 ? memberList[0].name : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} />
<Button type='link'>查看会员详情</Button> {memberList.length > 0 && <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>
......
...@@ -169,54 +169,14 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -169,54 +169,14 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
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 data = [{ return new Promise((resolve, reject) => {
// commodityId: 1, PublicApi.getProductCommodityCommonGetCommodityListByBuyer({...params,priceTypeList: 1,memberId:memberList[0].memberId }).then(res => {
// name: '进口头层黄牛皮荔枝纹/红色/XXL', if(res.code === 1000) {
// customerCategoryName: '牛皮', resolve(res.data)
// 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);
// });
} }
// 选择会员弹框结束 // 选择会员弹框结束
......
...@@ -14,15 +14,16 @@ const { TabPane } = Tabs; ...@@ -14,15 +14,16 @@ const { TabPane } = Tabs;
const AddQuotes: React.FC<{}> = () => { const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query; const { id } = history.location.query;
const [count, setCount] = useState<string>('1') const [count, setCount] = useState<string>('1')
const [memberList, setmemberList] = useState([]); //存放用户信息 const [inquiryNo, setInquiryLNo] = useState<any>({}); //存放用户信息
const [goodsList, setgoodsList] = useState([]); //存放商品 const [goodsList, setgoodsList] = useState([]); //存放商品
const [enclosureUrls, setenclosureUrls] = useState<any>([]);
const basicInfoRef = useRef<any>({}); const basicInfoRef = useRef<any>({});
const tradingConditionsRef = useRef<any>({}); const tradingConditionsRef = useRef<any>({});
const [editData, setEditData] = useState<any>({}); const [editData, setEditData] = useState<any>({});
useEffect(() => { useEffect(() => {
if (id) { if (id) {
PublicApi.getOrderInquiryListDetails({ id }).then(res => { PublicApi.getOrderProductQuotationDetails({ id }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setEditData(res.data) setEditData(res.data)
} }
...@@ -42,15 +43,21 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -42,15 +43,21 @@ const AddQuotes: React.FC<{}> = () => {
inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest
...basicInfoData, ...basicInfoData,
...tradingConditionsData, ...tradingConditionsData,
memberName: memberList[0].name, enclosureUrls,
memberId: memberList[0].memberId inquiryListNo: inquiryNo.orderNo,
inquiryListId: inquiryNo.orderId
} }
if (id) { if (id) {
console.log(parmas) parmas.id = editData.id;
await PublicApi.postOrderProductQuotationUpdate(parmas).then(res => {
if (res.code === 1000) {
history.goBack();
}
})
} else { } else {
await PublicApi.postOrderInquiryListAdd(parmas).then(res => { await PublicApi.postOrderProductQuotationAdd(parmas).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
console.log(res.data) history.goBack();
} }
}) })
} }
...@@ -63,7 +70,7 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -63,7 +70,7 @@ const AddQuotes: React.FC<{}> = () => {
} }
// 获取到会员信息 // 获取到会员信息
const getMemberList = (list: any) => { const getMemberList = (list: any) => {
setmemberList(list); setInquiryLNo(list);
} }
// 获取添加的商品列表 // 获取添加的商品列表
const getGoodsList = (list: any) => { const getGoodsList = (list: any) => {
...@@ -75,12 +82,16 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -75,12 +82,16 @@ const AddQuotes: React.FC<{}> = () => {
setCount(key) setCount(key)
} }
} }
// 附件回调
const handleGetEnclosureUrls = (data: any) => {
setenclosureUrls(data)
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description="返回" />}
title='新建报价单' title={id ? '编辑报价单' : '新建报价单'}
extra={ extra={
<Button type="primary" onClick={onSumbit}> 保存</Button> <Button type="primary" onClick={onSumbit}> 保存</Button>
} }
...@@ -94,21 +105,24 @@ const AddQuotes: React.FC<{}> = () => { ...@@ -94,21 +105,24 @@ const AddQuotes: React.FC<{}> = () => {
editData={editData} editData={editData}
/> />
</TabPane> </TabPane>
<TabPane tab="询价商品" key="2"> <TabPane tab="商品报价" key="2">
<EnquiryGoods <EnquiryGoods
memberList={memberList} inquiryNo={inquiryNo}
getGoodsList={getGoodsList} getGoodsList={getGoodsList}
editData={editData} editData={editData}
/> />
</TabPane> </TabPane>
<TabPane tab="交易条件" key="3"> <TabPane tab="其他说明" key="3">
<TradingConditions <TradingConditions
currentRef={tradingConditionsRef} currentRef={tradingConditionsRef}
editData={editData} editData={editData}
/> />
</TabPane> </TabPane>
<TabPane tab="附件" key="4"> <TabPane tab="附件" key="4">
<Attached /> <Attached
editData={editData}
handleGetEnclosureUrls={handleGetEnclosureUrls}
/>
</TabPane> </TabPane>
<TabPane tab="流转记录" key="5"> <TabPane tab="流转记录" key="5">
<FlowRecord <FlowRecord
......
...@@ -11,7 +11,13 @@ const layout: any = { ...@@ -11,7 +11,13 @@ const layout: any = {
wrapperCol: { span: 9 }, wrapperCol: { span: 9 },
labelAlign: "left" 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 [files, setFiles] = useState([]);
/**判断文件类型和大小 */ /**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => { const beforeDocUpload = (file: UploadFile) => {
...@@ -25,10 +31,31 @@ const Attached: React.FC<{}> = () => { ...@@ -25,10 +31,31 @@ const Attached: React.FC<{}> = () => {
const handleChange = ({ fileList }) => { const handleChange = ({ fileList }) => {
const arr: any = []; const arr: any = [];
fileList.forEach(v => { fileList.forEach(v => {
if(v) if (v.response) {
console.log(v) 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 ( return (
<Form <Form
{...layout} {...layout}
...@@ -36,13 +63,13 @@ const Attached: React.FC<{}> = () => { ...@@ -36,13 +63,13 @@ const Attached: React.FC<{}> = () => {
> >
<Form.Item label='附件' name='upload'> <Form.Item label='附件' name='upload'>
<div className={styles.upload_data}> <div className={styles.upload_data}>
{files.length > 0 && files.map(v => ( {files.length > 0 && files.map((v, index) => (
<div className={styles.upload_item}> <div key={index} className={styles.upload_item}>
<div className={styles.upload_left}> <div className={styles.upload_left}>
<LinkOutlined /> <LinkOutlined />
<span>验货详情.doc</span> <span>{v.name}</span>
</div> </div>
<div className={styles.upload_right}> <div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined /> <DeleteOutlined />
</div> </div>
</div> </div>
......
...@@ -28,41 +28,36 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -28,41 +28,36 @@ const BasicInfo: React.FC<queryProps> = (props) => {
console.log(editData, 10086) console.log(editData, 10086)
// 会员添加弹窗控制 // 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false); const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]); const [inquiryNo, setinquiryNo] = useState<any>({});
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' }); const [inquiryRowSelection, inquiryRowCtl] = useRowSelectionTable({ customKey: 'orderId', type: 'radio' });
const handleOkAddMember = () => { const handleOkAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
setmemberList(memberRowCtl.selectRow); setinquiryNo(inquiryRowCtl.selectRow[0]);
getMemberList(memberRowCtl.selectRow); // 回传给父级 getMemberList(inquiryRowCtl.selectRow[0]); // 回传给父级
} }
const handleCancelAddMember = () => { const handleCancelAddMember = () => {
setVisibleChannelMember(false) setVisibleChannelMember(false)
} }
const columnsSetMember: any[] = [ const columnsSetMember: any[] = [
{ {
title: 'ID', title: '询价单号',
dataIndex: 'memberId', dataIndex: 'orderNo',
key: 'memberId', key: 'orderNo',
}, },
{ {
title: '会员名称', title: '询价单摘要',
dataIndex: 'name', dataIndex: 'details',
key: 'name', key: 'details',
}, },
{ {
title: '会员类型', title: '询价会员',
dataIndex: 'memberTypeName', dataIndex: 'memberName',
key: 'memberTypeName', key: 'memberName',
}, },
{ {
title: '会员角色', title: '单据时间',
dataIndex: 'roleName', dataIndex: 'documentTime',
key: 'roleName', key: 'documentTime',
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
} }
] ]
const formSearch: ISchema = { const formSearch: ISchema = {
...@@ -78,36 +73,32 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -78,36 +73,32 @@ const BasicInfo: React.FC<queryProps> = (props) => {
} }
} }
// 模拟数据 // 模拟数据
const data = [{ const data = {
memberId: 6, totalCount: 1,
name: '测试会员数据', data: [{
roleId: 5, orderId: 6,
roleName: '可可西', orderNo: 'SZ1008',
memberTypeName: '超级会员', details: '可可西',
level: 1, memberName: '超级会员',
levelTag: '倔强铂金' documentTime: '2020-10-20 11:22:00',
},{ }]
memberId: 7, }
name: '测试会员数据',
roleId: 5,
roleName: '可可西',
memberTypeName: '超级会员',
level: 1,
levelTag: '倔强铂金'
}]
const fetchMemberList = async (params) => { const fetchMemberList = async (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getMemberManageLowerMerchantProviderPage({...params}).then(res => { // PublicApi.postOrderCorrespondingInquiryNumber({...params}).then(res => {
resolve(res.data) // resolve(res.data)
}) // })
setTimeout(() => {
resolve(data)
}, 500)
}); });
} }
// 选择会员弹框结束 // 选择会员弹框结束
useEffect(() => { useEffect(() => {
if(memberList.length > 0) { if(Object.keys(inquiryNo).length > 0) {
basicform.setFieldsValue({'memberName': memberList[0].name ? memberList[0].name : undefined}) basicform.setFieldsValue({'inquiryListNo': inquiryNo.orderNo})
} }
},[memberList]) },[inquiryNo])
/************* 页面的一些操作start *************/ /************* 页面的一些操作start *************/
// 拿到表单数据 // 拿到表单数据
...@@ -160,7 +151,8 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -160,7 +151,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label='对应询价单号' name='inquiryListNo' rules={[{ required: true, message: '请选择被询价会员' }]}> <Form.Item label='对应询价单号' name='inquiryListNo' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search value={memberList.length > 0 ? memberList[0].name : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} /> <Search value={Object.keys(inquiryNo).length > 0 ? inquiryNo.orderNo : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} />
{Object.keys(inquiryNo).length > 0 && <Button type='link'>查看询价单详情</Button>}
</Form.Item> </Form.Item>
<Form.Item label='报价单号' name='quotationNo'> <Form.Item label='报价单号' name='quotationNo'>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span> <span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
...@@ -183,13 +175,13 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -183,13 +175,13 @@ const BasicInfo: React.FC<queryProps> = (props) => {
</Form> </Form>
{/* 选择会员弹框 */} {/* 选择会员弹框 */}
<ModalTable <ModalTable
modalTitle='选择会员' modalTitle='选择询价单'
confirm={handleOkAddMember} confirm={handleOkAddMember}
cancel={handleCancelAddMember} cancel={handleCancelAddMember}
visible={visibleChannelMember} visible={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}} resetModal={{destroyOnClose: true, forceRender: true}}
columns={columnsSetMember} columns={columnsSetMember}
rowSelection={memberRowSelection} rowSelection={inquiryRowSelection}
fetchTableData={params => fetchMemberList(params)} fetchTableData={params => fetchMemberList(params)}
formilyProps={ formilyProps={
{ {
...@@ -197,7 +189,7 @@ const BasicInfo: React.FC<queryProps> = (props) => { ...@@ -197,7 +189,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
} }
} }
tableProps={{ tableProps={{
rowKey: 'memberId', rowKey: 'orderId',
}} }}
/> />
</> </>
......
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 { Input, 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 { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { ISchema, createAsyncFormActions, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import ModalTable, { ModalTableProps } from '@/components/ModalTable';
import { PublicApi } from '@/services/api'; 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 { interface queryProps {
memberList?: any, inquiryNo?: any,
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 { inquiryNo, getGoodsList, editData,} = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
setValue(value);
};
// 会员添加弹窗控制 // 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false); const [goodsList, setgoodsList] = useState([{
const [goodsList, setgoodsList] = useState([]); productId: 1,
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'commodityId' }); productName: '进口头层黄牛皮荔枝纹/红色/XXL',
inquiryListNo: 'sx1002x',
const handleOkAddMember = () => { brand: 'PELLE',
setVisibleChannelMember(false); nuit: '个',
const arr: any[] = [] purchaseQuantity: 100,
memberRowCtl.selectRow.forEach((v, i) => { money: 200,
arr.push({ pric: 100
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 inputOnchange = (id, e) => {
const {value} = e.target const {value} = e.target
...@@ -137,7 +39,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -137,7 +39,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: '商品ID',
dataIndex: 'productId', dataIndex: 'productId',
}, { }, {
title: '商品名称', title: '商品名称',
...@@ -154,85 +56,36 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -154,85 +56,36 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
}, { }, {
title: '采购数量', title: '采购数量',
dataIndex: 'purchaseQuantity', dataIndex: 'purchaseQuantity',
}, {
title: '报价单价',
dataIndex: 'pric',
}, {
title: '金额',
dataIndex: 'money',
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 <Input
addonBefore="¥"
onBlur={(e) => inputOnchange(record.productId, e)} onBlur={(e) => inputOnchange(record.productId, e)}
type='number' type='number'
maxLength={25} maxLength={25}
/> />
</Form.Item> </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) => {
}
// 选择会员弹框结束
useEffect(() => { useEffect(() => {
// 重选会员清掉已选择的商品 // if(Object.keys(inquiryNo).length > 0 && inquiryNo.orderId) {
setgoodsList([]); // PublicApi.getOrderProductInquiryDetails({id: inquiryNo.orderId}).then(res => {
}, [memberList]) // if(res.code === 1000) {
// 添加商品 // setgoodsList(res.data.inquiryListProductRequests)
const addGoods = () => { // }
if (memberList.length > 0 && memberList[0].memberId) { // })
setVisibleChannelMember(true); // }
} else { // // 询价单重选,清空数据
message.error('请选择被询价会员') // setgoodsList([])
} }, [inquiryNo])
}
// 删除
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(() => { useEffect(() => {
if(Object.keys(editData).length > 0) { if(Object.keys(editData).length > 0) {
...@@ -242,44 +95,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => { ...@@ -242,44 +95,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
return ( return (
<div className={styles.revise_style}> <div className={styles.revise_style}>
<Button block type='dashed' onClick={addGoods}><PlusOutlined />添加商品</Button>
<Form> <Form>
<Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} /> <Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} />
</Form> </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> </div>
) )
} }
......
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 { Form, Input, Row, Col, } from 'antd';
import { Form, Input, Select, Row, Col, DatePicker } from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
interface queryProps { interface queryProps {
...@@ -18,15 +17,13 @@ const layout: any = { ...@@ -18,15 +17,13 @@ const layout: any = {
const TradingConditions: React.FC<queryProps> = (props) => { const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props; const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm(); const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState([]);
const hadnleValidateFields = () => { const hadnleValidateFields = () => {
return new Promise((resolve) => { return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => { TradingConditionsForm.validateFields().then(values => {
resolve({ resolve({
state: true, state: true,
data: { data: {
deliveryTime: moment(values.deliveryTime).unix(), minimumOrder: values.minimumOrder,
quotationAsTime: moment(values.quotationAsTime).unix(),
offer: values.offer, offer: values.offer,
paymentType: values.paymentType, paymentType: values.paymentType,
taxes: values.taxes, taxes: values.taxes,
...@@ -52,10 +49,7 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -52,10 +49,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
currentRef.current = userAction; currentRef.current = userAction;
} }
} }
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(res.data)
})
// 编辑时回显的数据 // 编辑时回显的数据
if(Object.keys(editData).length > 0) { if(Object.keys(editData).length > 0) {
TradingConditionsForm.setFieldsValue({ TradingConditionsForm.setFieldsValue({
...@@ -65,9 +59,7 @@ const TradingConditions: React.FC<queryProps> = (props) => { ...@@ -65,9 +59,7 @@ 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), minimumOrder: editData.minimumOrder
deliveryTime: moment(editData.deliveryTime),
fullAddress: editData.fullAddress,
}) })
} }
}, []) }, [])
......
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { history, Link } from 'umi'; 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 { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
...@@ -77,13 +77,14 @@ const AddInquiryOrder: React.FC<{}> = () => { ...@@ -77,13 +77,14 @@ const AddInquiryOrder: React.FC<{}> = () => {
console.log(record.interiorState) console.log(record.interiorState)
return ( return (
<> <>
<Button type='link'>提交审核</Button> <Button type='link' >提交审核</Button>
<Button type="link">编辑</Button> <Button type="link"><Link to={`/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/add?id=${record.id}`}>编辑</Link></Button>
<Popconfirm <Popconfirm
destroyTooltipOnHide destroyTooltipOnHide
title="确定要删除吗?" title="确定要删除吗?"
okText="是" okText="是"
cancelText="否" cancelText="否"
onConfirm={() => handleDelete(record.id)}
> >
<Button type="link">删除</Button> <Button type="link">删除</Button>
</Popconfirm> </Popconfirm>
...@@ -91,6 +92,16 @@ const AddInquiryOrder: React.FC<{}> = () => { ...@@ -91,6 +92,16 @@ const AddInquiryOrder: React.FC<{}> = () => {
) )
} }
}] }]
//单个删除
const handleDelete = (id:number) => {
PublicApi.postOrderProductQuotationDelete({id}).then(res => {
if(res.code === 1000) {
message.success('删除成功!')
ref.current.reload();
}
})
}
const format = (text) => { const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</> return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
} }
......
...@@ -14,11 +14,14 @@ import EyePreview from '@/components/EyePreview'; ...@@ -14,11 +14,14 @@ import EyePreview from '@/components/EyePreview';
import { pendingReviewSchema } from '../schema/pendingReview'; import { pendingReviewSchema } from '../schema/pendingReview';
import { filterInternalState, filterExternalState } from './../../common/statusList'; import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/tableStatusList'; import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../common/tableStatusList';
import AuditModal from '../components/auditModel';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
const formActions = createFormActions(); const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => { const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const [id, setId] = useState<any>(0);
const [visible, setvisible] = useState<boolean>(false);
const [selectRow, setSelectRow] = useState([]) const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]) const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
...@@ -71,7 +74,7 @@ const PendingSubmit: React.FC<{}> = () => { ...@@ -71,7 +74,7 @@ const PendingSubmit: React.FC<{}> = () => {
title: '操作', title: '操作',
key: 'options', key: 'options',
dataIndex: 'options', dataIndex: 'options',
render: (text: any, record: any) => <Button type='link'><Link to={`/memberCenter/tranactionAbility/inquiryQuote/components/details?id=${record.id}&page_type=1&view=1`}>提交报价单</Link></Button> render: (text: any, record: any) => <Button type='link' disabled={record.interiorState !== 1 || record.interiorState !== 3} onClick={() => { setId(record.id); setvisible(true)}}>提交报价单</Button>
}] }]
const format = (text) => { const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</> return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
...@@ -138,6 +141,13 @@ const PendingSubmit: React.FC<{}> = () => { ...@@ -138,6 +141,13 @@ const PendingSubmit: React.FC<{}> = () => {
}) })
} }
const handleModalOK = () => {
setvisible(false)
setTimeout(() => {
history.goBack()
}, 1000)
}
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
...@@ -164,6 +174,13 @@ const PendingSubmit: React.FC<{}> = () => { ...@@ -164,6 +174,13 @@ const PendingSubmit: React.FC<{}> = () => {
> >
</StandardTable> </StandardTable>
</Card> </Card>
<AuditModal
id={id}
type={1}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={handleModalOK}
/>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
......
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