Files
pad-hl-hcx-new/pages/management/HcxErrorHandle.vue

94 lines
2.2 KiB
Vue
Raw Normal View History

2023-03-23 14:13:31 +08:00
<template>
<view class="content">
<nav-bar title="缓存线异常处理"></nav-bar>
<view class="search-confirm-wrap">
<view class="search-wrap">
<view class="search-item">
2023-03-30 16:14:01 +08:00
<label class="search-label">生产区域</label>
2023-03-23 14:13:31 +08:00
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
2023-03-30 16:14:01 +08:00
<view class="search-item">
<label class="search-label">缓存线</label>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
2023-03-23 14:13:31 +08:00
</view>
<view class="confirm-button-wrap">
2023-03-30 16:14:01 +08:00
<button class="confirm-button" :disabled="disabled" @tap="toSure('1')">暂停</button>
<button class="confirm-button" :disabled="disabled" @tap="toSure('2')">启动</button>
2023-03-23 14:13:31 +08:00
</view>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2023-03-30 16:14:01 +08:00
import {getCacheLine, cacheLineExcepOpt} from '@/utils/getData1.js'
2023-03-23 14:13:31 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
2023-03-30 16:14:01 +08:00
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
index1: 'A1',
options2: [],
index2: '',
2023-03-23 14:13:31 +08:00
disabled: false
};
},
2023-03-30 16:14:01 +08:00
created() {
this._getCacheLine('A1')
},
2023-03-23 14:13:31 +08:00
methods: {
/** 选择器1 */
selectChange1(e) {
this.index1 = e
2023-03-30 16:14:01 +08:00
if (this.index1) {
this._getCacheLine(e)
}
this.index2 = ''
},
/** 选择器2 */
selectChange2(e) {
this.index2 = e
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
2023-03-23 14:13:31 +08:00
},
2023-03-29 09:45:17 +08:00
async toSure (type) {
2023-03-23 14:13:31 +08:00
this.disabled = true
2023-03-30 16:14:01 +08:00
if (!this.index2) {
uni.showToast({
title: '请选择',
icon: 'none'
})
this.disabled = false
return
}
2023-03-29 09:45:17 +08:00
try {
2023-03-30 16:14:01 +08:00
let res = await cacheLineExcepOpt(this.index2, type)
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
2023-03-29 09:45:17 +08:00
} catch (e) {
2023-03-30 16:14:01 +08:00
this.disabled = false
2023-03-29 09:45:17 +08:00
}
2023-03-23 14:13:31 +08:00
}
}
}
</script>
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
2023-03-29 09:45:17 +08:00
// .grid-wrap
// height calc(100% - 526rpx)
2023-03-23 14:13:31 +08:00
</style>