组袋组桶
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button> -->
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': flag || !val1 || !weight || !pcsn || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="toZtPrint">组桶并打印</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': flag || !val1 || !weight || !pcsn || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="_confirmBucketAssembly">确认组桶</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': flag || !val1 || !weight || !pcsn || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="handleSubmit">确认组桶</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !weight || !pcsn || JSON.stringify(materialData) === '{}'}" :disabled="disabled1" @tap="tolPrint">标签打印</button>
|
||||
</view>
|
||||
<!-- 自定义弹窗 -->
|
||||
@@ -120,6 +120,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 放置弹窗组件(用户名密码) -->
|
||||
<CredentialPopup ref="credentialPopup" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -169,6 +171,21 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleSubmit() {
|
||||
if (this.flag || !this.val1 || !this.weight || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
// 显示弹窗,等待用户输入
|
||||
const { username, password } = await this.$refs.credentialPopup.show();
|
||||
// 调用原接口,传入账号密码
|
||||
this._confirmBucketAssembly(username, password);
|
||||
} catch (error) {
|
||||
// 用户取消,不做处理
|
||||
console.log('用户取消输入');
|
||||
}
|
||||
},
|
||||
// 显示弹窗(重置表单)
|
||||
showDialog() {
|
||||
this.resetForm();
|
||||
@@ -263,14 +280,10 @@
|
||||
this._confirmBucketAssembly()
|
||||
this.labelPrint()
|
||||
},
|
||||
async _confirmBucketAssembly () {
|
||||
async _confirmBucketAssembly (username, password) {
|
||||
this.disabled = true
|
||||
if (this.flag || !this.val1 || !this.weight || !this.pcsn || JSON.stringify(this.materialData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmBucketAssembly(this.val1, this.weight, this.num, this.pcsn, this.materialData.material_id)
|
||||
let res = await confirmBucketAssembly(username, password, this.val1, this.weight, this.num, this.pcsn, this.materialData.material_id)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user