This commit is contained in:
2023-06-30 11:27:19 +08:00
parent a49a28370b
commit 07bb2bc3fb
4 changed files with 464 additions and 116 deletions

View File

@@ -1,113 +1,55 @@
<template>
<div class="container">
<header>
<div class="left-box">
<button class="fl logo iconfont dropdown_icon" ref="logo" @click="getInfo">登录人员{{userName}}</button>
<ul class="drift dropdown-ul" id="dropdown-ul" :style="{'height': drift+'rem','width' : cwidth + 'px'}">
<li @click="exit">退出</li>
</ul>
<div class="content blue" ref="content">
<jxHeader
:title="title"
@switchColor="switchColor"
/>
<div class="body-container">
<div class="main-container">
<router-view></router-view>
</div>
</div>
</div>
<div class="fr date-box">
<p class="time">{{time}}</p>
<p class="date">{{date}}<span class="week">{{week}}</span></p>
</div>
</header>
<router-view></router-view>
</div>
</template>
</template>
<script>
import jxHeader from '@components/header2.vue'
export default {
name: 'homeset',
components: {
jxHeader
},
data () {
return {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : '',
timer: null,
time: '',
date: '',
week: '',
drift: 0,
cwidth: ''
title: ['成品入库', '选择成品箱物料', '成品入库查询'][Number(this.$route.meta.guidePath) - 1]
}
},
mounted () {
this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
getInfo () {
this.cwidth = this.$refs.logo.clientWidth
this.drift = this.drift === 0 ? 0.5 : 0
},
exit () {
this.$store.dispatch('delUserInfo')
this.$router.push('/login')
},
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}`
switchColor (type) {
switch (type) {
case 1:
this.$refs.content.classList.value = 'content overall_orange'
break
case 2:
this.$refs.content.classList.value = 'content overall_lightgreen'
break
case 3:
this.$refs.content.classList.value = 'content overall_blue'
break
}
}
}
}
</script>
<style lang="stylus" scoped>
.left-box
position relative
.logo
position relative
height 45px
overflow hidden
padding-right .3rem
line-height 45px
font-size 16px
background none
color #fff
.dropdown-ul
position absolute
background #3157a3
top calc(.6rem + 3px)
left 0
overflow hidden
border-bottom-left-radius .05rem
border-bottom-right-radius .05rem
box-shadow 0 2px 3px rgba(228,243,244,0.5)
li
text-align center
line-height .5rem
font-size .15rem
color #fff
border-bottom 1px solid #767a82
&:last-child
border-bottom none
.date-box
max-width 50%
height 45px
overflow hidden
display flex
justify-content flex-end
align-items center
.time
font-size 16px
line-height 24px
margin-right 10px
color #fff
.date
font-size 16px
line-height 24px
color #fff
.week
font-size 16px
.drift
transition height .3s linear
@import '~@style/mixin.styl'
.content
_wh(100%, 100vh)
.body-container
_wh(calc(100% - 30px), calc(100% - 55px))
margin 0 auto 10px
padding 5px
border 1px solid #484cce
.main-container
_wh(100%, 100%)
</style>

View File

@@ -0,0 +1,113 @@
<template>
<div class="container">
<header>
<div class="left-box">
<button class="fl logo iconfont dropdown_icon" ref="logo" @click="getInfo">登录人员{{userName}}</button>
<ul class="drift dropdown-ul" id="dropdown-ul" :style="{'height': drift+'rem','width' : cwidth + 'px'}">
<li @click="exit">退出</li>
</ul>
</div>
<div class="fr date-box">
<p class="time">{{time}}</p>
<p class="date">{{date}}<span class="week">{{week}}</span></p>
</div>
</header>
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'homeset',
data () {
return {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : '',
timer: null,
time: '',
date: '',
week: '',
drift: 0,
cwidth: ''
}
},
mounted () {
this.timer = window.setInterval(this.updateTime, 1000)
},
methods: {
getInfo () {
this.cwidth = this.$refs.logo.clientWidth
this.drift = this.drift === 0 ? 0.5 : 0
},
exit () {
this.$store.dispatch('delUserInfo')
this.$router.push('/login')
},
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}`
}
}
}
</script>
<style lang="stylus" scoped>
.left-box
position relative
.logo
position relative
height 45px
overflow hidden
padding-right .3rem
line-height 45px
font-size 16px
background none
color #fff
.dropdown-ul
position absolute
background #3157a3
top calc(.6rem + 3px)
left 0
overflow hidden
border-bottom-left-radius .05rem
border-bottom-right-radius .05rem
box-shadow 0 2px 3px rgba(228,243,244,0.5)
li
text-align center
line-height .5rem
font-size .15rem
color #fff
border-bottom 1px solid #767a82
&:last-child
border-bottom none
.date-box
max-width 50%
height 45px
overflow hidden
display flex
justify-content flex-end
align-items center
.time
font-size 16px
line-height 24px
margin-right 10px
color #fff
.date
font-size 16px
line-height 24px
color #fff
.week
font-size 16px
.drift
transition height .3s linear
</style>

View File

@@ -8,9 +8,9 @@
<el-select v-model="value1" filterable clearable placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id">
</el-option>
</el-select>
</div>
@@ -21,9 +21,9 @@
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
@@ -34,9 +34,9 @@
<el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option
v-for="item in options3"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
:key="item.point_code"
:label="item.point_name"
:value="item.point_code">
</el-option>
</el-select>
</div>
@@ -56,7 +56,7 @@
<div class="search-item_2 flexend">
<button class="button button--primary">确认入库</button>
<button class="button button--primary">作业查询</button>
<button class="button button--primary">添加单据物料</button>
<button class="button button--primary" @click="toAddBillMater">添加单据物料</button>
<button class="button button--primary">删除一行</button>
</div>
</div>
@@ -76,15 +76,15 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in [1, 2, 3]" :key="i">
<td>1</td>
<td>030301010031</td>
<td>碳化钨粉ZW300</td>
<td>1000</td>
<td></td>
<td>xno01</td>
<td>RT20210616001</td>
<td>供应商甲</td>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.material_code}" @click="toRadio(e)">
<td>i</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.sale_qty}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.bucketunique}}</td>
<td>{{e.sale_code}}</td>
<td>{{e.cust_name}}</td>
</tr>
</tbody>
</table>
@@ -93,6 +93,7 @@
</template>
<script>
import { getBcpStor, getBillType, getPoint } from '../../../config/getData1.js'
export default {
data () {
return {
@@ -101,7 +102,47 @@ export default {
options2: [],
value2: '',
options3: [],
value3: ''
value3: '',
dataList: [{material_code: '030301010031'}],
pkId: '',
pkObj: {}
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
},
created () {
this._getBcpStor()
this._getBillType()
this._getPoint()
},
methods: {
// 仓库下拉框
async _getBcpStor () {
let res = await getBcpStor()
this.options1 = [...res.data]
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options2 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
toAddBillMater () {
this.$router.push('/selectfinishedmater')
},
toRadio (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
}
}
}