提交 2eb3a855 作者: 龚洪江

修复:租赁缺陷修复

上级 77f9a87b
...@@ -50,6 +50,6 @@ export type likeUserInfoType = InterFunction< ...@@ -50,6 +50,6 @@ export type likeUserInfoType = InterFunction<
>; >;
// 论坛-审核 // 论坛-审核
export type checkDynamicType = InterFunction< export type checkDynamicType = InterFunction<
{ dynamicId: number; status: number }, { dynamicId: number; status: boolean },
NonNullable<unknown> NonNullable<unknown>
>; >;
...@@ -199,14 +199,14 @@ const DynamicList = () => { ...@@ -199,14 +199,14 @@ const DynamicList = () => {
okText: '审核通过', okText: '审核通过',
cancelText: '审核不通过', cancelText: '审核不通过',
onOk: async () => { onOk: async () => {
const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: 1 }); const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: true });
if (res && res.code === '200') { if (res && res.code === '200') {
message.success('操作成功'); message.success('操作成功');
paginationChange(pagination.pageNo, pagination.pageSize); paginationChange(pagination.pageNo, pagination.pageSize);
} }
}, },
onCancel: async () => { onCancel: async () => {
const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: 2 }); const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: false });
if (res && res.code === '200') { if (res && res.code === '200') {
message.success('操作成功'); message.success('操作成功');
paginationChange(pagination.pageNo, pagination.pageSize); paginationChange(pagination.pageNo, pagination.pageSize);
......
...@@ -176,7 +176,7 @@ const AccessoryList = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => ...@@ -176,7 +176,7 @@ const AccessoryList = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) =>
price: value['price' + cur.id], price: value['price' + cur.id],
number: value['number' + cur.id], number: value['number' + cur.id],
id: rentGoodsDetails id: rentGoodsDetails
? rentGoodsDetails.leasePartsList.some((v) => v.id === cur.id) ? rentGoodsDetails.leasePartsList?.some((v) => v.id === cur.id)
? cur.id ? cur.id
: undefined : undefined
: undefined, : undefined,
......
...@@ -205,10 +205,12 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => { ...@@ -205,10 +205,12 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
//类型选中 //类型选中
const rentTypeOnSelect = (value: number) => { const rentTypeOnSelect = (value: number) => {
rentAttrForm.setFieldValue('deviceModeId', undefined);
getRentModelList(rentAttrForm.getFieldValue('brandInfoId') || undefined, value); getRentModelList(rentAttrForm.getFieldValue('brandInfoId') || undefined, value);
}; };
//品牌选中 //品牌选中
const brandInfoOnSelect = (value: number) => { const brandInfoOnSelect = (value: number) => {
rentAttrForm.setFieldValue('deviceModeId', undefined);
getRentModelList(value, rentAttrForm.getFieldValue('productTypeId') || undefined); getRentModelList(value, rentAttrForm.getFieldValue('productTypeId') || undefined);
}; };
//商品图片上传成功 //商品图片上传成功
......
...@@ -14,6 +14,7 @@ import { InterDataType, InterReqListType, PaginationProps } from '../../../../ap ...@@ -14,6 +14,7 @@ import { InterDataType, InterReqListType, PaginationProps } from '../../../../ap
import { leaseGoodsListType } from '../../../../api/interface/rentManageType'; import { leaseGoodsListType } from '../../../../api/interface/rentManageType';
import './index.scss'; import './index.scss';
import qs from 'query-string'; import qs from 'query-string';
import { useSelector } from 'react-redux';
//租赁列表返回类型 //租赁列表返回类型
type rentGoodsType = InterDataType<leaseGoodsListType>['list']; type rentGoodsType = InterDataType<leaseGoodsListType>['list'];
...@@ -25,7 +26,7 @@ const RentList = () => { ...@@ -25,7 +26,7 @@ const RentList = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const { userInfo } = useSelector((state: any) => state.UserInfo);
//类型下拉列表 //类型下拉列表
const [rentTypeSelectList, setRentTypeSelectList] = useState<{ label: string; value: number }[]>( const [rentTypeSelectList, setRentTypeSelectList] = useState<{ label: string; value: number }[]>(
[], [],
...@@ -266,12 +267,20 @@ const RentList = () => { ...@@ -266,12 +267,20 @@ const RentList = () => {
}; };
//批量上下架请求 //批量上下架请求
const batchOnShelfOrTakeDownRequest = (goodsIds: number[], status: number) => { const batchOnShelfOrTakeDownRequest = (goodsIds: number[], status: number) => {
RentManageAPI.batchOnShelfOrTakeDown({ goodsIds, status }).then(({ code }) => { Modal.confirm({
if (code === '200') { title: '提示',
message.success(`${status ? '上架' : '下架'}成功`); content: status
getRentGoodsList(query); ? '是否确认上架?商品上架后,请到出租中的商品查看并管理。'
setSelectedRowKeys([]); : '是否确认下架?商品下架后请到仓库中的商品查看并管理',
} onOk: () => {
RentManageAPI.batchOnShelfOrTakeDown({ goodsIds, status }).then(({ code }) => {
if (code === '200') {
message.success(`${status ? '上架' : '下架'}成功`);
getRentGoodsList(query);
setSelectedRowKeys([]);
}
});
},
}); });
}; };
//批量删除操作 //批量删除操作
...@@ -343,7 +352,12 @@ const RentList = () => { ...@@ -343,7 +352,12 @@ const RentList = () => {
<SearchBox <SearchBox
search={searchColumns} search={searchColumns}
child={ child={
<Button icon={<PlusOutlined />} type='primary' onClick={addOrEditClick}> <Button
icon={<PlusOutlined />}
type='primary'
onClick={addOrEditClick}
disabled={!!userInfo.roleInfo.superAdmin}
>
新增商品 新增商品
</Button> </Button>
} }
......
...@@ -26,6 +26,7 @@ const RentMake = () => { ...@@ -26,6 +26,7 @@ const RentMake = () => {
dataIndex: 'modeInfoList', dataIndex: 'modeInfoList',
render: (text: makeListType[0]['modeInfoList']) => render: (text: makeListType[0]['modeInfoList']) =>
text?.map((v) => <Tag key={v.id}>{v.modeName}</Tag>), text?.map((v) => <Tag key={v.id}>{v.modeName}</Tag>),
width: '30%',
}, },
{ {
title: '操作', title: '操作',
...@@ -33,13 +34,12 @@ const RentMake = () => { ...@@ -33,13 +34,12 @@ const RentMake = () => {
width: '15%', width: '15%',
render: (_: any, record) => ( render: (_: any, record) => (
<> <>
<Button type='link' onClick={() => addRentModeClick(record)}>
新增型号
</Button>
<Button type='link' onClick={() => addOrEditRentMakeModalClick(record)}> <Button type='link' onClick={() => addOrEditRentMakeModalClick(record)}>
编辑 编辑
</Button> </Button>
<Button type='link'>详情</Button> <Button type='link' onClick={() => addRentModeClick(record)}>
详情
</Button>
</> </>
), ),
}, },
......
...@@ -38,6 +38,7 @@ const RentMode = () => { ...@@ -38,6 +38,7 @@ const RentMode = () => {
align: 'center', align: 'center',
dataIndex: 'tag', dataIndex: 'tag',
render: (text: string) => text?.split(',').map((v, index) => <Tag key={index}>{v}</Tag>), render: (text: string) => text?.split(',').map((v, index) => <Tag key={index}>{v}</Tag>),
width: '30%',
}, },
{ {
title: '操作', title: '操作',
......
...@@ -66,7 +66,11 @@ const AddOrEditTypeModal: FC<ModalProps & selfProps> = ({ ...@@ -66,7 +66,11 @@ const AddOrEditTypeModal: FC<ModalProps & selfProps> = ({
return ( return (
<Modal open={open} title='新增类型' onCancel={handleCancel} onOk={handelOk}> <Modal open={open} title='新增类型' onCancel={handleCancel} onOk={handelOk}>
<Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}> <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}>
<Form.Item label='类型名称' name='name'> <Form.Item
label='类型名称'
name='name'
rules={[{ required: true, message: '请输入类型名称' }]}
>
<Input placeholder='请输入类型名称' maxLength={30} /> <Input placeholder='请输入类型名称' maxLength={30} />
</Form.Item> </Form.Item>
<Form.Item label='图片' name='url' rules={[{ required: true, message: '请上传图片' }]}> <Form.Item label='图片' name='url' rules={[{ required: true, message: '请上传图片' }]}>
......
...@@ -35,7 +35,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({ ...@@ -35,7 +35,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({
...values, ...values,
districtCode: values.districtCode[2].toString(), districtCode: values.districtCode[2].toString(),
takeRegion: getDistrictName(values.districtCode), takeRegion: getDistrictName(values.districtCode),
type: values.type ? 1 : 0, type: !values.type ? 1 : 0,
id: currentAddressItem ? currentAddressItem.id : undefined, id: currentAddressItem ? currentAddressItem.id : undefined,
}).then(({ code }) => { }).then(({ code }) => {
if (code === '200') { if (code === '200') {
...@@ -75,7 +75,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({ ...@@ -75,7 +75,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({
Number(currentAddressItem.districtCode), Number(currentAddressItem.districtCode),
], ],
takeAddress: currentAddressItem.takeAddress, takeAddress: currentAddressItem.takeAddress,
type: !!currentAddressItem.type, type: !currentAddressItem.type,
}); });
} }
}, [currentAddressItem]); }, [currentAddressItem]);
...@@ -127,7 +127,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({ ...@@ -127,7 +127,7 @@ const AddOrEditAddressModal: FC<ModalProps & selfProps> = ({
> >
<Input.TextArea rows={4} showCount placeholder='请输入详细地址' maxLength={70} /> <Input.TextArea rows={4} showCount placeholder='请输入详细地址' maxLength={70} />
</Form.Item> </Form.Item>
<Form.Item label='设为默认地址' name='type'> <Form.Item label='设为默认地址' name='type' valuePropName='checked'>
<Switch /> <Switch />
</Form.Item> </Form.Item>
</Form> </Form>
......
...@@ -37,7 +37,7 @@ const AddressManage = () => { ...@@ -37,7 +37,7 @@ const AddressManage = () => {
title: '状态', title: '状态',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'type',
render: (text: number) => (text ? '默认' : ''), render: (text: number) => (!text ? '默认' : ''),
}, },
{ {
title: '操作', title: '操作',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论