no message
This commit is contained in:
155
pages/home/home.vue
Normal file
155
pages/home/home.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<view class="home_wraper">
|
||||
<view class="zd_content">
|
||||
<view class="header">首页</view>
|
||||
<view class="userInfo-wrap">
|
||||
<view class="userInfo">
|
||||
<text v-if="userName !== ''" class="p1">{{userName}}</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_home_wrapper">
|
||||
<view class="menus_wrap">
|
||||
<view class="fir_menu_wrap">
|
||||
<view class="fir_menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage(e)">
|
||||
<image class="menu-img" :src="require('../../static/image/menu/' + e.icon + '.png')" alt="">
|
||||
<view class="menu-name">{{e.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userName: '',
|
||||
menuList: [
|
||||
{title: '任务管理', icon: 'RF06', path: '/pages/manage/task-manage'},
|
||||
{title: '指令管理', icon: 'RF05', path: '/pages/manage/inst-manage'},
|
||||
{title: '混碾搬运', icon: 'RF01', path: '/pages/manage/hnby'},
|
||||
{title: '扫码出入库', icon: 'RF11', path: '/pages/manage/smck'},
|
||||
{title: '压制满料搬运', icon: 'RF02', path: '/pages/manage/yzmlby'},
|
||||
{title: '半成品解绑', icon: 'RF08', path: '/pages/manage/bcpjb'},
|
||||
{title: '混碾料罐绑定', icon: 'RF10', path: '/pages/manage/hnlgbd'},
|
||||
{title: '料罐物料查询', icon: 'RF09', path: '/pages/manage/hnlgcx'}
|
||||
],
|
||||
show: false,
|
||||
secM: []
|
||||
};
|
||||
},
|
||||
created () {
|
||||
if (this.$store.getters.userInfo) {
|
||||
this.userName = JSON.parse(this.$store.getters.userInfo).username
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async _authority () {
|
||||
let res = await authority()
|
||||
this.menuList = [...res.sonTree]
|
||||
|
||||
},
|
||||
toPage (e) {
|
||||
let url = e.path + '?title=' + e.title
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
Quit () {
|
||||
this.$store.dispatch('delUserInfo', '')
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.home_wraper
|
||||
_wh(100%, 100%)
|
||||
overflow hidden
|
||||
.zd_content
|
||||
padding 0 24rpx
|
||||
height 100%
|
||||
top 0
|
||||
padding-top calc(var(--status-bar-height) + 86rpx)
|
||||
// background linear-gradient(to bottom, #fae2ca 0%, #fff5ea 20%, #fdfdfd 100%)
|
||||
background linear-gradient(to bottom, #f5f6fb 0%, #fff 100%)
|
||||
.header
|
||||
position fixed
|
||||
left 0
|
||||
top 0
|
||||
padding-top var(--status-bar-height)
|
||||
z-index 100
|
||||
_wh(100%, calc(var(--status-bar-height) + 86rpx))
|
||||
_font(36rpx,86rpx,#333,,center)
|
||||
.userInfo-wrap
|
||||
_fj()
|
||||
_wh(100%,190rpx)
|
||||
padding 0 30rpx
|
||||
background-color $red
|
||||
_bis('../../static/image/info_bg.png',auto,100%,right,bottom)
|
||||
border-radius 12rpx
|
||||
margin-bottom 24rpx
|
||||
.userInfo
|
||||
_fj(,flex-start,column)
|
||||
.p1
|
||||
_font(34rpx,1,#fff)
|
||||
padding-bottom 18rpx
|
||||
.p2
|
||||
_font(26rpx,1,#fff)
|
||||
.exit
|
||||
_fj()
|
||||
height 50rpx
|
||||
padding 0 20rpx
|
||||
border 1px solid #FF967C
|
||||
border-radius 20rpx
|
||||
.icon-exit
|
||||
_wh(22rpx, 22rpx)
|
||||
_bis('../../static/image/exit.png',22rpx)
|
||||
.exit-text
|
||||
_font(32rpx,50rpx,#fff,,right)
|
||||
padding-left 10rpx
|
||||
.zd_home_wrapper
|
||||
_wh(100%, calc(100% - 238rpx))
|
||||
margin-bottom 24rpx
|
||||
background-color #fff
|
||||
border-radius: 12rpx;
|
||||
padding: 14rpx;
|
||||
margin-bottom 24rpx
|
||||
box-shadow: 0 4rpx 10rpx 4rpx rgba(0,0,0,.1)
|
||||
overflow-y scroll
|
||||
.menus_wrap
|
||||
width 100%
|
||||
.fir_menu_wrap
|
||||
_fj(flex-start,flex-start,,wrap)
|
||||
align-content: flex-start
|
||||
.fir_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)
|
||||
padding 0 20rpx
|
||||
</style>
|
||||
180
pages/login/login.vue
Normal file
180
pages/login/login.vue
Normal file
@@ -0,0 +1,180 @@
|
||||
<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" autocomplete=“off”>
|
||||
<uni-icons :type="showPassword ? 'eye-filled' : 'eye'" size="20" :color="showPassword ? '#ff6a00' : '#999'" @tap="showPassword = !showPassword"></uni-icons>
|
||||
</div>
|
||||
<view class="zd-row radio-box">
|
||||
<view class="zd-col-2 zd-row jccenter radio-icon-wrap" :class="{'radio-icon-wrap_checked': saveUser}" @tap="toSaveUser">
|
||||
<uni-icons type="checkmarkempty" size="14" :color="saveUser ? '#ff6a00' : '#fff'"></uni-icons>
|
||||
</view>
|
||||
<view class="zd-col-13 radio-label">记住用户名</view>
|
||||
<view class="zd-col-4 setup-text" @tap="setup">设置</view>
|
||||
<view class="zd-col-5 setup-text" @tap="isUpdate">升级版本</view>
|
||||
</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
|
||||
},
|
||||
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.user.user))
|
||||
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
|
||||
// }
|
||||
this.grade = true
|
||||
this.androidUrl = res.url
|
||||
},
|
||||
closeUpdate () {
|
||||
this.grade = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.p1
|
||||
_font(40rpx,75rpx,#444,666)
|
||||
padding-top: 190rpx
|
||||
.p2
|
||||
_font(44rpx,1,#444,600)
|
||||
padding: 10rpx 0 55rpx 0
|
||||
.input-box
|
||||
_fj()
|
||||
margin-top 68rpx
|
||||
height 75rpx
|
||||
border-bottom 1rpx solid #e2e2e2
|
||||
.large-input
|
||||
_wh(calc(100% - 100rpx), 74rpx)
|
||||
_font(32rpx,74rpx,#999)
|
||||
padding-left 10rpx
|
||||
.radio-box
|
||||
margin 25rpx 0 70rpx 0
|
||||
.radio-icon-wrap
|
||||
_wh(34rpx, 34rpx)
|
||||
border 1rpx solid #999
|
||||
border-radius 4rpx
|
||||
text-align center
|
||||
line-height 40rpx
|
||||
.radio-icon-wrap_checked
|
||||
border-color $red
|
||||
.radio-label
|
||||
_font(28rpx, 28rpx,#333)
|
||||
.setup-text
|
||||
_font(28rpx, 28rpx,$red,,right)
|
||||
.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
|
||||
top 0
|
||||
height: 100%
|
||||
padding-left 40rpx
|
||||
padding-right 40rpx
|
||||
background-color: #fff
|
||||
overflow: hidden
|
||||
.version-name
|
||||
width 100%
|
||||
position: absolute
|
||||
bottom: 30rpx
|
||||
_font(30rpx, 60rpx, #999,,center)
|
||||
</style>
|
||||
91
pages/login/setup.vue
Normal file
91
pages/login/setup.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="设置" :inner2="true" @goIn="goIn"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="setup-item">
|
||||
<view class="setup-label">LMS地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
||||
</view>
|
||||
<view class="setup-item">
|
||||
<view class="setup-label">ACS地址</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入ACS地址" v-model="acsip">
|
||||
</view>
|
||||
<!-- <view class="setup-item">
|
||||
<view class="setup-label">刷新时间(s)</view>
|
||||
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-24 button-primary" @click="_submit">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addrip: this.$store.getters.baseUrl,
|
||||
acsip: this.$store.getters.acsUrl,
|
||||
setTime: this.$store.getters.setTime / 1000
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goIn () {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
_submit () {
|
||||
if (this.addrip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写LMS地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.acsip === '') {
|
||||
uni.showToast({
|
||||
title: '请填写ACS地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (this.setTime === '') {
|
||||
// uni.showToast({
|
||||
// title: '请填写刷新时间',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// 存值
|
||||
this.$store.dispatch('setConfig',{baseUrl: this.addrip, acsUrl: this.acsip, setTime: this.setTime * 1000})
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.setup-item
|
||||
width 100%
|
||||
margin-bottom 40rpx
|
||||
.setup-label
|
||||
_font(24rpx,40rpx,#000)
|
||||
.setup-input
|
||||
_wh(100%, 80rpx)
|
||||
background #fff
|
||||
_font(28rpx,80rpx,#323232)
|
||||
padding 0 28rpx
|
||||
border 2px solid #e9ecf3
|
||||
border-radius 12rpx
|
||||
</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>
|
||||
89
pages/manage/bcpjb.vue
Normal file
89
pages/manage/bcpjb.vue
Normal file
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">区域</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<view class="filter_input">缓存货架区域</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">点位</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index2}" :disabled="disabled" @tap="_vehicleUnbind">解绑</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {vehicleUnbind} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options2: this.generateArray('CRYHCHJ', '出入窑缓存货架'),
|
||||
index2: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
generateArray(prefix, suffix) {
|
||||
const array = []
|
||||
for (let i = 1; i <= 136; i++) {
|
||||
array.push({
|
||||
value: `${prefix}${String(i).padStart(3, '0')}`,
|
||||
text: `${suffix}${String(i).padStart(3, '0')}`
|
||||
})
|
||||
}
|
||||
return array
|
||||
},
|
||||
clearUp () {
|
||||
this.index2 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _vehicleUnbind () {
|
||||
this.disabled = true
|
||||
if (!this.index2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await vehicleUnbind(this.index2)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
104
pages/manage/hnby.vue
Normal file
104
pages/manage/hnby.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">起点</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<zxz-uni-data-select v-model="index1" filterable :localdata="options1"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">终点</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<zxz-uni-data-select v-model="index2" filterable :localdata="options2"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">条码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap.stop="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index1 || !index2 || !val1}" :disabled="disabled1" @tap="_pdaHnby">混碾搬运</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {pdaHnby} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options1: this.generateArray('HNJ', 'DJW', '混碾机', '', 8),
|
||||
index1: '',
|
||||
options2: this.generateArray('YJ', 'SLW01', '压机', '号上料位', 10),
|
||||
index2: '',
|
||||
val1: null,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
generateArray(prefix, suffix, name1, name2, num) {
|
||||
const array = []
|
||||
for (let i = 1; i <= num; i++) {
|
||||
array.push({
|
||||
value: `${prefix}${String(i).padStart(2, '0')}${suffix}`,
|
||||
text: `${name1}${String(i).padStart(2, '0')}${name2}`
|
||||
})
|
||||
}
|
||||
return array
|
||||
},
|
||||
clearUp () {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.val1 = null
|
||||
this.disabled1 = false
|
||||
},
|
||||
async _pdaHnby () {
|
||||
this.disabled1 = true
|
||||
if (!this.index1 || !this.index2 || !this.val1) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await pdaHnby(this.index1, this.index2, this.val1)
|
||||
this.disabled1 = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
</style>
|
||||
103
pages/manage/hnlgbd.vue
Normal file
103
pages/manage/hnlgbd.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">设备</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<zxz-uni-data-select v-model="index1" filterable :localdata="options1"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">条码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<input type="number" class="filter_input" v-model="val2">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap.stop="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index1 || !val1 || !val2}" :disabled="disabled1" @tap="_hnlgbd">混碾料罐绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {hnlgbd} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options1: this.generateArray('HNJ', '混碾机', 8),
|
||||
index1: '',
|
||||
val1: null,
|
||||
val2: null,
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
generateArray(prefix, name, num) {
|
||||
const array = []
|
||||
for (let i = 1; i <= num; i++) {
|
||||
array.push({
|
||||
value: `${prefix}${String(i).padStart(2, '0')}`,
|
||||
text: `${name}${String(i).padStart(2, '0')}`
|
||||
})
|
||||
}
|
||||
return array
|
||||
},
|
||||
clearUp () {
|
||||
this.index1 = ''
|
||||
this.val1 = null
|
||||
this.val2 = null
|
||||
this.disabled1 = false
|
||||
},
|
||||
async _hnlgbd () {
|
||||
this.disabled1 = true
|
||||
if (!this.index1 || !this.val1 || !this.val2) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await hnlgbd(this.index1, this.val1, this.val2)
|
||||
this.disabled1 = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
</style>
|
||||
80
pages/manage/hnlgcx.vue
Normal file
80
pages/manage/hnlgcx.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">料罐条码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<view class="filter_input" style="color: #E9B451; font-weight: 700;">{{code}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap.stop="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_hnlgcx(val1)">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {hnlgcx} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
code: null,
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
clearUp () {
|
||||
this.val1 = null
|
||||
this.code = null
|
||||
this.disabled = false
|
||||
},
|
||||
async _hnlgcx (e) {
|
||||
this.disabled = true
|
||||
try {
|
||||
let res = await hnlgcx(e)
|
||||
this.disabled = false
|
||||
if (res) {
|
||||
this.code = res.material_code
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.msg_wrapper
|
||||
height auto
|
||||
min-height 30%
|
||||
</style>
|
||||
152
pages/manage/inst-manage.vue
Normal file
152
pages/manage/inst-manage.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content pdt0">
|
||||
<view class="filter_wrapper">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8 font-style-1" v-for="e in state" :key="e.id" @tap="changeTab(e)">
|
||||
<view class="font-style-1" :class="{'font-style-2': e.id === tab}">{{e.text}}</view>
|
||||
<view class="tab-line" :class="{'tab-line_active': e.id === tab}"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-wrapper">
|
||||
<view class="item-wrap" v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)" :class="{isChecked: pkId === e.inst_uuid}">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-15 item-font-1">{{e.task_no}} | {{e.inst_status_name}}</view>
|
||||
<view class="zd-col-9 item-font-2" style="text-align:right">{{e.create_time}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-16">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-6 item-font-3">指令号:</view>
|
||||
<view class="zd-col-18 item-font-4">{{e.inst_no}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-10 item-font-3">指令执行步骤:</view>
|
||||
<view class="zd-col-14 item-font-4">{{e.inst_step}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-6 item-font-3">载具号:</view>
|
||||
<view class="zd-col-18 item-font-4">{{e.carrier}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-6 item-font-3">车号:</view>
|
||||
<view class="zd-col-18 item-font-4">{{e.carno}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<view class="item-font-5">{{e.priority}}</view>
|
||||
<view class="item-font-7">优先级</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-10 item-font-6">起始设备:{{e.start_devicecode}}</view>
|
||||
<view class="zd-col-2 item-font-7">––</view>
|
||||
<view class="zd-col-10 item-font-6">目标设备:{{e.next_devicecode}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('1')">指令撤销</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('2')">重新下发</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handInst('3')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {handInsts, handInst} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}],
|
||||
tab: '-1',
|
||||
title: '',
|
||||
data: [],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._handInsts()
|
||||
},
|
||||
methods: {
|
||||
toSearch () {
|
||||
this.show = true
|
||||
this.tab = '-1'
|
||||
},
|
||||
async _handInsts () {
|
||||
try {
|
||||
let res = await handInsts(this.val1, this.val2, this.val3)
|
||||
if (res.code === '1') {
|
||||
this.data = [...res.result]
|
||||
this.dataList = [...this.data]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
changeTab (e) {
|
||||
this.tab = e.id
|
||||
if (e.id !== '-1') {
|
||||
let arr = this.data.filter(el => {return el.inst_status === e.id})
|
||||
this.dataList = [...arr]
|
||||
} else {
|
||||
this.dataList = [...this.data]
|
||||
}
|
||||
},
|
||||
async _handInst (type) {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handInst(type, this.pkId)
|
||||
if (res.code === '1') {
|
||||
this.disabled = false
|
||||
this.tab = '-1'
|
||||
this._handInsts()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.disabled = false
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.item-font-1
|
||||
font-size 28rpx
|
||||
</style>
|
||||
92
pages/manage/smck.vue
Normal file
92
pages/manage/smck.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">木托盘编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap.stop="clearUp">清空</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1}" :disabled="disabled1" @tap="toSure1">入库</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': !val1}" :disabled="disabled2" @tap="toSure2">出库</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {pdaSmck} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
clearUp () {
|
||||
this.val1 = null
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.val1) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._pdaSmck('1')
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.val1) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._pdaSmck('2')
|
||||
},
|
||||
async _pdaSmck (type) {
|
||||
try {
|
||||
let res = await pdaSmck(this.val1, type)
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.val1 = ''
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.msg_wrapper
|
||||
height auto
|
||||
min-height 30%
|
||||
</style>
|
||||
136
pages/manage/task-manage.vue
Normal file
136
pages/manage/task-manage.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content pdt0">
|
||||
<view class="filter_wrapper">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8 font-style-1" v-for="e in state" :key="e.id" @tap="changeTab(e)">
|
||||
<view class="font-style-1" :class="{'font-style-2': e.id === tab}">{{e.text}}</view>
|
||||
<view class="tab-line" :class="{'tab-line_active': e.id === tab}"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-wrapper">
|
||||
<view class="item-wrap" v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)" :class="{isChecked: pkId === e.task_uuid}">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-10 item-font-1">{{e.task_no}}</view>
|
||||
<view class="zd-col-10 item-font-2" style="text-align:right">{{e.create_time}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-16">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-7 item-font-3">任务状态:</view>
|
||||
<view class="zd-col-17 item-font-4">{{e.task_status_name}}</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-7 item-font-3">载具号:</view>
|
||||
<view class="zd-col-17 item-font-4">{{e.carrier}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-col-8">
|
||||
<view class="item-font-5">{{e.priority}}</view>
|
||||
<view class="item-font-7">优先级</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-10 item-font-6">起始设备:{{e.start_devicecode}}</view>
|
||||
<view class="zd-col-2 item-font-7">––</view>
|
||||
<view class="zd-col-10 item-font-6">目标设备:{{e.next_devicecode}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('1')">重新生成</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_handTaskoperation('2')">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {handTasks, handTaskoperation} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
state: [{id:'-1', text: '全部'}, {id:'0', text: '就绪'}, {id:'1', text: '执行中'}],
|
||||
tab: '-1',
|
||||
title: '',
|
||||
data: [],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._handTasks()
|
||||
},
|
||||
methods: {
|
||||
async _handTasks () {
|
||||
try {
|
||||
let res = await handTasks()
|
||||
if (res.code === '1') {
|
||||
this.data = [...res.result]
|
||||
this.dataList = [...this.data]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
changeTab (e) {
|
||||
this.tab = e.id
|
||||
if (e.id !== '-1') {
|
||||
let arr = this.data.filter(el => {return el.task_status === e.id})
|
||||
this.dataList = [...arr]
|
||||
} else {
|
||||
this.dataList = [...this.data]
|
||||
}
|
||||
},
|
||||
async _handTaskoperation (type) {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handTaskoperation(type, this.pkId)
|
||||
if (res.code === '1') {
|
||||
this.disabled = false
|
||||
this.tab = '-1'
|
||||
this._handTasks()
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.disabled = false
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
131
pages/manage/yzmlby.vue
Normal file
131
pages/manage/yzmlby.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">区域</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<view class="filter_input">压制区域</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">点位</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">条码</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">重量</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<input type="number" class="filter_input" v-model="val2">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">数量</span>
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<input type="number" class="filter_input" v-model="val3">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !index2 || !val1 || !val2 || !val3}" :disabled="disabled" @tap="_mlTask">满料搬运</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {mlTask} from '@/utils/getData2.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options2: this.generateArray(),
|
||||
index2: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
generateArray(prefix, suffix) {
|
||||
const array = []
|
||||
const baseText = '压制机'
|
||||
const baseValue = 'YJ'
|
||||
const maxMachines = 10
|
||||
const maxPositions = 2
|
||||
|
||||
for (let machine = 1; machine <= maxMachines; machine++) {
|
||||
for (let position = 1; position <= maxPositions; position++) {
|
||||
array.push({
|
||||
value: `${baseValue}${String(machine).padStart(2, '0')}XLW${String(position).padStart(2, '0')}`,
|
||||
text: `${baseText}${String(machine).padStart(2, '0')}下料位${String(position).padStart(2, '0')}`
|
||||
});
|
||||
}
|
||||
}
|
||||
return array
|
||||
},
|
||||
change (e) {
|
||||
this.options1.map((el, i) => {
|
||||
if (e === i) {
|
||||
this.options2 = el.point
|
||||
}
|
||||
})
|
||||
},
|
||||
clearUp () {
|
||||
this.index2 = ''
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
},
|
||||
async _mlTask () {
|
||||
this.disabled = true
|
||||
if (!this.index2 || !this.val1 || !this.val2 || !this.val3) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await mlTask(this.index2, this.val1, this.val2, this.val3)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user