bug修改

This commit is contained in:
jjLv 2025-08-22 13:56:35 +08:00
parent a243788a27
commit e33be099d4
3 changed files with 654 additions and 658 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,8 @@
@iconClick="search"
@keyup.enter.native="search"></uni-easyinput>
</view>
<uni-table :th-style="{backgroundColor:'#3c94fd'}" type="selection" @selection-change="selectChange" border stripe empty-text="暂无更多数据">
<uni-table ref="uniTable" :th-style="{backgroundColor:'#3c94fd'}" type="selection"
@selection-change="selectChange" border stripe empty-text="暂无更多数据">
<view class="tableHeader">
<uni-tr style="display:flex;width: 100%">
<uni-th align="center" style="width: 25vw">货品编码</uni-th>
@ -69,6 +70,7 @@ export default {
onLoad(options) {
console.log('options:', options)
this.form = options.form ? JSON.parse(decodeURIComponent(options.form)) : this.form
this.selectList = options.selectList ? JSON.parse(decodeURIComponent(options.selectList)) : []
console.log('form:', this.form)
this.getList()
},
@ -114,9 +116,21 @@ export default {
this.tableList.map(item => {
if (item.materialId === selectItem.materialId) {
item.checked = true
item.fetchNum = selectItem.fetchNum
}
})
})
this.$nextTick(() => {
if (this.$refs.uniTable) {
this.tableList.forEach((item, index) => {
if (item.checked) {
this.$refs.uniTable.toggleRowSelection(index, true)
}
})
} else {
console.warn('uniTable未挂载或setSelection方法不存在')
}
})
this.status = this.total == this.tableList.length ? 'nomore' : 'loadmore'
} catch (error) {
console.log(error)

View File

@ -38,7 +38,7 @@ export default {
searchValue: '',
tableList: [],
pageNum: 1,
pageSize: 10,
pageSize: 100,
total: 0,
status: 'loadmore',
}
@ -85,8 +85,8 @@ export default {
}
},
handleImage(item) {
if (item.materialImage) {
return item.materialImage
if (item.imgUrl) {
return item.imgUrl
} else {
return '/static/images/handheld/ic_goods_img.jpg'
}