组盘新

This commit is contained in:
2025-08-06 15:03:47 +08:00
parent f11679a5a0
commit 1e06bc56b7
2 changed files with 66 additions and 65 deletions

View File

@@ -6,7 +6,7 @@
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料</span>
<span class="filter_label">物料信息</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="val1">
@@ -18,16 +18,22 @@
<table>
<thead>
<tr>
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
<th>物料名称</th>
<th>物料规格</th>
<th>物料编码</th>
<th>数量</th>
<th>批次号</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_code}}</td>
<!-- <td>{{e.qty}}</td>
<td>{{e.pcsn}}</td> -->
<td><input type="number" class="sin_input" v-model="e.qty"></td>
<td><input type="text" class="sin_input" v-model="e.pcsn"></td>
</tr>
</tbody>
</table>
@@ -57,8 +63,10 @@
title: '',
val1: '',
dataList: [],
// dataList: [{material_name: 'name1', checked: false, qty:'100', pcsn:'p001'},{material_name: 'name2', checked: false},{material_name: 'name3', checked: false}],
pkId: '',
pkObj: {},
allCheck: false,
reload: false,
status: 'more',
contentText: {
@@ -73,7 +81,7 @@
},
onLoad (options) {
this.title = options.title
this.searchList()
// this.searchList()
},
methods: {
searchList () {
@@ -88,6 +96,9 @@
if (res.totalElements > 0) {
const dataMap = res.data
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
this.reload = false
} else {
this.dataList = []
@@ -108,9 +119,16 @@
this.status = 'noMore'
}
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
e.checked = !e.checked
let arr = this.dataList.filter(el => el.checked === true)
this.allCheck = arr.length === this.dataList.length
},
toEmpty () {
this.val1 = ''
@@ -119,8 +137,9 @@
this.pkId = ''
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
let arr = this.dataList.filter(el => el.checked === true)
if (arr.length) {
this.$store.dispatch('setPublicArr', arr)
uni.navigateBack()
}
}