搬运任务加提示框
This commit is contained in:
@@ -71,19 +71,7 @@
|
||||
// url: '/pages/home/home'
|
||||
// })
|
||||
this.disabled = true
|
||||
if (this.user === '') {
|
||||
uni.showToast({
|
||||
title: '用户名不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
if (this.password === '') {
|
||||
uni.showToast({
|
||||
title: '密码不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
if (this.user === '' || this.password === '') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-22 button-primary" :disabled="disabled" @tap="_callTask('1')">{{$t('button.handtask')}}</button>
|
||||
<button class="zd-col-22 button-primary" :disabled="disabled" @tap="toSure('1')">{{$t('button.handtask')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -44,8 +44,23 @@
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
async _callTask (type) {
|
||||
toSure (type) {
|
||||
this.disabled = true
|
||||
uni.showModal({
|
||||
title: this.$t('warning'),
|
||||
cancelText: this.$t('button.cancel'),
|
||||
confirmText: this.$t('button.confirm'),
|
||||
content: this.$t('toast.command-reissue'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this._callTask(type)
|
||||
} else if (res.cancel) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async _callTask (type) {
|
||||
try {
|
||||
let res = await callTask(this.sCode, this.nCode, type)
|
||||
this.disabled = false
|
||||
|
||||
Reference in New Issue
Block a user