This commit is contained in:
2022-09-16 15:37:15 +08:00
commit b281e2b076
80 changed files with 14690 additions and 0 deletions

309
src/pages/Login.vue Normal file
View File

@@ -0,0 +1,309 @@
<template>
<div class="login_bg">
<div class="login_wrap">
<div class="login_tab">
<div class="login_tab_line drift" :style="{'left': drift+'%'}"></div>
<div class="login_tab_item" @click="_tabChange(0)">登录</div>
<div class="login_tab_item" @click="_tabChange(50)">配置</div>
</div>
<div class="login_cnt clearfix drift" :style="{'left': '-'+drift*2+'%'}">
<div class="login_card fl">
<div class="card_wrap">
<div class="inputOuter">
<input type="text" placeholder="用户名" v-model="loginname" class="inputStyle">
<button v-show="showBtn3" class="iconfont login_icon delete_icon" @click="clearData(3)"></button>
</div>
<div class="inputOuter">
<input :type="inputType" placeholder="密码" v-model="password" class="inputStyle">
<button class="iconfont login_icon" :class="eyeOpen ? 'eye_colse_icon' : 'eye_open_icon'" @click="passwordShow"></button>
</div>
</div>
<div class="submit">
<button class="btn submit-button" @click="_login" :disabled="disabled">&nbsp;&nbsp;</button>
</div>
<!-- <div class="scanBox" @click="jumpQRCode">
<div class="iconfont scan_icon"></div>
<div class="san_text">扫码登录</div>
</div> -->
</div>
<div class="login_card fl">
<div class="card_wrap">
<div class="inputOuter">
<input type="text" placeholder="域名地址" class="inputStyle" v-model="baseUrl">
<button v-show="showBtn1" class="iconfont login_icon delete_icon" @click="clearData(1)"></button>
</div>
<div class="inputOuter">
<!-- <input type="text" placeholder="图片域名地址" class="inputStyle" v-model="imgBaseUrl">
<button v-show="showBtn2" class="iconfont login_icon delete_icon" @click="clearData(2)"></button> -->
</div>
</div>
<div class="submit">
<button class="btn submit-button" @click="_config">&nbsp;&nbsp;</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {loginApi} from '@config/getData'
import {encrypt} from '../main.js'
export default {
name: 'Login',
data () {
return {
loginname: '',
password: '',
baseUrl: this.$store.getters.baseUrl,
imgBaseUrl: this.$store.getters.imgBaseUrl,
inputType: 'password',
eyeOpen: true,
drift: 0,
disabled: false,
jobnum: '',
qrcode: '',
logintype: ''
}
},
computed: {
showBtn1 () {
return this.baseUrl !== ''
},
showBtn2 () {
return this.imgBaseUrl !== ''
},
showBtn3 () {
return this.loginname !== ''
}
},
destroyed () {
window.lxqrcode = ''
},
// mounted () {
// // window.addEventListener('setItemEvent', this.qrcodeCheck)
// },
// beforeDestroy () {
// window.removeEventListener('setItemEvent', this.qrcodeCheck)
// localStorage.removeItem('qrcodeUrl')
// localStorage.removeItem('qrcode')
// },
methods: {
// qrcodeCheck () {
// this.qrcode = localStorage.getItem('qrcode')
// localStorage.removeItem('qrcodeUrl')
// localStorage.removeItem('qrcode')
// alert('ewm1:' + this.qrcode)
// if (this.qrcode) {
// alert('ewm2:' + this.qrcode)
// this.logintype = '02'
// this.loginApi()
// }
// },
jumpQRCode () {
let passData = (event) => {
// alert('收到值', JSON.stringify(event))
// this.val1 = event.data.lxqrcode
this.qrcode = event.data.lxqrcode
if (this.qrcode) {
// alert('ewm2:' + this.qrcode)
this.logintype = '02'
this.loginApi()
} else {
alert('error')
}
window.removeEventListener('qrcodeEvent', passData)
}
window.addEventListener('qrcodeEvent', passData)
window.location.href = 'loadQRCode'
},
_tabChange (num) {
this.drift = num
},
clearData (d) {
switch (d) {
case 1:
this.baseUrl = ''
break
case 2:
this.imgBaseUrl = ''
break
case 3:
this.loginname = ''
break
}
},
passwordShow () {
this.eyeOpen = !this.eyeOpen
if (this.eyeOpen) {
this.inputType = 'password'
} else {
this.inputType = 'text'
}
},
_config () {
let obj = {
baseUrl: this.baseUrl,
imgBaseUrl: this.imgBaseUrl
}
this.$store.dispatch('setConfig', obj)
this._tabChange(0)
},
async loginApi () {
try {
let res = await loginApi(this.loginname, encrypt(this.password))
if (res.code === '1') {
this.$store.dispatch('setUserInfo', res.result)
this.$router.push('/home')
} else {
this.Dialog(res.desc)
}
this.disabled = false
} catch (err) {
this.disabled = false
this.Dialog(err)
}
},
// loginApi () {
// let data = {
// '_SRVNAME': 'server.app.screenAPI',
// '_SRVMETHOD': 'handlogin',
// '_DATA': JSON.stringify({
// form: {
// user: this.loginname,
// password: this.password
// }
// })
// }
// this
// .$post(data)
// .then(res => {
// if (res.code === '1') {
// this.$store.dispatch('setUserInfo', res.result)
// this.$router.push('/home')
// } else {
// this.Dialog(res.desc)
// }
// this.disabled = false
// })
// .catch(error => {
// this.disabled = false
// this.Dialog(error)
// })
// },
_login () {
this.disabled = true
if (this.loginname === '') {
this.toast('用户名不能为空')
this.disabled = false
return
}
if (this.password === '') {
this.toast('密码不能为空')
this.disabled = false
return
}
this.logintype = '01'
this.loginApi()
}
// jumpQRCode () {
// window.location.href = 'loadQRCode'
// }
}
}
</script>
<style lang="stylus" scoped>
.login_bg
width 100%
height 100%
background center bottom / 100% auto url(../images/bg_01.png) no-repeat
.login_wrap
position fixed
left 50%
top 50%
width 50%
transform translate3d(-50%, -50%, 0)
border-radius 5px
overflow hidden
.login_tab
position relative
height .5rem
border-bottom 1px solid #E2E2E2
margin-bottom .2rem
.login_tab_item
float left
width 50%
font-size .16rem
line-height .5rem
color #444444
text-align center
cursor pointer
.login_tab_line
position absolute
width 50%
height 2px
background-color #D7592F
left 0
bottom -1px
.login_cnt
position relative
width 200%
overflow hidden
.login_card
width 50%
.card_wrap
overflow hidden
.inputOuter
position relative
width 100%
margin .2rem auto
label
display block
font-size .16rem
line-height .3rem
color #333
.inputStyle, select
width 100%
line-height .4rem
height .4rem
color #999
text-indent .1rem
border-bottom 1px solid #E2E2E2
box-sizing border-box
select
appearance auto
outline none
.submit
width 100%
margin .2rem auto
text-align center
.btn
background-color #2778f3
font-size .16rem
line-height .4rem
color #fff
width .9rem
border-radius 5px
.submit-button
width 100%
border-radius .9rem
background linear-gradient(0deg, #D7592F 0%, #E2663C 100%)
.drift
transition left .3s linear
.scan_icon
width .4rem
font-size .3rem
line-height .4rem
color #D7592F
text-align center
border 1px solid #D7592F
border-radius 100%
margin .1rem auto
&::before
content: '\e607'
.san_text
font-size .16rem
color #D7592F
text-align center
</style>

View File

@@ -0,0 +1,303 @@
<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>

View File

@@ -0,0 +1,185 @@
<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>

114
src/pages/proj/HomePage.vue Normal file
View File

@@ -0,0 +1,114 @@
<template>
<div class="inner-wrap">
<div class="top_header">
<header>
<div class="top-left" @click="getInfo">
<div class="fl header-title header-name">登录人员{{this.$store.getters.userName}}</div>
<!-- <button class="fl iconfont dropdown_icon"></button>
<ul class="fl drift" :style="{'height': drift+'rem'}">
<li>部门: {{this.$store.getters.deptName}}</li>
<li @click="exit">退出</li>
</ul> -->
</div>
<div class="fr exitbtn" @click="exit">退出</div>
<!-- <div class="fr date-box">{{date}}&nbsp;{{week}}&nbsp;{{time}}</div> -->
</header>
</div>
<div class="menu">
<ul>
<li @click="toSure('equipstatus')">设备状态修改</li>
<li @click="toSure('GeneralTask')">普通任务</li>
<li @click="toSure('SpecialTask')">特殊任务</li>
<li @click="toSure('zlmanage')">指令管理</li>
<li @click="toSure('taskmanage')">任务管理</li>
</ul>
</div>
</div>
</template>
<script>
export default {
name: 'Home',
data () {
return {
timer: null,
time: '',
date: '',
week: '',
drift: 0
}
},
mounted () {
this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
toTest () {
window.location.href = 'http://192.168.81.171:8083/#/home'
},
updateTime () {
let cd = new Date()
let year = cd.getFullYear()
let month = cd.getMonth() + 1 < 10 ? '0' + (cd.getMonth() + 1) : cd.getMonth() + 1
let date = cd.getDate() < 10 ? '0' + cd.getDate() : cd.getDate()
let hh = cd.getHours() < 10 ? '0' + cd.getHours() : cd.getHours()
let mm = cd.getMinutes() < 10 ? '0' + cd.getMinutes() : cd.getMinutes()
let ss = cd.getSeconds() < 10 ? '0' + cd.getSeconds() : cd.getSeconds()
var weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
let myddy = new Date().getDay()
let week = weekday[myddy]
this.time = `${hh}:${mm}:${ss}`
this.date = `${year}${month}${date}`
this.week = `${week}`
},
getInfo () {
console.log('1')
this.drift = this.drift === 0 ? 0.73 : 0
},
exit () {
this.$store.dispatch('setSignOut')
this.$router.push('/login')
},
toSure (a) {
this.$router.push(a)
}
}
}
</script>
<style lang="stylus" scoped>
.header-title, .date-box,ul li
color #ffffff
.exitbtn
color #ffffff
width 0.6rem
text-align center
box-sizing border-box
border 1px solid #ffffff
border-radius 5px
height 0.24rem
line-height 0.24rem
margin-top 0.08rem
.menu
display flex
font-size .26rem
text-align center
justify-content center
align-items center
height 100%
// height calc(100% - 0.44rem);
ul
width 6.8rem
box-sizing border-box
// margin 0 auto
li
color #D75930
width 1.6rem
float left
font-size 0.18rem
margin 0.05rem 0.05rem
line-height 0.3rem
padding 0.1rem
border 1px solid #D75930
border-radius 5px
cursor pointer
</style>

View File

@@ -0,0 +1,244 @@
<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>

View File

@@ -0,0 +1,154 @@
<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>

159
src/pages/proj/ZlManage.vue Normal file
View File

@@ -0,0 +1,159 @@
<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>
<button class="button--primary" :disabled="disabled1" @click="toSure('3')">强制完成</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>agv车号</th>
<th>物料类型</th>
<th>优先级</th>
<th>时间</th>
</tr>
<tr v-for="e in dataList" :key="e.inst_uuid" @click="toRadio(e)">
<td>
<div class="radio__icon radio__icon--round radio__icon--disabled" :class="{'radio__icon--checked': pkId === e.inst_uuid}">
<i class="iconfont icon"></i>
</div>
</td>
<td>{{e.inst_no}}</td>
<td>{{e.task_no}}</td>
<td>{{e.start_devicecode}}</td>
<td>{{e.next_devicecode}}</td>
<td>{{e.inst_status_name}}</td>
<td>{{e.carno}}</td>
<td>{{e.material_type_name}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
</tr>
</table>
</section>
</div>
</div>
</template>
<script>
import {queryInstraction, instOperation} from '@config/getData'
import NavBar from '@components/NavBar.vue'
export default {
name: 'ZlManage',
components: {
NavBar
},
data () {
return {
dataList: [],
keyword: '',
startPoint: '',
endPoint: '',
pkId: '',
disabled0: false,
disabled1: false
}
},
mounted () {
this.queryInstraction(this.keyword, this.startPoint, this.endPoint)
},
methods: {
async queryInstraction () {
try {
let res = await queryInstraction(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 instOperation (type) {
try {
let res = await instOperation(this.pkId, type)
if (res.code === '1') {
this.toast('操作成功')
this.pkId = ''
this.dataList = []
this.queryInstraction()
} 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.queryInstraction()
},
toSure (type) {
if (this.pkId) {
this.disabled1 = true
this.instOperation(type)
} else {
this.toast('请查询后进行选择')
}
},
toRadio (e) {
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_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>