初始化
This commit is contained in:
@@ -1,303 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="inner-wrap">
|
|
||||||
<nav-bar title="设备状态修改"></nav-bar>
|
|
||||||
<div class="clear container">
|
|
||||||
<div class="fl left_block">
|
|
||||||
<div class="item_block" :class="reg === e.region_id ? 'item_block_focus' : ''" v-for="e in areaArr" :key="e.region_id" @click="getPoint(e)"><p>{{e.region_name}}</p></div>
|
|
||||||
</div>
|
|
||||||
<div class="fl right_block">
|
|
||||||
<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 orange"></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 blue"></div>
|
|
||||||
<div class="font_icon">有任务</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="locate_block">
|
|
||||||
<div class="item_locate" v-for="(e, i) in pointArr" :key="i" :class="['gray', 'orange', 'green', 'blue'][Number(e.status)]" @click="setInfo(e)"><p>站点:{{e.device_name}}</p></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="active" class="msg_wrapper">
|
|
||||||
<div class="msg_box">
|
|
||||||
<div class="msg_item">
|
|
||||||
<div class="label_item">设备状态</div>
|
|
||||||
<div class="from_item">
|
|
||||||
<el-radio v-model="radio" label="0">空</el-radio>
|
|
||||||
<el-radio v-model="radio" label="1">空载具</el-radio>
|
|
||||||
<el-radio v-model="radio" label="2">有货</el-radio>
|
|
||||||
<el-radio v-model="radio" label="3">有任务</el-radio>
|
|
||||||
</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_item">
|
|
||||||
<div class="label_item">物料数量</div>
|
|
||||||
<div class="from_item">
|
|
||||||
<input type="number" class="msg_input" v-model="val1">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="msg_item">
|
|
||||||
<div class="label_item">物料备注</div>
|
|
||||||
<div class="from_item">
|
|
||||||
<input type="text" class="msg_input" v-model="val2">
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import NavBar from '@components/NavBar.vue'
|
|
||||||
import {handArea, handPoint, handDeviceStatus, handMatrial} from '@config/getData2'
|
|
||||||
export default {
|
|
||||||
name: 'EquipStatus',
|
|
||||||
components: {
|
|
||||||
NavBar
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
options: [],
|
|
||||||
value: '',
|
|
||||||
val1: '',
|
|
||||||
val2: '',
|
|
||||||
radio: '',
|
|
||||||
active: false,
|
|
||||||
areaArr: [],
|
|
||||||
pointArr: [],
|
|
||||||
reg: '',
|
|
||||||
obj: {},
|
|
||||||
disabled1: false,
|
|
||||||
disabled2: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.initArea()
|
|
||||||
this.initHandMatrial()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async initArea () {
|
|
||||||
let res = await handArea('0')
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.areaArr = [...res.result]
|
|
||||||
if (this.areaArr.length > 0) {
|
|
||||||
this.initPonit(this.areaArr[0].region_id)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async initPonit (reg) {
|
|
||||||
let res = await handPoint(reg)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.pointArr = [...res.result]
|
|
||||||
this.reg = reg
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 物料信息 */
|
|
||||||
async initHandMatrial () {
|
|
||||||
let res = await handMatrial()
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.options = [...res.result]
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 根据区域查询设备编号及状态 */
|
|
||||||
getPoint (e) {
|
|
||||||
this.initPonit(e.region_id)
|
|
||||||
},
|
|
||||||
/** 修改设备状态 */
|
|
||||||
setInfo (e) {
|
|
||||||
if (e.allow_update === '1') {
|
|
||||||
this.active = true
|
|
||||||
this.obj = e
|
|
||||||
this.radio = e.status
|
|
||||||
this.value = e.material_type
|
|
||||||
this.val1 = e.quantity
|
|
||||||
this.val2 = e.remark
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async handStatus (code, type) {
|
|
||||||
try {
|
|
||||||
let res = await handDeviceStatus(code, type, this.radio, this.value, this.val1 + '', this.val2)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.toast(res.desc)
|
|
||||||
this.initPonit(this.reg)
|
|
||||||
this.value = ''
|
|
||||||
this.radio = ''
|
|
||||||
this.val1 = ''
|
|
||||||
this.val2 = ''
|
|
||||||
this.disabled1 = false
|
|
||||||
this.disabled2 = false
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
this.value = ''
|
|
||||||
this.radio = ''
|
|
||||||
this.val1 = ''
|
|
||||||
this.val2 = ''
|
|
||||||
this.disabled1 = false
|
|
||||||
this.disabled2 = false
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
this.value = ''
|
|
||||||
this.radio = ''
|
|
||||||
this.val1 = ''
|
|
||||||
this.val2 = ''
|
|
||||||
this.disabled1 = false
|
|
||||||
this.disabled2 = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
msgCancle () {
|
|
||||||
this.value = ''
|
|
||||||
this.radio = ''
|
|
||||||
this.val1 = ''
|
|
||||||
this.val2 = ''
|
|
||||||
this.active = false
|
|
||||||
},
|
|
||||||
msgSure () {
|
|
||||||
this.disabled2 = true
|
|
||||||
this.handStatus(this.obj.device_code, '1')
|
|
||||||
this.active = false
|
|
||||||
},
|
|
||||||
cleanUp () {
|
|
||||||
this.disabled1 = true
|
|
||||||
this.handStatus(this.obj.device_code, '2')
|
|
||||||
this.active = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
|
||||||
@import '~@style/mixin'
|
|
||||||
// .container
|
|
||||||
// width 100%
|
|
||||||
// height calc(100% - .4rem)
|
|
||||||
// .left_block
|
|
||||||
// width 15%
|
|
||||||
// height 100%
|
|
||||||
// overflow-y scroll
|
|
||||||
// background-color #f7f7f7
|
|
||||||
// .item_block
|
|
||||||
// _fj(center,)
|
|
||||||
// width 95%
|
|
||||||
// height .7rem
|
|
||||||
// border-bottom .02rem solid #e5e5e5
|
|
||||||
// margin 0 auto
|
|
||||||
// padding 0 20%
|
|
||||||
// &:hover
|
|
||||||
// background-color #eaeaea
|
|
||||||
// p
|
|
||||||
// _font(.16rem,.22rem,#444,,center)
|
|
||||||
// .item_block_focus
|
|
||||||
// background-color #e1e1e1
|
|
||||||
// .right_block
|
|
||||||
// width calc(85%)
|
|
||||||
// height 100%
|
|
||||||
// overflow hidden
|
|
||||||
// .icons
|
|
||||||
// height .4rem
|
|
||||||
// line-height .4rem
|
|
||||||
// padding-left .2rem
|
|
||||||
// .item_icon
|
|
||||||
// _fj(flex-start)
|
|
||||||
// width 1rem
|
|
||||||
// .color_icon
|
|
||||||
// _wh(.15rem, .15rem)
|
|
||||||
// border-radius 4px
|
|
||||||
// .font_icon
|
|
||||||
// _font(.14rem,.4rem,#666,,)
|
|
||||||
// padding-left .1rem
|
|
||||||
// .blue
|
|
||||||
// background-color $blue
|
|
||||||
// .green
|
|
||||||
// background-color $green
|
|
||||||
// .orange
|
|
||||||
// background-color orange
|
|
||||||
// .locate_block
|
|
||||||
// width calc(100% - .4rem)
|
|
||||||
// height calc(100% - .6rem)
|
|
||||||
// margin 0 .2rem
|
|
||||||
// overflow-y scroll
|
|
||||||
// .item_locate
|
|
||||||
// float left
|
|
||||||
// _wh(23%,1rem)
|
|
||||||
// margin 0 2% .25rem 0
|
|
||||||
// line-height 1rem
|
|
||||||
// border-radius .1rem
|
|
||||||
// overflow hidden
|
|
||||||
// _fj()
|
|
||||||
// padding 0 .1rem
|
|
||||||
// p
|
|
||||||
// _font(.16rem,.24rem,#fff,,center)
|
|
||||||
// .bottom_block
|
|
||||||
// _fj()
|
|
||||||
// width 100%
|
|
||||||
// height 1rem
|
|
||||||
// padding 0 .2rem
|
|
||||||
// border-top 2px solid #e5e5e5
|
|
||||||
// .dot_item
|
|
||||||
// width 1.4rem
|
|
||||||
// height .7rem
|
|
||||||
// background-color #e5e5e5
|
|
||||||
// margin-right .5rem
|
|
||||||
// .p1
|
|
||||||
// display block
|
|
||||||
// line-height .3rem
|
|
||||||
// border-bottom 1px solid #fff
|
|
||||||
// font-size 16px
|
|
||||||
// text-align center
|
|
||||||
// .p2
|
|
||||||
// display block
|
|
||||||
// line-height .4rem
|
|
||||||
// font-size .15rem
|
|
||||||
// text-align center
|
|
||||||
// .btn_block
|
|
||||||
// width 1.4rem
|
|
||||||
// height 100%
|
|
||||||
// _fj(center,)
|
|
||||||
// flex-direction column
|
|
||||||
// .btn1
|
|
||||||
// width 1rem
|
|
||||||
// height .3rem
|
|
||||||
// line-height .3rem
|
|
||||||
// font-size 14px
|
|
||||||
// text-align center
|
|
||||||
// .mgb20
|
|
||||||
// margin-bottom .1rem
|
|
||||||
// button:disabled
|
|
||||||
// background-color #e1e1e1
|
|
||||||
// color #444
|
|
||||||
</style>
|
|
||||||
@@ -1,185 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="inner-wrap">
|
|
||||||
<nav-bar title="普通任务"></nav-bar>
|
|
||||||
<div class="clear container">
|
|
||||||
<div class="fl left_block">
|
|
||||||
<div class="item_block" :class="reg === e.region_id ? 'item_block_focus' : ''" v-for="e in areaArr" :key="e.region_id" @click="getPoint(e)"><p>{{e.region_name}}</p></div>
|
|
||||||
</div>
|
|
||||||
<div class="fl right_block">
|
|
||||||
<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 orange"></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 blue"></div>
|
|
||||||
<div class="font_icon">有任务</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="locate_block">
|
|
||||||
<div class="item_locate" v-for="(e, i) in pointArr" :key="i" :class="['gray', 'orange', 'green', 'blue'][Number(e.status)]" @click="setInfo(e)"><p>站点:{{e.device_name}}</p></div>
|
|
||||||
</div>
|
|
||||||
<div class="clear bottom_block">
|
|
||||||
<div class="fl dot_item">
|
|
||||||
<p class="p1">起始点</p>
|
|
||||||
<p class="p2">设备号:{{startStr}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="fl dot_item">
|
|
||||||
<p class="p1">目标点</p>
|
|
||||||
<p class="p2">设备号:{{endStr}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="fr btn_block">
|
|
||||||
<button class="btn btn1 mgb20" @click="cancle">清空</button>
|
|
||||||
<button class="btn btn1" :disabled="disabled1" @click="toSure">确认</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="active" class="msg_wrapper">
|
|
||||||
<div class="msg_box">
|
|
||||||
<div class="msg_item">当前任务路线:</div>
|
|
||||||
<div class="msg_btns">
|
|
||||||
<button class="msg_btn">确认</button>
|
|
||||||
<button class="msg_btn">取消</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="active" class="mask"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import NavBar from '@components/NavBar.vue'
|
|
||||||
import {handArea, handPoint, handTask} from '@config/getData2'
|
|
||||||
export default {
|
|
||||||
name: 'GeneralTask',
|
|
||||||
components: {
|
|
||||||
NavBar
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
active: false,
|
|
||||||
areaArr: [],
|
|
||||||
pointArr: [],
|
|
||||||
reg: '',
|
|
||||||
startArr: [],
|
|
||||||
endStr: 'J1',
|
|
||||||
disabled1: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
startStr () {
|
|
||||||
let res = ''
|
|
||||||
let arr = []
|
|
||||||
this.startArr.map(el => {
|
|
||||||
arr.push(el.device_name)
|
|
||||||
})
|
|
||||||
res = arr.join(',')
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.initArea()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async initArea () {
|
|
||||||
let res = await handArea('1')
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.areaArr = [...res.result]
|
|
||||||
if (this.areaArr.length > 0) {
|
|
||||||
this.initPonit(this.areaArr[0].region_id)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async initPonit (reg) {
|
|
||||||
let res = await handPoint(reg)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.pointArr = [...res.result]
|
|
||||||
this.reg = reg
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 根据区域查询设备编号及状态 */
|
|
||||||
getPoint (e) {
|
|
||||||
this.initPonit(e.region_id)
|
|
||||||
},
|
|
||||||
/** 选择起点 */
|
|
||||||
setInfo (e) {
|
|
||||||
if (e.status === '0' || e.status === '3') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let arr1 = this.startArr.filter(el => { return el.device_code === e.device_code })
|
|
||||||
if (arr1.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.startArr.push(e)
|
|
||||||
},
|
|
||||||
cancle () {
|
|
||||||
this.startArr = []
|
|
||||||
},
|
|
||||||
toSure () {
|
|
||||||
this.disabled1 = true
|
|
||||||
if (!this.startArr.length) {
|
|
||||||
this.toast('起始点不能为空')
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.sureTask()
|
|
||||||
},
|
|
||||||
async sureTask () {
|
|
||||||
try {
|
|
||||||
let res = await handTask(this.startArr, this.endStr)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.initPonit(this.reg)
|
|
||||||
this.toast(res.desc)
|
|
||||||
this.startArr = []
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
|
||||||
} catch (err) {
|
|
||||||
this.disabled1 = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
|
||||||
@import '~@style/mixin'
|
|
||||||
.locate_block
|
|
||||||
height calc(100% - 1.4rem)
|
|
||||||
.bottom_block
|
|
||||||
_fj()
|
|
||||||
width 100%
|
|
||||||
height 1rem
|
|
||||||
padding 0 .2rem
|
|
||||||
border-top 2px solid #e5e5e5
|
|
||||||
.btn_block
|
|
||||||
width 1.4rem
|
|
||||||
height 100%
|
|
||||||
_fj(center,)
|
|
||||||
flex-direction column
|
|
||||||
.btn1
|
|
||||||
width 1rem
|
|
||||||
height .3rem
|
|
||||||
line-height .3rem
|
|
||||||
font-size 14px
|
|
||||||
text-align center
|
|
||||||
.mgb20
|
|
||||||
margin-bottom .1rem
|
|
||||||
button:disabled
|
|
||||||
background-color #e1e1e1
|
|
||||||
color #444
|
|
||||||
</style>
|
|
||||||
@@ -16,11 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="toSure('equipstatus')">设备状态修改</li>
|
|
||||||
<li @click="toSure('GeneralTask')">普通任务</li>
|
|
||||||
<li @click="toSure('SpecialTask')">特殊任务</li>
|
|
||||||
<li @click="toSure('zlmanage')">指令管理</li>
|
<li @click="toSure('zlmanage')">指令管理</li>
|
||||||
<li @click="toSure('taskmanage')">任务管理</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,244 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="inner-wrap">
|
|
||||||
<nav-bar title="特殊任务"></nav-bar>
|
|
||||||
<div class="clear container">
|
|
||||||
<div class="fl left_block">
|
|
||||||
<div class="item_block" :class="reg === e.region_id ? 'item_block_focus' : ''" v-for="e in areaArr" :key="e.region_id" @click="getPoint(e)"><p>{{e.region_name}}</p></div>
|
|
||||||
</div>
|
|
||||||
<div class="fl right_block">
|
|
||||||
<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 orange"></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 blue"></div>
|
|
||||||
<div class="font_icon">有任务</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="locate_block">
|
|
||||||
<div class="item_locate" v-for="(e, i) in pointArr" :key="i" :class="['gray', 'orange', 'green', 'blue'][Number(e.status)]">
|
|
||||||
<div class="i_block">
|
|
||||||
<p class="fxcol">站点:{{e.device_name}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="chose_block">
|
|
||||||
<button class="fxcol chose_btn" @click="setInfo(e, '1')">起始点</button>
|
|
||||||
<button class="fxcol chose_btn chose_btn1" @click="setInfo(e, '2')">目标点</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clear bottom_block">
|
|
||||||
<div class="fl dot_item">
|
|
||||||
<p class="p1">起始点</p>
|
|
||||||
<p class="p2">设备号:{{startStr}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="fl dot_item">
|
|
||||||
<p class="p1">目标点</p>
|
|
||||||
<p class="p2">设备号:{{endStr}}</p>
|
|
||||||
</div>
|
|
||||||
<div class="fr btn_block">
|
|
||||||
<button class="btn btn1 mgb20" @click="cancle">清空</button>
|
|
||||||
<button class="btn btn1" :disabled="disabled1" @click="toSure">确认</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="active" class="msg_wrapper">
|
|
||||||
<div class="msg_box">
|
|
||||||
<div class="msg_item">当前任务路线:</div>
|
|
||||||
<div class="msg_btns">
|
|
||||||
<button class="msg_btn">确认</button>
|
|
||||||
<button class="msg_btn">取消</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="active" class="mask"></div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import NavBar from '@components/NavBar.vue'
|
|
||||||
import {handArea, handPoint, spehandTask} from '@config/getData2'
|
|
||||||
export default {
|
|
||||||
name: 'SpecialTask',
|
|
||||||
components: {
|
|
||||||
NavBar
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
active: false,
|
|
||||||
areaArr: [],
|
|
||||||
pointArr: [],
|
|
||||||
reg: '',
|
|
||||||
startArr: [],
|
|
||||||
endArr: [],
|
|
||||||
disabled1: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
startStr () {
|
|
||||||
let res = ''
|
|
||||||
let arr = []
|
|
||||||
this.startArr.map(el => {
|
|
||||||
arr.push(el.device_name)
|
|
||||||
})
|
|
||||||
res = arr.join(',')
|
|
||||||
return res
|
|
||||||
},
|
|
||||||
endStr () {
|
|
||||||
let res = ''
|
|
||||||
let arr = []
|
|
||||||
this.endArr.map(el => {
|
|
||||||
arr.push(el.device_name)
|
|
||||||
})
|
|
||||||
res = arr.join(',')
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.initArea()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async initArea () {
|
|
||||||
let res = await handArea('2')
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.areaArr = [...res.result]
|
|
||||||
if (this.areaArr.length > 0) {
|
|
||||||
this.initPonit(this.areaArr[0].region_id)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async initPonit (reg) {
|
|
||||||
let res = await handPoint(reg)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.pointArr = [...res.result]
|
|
||||||
this.reg = reg
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 根据区域查询设备编号及状态 */
|
|
||||||
getPoint (e) {
|
|
||||||
this.initPonit(e.region_id)
|
|
||||||
},
|
|
||||||
/** 选择起点 */
|
|
||||||
setInfo (e, type) {
|
|
||||||
if (type === '1') {
|
|
||||||
if (e.status === '0' || e.status === '3') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let arr1 = this.startArr.filter(el => { return el.device_code === e.device_code })
|
|
||||||
if (arr1.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.startArr.push(e)
|
|
||||||
}
|
|
||||||
if (type === '2') {
|
|
||||||
let arr1 = this.endArr.filter(el => { return el.device_code === e.device_code })
|
|
||||||
if (arr1.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.endArr.push(e)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cancle () {
|
|
||||||
this.startArr = []
|
|
||||||
this.endArr = []
|
|
||||||
},
|
|
||||||
toSure () {
|
|
||||||
this.disabled1 = true
|
|
||||||
if (!this.startArr.length) {
|
|
||||||
this.toast('起始点不能为空')
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.endArr.length) {
|
|
||||||
this.toast('目标点不能为空')
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.startArr.length !== this.endArr.length) {
|
|
||||||
this.toast('起始点、目标点设备数量必须相同')
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.sureTask()
|
|
||||||
},
|
|
||||||
async sureTask () {
|
|
||||||
try {
|
|
||||||
let res = await spehandTask(this.startArr, this.endArr)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.initPonit(this.reg)
|
|
||||||
this.toast(res.desc)
|
|
||||||
this.startArr = []
|
|
||||||
this.endArr = []
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
|
||||||
} catch (err) {
|
|
||||||
this.disabled1 = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
|
||||||
@import '~@style/mixin'
|
|
||||||
.item_locate
|
|
||||||
display block
|
|
||||||
padding 0
|
|
||||||
.i_block
|
|
||||||
_fj()
|
|
||||||
_wh(100%, .6rem)
|
|
||||||
padding 0 .1rem
|
|
||||||
.chose_block
|
|
||||||
_fj()
|
|
||||||
_wh(100%, .4rem)
|
|
||||||
.chose_btn
|
|
||||||
cursor pointer
|
|
||||||
_wh(50%, .4rem)
|
|
||||||
_font(.14rem, .4rem, #fff,,center)
|
|
||||||
background-color #F56C6C
|
|
||||||
.chose_btn1
|
|
||||||
background-color #fff
|
|
||||||
color #F56C6C
|
|
||||||
.white
|
|
||||||
background-color #fff
|
|
||||||
color $green
|
|
||||||
.locate_block
|
|
||||||
height calc(100% - 1.4rem)
|
|
||||||
.bottom_block
|
|
||||||
_fj()
|
|
||||||
width 100%
|
|
||||||
height 1rem
|
|
||||||
padding 0 .2rem
|
|
||||||
border-top 2px solid #e5e5e5
|
|
||||||
.btn_block
|
|
||||||
width 1.4rem
|
|
||||||
height 100%
|
|
||||||
_fj(center,)
|
|
||||||
flex-direction column
|
|
||||||
.btn1
|
|
||||||
width 1rem
|
|
||||||
height .3rem
|
|
||||||
line-height .3rem
|
|
||||||
font-size 14px
|
|
||||||
text-align center
|
|
||||||
.mgb20
|
|
||||||
margin-bottom .1rem
|
|
||||||
button:disabled
|
|
||||||
background-color #e1e1e1
|
|
||||||
color #444
|
|
||||||
</style>
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="inner-wrap">
|
|
||||||
<nav-bar title="任务管理"></nav-bar>
|
|
||||||
<div class="wrap2">
|
|
||||||
<div class="wrap-filter-button">
|
|
||||||
<div class="wrap-filter clearfix">
|
|
||||||
<div class="fl filter_item">
|
|
||||||
<div class="filter_input">
|
|
||||||
<label class="filter-label">关键字</label>
|
|
||||||
<div class="iliblock">
|
|
||||||
<input type="number" class="input" placeholder="任务号、载具号" v-model="keyword">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="fl filter_item">
|
|
||||||
<div class="filter_input">
|
|
||||||
<label class="filter-label">起点</label>
|
|
||||||
<div class="iliblock">
|
|
||||||
<input type="text" class="input" v-model="startPoint">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="fl filter_item">
|
|
||||||
<div class="filter_input">
|
|
||||||
<label class="filter-label">终点</label>
|
|
||||||
<div class="iliblock">
|
|
||||||
<input type="text" class="input" v-model="endPoint">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="wrap-button clearfix">
|
|
||||||
<button class="button--primary" :disabled="disabled0" @click="toSearch()">查询</button>
|
|
||||||
<button class="button--primary" :disabled="disabled1" @click="toSure('1')">重新生成</button>
|
|
||||||
<button class="button--primary" :disabled="disabled1" @click="toSure('2')">强制完成</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<section class="grid-wraper mgt15">
|
|
||||||
<table class="filter-table">
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<th>任务号</th>
|
|
||||||
<th>起点</th>
|
|
||||||
<th>终点</th>
|
|
||||||
<th>状态</th>
|
|
||||||
<th>物料类型</th>
|
|
||||||
<th>优先级</th>
|
|
||||||
<th>时间</th>
|
|
||||||
</tr>
|
|
||||||
<tr v-for="e in dataList" :key="e.task_uuid" @click="toRadio(e)">
|
|
||||||
<td>
|
|
||||||
<div class="radio__icon radio__icon--round radio__icon--disabled" :class="{'radio__icon--checked': pkId === e.task_uuid}">
|
|
||||||
<i class="iconfont icon"></i>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>{{e.task_no}}</td>
|
|
||||||
<td>{{e.start_devicecode}}</td>
|
|
||||||
<td>{{e.next_devicecode}}</td>
|
|
||||||
<td>{{e.task_status_name}}</td>
|
|
||||||
<td>{{e.material_type_name}}</td>
|
|
||||||
<td>{{e.priority}}</td>
|
|
||||||
<td>{{e.create_time}}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {queryTask, taskOperation} from '@config/getData'
|
|
||||||
import NavBar from '@components/NavBar.vue'
|
|
||||||
export default {
|
|
||||||
name: 'TaskManage',
|
|
||||||
components: {
|
|
||||||
NavBar
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
dataList: [],
|
|
||||||
keyword: '',
|
|
||||||
startPoint: '',
|
|
||||||
endPoint: '',
|
|
||||||
pkId: '',
|
|
||||||
disabled0: false,
|
|
||||||
disabled1: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.queryTask(this.keyword, this.startPoint, this.endPoint)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async queryTask () {
|
|
||||||
try {
|
|
||||||
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.dataList = res.result
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled0 = false
|
|
||||||
} catch (err) {
|
|
||||||
this.Dialog(err)
|
|
||||||
this.disabled0 = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async taskOperation (type) {
|
|
||||||
try {
|
|
||||||
let res = await taskOperation(this.pkId, type)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.toast('操作成功')
|
|
||||||
this.pkId = ''
|
|
||||||
this.dataList = []
|
|
||||||
this.queryTask()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
this.disabled1 = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toSearch () {
|
|
||||||
this.pkId = ''
|
|
||||||
this.dataList = []
|
|
||||||
this.disabled0 = true
|
|
||||||
this.queryTask()
|
|
||||||
},
|
|
||||||
toSure (type) {
|
|
||||||
if (this.pkId) {
|
|
||||||
this.disabled1 = true
|
|
||||||
this.taskOperation(type)
|
|
||||||
} else {
|
|
||||||
this.toast('请查询后进行选择')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toRadio (e) {
|
|
||||||
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="stylus" scoped>
|
|
||||||
.wrap-filter-button
|
|
||||||
padding 0.05rem 0.2rem
|
|
||||||
margin 0
|
|
||||||
.wrap-button
|
|
||||||
margin 0.01rem auto
|
|
||||||
.filter-table
|
|
||||||
margin 0.08rem 0
|
|
||||||
.filter_item
|
|
||||||
margin 0.08rem 0 0 0
|
|
||||||
</style>
|
|
||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
// this.queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async queryInstraction () {
|
async queryInstraction () {
|
||||||
|
|||||||
@@ -4,11 +4,7 @@ import Router from 'vue-router'
|
|||||||
const Login = r => require.ensure([], () => r(require('@page/Login')), 'Login')
|
const Login = r => require.ensure([], () => r(require('@page/Login')), 'Login')
|
||||||
|
|
||||||
const ZlManage = r => require.ensure([], () => r(require('@page/proj/ZlManage')), 'ZlManage')
|
const ZlManage = r => require.ensure([], () => r(require('@page/proj/ZlManage')), 'ZlManage')
|
||||||
const TaskManage = r => require.ensure([], () => r(require('@page/proj/TaskManage')), 'TaskManage')
|
|
||||||
const HomePage = r => require.ensure([], () => r(require('@page/proj/HomePage')), 'HomePage')
|
const HomePage = r => require.ensure([], () => r(require('@page/proj/HomePage')), 'HomePage')
|
||||||
const GeneralTask = r => require.ensure([], () => r(require('@page/proj/GeneralTask')), 'GeneralTask')
|
|
||||||
const SpecialTask = r => require.ensure([], () => r(require('@page/proj/SpecialTask')), 'SpecialTask')
|
|
||||||
const EquipStatus = r => require.ensure([], () => r(require('@page/proj/EquipStatus')), 'EquipStatus')
|
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
@@ -30,22 +26,6 @@ export default new Router({
|
|||||||
{
|
{
|
||||||
path: '/zlmanage',
|
path: '/zlmanage',
|
||||||
component: ZlManage
|
component: ZlManage
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/taskmanage',
|
|
||||||
component: TaskManage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/GeneralTask',
|
|
||||||
component: GeneralTask
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/SpecialTask',
|
|
||||||
component: SpecialTask
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/equipstatus',
|
|
||||||
component: EquipStatus
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user