点位管理
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<view class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></view>
|
||||
</view>
|
||||
<view v-show="e.checked === true" class="site_block" ref="liCon">
|
||||
<view class="site_item" v-for="(el, i) in e.pointArr" :key="i">
|
||||
<view class="site_item" v-for="(el, i) in e.pointArr" :key="i" :class="['bggray', 'bggreen', 'bgyellow'][Number(el.status)]">
|
||||
<view class="site_item_box">
|
||||
<text class="title_2">站点</text>
|
||||
<view class="site_item_box_inner_r" @click="setcode(el)">
|
||||
@@ -97,23 +97,37 @@
|
||||
// },
|
||||
async initArea () {
|
||||
let res = await queryArea()
|
||||
this.areaArr = [...res.result]
|
||||
this.areaArr.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
this.$set(el, 'pointArr', [])
|
||||
})
|
||||
if (this.areaArr.length > 0) {
|
||||
this.getPonit(this.areaArr[0])
|
||||
if (res.code === '1') {
|
||||
this.areaArr = [...res.result]
|
||||
this.areaArr.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
this.$set(el, 'pointArr', [])
|
||||
})
|
||||
if (this.areaArr.length > 0) {
|
||||
this.getPonit(this.areaArr[0])
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async initPonit (e) {
|
||||
let res = await queryPointByArea(e.value)
|
||||
this.regobj = e
|
||||
this.areaArr.map(el => {
|
||||
if (el.value === e.value) {
|
||||
this.$set(el, 'pointArr', [...res.result])
|
||||
}
|
||||
})
|
||||
if (res.code === '1') {
|
||||
this.regobj = e
|
||||
this.areaArr.map(el => {
|
||||
if (el.value === e.value) {
|
||||
this.$set(el, 'pointArr', [...res.result])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
getPonit (e) {
|
||||
// clearInterval(this.timer)
|
||||
@@ -132,10 +146,17 @@
|
||||
},
|
||||
async _handMaterial () {
|
||||
let res = await handMaterial()
|
||||
res.result.map(el => {
|
||||
this.$set(el, 'text', el.label)
|
||||
})
|
||||
this.options = res.result
|
||||
if (res.code === '1') {
|
||||
res.result.map(el => {
|
||||
this.$set(el, 'text', el.label)
|
||||
})
|
||||
this.options = res.result
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
// console.log('e:', e);
|
||||
@@ -174,15 +195,23 @@
|
||||
try {
|
||||
let res = await handPointOpt(code, type, mtype, qty)
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
that.initPonit(this.regobj)
|
||||
this.index = ''
|
||||
this.qty = ''
|
||||
this.obj = {}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
if (res.code === '1') {
|
||||
this.index = ''
|
||||
this.qty = ''
|
||||
this.obj = {}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.initPonit(this.regobj)
|
||||
} else {
|
||||
this.index = ''
|
||||
this.qty = ''
|
||||
this.obj = {}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (err) {
|
||||
this.index = ''
|
||||
this.qty = ''
|
||||
@@ -309,7 +338,6 @@
|
||||
height 70rpx
|
||||
line-height 70rpx
|
||||
width 100%
|
||||
max-width 300px
|
||||
margin 40rpx auto 0
|
||||
_fj()
|
||||
.msg_btn
|
||||
|
||||
Reference in New Issue
Block a user