Files
hht-tongbo/pages/ProductManage/PointManage.vue

97 lines
2.3 KiB
Vue
Raw Normal View History

2022-10-11 08:39:10 +08:00
<template>
2022-10-15 15:29:58 +08:00
<view class="zd_container">
2022-10-13 14:44:45 +08:00
<nav-bar title="点位管理"></nav-bar>
2022-10-15 15:29:58 +08:00
<view class="zd_content">
<view class="zd_wrapper">
2022-10-13 14:44:45 +08:00
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
</view>
<view class="filter_input_wraper">
2022-10-13 17:00:05 +08:00
<search-box
v-model="val1"
2022-10-14 16:36:08 +08:00
:seaShow="true"
@toSearch="toSearch"
2022-10-13 17:00:05 +08:00
/>
2022-10-13 14:44:45 +08:00
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">空轴/母卷</span>
</view>
<view class="filter_input_wraper">
2022-10-13 17:00:05 +08:00
<search-box
v-model="val2"
/>
2022-10-13 14:44:45 +08:00
</view>
</view>
<view class="filter_item">
<view class="filter_label">是否有货</view>
<view class="filter_input_wraper">
2022-10-14 16:36:08 +08:00
<input type="text" class="filter_input" v-model="val3" :class="{'filter_input_disabled': disabled0}" :disabled="disabled0">
2022-10-13 14:44:45 +08:00
</view>
</view>
</view>
</view>
<view class="submit-bar">
2022-10-15 17:51:07 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate('1')">绑定</button>
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_pointOperate('2')">解绑</button>
2022-10-13 14:44:45 +08:00
</view>
2022-10-11 08:39:10 +08:00
</view>
</template>
<script>
2022-10-13 14:44:45 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {pointOperate, pointStatusQuery} from '@/utils/getData1.js'
2022-10-11 08:39:10 +08:00
export default {
2022-10-13 14:44:45 +08:00
components: {
NavBar,
SearchBox
},
2022-10-11 08:39:10 +08:00
data() {
return {
2022-10-13 14:44:45 +08:00
val1: '',
val2: '',
val3: '',
2022-10-14 16:36:08 +08:00
disabled0: true,
2022-10-13 14:44:45 +08:00
disabled: false
2022-10-11 08:39:10 +08:00
};
2022-10-13 14:44:45 +08:00
},
methods: {
2022-10-14 16:36:08 +08:00
toSearch (e) {
2022-10-14 16:05:55 +08:00
this._pointStatusQuery()
2022-10-13 14:44:45 +08:00
},
/** 查询 */
async _pointStatusQuery () {
if (!this.val1) {
return
}
let res = await pointStatusQuery(this.val1)
2022-10-15 17:32:13 +08:00
this.val2 = res.data.container_name
this.val3 = res.data.have_goods
2022-10-13 14:44:45 +08:00
},
2022-10-15 17:51:07 +08:00
async _pointOperate (type) {
2022-10-13 14:44:45 +08:00
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
2022-10-15 17:51:07 +08:00
let res = await pointOperate(this.val1, this.val2, type)
2022-10-13 14:44:45 +08:00
uni.showToast({
2022-10-15 10:58:20 +08:00
title: res.message,
2022-10-13 14:44:45 +08:00
icon: 'none'
})
this.disabled = false
} catch (e) {
this.disabled = false
}
}
2022-10-11 08:39:10 +08:00
}
}
</script>
<style lang="stylus">
</style>