Files
hht-gaoce-uni/pages/modules/cache-code-change.vue

78 lines
1.6 KiB
Vue
Raw Normal View History

2024-09-11 17:42:14 +08:00
<template>
<view class="zd_container">
<nav-bar title="缓存码变更"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">原子托盘号</view>
<view class="filter_input_wraper">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label">新子托盘号</view>
<view class="filter_input_wraper">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar_new">
<button class="zd-col-7 submit-button_c" @tap="toClear">清空</button>
<button class="zd-col-15 submit-button_new" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_zpchange">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
2024-09-12 14:40:28 +08:00
import {zpchange} from '@/utils/getData2.js'
2024-09-11 17:42:14 +08:00
import SearchBox from '@/components/SearchBox.vue'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
val2: '',
disabled: false
};
},
methods: {
toClear () {
this.val1 = ''
this.val2 = ''
},
async _zpchange () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await zpchange(this.val1, this.val2)
if (res.code === '1') {
this.toClear()
}
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>