Commit c6d9900d authored by 前端-许佳敏's avatar 前端-许佳敏
parents 8119d653 318cdfc8
......@@ -103,7 +103,7 @@ const AddQuotes: React.FC<{}> = () => {
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title='新建报价单'
title={id ? '编辑询价单' : '新建询价单'}
extra={
<Button type="primary" onClick={onSumbit}> 保存</Button>
}
......
......@@ -100,7 +100,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const fetchMemberList = async (params) => {
console.log(params)
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLowerMerchantProviderPage(params).then(res => {
PublicApi.getMemberManagePlatformProviderPage({...params}).then(res => {
resolve(res.data)
})
// setTimeout(() => {
......@@ -167,7 +167,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
</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>
{memberList.length > 0 && <Button type='link'>查看会员详情</Button>}
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
......
......@@ -169,63 +169,14 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
render: (text: any, record: any) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
}]
// 模拟数据
// const data = {
// totalCount: 6,
// 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) => {
console.log(params)
const fetchGoodsList = (params) => {
return new Promise((resolve, reject) => {
// setTimeout(() => {
// resolve(data);
// }, 1000);
PublicApi.getProductCommodityCommonGetCommodityListByBuyer({...params}).then(res => {
resolve(res.data)
PublicApi.getProductCommodityCommonGetCommodityListByBuyer({...params,priceTypeList: 1,memberId:memberList[0].memberId }).then(res => {
if(res.code === 1000) {
resolve(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;
const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query;
const [count, setCount] = useState<string>('1')
const [memberList, setmemberList] = useState([]); //存放用户信息
const [inquiryNo, setInquiryLNo] = useState<any>({}); //存放用户信息
const [goodsList, setgoodsList] = useState([]); //存放商品
const [enclosureUrls, setenclosureUrls] = useState<any>([]);
const basicInfoRef = useRef<any>({});
const tradingConditionsRef = useRef<any>({});
const [editData, setEditData] = useState<any>({});
useEffect(() => {
if (id) {
PublicApi.getOrderInquiryListDetails({ id }).then(res => {
PublicApi.getOrderProductQuotationDetails({ id }).then(res => {
if (res.code === 1000) {
setEditData(res.data)
}
......@@ -42,15 +43,21 @@ const AddQuotes: React.FC<{}> = () => {
inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest
...basicInfoData,
...tradingConditionsData,
memberName: memberList[0].name,
memberId: memberList[0].memberId
enclosureUrls,
inquiryListNo: inquiryNo.orderNo,
inquiryListId: inquiryNo.orderId
}
if (id) {
console.log(parmas)
parmas.id = editData.id;
await PublicApi.postOrderProductQuotationUpdate(parmas).then(res => {
if (res.code === 1000) {
history.goBack();
}
})
} else {
await PublicApi.postOrderInquiryListAdd(parmas).then(res => {
await PublicApi.postOrderProductQuotationAdd(parmas).then(res => {
if (res.code === 1000) {
console.log(res.data)
history.goBack();
}
})
}
......@@ -63,7 +70,7 @@ const AddQuotes: React.FC<{}> = () => {
}
// 获取到会员信息
const getMemberList = (list: any) => {
setmemberList(list);
setInquiryLNo(list);
}
// 获取添加的商品列表
const getGoodsList = (list: any) => {
......@@ -75,12 +82,16 @@ const AddQuotes: React.FC<{}> = () => {
setCount(key)
}
}
// 附件回调
const handleGetEnclosureUrls = (data: any) => {
setenclosureUrls(data)
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title='新建报价单'
title={id ? '编辑报价单' : '新建报价单'}
extra={
<Button type="primary" onClick={onSumbit}> 保存</Button>
}
......@@ -94,21 +105,24 @@ const AddQuotes: React.FC<{}> = () => {
editData={editData}
/>
</TabPane>
<TabPane tab="询价商品" key="2">
<TabPane tab="商品报价" key="2">
<EnquiryGoods
memberList={memberList}
inquiryNo={inquiryNo}
getGoodsList={getGoodsList}
editData={editData}
/>
</TabPane>
<TabPane tab="交易条件" key="3">
<TabPane tab="其他说明" key="3">
<TradingConditions
currentRef={tradingConditionsRef}
editData={editData}
/>
</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>
......
......@@ -28,41 +28,36 @@ const BasicInfo: React.FC<queryProps> = (props) => {
console.log(editData, 10086)
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const [inquiryNo, setinquiryNo] = useState<any>({});
const [inquiryRowSelection, inquiryRowCtl] = useRowSelectionTable({ customKey: 'orderId', type: 'radio' });
const handleOkAddMember = () => {
setVisibleChannelMember(false)
setmemberList(memberRowCtl.selectRow);
getMemberList(memberRowCtl.selectRow); // 回传给父级
setinquiryNo(inquiryRowCtl.selectRow[0]);
getMemberList(inquiryRowCtl.selectRow[0]); // 回传给父级
}
const handleCancelAddMember = () => {
setVisibleChannelMember(false)
}
const columnsSetMember: any[] = [
{
title: 'ID',
dataIndex: 'memberId',
key: 'memberId',
title: '询价单号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '会员名称',
dataIndex: 'name',
key: 'name',
title: '询价单摘要',
dataIndex: 'details',
key: 'details',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
title: '询价会员',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
title: '单据时间',
dataIndex: 'documentTime',
key: 'documentTime',
}
]
const formSearch: ISchema = {
......@@ -78,36 +73,32 @@ 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: 1,
data: [{
orderId: 6,
orderNo: 'SZ1008',
details: '可可西',
memberName: '超级会员',
documentTime: '2020-10-20 11:22:00',
}]
}
const fetchMemberList = async (params) => {
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLowerMerchantProviderPage({...params}).then(res => {
resolve(res.data)
})
// PublicApi.postOrderCorrespondingInquiryNumber({...params}).then(res => {
// resolve(res.data)
// })
setTimeout(() => {
resolve(data)
}, 500)
});
}
// 选择会员弹框结束
useEffect(() => {
if(memberList.length > 0) {
basicform.setFieldsValue({'memberName': memberList[0].name ? memberList[0].name : undefined})
if(Object.keys(inquiryNo).length > 0) {
basicform.setFieldsValue({'inquiryListNo': inquiryNo.orderNo})
}
},[memberList])
},[inquiryNo])
/************* 页面的一些操作start *************/
// 拿到表单数据
......@@ -160,7 +151,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Input />
</Form.Item>
<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 label='报价单号' name='quotationNo'>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
......@@ -183,13 +175,13 @@ const BasicInfo: React.FC<queryProps> = (props) => {
</Form>
{/* 选择会员弹框 */}
<ModalTable
modalTitle='选择会员'
modalTitle='选择询价单'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
visible={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}}
columns={columnsSetMember}
rowSelection={memberRowSelection}
rowSelection={inquiryRowSelection}
fetchTableData={params => fetchMemberList(params)}
formilyProps={
{
......@@ -197,7 +189,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
}
tableProps={{
rowKey: 'memberId',
rowKey: 'orderId',
}}
/>
</>
......
import React, { useState, useEffect } from 'react';
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 { 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,
interface queryProps {
inquiryNo?: any,
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 { inquiryNo, getGoodsList, editData,} = props
// 会员添加弹窗控制
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
const [goodsList, setgoodsList] = useState([{
productId: 1,
productName: '进口头层黄牛皮荔枝纹/红色/XXL',
inquiryListNo: 'sx1002x',
brand: 'PELLE',
nuit: '个',
purchaseQuantity: 100,
money: 200,
pric: 100
}]);
})
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
......@@ -137,7 +39,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
}
const columns: ColumnType<any>[] = [{
title: '序号',
title: '商品ID',
dataIndex: 'productId',
}, {
title: '商品名称',
......@@ -154,85 +56,36 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
}, {
title: '采购数量',
dataIndex: 'purchaseQuantity',
}, {
title: '报价单价',
dataIndex: 'pric',
}, {
title: '金额',
dataIndex: 'money',
render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.purchaseQuantity}>
<Input
addonBefore="¥"
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) => {
}
// 选择会员弹框结束
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)
}
// if(Object.keys(inquiryNo).length > 0 && inquiryNo.orderId) {
// PublicApi.getOrderProductInquiryDetails({id: inquiryNo.orderId}).then(res => {
// if(res.code === 1000) {
// setgoodsList(res.data.inquiryListProductRequests)
// }
// })
// }
// // 询价单重选,清空数据
// setgoodsList([])
}, [inquiryNo])
// 编辑时回显的数据
useEffect(() => {
if(Object.keys(editData).length > 0) {
......@@ -242,44 +95,9 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
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>
)
}
......
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 { Form, Input, Row, Col, } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
......@@ -18,15 +17,13 @@ const layout: any = {
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(),
minimumOrder: values.minimumOrder,
offer: values.offer,
paymentType: values.paymentType,
taxes: values.taxes,
......@@ -52,10 +49,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
currentRef.current = userAction;
}
}
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(res.data)
})
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
TradingConditionsForm.setFieldsValue({
......@@ -65,9 +59,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime),
fullAddress: editData.fullAddress,
minimumOrder: editData.minimumOrder
})
}
}, [])
......
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';
......@@ -77,13 +77,14 @@ const AddInquiryOrder: React.FC<{}> = () => {
console.log(record.interiorState)
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
destroyTooltipOnHide
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => handleDelete(record.id)}
>
<Button type="link">删除</Button>
</Popconfirm>
......@@ -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) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
......
......@@ -14,11 +14,14 @@ import EyePreview from '@/components/EyePreview';
import { pendingReviewSchema } from '../schema/pendingReview';
import { filterInternalState, filterExternalState } from './../../common/statusList';
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 [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [{
......@@ -71,7 +74,7 @@ const PendingSubmit: React.FC<{}> = () => {
title: '操作',
key: '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) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
......@@ -138,6 +141,13 @@ const PendingSubmit: React.FC<{}> = () => {
})
}
const handleModalOK = () => {
setvisible(false)
setTimeout(() => {
history.goBack()
}, 1000)
}
return (
<PageHeaderWrapper>
<Card>
......@@ -164,6 +174,13 @@ const PendingSubmit: React.FC<{}> = () => {
>
</StandardTable>
</Card>
<AuditModal
id={id}
type={1}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={handleModalOK}
/>
</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