分切暂存清除弹窗
This commit is contained in:
@@ -24,10 +24,13 @@
|
||||
</view>
|
||||
<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-success" :class="{'btn-info': !val1}" :disabled="disabled" @tap="_toCleanCutCacheInventory">清除</button>
|
||||
<button class="zd-col-7 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled1" @tap="_toSubvolumeBinding">子卷绑定</button>
|
||||
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled2" @tap="_toShaftBinding">气胀轴绑定</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}" @tap="toSure2">子卷绑定</button>
|
||||
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" @tap="toSure3">气胀轴绑定</button>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@@ -45,64 +48,78 @@
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
disabled: false,
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
content: '',
|
||||
type: ''
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
async _toCleanCutCacheInventory () {
|
||||
this.disabled = true
|
||||
dialogConfirm () {
|
||||
if (this.type === 1) {
|
||||
this._toCleanCutCacheInventory()
|
||||
} else if (this.type === 2) {
|
||||
this._toSubvolumeBinding()
|
||||
} else if (this.type === 3) {
|
||||
this._toShaftBinding()
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
if (!this.val1) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.content = '确认是否清除点位数据?'
|
||||
this.type = 1
|
||||
this.$refs.alertDialog.open()
|
||||
},
|
||||
async _toCleanCutCacheInventory () {
|
||||
try {
|
||||
let res = await toCleanCutCacheInventory(this.val1)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async _toSubvolumeBinding () {
|
||||
this.disabled1 = true
|
||||
toSure2 () {
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this.content = '确认是否绑定子卷?'
|
||||
this.type = 2
|
||||
this.$refs.alertDialog.open()
|
||||
},
|
||||
async _toSubvolumeBinding () {
|
||||
try {
|
||||
let res = await toSubvolumeBinding(this.val1, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1= false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async _toShaftBinding () {
|
||||
this.disabled2 = true
|
||||
toSure3 () {
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this.content = '确认是否绑定气胀轴?'
|
||||
this.type = 3
|
||||
this.$refs.alertDialog.open()
|
||||
},
|
||||
async _toShaftBinding () {
|
||||
try {
|
||||
let res = await toShaftBinding(this.val1, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled2= false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
|
||||
Reference in New Issue
Block a user