From 73af3ed9fbcc616cdecc739fc4307163c19c5764 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 07 六月 2024 14:35:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/staff/vehicle/sendACarDetail.vue |  271 ++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 211 insertions(+), 60 deletions(-)

diff --git a/h5/pages/staff/vehicle/sendACarDetail.vue b/h5/pages/staff/vehicle/sendACarDetail.vue
index af0f3ec..e266b61 100644
--- a/h5/pages/staff/vehicle/sendACarDetail.vue
+++ b/h5/pages/staff/vehicle/sendACarDetail.vue
@@ -16,19 +16,25 @@
     <view class="module_list">
       <view class="item">
         <view class="label">棰勮鐢ㄨ溅鏃舵</view>
-        <view class="value">{{ info.startTime.slice(0, 16) }}鑷硔{ info.endTime.slice(0, 16) }}</view>
+        <view class="value" v-if="info.startTime"
+          >{{ info.startTime.slice(0, 16) }}鑷硔{
+            info.endTime.slice(0, 16)
+          }}</view
+        >
       </view>
-			<view class="item">
+      <view class="item">
         <view class="label">棰勮鍑哄彂鏃堕棿</view>
         <view class="value">{{ info.planUseDate }}</view>
       </view>
-			<view class="item">
+      <view class="item">
         <view class="label">涔樿溅浜哄憳</view>
         <view class="value">{{ info.memberNames }}</view>
       </view>
       <view class="item">
         <view class="label">鐩殑鍦�</view>
-        <view class="value">{{ info.type == '1' ? '甯傚' : '瀹ゅ唴' }}锛歿{ info.addr }}</view>
+        <view class="value"
+          >{{ info.type == "1" ? "甯傚" : "瀹ゅ唴" }}锛歿{ info.addr }}</view
+        >
       </view>
       <view class="item">
         <view class="label">鐢ㄨ溅浜嬬敱</view>
@@ -46,31 +52,27 @@
     <!-- 娴佺▼ -->
     <view class="flow_wrap">
       <view class="flow_title">娴佺▼</view>
-      <view class="list">
-        <view class="item">
+      <view
+        class="list"
+        v-if="
+          info.approveDateVO != null && info.approveDateVO.approveList != null
+        "
+      >
+        <view
+          class="item"
+          v-for="(item, index) in info.approveDateVO.approveList"
+          :key="item.id"
+        >
+          <view class="separate"></view>
           <view class="avatar">
-            <image class="img" src="@/static/logo@2x.png" mode="widthFix" />
             <image
-              class="status"
-              src="@/static/staff/liucheng_success@2x.png"
-              mode="widthFix"
+              class="img"
+              :src="
+                item.faceImg
+                  ? item.faceImg
+                  : require('@/static/meeting/common/default_user@2x.png')
+              "
             />
-            <view class="separate"></view>
-          </view>
-          <view class="content">
-            <view class="head">
-              <view class="event">鏌愭煇鎻愪氦鐨勬嫓璁跨敵璇�</view>
-              <view class="time">time</view>
-            </view>
-            <view class="name_wrap">
-              <text>鏉庝笢(<text class="status">澶勭悊涓�</text>)</text>
-            </view>
-            <view class="remark">鍚屾剰鏀捐</view>
-          </view>
-        </view>
-        <view class="item">
-          <view class="avatar">
-            <image class="img" src="@/static/logo@2x.png" mode="widthFix" />
             <image
               class="status"
               src="@/static/staff/liucheng_success@2x.png"
@@ -79,19 +81,36 @@
           </view>
           <view class="content">
             <view class="head">
-              <view class="event">鏌愭煇鎻愪氦鐨勬嫓璁跨敵璇�</view>
-              <view class="time">time</view>
+              <view class="event">{{ item.title }}</view>
+              <view class="time">{{ item.checkDate }}</view>
             </view>
             <view class="name_wrap">
-              <text>鏉庝笢(<text class="status">澶勭悊涓�</text>)</text>
+              <text
+                >{{ item.memberName
+                }}<text class="status" v-if="item.statusInfo"
+                  >({{ item.statusInfo }})</text
+                ></text
+              >
             </view>
-            <view class="carbon">
-              <view class="carbon_item" v-for="i in 12">
+            <view v-if="item.checkInfo" class="remark">{{
+              item.checkInfo
+            }}</view>
+            <!-- 鎶勯�佷汉 -->
+            <view v-if="item.approveType == 1" class="children">
+              <view
+                class="child"
+                v-for="child in item.approveList"
+                :key="child.id"
+              >
                 <image
-                  src="../../../static/logo@2x.png"
-                  mode="widthFix"
-                ></image>
-                <view class="text">name</view>
+                  class="child_img"
+                  :src="
+                    child.faceImg
+                      ? child.faceImg
+                      : require('@/static/meeting/common/default_user@2x.png')
+                  "
+                />
+                <view>{{ child.memberName }}</view>
               </view>
             </view>
           </view>
@@ -100,10 +119,34 @@
     </view>
     <view class="emyty"></view>
     <view class="main_footer">
-      <view class="btn" @click="handleSub('0')">鎷掔粷</view>
-      <view class="btn agree" @click="handleSub('1')">鍚屾剰</view>
+      <template v-if="appr == '1'">
+        <view class="btn" @click="handleSub(3)">鎷掔粷</view>
+        <view class="btn agree" @click="handleSub(2)">鍚屾剰</view>
+      </template>
+      <view v-else class="btn agree" @click="isShowBack = true">鎾ら攢鐢ㄨ溅</view>
     </view>
 
+    <!-- 鎾ら攢 -->
+    <u-popup
+      :show="isShowBack"
+      :round="10"
+      :safeAreaInsetBottom="true"
+      mode="bottom"
+      @close="isShowBack = false"
+    >
+      <view class="appr_modal">
+        <view class="title">鎾ら攢鐢ㄨ溅</view>
+        <view class="line"> 鎾ら攢璇存槑 </view>
+        <textarea
+          v-model="backParam.info"
+          placeholder="闈炲繀濉�"
+          placeholder-class="placeholder9"
+        />
+        <view class="main_footer">
+          <view class="btn agree" @click="onSubBack">鎻愪氦</view>
+        </view>
+      </view>
+    </u-popup>
     <!--  -->
     <u-popup
       :show="showApprModal"
@@ -113,34 +156,60 @@
       @close="showApprModal = false"
     >
       <view class="appr_modal">
-        <view class="title">鍚屾剰</view>
+        <view class="title">{{ param.status == 2 ? "鍚屾剰" : "鎷掔粷" }}</view>
+        <view v-if="param.status == 2" class="line" @click="isShowDrive = true">
+          <text v-if="param.driverName">{{ param.driverName }}</text>
+          <text v-else class="placeholder9">娲捐溅鍙告満</text>
+          <u-icon class="ml12" name="arrow-right" color="#999999" />
+        </view>
         <textarea
-          placeholder="鍚屾剰璇存槑锛岄潪蹇呭~"
+          v-model="param.checkInfo"
+          :placeholder="
+            param.status == 2 ? '鍚屾剰璇存槑锛岄潪蹇呭~' : '鎷掔粷璇存槑锛屽繀濉�'
+          "
           placeholder-class="placeholder9"
         />
         <view class="main_footer">
           <view class="btn" @click="showApprModal = false">鍙栨秷</view>
-          <view class="btn agree">鎻愪氦</view>
+          <view class="btn agree" @click="onSubmit">鎻愪氦</view>
         </view>
       </view>
     </u-popup>
+    <!-- 鍙告満 -->
+    <u-picker
+      keyName="name"
+      :show="isShowDrive"
+      @close="isShowDrive = false"
+      :closeOnClickOverlay="true"
+      :columns="driveList"
+      @confirm="seletedDrive"
+      @cancel="isShowDrive = false"
+    ></u-picker>
   </view>
 </template>
 
 <script>
-import { carUseBookDetail } from '@/api'
+import { carUseBookDetail, carUseBookAppr, driveListPost, carUseBookBack } from '@/api'
 export default {
   data() {
     return {
       showApprModal: false,
+      isShowBack: false,
+      backParam: {},
+      isShowDrive: false,
       id: '',
+      appr: '',
       info: {},
-      param: {},
+      param: {
+        status: ''
+      },
+      driveList: []
 
     }
   },
   onLoad(option) {
     this.id = option.id
+    this.appr = option.appr || ''
     this.getDetail()
   },
   methods: {
@@ -150,15 +219,69 @@
         this.info = { ...res.data }
       })
     },
-    handleSub(flag) {
+    onSubBack() {
+      carUseBookBack({
+        id: this.id,
+        info: this.backParam.info
+      }).then(res => {
+        if (res.code === 200) {
+          uni.showToast({
+            title: '鎾ら攢鎴愬姛',
+            icon: 'success',
+            duration: 2000
+          })
+          this.isShowBack = false
+          setTimeout(() => {
+            uni.navigateBack()
+          }, 1000)
+        }
+      })
+    },
+    onSubmit() {
+      const { param, info } = this
+      carUseBookAppr({
+        status: param.status,
+        objType: info.type == 1 ? 4 : 3,
+        objId: this.id,
+        driverId: param.driverId,
+        checkInfo: param.checkInfo
+      }).then(res => {
+        if (res.code === 200) {
+          this.showApprModal = false
+          setTimeout(() => {
+            uni.showToast({
+              title: '鎿嶄綔鎴愬姛',
+              icon: 'success'
+            })
+          })
+          uni.navigateBack()
+        }
+      })
+    },
+    handleSub(status) {
       // this.param.flag = 
-      if (flag === '1') {
-
+      this.param = {
+        status
+      }
+      this.showApprModal = true
+      if (status === 2) { // 鍚屾剰
+        this.getDriveList()
       } else {
 
       }
       this.showApprModal = true
-    }
+    },
+    getDriveList() {
+      driveListPost({}).then(res => {
+        this.driveList = [res.data]
+      })
+    },
+    seletedDrive(e) {
+      console.log(e.value[0])
+      this.$set(this.param, 'driverId', e.value[0].id)
+      this.$set(this.param, 'driverName', e.value[0].name)
+      this.isShowDrive = false
+    },
   },
 }
 </script>
@@ -186,7 +309,16 @@
       .item {
         display: flex;
         margin-bottom: 48rpx;
-
+        position: relative;
+        .separate {
+          position: absolute;
+          width: 4rpx;
+          height: 100%;
+          background-color: #eeeeee;
+          left: 40rpx;
+          transform: translate(-50%, 0);
+          top: 80rpx;
+        }
         .avatar {
           width: 80rpx;
           height: 80rpx;
@@ -206,16 +338,6 @@
             position: absolute;
             right: 0;
             bottom: 0;
-          }
-
-          .separate {
-            position: absolute;
-            width: 4rpx;
-            height: 100%;
-            background-color: #eeeeee;
-            left: 50%;
-            transform: translate(-50%, 0);
-            bottom: -80rpx;
           }
         }
 
@@ -243,6 +365,23 @@
 
             .status {
               color: $uni-color-primary;
+            }
+          }
+          .children {
+            display: flex;
+            flex-wrap: wrap;
+            margin-top: 12rpx;
+            .child {
+              display: flex;
+              flex-direction: column;
+              justify-content: center;
+              align-items: center;
+              margin-right: 12rpx;
+              .child_img {
+                width: 48rpx;
+                height: 48rpx;
+                border-radius: 50%;
+              }
             }
           }
 
@@ -274,6 +413,11 @@
               font-size: 26rpx;
               color: #777777;
             }
+          }
+        }
+        &:nth-last-child(1) {
+          .separate {
+            height: 0;
           }
         }
       }
@@ -356,7 +500,7 @@
     justify-content: space-between;
 
     .btn {
-      width: 336rpx;
+      flex: 1;
       height: 88rpx;
       line-height: 88rpx;
       background: #ffffff;
@@ -364,7 +508,7 @@
       border: 1rpx solid #999999;
       font-size: 32rpx;
       text-align: center;
-      margin: 16rpx 0;
+      margin: 16rpx;
     }
 
     .agree {
@@ -376,7 +520,14 @@
 
   .appr_modal {
     padding: 36rpx 30rpx 0;
-
+    .line {
+      height: 90rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      border-bottom: 1rpx solid #e4e4e4;
+      margin-bottom: 20rpx;
+    }
     .title {
       font-weight: 500;
       font-size: 32rpx;

--
Gitblit v1.9.3