Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 4fe9392f
authored
May 14, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复分页BUG
1 parent
607bca32
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
43 deletions
src/views/financeManage/theAssetData/components/importTwo.vue
src/views/financeManage/theAssetData/index.vue
src/views/financeManage/theAssetData/components/importTwo.vue
View file @
4fe9392
...
@@ -29,30 +29,7 @@
...
@@ -29,30 +29,7 @@
:loading=
"$store.state.d2admin.loading.value"
>
下一步
</el-button>
:loading=
"$store.state.d2admin.loading.value"
>
下一步
</el-button>
</div>
</div>
</div>
</div>
<!--
<div
class=
"header"
slot=
"header"
>
<d2-search
ref=
"showSearch"
class=
"show-search"
:search-form=
"searchForm"
:label-width=
"labelWidth"
:form-data=
"showFormData"
>
</d2-search>
<div
class=
"up-btns"
>
<el-button
@
click=
"handleSearch"
size=
"small"
type=
"primary"
>
查询
</el-button>
<el-button
size=
"small"
@
click=
"handleReset"
>
重置
</el-button>
</div>
</div>
-->
<div
class=
"d2-container-content"
>
<div
class=
"d2-container-content"
>
<!--
<d2-table-header>
<auth-button
category=
"Button"
/>
</d2-table-header>
-->
<d2-search
ref=
"showSearch"
<d2-search
ref=
"showSearch"
class=
"show-search"
class=
"show-search"
:search-form=
"searchForm"
:search-form=
"searchForm"
...
@@ -154,7 +131,7 @@
...
@@ -154,7 +131,7 @@
import
{
Util
,
deepClone
}
from
'@/common/util'
import
{
Util
,
deepClone
}
from
'@/common/util'
import
{
mapActions
,
mapState
,
mapMutations
}
from
'vuex'
import
{
mapActions
,
mapState
,
mapMutations
}
from
'vuex'
import
{
cdSignOpt
,
receiptStatusOpt
,
associationOpt
}
from
'@/common/constants.js'
import
{
cdSignOpt
,
receiptStatusOpt
,
associationOpt
}
from
'@/common/constants.js'
import
{
receiptImport
,
association
,
saveAssociation
}
from
'@api/theAssetData'
import
{
receiptImport
,
association
,
saveAssociation
,
getImportTask
}
from
'@api/theAssetData'
export
default
{
export
default
{
name
:
'ImportTwo'
,
name
:
'ImportTwo'
,
props
:
{
props
:
{
...
@@ -186,14 +163,20 @@ export default {
...
@@ -186,14 +163,20 @@ export default {
changeAttr
:
(
value
,
targetItem
)
=>
{
changeAttr
:
(
value
,
targetItem
)
=>
{
console
.
log
(
"value"
,
value
)
console
.
log
(
"value"
,
value
)
console
.
log
(
"this.allData"
,
this
.
allData
)
console
.
log
(
"this.allData"
,
this
.
allData
)
if
([
''
,
null
].
includes
(
value
))
{
this
.
filterData
=
null
}
else
{
if
(
value
==
0
)
{
if
(
value
==
0
)
{
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
!
item
.
receipt
)
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
!
item
.
receipt
)
this
.
filterData
=
this
.
allData
.
filter
(
item
=>
!
item
.
receipt
)
}
else
if
(
value
==
1
)
{
}
else
if
(
value
==
1
)
{
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
item
.
receipt
)
this
.
tableData
=
this
.
allData
.
filter
(
item
=>
item
.
receipt
)
this
.
filterData
=
this
.
allData
.
filter
(
item
=>
item
.
receipt
)
}
}
}
console
.
log
(
"this.tableData"
,
this
.
tableData
)
console
.
log
(
"this.tableData"
,
this
.
tableData
)
// this.total = this.tableData.length
this
.
page
.
currentPage
=
1
this
.
paginatedData
(
this
.
tableData
)
// 重新计算分页数据
this
.
paginatedData
()
// 重新计算分页数据
}
}
}],
}],
// getListApi: nbcbAccDetailPage,
// getListApi: nbcbAccDetailPage,
...
@@ -319,7 +302,7 @@ export default {
...
@@ -319,7 +302,7 @@ export default {
receiptCount
:
0
,
receiptCount
:
0
,
allData
:
[],
// 从后端获取的所有数据
allData
:
[],
// 从后端获取的所有数据
tableData
:
[],
// 当前展示的数据
tableData
:
[],
// 当前展示的数据
// tableData_filter: [], // 当前展示的数据备份,用来筛选
filterData
:
[],
// 当前筛选的数据
currentRow
:
null
,
currentRow
:
null
,
total
:
0
,
total
:
0
,
page
:
{
page
:
{
...
@@ -336,7 +319,7 @@ export default {
...
@@ -336,7 +319,7 @@ export default {
mounted
()
{
mounted
()
{
console
.
log
(
'taskInfo'
,
this
.
taskInfo
)
console
.
log
(
'taskInfo'
,
this
.
taskInfo
)
this
.
getBaseData
()
this
.
getBaseData
()
this
.
association
()
this
.
getImportTask
()
},
},
methods
:
{
methods
:
{
...
@@ -371,33 +354,46 @@ export default {
...
@@ -371,33 +354,46 @@ export default {
})
})
},
},
getImportTask
()
{
getImportTask
({
taskId
:
this
.
taskInfo
.
taskId
}).
then
(
res
=>
{
if
(
res
)
{
if
(
res
.
taskStatus
==
3
)
{
// 任务过期
this
.
$message
({
message
:
"当前任务已过期,请重新导入"
,
type
:
"warning"
,
showClose
:
true
})
}
else
{
this
.
association
()
}
}
})
},
association
()
{
association
()
{
association
({
taskId
:
this
.
taskInfo
.
taskId
}).
then
(
res
=>
{
association
({
taskId
:
this
.
taskInfo
.
taskId
}).
then
(
res
=>
{
this
.
allData
=
deepClone
(
res
)
this
.
allData
=
deepClone
(
res
)
// this.tableData = deepClone(res)
// this.tableData_filter = deepClone(res) // 用来筛选数据的备份
this
.
paginatedData
()
this
.
paginatedData
()
this
.
statReceiptCount
(
res
)
this
.
statReceiptCount
(
res
)
})
})
},
},
// 前端处理数据分页
// 前端处理数据分页
paginatedData
(
filterData
)
{
paginatedData
()
{
this
.
total
=
this
.
allData
.
length
console
.
log
(
'filterData'
,
this
.
filterData
)
// this.total = this.tableData.length
// this.tableData_filter = deepClone(this.tableData) // 用来筛选数据的备份
const
start
=
(
this
.
page
.
currentPage
-
1
)
*
this
.
page
.
pageSize
const
start
=
(
this
.
page
.
currentPage
-
1
)
*
this
.
page
.
pageSize
const
end
=
start
+
this
.
page
.
pageSize
const
end
=
start
+
this
.
page
.
pageSize
if
(
filterData
)
{
if
(
this
.
filterData
&&
this
.
filterData
.
length
>
0
)
{
// 筛选时以筛选的数据进行分页
this
.
tableData
=
filterData
.
slice
(
start
,
end
)
this
.
tableData
=
this
.
filterData
.
slice
(
start
,
end
)
this
.
total
=
this
.
filterData
.
length
}
else
{
}
else
{
this
.
tableData
=
this
.
allData
.
slice
(
start
,
end
)
this
.
tableData
=
this
.
allData
.
slice
(
start
,
end
)
this
.
total
=
this
.
allData
.
length
}
}
console
.
log
(
'start'
,
start
)
console
.
log
(
'start'
,
start
)
console
.
log
(
'end'
,
end
)
console
.
log
(
'end'
,
end
)
console
.
log
(
'this.tableData'
,
this
.
tableData
)
console
.
log
(
'this.tableData'
,
this
.
tableData
)
return
this
.
tableData
return
this
.
tableData
// return this.tableData.slice(start, end)
},
},
// 统计回单关联数
// 统计回单关联数
...
@@ -412,7 +408,6 @@ export default {
...
@@ -412,7 +408,6 @@ export default {
},
},
handleCurrentChange
(
newPage
)
{
handleCurrentChange
(
newPage
)
{
console
.
log
(
'newPage'
,
newPage
)
this
.
page
.
currentPage
=
newPage
// 更新当前页码,触发计算属性重新计算paginatedData
this
.
page
.
currentPage
=
newPage
// 更新当前页码,触发计算属性重新计算paginatedData
this
.
paginatedData
()
// 重新计算分页数据
this
.
paginatedData
()
// 重新计算分页数据
},
},
...
@@ -428,16 +423,13 @@ export default {
...
@@ -428,16 +423,13 @@ export default {
type
:
'warning'
,
type
:
'warning'
,
closeOnClickModal
:
false
closeOnClickModal
:
false
}).
then
(()
=>
{
}).
then
(()
=>
{
console
.
log
(
'row'
,
row
)
// 删除展示数组中对应的数据
// 删除展示数组中对应的数据
const
index
=
this
.
tableData
.
findIndex
(
item
=>
item
==
row
)
const
index
=
this
.
tableData
.
findIndex
(
item
=>
item
==
row
)
console
.
log
(
'index'
,
index
)
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
this
.
tableData
.
splice
(
index
,
1
)
this
.
tableData
.
splice
(
index
,
1
)
}
}
// 删除原始数组中对应的数据
// 删除原始数组中对应的数据
const
index2
=
this
.
allData
.
findIndex
(
item2
=>
item2
==
row
)
const
index2
=
this
.
allData
.
findIndex
(
item2
=>
item2
==
row
)
console
.
log
(
'index2'
,
index2
)
if
(
index2
!==
-
1
)
{
if
(
index2
!==
-
1
)
{
this
.
allData
.
splice
(
index2
,
1
)
this
.
allData
.
splice
(
index2
,
1
)
}
}
...
@@ -584,7 +576,6 @@ export default {
...
@@ -584,7 +576,6 @@ export default {
*/
*/
downLoadFile
:
function
(
url
)
{
downLoadFile
:
function
(
url
)
{
const
Temp
=
document
.
createElement
(
"a"
)
const
Temp
=
document
.
createElement
(
"a"
)
// url = url + `${url.includes('?') ? '&' : '?'}` + "timestamp=" + new Date().getTime()
Temp
.
href
=
url
Temp
.
href
=
url
document
.
body
.
append
(
Temp
)
document
.
body
.
append
(
Temp
)
Temp
.
click
()
Temp
.
click
()
...
...
src/views/financeManage/theAssetData/index.vue
View file @
4fe9392
...
@@ -481,7 +481,6 @@ export default {
...
@@ -481,7 +481,6 @@ export default {
watch
:
{
watch
:
{
taskStatus
:
{
taskStatus
:
{
handler
(
newVal
)
{
handler
(
newVal
)
{
console
.
log
(
'newVal'
,
newVal
)
if
(
newVal
==
1
||
newVal
==
2
||
newVal
==
3
)
{
// 任务失败、成功、过期时,应该停止轮询
if
(
newVal
==
1
||
newVal
==
2
||
newVal
==
3
)
{
// 任务失败、成功、过期时,应该停止轮询
this
.
stopPolling
()
this
.
stopPolling
()
}
}
...
...
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