接口
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
<view class="zd-col-17">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,8 +29,8 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_pdaPalletIostorinvIn">绑定</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_pdaPalletIostorinvIn">解绑</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('1')">绑定</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('0')">解绑</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -39,7 +38,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getStructCount, pdaPalletIostorinvIn} from '@/utils/getData2.js'
|
||||
import {bindOrUnbind} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -51,7 +50,6 @@
|
||||
val1: '',
|
||||
val2: '',
|
||||
disabled: false,
|
||||
kwData: {}
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -60,35 +58,19 @@
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getStructCount(e)
|
||||
}
|
||||
},
|
||||
async _getStructCount (e) {
|
||||
try {
|
||||
let res = await getStructCount(e)
|
||||
if (res) {
|
||||
this.kwData = res
|
||||
} else {
|
||||
this.kwData = {}
|
||||
}
|
||||
} catch (e) {
|
||||
this.kwData = {}
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _pdaPalletIostorinvIn () {
|
||||
async _bindOrUnbind (type) {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index) {
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await pdaPalletIostorinvIn(this.val1, this.index)
|
||||
let res = await bindOrUnbind(this.val1, this.val2, type)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
||||
Reference in New Issue
Block a user