点位管理
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
<view class="header">首页</view>
|
<view class="header">首页</view>
|
||||||
<view class="userInfo-wrap">
|
<view class="userInfo-wrap">
|
||||||
<view class="userInfo">
|
<view class="userInfo">
|
||||||
<text class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}</text>
|
|
||||||
<text class="p2">欢迎进入诺力四期手持系统!</text>
|
<text class="p2">欢迎进入诺力四期手持系统!</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="exit" @tap="Quit">
|
<view class="exit" @tap="Quit">
|
||||||
@@ -63,7 +62,6 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
Quit () {
|
Quit () {
|
||||||
this.$store.dispatch('delUserInfo')
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<view class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></view>
|
<view class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></view>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="e.checked === true" class="site_block" ref="liCon">
|
<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">
|
<view class="site_item_box">
|
||||||
<text class="title_2">站点</text>
|
<text class="title_2">站点</text>
|
||||||
<view class="site_item_box_inner_r" @click="setcode(el)">
|
<view class="site_item_box_inner_r" @click="setcode(el)">
|
||||||
@@ -97,23 +97,37 @@
|
|||||||
// },
|
// },
|
||||||
async initArea () {
|
async initArea () {
|
||||||
let res = await queryArea()
|
let res = await queryArea()
|
||||||
this.areaArr = [...res.result]
|
if (res.code === '1') {
|
||||||
this.areaArr.map(el => {
|
this.areaArr = [...res.result]
|
||||||
this.$set(el, 'checked', false)
|
this.areaArr.map(el => {
|
||||||
this.$set(el, 'pointArr', [])
|
this.$set(el, 'checked', false)
|
||||||
})
|
this.$set(el, 'pointArr', [])
|
||||||
if (this.areaArr.length > 0) {
|
})
|
||||||
this.getPonit(this.areaArr[0])
|
if (this.areaArr.length > 0) {
|
||||||
|
this.getPonit(this.areaArr[0])
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.desc,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async initPonit (e) {
|
async initPonit (e) {
|
||||||
let res = await queryPointByArea(e.value)
|
let res = await queryPointByArea(e.value)
|
||||||
this.regobj = e
|
if (res.code === '1') {
|
||||||
this.areaArr.map(el => {
|
this.regobj = e
|
||||||
if (el.value === e.value) {
|
this.areaArr.map(el => {
|
||||||
this.$set(el, 'pointArr', [...res.result])
|
if (el.value === e.value) {
|
||||||
}
|
this.$set(el, 'pointArr', [...res.result])
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.desc,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getPonit (e) {
|
getPonit (e) {
|
||||||
// clearInterval(this.timer)
|
// clearInterval(this.timer)
|
||||||
@@ -132,10 +146,17 @@
|
|||||||
},
|
},
|
||||||
async _handMaterial () {
|
async _handMaterial () {
|
||||||
let res = await handMaterial()
|
let res = await handMaterial()
|
||||||
res.result.map(el => {
|
if (res.code === '1') {
|
||||||
this.$set(el, 'text', el.label)
|
res.result.map(el => {
|
||||||
})
|
this.$set(el, 'text', el.label)
|
||||||
this.options = res.result
|
})
|
||||||
|
this.options = res.result
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.desc,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
change(e) {
|
change(e) {
|
||||||
// console.log('e:', e);
|
// console.log('e:', e);
|
||||||
@@ -174,15 +195,23 @@
|
|||||||
try {
|
try {
|
||||||
let res = await handPointOpt(code, type, mtype, qty)
|
let res = await handPointOpt(code, type, mtype, qty)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '操作成功',
|
title: res.desc,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
that.initPonit(this.regobj)
|
if (res.code === '1') {
|
||||||
this.index = ''
|
this.index = ''
|
||||||
this.qty = ''
|
this.qty = ''
|
||||||
this.obj = {}
|
this.obj = {}
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
this.disabled2 = false
|
this.disabled2 = false
|
||||||
|
this.initPonit(this.regobj)
|
||||||
|
} else {
|
||||||
|
this.index = ''
|
||||||
|
this.qty = ''
|
||||||
|
this.obj = {}
|
||||||
|
this.disabled1 = false
|
||||||
|
this.disabled2 = false
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.index = ''
|
this.index = ''
|
||||||
this.qty = ''
|
this.qty = ''
|
||||||
@@ -309,7 +338,6 @@
|
|||||||
height 70rpx
|
height 70rpx
|
||||||
line-height 70rpx
|
line-height 70rpx
|
||||||
width 100%
|
width 100%
|
||||||
max-width 300px
|
|
||||||
margin 40rpx auto 0
|
margin 40rpx auto 0
|
||||||
_fj()
|
_fj()
|
||||||
.msg_btn
|
.msg_btn
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export const queryArea = () => request({
|
|||||||
})
|
})
|
||||||
// export const queryArea = () => {
|
// export const queryArea = () => {
|
||||||
// let res = {
|
// let res = {
|
||||||
|
// code: '1',
|
||||||
// result: [{value: '1', label: 'A1'}, {value: '2', label: 'A2'}]
|
// result: [{value: '1', label: 'A1'}, {value: '2', label: 'A2'}]
|
||||||
// }
|
// }
|
||||||
// return res
|
// return res
|
||||||
@@ -44,7 +45,8 @@ export const queryPointByArea = (code) => request({
|
|||||||
})
|
})
|
||||||
// export const queryPointByArea = () => {
|
// export const queryPointByArea = () => {
|
||||||
// let res = {
|
// 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
|
// return res
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user