点位管理

This commit is contained in:
2023-10-13 13:09:28 +08:00
parent 1cf040b14d
commit 3c820f4b8e
3 changed files with 57 additions and 29 deletions

View File

@@ -3,7 +3,6 @@
<view class="header">首页</view>
<view class="userInfo-wrap">
<view class="userInfo">
<text class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}</text>
<text class="p2">欢迎进入诺力四期手持系统</text>
</view>
<view class="exit" @tap="Quit">
@@ -63,7 +62,6 @@
})
},
Quit () {
this.$store.dispatch('delUserInfo')
uni.redirectTo({
url: '/pages/login/login'
})

View File

@@ -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

View File

@@ -31,6 +31,7 @@ export const queryArea = () => request({
})
// export const queryArea = () => {
// let res = {
// code: '1',
// result: [{value: '1', label: 'A1'}, {value: '2', label: 'A2'}]
// }
// return res
@@ -44,7 +45,8 @@ export const queryPointByArea = (code) => request({
})
// export const queryPointByArea = () => {
// let res = {
// result: [{device_code: '1', device_name: 'JLDFJLLJ', status: '0', material_type: '1', qty: '10'}, {device_code: '2', device_name: 'JLDFJLLJ2'}]
// code: '1',
// result: [{device_code: '1', device_name: 'JLDFJLLJ', status: '2', material_type: '1', qty: '10'}, {device_code: '2', device_name: 'JLDFJLLJ2', status: '0', material_type: '1', qty: '10'}]
// }
// return res
// }