载具管理

This commit is contained in:
2026-01-09 16:56:56 +08:00
parent ba0bc562af
commit 71910b0894
5 changed files with 149 additions and 29 deletions

View File

@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
<td>{{i+1}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.material_code}}</td>
@@ -76,7 +76,7 @@
</view>
<view class="zd-row submit-bar">
<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="_confirmCallMaterial">确认叫料</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val2 || !pkId}" :disabled="disabled" @tap="_confirmCallMaterial">确认叫料</button>
</view>
</view>
</template>
@@ -99,8 +99,10 @@
val1: '',
val2: '',
materialData: {},
pkId: '',
pkObj: {},
dataList: [],
dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
disabled: false
};
},
@@ -115,6 +117,10 @@
}
},
methods: {
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
toJump (name) {
uni.navigateTo({
url: `/pages/hdyy/wbc/${name}`
@@ -157,12 +163,12 @@
},
async _confirmCallMaterial () {
this.disabled = true
if (!this.val2 || !this.dataList.length) {
if (!this.val2 || !this.pkId) {
this.disabled = false
return
}
try {
let res = await confirmCallMaterial(this.val2, '', this.dataList)
let res = await confirmCallMaterial(this.val2, '', this.pkObj)
if (res) {
uni.showToast({
title: res.message,