init
This commit is contained in:
173
pages/home/home.vue
Normal file
173
pages/home/home.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view class="zd_content">
|
||||
<view class="header">首页</view>
|
||||
<view class="userInfo-wrap">
|
||||
<view class="userInfo">
|
||||
<text class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}</text>
|
||||
<text class="p2">欢迎进入立讯手持系统!</text>
|
||||
</view>
|
||||
<view class="exit" @tap="Quit">
|
||||
<view class="icon-exit"></view>
|
||||
<view class="exit-text">退出</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper">
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage1(e)">
|
||||
<image class="menu-img" :src="require('../../static/image/menu/' + e.imgsrc + '.png')" alt="">
|
||||
<view class="menu-name">{{e.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show === true" class="sec_menu_wraper">
|
||||
<view class="sec_menu_w">
|
||||
<view class="menu-item" v-for="(e, i) in secM" :key="i" @click="toPage2(e)">
|
||||
<view class="sec_menu-col_inner">
|
||||
<view class="menu-name menu-name_inner">{{e.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancel">
|
||||
<view class="iconfont cancel_icon" @tap="show = false"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {authority} from '@/utils/getData2.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
show: false,
|
||||
secM: []
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._authority()
|
||||
},
|
||||
methods: {
|
||||
async _authority () {
|
||||
let res = await authority()
|
||||
this.menuList = [...res.sonTree]
|
||||
|
||||
},
|
||||
toPage1 (e) {
|
||||
// if (e.sonTree.length > 0) {
|
||||
// this.show = true
|
||||
// this.secM = e.sonTree
|
||||
// }
|
||||
uni.redirectTo({
|
||||
url: e.path
|
||||
})
|
||||
},
|
||||
toPage2 (e) {
|
||||
let url = e.path
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
Quit () {
|
||||
this.$store.dispatch('delUserInfo')
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.zd_content
|
||||
padding-top 0
|
||||
.header
|
||||
height 86rpx
|
||||
_font(36rpx,86rpx,#333,,center)
|
||||
.userInfo-wrap
|
||||
_fj()
|
||||
_wh(100%,160rpx)
|
||||
padding 0 30rpx
|
||||
background-color $red
|
||||
_bis('../../static/image/info_bg.png',auto,100%,right,bottom)
|
||||
border-radius 12rpx
|
||||
margin-bottom 20rpx
|
||||
.userInfo
|
||||
_fj(,flex-start,column)
|
||||
.p1
|
||||
_font(34rpx,1,#fff)
|
||||
padding-bottom 18rpx
|
||||
.p2
|
||||
_font(26rpx,1,#fff)
|
||||
.exit
|
||||
_fj()
|
||||
height 47rpx
|
||||
padding 0 15rpx
|
||||
border 1px solid #FF967C
|
||||
border-radius 20rpx
|
||||
.icon-exit
|
||||
_wh(22rpx, 22rpx)
|
||||
_bis('../../static/image/exit.png',22rpx)
|
||||
.exit-text
|
||||
_font(24rpx,47rpx,#fff,,right)
|
||||
padding-left 10rpx
|
||||
.menu-wrap
|
||||
_fj(flex-start,flex-start,,wrap)
|
||||
align-content: flex-start
|
||||
.menu-item
|
||||
_fj()
|
||||
flex-direction column
|
||||
_wh(30%, auto)
|
||||
margin-bottom 40rpx
|
||||
_font(26rpx, 60rpx,#e74f1a,,center)
|
||||
&:nth-child(3n+2)
|
||||
margin-left 5%
|
||||
margin-right 5%
|
||||
::v-deep .menu-img
|
||||
_wh(100%, auto)
|
||||
img
|
||||
position relative
|
||||
opacity 1
|
||||
_wh(55%, auto)
|
||||
margin 0 auto 0.2rpx
|
||||
.menu-name
|
||||
_font(28rpx, 38rpx, #444,,center)
|
||||
.sec_menu_wraper
|
||||
position fixed
|
||||
top 0
|
||||
left 0
|
||||
_wh(100%, 100%)
|
||||
background-color rgba(0, 0, 0, .9)
|
||||
z-index 2017
|
||||
flex-direction column
|
||||
.sec_menu_w
|
||||
_fj()
|
||||
_wh(100%, calc(100% - 100rpx))
|
||||
padding 0 24rpx
|
||||
flex-wrap wrap
|
||||
align-content center
|
||||
&::after
|
||||
content ''
|
||||
display block
|
||||
_wh(30%,0)
|
||||
.sec_menu-col
|
||||
background-color transparent
|
||||
border none
|
||||
height auto
|
||||
.sec_menu-col_inner
|
||||
_fj(center)
|
||||
_wh(160rpx, 160rpx)
|
||||
border-radius 50%
|
||||
background-color $yellow
|
||||
margin 0 auto
|
||||
.menu-name_inner
|
||||
color #fff
|
||||
padding 0 20rpx
|
||||
.cancel
|
||||
_wh(100%, 100rpx)
|
||||
padding 0 24rpx
|
||||
overflow hidden
|
||||
background-color rgba(255, 255, 255, .3)
|
||||
box-shadow 0 1rpx 4rpx 0 rgba(160,160,160,0.9)
|
||||
</style>
|
||||
176
pages/login/login.vue
Normal file
176
pages/login/login.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<view class="zd_content bg">
|
||||
<view class="p1">欢迎来到</view>
|
||||
<view class="p2">立讯手持系统!</view>
|
||||
<view class="input-box">
|
||||
<input class="large-input" type="text" placeholder="请输入用户名" v-model="user">
|
||||
</view>
|
||||
<div class="input-box">
|
||||
<input class="large-input" :password="!showPassword" placeholder="请输入密码" v-model="password">
|
||||
<span class="iconfont icon_eye_close" :class="[showPassword ? 'icon_eye_active' : '']" @tap="changePassword"></span>
|
||||
</div>
|
||||
<view class="radio-box">
|
||||
<view class="radio-wrap">
|
||||
<span class="iconfont icon_unchecked" :class="{'icon_checked': saveUser}" @tap="toSaveUser"></span>
|
||||
<text class="radio-label">记住用户名</text>
|
||||
</view>
|
||||
<text class="setup-text" @tap="setup">设置</text>
|
||||
<text class="setup-text" @tap="isUpdate">升级版本</text>
|
||||
</view>
|
||||
<button class="login-btn" :disabled="disabled" @tap="toLogin">确认登录</button>
|
||||
<view v-if="version !== ''" class="version-name">v{{version}}</view>
|
||||
<Up-grade v-if="grade === true" @closeUpdate="closeUpdate" :androidUrl="androidUrl"></up-grade>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { RSAencrypt } from '@/utils/jsencrypt.js'
|
||||
import {handLogin, pdaUpdate} from '@/utils/getData2.js'
|
||||
import UpGrade from './upgrade.vue'
|
||||
export default {
|
||||
components: {
|
||||
UpGrade
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
user: this.$store.getters.loginName ? this.$store.getters.loginName : '',
|
||||
password: '',
|
||||
showPassword: false,
|
||||
saveUser: this.$store.getters.loginName ? true : false,
|
||||
disabled: false,
|
||||
version: '',
|
||||
versionCode: '',
|
||||
grade: false,
|
||||
androidUrl: ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
//#ifdef APP-PLUS
|
||||
// 获取本地应用资源版本号
|
||||
plus.runtime.getProperty(plus.runtime.appid, (info) => {
|
||||
console.log(JSON.stringify(info));
|
||||
this.version = info.version;
|
||||
this.versionCode = info.versionCode ;
|
||||
})
|
||||
//#endif
|
||||
},
|
||||
methods: {
|
||||
isUpdate () {
|
||||
this._pdaUpdate()
|
||||
},
|
||||
toSaveUser() {
|
||||
this.saveUser = !this.saveUser
|
||||
},
|
||||
changePassword() {
|
||||
this.showPassword = !this.showPassword
|
||||
},
|
||||
setup () {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/setup'
|
||||
})
|
||||
},
|
||||
async toLogin() {
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/home/home'
|
||||
// })
|
||||
this.disabled = true
|
||||
if (this.user === '') {
|
||||
uni.showToast({
|
||||
title: '用户名不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
if (this.password === '') {
|
||||
uni.showToast({
|
||||
title: '密码不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handLogin(this.user, RSAencrypt(this.password))
|
||||
if (this.saveUser) {
|
||||
this.$store.dispatch('saveLoginName', this.user)
|
||||
} else {
|
||||
this.$store.dispatch('delLoginName', '')
|
||||
}
|
||||
this.$store.dispatch('saveUserInfo', JSON.stringify(res.result))
|
||||
// this.$store.dispatch('saveToken', res.token)
|
||||
uni.redirectTo({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _pdaUpdate () {
|
||||
let res = await pdaUpdate()
|
||||
if (res.versionName === this.version) {
|
||||
uni.showToast({
|
||||
title: '当前为最新版本',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.grade = true
|
||||
this.androidUrl = res.url
|
||||
}
|
||||
},
|
||||
closeUpdate () {
|
||||
this.grade = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.p1
|
||||
_font(60rpx,75rpx,#444)
|
||||
padding-top: 90rpx
|
||||
.p2
|
||||
_font(50rpx,1,#444)
|
||||
padding: 40rpx 0 25rpx
|
||||
.input-box
|
||||
_fj()
|
||||
margin-top 68rpx
|
||||
height 75rpx
|
||||
border-bottom 1rpx solid #e2e2e2
|
||||
.large-input
|
||||
_wh(calc(100% - 40rpx), 74rpx)
|
||||
_font(32rpx,74rpx,#999)
|
||||
padding-left 10rpx
|
||||
.radio-box
|
||||
_fj()
|
||||
margin: 25rpx 0 70rpx 0
|
||||
height: 34rpx
|
||||
.radio-wrap
|
||||
_fj(flex-start)
|
||||
height: 34rpx
|
||||
flex: 2
|
||||
.radio-label
|
||||
_font(28rpx, 28rpx,#333)
|
||||
padding-left: 10rpx
|
||||
.setup-text
|
||||
_font(28rpx, 28rpx,$red,,right)
|
||||
padding-left 25rpx
|
||||
.bg
|
||||
background-color: #fff;
|
||||
_bis('../../static/image/login_bg.png', 100%,,bottom)
|
||||
.login-btn
|
||||
width 100%
|
||||
border-radius 46rpx
|
||||
_font(36rpx,92rpx,#fff,,center)
|
||||
background-color $red
|
||||
.zd_content
|
||||
position: relative
|
||||
height: 100%
|
||||
.version-name
|
||||
width 100%
|
||||
position: absolute
|
||||
bottom: 30rpx
|
||||
_font(30rpx, 60rpx, #999,,center)
|
||||
</style>
|
||||
80
pages/login/setup.vue
Normal file
80
pages/login/setup.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="设置" :inner2="true" @goIn="goIn" :show1="false"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="input-wrap">
|
||||
<view class="input-label">服务器地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="zd_wrapper">
|
||||
<view class="input-wrap">
|
||||
<view class="input-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<button class="submit-button" @click="_submit">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addrip: this.$store.getters.baseUrl,
|
||||
setTime: this.$store.getters.setTime / 1000
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goIn () {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
_submit () {
|
||||
if (this.addrip === '') {
|
||||
uni.showToast({
|
||||
title: '服务器地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (this.setTime === '') {
|
||||
// uni.showToast({
|
||||
// title: '请填写刷新时间',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// 存值
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000})
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.input-wrap
|
||||
width 100%
|
||||
_fj()
|
||||
.input-label
|
||||
wh(200rpx, 58rpx)
|
||||
_font(28rpx,58rpx,#464646)
|
||||
.setup-input
|
||||
_wh(calc(100% - 200rpx), 58rpx)
|
||||
background #fff
|
||||
_font(28rpx,58rpx,#323232)
|
||||
padding 0 10rpx
|
||||
</style>
|
||||
229
pages/login/upgrade.vue
Normal file
229
pages/login/upgrade.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<view class="mask flex-center">
|
||||
<view class="content botton-radius">
|
||||
<view class="content-top">
|
||||
<text class="content-top-text">发现新版本</text>
|
||||
<image class="content-top" style="top: 0;" width="100%" height="100%" src="../../static/image/bg_top.png">
|
||||
</image>
|
||||
</view>
|
||||
<view class="content-header"></view>
|
||||
<view class="content-body">
|
||||
<view class="title">
|
||||
<text>立讯又有新版本了,升级到最新版本,享受更丰富、稳定、快速的功能和体验!</text>
|
||||
</view>
|
||||
<view class="footer flex-center">
|
||||
<template>
|
||||
<template v-if="!downloadSuccess">
|
||||
<view class="progress-box flex-column" v-if="downloading">
|
||||
<progress class="progress" border-radius="35" :percent="downLoadPercent" activeColor="#3DA7FF" show-info stroke-width="10" />
|
||||
<view style="width:100%;font-size: 28rpx;display: flex;justify-content: space-around;">
|
||||
<text>安装包下载中,请稍后</text>
|
||||
<text>({{downloadedSize}}/{{packageFileSize}}M)</text>
|
||||
</view>
|
||||
</view>
|
||||
<button v-else class="content-button" style="border: none;color: #fff;" plain @click="updateApp">立即升级</button>
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<image v-if="is_mandatory" class="close-img" src="../../static/image/app_update_close.png" @click.stop="closeUpdate"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
downloadSuccess: false,
|
||||
downloading: false,
|
||||
downLoadPercent: 0,
|
||||
downloadedSize: 0,
|
||||
packageFileSize: 0,
|
||||
is_mandatory: true
|
||||
}
|
||||
},
|
||||
props: {
|
||||
androidUrl: String
|
||||
},
|
||||
methods: {
|
||||
updateApp() {
|
||||
this.is_mandatory = false
|
||||
this.downloading = true
|
||||
this.doUpData(this.androidUrl);
|
||||
},
|
||||
doUpData(Url) {
|
||||
const downloadTask = uni.downloadFile({
|
||||
url: Url,
|
||||
success: downloadResult => {
|
||||
if (downloadResult.statusCode == 200) {
|
||||
this.downloadSuccess = true;
|
||||
plus.runtime.install(
|
||||
//安装软件
|
||||
downloadResult.tempFilePath,
|
||||
{
|
||||
force: true
|
||||
},
|
||||
function(res) {
|
||||
plus.runtime.restart();
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
this.downloading = false;
|
||||
this.downLoadPercent = 0
|
||||
this.downloadedSize = 0
|
||||
this.packageFileSize = 0
|
||||
}
|
||||
});
|
||||
// 下载进度
|
||||
downloadTask.onProgressUpdate(res => {
|
||||
this.downLoadPercent = res.progress;
|
||||
this.downloadedSize = (res.totalBytesWritten / Math.pow(1024, 2)).toFixed(2);
|
||||
this.packageFileSize = (res.totalBytesExpectedToWrite / Math.pow(1024, 2)).toFixed(2);
|
||||
});
|
||||
},
|
||||
closeUpdate () {
|
||||
this.$emit('closeUpdate')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, .65);
|
||||
}
|
||||
|
||||
.botton-radius {
|
||||
border-bottom-left-radius: 30rpx;
|
||||
border-bottom-right-radius: 30rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
top: 0;
|
||||
width: 600rpx;
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 0 50rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
}
|
||||
|
||||
.text {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: block;
|
||||
/* #endif */
|
||||
line-height: 200px;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content-top {
|
||||
position: absolute;
|
||||
top: -195rpx;
|
||||
left: 0;
|
||||
width: 600rpx;
|
||||
height: 270rpx;
|
||||
}
|
||||
|
||||
.content-top-text {
|
||||
font-size: 45rpx;
|
||||
font-weight: bold;
|
||||
color: #F8F8FA;
|
||||
position: absolute;
|
||||
top: 120rpx;
|
||||
left: 50rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 33rpx;
|
||||
font-weight: bold;
|
||||
color: #3DA7FF;
|
||||
line-height: 38rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.footer {
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.box-des-scroll {
|
||||
box-sizing: border-box;
|
||||
padding: 0 40rpx;
|
||||
height: 50rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.box-des {
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.progress-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress {
|
||||
width: 90%;
|
||||
height: 40rpx;
|
||||
border-radius: 35px;
|
||||
}
|
||||
|
||||
.close-img {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
bottom: -120rpx;
|
||||
left: calc(50% - 70rpx / 2);
|
||||
}
|
||||
|
||||
.content-button {
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
border-radius: 40rpx;
|
||||
margin: 0 18rpx;
|
||||
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
background: linear-gradient(to right, #1785ff, #3DA7FF);
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
235
pages/modules/callmanage.vue
Normal file
235
pages/modules/callmanage.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="呼叫管理"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="locate_block" v-for="e in areaArr" :key="e.region_code">
|
||||
<view class="locate_name" @click="getPonit (e)">
|
||||
<view class="title_1">{{e.region_name}}</view>
|
||||
<view class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></view>
|
||||
</view>
|
||||
<view v-show="e.checked === true" class="site_block" ref="liCon">
|
||||
<view class="site_item" v-for="(el, i) in e.pointArr" :key="i">
|
||||
<view class="site_item_box">
|
||||
<text class="title_2">站点</text>
|
||||
<view class="site_item_box_inner_r" @click="setcode(el)">
|
||||
<text>{{el.device_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<view class="dot_item">
|
||||
<view class="p1">起始点</view>
|
||||
<view class="p2">设备号:{{sObj.device_name}}</view>
|
||||
</view>
|
||||
<view class="dot_item">
|
||||
<view class="p1">目标点</view>
|
||||
<view class="p2">设备号:{{nObj.device_name}}</view>
|
||||
</view>
|
||||
<view class="btn_block">
|
||||
<button class="submit-button" :class="{'btn-disabled': JSON.stringify(sObj) === '{}' && JSON.stringify(nObj) === '{}'}" @click="cancle">清空</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': JSON.stringify(sObj) === '{}' || JSON.stringify(nObj) === '{}'}" :disabled="disabled1" @click="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea, callTask} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// interTime: this.$store.getters.setTime,
|
||||
// timer: null,
|
||||
areaArr: [],
|
||||
pointArr: [],
|
||||
regobj: {},
|
||||
disabled1: false,
|
||||
sObj: {},
|
||||
nObj: {},
|
||||
isS: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
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)
|
||||
}
|
||||
},
|
||||
setcode (el) {
|
||||
if (this.isS === false) {
|
||||
this.sObj = el
|
||||
this.isS = true
|
||||
} else if (this.isS) {
|
||||
this.nObj = el
|
||||
this.isS = false
|
||||
}
|
||||
},
|
||||
/** 清空点位选择 */
|
||||
cancle () {
|
||||
this.sObj = {}
|
||||
this.nObj = {}
|
||||
this.disabled1 = false
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (JSON.stringify(this.sObj) === '{}' || JSON.stringify(this.nObj) === '{}') {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._callTask()
|
||||
},
|
||||
async _callTask () {
|
||||
try {
|
||||
let res = await callTask(this.sObj.device_code, this.nObj.device_code)
|
||||
this.cancle()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
// clearInterval(this.timer)
|
||||
// this.timer = null
|
||||
// setTimeout(() => {
|
||||
// this.refresh()
|
||||
// this.cancle()
|
||||
// }, 2000)
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.zd_content
|
||||
padding-bottom 152rpx
|
||||
.locate_block
|
||||
width 100%
|
||||
.locate_name
|
||||
position relative
|
||||
_wh(100%,48rpx)
|
||||
.title_1
|
||||
_font(32rpx,48rpx,#000,500)
|
||||
.open_icon
|
||||
position absolute
|
||||
right 0
|
||||
top 0
|
||||
_wh(48rpx,48rpx)
|
||||
_font(40rpx,48rpx,$red,,right)
|
||||
transition all .3s
|
||||
transform rotateZ(-90deg)
|
||||
&:before
|
||||
content: "\e6db";
|
||||
.is_reverse
|
||||
transform rotateZ(90deg)
|
||||
.site_block
|
||||
_wh(100%,auto)
|
||||
overflow hidden
|
||||
transition height .3s
|
||||
_fj(flex-start,,,wrap)
|
||||
padding-bottom 10rpx
|
||||
.site_item
|
||||
_wh(32%,100rpx)
|
||||
padding 0 10rpx
|
||||
margin-top 12rpx
|
||||
background-color #e5e5e5
|
||||
border-radius 5px
|
||||
overflow hidden
|
||||
_fj(center)
|
||||
&:nth-child(3n+2)
|
||||
margin-left 2%
|
||||
margin-right 2%
|
||||
.site_item_box
|
||||
_wh(100%, 80rpx)
|
||||
_fj()
|
||||
.title_2
|
||||
width 36rpx
|
||||
_font(28rpx,40rpx,#000,500)
|
||||
.site_item_box_inner_r
|
||||
_fj(center)
|
||||
_wh(calc(100% - 36rpx), 100%)
|
||||
background-color #fff
|
||||
border-radius 3px
|
||||
padding 0 5rpx
|
||||
overflow hidden
|
||||
text
|
||||
_font(28rpx,40rpx,#999,,center)
|
||||
.submit-bar
|
||||
justify-content space-between
|
||||
padding 10rpx
|
||||
.dot_item
|
||||
width 35%
|
||||
background-color #e5e5e5
|
||||
_fj(center,,column)
|
||||
.p1
|
||||
_wh(100%, 52rpx)
|
||||
_font(30rpx,52rpx,,,center)
|
||||
border-bottom 1rpx solid #fff
|
||||
overflow hidden
|
||||
.p2
|
||||
_wh(100%, 80rpx)
|
||||
_fj(center)
|
||||
padding 0 5rpx
|
||||
_font(30rpx,40rpx,,,center)
|
||||
overflow hidden
|
||||
word-break break-all
|
||||
.btn_block
|
||||
_fj(,,column)
|
||||
align-content: flex-end
|
||||
.submit-button
|
||||
line-height 56rpx
|
||||
margin 0
|
||||
&:nth-child(1)
|
||||
margin-bottom 10rpx
|
||||
</style>
|
||||
126
pages/modules/taskmanage.vue
Normal file
126
pages/modules/taskmanage.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="任务管理"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>任务号</th>
|
||||
<th>起点</th>
|
||||
<th>终点</th>
|
||||
<th>状态</th>
|
||||
<th>托盘号</th>
|
||||
<th>物料类型</th>
|
||||
<th>优先级</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
|
||||
<td>{{e.task_no}}</td>
|
||||
<td>{{e.start_devicecode}}</td>
|
||||
<td>{{e.next_devicecode}}</td>
|
||||
<td>{{e.task_status_name}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.material_type_name}}</td>
|
||||
<td>{{e.priority}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1('1')">重新生成</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2('2')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryTask, taskOperation} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
startPoint: '',
|
||||
endPoint: '',
|
||||
dataList: [],
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
pkId: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._queryTask(this.keyword, this.startPoint, this.endPoint)
|
||||
},
|
||||
methods: {
|
||||
async _queryTask () {
|
||||
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.result]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async _taskOperation (type) {
|
||||
try {
|
||||
let res = await taskOperation(this.pkId, type)
|
||||
if (res.code === '1') {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this._queryTask()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
|
||||
},
|
||||
toSure1 (type) {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._taskOperation(type)
|
||||
},
|
||||
toSure2 (type) {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._taskOperation(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
142
pages/modules/zlmanage.vue
Normal file
142
pages/modules/zlmanage.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="指令管理"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>任务号</th>
|
||||
<th>指令号</th>
|
||||
<th>起点</th>
|
||||
<th>终点</th>
|
||||
<th>状态</th>
|
||||
<th>托盘号</th>
|
||||
<th>agv车号</th>
|
||||
<th>物料类型</th>
|
||||
<th>优先级</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.inst_uuid === pkId}">
|
||||
<td>{{e.task_no}}</td>
|
||||
<td>{{e.inst_no}}</td>
|
||||
<td>{{e.start_devicecode}}</td>
|
||||
<td>{{e.next_devicecode}}</td>
|
||||
<td>{{e.inst_status_name}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.carno}}</td>
|
||||
<td>{{e.material_type_name}}</td>
|
||||
<td>{{e.priority}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1('1')">指令撤销</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2('2')">重新下发</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled3" @tap="toSure3('3')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryInstraction, instOperation} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
startPoint: '',
|
||||
endPoint: '',
|
||||
dataList: [],
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
pkId: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
||||
},
|
||||
methods: {
|
||||
async _queryInstraction () {
|
||||
let res = await queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.result]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async _instOperation (type) {
|
||||
try {
|
||||
let res = await instOperation(this.pkId, type)
|
||||
if (res.code === '1') {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
this.pkId = ''
|
||||
this._queryInstraction()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
}
|
||||
} catch (err) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
|
||||
},
|
||||
toSure1 (type) {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._instOperation(type)
|
||||
},
|
||||
toSure2 (type) {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._instOperation(type)
|
||||
},
|
||||
toSure3 (type) {
|
||||
this.disabled3 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
this._instOperation(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
Reference in New Issue
Block a user