Commit 5bfb3f58 authored by wzy's avatar wzy

fix: 去除多余代码-productModal

parent b8ca0b00
import NiceForm from '@/components/NiceForm';
import StandardTable from '@/components/StandardTable';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
// import {
// getProductCommodityGetSubCommodityListS2B,
// getProductCommodityGetUpperCommodityListS2B,
// GetProductCommodityGetUpperCommodityListS2BRequest,
// postProductCommodityChoiceSubCommodity,
// postProductCommodityChoiceUpperCommodity,
// } from '@/services/ProductV2Api';
import {
getProductCommodityGetSubCommodityListS2B,
getProductCommodityGetUpperCommodityListS2B,
GetProductCommodityGetUpperCommodityListS2BRequest,
postProductCommodityChoiceSubCommodity,
postProductCommodityChoiceUpperCommodity,
} from '@/services/ProductV2Api';
import { createFormActions } from '@formily/antd';
import { Button, Modal, Table } from 'antd';
import { useEffect, useRef, useState } from 'react';
......@@ -215,21 +215,21 @@ export const ProductView = props => {
// };
useEffect(() => {
if (productId) {
// const params: GetProductCommodityGetUpperCommodityListS2BRequest = {
// current: '1',
// pageSize: '50',
// productId,
// name: '',
// priceType: '',
// customerCategoryName: '',
// memberName: '',
// brandName: ''
// };
// getProductCommodityGetUpperCommodityListS2B(params).then(res => {
// if (res.code === 1000) {
// setDataSource(res.data.data);
// }
// });
const params: GetProductCommodityGetUpperCommodityListS2BRequest = {
current: '1',
pageSize: '50',
productId,
name: '',
priceType: '',
customerCategoryName: '',
memberName: '',
brandName: ''
};
getProductCommodityGetUpperCommodityListS2B(params).then(res => {
if (res.code === 1000) {
setDataSource(res.data.data);
}
});
}
}, [productId]);
return (
......@@ -253,7 +253,7 @@ export const ProductView = props => {
}}
fetchTableData={(params: any) => fetchData(params)}
/> */}
<Table dataSource={dataSource} columns={columns} rowKey="id"/>
<Table dataSource={dataSource} columns={columns} rowKey="id" />
</Modal>
);
};
......@@ -363,8 +363,7 @@ export const ProductSel = props => {
return arr;
};
const formActions = createFormActions();
// const fetchData = (item: GetProductCommodityGetUpperCommodityListS2BRequest) => {
const fetchData = (item: any) => {
const fetchData = (item: GetProductCommodityGetUpperCommodityListS2BRequest) => {
const params = {
current: '1',
pageSize: '10',
......@@ -376,37 +375,28 @@ export const ProductSel = props => {
// productId: '',
...item,
};
// const fn =
// titleKey === 'upperMemberName'
// ? getProductCommodityGetUpperCommodityListS2B
// : getProductCommodityGetSubCommodityListS2B;
// return new Promise(resolve => {
// fn(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// });
return new Promise(resolve => {
resolve({
totalCount:0,
data:[]
})
})
const fn =
titleKey === 'upperMemberName'
? getProductCommodityGetUpperCommodityListS2B
: getProductCommodityGetSubCommodityListS2B;
return new Promise(resolve => {
fn(params).then(res => {
resolve(res.data);
});
});
};
const handleOk = () => {
// setLoading(true)
// const fn =
// titleKey === 'upperMemberName'
// ? postProductCommodityChoiceSubCommodity
// : postProductCommodityChoiceUpperCommodity;
// fn({ idList: RowCtl.selectedRowKeys }).then(res => {
// if (res.code === 1000) {
// setVisible(false);
// }
// setLoading(false)
// });
setLoading(true)
const fn =
titleKey === 'upperMemberName'
? postProductCommodityChoiceSubCommodity
: postProductCommodityChoiceUpperCommodity;
fn({ idList: RowCtl.selectedRowKeys }).then(res => {
if (res.code === 1000) {
setVisible(false);
}
setLoading(false)
});
};
return (
<Modal
......
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