优化代码

This commit is contained in:
蔡玲
2024-09-12 09:48:30 +08:00
parent 8519b4249f
commit 4d4c7c016a
32 changed files with 60 additions and 1467 deletions

View File

@@ -30,4 +30,5 @@ npm test
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
# 注意事项
+ 屏幕分辨率800 * 600
+ 屏幕分辨率1280 * 960
+ 15寸分辨率1024*768这个为标准

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>山东金宝一体机</title>
</head>
<body>

View File

@@ -17,11 +17,10 @@
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"element-ui": "^2.8.2",
"fastclick": "^1.0.6",
"jsencrypt": "^3.3.2",
"vue": "^2.5.2",
"vue-infinite-scroll": "^2.0.2",
"vue-router": "^3.0.1",
"vue-seamless-scroll": "^1.1.23",
"vuex": "^3.0.1"
},
"devDependencies": {

View File

@@ -9,3 +9,9 @@ export default {
name: 'App'
}
</script>
<style lang="stylus" scoped>
#app
width 100%
height 100%
</style>

View File

@@ -1,45 +0,0 @@
<template>
<div></div>
</template>
<script>
export default {
name: 'Back',
data () {
return {
lockTime: this.$store.getters.lockTime,
timeOut: null,
actions: ['mouseup', 'mousemove', 'keyup', 'click', 'touchend']
}
},
mounted () {
if (Number(this.lockTime) !== 0) {
this.isTimeOut()
}
},
methods: {
startTimer () {
// console.log('8')
clearInterval(this.timeOut)
this.timeOut = setInterval(() => {
this.$router.push({path: '/'})
// console.log('time', 1000 * 6 * this.lockTime)
}, 1000 * 60 * this.lockTime)
},
isTimeOut () {
this.startTimer()
this.actions.forEach(item => {
document.body.addEventListener(item, this.startTimer)
})
}
},
beforeDestroy () {
this.actions.forEach(item => {
// console.log(item)
document.body.removeEventListener(item, this.startTimer)
})
clearInterval(this.timeOut)
this.timeOut = null
}
}
</script>

View File

@@ -1,37 +0,0 @@
<template>
<div v-show="mdShow" class="message-box__wrapper">
<div class="message-box">
<div class="message-box__content">
<div class="message-box__message"><p>{{message}}</p></div>
<div class="message-box__input">
<slot></slot>
</div>
</div>
<div class="message-box__btns">
<div class="fr">
<button class="mgr5 button--primary button--defalut" @click="closeModal">&nbsp;&nbsp;</button>
<button class="button--primary" @click="comfirm" :disabled="disabled">&nbsp;&nbsp;</button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Modal',
props: {
mdShow: Boolean,
message: String,
disabled: Boolean
},
methods: {
closeModal () {
this.$emit('closeModalCallback')
},
comfirm () {
this.$emit('comfirmCallback', this.type)
}
}
}
</script>

View File

@@ -1,67 +0,0 @@
<template>
<div class="container">
<header>
<div class="header-tip">设备{{deviceCode}}</div>
<button class="button button--primary" @click="goBack">&nbsp;&nbsp;</button>
</header>
<!-- <ul v-if="tabShow" class="tabs">
<li v-for="i in menus" :key="i.index">
<router-link :to="i.router" :class="{'router-link-active': i.index === activeIndex}">{{i.label}}</router-link>
</li>
</ul> -->
<slot></slot>
</div>
</template>
<script>
export default {
name: 'Assignment',
props: {
deviceCode: String,
activeIndex: String,
tabShow: {
type: Boolean,
default: true
},
inner: {
type: Boolean,
default: false
}
},
data () {
return {
menus: [
{
label: '工单操作',
index: '1',
router: '/operation'
}
// {
// label: '残次品上报',
// index: '2',
// router: '/ungraded'
// },
// {
// label: '状态设置',
// index: '3',
// router: '/stateset'
// },
// {
// label: '工单查询',
// index: '4',
// router: '/opersearch'
// }
]
}
},
methods: {
goBack () {
if (this.inner) {
this.$emit('goIn')
} else {
this.$router.push('/home')
}
}
}
}
</script>

View File

@@ -1,116 +0,0 @@
<template>
<div>
<transition name="bounce">
<div class="alert-wrap">
<div class="text">{{alertMsg}}</div>
<div class="hairline--top">
<button class="button--large" @click="onClose"><span>确认</span></button>
</div>
</div>
</transition>
<transition name="fade">
<div class="overlay"></div>
</transition>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {}
},
computed: mapState({
alertMsg: state => state.com.alertMsg
}),
methods: {
onClose () {
this.$store.dispatch('showAlert', false)
}
}
}
</script>
<style lang="stylus" scoped>
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.bounce-enter {
opacity 0
transform translate3d(-50%, -50%, 0) scale(0.7)
}
.bounce-leave-active {
opacity 0
transform translate3d(-50%, -50%, 0) scale(0.9)
}
.fade-enter-active
animation 0.3s fade-in
.fade-leave-active
animation 0.3s fade-out
.overlay
position fixed
top 0
left 0
width 100%
height 100%
background-color rgba(0, 0, 0, 0.7)
z-index 2012
.alert-wrap
position fixed
top 50%
left 50%
width 45%
transition .3s
transform translate3d(-50%, -50%, 0)
overflow hidden
border-radius 4px
border 1px solid #ebeef5
background-color #fff
box-shadow 0 2px 12px 0 rgba(0,0,0,.3)
font-size .28rem
line-height .42rem
color #929292
z-index 2018
.text
padding .1rem
max-height 60vh
overflow-y auto
text-align center
-webkit-overflow-scrolling touch
white-space pre-wrap
color #606266
[class*='hairline']
position relative
[class*='hairline']::after
content ' '
position absolute
pointer-events none
box-sizing border-box
top -50%
left -50%
right -50%
bottom -50%
transform scale(0.5)
border 0 solid #ebedf0
.hairline--top::after
border-top-width 1px
.button--large
width 100%
height .5rem
line-height .5rem
color #fff
background-color #2778f3
</style>

View File

@@ -1,111 +0,0 @@
<template>
<div>
<div v-if="active" class="dialog_wrapper">
<div class="dialog">
<div class="dialog_header">
<span class="dialog_title">{{title}}</span>
<button class="dialog_headerbtn" @click="toCancle">
<i class="iconfont close_icon"></i>
</button>
</div>
<div class="dialog_body">
<slot></slot>
</div>
<div class="dialog_footer">
<button class="button button--primary" @click="toCancle">取消</button>
<button class="button button--primary" :class="{'button--info': unclick === true}" :disabled="disabled" @click="toSure">确定</button>
</div>
</div>
</div>
<div v-if="active" class="modal"></div>
</div>
</template>
<script>
export default {
name: 'jxDialog',
props: {
title: String,
type: String,
unclick: {
type: Boolean,
default: false
}
},
data () {
return {
active: false,
disabled: false
}
},
methods: {
toCancle () {
this.active = false
this.$emit('toCancle', this.type)
},
toSure () {
this.$emit('toSure', this.type)
}
}
}
</script>
<style lang="stylus" scoped>
.modal
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: .5;
background: #000;
z-index: 101;
.dialog_wrapper
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
z-index: 102;
.dialog
position: relative;
margin: 0 auto 50px;
background: #fff;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,.3);
box-sizing: border-box;
width: 50%;
margin-top: 15vh;
.dialog_header
padding: 20px 20px 10px;
.dialog_title
line-height: 24px;
font-size: 18px;
color: #303133;
.dialog_headerbtn
position: absolute;
top: 20px;
right: 20px;
padding: 0;
background: transparent;
border: none;
outline: none;
cursor: pointer;
font-size: 16px;
.close_icon
width 24px
height 24px
font-size 15px
line-height 24px
top 0
.dialog_body
padding: 30px 20px;
color: #606266;
font-size: 14px;
word-break: break-all;
.dialog_footer
padding: 10px 20px 20px;
text-align: center;
box-sizing: border-box;
</style>

View File

@@ -1,252 +0,0 @@
<template>
<div class="header">
<div class="header-time-wrap">
<div class="header-time">
<div class="date_week">
<div class="xj_date">{{date}}</div>
<div class="xj_week">{{week}}</div>
</div>
<div class="xj_time">{{time}}</div>
</div>
</div>
<div class="header-center">{{ title }}</div>
<div class="header_wrap_left">
<div class="header-user-content">
<div class="header-user-txt" @click="toSelect">
<div class="span2">{{userName}}</div>
<div class="span1"></div>
</div>
<div v-show="show" class="dropdown-wrap">
<ul class="dropdown-list drift">
<li class="dropdown-item__1" @click="exit">
<i class="icon_exit"></i>
<i class="exit_txt">退出</i>
</li>
</ul>
<div class="popper__arrow"></div>
</div>
</div>
<div class="drop-button-wraper">
<div class="colors_3_wrap" @click="toSelectColor">
<div class="color_item color_1"></div>
<div class="color_item color_2"></div>
<div class="color_item color_3"></div>
</div>
<div v-show="showColor" class="dropdown-wrap">
<ul class="dropdown-list drift">
<li class="dropdown-item color_button_wrap">
<div class="color_button overall_orange" @click="switchColor(1)"></div>
<div class="color_button overall_lightgreen" @click="switchColor(2)"></div>
<div class="color_button overall_blue" @click="switchColor(3)"></div>
</li>
</ul>
<div class="popper__arrow"></div>
</div>
</div>
<div class="home_tip_wrap" @click="backHome">
<div class="iconfont icon_home"></div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
timer: null,
time: '',
date: '',
week: '',
show: false,
showColor: false
}
},
props: {
title: String
},
mounted () {
this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
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}`
},
toSelect () {
this.show = !this.show
},
exit () {
this.$store.dispatch('delUserInfo')
this.$router.push('/login')
},
toSelectColor () {
this.showColor = !this.showColor
},
switchColor (type) {
this.$emit('switchColor', type)
},
backHome () {
this.$router.push('/home')
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin.styl'
.header
height 45px
_fj()
padding 0 15px
// border-bottom 1px solid #2aa6f9
// box-shadow 0 1px 2px 0 rgba(42,166,249,.4)
.header_wrap_left
_wh(35%,45px)
_fj(flex-end)
.header-center
_wh(30%, 45px)
_font(18px, 45px, #fff,,center)
.header-user-content
position relative
height 45px
_fj(flex-start)
cursor pointer
.header-user-txt
_fj()
.span1
_wh(18px, 18px)
background url(../images/user.png) center center / 100% 100% no-repeat
margin-left 10px
.span2
_font(16px, 20px, #fff,,)
margin-bottom -2px
.drop-button-wraper
position relative
height 100%
line-height 45px
font-size 14px
color #fff
margin-left 15px
vertical-align middle
_fj(center)
.dropdown-wrap
position absolute
min-width 75px
top 35px
right 0
z-index 1
transform-origin center top
transition transform .3s ease-in-out
border 1px solid #e4e7ed
border-radius 4px
background-color #fff
box-shadow 0 2px 12px 0 rgba(0,0,0,.1)
margin 5px 0
.dropdown-list
padding 0
.dropdown-item
height 34px
_font(14px, 34px, #606266,,center)
padding 0 10px
&:hover
background-color $gray2
.dropdown-item__1
height 34px
_font(14px, 34px, #606266,,center)
padding 0 10px
_fj(center)
&:hover
background-color $gray2
.icon_exit
_font(14px, 34px, #606266,,center)
.exit_txt
_font(14px, 34px, #606266,,center)
font-style normal
margin-left 5px
.popper__arrow
position absolute
display block
width 0
height 0
border-color transparent
border-style solid
border-width 6px
filter drop-shadow(0 2px 12px rgba(0,0,0,.03))
top -5px
right 2px
border-top-width 0
border-bottom-color #fff
.header-time-wrap
_wh(35%, 45px)
.header-time
height 45px
_fj(flex-start)
.xj_time
_font(16px, 18px, #fff,,right)
.date_week
_fj()
.xj_date
_font(15px, 18px, #fff,,)
.xj_week
_font(15px, 18px, #fff,,)
margin 0 5px 0 1px
.drop-button-wraper
.dropdown-list
padding 0 10px
.dropdown-item
float left
padding 0
&:nth-child(2)
padding 0 10px
.home_tip_wrap
_wh(18px, 45px)
_fj(center)
margin-left 15px
.icon_home
_font(18px, 45px, #fff,,center)
.colors_3_wrap
position relative
_wh(18px, 18px)
border 1px solid $gray3
border-radius 50%
overflow hidden
>.color_item
_wh(58%, 58%)
position absolute
top 50%
left 50%
transform-origin 0% 0%
.color_1
transform rotate(0deg) skewX(-30deg)
background-color #ffa530
.color_2
transform rotate(120deg) skewX(-30deg)
background-color #b7e15d
.color_3
transform rotate(240deg) skewX(-30deg)
background-color #484cce
.color_button_wrap
display block
_fj()
.color_button
_wh(30px, 30px)
line-height 30px
font-size 30px
border-radius 50%
overflow hidden
&:nth-child(2)
margin 0 5px
</style>

View File

@@ -1,252 +0,0 @@
<template>
<div class="header">
<div class="header-time-wrap">
<div class="header-time">
<div class="date_week">
<div class="xj_date">{{date}}</div>
<div class="xj_week">{{week}}</div>
</div>
<div class="xj_time">{{time}}</div>
</div>
</div>
<!-- <div class="header-center">{{ title }}</div> -->
<div class="header_wrap_left">
<div class="header-user-content">
<div class="header-user-txt" @click="toSelect">
<div class="span2">{{userName}}</div>
<div class="span1"></div>
</div>
<div v-show="show" class="dropdown-wrap">
<ul class="dropdown-list drift">
<li class="dropdown-item__1" @click="exit">
<i class="icon_exit"></i>
<i class="exit_txt">退出</i>
</li>
</ul>
<div class="popper__arrow"></div>
</div>
</div>
<!-- <div class="drop-button-wraper">
<div class="colors_3_wrap" @click="toSelectColor">
<div class="color_item color_1"></div>
<div class="color_item color_2"></div>
<div class="color_item color_3"></div>
</div>
<div v-show="showColor" class="dropdown-wrap">
<ul class="dropdown-list drift">
<li class="dropdown-item color_button_wrap">
<div class="color_button overall_orange" @click="switchColor(1)"></div>
<div class="color_button overall_lightgreen" @click="switchColor(2)"></div>
<div class="color_button overall_blue" @click="switchColor(3)"></div>
</li>
</ul>
<div class="popper__arrow"></div>
</div>
</div>
<div class="home_tip_wrap" @click="backHome">
<div class="iconfont icon_home"></div>
</div> -->
</div>
</div>
</template>
<script>
export default {
data () {
return {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : 'admin',
timer: null,
time: '',
date: '',
week: '',
show: false,
showColor: false
}
},
props: {
title: String
},
mounted () {
this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
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}`
},
toSelect () {
this.show = !this.show
},
exit () {
this.$store.dispatch('delUserInfo')
this.$router.push('/login')
},
toSelectColor () {
this.showColor = !this.showColor
},
switchColor (type) {
this.$emit('switchColor', type)
},
backHome () {
this.$router.push('/home')
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin.styl'
.header
height 45px
_fj()
padding 0 15px
// border-bottom 1px solid #2aa6f9
// box-shadow 0 1px 2px 0 rgba(42,166,249,.4)
.header_wrap_left
_wh(35%,45px)
_fj(flex-end)
.header-center
_wh(30%, 45px)
_font(18px, 45px, #fff,,center)
.header-user-content
position relative
height 45px
_fj(flex-start)
cursor pointer
.header-user-txt
_fj()
.span1
_wh(18px, 18px)
background url(../images/user.png) center center / 100% 100% no-repeat
margin-left 10px
.span2
_font(16px, 20px, #fff,,)
margin-bottom -2px
.drop-button-wraper
position relative
height 100%
line-height 45px
font-size 14px
color #fff
margin-left 15px
vertical-align middle
_fj(center)
.dropdown-wrap
position absolute
min-width 75px
top 35px
right 0
z-index 1
transform-origin center top
transition transform .3s ease-in-out
border 1px solid #e4e7ed
border-radius 4px
background-color #fff
box-shadow 0 2px 12px 0 rgba(0,0,0,.1)
margin 5px 0
.dropdown-list
padding 0
.dropdown-item
height 34px
_font(14px, 34px, #606266,,center)
padding 0 10px
&:hover
background-color $gray2
.dropdown-item__1
height 34px
_font(14px, 34px, #606266,,center)
padding 0 10px
_fj(center)
&:hover
background-color $gray2
.icon_exit
_font(14px, 34px, #606266,,center)
.exit_txt
_font(14px, 34px, #606266,,center)
font-style normal
margin-left 5px
.popper__arrow
position absolute
display block
width 0
height 0
border-color transparent
border-style solid
border-width 6px
filter drop-shadow(0 2px 12px rgba(0,0,0,.03))
top -5px
right 2px
border-top-width 0
border-bottom-color #fff
.header-time-wrap
_wh(35%, 45px)
.header-time
height 45px
_fj(flex-start)
.xj_time
_font(16px, 18px, #fff,,right)
.date_week
_fj()
.xj_date
_font(15px, 18px, #fff,,)
.xj_week
_font(15px, 18px, #fff,,)
margin 0 5px 0 1px
.drop-button-wraper
.dropdown-list
padding 0 10px
.dropdown-item
float left
padding 0
&:nth-child(2)
padding 0 10px
.home_tip_wrap
_wh(18px, 45px)
_fj(center)
margin-left 15px
.icon_home
_font(18px, 45px, #fff,,center)
.colors_3_wrap
position relative
_wh(18px, 18px)
border 1px solid $gray3
border-radius 50%
overflow hidden
>.color_item
_wh(58%, 58%)
position absolute
top 50%
left 50%
transform-origin 0% 0%
.color_1
transform rotate(0deg) skewX(-30deg)
background-color #ffa530
.color_2
transform rotate(120deg) skewX(-30deg)
background-color #b7e15d
.color_3
transform rotate(240deg) skewX(-30deg)
background-color #484cce
.color_button_wrap
display block
_fj()
.color_button
_wh(30px, 30px)
line-height 30px
font-size 30px
border-radius 50%
overflow hidden
&:nth-child(2)
margin 0 5px
</style>

View File

@@ -1,30 +0,0 @@
<template>
<div class="loading">
<div class="loader-inner">
<img src="../images/oval-white.svg">
</div>
</div>
</template>
<style lang="stylus" scoped>
.loading
position fixed
width 100%
height 100%
z-index 100000
.loader-inner
position absolute
z-index 100000
height 50px
width 50px
padding 10px
transform translate(-25px, -25px)
left 50%
top 50%
overflow hidden
background-color rgba(0, 0, 0, .5)
border-radius 3px
img
width 100%
height 100%
</style>

View File

@@ -1,44 +0,0 @@
<template>
<div class="toast">
<div class="toast-wrap">
<div class="text">
{{toastMsg}}
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {}
},
computed: mapState({
toastMsg: state => state.com.toastMsg
})
}
</script>
<style lang="stylus" scoped>
.toast
.toast-wrap
position fixed
z-index 10000
width 100%
height .5rem
line-height .5rem
text-align center
left 50%
top 50%
transform translate(-50%, -50%)
.text
display inline-block
width auto
text-align center
padding 0 .1rem
border-radius 10px
background #a2a6ae
font-size .2rem
color #fff
</style>

View File

@@ -1,16 +0,0 @@
import {accDiv} from '@config/utils.js'
const filter = {
numeric (value, bit) {
if (!value) return ''
return Number(value).toFixed(bit)
},
unitskg (value) {
if (!value) return ''
let res = accDiv(value, 1000)
res = Number(res).toFixed(3)
return res
}
}
export default filter

View File

@@ -1,221 +0,0 @@
import {post} from '@config/http.js'
// 菜单
export const authority = () => {
let res = {
sonTree: [
{menu_id: '1',
path: 'RF01',
name: '工单管理',
sonTree: [
{menu_id: '1', name: '工单作业', path: '/workorderassignment'}
]
},
{menu_id: '2',
path: 'RF02',
name: '半成品管理',
sonTree: [
{menu_id: '1', name: '半成品入库', path: '/semifinishedinstore'},
{menu_id: '2', name: '半成品出库', path: '/semifinishedoutstore'},
{menu_id: '3', name: '半成品盘点', path: '/semifinishedcheck'},
{menu_id: '4', name: '半成品拼盘', path: '/semifinishedcomposesearch'}
]
},
{menu_id: '3',
path: 'RF03',
name: '成品管理',
sonTree: [
{menu_id: '1', name: '批量入库', path: '/batchinstore'},
{menu_id: '2', name: '成品入库', path: '/finishedinstore'}
]
},
{menu_id: '4',
path: 'RF13',
name: '刻字管理',
sonTree: [
{menu_id: '1', name: '刻字工序', path: '/letteringprocess'},
{menu_id: '2', name: '人工刻字上料', path: '/letteringload'}
]
},
{menu_id: '5',
path: 'RF05',
name: '清洗管理',
sonTree: [
{menu_id: '1', name: '清洗管理', path: '/cleaningloading'},
{menu_id: '2', name: '人工倒料', path: '/manpour'}
]
},
{menu_id: '6',
path: 'RF07',
name: '专机管理',
sonTree: [
{menu_id: '1', name: '人工倒料', path: '/manpouring'}
]
},
{menu_id: '7',
path: 'RF06',
name: '暂存区管理',
sonTree: [
{menu_id: '1', name: '包装机选择', path: '/bzjselect'}
]
},
{menu_id: '8',
path: 'RF04',
name: '设备管理',
sonTree: [
{menu_id: '1', name: '维修单管理', path: '/repairorder'},
{menu_id: '2', name: '保养单管理', path: '/maintainorder'},
{menu_id: '3', name: '点检单管理', path: '/checkorder'},
{menu_id: '4', name: '润滑单管理', path: '/lubricorder'}
]
}
]
}
return res
}
// 成品入库
// 1.1仓库下拉框
export const getBcpStor = () => post('api/pda/cp/in/getBcpStor', {
})
// 1.2单据类型下拉框
export const getBillType = () => post('api/pda/cp/in/getBillType', {
})
// 1.3入库点下拉框
export const getPoint = () => post('api/pda/cp/in/getPoint', {
})
// 1.4添加单据物料按钮
// 1.5选择成品箱物料页面
export const getMaterial = (page, size, btime, etime, scode, mcode) => post('api/pda/cp/in/getMaterial', {
page: page,
size: size,
begin_time: btime,
end_time: etime,
sale_code: scode,
material_code: mcode
})
// 1.6删除一行(按钮)
// 1.7确认入库(按钮)-->点击后弹出框(“确认入库是否继续?”)
export const confirmIn = (from) => post('api/pda/cp/in/confirmIn', {
from: from
})
// 1.8作业查询(按钮)
// 2.1成品入库查询
export const outgetAll = (sid, btime, etime, btype, mcode, scode) => post('api/pda/cp/in/getAll', {
stor_id: sid,
begin_time: btime,
end_time: etime,
bill_type: btype,
material_code: mcode,
storagevehicle_code: scode
})
// 2.2强制确认(按钮)
export const inconfirm = (row) => post('api/pda/cp/in/confirm', {
row: row
})
// 刻字上料
// 1.1设备列表
export const devicelist = () => post('api/device/list', {
workprocedure_id: '1535144682756116480'
})
// 1.2车间列表
export const dictDetailByCode = (code) => post('api/dict/dictDetailByCode', {
code: code
})
// 1卸料
export const kzunload = (dcode, qty) => post('api/pda/kzunload', {
device_code: dcode,
qty: qty
})
// 2余料上完
export const kzresidue = (dcode) => post('api/pda/kzresidue', {
device_code: dcode
})
// 临时人工刻字上料
// 1刻字上料
export const tmpcallVechile = (dcode, qty) => post('api/pda/tmpcallVechile', {
device_code: dcode,
qty: qty
})
// 2空框回库
export const tmpsendVechile = (dcode) => post('api/pda/tmpsendVechile', {
device_code: dcode
})
// 公共接口
// 1.1车间列表
export const dictall = () => post('api/dict/all', {
})
// 人工倒料
// 1.1设备列表
export const washdevicelist = (wid) => post('api/device/list', {
workprocedure_id: wid
})
// 1.2根据设备列表获取物料信息
export const washquery = (parea, dcode) => post('api/pda/wash/query', {
product_area: parea,
device_code: dcode
})
// 1.3称重
export const washweighing = (list) => post('api/pda/wash/weighing', {
list: list
})
// 1.4确认
export const washweighingFinish = (dcode, dweight, mcode, mspec, mname) => post('api/pda/wash/weighingFinish', {
device_code: dcode,
deviceinstor_weight: dweight,
material_code: mcode,
material_spec: mspec,
material_name: mname
})
// 1.5查询物料列表
export const washmaterialList = (page, size, mcode) => post('api/pda/wash/materialList', {
page: page,
size: size,
material_code: mcode
})
// 暂存区管理
// 包装机管理1
// 1.2包装机选择列表
export const packageList = () => post('api/pda/package/packageList', {
})
// 1.3空框送回
export const sendVechile = (dcode) => post('api/pda/package/sendVechile', {
device_code: dcode
})
// 刻字暂存位选择2
// 1.2包装机选择列表
export const cachepoint = () => post('api/pda/package/cachepoint', {
})
// 1.3确认上料
export const sendMaterial = (dcode, pcode) => post('api/pda/package/sendMaterial', {
device_code: dcode,
point_code: pcode
})
// 1.3空框送回
export const sendVechile2 = (dcode, pcode) => post('api/pda/package/sendVechile2', {
device_code: dcode,
point_code: pcode
})

View File

@@ -1,5 +1,4 @@
import axios from 'axios'
import { Dialog } from './utils.js'
import store from '../vuex/store'
import router from '@/router'
@@ -23,7 +22,7 @@ axios.interceptors.request.use(
return config
},
error => {
Dialog('错误的传参')
this.$message.error('错误的传参')
return Promise.reject(error)
}
)
@@ -55,7 +54,7 @@ export const post = (sevmethod, params) => {
.then(response => {
resolve(response.data)
}, error => {
Dialog(error.message)
this.$message.error(error.message)
reject(error.message)
})
.catch((error) => {
@@ -70,7 +69,7 @@ export const get = (sevmethod, params) => {
.then(response => {
resolve(response.data)
}, error => {
Dialog(error.message)
this.$message.error(error.message)
reject(error.message)
})
.catch((error) => {

View File

@@ -5,7 +5,7 @@
var recalc = function () {
var clientWidth = docEl.clientWidth
if (!clientWidth) return
docEl.style.fontSize = 100 * (clientWidth / 800) + 'px'
docEl.style.fontSize = 100 * (clientWidth / 1024) + 'px'
}
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)

View File

@@ -1,27 +1,3 @@
import store from '../vuex/store'
/**
* 弹出框
*/
export const Dialog = (str) => {
store.dispatch('showAlert', true)
store.dispatch('alertMsg', str)
setTimeout(() => {
store.dispatch('showAlert', false)
}, 30000)
}
/**
* 提示框
*/
export const toast = (str) => {
store.dispatch('showToast', true)
store.dispatch('toastMsg', str)
setTimeout(() => {
store.dispatch('showToast', false)
}, 3000)
}
/**
* 存储localStorage
*/

BIN
src/images/area_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 KiB

View File

@@ -4,29 +4,18 @@ import Vue from 'vue'
import App from './App'
import router from './router'
import store from './vuex/store'
import '@config/rem.js'
import '@style/reset.css'
import '@style/layout.styl'
import fastClick from 'fastclick'
import infiniteScroll from 'vue-infinite-scroll'
import { DatePicker, Select, Option } from 'element-ui'
import '@config/rem.js'
import {post} from '@config/http.js'
import { Dialog, toast } from '@config/utils.js'
import filter from '@config/filter.js'
import { Message, Select, Option } from 'element-ui'
import scroll from 'vue-seamless-scroll'
import JSEncrypt from 'jsencrypt'
fastClick.attach(document.body)
Vue.use(infiniteScroll)
Vue.use(DatePicker)
Vue.prototype.$message = Message
Vue.use(Select)
Vue.use(Option)
Vue.prototype.$post = post
Vue.prototype.Dialog = Dialog
Vue.prototype.toast = toast
Vue.use(scroll)
Vue.config.productionTip = false
for (let k in filter) {
Vue.filter(k, filter[k])
}
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='

View File

@@ -1,7 +1,7 @@
<template>
<div class="canvas-wrap">
<canvas id="lineCanvas" width="400" height="500"></canvas>
<canvas id="carCanvas" width="400" height="500"></canvas>
<canvas id="lineCanvas" width="300" height="300"></canvas>
<canvas id="carCanvas" width="300" height="300"></canvas>
</div>
</template>

View File

@@ -76,7 +76,7 @@
</div>
</div>
<div class="r-wrap" @click="rectClick">
<t-canvas></t-canvas>
<!-- <t-canvas></t-canvas> -->
</div>
</div>
</div>

View File

@@ -1,37 +0,0 @@
.dropdown_icon::before
position absolute
right 0
top 0
content: '\e626'
.radio__icon--disabled .icon::before
content '\e608'
.radio__icon--checked .icon::before
content '\e608'
.close_icon::before
content '\e60f'
.select_icon::before
content '\e608'
.icon_exit
&::before
content '\e892'
// new
[class*=" icon_"],[class^=icon_]
font-family: "iconfont" !important;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
line-height: 1;
vertical-align: middle;
display: inline-block;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
.icon_dropdown
font-size 15px
&::before
content: '\e626'
.icon_home
&::before
content: '\e632'

View File

@@ -7,13 +7,16 @@
url('iconfont/iconfont.ttf') format('truetype');
//
.el-select {
width: 100%;
}
.el-input {
font-size: 16px;
font-size: .16rem;
}
.el-input__inner {
height 40px;
font-size: 14px;
line-height: 40px;
height .4rem;
font-size: .14rem;
line-height: .4rem;
// text-align: right;
border: 0;
background-color: transparent;
@@ -39,25 +42,25 @@
}
.button {
font-size: 16px;
line-height: 40px;
font-size: .16rem;
line-height: .4rem;
color #fff;
padding: 0 10px
padding: 0 .1rem
border: 1px solid #fff;
border-radius: 10px;
background: transparent;
}
.button_s {
font-size: 12px;
padding: 0 2px
font-size: .12rem;
padding: 0 .02rem
}
.btn-primary {
background: linear-gradient(0deg, #005ad2, #00a0ec);
border-color: #083a7e;
}
.contianer
_wh(100vw, 100vh)
padding 2%
_wh(100%, 100%)
padding .15rem
.content
_wh(100%, 100%)
.l-wrap
@@ -68,13 +71,13 @@
border-radius: 10px;
.item-wrap
width 100%
padding 15px 8px
padding .15rem .08rem
background: linear-gradient(90deg, #213a62, #243a63);
border-radius: 10px;
margin-top: 20px;
margin-top: .2rem;
.filter-name
_font(18px, 18px, #fff, 700,)
_font(.18rem, 1, #fff, 700,)
.filter-label
_font(16px, 40px, #cee4ff,,)
_font(.16rem, .4rem, #cee4ff,,)
.filter-value
_font(14px, 40px, #b0c7e8,,right)
_font(.14rem, .4rem, #b0c7e8,,right)

View File

@@ -1,18 +1,3 @@
$red = #e74f1a
$red1 = #E74F19
$red2 = #FA6400
$green = #6CBE8B
$green1 = #00d246
$yellow = #E9B451
$blue = #6798ef
$gray = #c9c9c9
$gray1 = #8B90A6
$gray2 = #DFE1E6
$fc1 = #323232
$orange = #ffa530
$lightgreen = #b7e15d
//
_wh(w, h)
width: w

View File

@@ -14,6 +14,10 @@
}
body, html {
width: 100%;
height: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: auto;
-ms-user-select: auto;
user-select: auto;

View File

@@ -2,92 +2,28 @@ import * as types from '../types'
import { getStore, setStore } from '@config/utils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.171:8018' : 'http://192.168.81.171:8018'
const imgBaseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.171:8018' : 'http://192.168.81.171:8018'
const state = {
baseUrl: getStore('baseUrl') || baseUrl,
imgBaseUrl: getStore('imgBaseUrl') || imgBaseUrl,
lockTime: getStore('lockTime') || 0,
loading: false,
showToast: false,
showAlert: false,
showSuccess: true,
showFail: false,
toastMsg: '',
alertMsg: ''
lockTime: getStore('lockTime') || 0
}
const getters = {
baseUrl: state => state.baseUrl,
imgBaseUrl: state => state.imgBaseUrl,
lockTime: state => state.lockTime,
loading: state => state.loading,
showToast: state => state.showToast,
showAlert: state => state.showAlert
lockTime: state => state.lockTime
}
const actions = {
setConfig ({commit}, res) {
setStore('baseUrl', res.baseUrl)
setStore('imgBaseUrl', res.imgBaseUrl)
setStore('lockTime', res.lockTime)
commit(types.COM_CONFIG, res)
},
setLoadingState ({ commit }, status) {
commit(types.COM_LOADING_STATUS, status)
},
showToast ({ commit }, status) {
commit(types.COM_SHOW_TOAST, status)
},
showAlert ({ commit }, status) {
commit(types.COM_SHOW_ALERT, status)
},
showSuccess ({ commit }, status) {
commit(types.COM_SHOW_SUCCESS, status)
},
showFail ({ commit }, status) {
commit(types.COM_SHOW_FAIL, status)
},
toastMsg ({ commit }, str) {
commit(types.COM_TOAST_MSG, str)
},
alertMsg ({ commit }, str) {
commit(types.COM_ALERT_MSG, str)
}
}
const mutations = {
[types.COM_CONFIG] (state, res) {
state.baseUrl = res.baseUrl
state.imgBaseUrl = res.imgBaseUrl
state.lockTime = res.lockTime
},
[types.COM_LOADING_STATUS] (state, status) {
state.loading = status
},
[types.COM_SHOW_TOAST] (state, status) {
state.showToast = status
},
[types.COM_SHOW_ALERT] (state, status) {
state.showAlert = status
},
[types.COM_SHOW_SUCCESS] (state, status) {
state.showSuccess = status
},
[types.COM_SHOW_FAIL] (state, status) {
state.showFail = status
},
[types.COM_TOAST_MSG] (state, str) {
state.toastMsg = str
},
[types.COM_ALERT_MSG] (state, str) {
state.alertMsg = str
}
}

View File

@@ -1,70 +0,0 @@
import * as types from '../types'
import { getStore, setStore } from '@config/utils.js'
const state = {
keepAlive: JSON.parse(getStore('keepAlive')) || [], // 缓存页面
materObj: getStore('materObj') || '', // 存储对象
materArr: JSON.parse(getStore('materArr')) || [], // 存储数组
deviceUuid: getStore('deviceUuid') || '',
deviceCode: getStore('deviceCode') || '',
isProductonplan: getStore('isProductonplan') || ''
}
const getters = {
keepAlive: state => state.keepAlive,
materObj: state => state.materObj,
materArr: state => state.materArr,
deviceUuid: state => state.deviceUuid,
deviceCode: state => state.deviceCode,
isProductonplan: state => state.isProductonplan
}
const actions = {
setKeepAlive ({commit}, res) {
setStore('keepAlive', res)
commit(types.SET_KEEP_ALIVE, res)
},
setMaterObj ({commit}, res) {
setStore('materObj', res)
commit(types.SET_MATER_OBJ, res)
},
setMaterArr ({commit}, res) {
setStore('materArr', res)
commit(types.SET_MATER_ARR, res)
},
setDevice ({commit}, res) {
setStore('deviceUuid', res.deviceUuid)
setStore('deviceCode', res.deviceCode)
commit(types.DATA_DEVICE, res)
},
getIsProplan ({ commit }, res) {
setStore('isProductonplan', res)
commit(types.DATA_IS_PROPLAN, res)
}
}
const mutations = {
[types.SET_KEEP_ALIVE] (state, res) {
state.keepAlive = res
},
[types.SET_MATER_OBJ] (state, res) {
state.materObj = res
},
[types.SET_MATER_ARR] (state, res) {
state.materArr = res
},
[types.DATA_DEVICE] (state, res) {
state.deviceUuid = res.deviceUuid
state.deviceCode = res.deviceCode
},
[types.DATA_IS_PROPLAN] (state, res) {
state.isProductonplan = res
}
}
export default {
state,
getters,
actions,
mutations
}

View File

@@ -3,14 +3,12 @@ import Vuex from 'vuex'
import com from './modules/com'
import user from './modules/user'
import data from './modules/data'
Vue.use(Vuex)
export default new Vuex.Store({
modules: {
com,
user,
data
user
}
})

View File

@@ -1,12 +1,5 @@
// 公共配置
export const COM_CONFIG = 'COM_CONFIG'
export const COM_LOADING_STATUS = 'COM_LOADING_STATUS'
export const COM_SHOW_TOAST = 'COM_SHOW_TOAST' // 显示toast
export const COM_SHOW_SUCCESS = 'COM_SHOW_SUCCESS' // 显示成功toast
export const COM_SHOW_FAIL = 'COM_SHOW_FAIL' // 显示失败toast
export const COM_TOAST_MSG = 'COM_TOAST_MSG' // 显示toast文字
export const COM_SHOW_ALERT = 'COM_SHOW_ALERT'
export const COM_ALERT_MSG = 'COM_ALERT_MSG'
// 用户
export const SAVE_USER_INFO = 'SAVE_USER_INFO'

View File

@@ -2046,6 +2046,11 @@ compression@^1.7.3:
safe-buffer "5.1.2"
vary "~1.1.2"
comutils@^1.1.9:
version "1.1.19"
resolved "https://registry.yarnpkg.com/comutils/-/comutils-1.1.19.tgz#3e07f306abf48e83726511713a72b20565034443"
integrity sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw==
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -3416,11 +3421,6 @@ fast-levenshtein@~2.0.4:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
fastclick@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/fastclick/-/fastclick-1.0.6.tgz#161625b27b1a5806405936bda9a2c1926d06be6a"
integrity sha1-FhYlsnsaWAZAWTa9qaLBkm0Gvmo=
fastparse@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9"
@@ -8811,11 +8811,6 @@ vue-hot-reload-api@^2.2.0:
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz#2756f46cb3258054c5f4723de8ae7e87302a1ccf"
integrity sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==
vue-infinite-scroll@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/vue-infinite-scroll/-/vue-infinite-scroll-2.0.2.tgz#ca37a91fe92ee0ad3b74acf8682c00917144b711"
integrity sha512-n+YghR059YmciANGJh9SsNWRi1YZEBVlODtmnb/12zI+4R72QZSWd+EuZ5mW6auEo/yaJXgxzwsuhvALVnm73A==
vue-jest@^1.0.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/vue-jest/-/vue-jest-1.4.0.tgz#1d6b4d2774b0aec06cfe5d39789039d3381bc528"
@@ -8856,6 +8851,13 @@ vue-router@^3.0.1:
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.6.tgz#2e4f0f9cbb0b96d0205ab2690cfe588935136ac3"
integrity sha512-Ox0ciFLswtSGRTHYhGvx2L44sVbTPNS+uD2kRISuo8B39Y79rOo0Kw0hzupTmiVtftQYCZl87mwldhh2L9Aquw==
vue-seamless-scroll@^1.1.23:
version "1.1.23"
resolved "https://registry.yarnpkg.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz#dde81b3c79aa499791b3c3bffd0fdb22ff3e59a7"
integrity sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==
dependencies:
comutils "^1.1.9"
vue-style-loader@^3.0.0, vue-style-loader@^3.0.1:
version "3.1.2"
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-3.1.2.tgz#6b66ad34998fc9520c2f1e4d5fa4091641c1597a"