右边标题仓库,分库修改

fencang
anthonywj 3 years ago
parent a9ab66c0aa
commit fc5dac5fc1

@ -17,7 +17,7 @@ import {
} from "../../utils/auth";
// import { $NOT_NETWORK } from '../../utils/errorCode'
import {Message} from "element-ui";
import {RECEIVE_LOCINVCODE, RECEIVE_LOCSUBINVCODE} from "../mutation-types";
import {RECEIVE_LOCINVCODE, RECEIVE_LOCINVNAME, RECEIVE_LOCSUBINVCODE, RECEIVE_LOCSUBINVNAME} from "../mutation-types";
// initial state
const state = {
@ -31,7 +31,9 @@ const state = {
customerId: getCustomerId(),
companyName: getCompanyName(),
locInvCode: "",
locSubInvCode:""
locSubInvCode: "",
locInvName: "",
locSubInvName: ""
};
// getters
@ -47,6 +49,8 @@ const getters = {
companyName: state => state.companyName,
locInvCode: state => state.locInvCode,
locSubInvCode: state => state.locSubInvCode,
locInvName: state => state.locInvName,
locSubInvName: state => state.locSubInvName,
};
// actions
@ -201,6 +205,12 @@ const mutations = {
[types.RECEIVE_LOCSUBINVCODE](state, locSubInvCode) {
state.locSubInvCode = locSubInvCode;
},
[types.RECEIVE_LOCINVNAME](state, locInvName) {
state.locInvName = locInvName;
},
[types.RECEIVE_LOCSUBINVNAME](state, locSubInvName) {
state.locSubInvName = locSubInvName;
},
};
export default {

@ -19,3 +19,6 @@ export const RECEIVE_COMPANYNAME = "RECEIVE_COMPANYNAME"; // 企业名称
export const RECEIVE_LOCINVCODE = "RECEIVE_LOCINVCODE"; // 当前仓库
export const RECEIVE_LOCSUBINVCODE = "RECEIVE_LOCSUBINVCODE"; // 当前分库
export const RECEIVE_LOCINVNAME = "RECEIVE_LOCINVNAME"; // 当前仓库
export const RECEIVE_LOCSUBINVNAME = "RECEIVE_LOCSUBINVNAME"; // 当前分库

@ -71,7 +71,7 @@
<span style="margin-right: 10px; margin-top: 2px">{{ company.Name }}</span>
<el-dropdown trigger="click">
<!--<i class="el-icon-setting" style="margin-right: 15px"></i>-->
<span>{{ username }}<i class="el-icon-arrow-down el-icon--right"></i></span>
<span>{{ title }}<i class="el-icon-arrow-down el-icon--right"></i></span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item><span @click="changeInv"></span></el-dropdown-item>
<el-dropdown-item><span @click="handlePassword"></span></el-dropdown-item>
@ -328,6 +328,7 @@ export default {
selInvVisible: false,
locInvName: "",
locSubInvName: "",
title: "",
};
},
components: {
@ -342,9 +343,7 @@ export default {
return this.$route.path;
},
username() {
let username = this.$store.state.admin.userName;
let rUserName = !username ? this.name : username;
return this.$store.state.admin.employeeName + "" + this.locInvName + " " + this.locSubInvName + "";
return this.$store.state.admin.employeeName + "" + this.$store.getters.locInvName + " " + this.$store.getters.locSubInvName + "";
},
isCollapse() {
return false;
@ -457,7 +456,9 @@ export default {
}
);
this.$store.commit(types.RECEIVE_LOCINVNAME, this.locInvName);
this.$store.commit(types.RECEIVE_LOCSUBINVNAME, this.locSubInvName);
this.title = this.$store.state.admin.employeeName + "(" + this.locInvName + " " + this.locSubInvName + ")";
this.getStorage();
}
}

Loading…
Cancel
Save