用户信息获取变动,出库功能变动

This commit is contained in:
2024-04-24 08:44:09 +08:00
parent 6002bcf721
commit eec55cf076
7 changed files with 413 additions and 374 deletions

View File

@@ -1,6 +1,7 @@
<template>
<view class="input-box">
<input :adjust-position="false" :focus="isFocus" type="text" v-model.trim="search" @confirm="getInfo" @blur="handlerBlur" />
<!-- <input type="text" v-model.trim="search" @confirm="getInfo($event)" /> -->
</view>
</template>
@@ -276,6 +277,8 @@
<style scoped>
.input-box {
background-color: #e6e6e6;
display: flex;
flex-direction: row;
/* width: 100%;
position: absolute;
bottom: 0; */
@@ -284,4 +287,8 @@
/* visibility: hidden; */
/* display:none; */
}
.input-box input{
font-size: 18px;
height: 18px;
}
</style>

View File

@@ -1,16 +1,10 @@
<template>
<view class="content">
<view class="common-nav-container">
<view class="title-box">
<!-- <span class="title-text">出库</span> -->
<view class="warehoseInfo-box">
<view>出库单号{{ outInfo.shipmentNum }}</view>
<view class="row">
<view>备注{{ outInfo.remarks }}</view>
</view>
<view class="row">
<span class="col">已扫货物数{{ quantityTotal }}</span>
<span class="col">已扫箱数{{ newMaterialList.length }}</span>
</view>
<view>
<view v-if="searchType === 3" class="color1 aciton-box">请扫出库单</view>
<view v-if="searchType === 2" class="color2 aciton-box">请扫箱码</view>
@@ -19,6 +13,15 @@
<PdaScanInput @getInfo="handleGetInfo" :type="searchType"></PdaScanInput>
</view>
</view>
<view>出库单号{{ outInfo.shipmentNum }}</view>
<view class="row">
<view>备注{{ outInfo.remarks }}</view>
</view>
<view class="row">
<span class="col">已扫货物数{{ quantityTotal }}</span>
<span class="col">已扫箱数{{ newMaterialList.length }}</span>
</view>
</view>
</view>
<!-- 选择物料号 -->
@@ -34,8 +37,8 @@
</view>
<!-- 底部按钮 -->
<view class="button-box">
<button type="default" @click="handlerDoOut">货物出库</button>
<button type="default" @click="handlerSubmit">出库单完成</button>
<u-button style="width: 40%" type="primary" @click="handlerDoOut">货物出库</u-button>
<u-button style="width: 40%" type="success" @click="handlerSubmit">出库单完成</u-button>
</view>
</view>
</template>
@@ -89,7 +92,9 @@ export default {
searchType: 3,
show: false,
columns: [['无物料号']],
columns: [
['无物料号']
],
material_id: '无物料号' //物料号
};
},
@@ -321,66 +326,71 @@ export default {
<style scoped>
.title-box {
margin-top: 54px;
margin-bottom: 20px;
height: 60px;
/* margin-top: 54px; */
/* margin-bottom: 20px; */
font-size: 26px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.warehoseInfo-box {
width: 100%;
font-size: 20px;
width: 94%;
margin: 0 auto;
padding-left: 10px;
padding-right: 10px;
background-color: aliceblue;
border-radius: 10px;
display: flex;
flex-direction: column;
}
.warehoseInfo-box .row {
display: flex;
flex-direction: row;
}
.warehoseInfo-box .row .col {
width: 50%;
}
.aciton-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.color1 {
color: yellowgreen;
}
.color2 {
color: orange;
}
.pda-search-box {
margin-bottom: 5px;
}
.list-box {
width: 100%;
}
.scroll-view-title {
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.scroll-view-box {
width: 94%;
width: 98%;
margin: 0 auto;
margin-top: 50px;
height: 360px;
height: 200px;
padding: 10px;
background-color: rgba(179, 179, 179, 0.7);
background-color: rgba(179, 179, 179, 0.3);
border-radius: 5px;
}
.scroll-view-last {
width: 100%;
height: 60px;
@@ -395,6 +405,7 @@ export default {
border-radius: 10px;
background-color: white;
}
.button-box {
width: 80%;
margin: 10px auto;

View File

@@ -822,3 +822,7 @@ text {
.out-button-box{
padding: 10px;
}
.card-box{
height: 40px !important;
}

View File

@@ -3,20 +3,15 @@
<view class="flex-col page">
<view class="flex-col justify-start relative section">
<view class="shrink-0 section_2"></view>
<u-avatar class="shrink-0 image pos" :showLoading="true" size="64px" src="/static/images/icon/app.png"
<u-avatar class="shrink-0 image pos" :showLoading="true" size="64px" :src="avatar"
@click="avatarClick"></u-avatar>
<text class="text pos_2">{{name}}</text>
<view class="flex-row items-center section_3 pos_3">
<image class="image_2"
src="https://ide.code.fun/api/image?token=661f6554a17dbc0011549df2&name=e9f03cae38a2e6362ae08df54c42ba39.png" />
<text class="text_2">编辑资料</text>
</view>
<text class="text pos_2">{{nickName}}</text>
<view class="flex-row justify-between section_4 pos_4">
<text class="font">部门工程师</text>
<text class="font">岗位工程师</text>
<text class="font">部门{{deptName}}</text>
<!-- <text class="font">手机号{{userInfo.phonenumber}}</text> -->
</view>
</view>
<uni-card>
<uni-card class="card-box" is-shadow>
<u-grid :border="false" @click="gridClick" col="3">
<u-grid-item v-for="(baseListItem,baseListIndex) in gridList" :key="baseListIndex"
:name="baseListItem.url">
@@ -26,10 +21,9 @@
</u-grid>
</uni-card>
<u-cell-group>
<u-cell icon="setting-fill" title="个人设置"></u-cell>
<u-cell icon="integral-fill" title="会员等级" value="新版本"></u-cell>
<u-cell icon="setting-fill" title="个人设置"></u-cell>
<u-cell icon="integral-fill" title="会员等级" value="新版本"></u-cell>
<u-cell :iconStyle="{fontSize:'24px',color:'#2979ff'}" icon="server-man" title="问题反馈" isLink></u-cell>
<u-cell :iconStyle="{fontSize:'24px',color:'#909399'}" icon="setting-fill" title="个人设置" isLink></u-cell>
<u-cell :iconStyle="{fontSize:'24px',color:'#19be6b'}" icon="level" title="版本号" :value="version"></u-cell>
</u-cell-group>
<view class="out-button-box">
<u-modal :show="outLoginShow" title="退出登录" showCancelButton content='是否注销,并退出登录?'
@@ -55,33 +49,37 @@
// 使用对象展开运算符将 getter 混入 computed 对象中
...mapGetters([
'name',
'nickName',
'deptName',
'avatar',
])
},
onLoad() {
console.log(this.name, this.avatar);
},
onShow() {
this.GetInfo();
},
data() {
return {
version:'V2.1.0',
outLoginShow: false,
userInfo: {
},
gridList: [{
name: 'photo',
title: 'agv',
url: '/pages/agv/agv'
},
{
name: 'lock',
title: '帮助',
url: ''
},
{
name: 'star',
title: '客服',
url: ''
},
// {
// name: 'lock',
// title: '帮助',
// url: ''
// },
// {
// name: 'star',
// title: '客服',
// url: ''
// },
]
};
},

View File

@@ -2,6 +2,8 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
nickName: state => state.user.nickName,
deptName: state => state.user.deptName,
roles: state => state.user.roles,
permissions: state => state.user.permissions
}

View File

@@ -20,7 +20,9 @@ const user = {
name: storage.get(constant.name),
avatar: storage.get(constant.avatar),
roles: storage.get(constant.roles),
permissions: storage.get(constant.permissions)
permissions: storage.get(constant.permissions),
nickName: storage.get(constant.nickName),
deptName: storage.get(constant.deptName)
},
mutations: {
@@ -42,7 +44,15 @@ const user = {
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
storage.set(constant.permissions, permissions)
}
},
SET_NICKNAME: (state, nickName) => {
state.nickName = nickName
storage.set(constant.nickName, nickName)
},
SET_DEPTNAME: (state, deptName) => {
state.deptName = deptName
storage.set(constant.deptName, deptName)
},
},
actions: {
@@ -72,18 +82,23 @@ const user = {
}) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const user = res.data.user
const avatar = (user == null || user.avatar == "" || user.avatar == null) ?
require("@/static/images/profile.jpg") : baseUrl + user.avatar
const username = (user == null || user.userName == "" || user.userName ==
null) ? "" : user.userName
if (res.roles && res.roles.length > 0) {
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
const nickName = (user == null || user.nickName == "" || user.nickName ==
null) ? "" : user.nickName
const deptName = (user == null || user.deptName == "" || user.deptName ==
null) ? "" : user.deptName
if (user.roles && user.roles.length > 0) {
commit('SET_ROLES', user.roles)
commit('SET_PERMISSIONS', res.roleIds)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
console.log(res);
commit('SET_NICKNAME', user.nickName)
commit('SET_DEPTNAME', user.deptName)
commit('SET_NAME', username)
commit('SET_AVATAR', avatar)
resolve(res)

View File

@@ -2,7 +2,9 @@ const constant = {
avatar: 'vuex_avatar',
name: 'vuex_name',
roles: 'vuex_roles',
permissions: 'vuex_permissions'
permissions: 'vuex_permissions',
nickName:'vuex_nickName',
deptName:'vuex_deptName'
}
export default constant