优化单据扫码时候明细滚动条的下滑逻辑
This commit is contained in:
@@ -90,12 +90,12 @@
|
|||||||
|
|
||||||
<!-- 动态生成tr -->
|
<!-- 动态生成tr -->
|
||||||
<template v-for="(row,rowIndex) in rows">
|
<template v-for="(row,rowIndex) in rows">
|
||||||
<!-- tr 只加载可见的和预加载的总共十条数据 -->
|
<!-- tr 如果超出200条,则只加载可见的和预加载的总共十条数据 -->
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="rows.length<=200 ||
|
||||||
|
(rows.length>200 &&
|
||||||
rowIndex >= parseInt(`${(scrollTop-rowHeight) / rowHeight}`) &&
|
rowIndex >= parseInt(`${(scrollTop-rowHeight) / rowHeight}`) &&
|
||||||
(parseInt(`${scrollTop / rowHeight}`) + 9) > rowIndex
|
(parseInt(`${scrollTop / rowHeight}`) + 9) > rowIndex)"
|
||||||
"
|
|
||||||
:id="`${caseId}tbody-tr-${rowIndex}`"
|
:id="`${caseId}tbody-tr-${rowIndex}`"
|
||||||
:data-idx="rowIndex"
|
:data-idx="rowIndex"
|
||||||
class="tr"
|
class="tr"
|
||||||
|
|||||||
@@ -797,6 +797,7 @@ export const BillModalMixin = {
|
|||||||
},
|
},
|
||||||
//扫码之后回车
|
//扫码之后回车
|
||||||
scanPressEnter() {
|
scanPressEnter() {
|
||||||
|
let that = this
|
||||||
if(this.scanBarCode) {
|
if(this.scanBarCode) {
|
||||||
this.getAllTable().then(tables => {
|
this.getAllTable().then(tables => {
|
||||||
return getListData(this.form, tables)
|
return getListData(this.form, tables)
|
||||||
@@ -910,6 +911,10 @@ export const BillModalMixin = {
|
|||||||
//置空扫码的内容
|
//置空扫码的内容
|
||||||
this.scanBarCode = ''
|
this.scanBarCode = ''
|
||||||
this.$refs.scanBarCode.focus()
|
this.$refs.scanBarCode.focus()
|
||||||
|
//自动下滑到最后一行
|
||||||
|
setTimeout(function(){
|
||||||
|
that.$refs.materialDataTable.resetScrollTop((newDetailArr.length+1)*that.$refs.materialDataTable.rowHeight)
|
||||||
|
},1000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user