CredentialPopup
This commit is contained in:
@@ -73,8 +73,10 @@
|
||||
</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': !val1 || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="_packConfirmReturn">确认还回</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="handleSubmit">确认还回</button>
|
||||
</view>
|
||||
<!-- 放置弹窗组件 -->
|
||||
<CredentialPopup ref="credentialPopup" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -109,6 +111,21 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleSubmit() {
|
||||
if (!this.val1 || JSON.stringify(this.materialData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
// 显示弹窗,等待用户输入
|
||||
const { username, password } = await this.$refs.credentialPopup.show();
|
||||
// 调用原接口,传入账号密码
|
||||
this._packConfirmReturn(username, password);
|
||||
} catch (error) {
|
||||
// 用户取消,不做处理
|
||||
console.log('用户取消输入');
|
||||
}
|
||||
},
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/hdyy/wbc/${name}`
|
||||
@@ -124,14 +141,10 @@
|
||||
this.mark = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _packConfirmReturn () {
|
||||
async _packConfirmReturn (username, password) {
|
||||
this.disabled = true
|
||||
if (!this.val1 || JSON.stringify(this.materialData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await packConfirmReturn(this.val1, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.pcsn, this.num, this.mark)
|
||||
let res = await packConfirmReturn(username, password, this.val1, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.pcsn, this.num, this.mark)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user