From e38f5f42bb4fb6b55da9ccdaf0f96bbb7591e0af Mon Sep 17 00:00:00 2001
From: zhangxiaoxu <819527061@qq.com>
Date: 星期三, 17 十二月 2025 14:17:40 +0800
Subject: [PATCH] 火石咀加权限

---
 pages/home/home.vue |   67 +++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 20 deletions(-)

diff --git a/pages/home/home.vue b/pages/home/home.vue
index 6d06960..b89a968 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -11,7 +11,7 @@
 		</view>
 
 
-    <view class="huoshiju-box" v-if="compId == '1000278'">
+    <view class="huoshiju-box" v-if="roles && roles.includes(2000144)">
       <!-- 浜у搧褰撳墠浠锋牸 -->
       <view class="price-group" v-if="coalData && coalData.length > 0">
         <combined-title title="浜у搧褰撳墠浠锋牸"></combined-title>
@@ -25,8 +25,8 @@
               </uni-tr>
               <uni-tr v-for="(item,index) in coalData" :key="index">
                 <uni-td align="left">{{item.coalName}}</uni-td>
-                <uni-td align="center">{{item.price1}}</uni-td>
-                <uni-td align="center">{{item.price2}}</uni-td>
+                <uni-td align="center">{{item.price1 || ''}}</uni-td>
+                <uni-td align="center">{{item.price2 || ''}}</uni-td>
               </uni-tr>
             </uni-table>
 <!--            <view class="price-line">
@@ -78,7 +78,7 @@
                 <view class="text1">{{item.ledgerName || ''}}</view>
               </view>
             </view>
-            <view class="shouqiIcon" @click="handleShouKuanIsMore">
+            <view v-if="shoukuanJiluTemp && shoukuanJiluTemp.length > 2" class="shouqiIcon" @click="handleShouKuanIsMore">
               <image v-if="!shoukuanIsMore" src="@/static/home/xialaIcon.png"></image>
               <image v-else src="@/static/home/shouqiIcon.png"></image>
             </view>
@@ -150,7 +150,7 @@
                 </view>
               </view>
             </view>
-            <view class="shouqiIcon" @click="handleCoalIsMore">
+            <view class="shouqiIcon"  v-if="coalTongjiTemp && coalTongjiTemp.length > 2" @click="handleCoalIsMore">
               <image v-if="!coalShowIsMore" src="@/static/home/xialaIcon.png"></image>
               <image v-else src="@/static/home/shouqiIcon.png"></image>
             </view>
@@ -169,23 +169,35 @@
           <div class="shoukuan-box-inside">
             <view class="shoukuan-main" v-for="(item,index) in kehuTongji" :key="index">
               <view class="shoukuan-line">
-                <view class="name">瀹㈡埛锛�</view>
+<!--                <view class="name">瀹㈡埛锛�</view>-->
                 <view class="text1">{{item.customerName}}</view>
+<!--                <view class="meizhong">
+                  <view class="coal">{{item.coalName}}</view>
+                </view>-->
+              </view>
+              <view class="shoukuan-line coal-line">
+                <view class="coal" v-if="item.coalName">{{item.coalName}}</view>
+                <view class="coal" v-if="item.type">{{item.type || ''}}</view>
+                <view class="coal" v-if="item.carSize">{{item.carSize || ''}}杞�</view>
               </view>
               <view class="shoukuan-line">
                 <view class="name">璐﹀锛�</view>
                 <view class="text1">{{item.ledgerName}}</view>
               </view>
-              <view class="coalTongji-box">
+<!--              <view class="coalTongji-box">
                 <view class="shoukuan-line kehu-block">
                   <view class="name">杞︽暟锛�</view>
-                  <view class="text1 num">{{item.carSize}}</view>
+                  <view class="text1 num">{{item.carSize || ''}}</view>
                 </view>
                 <view class="shoukuan-line kehu-block">
+                  <view class="name">鏂瑰紡锛�</view>
+                  <view class="text1 num">{{item.type || ''}}</view>
+                </view>
+&lt;!&ndash;                <view class="shoukuan-line kehu-block">
                   <view class="name">鐓ょ锛�</view>
                   <view class="text1">{{item.coalName}}</view>
-                </view>
-              </view>
+                </view>&ndash;&gt;
+              </view>-->
               <view class="coalTongji-box marginTop">
                 <view class="caol-block">
                   <view class="name">鍙戣繍閲�(鍚�)</view>
@@ -201,7 +213,7 @@
                 </view>
               </view>
             </view>
-            <view class="shouqiIcon" @click="handlekehuTongjiShowIsMore">
+            <view class="shouqiIcon" v-if="kehuTongjiTemp && kehuTongjiTemp.length > 2" @click="handlekehuTongjiShowIsMore">
               <image v-if="!kehuTongjiShowIsMore" src="@/static/home/xialaIcon.png"></image>
               <image v-else src="@/static/home/shouqiIcon.png"></image>
             </view>
@@ -677,7 +689,7 @@
       kehuTongji:[], //鐓ょ缁熻
       kehuTongjiTemp:[], //鐓ょ缁熻
       kehuTongjiShowIsMore: false,
-      compId:'',
+      roles:[],
       d2Sum:0,  //鎬昏閲戦
       d1Sum:0,  //鎬昏
       lyDSumSum:0,  //璺繍
@@ -715,11 +727,11 @@
   watch: {
     shoukuanIsMore: {
       handler(newVal,oldVal) {
-        console.log(newVal,'newVal-------褰撳ぉ鏀舵璁板綍')
         let temp = newVal.toString() || ''
         if(this.shoukuanJiluTemp && this.shoukuanJiluTemp.length > 0) {
           if(temp == 'false') {
             this.shoukuanJilu = this.shoukuanJiluTemp.slice(0,2)
+            console.log(this.shoukuanJilu,'this.shoukuanJilu------鏀舵鎯呭喌')
             this.coalShowIsMore = false
           }else if(temp == 'true') {
             this.shoukuanJilu = this.shoukuanJiluTemp
@@ -732,7 +744,6 @@
     },
     coalShowIsMore: {
       handler(newVal,oldVal) {
-        console.log(newVal,'newVal-------鎸夌叅绉嶇粺璁�')
         let temp = newVal.toString() || ''
         if(this.coalTongjiTemp && this.coalTongjiTemp.length > 0) {
           if(temp == 'false') {
@@ -749,7 +760,6 @@
     },
     kehuTongjiShowIsMore: {
       handler(newVal,oldVal) {
-        console.log(newVal,'newVal-------鎸夊鎴峰彂杩愮粺璁�')
         let temp = newVal.toString() || ''
         if(this.kehuTongjiTemp && this.kehuTongjiTemp.length > 0) {
           if(temp == 'false') {
@@ -804,7 +814,7 @@
           this.shoukuanJiluTemp = res.data || []
           if(this.shoukuanJiluTemp && this.shoukuanJiluTemp.length > 0) {
             this.shoukuanToatl = this.shoukuanJiluTemp[0]?.money || 0
-            if(this.shoukuanJiluTemp.length > 1) {
+            if(this.shoukuanJiluTemp.length > 0) {
               this.shoukuanJilu = this.shoukuanJiluTemp.slice(0,2)
               this.shoukuanIsMore = false
             }
@@ -821,7 +831,7 @@
             this.d1Sum = this.coalTongjiTemp[0]?.d1Sum || 0
             this.lyDSumSum = this.coalTongjiTemp[0]?.lyDSumSum || 0
             this.dsumSum = this.coalTongjiTemp[0]?.dsumSum || 0
-            if(this.coalTongjiTemp.length > 1) {
+            if(this.coalTongjiTemp.length > 0) {
               this.coalTongji = this.coalTongjiTemp.slice(0,2)
               this.coalShowIsMore = false
             }
@@ -834,7 +844,7 @@
         if (res.code == 0) {
           this.kehuTongjiTemp = res.data || []
           if(this.kehuTongjiTemp && this.kehuTongjiTemp.length > 0){
-            if(this.kehuTongjiTemp.length > 1) {
+            if(this.kehuTongjiTemp.length > 0) {
               this.kehuTongji = this.kehuTongjiTemp.slice(0,2)
               this.kehuTongjiShowIsMore = false
             }
@@ -877,8 +887,8 @@
           this.$store.commit('SET_PERMISSIONS',res.data.permissions)
 					//uni.setStorageSync('permissions', res.data.permissions);
 					this.userId = res.data.sysUser?.userId;
-          this.compId = res.data.sysUser?.compId;
-          console.log(this.compId,'this.compId---111')
+          this.roles = res.data?.roles;
+          console.log(this.roles,'this.roles---111')
 					this.$nextTick(() => {
 						this.coalbunker();
 					});
@@ -1650,6 +1660,19 @@
           align-items: baseline;
           height: 60rpx;
           line-height: 60rpx;
+          position: relative;
+          .coal{
+            font-size: 26rpx;
+            color: #3884ff;
+            border: 1px solid #3884ff;
+            margin-right: 26rpx;
+            padding: 0 32rpx;
+            height: 38rpx;
+            line-height: 38rpx;
+            border-radius: 8rpx;
+            letter-spacing: 2px;
+            font-weight: 500;
+          }
           .name{
             font-size: 24rpx;
             color: #606266;
@@ -1666,6 +1689,10 @@
             align-items: baseline;
           }
         }
+        .coal-line{
+          display: flex;
+          align-items: center;
+        }
         .kehu-block{
           width: 33%;
           .text1{

--
Gitblit v1.9.1