Browse Source

修改bug

暖心小太阳 17 hours ago
parent
commit
9985e19782

+ 17 - 3
pages/temp/fraWeekReport/fraWeekReport.js

@@ -56,15 +56,28 @@ Page({
     util.request(api.GetReportList, params, 'post').then(res => {
       if (res.errno === 0) {
 
-        if (res.data == null) {
+        if (res.data == null || res.data == undefined  ) {
           this.setData({
             noData: true
           })
         }else{
-           // console.log("我的打印", res.data.records[0]);
+           console.log("我的打印", res.data.records[0]);
+
+let reportList=res.data.records[0];
         this.setData({
-          reportList: res.data.records[0]
+          noData:false,
         })
+  // 遍历 record 对象,并过滤 null 值
+  for (const key in reportList) {
+    if (reportList[key] != null) {
+      reportList[key] = reportList[key];
+    }else{
+      reportList[key]="暂无"
+    }
+  }
+  this.setData({
+    reportList: reportList
+  })
         }
        
       } else {
@@ -103,6 +116,7 @@ Page({
   },
 
   showWeekDate() {
+    console.log(111);
     this.setData({
       showPopup: true
     })

+ 16 - 14
pages/temp/fraWeekReport/fraWeekReport.wxml

@@ -1,4 +1,12 @@
 <view class="whole-page">
+  <view class="week-report" bind:tap="showWeekDate">
+      <view class="l">周报数据</view>
+      <view class="r">
+        <text wx:if="{{selectedWeek}}">{{selectedWeek}}</text>
+        <text wx:else>{{columns[columns.length-1]}}</text>
+        <view class="r-border"></view>
+      </view>
+    </view>
   <view class="no-data" wx:if="{{noData}}">
     <view class="no-data-img">
     </view>
@@ -10,13 +18,6 @@
 
 
   <view class="data-container" wx:else>
-    <view class="week-report" bind:tap="showWeekDate">
-      <view class="l">周报数据</view>
-      <view class="r">
-        <text>{{reportList.bookStartAndEnd}}</text>
-        <view class="r-border"></view>
-      </view>
-    </view>
     <view class="report-data">
       <view class="report-first">
         <view class="top">
@@ -123,7 +124,14 @@
     </view>
 
 
-    <van-overlay show="{{ showPopup }}" bind:click="onClose" />
+   
+ 
+
+
+
+
+  </view>
+  <van-overlay show="{{ showPopup }}" bind:click="onClose" />
     <view class="time-select" wx:if="{{showPopup}}"> 
            <van-picker
            default-index="{{ reportDateList.length }}"
@@ -135,10 +143,4 @@
   
 />
     </view>
- 
-
-
-
-
-  </view>
 </view>

+ 4 - 3
pages/temp/fraWeekReport/fraWeekReport.wxss

@@ -27,13 +27,14 @@
 .data-container {
   height: 100vh;
   background-color: #f5f5f5;
-  padding: 20rpx 30rpx;
+  padding: 10rpx 30rpx;
 }
 
 .week-report {
   display: flex;
   justify-content: space-between;
-
+  padding: 20rpx 30rpx;
+  background-color: #f5f5f5;
 }
 
 .week-report .l {
@@ -63,7 +64,7 @@
   border-radius: 20rpx;
   height: 820rpx;
   padding: 40rpx 30rpx;
-  margin-top: 30rpx;
+  /* margin-top: 30rpx; */
 }
 
 .report-first {