Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
db9c4851
提交
db9c4851
authored
8月 19, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:租赁地址回显
上级
366f4a76
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
50 行增加
和
26 行删除
+50
-26
systemManageType.ts
src/api/interface/systemManageType.ts
+13
-0
systemManage.ts
src/api/modules/systemManage.ts
+4
-0
index.tsx
.../rentGoods/rentAddOrEdit/components/addressInfo/index.tsx
+13
-2
index.tsx
...ge/rentGoods/rentAddOrEdit/components/goodsInfo/index.tsx
+1
-1
index.tsx
src/pages/rentManage/rentGoods/rentDetail/index.tsx
+19
-23
没有找到文件。
src/api/interface/systemManageType.ts
浏览文件 @
db9c4851
...
@@ -340,3 +340,16 @@ export type editAddressType = InterFunction<
...
@@ -340,3 +340,16 @@ export type editAddressType = InterFunction<
>
;
>
;
//地址管理-删除地址
//地址管理-删除地址
export
type
deleteAddressType
=
InterFunction
<
{
id
:
number
},
any
>
;
export
type
deleteAddressType
=
InterFunction
<
{
id
:
number
},
any
>
;
// 地址管理-根据id查找
export
type
getUserAddressInfoType
=
InterFunction
<
{
userAddressId
:
number
},
{
takeAddress
:
string
;
takeName
:
string
;
takePhone
:
string
;
takeRegion
:
string
;
type
:
number
;
districtCode
:
string
;
id
:
number
;
}
>
;
src/api/modules/systemManage.ts
浏览文件 @
db9c4851
...
@@ -7,6 +7,7 @@ import {
...
@@ -7,6 +7,7 @@ import {
editAddressType
,
editAddressType
,
getCompanyInfoByIdType
,
getCompanyInfoByIdType
,
getSecondDistrictInfo
,
getSecondDistrictInfo
,
getUserAddressInfoType
,
insertBAccountType
,
insertBAccountType
,
insertRoleInfoType
,
insertRoleInfoType
,
listBAccountPageType
,
listBAccountPageType
,
...
@@ -119,4 +120,7 @@ export class SystemManageAPI {
...
@@ -119,4 +120,7 @@ export class SystemManageAPI {
// 地址管理-删除
// 地址管理-删除
static
deleteAddress
:
deleteAddressType
=
(
params
)
=>
static
deleteAddress
:
deleteAddressType
=
(
params
)
=>
axios
.
get
(
'/oms/user-address/deleteById'
,
{
params
});
axios
.
get
(
'/oms/user-address/deleteById'
,
{
params
});
// 地址管理-根据地址id查找
static
getUserAddressInfo
:
getUserAddressInfoType
=
(
params
)
=>
axios
.
get
(
'/oms/user-address/getUserAddressInfo'
,
{
params
});
}
}
src/pages/rentManage/rentGoods/rentAddOrEdit/components/addressInfo/index.tsx
浏览文件 @
db9c4851
...
@@ -104,6 +104,17 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -104,6 +104,17 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
const
addOrEditAddressModalCancel
=
()
=>
{
const
addOrEditAddressModalCancel
=
()
=>
{
setAddOrEditAddressModalShow
(
false
);
setAddOrEditAddressModalShow
(
false
);
};
};
// 获取地址
const
getUserAddressInfo
=
(
userAddressId
:
number
,
key
:
string
)
=>
{
SystemManageAPI
.
getUserAddressInfo
({
userAddressId
}).
then
(({
result
})
=>
{
addressInfoForm
.
setFieldValue
(
key
,
result
.
takeName
+
result
.
takePhone
+
`(
${
result
.
takeRegion
.
split
(
'/'
).
join
(
''
)
+
result
.
takeAddress
}
)`
,
);
});
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getAddressList
();
getAddressList
();
...
@@ -113,9 +124,9 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -113,9 +124,9 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
rentGoodsDetails
)
{
if
(
rentGoodsDetails
)
{
getUserAddressInfo
(
rentGoodsDetails
.
shipAddress
,
'shipAddress'
);
getUserAddressInfo
(
rentGoodsDetails
.
returnAddress
,
'returnAddress'
);
addressInfoForm
.
setFieldsValue
({
addressInfoForm
.
setFieldsValue
({
shipAddress
:
rentGoodsDetails
.
shipAddress
,
returnAddress
:
rentGoodsDetails
.
returnAddress
,
logisticsCompany
:
rentGoodsDetails
.
logisticsCompany
,
logisticsCompany
:
rentGoodsDetails
.
logisticsCompany
,
modeOfDelivery
:
rentGoodsDetails
.
modeOfDelivery
,
modeOfDelivery
:
rentGoodsDetails
.
modeOfDelivery
,
});
});
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/components/goodsInfo/index.tsx
浏览文件 @
db9c4851
...
@@ -68,7 +68,7 @@ const GoodsInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -68,7 +68,7 @@ const GoodsInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
<
Input
placeholder=
'请输入商品标题'
maxLength=
{
30
}
/>
<
Input
placeholder=
'请输入商品标题'
maxLength=
{
30
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
'
商品卖点
'
label=
'
营销短语
'
name=
'sellingPoint'
name=
'sellingPoint'
rules=
{
[{
required
:
true
,
message
:
'请输入商品卖点'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入商品卖点'
}]
}
>
>
...
...
src/pages/rentManage/rentGoods/rentDetail/index.tsx
浏览文件 @
db9c4851
...
@@ -59,17 +59,21 @@ const RentDetail = () => {
...
@@ -59,17 +59,21 @@ const RentDetail = () => {
key
:
string
;
key
:
string
;
}[]
}[]
>
([]);
>
([]);
const
[
addressOptionList
,
setAddressOptionList
]
=
useState
<
{
label
:
string
;
value
:
number
;
districtCode
:
string
}[]
>
([]);
const
[
expressOptionList
,
setExpressOptionList
]
=
useState
<
{
label
:
string
;
value
:
string
}[]
>
(
const
[
expressOptionList
,
setExpressOptionList
]
=
useState
<
{
label
:
string
;
value
:
string
}[]
>
(
[],
[],
);
);
// 寄出地址跟归还地址str
const
[
addressStr
,
setAddressStr
]
=
useState
<
any
>
({
shipAddress
:
''
,
returnAddress
:
''
,
});
//获取租赁商品详情
//获取租赁商品详情
const
getRentGoodsDetail
=
(
id
:
number
)
=>
{
const
getRentGoodsDetail
=
(
id
:
number
)
=>
{
RentManageAPI
.
getLeaseGoodsDetails
({
id
}).
then
(({
result
})
=>
{
RentManageAPI
.
getLeaseGoodsDetails
({
id
}).
then
(({
result
})
=>
{
if
(
result
)
{
if
(
result
)
{
getAddressStr
(
result
.
shipAddress
,
'shipAddress'
);
getAddressStr
(
result
.
returnAddress
,
'returnAddress'
);
setRentGoodsDetails
({
...
result
});
setRentGoodsDetails
({
...
result
});
//转化数据
//转化数据
const
covertSpecAttrList
=
result
.
specAttrList
.
map
((
v
,
index
)
=>
({
const
covertSpecAttrList
=
result
.
specAttrList
.
map
((
v
,
index
)
=>
({
...
@@ -174,19 +178,6 @@ const RentDetail = () => {
...
@@ -174,19 +178,6 @@ const RentDetail = () => {
}
}
});
});
};
};
//地址列表
const
getAddressList
=
()
=>
{
SystemManageAPI
.
getAddressList
({}).
then
(({
result
})
=>
{
if
(
result
)
{
const
optionList
=
result
.
map
((
v
)
=>
({
label
:
v
.
takeName
+
v
.
takePhone
+
`(
${
v
.
takeRegion
.
split
(
'/'
).
join
(
''
)
+
v
.
takeAddress
}
)`
,
value
:
v
.
id
,
districtCode
:
v
.
districtCode
,
}));
setAddressOptionList
(
optionList
);
}
});
};
//物流公司列表
//物流公司列表
const
getListExpressInfo
=
()
=>
{
const
getListExpressInfo
=
()
=>
{
OrderManageAPI
.
listExpressInfo
().
then
(({
result
})
=>
{
OrderManageAPI
.
listExpressInfo
().
then
(({
result
})
=>
{
...
@@ -199,6 +190,16 @@ const RentDetail = () => {
...
@@ -199,6 +190,16 @@ const RentDetail = () => {
}
}
});
});
};
};
// 地址名称
const
getAddressStr
=
(
userAddressId
:
number
,
key
:
string
)
=>
{
SystemManageAPI
.
getUserAddressInfo
({
userAddressId
}).
then
(({
result
})
=>
{
addressStr
[
key
]
=
result
.
takeName
+
result
.
takePhone
+
`(
${
result
.
takeRegion
.
split
(
'/'
).
join
(
''
)
+
result
.
takeAddress
}
)`
;
setAddressStr
({
...
addressStr
});
});
};
//返回
//返回
const
backRoute
=
()
=>
{
const
backRoute
=
()
=>
{
...
@@ -207,7 +208,6 @@ const RentDetail = () => {
...
@@ -207,7 +208,6 @@ const RentDetail = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
getLeaseTermInfo
();
getLeaseTermInfo
();
getAddressList
();
getListExpressInfo
();
getListExpressInfo
();
},
[]);
},
[]);
...
@@ -327,12 +327,8 @@ const RentDetail = () => {
...
@@ -327,12 +327,8 @@ const RentDetail = () => {
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
<
Descriptions
title=
'物流信息'
bordered
column=
{
2
}
style=
{
{
marginTop
:
'10px'
}
}
>
<
Descriptions
title=
'物流信息'
bordered
column=
{
2
}
style=
{
{
marginTop
:
'10px'
}
}
>
<
Descriptions
.
Item
label=
'发货地址'
>
<
Descriptions
.
Item
label=
'发货地址'
>
{
addressStr
.
shipAddress
}
</
Descriptions
.
Item
>
{
addressOptionList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
shipAddress
)?.
label
}
<
Descriptions
.
Item
label=
'归还地址'
>
{
addressStr
.
returnAddress
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'归还地址'
>
{
addressOptionList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
returnAddress
)?.
label
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'寄出物流'
>
<
Descriptions
.
Item
label=
'寄出物流'
>
{
expressOptionList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
logisticsCompany
)?.
label
}
{
expressOptionList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
logisticsCompany
)?.
label
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论