提交 ecd76e89 作者: 龚洪江

功能:租赁联调完成

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