Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
d854adce
提交
d854adce
authored
8月 17, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into develop
上级
e7c56f3c
a60e37bb
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
197 行增加
和
63 行删除
+197
-63
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
goodsType.ts
src/api/interface/goodsType.ts
+1
-1
index.tsx
src/components/EditableCell/index.tsx
+7
-1
index.tsx
.../rentGoods/rentAddOrEdit/components/addressInfo/index.tsx
+2
-1
index.tsx
...ge/rentGoods/rentAddOrEdit/components/goodsInfo/index.tsx
+3
-22
index.tsx
...age/rentGoods/rentAddOrEdit/components/rentAttr/index.tsx
+3
-2
index.tsx
...nage/rentGoods/rentAddOrEdit/components/skuInfo/index.tsx
+4
-2
index.tsx
src/pages/rentManage/rentGoods/rentAddOrEdit/index.tsx
+47
-23
index.tsx
src/pages/rentManage/rentGoods/rentDetail/index.tsx
+46
-7
index.tsx
src/pages/rentManage/rentGoods/rentList/index.tsx
+59
-3
dictionary.ts
src/utils/dictionary.ts
+24
-0
没有找到文件。
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
d854adce
...
@@ -14,4 +14,4 @@ patches:
...
@@ -14,4 +14,4 @@ patches:
images
:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag
:
8e162d9be47276998aa054b173a062ef1e4b785c
newTag
:
e93cd2127c17031785d384d0ca57c4cb67271978
src/api/interface/goodsType.ts
浏览文件 @
d854adce
...
@@ -162,7 +162,7 @@ export type editMallGoodsType = InterFunction<goodsItemType & { id: number }, an
...
@@ -162,7 +162,7 @@ export type editMallGoodsType = InterFunction<goodsItemType & { id: number }, an
//商品-列表(新)
//商品-列表(新)
export
type
listPageGoodsInfoType
=
InterItemFunction
<
export
type
listPageGoodsInfoType
=
InterItemFunction
<
{
categoryPrimaryId
?:
number
;
tradeName
?:
string
;
shelfStatus
?:
number
},
{
categoryPrimaryId
?:
number
;
tradeName
?:
string
;
shelfStatus
?:
number
},
goodsItemType
&
{
id
:
number
}
[]
(
goodsItemType
&
{
id
:
number
})
[]
>
;
>
;
//商城-详情(新)
//商城-详情(新)
export
type
mallGoodsDetailsType
=
InterFunction
<
{
id
:
number
},
goodsItemType
&
{
id
:
number
}
>
;
export
type
mallGoodsDetailsType
=
InterFunction
<
{
id
:
number
},
goodsItemType
&
{
id
:
number
}
>
;
src/components/EditableCell/index.tsx
浏览文件 @
d854adce
...
@@ -91,7 +91,13 @@ const EditableCell: React.FC<
...
@@ -91,7 +91,13 @@ const EditableCell: React.FC<
return
(
return
(
<
td
{
...
restProps
}
>
<
td
{
...
restProps
}
>
{
editing
?
(
{
editing
?
(
<
Form
.
Item
name=
{
dataIndex
+
record
.
id
}
style=
{
{
margin
:
0
}
}
rules=
{
rules
}
>
<
Form
.
Item
name=
{
dataIndex
+
record
.
id
}
style=
{
{
margin
:
0
}
}
rules=
{
rules
}
//valuePropName:当 form setFieldsValue 设置switch不生效时
valuePropName=
{
inputType
===
'switch'
?
'checked'
:
''
}
>
{
inputNode
()
}
{
inputNode
()
}
</
Form
.
Item
>
</
Form
.
Item
>
)
:
(
)
:
(
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/components/addressInfo/index.tsx
浏览文件 @
d854adce
...
@@ -37,6 +37,7 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -37,6 +37,7 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
addressInfoFormSubmit
,
addressInfoFormSubmit
,
getForm
:
()
=>
addressInfoForm
,
}));
}));
//地址列表
//地址列表
...
@@ -89,7 +90,7 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -89,7 +90,7 @@ const AddressInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
?.
districtCode
,
?.
districtCode
,
});
});
})
})
.
then
((
err
)
=>
{
.
catch
((
err
)
=>
{
reject
(
err
);
reject
(
err
);
});
});
});
});
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/components/goodsInfo/index.tsx
浏览文件 @
d854adce
...
@@ -3,6 +3,7 @@ import './index.scss';
...
@@ -3,6 +3,7 @@ import './index.scss';
import
{
forwardRef
,
useEffect
,
useImperativeHandle
}
from
'react'
;
import
{
forwardRef
,
useEffect
,
useImperativeHandle
}
from
'react'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
leaseGoodsDetailsType
}
from
'~/api/interface/rentManageType'
;
import
{
leaseGoodsDetailsType
}
from
'~/api/interface/rentManageType'
;
import
{
qualityList
}
from
'~/utils/dictionary'
;
//租赁商品详情返回类型
//租赁商品详情返回类型
type
rentGoodsDetailType
=
InterDataType
<
leaseGoodsDetailsType
>
;
type
rentGoodsDetailType
=
InterDataType
<
leaseGoodsDetailsType
>
;
...
@@ -18,32 +19,11 @@ interface selfProps {
...
@@ -18,32 +19,11 @@ interface selfProps {
}
}
const
GoodsInfo
=
forwardRef
<
any
,
selfProps
>
(({
rentGoodsDetails
},
ref
)
=>
{
const
GoodsInfo
=
forwardRef
<
any
,
selfProps
>
(({
rentGoodsDetails
},
ref
)
=>
{
const
qualityList
=
[
{
label
:
'全新'
,
value
:
0
,
},
{
label
:
'99新'
,
value
:
1
,
},
{
label
:
'95新'
,
value
:
2
,
},
{
label
:
'90新'
,
value
:
3
,
},
{
label
:
'80新'
,
value
:
4
,
},
];
const
[
form
]
=
Form
.
useForm
<
goodsInfoForm
>
();
const
[
form
]
=
Form
.
useForm
<
goodsInfoForm
>
();
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
submitGoodsInfoForm
,
submitGoodsInfoForm
,
getForm
:
()
=>
form
,
}));
}));
const
submitGoodsInfoForm
=
()
=>
{
const
submitGoodsInfoForm
=
()
=>
{
...
@@ -54,6 +34,7 @@ const GoodsInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -54,6 +34,7 @@ const GoodsInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
resolve
(
value
);
resolve
(
value
);
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
'商品信息错误--->'
,
error
);
reject
(
error
);
reject
(
error
);
});
});
});
});
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/components/rentAttr/index.tsx
浏览文件 @
d854adce
...
@@ -145,6 +145,7 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -145,6 +145,7 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
submitAttrForm
,
submitAttrForm
,
getForm
:
()
=>
rentAttrForm
,
}));
}));
//商品参数新增
//商品参数新增
...
@@ -275,8 +276,8 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -275,8 +276,8 @@ const RentAttr = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
values
[
0
],
...
values
[
0
],
productParam
:
values
[
1
].
length
?
JSON
.
stringify
(
values
[
1
])
:
undefined
,
productParam
:
values
[
1
].
length
?
JSON
.
stringify
(
values
[
1
])
:
undefined
,
});
});
}
catch
(
e
)
{
}
catch
(
e
rror
:
any
)
{
return
Promise
.
reject
(
e
);
return
Promise
.
reject
(
e
rror
);
}
}
};
};
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/components/skuInfo/index.tsx
浏览文件 @
d854adce
...
@@ -140,6 +140,8 @@ const SkuInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -140,6 +140,8 @@ const SkuInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
getForm
:
()
=>
form
,
getForm
:
()
=>
form
,
skuFormSubmit
,
skuFormSubmit
,
getSpecificationValueForm
:
()
=>
commonSkuInfoRef
.
current
.
getSpecificationValueForm
(),
getSpecificationForm
:
()
=>
commonSkuInfoRef
.
current
.
getSpecificationForm
(),
}));
}));
const
updateTableData
=
(
tableData
:
any
)
=>
{
const
updateTableData
=
(
tableData
:
any
)
=>
{
...
@@ -314,8 +316,8 @@ const SkuInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
...
@@ -314,8 +316,8 @@ const SkuInfo = forwardRef<any, selfProps>(({ rentGoodsDetails }, ref) => {
showPrice
:
rentDateMinPrice
,
showPrice
:
rentDateMinPrice
,
});
});
}
}
}
catch
(
e
)
{
}
catch
(
e
rror
:
any
)
{
return
Promise
.
reject
(
e
);
return
Promise
.
reject
(
e
rror
);
}
}
};
};
//表头拆分及合并列
//表头拆分及合并列
...
...
src/pages/rentManage/rentGoods/rentAddOrEdit/index.tsx
浏览文件 @
d854adce
...
@@ -38,31 +38,55 @@ const RentAddOrEdit = () => {
...
@@ -38,31 +38,55 @@ const RentAddOrEdit = () => {
skuInfoRef
.
current
.
skuFormSubmit
(),
skuInfoRef
.
current
.
skuFormSubmit
(),
accessoryListRef
.
current
.
accessoryTableFormSubmit
(),
accessoryListRef
.
current
.
accessoryTableFormSubmit
(),
addressInfoRef
.
current
.
addressInfoFormSubmit
(),
addressInfoRef
.
current
.
addressInfoFormSubmit
(),
]).
then
((
values
)
=>
{
])
const
resourcesList
=
[
.
then
((
values
)
=>
{
{
type
:
0
,
url
:
values
[
1
].
mainImage
},
const
resourcesList
=
[
...(
values
[
1
].
subImage
?.
map
((
v
:
string
)
=>
({
type
:
1
,
url
:
v
}))
||
[]),
{
type
:
0
,
url
:
values
[
1
].
mainImage
},
...(
values
[
1
].
goodsVideo
?
[{
type
:
2
,
url
:
values
[
1
].
goodsVideo
}]
:
[]),
...(
values
[
1
].
subImage
?.
map
((
v
:
string
)
=>
({
type
:
1
,
url
:
v
}))
||
[]),
];
...(
values
[
1
].
goodsVideo
?
[{
type
:
2
,
url
:
values
[
1
].
goodsVideo
}]
:
[]),
values
[
2
].
priceStock
=
values
[
2
].
priceStock
.
map
((
v
:
any
)
=>
({
];
...
v
,
values
[
2
].
priceStock
=
values
[
2
].
priceStock
.
map
((
v
:
any
)
=>
({
stockOut
:
v
.
stockOut
?
1
:
0
,
...
v
,
}));
stockOut
:
v
.
stockOut
?
1
:
0
,
RentManageAPI
[
rentGoodsId
?
'editLeaseGoods'
:
'addRentGoods'
]({
}));
...
values
[
0
],
RentManageAPI
[
rentGoodsId
?
'editLeaseGoods'
:
'addRentGoods'
]({
...
filterObjAttr
(
values
[
1
],
[
'goodsImage'
,
'goodsVideo'
]),
...
values
[
0
],
...
values
[
2
],
...
filterObjAttr
(
values
[
1
],
[
'goodsImage'
,
'goodsVideo'
]),
leasePartsList
:
values
[
3
],
...
values
[
2
],
...
values
[
4
],
leasePartsList
:
values
[
3
],
resourcesList
,
...
values
[
4
],
id
:
rentGoodsId
?
rentGoodsId
:
undefined
,
resourcesList
,
}).
then
(({
code
})
=>
{
id
:
rentGoodsId
?
rentGoodsId
:
undefined
,
if
(
code
===
'200'
)
{
}).
then
(({
code
})
=>
{
message
.
success
(
rentGoodsId
?
'编辑成功'
:
'新增成功'
);
if
(
code
===
'200'
)
{
navigate
(
-
1
);
message
.
success
(
rentGoodsId
?
'编辑成功'
:
'新增成功'
);
navigate
(
-
1
);
}
});
})
.
catch
((
error
:
any
)
=>
{
message
.
warning
(
error
.
errorFields
[
0
].
errors
[
0
]
||
error
);
if
(
error
?.
errorFields
)
{
goodsInfoRef
.
current
.
getForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
rentAttrRef
.
current
.
getForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
skuInfoRef
.
current
.
getForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
skuInfoRef
.
current
.
getSpecificationForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
skuInfoRef
.
current
.
getSpecificationValueForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
addressInfoRef
.
current
.
getForm
()
.
scrollToField
(
error
.
errorFields
[
0
].
name
[
0
],
{
behavior
:
'smooth'
});
}
}
});
});
});
};
};
//获取租赁商品详情
//获取租赁商品详情
...
...
src/pages/rentManage/rentGoods/rentDetail/index.tsx
浏览文件 @
d854adce
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
}
from
'~/api'
;
import
{
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'
;
//租赁商品详情返回类型
//租赁商品详情返回类型
type
rentGoodsDetailType
=
InterDataType
<
leaseGoodsDetailsType
>
;
type
rentGoodsDetailType
=
InterDataType
<
leaseGoodsDetailsType
>
;
...
@@ -57,6 +58,9 @@ const RentDetail = () => {
...
@@ -57,6 +58,9 @@ const RentDetail = () => {
key
:
string
;
key
:
string
;
}[]
}[]
>
([]);
>
([]);
const
[
addressOptionList
,
setAddressOptionList
]
=
useState
<
{
label
:
string
;
value
:
number
;
districtCode
:
string
}[]
>
([]);
//获取租赁商品详情
//获取租赁商品详情
const
getRentGoodsDetail
=
(
id
:
number
)
=>
{
const
getRentGoodsDetail
=
(
id
:
number
)
=>
{
...
@@ -166,6 +170,20 @@ const RentDetail = () => {
...
@@ -166,6 +170,20 @@ 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
backRoute
=
()
=>
{
const
backRoute
=
()
=>
{
navigate
(
-
1
);
navigate
(
-
1
);
...
@@ -173,6 +191,7 @@ const RentDetail = () => {
...
@@ -173,6 +191,7 @@ const RentDetail = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
getLeaseTermInfo
();
getLeaseTermInfo
();
getAddressList
();
},
[]);
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -195,7 +214,9 @@ const RentDetail = () => {
...
@@ -195,7 +214,9 @@ const RentDetail = () => {
>
>
<
Descriptions
.
Item
label=
'商品标题'
>
{
rentGoodsDetails
?.
tradeName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品标题'
>
{
rentGoodsDetails
?.
tradeName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品卖点'
>
{
rentGoodsDetails
?.
sellingPoint
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品卖点'
>
{
rentGoodsDetails
?.
sellingPoint
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品成新'
>
{
rentGoodsDetails
?.
level
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品成新'
>
{
qualityList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
level
)?.
label
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品状态'
>
<
Descriptions
.
Item
label=
'商品状态'
>
<
Badge
<
Badge
status=
{
rentGoodsDetails
?.
shelfStatus
?
'processing'
:
'default'
}
status=
{
rentGoodsDetails
?.
shelfStatus
?
'processing'
:
'default'
}
...
@@ -211,18 +232,26 @@ const RentDetail = () => {
...
@@ -211,18 +232,26 @@ const RentDetail = () => {
<
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
>
<
Descriptions
.
Item
label=
'商品副图'
span=
{
2
}
>
<
Descriptions
.
Item
label=
'商品副图'
span=
{
2
}
>
{
rentGoodsDetails
?.
resourcesList
.
filter
((
v
)
=>
v
.
type
===
1
).
length
{
rentGoodsDetails
?.
resourcesList
.
filter
((
v
)
=>
v
.
type
===
1
).
length
?
(
?
rentGoodsDetails
?.
resourcesList
<
Row
>
{
rentGoodsDetails
?.
resourcesList
.
filter
((
v
)
=>
v
.
type
===
1
)
.
filter
((
v
)
=>
v
.
type
===
1
)
.
map
((
v
)
=>
<
Image
src=
{
v
.
url
}
width=
{
50
}
height=
{
50
}
key=
{
v
.
id
}
/>)
.
map
((
v
)
=>
(
:
'暂无'
}
<
Col
key=
{
v
.
id
}
offset=
{
1
}
>
<
Image
src=
{
v
.
url
}
width=
{
50
}
height=
{
50
}
/>
</
Col
>
))
}
</
Row
>
)
:
(
'暂无'
)
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'商品视频'
>
<
Descriptions
.
Item
label=
'商品视频'
>
{
rentGoodsDetails
?.
resourcesList
.
find
((
v
)
=>
v
.
type
===
2
)?.
url
?
(
{
rentGoodsDetails
?.
resourcesList
.
find
((
v
)
=>
v
.
type
===
2
)?.
url
?
(
<
video
<
video
src=
{
rentGoodsDetails
?.
resourcesList
.
find
((
v
)
=>
v
.
type
===
2
)?.
url
}
src=
{
rentGoodsDetails
?.
resourcesList
.
find
((
v
)
=>
v
.
type
===
2
)?.
url
}
controls
controls
style=
{
{
width
:
'
100px'
,
height
:
'1
00px'
}
}
style=
{
{
width
:
'
200px'
,
height
:
'2
00px'
}
}
/>
/>
)
:
(
)
:
(
'暂无'
'暂无'
...
@@ -280,6 +309,16 @@ const RentDetail = () => {
...
@@ -280,6 +309,16 @@ const RentDetail = () => {
/>
/>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
<
Descriptions
title=
'物流信息'
bordered
column=
{
2
}
style=
{
{
marginTop
:
'10px'
}
}
>
<
Descriptions
.
Item
label=
'发货地址'
>
{
addressOptionList
.
find
((
v
)
=>
v
.
value
===
rentGoodsDetails
?.
shipAddress
)?.
label
}
</
Descriptions
.
Item
>
<
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
>
</
div
>
</
div
>
);
);
};
};
...
...
src/pages/rentManage/rentGoods/rentList/index.tsx
浏览文件 @
d854adce
...
@@ -6,13 +6,14 @@ import {
...
@@ -6,13 +6,14 @@ import {
DeleteOutlined
,
DeleteOutlined
,
PlusOutlined
,
PlusOutlined
,
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
use
Ref
,
use
State
}
from
'react'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
useNavigate
,
useSearchParams
}
from
'react-router-dom'
;
import
{
RentManageAPI
}
from
'../../../../api'
;
import
{
RentManageAPI
}
from
'../../../../api'
;
import
{
InterDataType
,
InterReqListType
,
PaginationProps
}
from
'../../../../api/interface'
;
import
{
InterDataType
,
InterReqListType
,
PaginationProps
}
from
'../../../../api/interface'
;
import
{
leaseGoodsListType
}
from
'../../../../api/interface/rentManageType'
;
import
{
leaseGoodsListType
}
from
'../../../../api/interface/rentManageType'
;
import
'./index.scss'
;
import
'./index.scss'
;
import
qs
from
'query-string'
;
//租赁列表返回类型
//租赁列表返回类型
type
rentGoodsType
=
InterDataType
<
leaseGoodsListType
>
[
'list'
];
type
rentGoodsType
=
InterDataType
<
leaseGoodsListType
>
[
'list'
];
...
@@ -20,7 +21,10 @@ type rentGoodsType = InterDataType<leaseGoodsListType>['list'];
...
@@ -20,7 +21,10 @@ type rentGoodsType = InterDataType<leaseGoodsListType>['list'];
type
rentGoodsParametersType
=
Exclude
<
InterReqListType
<
leaseGoodsListType
>
,
undefined
>
;
type
rentGoodsParametersType
=
Exclude
<
InterReqListType
<
leaseGoodsListType
>
,
undefined
>
;
const
RentList
=
()
=>
{
const
RentList
=
()
=>
{
const
searchRef
=
useRef
<
any
>
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
[
searchParams
,
setSearchParams
]
=
useSearchParams
();
//类型下拉列表
//类型下拉列表
const
[
rentTypeSelectList
,
setRentTypeSelectList
]
=
useState
<
{
label
:
string
;
value
:
number
}[]
>
(
const
[
rentTypeSelectList
,
setRentTypeSelectList
]
=
useState
<
{
label
:
string
;
value
:
number
}[]
>
(
...
@@ -169,6 +173,14 @@ const RentList = () => {
...
@@ -169,6 +173,14 @@ const RentList = () => {
pagination
.
pageSize
=
10
;
pagination
.
pageSize
=
10
;
setActiveTabKey
(
key
);
setActiveTabKey
(
key
);
query
.
shelfStatus
=
key
===
'1'
?
undefined
:
key
===
'2'
?
1
:
0
;
query
.
shelfStatus
=
key
===
'1'
?
undefined
:
key
===
'2'
?
1
:
0
;
setSearchParams
(
qs
.
stringify
({
pageNo
:
1
,
pageSize
:
10
,
...
query
,
shelfStatus
:
query
.
shelfStatus
===
undefined
?
'all'
:
query
.
shelfStatus
,
}),
);
setQuery
(
query
);
setQuery
(
query
);
getRentGoodsList
(
query
);
getRentGoodsList
(
query
);
};
};
...
@@ -194,11 +206,27 @@ const RentList = () => {
...
@@ -194,11 +206,27 @@ const RentList = () => {
pagination
.
pageNo
=
pageNo
;
pagination
.
pageNo
=
pageNo
;
pagination
.
pageSize
=
pageSize
;
pagination
.
pageSize
=
pageSize
;
getRentGoodsList
(
query
);
getRentGoodsList
(
query
);
setSearchParams
(
qs
.
stringify
({
pageNo
,
pageSize
,
...
query
,
shelfStatus
:
query
.
shelfStatus
===
undefined
?
'all'
:
query
.
shelfStatus
,
}),
);
};
};
//筛选
//筛选
const
searchSuccess
=
(
value
:
rentGoodsParametersType
)
=>
{
const
searchSuccess
=
(
value
:
rentGoodsParametersType
)
=>
{
pagination
.
pageNo
=
1
;
pagination
.
pageNo
=
1
;
pagination
.
pageSize
=
10
;
pagination
.
pageSize
=
10
;
setSearchParams
(
qs
.
stringify
({
pageNo
:
1
,
pageSize
:
10
,
...
value
,
shelfStatus
:
query
.
shelfStatus
===
undefined
?
'all'
:
query
.
shelfStatus
,
}),
);
setQuery
(
value
);
setQuery
(
value
);
getRentGoodsList
(
value
);
getRentGoodsList
(
value
);
};
};
...
@@ -278,7 +306,34 @@ const RentList = () => {
...
@@ -278,7 +306,34 @@ const RentList = () => {
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getRentGoodsList
();
pagination
.
pageNo
=
Number
(
searchParams
.
get
(
'pageNo'
))
||
1
;
pagination
.
pageSize
=
Number
(
searchParams
.
get
(
'pageSize'
))
||
10
;
const
searchData
=
{
tradeName
:
searchParams
.
get
(
'tradeName'
)
||
undefined
,
productTypeId
:
searchParams
.
get
(
'productTypeId'
)
?
Number
(
searchParams
.
get
(
'productTypeId'
))
:
undefined
,
brandInfoId
:
searchParams
.
get
(
'brandInfoId'
)
?
Number
(
searchParams
.
get
(
'brandInfoId'
))
:
undefined
,
shelfStatus
:
searchParams
.
get
(
'shelfStatus'
)
?
searchParams
.
get
(
'shelfStatus'
)
===
'all'
?
undefined
:
Number
(
searchParams
.
get
(
'shelfStatus'
))
:
undefined
,
};
searchRef
.
current
.
getForm
().
setFieldsValue
(
searchData
);
setActiveTabKey
(
searchParams
.
get
(
'shelfStatus'
)
?
searchParams
.
get
(
'shelfStatus'
)
===
'all'
?
'1'
:
Number
(
searchParams
.
get
(
'shelfStatus'
))
===
1
?
'2'
:
'3'
:
'1'
,
);
setQuery
(
searchData
);
getRentGoodsList
(
searchData
);
getRentTypeList
();
getRentTypeList
();
getRentMakeList
();
getRentMakeList
();
},
[]);
},
[]);
...
@@ -293,6 +348,7 @@ const RentList = () => {
...
@@ -293,6 +348,7 @@ const RentList = () => {
</
Button
>
</
Button
>
}
}
searchData=
{
searchSuccess
}
searchData=
{
searchSuccess
}
baseRef=
{
searchRef
}
/>
/>
<
Card
tabList=
{
tabList
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
onTabChange
}
>
<
Card
tabList=
{
tabList
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
onTabChange
}
>
<
div
className=
'table-operate'
style=
{
{
marginBottom
:
'10px'
}
}
>
<
div
className=
'table-operate'
style=
{
{
marginBottom
:
'10px'
}
}
>
...
...
src/utils/dictionary.ts
浏览文件 @
d854adce
...
@@ -37,3 +37,27 @@ export const splitCouponUseType = [
...
@@ -37,3 +37,27 @@ export const splitCouponUseType = [
label
:
'店铺券'
,
label
:
'店铺券'
,
},
},
];
];
//租赁-质量字典
export
const
qualityList
=
[
{
label
:
'全新'
,
value
:
0
,
},
{
label
:
'99新'
,
value
:
1
,
},
{
label
:
'95新'
,
value
:
2
,
},
{
label
:
'90新'
,
value
:
3
,
},
{
label
:
'80新'
,
value
:
4
,
},
];
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论