站点管理呼叫管理
This commit is contained in:
@@ -18,11 +18,38 @@ export const updatePass = (Rfold, Rfnew) => post2('api/pda/updatePass', {
|
||||
RfnewPass: Rfnew
|
||||
})
|
||||
|
||||
/** 任务生成 */
|
||||
// 1.1查询设备
|
||||
export const queryDevice = () => post2('api/pda/queryDevice', {})
|
||||
// 1.2根据区域查询点位
|
||||
export const pdaTask = (scode, ncode) => post2('api/pda/task', {
|
||||
start_devicecode: scode,
|
||||
next_devicecode: ncode
|
||||
/** 站点管理 */
|
||||
// 1.1查询所有区域信息
|
||||
// export const queryArea = () => post2('api/hand/queryArea', {})
|
||||
export const queryArea = () => {
|
||||
let res = {
|
||||
result: [{region_code: '1', region_name: 'JLDFJLLJ'}, {region_code: '2', region_name: 'JLDFJLLJ'}, {region_code: '3', region_name: 'JLDFJLLJ'}]
|
||||
}
|
||||
return res
|
||||
}
|
||||
// 1.2根据区域查询设备编号及状态
|
||||
// export const queryPointByArea = (code) => post2('api/hand/queryPointByArea', {
|
||||
// areaCode: code
|
||||
// })
|
||||
export const queryPointByArea = (code) => {
|
||||
let res = {
|
||||
result: [{device_code: '1', device_name: 'JLDFJLLJ', input_material: '1', status: '0'}, {device_code: '2', device_name: 'fffdf', status: '1'}, {device_code: '3', device_name: 'dffsfg', status: '2'}]
|
||||
}
|
||||
return res
|
||||
}
|
||||
// 1.3查询物料
|
||||
export const queryMaterial = () => post2('api/hand/queryMaterial', {})
|
||||
// 1.4点位状态绑定
|
||||
export const bindpoint = (code, mtype, type, status) => post2('api/hand/bindpoint', {
|
||||
device_code: code,
|
||||
material_type: mtype,
|
||||
type: type,
|
||||
status: status
|
||||
})
|
||||
|
||||
/** 呼叫管理 */
|
||||
// 1.1创建任务(确定起点)
|
||||
export const callTask = (scodes, code) => post2('api/hand/callTask', {
|
||||
start_device_codes: scodes,
|
||||
next_device_code: code
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="userInfo">
|
||||
<div class="fxcol">
|
||||
<p class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).nickName : ''}}</p>
|
||||
<p class="p2">欢迎进入马钢手持系统!</p>
|
||||
<p class="p2">欢迎进入辽宁奥美手持系统!</p>
|
||||
</div>
|
||||
<div class="exit" @click="Quit">
|
||||
<i class="icon-exit"></i>
|
||||
@@ -16,7 +16,8 @@
|
||||
<div class="con">
|
||||
<ul>
|
||||
<!-- <li v-for="e in menuList" :key="e.menu_id" @click="toPage(e)">{{e.name}}</li> -->
|
||||
<li @click="goInner('/PaintTask')">任务生成</li>
|
||||
<li @click="goInner('/SiteManage')">站点管理</li>
|
||||
<li @click="goInner('/CallManage')">呼叫管理</li>
|
||||
<li @click="goInner('/ZlManage')">指令管理</li>
|
||||
<li @click="goInner('/TaskManage')">任务管理</li>
|
||||
<!-- <li @click="goInner('/Password')">修改密码</li> -->
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<section>
|
||||
<section class="content">
|
||||
<p class="p1">欢迎来到</p>
|
||||
<p class="p2">马钢手持系统!</p>
|
||||
<p class="p2">辽宁奥美手持系统!</p>
|
||||
<div class="input-box">
|
||||
<input type="text" class="allwidth" placeholder="请输入用户名" v-model="loginname">
|
||||
</div>
|
||||
|
||||
283
src/pages/proj/CallManage.vue
Normal file
283
src/pages/proj/CallManage.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="站点管理"></nav-bar>
|
||||
<section class="content mgt15">
|
||||
<div class="clear icons">
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon gray"></div>
|
||||
<div class="font_icon">空</div>
|
||||
</div>
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon green"></div>
|
||||
<div class="font_icon">有货</div>
|
||||
</div>
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon orange"></div>
|
||||
<div class="font_icon">有任务</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="locate_block" v-for="e in areaArr" :key="e.region_code">
|
||||
<div class="locate_name" @click="getPonit (e)">
|
||||
<h2>{{e.region_name}}</h2>
|
||||
<div class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></div>
|
||||
</div>
|
||||
<div v-show="e.checked === true" class="site_block clear" ref="liCon">
|
||||
<div class="site_item fl" v-for="(el, i) in e.pointArr" :key="i" :class="['gray', 'green', 'orange'][Number(el.status)]">
|
||||
<div class="site_item_box clear">
|
||||
<!-- <h3 class="fl">站点</h3> -->
|
||||
<div class="fl site_item_box_inner_r">
|
||||
<p>{{el.device_name}}</p>
|
||||
<div class="s_n_code_tip">
|
||||
<div class="s_code_tip" @click="setStartcode(el)">起点</div>
|
||||
<div class="n_code_tip" @click="setNextcode(el)">终点</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<div class="dot_item">
|
||||
<p class="p1">起始点</p>
|
||||
<p class="p2">设备号:{{scodenameArr.toString()}}</p>
|
||||
</div>
|
||||
<div class="dot_item">
|
||||
<p class="p1">目标点</p>
|
||||
<p class="p2">设备号:{{nObj.device_name}}</p>
|
||||
</div>
|
||||
<div class="btn_block">
|
||||
<button class="btn btn1" :class="{'btn-disabled': scodeArr.length === 0 && JSON.stringify(nObj) === '{}'}" @click="cancle">清空</button>
|
||||
<button class="btn btn1" :class="{'btn-disabled': scodeArr.length === 0 || JSON.stringify(nObj) === '{}'}" :disabled="disabled1" @click="toSure">确认</button>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea, callTask} from '@config/getData2'
|
||||
export default {
|
||||
name: 'CallManage',
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
areaArr: [],
|
||||
pointArr: [],
|
||||
regobj: {},
|
||||
disabled1: false,
|
||||
scodeArr: [],
|
||||
scodenameArr: [],
|
||||
nObj: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
document.body.removeAttribute('class', 'login-bg')
|
||||
this.initArea()
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
refresh (e) {
|
||||
this.timer = setInterval(() => {
|
||||
this.initPonit(e)
|
||||
}, this.interTime)
|
||||
},
|
||||
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])
|
||||
}
|
||||
},
|
||||
async initPonit (e) {
|
||||
let res = await queryPointByArea(e.region_code)
|
||||
this.regobj = e
|
||||
this.areaArr.map(el => {
|
||||
if (el.region_code === e.region_code) {
|
||||
this.$set(el, 'pointArr', [...res.result])
|
||||
}
|
||||
})
|
||||
},
|
||||
getPonit (e) {
|
||||
clearInterval(this.timer)
|
||||
this.areaArr.map(el => {
|
||||
if (el.region_code !== e.region_code) {
|
||||
el.checked = false
|
||||
}
|
||||
if (el.region_code === e.region_code) {
|
||||
e.checked = !e.checked
|
||||
}
|
||||
})
|
||||
if (e.checked) {
|
||||
this.initPonit(e)
|
||||
this.refresh(e)
|
||||
}
|
||||
},
|
||||
setStartcode (e) {
|
||||
this.scodeArr.push(e.device_code)
|
||||
this.scodenameArr.push(e.device_name)
|
||||
},
|
||||
setNextcode (e) {
|
||||
this.nObj = e
|
||||
},
|
||||
/** 清空点位选择 */
|
||||
cancle () {
|
||||
this.scodeArr = []
|
||||
this.scodenameArr = []
|
||||
this.nObj = {}
|
||||
this.disabled1 = false
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (this.scodeArr.length === 0 || JSON.stringify(this.nObj) === '{}') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._callTask()
|
||||
},
|
||||
async _callTask () {
|
||||
try {
|
||||
let res = await callTask(this.scodeArr, this.nObj.device_code)
|
||||
this.toast(res.desc)
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
setTimeout(() => {
|
||||
this.refresh()
|
||||
this.cancle()
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.locate_block
|
||||
width 100%
|
||||
background-color #fff
|
||||
border-radius 5px
|
||||
padding .1rem
|
||||
margin-bottom .12rem
|
||||
.locate_name
|
||||
position relative
|
||||
_wh(100%,.48rem)
|
||||
h2
|
||||
_font(.32rem,.48rem,#000,500)
|
||||
.site_block
|
||||
_wh(100%,auto)
|
||||
overflow hidden
|
||||
transition height .3s
|
||||
.site_item
|
||||
_wh(32%,1rem)
|
||||
margin-top .12rem
|
||||
background-color #e5e5e5
|
||||
border-radius 5px
|
||||
margin-right 2%
|
||||
overflow hidden
|
||||
&:nth-child(3n)
|
||||
margin-right 0
|
||||
.site_item_box
|
||||
_wh(100%, 1rem)
|
||||
margin 0
|
||||
overflow hidden
|
||||
h3
|
||||
display block
|
||||
width .32rem
|
||||
_font(.28rem,.4rem,#000,500)
|
||||
margin .1rem 0
|
||||
.site_item_box_inner_r
|
||||
_fj(center)
|
||||
flex-direction column
|
||||
_wh(100%, 1rem)
|
||||
border-radius 3px
|
||||
overflow hidden
|
||||
p
|
||||
display block
|
||||
_wh(100%, .5rem)
|
||||
overflow hidden
|
||||
_font(.28rem,.5rem,#fff,,center)
|
||||
padding 0 .05rem
|
||||
.open_icon
|
||||
position absolute
|
||||
right 0
|
||||
top 0
|
||||
_wh(.48rem,.48rem)
|
||||
_font(.4rem,.48rem,$red,,right)
|
||||
transition all .3s
|
||||
transform rotateZ(180deg)
|
||||
.is_reverse
|
||||
transform rotateZ(0)
|
||||
.gray
|
||||
background-color #b3aeae
|
||||
.blue
|
||||
background-color $blue
|
||||
.green
|
||||
background-color $green
|
||||
.orange
|
||||
background-color orange
|
||||
.submit-bar
|
||||
height 1.6rem
|
||||
padding .1rem
|
||||
.dot_item
|
||||
width 35%
|
||||
background-color #e5e5e5
|
||||
.p1
|
||||
display block
|
||||
height .6rem
|
||||
_font(.15rem,.6rem,,,center)
|
||||
border-bottom .01rem solid #fff
|
||||
overflow hidden
|
||||
.p2
|
||||
display block
|
||||
_fj(center)
|
||||
height .8rem
|
||||
padding 0 .05rem
|
||||
_font(.15rem,.4rem,,,center)
|
||||
overflow hidden
|
||||
word-break: break-all
|
||||
.btn_block
|
||||
_wh(20%, 1.4rem)
|
||||
_fj()
|
||||
flex-direction column
|
||||
.btn1
|
||||
width 100%
|
||||
.content
|
||||
height calc(100% - 2.7rem)
|
||||
.locate_block_wrap
|
||||
height 100%
|
||||
overflow-y auto
|
||||
.msg_item_flex_2
|
||||
width 100%
|
||||
_fj()
|
||||
.msg_item1
|
||||
width calc(50% - .1rem)
|
||||
.from_item
|
||||
border-bottom .01rem solid #dcdfe6
|
||||
.s_n_code_tip
|
||||
_fj()
|
||||
_wh(100%, .5rem)
|
||||
padding .1rem
|
||||
background-color rgba(229, 229, 229, .5)
|
||||
border-bottom-right-radius 5px
|
||||
border-bottom-left-radius 5px
|
||||
.s_code_tip
|
||||
_wh(50%, .3rem)
|
||||
_font(.24rem, .3rem, $blue, ,center)
|
||||
border-right .01rem solid $blue
|
||||
.n_code_tip
|
||||
_wh(50%, .3rem)
|
||||
_font(.24rem, .3rem, $red, ,center)
|
||||
</style>
|
||||
@@ -1,236 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="任务生成"></nav-bar>
|
||||
<section class="content mgt15">
|
||||
<div class="locate_block_wrap">
|
||||
<div class="locate_block" v-for="e in areaArr" :key="e.region_id">
|
||||
<div class="locate_name" @click="getPonit(e)">
|
||||
<h2>{{e.region_name}}</h2>
|
||||
<div class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></div>
|
||||
</div>
|
||||
<div v-show="e.checked === true" class="site_block clear" ref="liCon">
|
||||
<div class="site_item fl" v-for="(el, i) in e.deviceArr" :key="i" @click="setInfo(el)">
|
||||
<div class="site_item_box clear">
|
||||
<h3 class="fl">站点</h3>
|
||||
<div class="fl site_item_box_inner_r">
|
||||
<p class="bg_white">{{el.device_name}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<div class="dot_item">
|
||||
<p class="p1">起始点</p>
|
||||
<p class="p2">设备号:{{scodeObj.device_name}}</p>
|
||||
</div>
|
||||
<div class="dot_item">
|
||||
<p class="p1">目标点</p>
|
||||
<p class="p2">设备号:{{ncodeObj.device_name}}</p>
|
||||
</div>
|
||||
<div class="btn_block">
|
||||
<button class="btn btn1" :class="{'btn-disabled': JSON.stringify(scodeObj) === '{}' && JSON.stringify(ncodeObj) === '{}'}" @click="cancle">清空</button>
|
||||
<button class="btn btn1" :class="{'btn-disabled': JSON.stringify(scodeObj) === '{}' || JSON.stringify(ncodeObj) === '{}'}" :disabled="disabled1" @click="toSure">确认</button>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import {queryDevice, pdaTask} from '@config/getData2'
|
||||
export default {
|
||||
name: 'PaintTask',
|
||||
components: {
|
||||
NavBar,
|
||||
DropdownMenu
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
areaArr: [],
|
||||
scodeObj: {},
|
||||
ncodeObj: {},
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.refresh()
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
},
|
||||
methods: {
|
||||
refresh () {
|
||||
this._queryDevice()
|
||||
this.timer = setInterval(() => {
|
||||
this._queryDevice()
|
||||
}, this.interTime)
|
||||
},
|
||||
/** 查询设备 */
|
||||
async _queryDevice () {
|
||||
let res = await queryDevice()
|
||||
this.areaArr = [...res.result.regionja]
|
||||
this.areaArr.map(el => {
|
||||
this.$set(el, 'checked', true)
|
||||
})
|
||||
},
|
||||
getPonit (e) {
|
||||
this.areaArr.map(el => {
|
||||
if (el.region_id === e.region_id) {
|
||||
e.checked = !e.checked
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 设为起始点目标点 */
|
||||
setInfo (e) {
|
||||
if (JSON.stringify(this.scodeObj) === '{}') {
|
||||
this.scodeObj = e
|
||||
} else if (JSON.stringify(this.ncodeObj) === '{}') {
|
||||
this.ncodeObj = e
|
||||
}
|
||||
},
|
||||
/** 清空点位选择 */
|
||||
cancle () {
|
||||
this.scodeObj = {}
|
||||
this.ncodeObj = {}
|
||||
this.disabled1 = false
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (JSON.stringify(this.scodeObj) === '{}' || JSON.stringify(this.ncodeObj) === '{}') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._pdaTask()
|
||||
},
|
||||
async _pdaTask () {
|
||||
try {
|
||||
let res = await pdaTask(this.scodeObj.device_code, this.ncodeObj.device_code)
|
||||
this.toast(res.desc)
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
setTimeout(() => {
|
||||
this.refresh()
|
||||
this.scodeObj = {}
|
||||
this.ncodeObj = {}
|
||||
this.disabled1 = false
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.locate_block
|
||||
width 100%
|
||||
background-color #fff
|
||||
border-radius 5px
|
||||
padding .1rem
|
||||
margin-bottom .12rem
|
||||
.locate_name
|
||||
position relative
|
||||
_wh(100%,24px)
|
||||
h2
|
||||
_font(16px,24px,#000,500)
|
||||
.site_block
|
||||
_wh(100%,auto)
|
||||
overflow hidden
|
||||
transition height .3s
|
||||
.site_item
|
||||
_wh(32%,50px)
|
||||
padding 0 .1rem
|
||||
margin-top .12rem
|
||||
background-color #e5e5e5
|
||||
border-radius 5px
|
||||
margin-right 2%
|
||||
overflow hidden
|
||||
&:nth-child(3n)
|
||||
margin-right 0
|
||||
.site_item_box
|
||||
_wh(100%, 40px)
|
||||
margin 5px 0
|
||||
overflow hidden
|
||||
h3
|
||||
display block
|
||||
width 18px
|
||||
_font(14px,20px,#000,500)
|
||||
.site_item_box_inner_r
|
||||
_fj(center)
|
||||
flex-direction column
|
||||
_wh(calc(100% - 18px), 40px)
|
||||
background-color #fff
|
||||
border-radius 3px
|
||||
overflow hidden
|
||||
p
|
||||
display block
|
||||
_wh(100%, 20px)
|
||||
overflow hidden
|
||||
_font(14px,20px,#999,,center)
|
||||
padding 0 .05rem
|
||||
.bg_white
|
||||
background-color #fff
|
||||
.open_icon
|
||||
position absolute
|
||||
right 0
|
||||
top 0
|
||||
_wh(24px,24px)
|
||||
_font(20px,24px,$red,,right)
|
||||
transition all .3s
|
||||
transform rotateZ(180deg)
|
||||
.is_reverse
|
||||
transform rotateZ(0)
|
||||
.gray
|
||||
background-color #e5e5e5
|
||||
.blue
|
||||
background-color $blue
|
||||
.green
|
||||
background-color $green
|
||||
.orange
|
||||
background-color orange
|
||||
.submit-bar
|
||||
height 1.6rem
|
||||
padding .1rem
|
||||
.dot_item
|
||||
width 35%
|
||||
background-color #e5e5e5
|
||||
.p1
|
||||
display block
|
||||
height .6rem
|
||||
_font(.15rem,.6rem,,,center)
|
||||
border-bottom .01rem solid #fff
|
||||
overflow hidden
|
||||
.p2
|
||||
display block
|
||||
height .8rem
|
||||
padding 0 .05rem
|
||||
_font(.15rem,.8rem,,,center)
|
||||
overflow hidden
|
||||
.btn_block
|
||||
_wh(20%, 1.4rem)
|
||||
_fj()
|
||||
flex-direction column
|
||||
.btn1
|
||||
width 100%
|
||||
.content
|
||||
height calc(100% - 2.7rem)
|
||||
.locate_block_wrap
|
||||
height 100%
|
||||
overflow-y auto
|
||||
.msg_item_flex_2
|
||||
width 100%
|
||||
_fj()
|
||||
.msg_item1
|
||||
width calc(50% - .1rem)
|
||||
.from_item
|
||||
border-bottom .01rem solid #dcdfe6
|
||||
</style>
|
||||
@@ -1,127 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="压制叫料"></nav-bar>
|
||||
<section class="content mgt186">
|
||||
<div class="filter-wraper">
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">点位</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option1"
|
||||
:active="active1"
|
||||
:open="open1"
|
||||
@toggleItem="toggleItem1"
|
||||
@dropdownMenu="dropdownMenu1">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">是否满托</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option2"
|
||||
:active="active2"
|
||||
:open="open2"
|
||||
@toggleItem="toggleItem2"
|
||||
@dropdownMenu="dropdownMenu2">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" :class="{'btn-disabled' : active1 === '' || active2 === ''}" :disabled="disabled1" @click="_callMaterialconfirm">确定</button>
|
||||
<button class="btn submit-button" @click="toCancle">取消</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import {callMaterialqueryPoint, callMaterialconfirm} from '@config/getData1'
|
||||
export default {
|
||||
name: 'PressCallMater',
|
||||
components: {
|
||||
NavBar,
|
||||
DropdownMenu
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
option1: [],
|
||||
active1: '',
|
||||
open1: false,
|
||||
option2: [{value: '1', label: '是'}, {value: '2', label: '否'}],
|
||||
active2: '',
|
||||
open2: false,
|
||||
disabled1: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._callMaterialqueryPoint()
|
||||
},
|
||||
methods: {
|
||||
/** 1.1查询点位 */
|
||||
async _callMaterialqueryPoint () {
|
||||
let res = await callMaterialqueryPoint()
|
||||
if (res.code === '1') {
|
||||
this.option1 = [...res.result]
|
||||
this.option1.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'label', el.point_name)
|
||||
})
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 确定 */
|
||||
async _callMaterialconfirm () {
|
||||
this.disabled1 = true
|
||||
if (this.active1 === '' || this.active2 === '') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await callMaterialconfirm(this.option1[this.active1].point_id, this.option1[this.active1].point_code, this.option1[this.active1].point_name, this.option2[this.active2].value)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this.toCancle()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
/** 取消 */
|
||||
toCancle () {
|
||||
this.active1 = ''
|
||||
this.active2 = ''
|
||||
this.disabled1 = false
|
||||
},
|
||||
toggleItem1 () {
|
||||
if (!this.open1) {
|
||||
this.open1 = true
|
||||
} else {
|
||||
this.open1 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu1 (i) {
|
||||
this.active1 = i + ''
|
||||
this.open1 = false
|
||||
},
|
||||
toggleItem2 () {
|
||||
if (!this.open2) {
|
||||
this.open2 = true
|
||||
} else {
|
||||
this.open2 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu2 (i) {
|
||||
this.active2 = i + ''
|
||||
this.open2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
301
src/pages/proj/SiteManage.vue
Normal file
301
src/pages/proj/SiteManage.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="站点管理"></nav-bar>
|
||||
<section class="content mgt15">
|
||||
<div class="clear icons">
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon gray"></div>
|
||||
<div class="font_icon">空</div>
|
||||
</div>
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon green"></div>
|
||||
<div class="font_icon">有货</div>
|
||||
</div>
|
||||
<div class="fl item_icon">
|
||||
<div class="color_icon orange"></div>
|
||||
<div class="font_icon">有任务</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="locate_block" v-for="e in areaArr" :key="e.region_code">
|
||||
<div class="locate_name" @click="getPonit (e)">
|
||||
<h2>{{e.region_name}}</h2>
|
||||
<div class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></div>
|
||||
</div>
|
||||
<div v-show="e.checked === true" class="site_block clear" ref="liCon">
|
||||
<div class="site_item fl" v-for="(el, i) in e.pointArr" :key="i" :class="['gray', 'green', 'orange'][Number(el.status)]" @click="setInfo(el)">
|
||||
<div class="site_item_box clear">
|
||||
<h3 class="fl">站点</h3>
|
||||
<div class="fl site_item_box_inner_r">
|
||||
<p class="bg_white">{{el.device_name}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div v-if="active" class="msg_wrapper">
|
||||
<div class="msg_box">
|
||||
<div class="msg_item">
|
||||
<div class="label_item">当前设备</div>
|
||||
<div class="from_item">
|
||||
{{obj.device_name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="msg_item">
|
||||
<div class="label_item">当前物料</div>
|
||||
<div class="from_item">
|
||||
<el-select v-model="value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="msg_btns">
|
||||
<button class="msg_btn" :disabled="disabled1" @click="cleanUp">清空</button>
|
||||
<button class="msg_btn" :disabled="disabled2" @click="msgSure">确认</button>
|
||||
<button class="msg_btn" @click="msgCancle">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="active" class="mask"></div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea, queryMaterial, bindpoint} from '@config/getData2'
|
||||
export default {
|
||||
name: 'siteManage',
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
areaArr: [],
|
||||
pointArr: [],
|
||||
regobj: {},
|
||||
active: false,
|
||||
options: [],
|
||||
value: '',
|
||||
obj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
document.body.removeAttribute('class', 'login-bg')
|
||||
this.initArea()
|
||||
this.initHandMatrial()
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
refresh (e) {
|
||||
this.timer = setInterval(() => {
|
||||
this.initPonit(e)
|
||||
}, this.interTime)
|
||||
},
|
||||
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])
|
||||
}
|
||||
},
|
||||
async initPonit (e) {
|
||||
let res = await queryPointByArea(e.region_code)
|
||||
this.regobj = e
|
||||
this.areaArr.map(el => {
|
||||
if (el.region_code === e.region_code) {
|
||||
this.$set(el, 'pointArr', [...res.result])
|
||||
}
|
||||
})
|
||||
},
|
||||
async initHandMatrial () {
|
||||
let res = await queryMaterial()
|
||||
this.options = [...res.result]
|
||||
},
|
||||
getPonit (e) {
|
||||
clearInterval(this.timer)
|
||||
this.areaArr.map(el => {
|
||||
if (el.region_code !== e.region_code) {
|
||||
el.checked = false
|
||||
}
|
||||
if (el.region_code === e.region_code) {
|
||||
e.checked = !e.checked
|
||||
}
|
||||
})
|
||||
if (e.checked) {
|
||||
this.initPonit(e)
|
||||
this.refresh(e)
|
||||
}
|
||||
},
|
||||
setInfo (e) {
|
||||
if (e.input_material === '1') {
|
||||
this.active = true
|
||||
this.obj = e
|
||||
this.value = e.material_type
|
||||
}
|
||||
},
|
||||
msgCancle () {
|
||||
this.active = false
|
||||
this.obj = {}
|
||||
this.value = ''
|
||||
},
|
||||
msgSure () {
|
||||
this.disabled2 = true
|
||||
this.handStatus(this.obj.device_code, this.value, '1', this.obj.status)
|
||||
this.active = false
|
||||
},
|
||||
cleanUp () {
|
||||
this.disabled1 = true
|
||||
this.handStatus(this.obj.device_code, this.value, '2', this.obj.status)
|
||||
this.active = false
|
||||
},
|
||||
async handStatus (code, mtype, type, no) {
|
||||
try {
|
||||
let res = await bindpoint(code, mtype, type, no)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
clearInterval(this.timer)
|
||||
var that = this
|
||||
setTimeout(() => {
|
||||
that.initPonit(this.regobj)
|
||||
this.refresh(this.regobj)
|
||||
this.value = ''
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}, 2000)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.value = ''
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
this.value = ''
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.locate_block
|
||||
width 100%
|
||||
background-color #fff
|
||||
border-radius 5px
|
||||
padding .1rem
|
||||
margin-bottom .12rem
|
||||
.locate_name
|
||||
position relative
|
||||
_wh(100%,.48rem)
|
||||
h2
|
||||
_font(.32rem,.48rem,#000,500)
|
||||
.site_block
|
||||
_wh(100%,auto)
|
||||
overflow hidden
|
||||
transition height .3s
|
||||
.site_item
|
||||
_wh(32%,1rem)
|
||||
padding 0 .1rem
|
||||
margin-top .12rem
|
||||
background-color #e5e5e5
|
||||
border-radius 5px
|
||||
margin-right 2%
|
||||
overflow hidden
|
||||
&:nth-child(3n)
|
||||
margin-right 0
|
||||
.site_item_box
|
||||
_wh(100%, .8rem)
|
||||
margin .1rem 0
|
||||
overflow hidden
|
||||
h3
|
||||
display block
|
||||
width .32rem
|
||||
_font(.28rem,.4rem,#000,500)
|
||||
.site_item_box_inner_r
|
||||
_fj(center)
|
||||
flex-direction column
|
||||
_wh(calc(100% - .32rem), .8rem)
|
||||
background-color #fff
|
||||
border-radius 3px
|
||||
overflow hidden
|
||||
p
|
||||
display block
|
||||
_wh(100%, .4rem)
|
||||
overflow hidden
|
||||
_font(.28rem,.4rem,#999,,center)
|
||||
padding 0 .05rem
|
||||
.bg_white
|
||||
background-color #fff
|
||||
.open_icon
|
||||
position absolute
|
||||
right 0
|
||||
top 0
|
||||
_wh(.48rem,.48rem)
|
||||
_font(.4rem,.48rem,$red,,right)
|
||||
transition all .3s
|
||||
transform rotateZ(180deg)
|
||||
.is_reverse
|
||||
transform rotateZ(0)
|
||||
.gray
|
||||
background-color #e5e5e5
|
||||
.blue
|
||||
background-color $blue
|
||||
.green
|
||||
background-color $green
|
||||
.orange
|
||||
background-color orange
|
||||
.submit-bar
|
||||
height 1.6rem
|
||||
padding .1rem
|
||||
.dot_item
|
||||
width 35%
|
||||
background-color #e5e5e5
|
||||
.p1
|
||||
display block
|
||||
height .6rem
|
||||
_font(.15rem,.6rem,,,center)
|
||||
border-bottom .01rem solid #fff
|
||||
overflow hidden
|
||||
.p2
|
||||
display block
|
||||
height .8rem
|
||||
padding 0 .05rem
|
||||
_font(.15rem,.8rem,,,center)
|
||||
overflow hidden
|
||||
.btn_block
|
||||
_wh(20%, 1.4rem)
|
||||
_fj()
|
||||
flex-direction column
|
||||
.btn1
|
||||
width 100%
|
||||
.content
|
||||
height calc(100% - 2.7rem)
|
||||
.locate_block_wrap
|
||||
height 100%
|
||||
overflow-y auto
|
||||
.msg_item_flex_2
|
||||
width 100%
|
||||
_fj()
|
||||
.msg_item1
|
||||
width calc(50% - .1rem)
|
||||
.from_item
|
||||
border-bottom .01rem solid #dcdfe6
|
||||
</style>
|
||||
@@ -10,7 +10,8 @@ const Setup = r => require.ensure([], () => r(require('../pages/login/Setup')),
|
||||
const Password = r => require.ensure([], () => r(require('../pages/proj/Password')), 'Password')
|
||||
const TaskManage = r => require.ensure([], () => r(require('../pages/proj/TaskManage')), 'TaskManage')
|
||||
const ZlManage = r => require.ensure([], () => r(require('../pages/proj/ZlManage')), 'ZlManage')
|
||||
const PaintTask = r => require.ensure([], () => r(require('../pages/proj/PaintTask')), 'PaintTask')
|
||||
const SiteManage = r => require.ensure([], () => r(require('../pages/proj/SiteManage')), 'SiteManage')
|
||||
const CallManage = r => require.ensure([], () => r(require('../pages/proj/CallManage')), 'CallManage')
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@@ -56,8 +57,12 @@ export default new Router({
|
||||
component: ZlManage
|
||||
},
|
||||
{
|
||||
path: '/PaintTask', // 任务生成
|
||||
component: PaintTask
|
||||
path: '/SiteManage', // 站点管理
|
||||
component: SiteManage
|
||||
},
|
||||
{
|
||||
path: '/CallManage', // 呼叫管理
|
||||
component: CallManage
|
||||
}
|
||||
],
|
||||
scrollBehavior (to, from, savedPosition) {
|
||||
|
||||
Reference in New Issue
Block a user