This commit is contained in:
2022-11-17 15:01:06 +08:00
4 changed files with 16 additions and 32 deletions

View File

@@ -60,7 +60,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @tap="_stPrint">补码</button> <button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @tap="_stPrint">补码</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
@@ -102,7 +102,7 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (this.dataList.length === 0) { if (!this.val1 || this.dataList.length === 0) {
this.disabled = false this.disabled = false
return return
} }

View File

@@ -36,8 +36,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.package_box_SN === pkId, 'bgyellow': e.colro_flag === '1'}"> <tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.package_box_sn === pkId, 'bgyellow': e.colro_flag === '1'}">
<td>{{e.package_box_SN}}</td> <td>{{e.package_box_sn}}</td>
<td>{{e.container_name}}</td> <td>{{e.container_name}}</td>
<td>{{e.product_name}}</td> <td>{{e.product_name}}</td>
<td>{{e.product_description}}</td> <td>{{e.product_description}}</td>
@@ -124,8 +124,8 @@
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.package_box_SN ? '' : e.package_box_SN this.pkId = this.pkId === e.package_box_sn ? '' : e.package_box_sn
this.pkObj = this.pkId === e.package_box_SN ? e : {} this.pkObj = this.pkId === e.package_box_sn ? e : {}
} }
} }
} }

View File

@@ -53,8 +53,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.package_box_SN === pkId}"> <tr v-for="(e, i) in dataList" :key="i">
<td>{{e.package_box_SN}}</td> <td>{{e.package_box_sn}}</td>
<td>{{e.container_name}}</td> <td>{{e.container_name}}</td>
<td>{{e.product_name}}</td> <td>{{e.product_name}}</td>
<td>{{e.product_description}}</td> <td>{{e.product_description}}</td>
@@ -66,7 +66,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
</view> </view>
@@ -88,8 +88,6 @@
val3: '', val3: '',
isV: '0', isV: '0',
dataList: [], dataList: [],
pkId: '',
pkObj: {},
disabled: false disabled: false
}; };
}, },
@@ -109,14 +107,12 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (!this.pkId) { if (!this.val1 || this.dataList.length === 0) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await stConfirm(this.pkObj, this.val2, '3', this.isV, this.val3) let res = await stConfirm(this.dataList, this.val2, '3', this.isV, this.val3)
this.pkId = ''
this.pkObj = {}
this.disabled = false this.disabled = false
this._boxQuery(this.val1) this._boxQuery(this.val1)
uni.showToast({ uni.showToast({
@@ -126,10 +122,6 @@
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }
},
toCheck (e) {
this.pkId = this.pkId === e.package_box_SN ? '' : e.package_box_SN
this.pkObj = this.pkId === e.package_box_SN ? e : {}
} }
} }
} }

View File

@@ -47,8 +47,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.package_box_SN === pkId}"> <tr v-for="(e, i) in dataList" :key="i">
<td>{{e.package_box_SN}}</td> <td>{{e.package_box_sn}}</td>
<td>{{e.container_name}}</td> <td>{{e.container_name}}</td>
<td>{{e.product_name}}</td> <td>{{e.product_name}}</td>
<td>{{e.product_description}}</td> <td>{{e.product_description}}</td>
@@ -60,7 +60,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
</view> </view>
@@ -81,8 +81,6 @@
val2: '', val2: '',
isV: '0', isV: '0',
dataList: [], dataList: [],
pkId: '',
pkObj: {},
disabled: false disabled: false
}; };
}, },
@@ -102,14 +100,12 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (!this.pkId) { if (!this.val1 || this.dataList.length === 0) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await stConfirm(this.pkObj, this.val2, '1', this.isV) let res = await stConfirm(this.dataList, this.val2, '1', this.isV)
this.pkId = ''
this.pkObj = {}
this.disabled = false this.disabled = false
this._boxQuery(this.val1) this._boxQuery(this.val1)
uni.showToast({ uni.showToast({
@@ -119,10 +115,6 @@
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }
},
toCheck (e) {
this.pkId = this.pkId === e.package_box_SN ? '' : e.package_box_SN
this.pkObj = this.pkId === e.package_box_SN ? e : {}
} }
} }
} }