提交 ecd76e89 作者: 龚洪江

功能:租赁联调完成

上级 b49c069b
...@@ -35,6 +35,13 @@ export type addRentModeType = InterFunction< ...@@ -35,6 +35,13 @@ export type addRentModeType = InterFunction<
{ modeName: string; productTypeId: number; brandInfoId: number; tag?: string }, { modeName: string; productTypeId: number; brandInfoId: number; tag?: string },
any any
>; >;
//租赁-型号-编辑
export type editRentModeType = InterFunction<
{ modeName: string; productTypeId: number; brandInfoId: number; tag?: string; id?: number },
any
>;
//租赁-型号-删除
export type deleteModeType = InterFunction<{ id: number }, any>;
//租赁-型号-列表 //租赁-型号-列表
export type rentModeListType = InterItemFunction< export type rentModeListType = InterItemFunction<
{ brandInfoId?: number; productTypeId?: number }, { brandInfoId?: number; productTypeId?: number },
...@@ -81,13 +88,16 @@ export type addRentGoodsType = InterFunction< ...@@ -81,13 +88,16 @@ export type addRentGoodsType = InterFunction<
//租赁商品-列表 //租赁商品-列表
type rentGoodsType = { type rentGoodsType = {
brandInfoId: number; brandInfoId: number;
brandName: string;
deviceModeId: number; deviceModeId: number;
deviceModeName: string;
leasePartsList: { id: number; name: string; number: number; price: number }[]; leasePartsList: { id: number; name: string; number: number; price: number }[];
level: number; level: number;
logisticsCompany: string; logisticsCompany: string;
maxLeaseTerm: number; maxLeaseTerm: number;
minLeaseTerm: number; minLeaseTerm: number;
modeOfDelivery: number; modeOfDelivery: number;
modeOfDeliveryInfo: string;
priceStock: { priceStock: {
cashPledge: number; cashPledge: number;
maxDaysRental?: number; maxDaysRental?: number;
...@@ -105,6 +115,7 @@ type rentGoodsType = { ...@@ -105,6 +115,7 @@ type rentGoodsType = {
productDetails: string; productDetails: string;
productParam: string; productParam: string;
productTypeId: number; productTypeId: number;
productTypeName: string;
resourcesList: { id: number; type: number; url: string }[]; resourcesList: { id: number; type: number; url: string }[];
returnAddress: number; returnAddress: number;
sellingPoint: string; sellingPoint: string;
......
...@@ -3,8 +3,10 @@ import { ...@@ -3,8 +3,10 @@ import {
addRentModeType, addRentModeType,
addType, addType,
batchRemoveWareInfoType, batchRemoveWareInfoType,
deleteModeType,
editBrandInfoType, editBrandInfoType,
editLeaseGoodsType, editLeaseGoodsType,
editRentModeType,
getTypeListType, getTypeListType,
leaseGoodsDetailsType, leaseGoodsDetailsType,
leaseGoodsListType, leaseGoodsListType,
...@@ -43,6 +45,10 @@ export class RentManageAPI { ...@@ -43,6 +45,10 @@ export class RentManageAPI {
// 租赁-型号-新增 // 租赁-型号-新增
static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data); static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data);
//租赁-型号-编辑
static editRentMode: editRentModeType = (data) => axios.post('/pms/brand/editMode', data);
//租赁-型号-删除
static deleteMode: deleteModeType = (params) => axios.get('/pms/brand/deleteMode', { params });
// 租赁-型号-列表 // 租赁-型号-列表
static getRentModeList: rentModeListType = (data) => axios.post('/pms/brand/modeList', data); static getRentModeList: rentModeListType = (data) => axios.post('/pms/brand/modeList', data);
......
...@@ -96,7 +96,7 @@ const EditableCell: React.FC< ...@@ -96,7 +96,7 @@ const EditableCell: React.FC<
style={{ margin: 0 }} style={{ margin: 0 }}
rules={rules} rules={rules}
//valuePropName:当 form setFieldsValue 设置switch不生效时 //valuePropName:当 form setFieldsValue 设置switch不生效时
valuePropName={inputType === 'switch' ? 'checked' : ''} valuePropName={inputType === 'switch' ? 'checked' : undefined}
> >
{inputNode()} {inputNode()}
</Form.Item> </Form.Item>
......
...@@ -291,9 +291,9 @@ const CommonSkuInfo = forwardRef<any, selfProps>( ...@@ -291,9 +291,9 @@ const CommonSkuInfo = forwardRef<any, selfProps>(
<div className='common-sku-info'> <div className='common-sku-info'>
<Form wrapperCol={{ span: 5 }} labelCol={{ span: 1 }} form={form}> <Form wrapperCol={{ span: 5 }} labelCol={{ span: 1 }} form={form}>
{specificationFormList.map((v, index) => ( {specificationFormList.map((v, index) => (
<> <div key={v.id}>
{/* 规格项*/} {/* 规格项*/}
<Row key={v.id}> <Row>
<Col span={7}> <Col span={7}>
<Form.Item <Form.Item
label={'规格项' + (index + 1)} label={'规格项' + (index + 1)}
...@@ -388,7 +388,7 @@ const CommonSkuInfo = forwardRef<any, selfProps>( ...@@ -388,7 +388,7 @@ const CommonSkuInfo = forwardRef<any, selfProps>(
) : ( ) : (
'' ''
)} )}
</> </div>
))} ))}
<Row> <Row>
<Col span={2}></Col> <Col span={2}></Col>
......
.rent-detail-introduce{
img{
max-width: 100%;
}
}
import { useSearchParams, useNavigate } from 'react-router-dom'; import { useSearchParams, useNavigate } from 'react-router-dom';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { RentManageAPI, SystemManageAPI } from '~/api'; import { OrderManageAPI, RentManageAPI, SystemManageAPI } from '~/api';
import { InterDataType } from '~/api/interface'; import { InterDataType } from '~/api/interface';
import { leaseGoodsDetailsType } from '~/api/interface/rentManageType'; import { leaseGoodsDetailsType } from '~/api/interface/rentManageType';
import { Badge, Button, Col, Descriptions, Image, Row, Switch, Table } from 'antd'; import { Badge, Button, Col, Descriptions, Image, Row, Switch, Table } from 'antd';
import { qualityList } from '~/utils/dictionary'; import { qualityList } from '~/utils/dictionary';
import './index.scss';
//租赁商品详情返回类型 //租赁商品详情返回类型
type rentGoodsDetailType = InterDataType<leaseGoodsDetailsType>; type rentGoodsDetailType = InterDataType<leaseGoodsDetailsType>;
...@@ -61,6 +62,9 @@ const RentDetail = () => { ...@@ -61,6 +62,9 @@ const RentDetail = () => {
const [addressOptionList, setAddressOptionList] = useState< const [addressOptionList, setAddressOptionList] = useState<
{ label: string; value: number; districtCode: string }[] { label: string; value: number; districtCode: string }[]
>([]); >([]);
const [expressOptionList, setExpressOptionList] = useState<{ label: string; value: string }[]>(
[],
);
//获取租赁商品详情 //获取租赁商品详情
const getRentGoodsDetail = (id: number) => { const getRentGoodsDetail = (id: number) => {
...@@ -183,6 +187,18 @@ const RentDetail = () => { ...@@ -183,6 +187,18 @@ const RentDetail = () => {
} }
}); });
}; };
//物流公司列表
const getListExpressInfo = () => {
OrderManageAPI.listExpressInfo().then(({ result }) => {
if (result) {
const optionList = result.map((v) => ({
label: v.exName,
value: v.exCode,
}));
setExpressOptionList(optionList);
}
});
};
//返回 //返回
const backRoute = () => { const backRoute = () => {
...@@ -192,6 +208,7 @@ const RentDetail = () => { ...@@ -192,6 +208,7 @@ const RentDetail = () => {
useEffect(() => { useEffect(() => {
getLeaseTermInfo(); getLeaseTermInfo();
getAddressList(); getAddressList();
getListExpressInfo();
}, []); }, []);
useEffect(() => { useEffect(() => {
...@@ -225,9 +242,9 @@ const RentDetail = () => { ...@@ -225,9 +242,9 @@ const RentDetail = () => {
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
<Descriptions title='商品属性' bordered column={3} style={{ marginTop: '10px' }}> <Descriptions title='商品属性' bordered column={3} style={{ marginTop: '10px' }}>
<Descriptions.Item label='商品类型'>{rentGoodsDetails?.productTypeId}</Descriptions.Item> <Descriptions.Item label='商品类型'>{rentGoodsDetails?.productTypeName}</Descriptions.Item>
<Descriptions.Item label='商品品牌'>{rentGoodsDetails?.brandInfoId}</Descriptions.Item> <Descriptions.Item label='商品品牌'>{rentGoodsDetails?.brandName}</Descriptions.Item>
<Descriptions.Item label='商品型号'>{rentGoodsDetails?.deviceModeId}</Descriptions.Item> <Descriptions.Item label='商品型号'>{rentGoodsDetails?.deviceModeName}</Descriptions.Item>
<Descriptions.Item label='商品主图'> <Descriptions.Item label='商品主图'>
<Image src={rentGoodsDetails?.resourcesList.find((v) => v.type === 0)?.url} width={50} /> <Image src={rentGoodsDetails?.resourcesList.find((v) => v.type === 0)?.url} width={50} />
</Descriptions.Item> </Descriptions.Item>
...@@ -316,8 +333,21 @@ const RentDetail = () => { ...@@ -316,8 +333,21 @@ const RentDetail = () => {
<Descriptions.Item label='归还地址'> <Descriptions.Item label='归还地址'>
{addressOptionList.find((v) => v.value === rentGoodsDetails?.returnAddress)?.label} {addressOptionList.find((v) => v.value === rentGoodsDetails?.returnAddress)?.label}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label='寄出物流'>{rentGoodsDetails?.logisticsCompany}</Descriptions.Item> <Descriptions.Item label='寄出物流'>
<Descriptions.Item label='配送方式'>{rentGoodsDetails?.modeOfDelivery}</Descriptions.Item> {expressOptionList.find((v) => v.value === rentGoodsDetails?.logisticsCompany)?.label}
</Descriptions.Item>
<Descriptions.Item label='配送方式'>
{rentGoodsDetails?.modeOfDeliveryInfo}
</Descriptions.Item>
</Descriptions>
<Descriptions title='商品详情页' column={1} style={{ marginTop: '10px' }}>
<Descriptions.Item>
<div
dangerouslySetInnerHTML={{ __html: rentGoodsDetails?.productDetails || '' }}
style={{ width: '100%' }}
className='rent-detail-introduce'
></div>
</Descriptions.Item>
</Descriptions> </Descriptions>
</div> </div>
); );
......
...@@ -45,14 +45,15 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ ...@@ -45,14 +45,15 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({
} }
return pre; return pre;
}, []); }, []);
RentManageAPI.addRentMode({ RentManageAPI[currentRentMode ? 'editRentMode' : 'addRentMode']({
productTypeId: values.productTypeId, productTypeId: values.productTypeId,
modeName: values.modeName, modeName: values.modeName,
tag: covertTagList.length ? covertTagList.join(',') : undefined, tag: covertTagList.length ? covertTagList.join(',') : undefined,
brandInfoId, brandInfoId,
id: currentRentMode ? currentRentMode.id : undefined,
}).then(({ code }) => { }).then(({ code }) => {
if (code === '200') { if (code === '200') {
message.success('新增成功'); message.success(currentRentMode ? '编辑成功' : '新增成功');
form.resetFields(); form.resetFields();
onOk(); onOk();
} }
...@@ -131,7 +132,7 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ ...@@ -131,7 +132,7 @@ const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({
wrapperCol={{ span: 19, offset: index ? 5 : 0 }} wrapperCol={{ span: 19, offset: index ? 5 : 0 }}
name={v.tagName} name={v.tagName}
> >
<Input placeholder='请输入标签名称' /> <Input placeholder='请输入标签名称' maxLength={30} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={3} offset={1}> <Col span={3} offset={1}>
......
...@@ -93,7 +93,16 @@ const RentMode = () => { ...@@ -93,7 +93,16 @@ const RentMode = () => {
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
content: '确认删除该型号?', content: '确认删除该型号?',
onOk: () => {}, onOk: () => {
RentManageAPI.deleteMode({ id: record.id }).then(({ code }) => {
if (code === '200') {
if (tableData.length === 1 && pagination.pageNo !== 1) {
pagination.pageNo -= 1;
}
getModeList(brandInfoId, query);
}
});
},
}); });
}; };
//型号列表 //型号列表
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论