提交 2eb3a855 作者: 龚洪江

修复:租赁缺陷修复

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