Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-quality
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8645acc9
authored
May 20, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 查询导出增加日期限制
1 parent
c5021191
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
22 deletions
src/views/qualityManage/index.vue
src/views/qualityManage/index.vue
View file @
8645acc
...
@@ -161,6 +161,7 @@
...
@@ -161,6 +161,7 @@
import
{
Util
,
deepClone
}
from
'@/common/util'
import
{
Util
,
deepClone
}
from
'@/common/util'
import
url
from
'@/assets/empty.png'
import
url
from
'@/assets/empty.png'
import
ElInputRange
from
'./el-input-range'
import
ElInputRange
from
'./el-input-range'
import
dayjs
from
"dayjs"
export
default
{
export
default
{
components
:
{
components
:
{
ElInputRange
ElInputRange
...
@@ -455,10 +456,10 @@ export default {
...
@@ -455,10 +456,10 @@ export default {
}
}
return
data
return
data
},
},
beforeSearchFn
()
{
beforeSearchFn
(
type
)
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
,
reject
)
=>
{
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
if
(
this
.
searchForm
.
searchdate
.
length
)
{
if
(
this
.
searchForm
?.
searchdate
?
.
length
)
{
let
[
searchStartDate
,
searchEndDate
]
=
this
.
searchForm
.
searchdate
let
[
searchStartDate
,
searchEndDate
]
=
this
.
searchForm
.
searchdate
this
.
searchFormSearch
.
searchStartDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
searchStartDate
=
Util
.
dateFormate
(
searchStartDate
,
searchStartDate
,
...
@@ -468,6 +469,10 @@ export default {
...
@@ -468,6 +469,10 @@ export default {
searchEndDate
,
searchEndDate
,
"YYYY-MM-DD"
"YYYY-MM-DD"
)
)
const
date1
=
dayjs
(
searchStartDate
),
date2
=
dayjs
(
searchEndDate
),
day
=
date2
.
diff
(
date1
,
'day'
)
+
1
if
(
day
>
31
)
reject
(
`
${
type
==
1
?
'查询'
:
'导出'
}
的时间跨度最大为31天,请重新选择日期范围`
)
}
}
delete
this
.
searchFormSearch
.
searchdate
delete
this
.
searchFormSearch
.
searchdate
this
.
searchFormSearch
.
serviceMerchantNo
=
this
.
$globalState
.
session
.
merchantId
this
.
searchFormSearch
.
serviceMerchantNo
=
this
.
$globalState
.
session
.
merchantId
...
@@ -514,19 +519,24 @@ export default {
...
@@ -514,19 +519,24 @@ export default {
this
.
refreshTable
()
this
.
refreshTable
()
},
},
async
refreshTable
(
pageCon
)
{
async
refreshTable
(
pageCon
)
{
if
(
pageCon
)
this
.
pageConfig
=
pageCon
try
{
else
this
.
pageConfig
=
{
if
(
pageCon
)
this
.
pageConfig
=
pageCon
pageSize
:
10
,
else
this
.
pageConfig
=
{
pageNum
:
1
,
pageSize
:
10
,
pageNum
:
1
,
}
await
this
.
beforeSearchFn
(
1
)
const
{
total
,
list
}
=
await
this
.
$apis
.
quality
.
getReclistWithPage
({
...
this
.
pageConfig
,
...
this
.
searchFormSearch
})
this
.
$refs
.
qualityTable
.
page
=
this
.
pageConfig
this
.
restructureData
(
list
)
this
.
tableTotal
=
total
}
catch
(
error
)
{
console
.
log
(
error
)
if
(
error
)
this
.
$message
.
error
(
error
)
}
}
await
this
.
beforeSearchFn
()
const
{
total
,
list
}
=
await
this
.
$apis
.
quality
.
getReclistWithPage
({
...
this
.
pageConfig
,
...
this
.
searchFormSearch
})
this
.
$refs
.
qualityTable
.
page
=
this
.
pageConfig
this
.
restructureData
(
list
)
this
.
tableTotal
=
total
},
},
restructureData
(
data
)
{
restructureData
(
data
)
{
this
.
tableList
=
[]
this
.
tableList
=
[]
...
@@ -655,13 +665,17 @@ export default {
...
@@ -655,13 +665,17 @@ export default {
}
}
},
},
async
exportTable
()
{
async
exportTable
()
{
await
this
.
beforeSearchFn
()
try
{
const
res
=
await
this
.
$apis
.
quality
.
exportReclistList
({
await
this
.
beforeSearchFn
()
...
this
.
searchFormSearch
,
const
res
=
await
this
.
$apis
.
quality
.
exportReclistList
({
pageNum
:
1
,
...
this
.
searchFormSearch
,
pageSize
:
1000
pageNum
:
1
,
})
pageSize
:
1000
if
(
res
)
window
.
open
(
res
)
})
if
(
res
)
window
.
open
(
res
)
}
catch
(
error
)
{
if
(
error
)
this
.
$message
.
error
(
error
)
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment