提交 f46b5f58 作者: 余乾开

feat(租赁):商品品牌删除

上级 a6f573fa
......@@ -29,6 +29,8 @@ export type listBrandInfoType = InterItemFunction<
}[];
}[]
>;
//租赁-品牌-删除
export type deleteBrandInfoType = InterItemFunction<{ id: number }, null>;
//租赁-型号-新增
export type addRentModeType = InterFunction<
......
......@@ -3,6 +3,7 @@ import {
addRentModeType,
addType,
batchRemoveWareInfoType,
deleteBrandInfoType,
deleteModeType,
editBrandInfoType,
editLeaseGoodsType,
......@@ -42,6 +43,9 @@ export class RentManageAPI {
// 租赁-品牌-列表
static getListBrandInfo: listBrandInfoType = (params) =>
axios.get('/pms/brand/listBrandInfo', { params });
// 租赁-品牌-删除
static deleteBrandInfo: deleteBrandInfoType = (params) =>
axios.get('/pms/brand/deleteBrandInfo', { params });
// 租赁-型号-新增
static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data);
......
import { Button, Table, Tag } from 'antd';
import { Button, Modal, Table, Tag, message } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table';
import AddOrEditRentMakeModal from './components/addOrEditRentMakeModal';
......@@ -40,6 +40,9 @@ const RentMake = () => {
<Button type='link' onClick={() => addRentModeClick(record)}>
详情
</Button>
<Button type='link' danger onClick={() => deleteBrandInfoClick(record)}>
删除
</Button>
</>
),
},
......@@ -84,6 +87,23 @@ const RentMake = () => {
});
};
//品牌删除
const deleteBrandInfoClick = (record: makeListType[0]) => {
Modal.confirm({
content: '是否删除该品牌?',
onOk: () => {
RentManageAPI.deleteBrandInfo({ id: record.id }).then(({ code }) => {
if (code === '200') {
if (tableData.length === 1 && pagination.pageNo !== 1) {
pagination.pageNo--;
}
message.success('删除成功');
getListBrandInfo();
}
});
},
});
};
//分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论