Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
ccefd1c9
Commit
ccefd1c9
authored
Nov 16, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善售后查看多物流功能
parent
8ce355f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
39 deletions
+93
-39
LogisticsRecordModal.jsx
...pages/AfterSaleManage/components/LogisticsRecordModal.jsx
+33
-20
index.jsx
src/pages/AfterSaleManage/index.jsx
+24
-19
index.less
src/pages/AfterSaleManage/index.less
+21
-0
services.js
src/pages/AfterSaleManage/services.js
+15
-0
No files found.
src/pages/AfterSaleManage/components/LogisticsRecordModal.jsx
View file @
ccefd1c9
import
React
,
{
useState
,
forwardRef
,
useImperativeHandle
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
forwardRef
,
useImperativeHandle
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Timeline
,
notification
,
Spin
}
from
'
antd
'
;
import
{
Modal
,
Timeline
,
notification
,
Spin
}
from
'
antd
'
;
import
{
getLogisticsRecord
}
from
'
../services
'
;
import
{
getLogisticsRecord
,
apiDeliveriesTraceList
}
from
'
../services
'
;
import
styles
from
'
../index.less
'
;
const
LogisticsRecordModal
=
(
props
,
ref
)
=>
{
const
LogisticsRecordModal
=
(
props
,
ref
)
=>
{
// const { } = props;
// const { } = props;
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
result
,
setResult
]
=
useState
({});
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
dataList
,
setDataList
]
=
useState
([]);
const
getRecordList
=
async
orderNo
=>
{
const
getRecordList
=
async
orderNo
=>
{
const
tempObj
=
{
const
tempObj
=
{
...
@@ -15,19 +16,14 @@ const LogisticsRecordModal = (props, ref) => {
...
@@ -15,19 +16,14 @@ const LogisticsRecordModal = (props, ref) => {
key
:
Date
.
now
(),
key
:
Date
.
now
(),
};
};
setLoading
(
true
);
setLoading
(
true
);
const
res
=
await
getLogisticsRecord
({
orderNo
});
const
res
=
await
apiDeliveriesTraceList
({
orderNo
});
setLoading
(
false
);
setLoading
(
false
);
if
(
!
res
)
{
if
(
!
res
)
{
notification
.
info
({
message
:
'
暂无物流信息
'
});
notification
.
info
({
message
:
'
暂无物流信息
'
});
return
;
return
;
}
}
const
{
logisticsName
,
logisticsBillNo
,
logisticsList
=
[]
}
=
res
.
data
;
tempObj
.
expressCompanyName
=
logisticsName
;
setDataList
(
res
.
data
);
tempObj
.
deliveryNo
=
logisticsBillNo
;
logisticsList
.
forEach
(
v
=>
{
tempObj
.
detailList
=
[...
tempObj
.
detailList
,
...
v
.
detailList
];
});
setResult
(
tempObj
);
};
};
const
open
=
orderNo
=>
{
const
open
=
orderNo
=>
{
...
@@ -36,7 +32,9 @@ const LogisticsRecordModal = (props, ref) => {
...
@@ -36,7 +32,9 @@ const LogisticsRecordModal = (props, ref) => {
};
};
const
onCancel
=
()
=>
{
const
onCancel
=
()
=>
{
setVisible
(
false
);
setVisible
(
false
);
setResult
([]);
setTimeout
(()
=>
{
setDataList
([]);
},
1000
);
};
};
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
open
,
open
,
...
@@ -59,15 +57,30 @@ const LogisticsRecordModal = (props, ref) => {
...
@@ -59,15 +57,30 @@ const LogisticsRecordModal = (props, ref) => {
return
(
return
(
<
Modal
{
...
modalProps
}
>
<
Modal
{
...
modalProps
}
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
{
result
.
detailList
?.
length
?
(
{
dataList
.
length
?
(
<
Timeline
>
dataList
.
map
((
dataItem
,
dataIndex
)
=>
(
{
result
?.
detailList
?.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
[
'
logistics-record
'
]
}
>
<
Timeline
.
Item
color=
{
index
>
0
?
'
gray
'
:
'
blue
'
}
key=
{
index
.
toString
()
}
>
<
div
className=
{
styles
[
'
logistics-record__topbar
'
]
}
>
包裹
{
dataIndex
+
1
}
</
div
>
<
p
>
{
item
.
desc
}
</
p
>
<
div
className=
{
styles
[
'
logistics-record__head
'
]
}
>
<
p
>
{
item
.
logisticsTime
}
</
p
>
<
span
className=
{
styles
.
name
}
>
物流公司:
{
dataItem
.
expressCompanyName
}
</
span
>
</
Timeline
.
Item
>
<
span
className=
{
styles
.
no
}
>
物流单号:
{
dataItem
.
expressNo
}
</
span
>
))
}
</
div
>
</
Timeline
>
{
dataItem
.
traceList
.
map
(
traceItem
=>
(
<
Timeline
>
{
traceItem
?.
detailList
.
length
?
(
traceItem
?.
detailList
?.
map
((
item
,
index
)
=>
(
<
Timeline
.
Item
color=
{
index
>
0
?
'
gray
'
:
'
blue
'
}
key=
{
index
.
toString
()
}
>
<
p
>
{
item
.
desc
}
</
p
>
<
p
>
{
item
.
time
}
</
p
>
</
Timeline
.
Item
>
))
)
:
(
<
div
style=
{
emptyStyle
}
>
暂无物流信息
</
div
>
)
}
</
Timeline
>
))
}
</
div
>
))
)
:
(
)
:
(
<
div
style=
{
emptyStyle
}
>
暂无物流信息
</
div
>
<
div
style=
{
emptyStyle
}
>
暂无物流信息
</
div
>
)
}
)
}
...
...
src/pages/AfterSaleManage/index.jsx
View file @
ccefd1c9
...
@@ -16,6 +16,7 @@ import RejectModal from './components/rejectModal';
...
@@ -16,6 +16,7 @@ import RejectModal from './components/rejectModal';
import
LogisticsCom
from
'
../orderManage/pendingDeliveryOrder/components/LogisticsCom
'
;
import
LogisticsCom
from
'
../orderManage/pendingDeliveryOrder/components/LogisticsCom
'
;
import
CancelAuditModal
from
'
./components/CancelAuditModal
'
;
import
CancelAuditModal
from
'
./components/CancelAuditModal
'
;
import
CancelDetailTable
from
'
./components/CancelDetailTable
'
;
import
CancelDetailTable
from
'
./components/CancelDetailTable
'
;
import
LogisticsRecordModal
from
'
./components/LogisticsRecordModal
'
;
import
{
getColumns
,
getFormConfig
,
TAB_MAPPING_DATA
}
from
'
./data.js
'
;
import
{
getColumns
,
getFormConfig
,
TAB_MAPPING_DATA
}
from
'
./data.js
'
;
import
{
getDetail
}
from
'
@/pages/afterSale/appeal/services
'
;
import
{
getDetail
}
from
'
@/pages/afterSale/appeal/services
'
;
...
@@ -44,6 +45,7 @@ const AfterSale = props => {
...
@@ -44,6 +45,7 @@ const AfterSale = props => {
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
formRef
=
useRef
();
const
formRef
=
useRef
();
const
logisticsRecordModalRef
=
useRef
();
const
[
tableParams
,
setTableParams
]
=
useState
({});
const
[
tableParams
,
setTableParams
]
=
useState
({});
const
[
currentTab
,
setCurrentTab
]
=
useState
(
''
);
const
[
currentTab
,
setCurrentTab
]
=
useState
(
''
);
// const [appealDetailModal, setAppealDetailModal] = useState(false);
// const [appealDetailModal, setAppealDetailModal] = useState(false);
...
@@ -132,25 +134,26 @@ const AfterSale = props => {
...
@@ -132,25 +134,26 @@ const AfterSale = props => {
};
};
// 查看物流
// 查看物流
const
handleCom
=
async
({
expressCompanyCode
,
deliveryNo
})
=>
{
const
handleCom
=
async
({
orderNo
})
=>
{
const
tempObj
=
{
logisticsRecordModalRef
.
current
.
open
(
orderNo
);
detailList
:
[],
// const tempObj = {
key
:
Date
.
now
(),
// detailList: [],
};
// key: Date.now(),
const
data
=
await
trackInfo
({
expressCompanyCode
,
logisticsNo
:
deliveryNo
});
// };
if
(
!
data
)
{
// const data = await trackInfo({ expressCompanyCode, logisticsNo: deliveryNo });
notification
.
info
({
message
:
'
暂无物流信息
'
});
// if (!data) {
return
;
// notification.info({ message: '暂无物流信息' });
}
// return;
tempObj
.
expressCompanyName
=
data
.
logisticsName
;
// }
tempObj
.
deliveryNo
=
data
.
logisticsBillNo
;
// tempObj.expressCompanyName = data.logisticsName;
if
(
data
.
logisticsList
?.
length
)
{
// tempObj.deliveryNo = data.logisticsBillNo;
data
.
logisticsList
.
forEach
(
v
=>
{
// if (data.logisticsList?.length) {
tempObj
.
detailList
=
[...
tempObj
.
detailList
,
...
v
.
detailList
];
// data.logisticsList.forEach(v => {
});
// tempObj.detailList = [...tempObj.detailList, ...v.detailList];
}
// });
setLogisticsComModalVisible
(
true
);
// }
setLogisticsComList
(
tempObj
);
// setLogisticsComModalVisible(true);
// setLogisticsComList(tempObj);
};
};
// 物流拦截
// 物流拦截
...
@@ -439,6 +442,8 @@ const AfterSale = props => {
...
@@ -439,6 +442,8 @@ const AfterSale = props => {
onCancel=
{
closeModal
}
onCancel=
{
closeModal
}
dataSource=
{
cancelDetailInfo
}
dataSource=
{
cancelDetailInfo
}
/>
/>
<
LogisticsRecordModal
ref=
{
logisticsRecordModalRef
}
/>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
);
);
};
};
...
...
src/pages/AfterSaleManage/index.less
View file @
ccefd1c9
...
@@ -59,3 +59,24 @@
...
@@ -59,3 +59,24 @@
}
}
}
}
}
}
.logistics-record {
&__topbar {
margin-bottom: 15px;
padding-left: 10px;
color: #000;
font-weight: bold;
font-size: 16px;
border-left: 10px solid #2391fe;
}
&__head {
padding-bottom: 25px;
color: #000;
font-weight: 500;
font-size: 14px;
line-height: 1;
.no {
margin-left: 20px;
}
}
}
src/pages/AfterSaleManage/services.js
View file @
ccefd1c9
...
@@ -131,6 +131,21 @@ export async function getLogisticsRecord(params) {
...
@@ -131,6 +131,21 @@ export async function getLogisticsRecord(params) {
});
});
}
}
/**
* 多物流发货-查询物流轨迹
* @see http://yapi.quantgroups.com/project/389/interface/api/46120
*/
export
function
apiDeliveriesTraceList
(
data
)
{
return
request
.
post
(
'
/api/merchants/deliveries/trace/list
'
,
{
data
:
stringify
(
data
),
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
},
prefix
:
kdspApi
,
});
}
// 查询售后待办数量
// 查询售后待办数量
export
function
getAfterPendingNum
(
data
)
{
export
function
getAfterPendingNum
(
data
)
{
return
request
.
post
(
'
/api/kdsp/op/afs/getPendingNum
'
,
{
return
request
.
post
(
'
/api/kdsp/op/afs/getPendingNum
'
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment