add点位放货确认
This commit is contained in:
@@ -48,3 +48,9 @@ export const handTask2 = (code, mtype, type, batch) => post('api/aja/hand/task2'
|
|||||||
type: type,
|
type: type,
|
||||||
batch: batch
|
batch: batch
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 1.5点位放货确认
|
||||||
|
export const handpointPut = (code, type) => post('api/aja/hand/pointPut', {
|
||||||
|
device_code: code,
|
||||||
|
status_type: type
|
||||||
|
})
|
||||||
|
|||||||
@@ -15,9 +15,10 @@
|
|||||||
</section>
|
</section>
|
||||||
<div class="con">
|
<div class="con">
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="toPage('sitemanage')">站点管理</li>
|
|
||||||
<!-- <li @click="toPage('taskgenerate')">任务生成</li> -->
|
<!-- <li @click="toPage('taskgenerate')">任务生成</li> -->
|
||||||
<li @click="toPage('painttask')">任务生成</li>
|
<li @click="toPage('painttask')">任务生成</li>
|
||||||
|
<li @click="toPage('sitemanage')">站点管理</li>
|
||||||
|
<li @click="toPage('PointRelease')">点位放货确认</li>
|
||||||
<li @click="toPage('taskmanage')">任务管理</li>
|
<li @click="toPage('taskmanage')">任务管理</li>
|
||||||
<li @click="toPage('zlmanage')">指令管理</li>
|
<li @click="toPage('zlmanage')">指令管理</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
275
src/pages/proj/PointRelease.vue
Normal file
275
src/pages/proj/PointRelease.vue
Normal file
@@ -0,0 +1,275 @@
|
|||||||
|
<template>
|
||||||
|
<section>
|
||||||
|
<nav-bar title="点位放货确认"></nav-bar>
|
||||||
|
<section class="content mgt15">
|
||||||
|
<div class="clear icons">
|
||||||
|
<div class="fl item_icon">
|
||||||
|
<div class="color_icon blue"></div>
|
||||||
|
<div class="font_icon">等待确认</div>
|
||||||
|
</div>
|
||||||
|
<div class="fr item_icon item_icon_1">
|
||||||
|
<button class="msg_btn msg_btn_1" @click="toFresh">刷新</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<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 in e.pointArr1" :key="el.device_code" :class="el.status === '4' ? 'green' : 'orange'" @click="setInfo(el)">
|
||||||
|
<div class="site_item_box clear">
|
||||||
|
<h3 class="fl">站点</h3>
|
||||||
|
<p class="fl">{{el.device_name}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="site_item fl" v-for="el in e.pointArr2" :key="el.device_code" :class="el.status === '4' ? 'green' : 'orange'" @click="setInfo(el)">
|
||||||
|
<div class="site_item_box clear">
|
||||||
|
<h3 class="fl">站点</h3>
|
||||||
|
<p class="fl">{{el.device_name}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div v-if="active" class="msg_wrapper">
|
||||||
|
<div class="msg_box">
|
||||||
|
<div class="msg_item">
|
||||||
|
<p>请确认是否放货完成?</p>
|
||||||
|
</div>
|
||||||
|
<div class="msg_btns">
|
||||||
|
<button class="msg_btn" :disabled="disabled" @click="toSure">确认</button>
|
||||||
|
<button class="msg_btn" @click="cancle">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="active" class="mask"></div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import NavBar from '@components/NavBar.vue'
|
||||||
|
import {handArea, handPoint, handpointPut} from '@config/getData2'
|
||||||
|
export default {
|
||||||
|
name: 'PointRelease',
|
||||||
|
components: {
|
||||||
|
NavBar
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
interTime: this.$store.getters.setTime,
|
||||||
|
timer: null,
|
||||||
|
liConHeight: 0, // 折叠面板内容初始高度
|
||||||
|
areaArr: [],
|
||||||
|
pointArr: [],
|
||||||
|
reg: '',
|
||||||
|
active: false,
|
||||||
|
obj: {},
|
||||||
|
disabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
document.body.removeAttribute('class', 'login-bg')
|
||||||
|
this.initArea()
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
refresh (e) {
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.initPonit(e)
|
||||||
|
}, this.interTime)
|
||||||
|
},
|
||||||
|
toFresh () {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.initPonit(this.reg)
|
||||||
|
this.refresh(this.reg)
|
||||||
|
this.obj = {}
|
||||||
|
this.active = false
|
||||||
|
this.disabled = false
|
||||||
|
},
|
||||||
|
async initArea () {
|
||||||
|
let res = await handArea('0')
|
||||||
|
if (res.code === '1') {
|
||||||
|
this.areaArr = [...res.result]
|
||||||
|
this.areaArr.map(el => {
|
||||||
|
this.$set(el, 'checked', false)
|
||||||
|
this.$set(el, 'pointArr1', [])
|
||||||
|
this.$set(el, 'pointArr2', [])
|
||||||
|
})
|
||||||
|
if (this.areaArr.length > 0) {
|
||||||
|
this.getPonit(this.areaArr[0])
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Dialog(res.desc)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async initPonit (e) {
|
||||||
|
let res = await handPoint(e.region_id)
|
||||||
|
if (res.code === '1') {
|
||||||
|
this.regobj = e
|
||||||
|
let arr1 = []
|
||||||
|
let arr2 = []
|
||||||
|
res.result.map(el => {
|
||||||
|
if (Number(el.seq_num) <= 10) {
|
||||||
|
arr1.push(el)
|
||||||
|
}
|
||||||
|
if (Number(el.seq_num) > 10 && Number(el.seq_num) <= 20) {
|
||||||
|
arr2.push(el)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.areaArr.map(el => {
|
||||||
|
if (el.region_id === e.region_id) {
|
||||||
|
this.$set(el, 'pointArr1', [...arr1])
|
||||||
|
this.$set(el, 'pointArr2', [...arr2])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.Dialog(res.desc)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPonit (e) {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.areaArr.map(el => {
|
||||||
|
if (el.region_id !== e.region_id) {
|
||||||
|
el.checked = false
|
||||||
|
}
|
||||||
|
if (el.region_id === e.region_id) {
|
||||||
|
e.checked = !e.checked
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (e.checked) {
|
||||||
|
this.initPonit(e)
|
||||||
|
this.refresh(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toOpen (i) {
|
||||||
|
const liCon = this.$refs.liCon[i]
|
||||||
|
let height = liCon.offsetHeight
|
||||||
|
if (height === this.liConHeight) { // 展开
|
||||||
|
liCon.style.height = 'auto'
|
||||||
|
height = liCon.offsetHeight
|
||||||
|
liCon.style.height = this.liConHeight + 'px'
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
let f = document.body.offsetHeight // 必加
|
||||||
|
liCon.style.height = height + 'px'
|
||||||
|
} else { // 收缩
|
||||||
|
liCon.style.height = this.liConHeight + 'px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setInfo (e) {
|
||||||
|
if (e.status === '4') {
|
||||||
|
this.active = true
|
||||||
|
this.obj = e
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancle () {
|
||||||
|
this.active = false
|
||||||
|
},
|
||||||
|
async toSure () {
|
||||||
|
this.disabled = true
|
||||||
|
try {
|
||||||
|
let res = await handpointPut(this.obj.device_code, '1')
|
||||||
|
if (res.code === '1') {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.toast(res.desc)
|
||||||
|
this.initPonit(this.reg)
|
||||||
|
this.refresh(this.reg)
|
||||||
|
this.obj = {}
|
||||||
|
} else {
|
||||||
|
this.Dialog(res.desc)
|
||||||
|
}
|
||||||
|
this.active = false
|
||||||
|
this.disabled = false
|
||||||
|
} catch (e) {
|
||||||
|
this.active = false
|
||||||
|
this.disabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
@import '~@style/mixin'
|
||||||
|
.icons
|
||||||
|
height 24px
|
||||||
|
margin-bottom .12rem
|
||||||
|
.item_icon
|
||||||
|
_fj()
|
||||||
|
margin-right .2rem
|
||||||
|
.color_icon
|
||||||
|
_wh(15px,15px)
|
||||||
|
border-radius 50%
|
||||||
|
margin-right .1rem
|
||||||
|
.font_icon
|
||||||
|
_font(.32rem, .48rem, #000)
|
||||||
|
.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
|
||||||
|
ul
|
||||||
|
width 100%
|
||||||
|
clear both
|
||||||
|
.site_item
|
||||||
|
_wh(32%,.8rem)
|
||||||
|
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%, .6rem)
|
||||||
|
margin .1rem 0
|
||||||
|
overflow hidden
|
||||||
|
h3
|
||||||
|
display block
|
||||||
|
width .32rem
|
||||||
|
_font(.24rem,.3rem,#000,500)
|
||||||
|
p
|
||||||
|
display block
|
||||||
|
_wh(calc(100% - .32rem), .6rem)
|
||||||
|
_font(.28rem,.6rem,#999,,center)
|
||||||
|
background-color #fff
|
||||||
|
border-radius 3px
|
||||||
|
padding 0 .05rem
|
||||||
|
.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
|
||||||
|
.item_icon_1
|
||||||
|
_fj(flex-end)
|
||||||
|
height .4rem
|
||||||
|
.msg_btn_1
|
||||||
|
_wh(1rem, .48rem)
|
||||||
|
_font(.26rem, .48rem,#fff,,center)
|
||||||
|
</style>
|
||||||
@@ -19,6 +19,10 @@
|
|||||||
<div class="color_icon orange"></div>
|
<div class="color_icon orange"></div>
|
||||||
<div class="font_icon">有任务</div>
|
<div class="font_icon">有任务</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="fl item_icon">
|
||||||
|
<div class="color_icon red"></div>
|
||||||
|
<div class="font_icon">需要人工解锁</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="locate_block" v-for="e in areaArr" :key="e.region_id">
|
<div class="locate_block" v-for="e in areaArr" :key="e.region_id">
|
||||||
<div class="locate_name" @click="getPonit (e)">
|
<div class="locate_name" @click="getPonit (e)">
|
||||||
@@ -26,7 +30,7 @@
|
|||||||
<div class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></div>
|
<div class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="e.checked === true" class="site_block clear" ref="liCon">
|
<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', 'blue', 'green', 'orange'][Number(el.status)]" @click="setInfo(el)">
|
<div class="site_item fl" v-for="(el, i) in e.pointArr" :key="i" :class="['gray', 'blue', 'green', 'orange', 'red'][Number(el.status)]" @click="setInfo(el)">
|
||||||
<div class="site_item_box clear">
|
<div class="site_item_box clear">
|
||||||
<h3 class="fl">站点</h3>
|
<h3 class="fl">站点</h3>
|
||||||
<p class="fl">{{el.device_name}}</p>
|
<p class="fl">{{el.device_name}}</p>
|
||||||
@@ -305,4 +309,6 @@ export default {
|
|||||||
background-color $green
|
background-color $green
|
||||||
.orange
|
.orange
|
||||||
background-color orange
|
background-color orange
|
||||||
|
.red
|
||||||
|
background-color red
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const Setup = r => require.ensure([], () => r(require('../pages/login/Setup')),
|
|||||||
const TaskManage = r => require.ensure([], () => r(require('../pages/proj/TaskManage')), 'TaskManage')
|
const TaskManage = r => require.ensure([], () => r(require('../pages/proj/TaskManage')), 'TaskManage')
|
||||||
const ZlManage = r => require.ensure([], () => r(require('../pages/proj/ZlManage')), 'ZlManage')
|
const ZlManage = r => require.ensure([], () => r(require('../pages/proj/ZlManage')), 'ZlManage')
|
||||||
const siteManage = r => require.ensure([], () => r(require('../pages/proj/siteManage')), 'siteManage')
|
const siteManage = r => require.ensure([], () => r(require('../pages/proj/siteManage')), 'siteManage')
|
||||||
|
const PointRelease = r => require.ensure([], () => r(require('../pages/proj/PointRelease')), 'PointRelease')
|
||||||
const taskGenerate = r => require.ensure([], () => r(require('../pages/proj/taskGenerate')), 'taskGenerate')
|
const taskGenerate = r => require.ensure([], () => r(require('../pages/proj/taskGenerate')), 'taskGenerate')
|
||||||
const PaintTask = r => require.ensure([], () => r(require('../pages/proj/PaintTask')), 'PaintTask')
|
const PaintTask = r => require.ensure([], () => r(require('../pages/proj/PaintTask')), 'PaintTask')
|
||||||
|
|
||||||
@@ -63,6 +64,10 @@ export default new Router({
|
|||||||
path: '/sitemanage', // 站点管理
|
path: '/sitemanage', // 站点管理
|
||||||
component: siteManage
|
component: siteManage
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/pointrelease', // 点位放货确认
|
||||||
|
component: PointRelease
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/taskgenerate', // 任务生成
|
path: '/taskgenerate', // 任务生成
|
||||||
component: taskGenerate
|
component: taskGenerate
|
||||||
|
|||||||
Reference in New Issue
Block a user