料桶入库
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('1')">检查站点</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('0')">确认放置</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_checkStruct">检查站点</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || flag === '2'}" :disabled="disabled2" @tap="_confirmSet">确认放置</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -36,7 +36,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {bindOrUnbind} from '@/utils/getData3.js'
|
||||
import {checkStruct, confirmSet} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -47,7 +47,9 @@
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
flag: '',
|
||||
disabled: false,
|
||||
disabled2: false,
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -61,15 +63,22 @@
|
||||
this.val2 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _bindOrUnbind (type) {
|
||||
clearUp2 () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.disabled2 = false
|
||||
},
|
||||
async _checkStruct () {
|
||||
console.log(1111)
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
if (!this.val1) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await bindOrUnbind(this.val1, this.val2, type)
|
||||
let res = await checkStruct(this.val1)
|
||||
if (res.code === '200') {
|
||||
this.flag = res.data.flag
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -85,6 +94,31 @@
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _confirmSet () {
|
||||
this.disabled2 = true
|
||||
if (!this.val1 || !this.val2 || this.flag === '2') {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmSet(this.val1, this.val2)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user