Commit f50dd120 authored by 周远喜's avatar 周远喜

修改获取用户信息

parent c6d1e674
...@@ -68,8 +68,9 @@ export default { ...@@ -68,8 +68,9 @@ export default {
methods: { methods: {
//获取用户基本信息 //获取用户基本信息
initUserInfo() { initUserInfo() {
let userInfo=this.$store.state.admin.user.info;
let parma = { let parma = {
Id: JSON.parse(sessionStorage.getItem("userInfo")).userId Id: userInfo.userId
}; };
this.$http.sysUser.getuserinfo(parma).then(res => { this.$http.sysUser.getuserinfo(parma).then(res => {
if (res.result) { if (res.result) {
......
...@@ -121,6 +121,7 @@ export default { ...@@ -121,6 +121,7 @@ export default {
Search Search
}, },
data() { data() {
let userInfo=this.$store.state.admin.user.info;
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
...@@ -128,7 +129,7 @@ export default { ...@@ -128,7 +129,7 @@ export default {
status: { op: 'Equal', value: null }, status: { op: 'Equal', value: null },
creatorUserId: { creatorUserId: {
op: 'Equal', op: 'Equal',
value: JSON.parse(sessionStorage.getItem('userInfo')).userId value: userInfo.userId
} }
}, },
selectList: [], selectList: [],
......
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
for (let i = 0; i < roles.length; i++) { for (let i = 0; i < roles.length; i++) {
roleids.push(roles[i].id) roleids.push(roles[i].id)
} }
let userInfo = JSON.parse(sessionStorage.getItem('userInfo')) let userInfo = this.$store.admin.user.info;
// var url = // var url =
// `${systemUrl}/myuserrole/GetUsersByRoleAndorgan?ids=` + // `${systemUrl}/myuserrole/GetUsersByRoleAndorgan?ids=` +
// roleids.join(',') + // roleids.join(',') +
...@@ -227,9 +227,9 @@ export default { ...@@ -227,9 +227,9 @@ export default {
}, },
getCurrentUser(e) { getCurrentUser(e) {
if (e) { if (e) {
let userInfo = JSON.parse(sessionStorage.getItem('userInfo')) let userInfo = this.$store.admin.user.info;
this.user.cardno = userInfo.login_id this.user.cardno = userInfo.login_id
this.user.user_name = localStorage.getItem('userName') this.user.user_name =userInfo.userName
this.user.user_id = userInfo.userId this.user.user_id = userInfo.userId
} else { } else {
this.user.cardno = '' this.user.cardno = ''
......
...@@ -238,7 +238,7 @@ export default { ...@@ -238,7 +238,7 @@ export default {
}, },
getCurrentUser(e) { getCurrentUser(e) {
if (e) { if (e) {
let userInfo = JSON.parse(sessionStorage.getItem('userInfo')) let userInfo = this.$store.admin.user.info;
this.user.cardno = userInfo.login_id this.user.cardno = userInfo.login_id
this.user.user_name = localStorage.getItem('userName') this.user.user_name = localStorage.getItem('userName')
this.user.user_id = userInfo.userId this.user.user_id = userInfo.userId
......
...@@ -119,11 +119,10 @@ export default { ...@@ -119,11 +119,10 @@ export default {
StoreHouse StoreHouse
}, },
data() { data() {
let userInfo=this.$store.admin.user.info;
return { return {
entity: { entity: {
creator: parseInt( creator: userInfo.userId,
JSON.parse(sessionStorage.getItem('userInfo')).userId
),
thickness: null, thickness: null,
inventory: null inventory: null
}, },
......
...@@ -127,11 +127,12 @@ export default { ...@@ -127,11 +127,12 @@ export default {
StoreHouse StoreHouse
}, },
data() { data() {
let userInfo=this.$store.state.admin.user.info;
return { return {
entity: { entity: {
totalInventory: null, totalInventory: null,
unitPrice: null, unitPrice: null,
creator: parseInt(JSON.parse(sessionStorage.getItem('userInfo')).userId) creator: userInfo.userId
}, },
rules: { rules: {
storeTitle: [ storeTitle: [
......
...@@ -103,11 +103,10 @@ export default { ...@@ -103,11 +103,10 @@ export default {
StoreHouse StoreHouse
}, },
data() { data() {
let userInfo=this.$store.state.admin.user.info;
return { return {
entity: { entity: {
creator: parseInt( creator:userInfo.userId,
JSON.parse(sessionStorage.getItem('userInfo')).userId
),
inCount: null, inCount: null,
quantityCount: null, quantityCount: null,
price: null price: null
......
...@@ -39,6 +39,7 @@ import Api from './api' ...@@ -39,6 +39,7 @@ import Api from './api'
export default { export default {
name: 'Add', name: 'Add',
data() { data() {
let userInfo=this.$store.state.admin.user.info;
return { return {
columns: [ columns: [
{ {
...@@ -101,8 +102,8 @@ export default { ...@@ -101,8 +102,8 @@ export default {
} }
], ],
resource: { resource: {
libraryTube: localStorage.getItem('userName'), //库管员 libraryTube: userInfo.userName, //库管员
libraryTubeId: JSON.parse(sessionStorage.getItem('userInfo')).userId, //库管员ID libraryTubeId: userInfo.userId, //库管员ID
customer: '', //领料人 customer: '', //领料人
customerId: null, //领料人ID customerId: null, //领料人ID
category: 0, //类别 category: 0, //类别
......
...@@ -71,13 +71,14 @@ export default { ...@@ -71,13 +71,14 @@ export default {
Search Search
}, },
data() { data() {
let userInfo=this.$store.state.admin.user.info;
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: 'name', value: null, default: true } keys: { op: 'name', value: null, default: true }
// creatorUserId: { // creatorUserId: {
// op: 'Equal', // op: 'Equal',
// value: JSON.parse(sessionStorage.getItem('userInfo')).userId // value: userInfo.userId
// } // }
}, },
addModal: false, addModal: false,
......
...@@ -4,6 +4,10 @@ export const state=()=>({ ...@@ -4,6 +4,10 @@ export const state=()=>({
counter:0, counter:0,
dictionary: new Map(),//所有字典项 dictionary: new Map(),//所有字典项
userMap:[],//所有用户缓存; userMap:[],//所有用户缓存;
userInfo:{
userId:0,
userName:""
}
}) })
export const getters={ export const getters={
dictionaryByKey: (state) => (key) => { dictionaryByKey: (state) => (key) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment