菜单部分对接

master
guoshuang 2 years ago
parent 1a4b1af699
commit 0f684172a8

@ -237,6 +237,15 @@ export default class LoginPage extends BasePage {
const userName = loginResultuser.user.userName; const userName = loginResultuser.user.userName;
const loginName = username; const loginName = username;
const createBy = loginResultuser.user.createBy; const createBy = loginResultuser.user.createBy;
const menuListold = loginResultuser.menuList;
let menuList = [];
for (let i = 1; i < menuListold.length; i++) {
menuList.push({
menuName: menuListold[i].menuName,
path: menuListold[i].path,
perms: menuListold[i].perms,
});
}
session.setUser({ session.setUser({
access_token, access_token,
userName, userName,
@ -244,6 +253,7 @@ export default class LoginPage extends BasePage {
loginName, loginName,
poolNameList, poolNameList,
createBy, createBy,
menuList,
}); });
uni.showToast({ uni.showToast({
//icon: 'success', //icon: 'success',

@ -12,19 +12,23 @@
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 生产 </view> <view class="title"> 生产 </view>
</view> </view>
<!-- <view v-for="item in newmenuList" :key="item.path"> -->
<view class="tubiao"> <view class="tubiao">
<u-icon <u-icon
v-for="item in newmenuList"
:key="item.path"
@click=" @click="
uni.navigateTo({ uni.navigateTo({
url: page.mes.ProductionQtyInsplist, url: item.path,
}) })
" "
label="生产质检" :label="item.menuName"
label-pos="bottom" label-pos="bottom"
size="80" size="80"
name="../../static/icons/icon-01.png" name="../../static/icons/icon-01.png"
></u-icon> ></u-icon>
</view> </view>
<!-- </view> -->
</view> </view>
</view> </view>
</template> </template>
@ -32,12 +36,16 @@
<script lang="ts"> <script lang="ts">
import { Component } from 'vue-property-decorator'; import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page'; import { BasePage } from '@/components/base/page';
import { session } from '@/store/modules/session';
@Component @Component
export default class RawAppointment extends BasePage { export default class RawAppointment extends BasePage {
childData: any; childData: any;
// onLoad(option: { childData: any }) { menuList = session.getMenus;
// //this.childData = JSON.parse(option.childData); newmenuList: any = [];
// } onReady() {
this.newmenuList = this.menuList.filter((item) => item.perms == 'mesCh');
console.log('1234', this.menuList);
}
} }
</script> </script>
@ -106,4 +114,11 @@ export default class RawAppointment extends BasePage {
} }
} }
} }
::v-deep .u-icon {
padding: 17rpx;
}
::v-deep .u-icon__label {
width: 124rpx;
text-align: center;
}
</style> </style>

@ -15,28 +15,26 @@
</view> </view>
<!-- <view class="date">{{ today }}</view> --> <!-- <view class="date">{{ today }}</view> -->
</view> </view>
<view class="container"> <view v-for="item in newmenuList" :key="item.path">
<!-- <view style="background: #ffffff; display: flex; flex-direction: row"> <view class="container">
<span>工厂</span> <u-row :gutter="30">
<jPicker sureColor="#ff0000" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="factoryList.value" :options="areas" /> <u-col :span="16" style="padding: 0px">
</view> --> <u-button
<!-- <u-row style="background: #ffff; display: flex; flex-direction: row" :gutter="30"> @click.native="
<u-col :span="16" style="padding: 0px"> uni.navigateTo({
<span>工厂</span> url: item.path,
<jPicker sureColor="#ff0000" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="factoryList.value" :options="areas" /> })
</u-col> "
</u-row> --> >
<u-row :gutter="30"> <u-icon size="80" name="/static/icons/icon-02.png"></u-icon>
<u-col :span="16" style="padding: 0px"> <!-- <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text> -->
<u-button @click.native="tomes"> <text class="name">{{ item.menuName }}</text>
<u-icon size="80" name="/static/icons/icon-02.png"></u-icon> </u-button>
<!-- <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text> --> </u-col>
<text class="name">mes </text> </u-row>
</u-button> </view>
</u-col>
</u-row>
</view> </view>
<view class="container"> <!-- <view class="container">
<u-row :gutter="30"> <u-row :gutter="30">
<u-col :span="16" style="padding: 0px"> <u-col :span="16" style="padding: 0px">
<u-button <u-button
@ -47,12 +45,11 @@
" "
> >
<u-icon size="80" name="/static/icons/icon-02.png"></u-icon> <u-icon size="80" name="/static/icons/icon-02.png"></u-icon>
<!-- <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text> -->
<text class="name">wms</text> <text class="name">wms</text>
</u-button> </u-button>
</u-col> </u-col>
</u-row> </u-row>
</view> </view> -->
</view> </view>
</template> </template>
@ -72,13 +69,20 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
}, },
}) })
export default class RawHome extends BasePage { export default class RawHome extends BasePage {
//
get areas(): Array<Factory> { get areas(): Array<Factory> {
return area.areas; return area.areas;
} }
model = model; model = model;
menuList = session.getMenus;
newmenuList: any = [];
moren = '选择工厂'; moren = '选择工厂';
factoryList: any = {}; factoryList: any = {};
today = dayjs().format('YYYY-MM-DD dddd'); today = dayjs().format('YYYY-MM-DD dddd');
onReady() {
this.newmenuList = this.menuList.filter((item) => item.perms == 'wms' || item.perms == 'mes');
console.log('1234', this.menuList);
}
onLoad() { onLoad() {
//console.log('sssss', area.areas); //console.log('sssss', area.areas);
// this.model.getMenuList(); // this.model.getMenuList();

@ -7,7 +7,134 @@
<view class="title">wms菜单</view> <view class="title">wms菜单</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="container"> <view v-if="wmsRImenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 原材料入库 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsRImenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
name="../../static/icons/icon-54.png"
></u-icon>
</view>
</view>
<view v-if="wmsROmenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 原材料出库 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsROmenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
name="../../static/icons/icon-55.png"
></u-icon>
</view>
</view>
<view v-if="wmsRNmenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 原材料库内 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsRNmenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
:name="item.menuName == '盘点' ? '../../static/icons/icon-53.png' : '../../static/icons/icon-56.png'"
></u-icon>
</view>
</view>
<view v-if="wmsPImenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品入库 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsPImenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
name="../../static/icons/icon-54.png"
></u-icon>
</view>
</view>
<view v-if="wmsPOmenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品出库 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsPOmenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
name="../../static/icons/icon-55.png"
></u-icon>
</view>
</view>
<view v-if="wmsPNmenuList.length" class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品库内 </view>
</view>
<view class="tubiao">
<u-icon
v-for="item in wmsPNmenuList"
:key="item.path"
@click="
uni.navigateTo({
url: item.path,
})
"
:label="item.menuName"
label-pos="bottom"
size="80"
:name="item.menuName == '盘点' ? '../../static/icons/icon-53.png' : '../../static/icons/icon-56.png'"
></u-icon>
</view>
</view>
<!-- 以下为写死的菜单 -->
<!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 原材料入库 </view> <view class="title"> 原材料入库 </view>
@ -102,8 +229,8 @@
name="../../static/icons/icon-54.png" name="../../static/icons/icon-54.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
<view class="container"> <!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 原材料出库 </view> <view class="title"> 原材料出库 </view>
@ -198,8 +325,8 @@
name="../../static/icons/icon-55.png" name="../../static/icons/icon-55.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
<view class="container"> <!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 原材料库内 </view> <view class="title"> 原材料库内 </view>
@ -239,8 +366,8 @@
name="../../static/icons/icon-56.png" name="../../static/icons/icon-56.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
<view class="container"> <!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 成品入库 </view> <view class="title"> 成品入库 </view>
@ -291,8 +418,8 @@
name="../../static/icons/icon-54.png" name="../../static/icons/icon-54.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
<view class="container"> <!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 成品出库 </view> <view class="title"> 成品出库 </view>
@ -332,8 +459,8 @@
name="../../static/icons/icon-55.png" name="../../static/icons/icon-55.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
<view class="container"> <!-- <view class="container">
<view class="toptitle"> <view class="toptitle">
<view class="shuxian"></view> <view class="shuxian"></view>
<view class="title"> 成品库内 </view> <view class="title"> 成品库内 </view>
@ -373,16 +500,35 @@
name="../../static/icons/icon-56.png" name="../../static/icons/icon-56.png"
></u-icon> ></u-icon>
</view> </view>
</view> </view> -->
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from 'vue-property-decorator'; import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page'; import { BasePage } from '@/components/base/page';
import { session } from '@/store/modules/session';
@Component @Component
export default class RawAppointment extends BasePage { export default class RawAppointment extends BasePage {
childData: any; childData: any;
menuList = session.getMenus;
wmsRImenuList: any = [];
wmsROmenuList: any = [];
wmsRNmenuList: any = [];
wmsPImenuList: any = [];
wmsPOmenuList: any = [];
wmsPNmenuList: any = [];
onReady() {
this.wmsRImenuList = this.menuList.filter((item) => item.perms == 'wmsRI');
this.wmsROmenuList = this.menuList.filter((item) => item.perms == 'wmsRO');
this.wmsRNmenuList = this.menuList.filter((item) => item.perms == 'wmsRN');
this.wmsPImenuList = this.menuList.filter((item) => item.perms == 'wmsPI');
this.wmsPOmenuList = this.menuList.filter((item) => item.perms == 'wmsPO');
this.wmsPNmenuList = this.menuList.filter((item) => item.perms == 'wmsPN');
console.log('1234', this.menuList);
}
// onLoad(option: { childData: any }) { // onLoad(option: { childData: any }) {
// //this.childData = JSON.parse(option.childData); // //this.childData = JSON.parse(option.childData);
// } // }

@ -14,12 +14,18 @@ export interface User {
userName?: string; userName?: string;
password?: string; password?: string;
poolNameList?: Array<Area>; poolNameList?: Array<Area>;
createBy: string; createBy?: string;
menuList?: Array<Menu>;
} }
export interface FactoryCode { export interface FactoryCode {
factoryCode?: string; factoryCode?: string;
poolName?: string; poolName?: string;
} }
export interface Menu {
menuName?: string;
path?: string;
perms?: string;
}
@Module({ @Module({
dynamic: true, dynamic: true,
@ -160,6 +166,14 @@ class SessionService extends VuexModule {
return this.factory; return this.factory;
} }
} }
//获取菜单
get getMenus(): any {
if (this.user === null) {
throw new Error('当前无登录用户');
} else {
return this.user.menuList;
}
}
// 登录 // 登录
@Action({ rawError: true }) @Action({ rawError: true })

@ -2,8 +2,8 @@ module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://192.168.3.93:81', target: 'http://192.168.3.93:81',
target: 'http://192.168.3.81:80', //target: 'http://192.168.3.81:80',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '', '^/api': '',

Loading…
Cancel
Save