Commit 11573239 authored by GuanHua's avatar GuanHua
parents e3181151 3ab6693c
......@@ -794,8 +794,9 @@ const AddLogistics: React.FC<{}> = () => {
rowSelection={shippingRowSelection}
cancel={() => setshippingvisible(false)}
confirm={handleShipping}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true}
fetchTableData={params => fetchShippingData(params)}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'id' }}
modalType='logisticsDelivery'
searchName='invoicesNo'
......@@ -807,8 +808,9 @@ const AddLogistics: React.FC<{}> = () => {
columns={invoicesColumns}
invoicesNo={query.invoicesNo}
relevanceType={relevanceType}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'id' }}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true}
rowSelection={invoicesRowSelection}
cancel={() => setinvoicesvisible(false)}
confirm={handleInvoices}
......@@ -818,6 +820,7 @@ const AddLogistics: React.FC<{}> = () => {
modalTitle='选择商品'
visible={visible}
columns={(createType !== 4 && createType !== 5 && createType !== 6) ? SelectGoodsColumns : AfterSalesSelectGoodsColumns}
resetModal={{destroyOnClose: true, forceRender: true}}
forceRender={true}
fetchTableData={(params) => fetchData(params)}
cancel={() => setvisible(false)}
......
......@@ -4,14 +4,10 @@ import { Button, message, InputNumber, 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 { 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 {
member?: any,
......@@ -23,23 +19,17 @@ interface queryProps extends ModalTableProps {
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { member, schemaAction, getGoodsList, editData, type, ...restProps } = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
setValue(value);
};
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [goodsList, setgoodsList] = useState<any>([]);
const [inquiryGoods, setinquiryGoods] = useState<any>([]);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const [brand, setbrand] = useState<any>([]);
const [form] = Form.useForm()
const handleOkAddMember = () => {
setVisibleChannelMember(false);
const arr: any[] = [];
const inquiry: any[] = [];
console.log(memberRowCtl.selectRow, 100000)
memberRowCtl.selectRow.forEach((v, i) => {
inquiry.push(v)
arr.push({
......@@ -168,12 +158,18 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 删除选中的项
const selectData = [...inquiryGoods];
if (type !== 1) {
const idx = selectData.findIndex(v => v.productId === record.productId);
selectData.splice(idx, 1)
memberRowCtl.setSelectRow(selectData)
memberRowCtl.setSelectedRowKeys(selectData.map(v => v.productId))
} else {
const idx = selectData.findIndex(v => v.id === record.productId);
console.log(newData, selectData);
console.log(colIndex, idx);
selectData.splice(idx, 1)
memberRowCtl.setSelectRow(selectData)
memberRowCtl.setSelectedRowKeys(selectData.map(v => v.id))
}
setinquiryGoods(selectData)
setgoodsList(newData)
getGoodsList(newData)
}
......@@ -182,23 +178,26 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
useEffect(() => {
if (Object.keys(editData).length > 0) {
const arr: any[] = [];
const inquiry: any[] = [];
editData.inquiryListProductRequests.forEach(item => {
inquiry.push(item)
arr.push({
id: item.productId,
name: item.productName,
customerCategoryName: item.category,
brandName: item.brand,
unitName:item.unit,
logistics:item.logistics,
memberId:item.memberId,
memberRoleId:item.memberRoleId,
mainPic:item.imgUrl,
unitName: item.unit,
logistics: item.logistics,
memberId: item.memberId,
memberRoleId: item.memberRoleId,
mainPic: item.imgUrl,
purchaseCount: item.purchaseCount
})
})
memberRowCtl.setSelectRow(arr);
memberRowCtl.setSelectedRowKeys(editData.inquiryListProductRequests.map(v => v.productId))
setgoodsList(editData.inquiryListProductRequests);
setinquiryGoods(inquiry)
}
}, [editData])
......@@ -216,7 +215,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
cancel={handleCancelAddMember}
visible={visibleChannelMember}
forceRender={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}}
resetModal={{ destroyOnClose: true, forceRender: true }}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchGoodsList(params)}
......
......@@ -170,6 +170,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
fetchTableData={params => fetchMemberList(params)}
modalType='selectRfqOrder'
searchName='orderNo'
forceRender={true}
tableProps={{
rowKey: 'orderId',
}}
......
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