客户标签打印

This commit is contained in:
2022-11-22 11:01:52 +08:00
parent b87294992d
commit e0ae9c5daa

View File

@@ -33,7 +33,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.container_name === pkId}">
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.package_box_sn}}</td>
<td>{{e.quanlity_in_box}}</td>
<td>{{e.box_weight}}</td>
@@ -52,7 +52,7 @@
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="_customerPrint">打印</button>
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled2" @tap="_customerPrint">打印</button>
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled1" @tap="_customerInfo">查询</button>
</view>
</view>
@@ -72,16 +72,10 @@
val1: '',
dataList: [],
disabled1: false,
disabled2: false,
pkId: '',
pkObj: {}
disabled2: false
};
},
methods: {
toCheck (e) {
this.pkId = this.pkId === e.container_name ? '' : e.container_name
this.pkObj = this.pkId === e.container_name ? e : {}
},
/** 查询 */
async _customerInfo () {
this.disabled1 = true
@@ -104,20 +98,18 @@
/** 打印 */
async _customerPrint () {
this.disabled2 = true
if (!this.pkId) {
if (!this.val1) {
uni.showToast({
title: '请选择一行',
title: '请扫木箱码',
icon: 'none'
})
this.disabled2 = false
return
}
try {
let res = await customerPrint(this.pkObj.package_box_sn)
let res = await customerPrint(this.val1)
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
this._customerInfo()
this.val1 = ''
uni.showToast({
title: res.message,
icon: 'none'