料桶叫料

This commit is contained in:
2026-01-19 17:13:56 +08:00
parent 626a9359e3
commit 8ff2360dcd

View File

@@ -40,6 +40,7 @@
<table> <table>
<thead> <thead>
<tr> <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> <th>物料编码</th>
@@ -56,6 +57,7 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i"> <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>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{e.struct_code}}</td> <td>{{e.struct_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
@@ -76,7 +78,7 @@
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button> <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val2 || !dataList.length}" :disabled="disabled" @tap="_confirmCallBucketMaterial">确认叫料</button> <button class="zd-col-18 button-primary" :class="{'button-info': !val2 || !checkedArr.length}" :disabled="disabled" @tap="_confirmCallBucketMaterial">确认叫料</button>
</view> </view>
</view> </view>
</template> </template>
@@ -97,6 +99,8 @@
val1: '', val1: '',
val2: '', val2: '',
materialData: {}, materialData: {},
allCheck: false,
checkedArr: [],
dataList: [], dataList: [],
disabled: false disabled: false
}; };
@@ -120,12 +124,25 @@
this.val1 = '' this.val1 = ''
this.val2 = '' this.val2 = ''
this.num = null this.num = null
this.checkedArr = []
this.allCheck = false
this.dataList = [] this.dataList = []
this.disabled = false this.disabled = false
}, },
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.allCheck = this.checkedArr.length === this.dataList.length
},
async _getBucketGroupInfo () { async _getBucketGroupInfo () {
try { try {
let res = await getBucketGroupInfo(this.materialData.material_code, this.val1) let res = await getBucketGroupInfo(this.materialData.material_id, this.val1)
if (res && res.data.length > 0) { if (res && res.data.length > 0) {
this.dataList = [...res.data] this.dataList = [...res.data]
} else { } else {
@@ -136,13 +153,14 @@
} }
}, },
async _confirmCallBucketMaterial () { async _confirmCallBucketMaterial () {
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.disabled = true this.disabled = true
if (!this.val2 || !this.dataList.length) { if (!this.val2 || !this.checkedArr.length) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await confirmCallBucketMaterial(this.val2, this.dataList) let res = await confirmCallBucketMaterial(this.val2, this.checkedArr)
if (res) { if (res) {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,