96 lines
2.2 KiB
Vue
96 lines
2.2 KiB
Vue
<template>
|
|
<view class="zd_container">
|
|
<nav-bar :title="title"></nav-bar>
|
|
<view class="zd_content">
|
|
<view class="zd_wrapper">
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-7">
|
|
<span class="filter_label">大小卷</span>
|
|
</view>
|
|
<view class="zd-col-17">
|
|
<search-box
|
|
v-model="val1"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-7">
|
|
<span class="filter_label">设备</span>
|
|
</view>
|
|
<view class="zd-col-17 filter_select">
|
|
<zxz-uni-data-select v-model="index" :localdata="options"></zxz-uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-8 button-default" @tap="clearUp">清空</button>
|
|
<button class="zd-col-15 button-primary" :class="{'button-info': !index || !val1}" :disabled="disabled" @tap="_temporaryStorage">确认暂存</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import {getSlitterDeviceBox, temporaryStorage} from '@/utils/getData2.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox
|
|
},
|
|
data() {
|
|
return {
|
|
title: '',
|
|
val1: '',
|
|
index: '',
|
|
options: [],
|
|
disabled: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
this._getSlitterDeviceBox()
|
|
},
|
|
methods: {
|
|
async _getSlitterDeviceBox () {
|
|
let res = await getSlitterDeviceBox()
|
|
this.options = [...res]
|
|
},
|
|
clearUp () {
|
|
this.index = ''
|
|
this.val1 = ''
|
|
this.disabled = false
|
|
},
|
|
async _temporaryStorage () {
|
|
this.disabled = true
|
|
if (!this.index || !this.val1) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await temporaryStorage(this.val1, this.index)
|
|
this.clearUp()
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
.zd_content
|
|
height: calc(100% - var(--status-bar-height) - 212rpx);
|
|
padding: 20rpx 14rpx 0 14rpx;
|
|
.grid-wraper
|
|
height: 100%;
|
|
overflow: auto;
|
|
.slide_new table td, .slide_new table th
|
|
overflow: visible;
|
|
</style>
|