分切暂存清除弹窗

This commit is contained in:
2024-07-24 17:54:43 +08:00
parent 9c166796b5
commit 8f2ec3cc58

View File

@@ -24,10 +24,13 @@
</view> </view>
<view class="zd-row submitbar"> <view class="zd-row submitbar">
<button class="zd-col-4 btn-submit btn-default" @tap="clearUp">清空</button> <button class="zd-col-4 btn-submit btn-default" @tap="clearUp">清空</button>
<button class="zd-col-4 btn-submit btn-success" :class="{'btn-info': !val1}" :disabled="disabled" @tap="_toCleanCutCacheInventory">清除</button> <button class="zd-col-4 btn-submit btn-success" :class="{'btn-info': !val1}" @tap="toSure1">清除</button>
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled1" @tap="_toSubvolumeBinding">子卷绑定</button> <button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" @tap="toSure2">子卷绑定</button>
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled2" @tap="_toShaftBinding">气胀轴绑定</button> <button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" @tap="toSure3">气胀轴绑定</button>
</view> </view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="确定" title="提示" :content="content" @confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
@@ -45,64 +48,78 @@
title: '', title: '',
val1: '', val1: '',
val2: '', val2: '',
disabled: false, content: '',
disabled1: false, type: ''
disabled2: false
}; };
}, },
onLoad (options) { onLoad (options) {
this.title = options.title this.title = options.title
}, },
methods: { methods: {
async _toCleanCutCacheInventory () { dialogConfirm () {
this.disabled = true if (this.type === 1) {
this._toCleanCutCacheInventory()
} else if (this.type === 2) {
this._toSubvolumeBinding()
} else if (this.type === 3) {
this._toShaftBinding()
}
},
toSure1 () {
if (!this.val1) { if (!this.val1) {
this.disabled = false
return return
} }
this.content = '确认是否清除点位数据?'
this.type = 1
this.$refs.alertDialog.open()
},
async _toCleanCutCacheInventory () {
try { try {
let res = await toCleanCutCacheInventory(this.val1) let res = await toCleanCutCacheInventory(this.val1)
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.disabled = false
} catch (e) { } catch (e) {
this.disabled = false console.log(e)
} }
}, },
async _toSubvolumeBinding () { toSure2 () {
this.disabled1 = true
if (!this.val1 || !this.val2) { if (!this.val1 || !this.val2) {
this.disabled1 = false
return return
} }
this.content = '确认是否绑定子卷?'
this.type = 2
this.$refs.alertDialog.open()
},
async _toSubvolumeBinding () {
try { try {
let res = await toSubvolumeBinding(this.val1, this.val2) let res = await toSubvolumeBinding(this.val1, this.val2)
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.disabled1= false
} catch (e) { } catch (e) {
this.disabled1 = false console.log(e)
} }
}, },
async _toShaftBinding () { toSure3 () {
this.disabled2 = true
if (!this.val1 || !this.val2) { if (!this.val1 || !this.val2) {
this.disabled2 = false
return return
} }
this.content = '确认是否绑定气胀轴?'
this.type = 3
this.$refs.alertDialog.open()
},
async _toShaftBinding () {
try { try {
let res = await toShaftBinding(this.val1, this.val2) let res = await toShaftBinding(this.val1, this.val2)
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
icon: 'none' icon: 'none'
}) })
this.disabled2= false
} catch (e) { } catch (e) {
this.disabled2 = false console.log(e)
} }
}, },
clearUp () { clearUp () {