修改功能

This commit is contained in:
2025-06-24 16:25:43 +08:00
parent 9beb17b531
commit ae24e7283b
4 changed files with 64 additions and 30 deletions

View File

@@ -98,8 +98,9 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3)}" :disabled="disabled" @tap="toSure">拣选确认</button>
<button :class="isChecked1 ? 'zd-col-5' : 'zd-col-6'" class="button-default" @tap="clearUp">清空</button>
<button v-if="isChecked1" class="zd-col-8 button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3)}" :disabled="disabled" @tap="handlePrint">标签打印</button>
<button class="button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3) || (isChecked1 && !isPrintSuccessful), 'zd-col-8': isChecked1,'zd-col-16': !isChecked1}" :disabled="disabled" @tap="toSure">拣选确认</button>
</view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="pop-line"></view>
@@ -142,7 +143,8 @@
isChecked1: true,
data: {},
disabled: false,
show: false
show: false,
isPrintSuccessful: false
};
},
onLoad (options) {
@@ -194,9 +196,27 @@
this.isChecked1 = true
this.disabled = false
this.show = false
this.isPrintSuccessful = false
},
handlePrint () {
this.disabled = true
if (!this.val1|| !this.val2 || !this.val3) {
this.disabled = false
return
}
if (this.val2 === this.val3) {
uni.showToast({
title: '出库和入库料箱不能相同',
icon: 'none'
})
this.disabled = false
return
}
let data = Object.assign({}, this.data, {lxCode: this.val2})
this.toPrint(data)
},
toSure () {
if (!this.val1|| !this.val2 || !this.val3) {
if (!this.val1|| !this.val2 || !this.val3 || (this.isChecked1 && !this.isPrintSuccessful)) {
return
}
if (this.val2 === this.val3) {
@@ -209,13 +229,7 @@
this.show = true
},
toConfirm () {
if (this.isChecked1) {
this.disabled = true
let data = Object.assign({}, this.data, {lxCode: this.val2})
this.toPrint(data)
} else {
this._savePickTask()
}
this._savePickTask()
},
async _savePickTask () {
this.disabled = true
@@ -281,9 +295,8 @@
title: '打印成功',
icon: 'none'
})
if (this.isChecked1) {
this._savePickTask()
}
this.disabled = false
this.isPrintSuccessful = true
}
}
}