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" @iconClick="search"
@keyup.enter.native="search"></uni-easyinput> @keyup.enter.native="search"></uni-easyinput>
</view> </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"> <view class="tableHeader">
<uni-tr style="display:flex;width: 100%"> <uni-tr style="display:flex;width: 100%">
<uni-th align="center" style="width: 25vw">货品编码</uni-th> <uni-th align="center" style="width: 25vw">货品编码</uni-th>
@ -69,6 +70,7 @@ export default {
onLoad(options) { onLoad(options) {
console.log('options:', options) console.log('options:', options)
this.form = options.form ? JSON.parse(decodeURIComponent(options.form)) : this.form 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) console.log('form:', this.form)
this.getList() this.getList()
}, },
@ -114,9 +116,21 @@ export default {
this.tableList.map(item => { this.tableList.map(item => {
if (item.materialId === selectItem.materialId) { if (item.materialId === selectItem.materialId) {
item.checked = true 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' this.status = this.total == this.tableList.length ? 'nomore' : 'loadmore'
} catch (error) { } catch (error) {
console.log(error) console.log(error)

View File

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