Explorar el Código

feat: 根据权限显示首页

liujt hace 4 semanas
padre
commit
2e214eadc2
Se han modificado 2 ficheros con 115 adiciones y 120 borrados
  1. 106 111
      pages/home/home.vue
  2. 9 9
      pages/home/homeNew.vue

+ 106 - 111
pages/home/home.vue

@@ -16,147 +16,140 @@
 			<!-- 备品备件 -->
 			<sparePart v-if="roleId == 150" ref="sparePartRef"></sparePart>
 
-			<view class="data-middle">
-				<view class="cell">
-					<view class="num">
-						{{homeData.totalFinishedProducts}}
-					</view>
-					<view class="label">
-						成品库存总量
-					</view>
-				</view>
+			<view v-if="$isAuthorities('pda:home:manage')">
+				<homeNew></homeNew>
+			</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.totalRawMaterials}}
-					</view>
-					<view class="label">
-						物料库存总量
+			<view v-else>
+				<view class="data-middle">
+					<view class="cell">
+						<view class="num">
+							{{homeData.totalFinishedProducts}}
+						</view>
+						<view class="label">
+							成品库存总量
+						</view>
 					</view>
-				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.goodsCount}}
-					</view>
-					<view class="label">
-						商品列表
+					<view class="cell">
+						<view class="num">
+							{{homeData.totalRawMaterials}}
+						</view>
+						<view class="label">
+							物料库存总量
+						</view>
 					</view>
-				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.yearAmount}}
-					</view>
-					<view class="label">
-						年度合同金额(万元)
+					<view class="cell">
+						<view class="num">
+							{{homeData.goodsCount}}
+						</view>
+						<view class="label">
+							商品列表
+						</view>
 					</view>
-				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.receivableAmount}}
-					</view>
-					<view class="label">
-						应收金额(万元)
+					<view class="cell">
+						<view class="num">
+							{{homeData.yearAmount}}
+						</view>
+						<view class="label">
+							年度合同金额(万元)
+						</view>
 					</view>
-				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.payableAmount}}
-					</view>
-					<view class="label">
-						应付金额(万元)
+					<view class="cell">
+						<view class="num">
+							{{homeData.receivableAmount}}
+						</view>
+						<view class="label">
+							应收金额(万元)
+						</view>
 					</view>
-				</view>
-			</view>
 
-			<view class="data-rank">
-				<view class="tab-top">
-					<view class="tab-item" v-for="(item,index) in tabList" :key="index">
-						<view :class="{active: activeIndex == item.index}" @click="handleTabChange(item)">
-							{{item.name}}
+					<view class="cell">
+						<view class="num">
+							{{homeData.payableAmount}}
+						</view>
+						<view class="label">
+							应付金额(万元)
 						</view>
 					</view>
 				</view>
 
-
-				<!-- <uni-table class="table" ref="table" emptyText="暂无更多数据">
-					<uni-tr class="table-title">
-						<uni-th align="center" width="100">产品编码</uni-th>
-						<uni-th align="center">名称</uni-th>
-						<uni-th align="center" width="100">销量</uni-th>
-					</uni-tr>
-					<uni-tr v-for="(item, index) in tableData" :key="index">
-						<uni-td>{{index+1}}.{{item.productCode}}</uni-td>
-						<uni-td>{{item.productName}}</uni-td>
-						<uni-td align="center">{{item.totalSaleCount}}</uni-td>
-					</uni-tr>
-				</uni-table> -->
-
-				<view class="table-title" style="text-align: center;">
-					<view class="code">产品编码</view>
-					<view class="name">名称</view>
-					<view class="total">销量</view>
-				</view>
-				<view class="table-content" v-for="(item,index) in tableData">
-					<view class="code">
-						<view class="index">{{index+1}}.</view>
-						<view class="value">{{item.productCode}}</view>
-
+				<view class="data-rank">
+					<view class="tab-top">
+						<view class="tab-item" v-for="(item,index) in tabList" :key="index">
+							<view :class="{active: activeIndex == item.index}" @click="handleTabChange(item)">
+								{{item.name}}
+							</view>
+						</view>
 					</view>
-					<view class="name">{{item.productName}}</view>
-					<view class="total">{{item.totalSaleCount}}</view>
-				</view>
-
-
 
-			</view>
 
+					<!-- <uni-table class="table" ref="table" emptyText="暂无更多数据">
+						<uni-tr class="table-title">
+							<uni-th align="center" width="100">产品编码</uni-th>
+							<uni-th align="center">名称</uni-th>
+							<uni-th align="center" width="100">销量</uni-th>
+						</uni-tr>
+						<uni-tr v-for="(item, index) in tableData" :key="index">
+							<uni-td>{{index+1}}.{{item.productCode}}</uni-td>
+							<uni-td>{{item.productName}}</uni-td>
+							<uni-td align="center">{{item.totalSaleCount}}</uni-td>
+						</uni-tr>
+					</uni-table> -->
+
+					<view class="table-title" style="text-align: center;">
+						<view class="code">产品编码</view>
+						<view class="name">名称</view>
+						<view class="total">销量</view>
+					</view>
+					<view class="table-content" v-for="(item,index) in tableData">
+						<view class="code">
+							<view class="index">{{index+1}}.</view>
+							<view class="value">{{item.productCode}}</view>
 
+						</view>
+						<view class="name">{{item.productName}}</view>
+						<view class="total">{{item.totalSaleCount}}</view>
+					</view>
 
 
 
-			<view class="data-bottom">
-				<view class="cell">
-					<view class="num">
-						{{this.homeData.yearProduceAmount}}
-					</view>
-					<view class="label">
-						年度生产总量
-					</view>
 				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{this.homeData.monthProduceAmount}}
-					</view>
-					<view class="label">
-						月生产总量
+				<view class="data-bottom">
+					<view class="cell">
+						<view class="num">
+							{{this.homeData.yearProduceAmount}}
+						</view>
+						<view class="label">
+							年度生产总量
+						</view>
 					</view>
-				</view>
 
-				<view class="cell">
-					<view class="num">
-						{{homeData.pendingAmount}}
+					<view class="cell">
+						<view class="num">
+							{{this.homeData.monthProduceAmount}}
+						</view>
+						<view class="label">
+							月生产总量
+						</view>
 					</view>
-					<view class="label">
-						待生产总量
+
+					<view class="cell">
+						<view class="num">
+							{{homeData.pendingAmount}}
+						</view>
+						<view class="label">
+							待生产总量
+						</view>
 					</view>
-				</view>
 
+				</view>
 			</view>
-
-
-
 		</view>
-
-
-
-
-
-		<!-- <ScanCode ref="ScanCode" :model="'uni'"></ScanCode> -->
 	</view>
 </template>
 
@@ -167,6 +160,7 @@
 	import mould from './pages/mould/mould.vue'
 	import sparePart from './pages/sparePart/sparePart.vue'
 	import ScanCode from '@/components/ScanCode.vue'
+	import homeNew from './homeNew.vue'
 
 	import {
 		getDateNew
@@ -197,7 +191,8 @@
 			Mocha,
 			mould,
 			sparePart,
-			ScanCode
+			ScanCode,
+			homeNew
 		},
 		onShow() {
 

+ 9 - 9
pages/home/homeNew.vue

@@ -1,19 +1,19 @@
 <template>
 	<view class="ss">
 		<!-- 头 -->
-		<uni-nav-bar fixed="true" statusBar="true" right-icon="scan" title="首页" @clickLeft="back"
-			@clickRight="HandlScanCode"></uni-nav-bar>
+		<!-- <uni-nav-bar fixed="true" statusBar="true" right-icon="scan" title="首页" @clickLeft="back"
+			@clickRight="HandlScanCode"></uni-nav-bar> -->
 
-		<view class="container">
-			<navigation :workOrder="workOrder" ref="navigationRef"></navigation>
+		<!-- <view class="container"> -->
+			<!-- <navigation :workOrder="workOrder" ref="navigationRef"></navigation> -->
 			<!-- 设备主管 -->
-			<equipment v-if="roleId == 102" ref="equipmentRef"></equipment>
+			<!-- <equipment v-if="roleId == 102" ref="equipmentRef"></equipment> -->
 			<!-- 运维 -->
-			<Mocha v-if="roleId == 157" ref="mochaRef"></Mocha>
+			<!-- <Mocha v-if="roleId == 157" ref="mochaRef"></Mocha> -->
 			<!-- 模具舟皿 -->
-			<mould v-if="roleId == 155" ref="mouldRef"></mould>
+			<!-- <mould v-if="roleId == 155" ref="mouldRef"></mould> -->
 			<!-- 备品备件 -->
-			<sparePart v-if="roleId == 150" ref="sparePartRef"></sparePart>
+			<!-- <sparePart v-if="roleId == 150" ref="sparePartRef"></sparePart> -->
 
 			<view class="data-middle">
 				<view class="cell">
@@ -89,7 +89,7 @@
 			</view>
 
 			<manage ref="manageRef"></manage>
-		</view>
+		<!-- </view> -->
 	</view>
 </template>