菜单部分对接

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 loginName = username;
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({
access_token,
userName,
@ -244,6 +253,7 @@ export default class LoginPage extends BasePage {
loginName,
poolNameList,
createBy,
menuList,
});
uni.showToast({
//icon: 'success',

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

@ -15,28 +15,26 @@
</view>
<!-- <view class="date">{{ today }}</view> -->
</view>
<view v-for="item in newmenuList" :key="item.path">
<view class="container">
<!-- <view style="background: #ffffff; display: flex; flex-direction: row">
<span>工厂</span>
<jPicker sureColor="#ff0000" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="factoryList.value" :options="areas" />
</view> -->
<!-- <u-row style="background: #ffff; display: flex; flex-direction: row" :gutter="30">
<u-col :span="16" style="padding: 0px">
<span>工厂</span>
<jPicker sureColor="#ff0000" @bindpicker="selectProductCode" showKey="label" valKey="value" :val="factoryList.value" :options="areas" />
</u-col>
</u-row> -->
<u-row :gutter="30">
<u-col :span="16" style="padding: 0px">
<u-button @click.native="tomes">
<u-button
@click.native="
uni.navigateTo({
url: item.path,
})
"
>
<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">mes </text>
<text class="name">{{ item.menuName }}</text>
</u-button>
</u-col>
</u-row>
</view>
<view class="container">
</view>
<!-- <view class="container">
<u-row :gutter="30">
<u-col :span="16" style="padding: 0px">
<u-button
@ -47,12 +45,11 @@
"
>
<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>
</u-button>
</u-col>
</u-row>
</view>
</view> -->
</view>
</template>
@ -72,13 +69,20 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
},
})
export default class RawHome extends BasePage {
//
get areas(): Array<Factory> {
return area.areas;
}
model = model;
menuList = session.getMenus;
newmenuList: any = [];
moren = '选择工厂';
factoryList: any = {};
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() {
//console.log('sssss', area.areas);
// this.model.getMenuList();

@ -7,7 +7,134 @@
<view class="title">wms菜单</view>
<view class="right"></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="shuxian"></view>
<view class="title"> 原材料入库 </view>
@ -102,8 +229,8 @@
name="../../static/icons/icon-54.png"
></u-icon>
</view>
</view>
<view class="container">
</view> -->
<!-- <view class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 原材料出库 </view>
@ -198,8 +325,8 @@
name="../../static/icons/icon-55.png"
></u-icon>
</view>
</view>
<view class="container">
</view> -->
<!-- <view class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 原材料库内 </view>
@ -239,8 +366,8 @@
name="../../static/icons/icon-56.png"
></u-icon>
</view>
</view>
<view class="container">
</view> -->
<!-- <view class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品入库 </view>
@ -291,8 +418,8 @@
name="../../static/icons/icon-54.png"
></u-icon>
</view>
</view>
<view class="container">
</view> -->
<!-- <view class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品出库 </view>
@ -332,8 +459,8 @@
name="../../static/icons/icon-55.png"
></u-icon>
</view>
</view>
<view class="container">
</view> -->
<!-- <view class="container">
<view class="toptitle">
<view class="shuxian"></view>
<view class="title"> 成品库内 </view>
@ -373,16 +500,35 @@
name="../../static/icons/icon-56.png"
></u-icon>
</view>
</view>
</view> -->
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { session } from '@/store/modules/session';
@Component
export default class RawAppointment extends BasePage {
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 }) {
// //this.childData = JSON.parse(option.childData);
// }

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

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

Loading…
Cancel
Save