Prechádzať zdrojové kódy

施工日志汇报fix

NULL1222 6 dní pred
rodič
commit
193fcab373

+ 8 - 6
bgj/workOrder/nodes/report/index.scss

@@ -48,8 +48,7 @@ page {
   z-index: 1;
 
   .logo-img {
-    width: 300rpx;
-    height: 120rpx;
+    width: 400rpx;
   }
 }
 
@@ -179,16 +178,19 @@ page {
     line-height: 1.6;
 
     &.has-arrow {
+      position: relative;
+      padding-right: 30rpx;
+
       &::after {
         content: '';
-        display: inline-block;
+        position: absolute;
+        right: 0;
+        top: 46rpx;
         width: 12rpx;
         height: 12rpx;
         border-top: 2rpx solid #999;
         border-right: 2rpx solid #999;
         transform: rotate(45deg);
-        margin-left: 10rpx;
-        vertical-align: middle;
       }
     }
   }
@@ -290,7 +292,7 @@ page {
     font-size: 28rpx;
     color: rgba(255, 255, 255, 0.95);
     line-height: 1.8;
-    text-align: center;
+    text-align: left;
     word-break: break-all;
 
     // 富文本样式

+ 1 - 1
bgj/workOrder/nodes/report/index.wxml

@@ -4,7 +4,7 @@
   <view class="header-bg">
     <!-- logo 区域 -->
     <view class="logo-area" wx:if="{{logoUrl}}">
-      <image class="logo-img" src="{{logoUrl}}" mode="aspectFit" />
+      <image class="logo-img" src="{{logoUrl}}" mode="widthFix" />
     </view>
 
     <!-- 标题 -->

+ 28 - 20
bgj/workOrder/nodes/update/update.js

@@ -167,6 +167,10 @@ Page({
         updateData.team = team;
         updateData.selectedTrainers = team.filter(t => t._active);
       }
+      // 回填 report_content,确保确认完成时能拿到之前保存的值
+      if (d.report_content) {
+        updateData['detail.report_content'] = d.report_content;
+      }
       this.setData(updateData);
     }).catch(() => {});
   },
@@ -551,11 +555,32 @@ Page({
     this.setData({ loading: true });
 
     try {
-      // 第一步:完成工单(isconfirm: 1)
+      // 第一步:获取天气和日期
+      const now = new Date();
+      const weatherdate = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
+
+      let weather = '';
+      if (this.data.workpresetjson.logreport == 1) {
+        try {
+          const weatherRes = await _Http.basic({ id: 20231012093701 });
+          if (weatherRes.code == 1 && weatherRes.data && weatherRes.data.real && weatherRes.data.real.weather) {
+            const w = weatherRes.data.real.weather;
+            weather = `${w.info} ${w.temperature}℃`;
+          }
+        } catch (e) {
+          console.log('获取天气失败', e);
+        }
+      }
+      console.log("weather",weather)
+      // 第二步:完成工单(isconfirm: 1),带上天气和日期
       const confirmContent = this.buildContent(1);
       const confirmRes = await _Http.basic({
         id: 2026052615154602,
-        content: confirmContent,
+        content: {
+          ...confirmContent,
+          weather,
+          weatherdate,
+        },
       });
 
       if (confirmRes.code != 1) {
@@ -568,24 +593,7 @@ Page({
         return;
       }
 
-      // 第二步:获取天气数据(仅 logreport 为 1 时)
-      let weather = '';
-      if (this.data.workpresetjson.logreport == 1) {
-        try {
-          const weatherRes = await _Http.basic({ id: 20231012093701 });
-          if (weatherRes.code == 1 && weatherRes.data && weatherRes.data.weather) {
-            const w = weatherRes.data.weather;
-            weather = `${w.info} ${w.temperature}℃`;
-          }
-        } catch (e) {
-          console.log('获取天气失败', e);
-        }
-      }
-
-      // 第三步:保存工序,带上天气和日期信息
-      const now = new Date();
-      const weatherdate = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
-
+      // 第三步:保存工序 report_content,带上天气和日期信息
       // report_content 优先取原本返回的,再把天气和日期替换进去
       const originalReportContent = this.data.detail.report_content || {};