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
8447bd23
Commit
8447bd23
authored
Nov 03, 2022
by
李腾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复售后订单管理的列表高度问题
parent
84801e00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
index.jsx
src/pages/AfterSaleManage/index.jsx
+9
-8
utils.js
src/utils/utils.js
+19
-0
No files found.
src/pages/AfterSaleManage/index.jsx
View file @
8447bd23
...
@@ -19,6 +19,7 @@ import CancelDetailTable from './components/CancelDetailTable';
...
@@ -19,6 +19,7 @@ import CancelDetailTable from './components/CancelDetailTable';
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
'
;
import
{
getClientInfo
}
from
'
@/utils/utils
'
;
import
{
import
{
searchList
,
searchList
,
logisticsIntercept
,
logisticsIntercept
,
...
@@ -40,7 +41,6 @@ const AfterSale = props => {
...
@@ -40,7 +41,6 @@ const AfterSale = props => {
const
{
permissions
}
=
props
;
const
{
permissions
}
=
props
;
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
];
const
canEditable
=
permissions
[
AFTER_SALE_ORDER
.
EDITABLE
];
const
location
=
useLocation
();
const
location
=
useLocation
();
const
[
pageQueryOrderNo
,
setPageQueryOrderNo
]
=
useState
(
location
.
query
?.
orderNo
||
''
);
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
formRef
=
useRef
();
const
formRef
=
useRef
();
...
@@ -284,12 +284,16 @@ const AfterSale = props => {
...
@@ -284,12 +284,16 @@ const AfterSale = props => {
}
}
},
[
location
]);
},
[
location
]);
const
calculationLayoutHeight
=
()
=>
{
// 动态计算表格滚动区域高度
setTableScrollY
(
scrollYRef
.
current
.
offsetTop
+
330
);
const
clientInfo
=
getClientInfo
();
const
calculationLayoutHeight
=
e
=>
{
const
otherHeight
=
typeof
e
===
'
number
'
?
e
:
330
;
const
h
=
clientInfo
.
height
-
scrollYRef
.
current
.
offsetTop
-
otherHeight
;
setTableScrollY
(
h
<
500
?
'
500px
'
:
h
);
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
setTableScrollY
(
scrollYRef
.
current
.
offsetTop
+
35
0
);
calculationLayoutHeight
(
33
0
);
},
[]);
},
[]);
window
.
removeEventListener
(
'
resize
'
,
calculationLayoutHeight
);
window
.
removeEventListener
(
'
resize
'
,
calculationLayoutHeight
);
...
@@ -316,7 +320,7 @@ const AfterSale = props => {
...
@@ -316,7 +320,7 @@ const AfterSale = props => {
columns
,
columns
,
params
:
tableParams
,
params
:
tableParams
,
bordered
:
true
,
bordered
:
true
,
scroll
:
{
x
:
'
100%
'
,
y
:
`calc(100vh -
${
tableScrollY
}
px)`
},
scroll
:
{
x
:
'
100%
'
,
y
:
tableScrollY
},
rowKey
:
r
=>
r
.
serviceNo
,
rowKey
:
r
=>
r
.
serviceNo
,
request
:
async
params
=>
{
request
:
async
params
=>
{
const
[
start
,
end
]
=
params
.
afterTime
||
afterTime
;
const
[
start
,
end
]
=
params
.
afterTime
||
afterTime
;
...
@@ -326,7 +330,6 @@ const AfterSale = props => {
...
@@ -326,7 +330,6 @@ const AfterSale = props => {
const
requestParams
=
{
const
requestParams
=
{
page
,
page
,
size
,
size
,
// orderNo: pageQueryOrderNo, // 首次请求需要直接使用 此方式,因为params中首次请求不存在orderNo
...
params
,
...
params
,
startDate
,
startDate
,
endDate
,
endDate
,
...
@@ -339,8 +342,6 @@ const AfterSale = props => {
...
@@ -339,8 +342,6 @@ const AfterSale = props => {
endDate
,
endDate
,
});
});
const
res
=
await
searchList
(
requestParams
);
const
res
=
await
searchList
(
requestParams
);
// 初始化获取订单编号后删除临时存储的订单编号
setPageQueryOrderNo
(
''
);
const
{
records
=
[],
total
}
=
res
.
data
;
const
{
records
=
[],
total
}
=
res
.
data
;
if
(
countRes
.
code
===
'
0000
'
)
{
if
(
countRes
.
code
===
'
0000
'
)
{
...
...
src/utils/utils.js
View file @
8447bd23
...
@@ -56,3 +56,22 @@ export function toThousands(data, num) {
...
@@ -56,3 +56,22 @@ export function toThousands(data, num) {
export
const
formatTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH:mm:ss
'
)
=>
time
.
format
(
crm
);
export
const
formatTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH:mm:ss
'
)
=>
time
.
format
(
crm
);
export
const
resetTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH:mm:ss
'
)
=>
moment
(
time
,
crm
);
export
const
resetTime
=
(
time
,
crm
=
'
YYYY-MM-DD HH:mm:ss
'
)
=>
moment
(
time
,
crm
);
export
const
getClientInfo
=
()
=>
{
if
(
window
.
innerHeight
!==
undefined
)
{
return
{
width
:
window
.
innerWidth
,
height
:
window
.
innerHeight
,
};
}
if
(
document
.
compatMode
===
'
CSS1Compat
'
)
{
return
{
width
:
document
.
documentElement
.
clientWidth
,
height
:
document
.
documentElement
.
clientHeight
,
};
}
return
{
width
:
document
.
body
.
clientWidth
,
height
:
document
.
body
.
clientHeight
,
};
};
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