提交 a99d4c23 作者: 龚洪江

功能:租赁品牌,租赁类型,租赁型号

上级 3a749ea2
...@@ -31,7 +31,9 @@ export type listBrandInfoType = InterItemFunction< ...@@ -31,7 +31,9 @@ export type listBrandInfoType = InterItemFunction<
>; >;
//租赁-型号-新增 //租赁-型号-新增
export type addRentModeType = InterFunction< export type addRentModeType = InterFunction<{ modeName: string; productTypeId: number }, any>;
{ modeName: string; brandInfoId: number; productTypeId: number }, //租赁-型号-列表
export type rentModeListType = InterItemFunction<
{ brandInfoId?: number; productTypeId?: number },
any any
>; >;
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
getTypeListType, getTypeListType,
listBrandInfoType, listBrandInfoType,
rentMakeAddType, rentMakeAddType,
rentModeListType,
rentTypeEditType, rentTypeEditType,
rentTypeRemoveType, rentTypeRemoveType,
} from '~/api/interface/rentManageType'; } from '~/api/interface/rentManageType';
...@@ -34,4 +35,6 @@ export class RentManageAPI { ...@@ -34,4 +35,6 @@ export class RentManageAPI {
// 租赁-型号-新增 // 租赁-型号-新增
static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data); static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data);
// 租赁-型号-列表
static getRentModeList: rentModeListType = (data) => axios.post('/pms/brand/modeList', data);
} }
...@@ -18,9 +18,17 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc ...@@ -18,9 +18,17 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc
const [rentTypeList, setRentTypeList] = useState<rentTypeListType>([]); const [rentTypeList, setRentTypeList] = useState<rentTypeListType>([]);
const handleOk = () => { const handleOk = () => {
onOk(); form.validateFields().then((values) => {
RentManageAPI.addRentMode({ ...values }).then(({ code }) => {
if (code === '200') {
form.resetFields();
onOk();
}
});
});
}; };
const handleCancel = () => { const handleCancel = () => {
form.resetFields();
onCancel(); onCancel();
}; };
//获取类型列表 //获取类型列表
...@@ -37,7 +45,11 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc ...@@ -37,7 +45,11 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc
return ( return (
<Modal open={open} onOk={handleOk} onCancel={handleCancel} title='新增型号'> <Modal open={open} onOk={handleOk} onCancel={handleCancel} title='新增型号'>
<Form form={form}> <Form form={form}>
<Form.Item label='所属类别'> <Form.Item
label='所属类别'
name='productTypeId'
rules={[{ required: true, message: '请选择所属类别' }]}
>
<Select placeholder='请选择所属类别'> <Select placeholder='请选择所属类别'>
{rentTypeList.map((v) => ( {rentTypeList.map((v) => (
<Select.Option key={v.id} value={v.id}> <Select.Option key={v.id} value={v.id}>
...@@ -46,8 +58,12 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc ...@@ -46,8 +58,12 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCanc
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label='型号名称'> <Form.Item
<Input placeholder='请输入型号名称' /> label='型号名称'
name='modeName'
rules={[{ required: true, message: '请输入型号名称' }]}
>
<Input placeholder='请输入型号名称' maxLength={30} />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -3,7 +3,9 @@ import { Button, Table } from 'antd'; ...@@ -3,7 +3,9 @@ import { Button, Table } from 'antd';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table/InternalTable'; import { ColumnsType } from 'antd/es/table/InternalTable';
import AddOrEditRentModeModal from '~/pages/rentManage/rentMode/components/addOrEditRentModeModal'; import AddOrEditRentModeModal from '~/pages/rentManage/rentMode/components/addOrEditRentModeModal';
import { useState } from 'react'; import { useEffect, useState } from 'react';
import { RentManageAPI } from '~/api';
import { PaginationProps } from '~/api/interface';
const RentMode = () => { const RentMode = () => {
const tableColumns: ColumnsType<any> = [ const tableColumns: ColumnsType<any> = [
...@@ -40,6 +42,11 @@ const RentMode = () => { ...@@ -40,6 +42,11 @@ const RentMode = () => {
]; ];
const [addOrEditRentModelModalShow, setAddOrEditRentModelModalShow] = useState<boolean>(false); const [addOrEditRentModelModalShow, setAddOrEditRentModelModalShow] = useState<boolean>(false);
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
pageSize: 10,
totalCount: 0,
});
//新增,编辑型号弹窗 //新增,编辑型号弹窗
const addOrEditRentModelClick = () => { const addOrEditRentModelClick = () => {
...@@ -51,6 +58,20 @@ const RentMode = () => { ...@@ -51,6 +58,20 @@ const RentMode = () => {
const addOrEditRentModelModalOk = () => { const addOrEditRentModelModalOk = () => {
setAddOrEditRentModelModalShow(true); setAddOrEditRentModelModalShow(true);
}; };
//类型列表
const getModeList = () => {
RentManageAPI.getRentModeList({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
}).then(({ result }) => {
pagination.totalCount = result.totalCount;
setPagination({ ...pagination });
});
};
useEffect(() => {
getModeList();
}, []);
return ( return (
<div className='rent-model'> <div className='rent-model'>
<SearchBox <SearchBox
......
...@@ -905,7 +905,6 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -905,7 +905,6 @@ export const routerList: Array<RouteObjectType> = [
id: 2210, id: 2210,
title: '积分列表', title: '积分列表',
icon: <MacCommandOutlined />, icon: <MacCommandOutlined />,
develop: true,
}, },
}, },
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论