ll
liukangdong
2024-10-18 e6acb39a2475e211f2c1decc45a95c868239c25f
h5/pages/staff/vehicle/sendACarDetail.vue
@@ -1,32 +1,29 @@
<template>
  <view class="main_app">
    <view class="status_wrap">
      <view class="name">{{ info.memberName }}的用车申请</view>
      <view class="placeholder9">{{ info.companyName }}</view>
        <view class="name">{{ info.createMemberName }}提交的用车申请</view>
         <view
           class="desc"
           :class="{
             gray: info.businessStatus == '2' || info.businessStatus == '3' || info.businessStatus == '4',
            gray: info.status == '2' || info.status == '3' || info.status == '4',
           }"
           >{{ infoStatus }}</view
         >
      <view class="status">
        <text class="loading" :class="{
               grr: info.status == 1 || info.status == 2 || info.status == 4,
               error: info.status == 3
            }" v-if="info.status == '0'">{{statusMap[info.status]}}</text>
      </view>
        <view v-if="info.status == '0' || info.status == '1'" class="status">{{
          statusMap[info.status]
        }}</view>
        <image v-if="info.status == '2'" src="@/static/ic_passed@2x.png" mode="widthFix" class="status_img"></image>
        <image v-if="info.status == '3' || info.status == '6'" src="@/static/ic_refused@2x.png" mode="widthFix"
          class="status_img"></image>
    </view>
    <!--  -->
    <view class="emyty"></view>
    <view class="module_list">
      <view class="item">
        <view class="label">预计用车时段</view>
        <view class="value" v-if="info.startTime"
          >{{ info.startTime.slice(0, 16) }}至{{
            <view class="value" v-if="info.startTime">{{ info.startTime.slice(0, 16) }}至{{
            info.endTime.slice(0, 16)
          }}</view
        >
          }}</view>
      </view>
      <view class="item">
        <view class="label">预计出发时间</view>
@@ -38,9 +35,7 @@
      </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>
@@ -58,42 +53,20 @@
    <!-- 流程 -->
    <view class="flow_wrap">
      <view class="flow_title">流程</view>
      <view
        class="list"
        v-if="
         <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="item" v-for="(item, index) in info.approveDateVO.approveList" :key="item.id">
          <view class="separate"></view>
          <view class="avatar">
             <image
                v-if="item.type == 1"
               class="img"
               src="@/static/staff/ic_chaosong@2x.png"
             />
            <image
               v-else-if="item.approveType == 1 || item.approveType == 0"
              class="img"
              src="@/static/staff/ic_shenpiren@2x.png"
            />
                  <image v-if="item.type == 1" class="img" src="@/static/staff/ic_chaosong@2x.png" />
                  <image v-else-if="item.approveType == 1 || item.approveType == 0" class="img"
                     src="@/static/staff/ic_shenpiren@2x.png" />
                  <image v-else-if="item.faceImg" :src="item.faceImg" class="img"></image>
             <span v-else class="img_name">{{item.memberName && item.memberName.slice(0,1)}}</span>
            <image
               v-if="item.status == 2"
              class="status"
              src="@/static/staff/liucheng_success@2x.png"
              mode="widthFix"
            />
            <image
               v-if="item.status == 3"
              class="status"
              src="@/static/staff/liucheng_fail@2x.png"
              mode="widthFix"
            />
                  <image v-if="item.status == 2" class="status" src="@/static/staff/liucheng_success@2x.png"
                     mode="widthFix" />
                  <image v-if="item.status == 3" class="status" src="@/static/staff/liucheng_fail@2x.png" mode="widthFix" />
          </view>
          <view class="content">
            <view class="head">
@@ -101,31 +74,18 @@
              <view class="time">{{ item.checkDate }}</view>
            </view>
            <view class="name_wrap">
              <text
                >{{ item.memberName
                }}<text class="status" v-if="item.statusInfo"
                  >({{ item.statusInfo }})</text
                ></text
              >
                     <text>{{ item.memberName
                   }}<text :class="{ status: item.statusInfo == '处理中' || item.status == '1'  }"
                           v-if="item.statusInfo">({{ item.statusInfo }})</text></text>
            </view>
            <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
                  class="child_img"
                  :src="
                    child.faceImg
                      ? child.faceImg
                      : require('@/static/meeting/common/default_user@2x.png')
                  "
                />
                  <view v-if="item.approveType == 0 || item.type == 1 || item.approveType == 1" class="children">
                     <view class="child" v-for="child in item.approveList" :key="child.id">
                        <image v-if="child.faceImg" class="child_img" :src="child.faceImg" />
                        <view v-else class="child_name">{{ child.memberName && child.memberName.slice(0,1) }}</view>
                <view>{{ child.memberName }}</view>
              </view>
            </view>
@@ -134,14 +94,11 @@
      </view>
    </view>
    <view class="emyty"></view>
    <view
      class="main_footer"
      v-if="
      <view class="main_footer" v-if="
        info.approveDateVO != null &&
        info.approveDateVO.canBeApproved != null &&
        info.approveDateVO.canBeApproved == 1
      "
    >
      ">
      <template v-if="appr == '1'">
        <view class="btn" @click="handleSub(3)">拒绝</view>
        <view class="btn agree" @click="handleSub(2)">同意</view>
@@ -150,34 +107,18 @@
    </view>
    <!-- 撤销 -->
    <u-popup
      :show="isShowBack"
      :round="10"
      :safeAreaInsetBottom="true"
      mode="bottom"
      @close="isShowBack = false"
    >
      <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"
        />
            <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"
      :round="10"
      :safeAreaInsetBottom="true"
      mode="bottom"
      @close="showApprModal = false"
    >
      <u-popup :show="showApprModal" :round="10" :safeAreaInsetBottom="true" mode="bottom" @close="showApprModal = false">
      <view class="appr_modal">
        <view class="title">{{ param.status == 2 ? "同意" : "拒绝" }}</view>
        <view v-if="param.status == 2" class="line" @click="isShowDrive = true">
@@ -185,13 +126,9 @@
          <text v-else class="placeholder9">派车司机</text>
          <u-icon class="ml12" name="arrow-right" color="#999999" />
        </view>
        <textarea
          v-model="param.checkInfo"
          :placeholder="
            <textarea v-model="param.checkInfo" :placeholder="
            param.status == 2 ? '同意说明,非必填' : '拒绝说明,必填'
          "
          placeholder-class="placeholder9"
        />
          " placeholder-class="placeholder9" />
        <view class="main_footer">
          <view class="btn" @click="showApprModal = false">取消</view>
          <view class="btn agree" @click="onSubmit">提交</view>
@@ -199,20 +136,18 @@
      </view>
    </u-popup>
    <!-- 司机 -->
    <u-picker
      keyName="name"
      :show="isShowDrive"
      @close="isShowDrive = false"
      :closeOnClickOverlay="true"
      :columns="driveList"
      @confirm="seletedDrive"
      @cancel="isShowDrive = false"
    ></u-picker>
      <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, carUseBookAppr, driveListPost, carUseBookBack } from '@/api'
   import {
      carUseBookDetail,
      carUseBookAppr,
      driveListPost,
      carUseBookBack
   } from '@/api'
export default {
  data() {
    return {
@@ -246,9 +181,25 @@
  },
  methods: {
    getDetail() {
      const { id } = this
            const {
               id
            } = this
      carUseBookDetail(id).then(res => {
        this.info = { ...res.data }
               this.info = {
                  ...res.data
               }
               if (this.info.approveDateVO && this.info.approveDateVO.approveList.length > 0) {
                  this.info.approveDateVO.approveList.forEach(item => {
                     if (item.approveList && item.approveList.length == 1 && item.type !== 1) {
                        item.title = item.approveList[0].title
                        item.faceImg = item.approveList[0].faceImg
                        item.memberName = item.approveList[0].memberName
                        item.statusInfo = item.approveList[0].statusInfo
                        item.status = item.approveList[0].status
                        item.approveList = []
                     }
                  })
               }
      })
    },
    onSubBack() {
@@ -270,7 +221,10 @@
      })
    },
    onSubmit() {
      const { param, info } = this
            const {
               param,
               info
            } = this
      carUseBookAppr({
        status: param.status,
        objType: info.type == 1 ? 4 : 3,
@@ -342,6 +296,7 @@
        display: flex;
        margin-bottom: 48rpx;
        position: relative;
        .separate {
          position: absolute;
          width: 4rpx;
@@ -351,6 +306,7 @@
          transform: translate(-50%, 0);
          top: 80rpx;
        }
        .avatar {
          width: 80rpx;
          height: 80rpx;
@@ -359,15 +315,18 @@
              display: flex;
              align-items: center;
              justify-content: center;
          .img {
            width: 80rpx;
            height: 80rpx;
            border-radius: 50%;
          }
              .img_name{
                 font-size: 32rpx;
                 color: #FFFFFF;
              }
          .status {
            width: 28rpx;
            height: 28rpx;
@@ -404,10 +363,12 @@
              color: $uni-color-primary;
            }
          }
          .children {
            display: flex;
            flex-wrap: wrap;
            margin-top: 12rpx;
            .child {
              display: flex;
              flex-direction: column;
@@ -416,12 +377,14 @@
              margin-right: 12rpx;
                    font-size: 26rpx;
                    color: #777777;
              .child_img {
                width: 48rpx;
                height: 48rpx;
                border-radius: 50%;
                       margin-bottom: 2rpx;
              }
                    .child_name{
                       margin-bottom: 2rpx;
                       width: 48rpx;
@@ -447,26 +410,31 @@
            line-height: 36rpx;
          }
        }
        .carbon {
          display: flex;
          width: 590rpx;
          overflow-x: auto;
          margin-top: 12rpx;
          .carbon_item {
            text-align: center;
            flex-shrink: 0;
            width: 100rpx;
            image {
              width: 60rpx;
              height: 60rpx;
              margin: 0 auto;
            }
            view {
              font-size: 26rpx;
              color: #777777;
            }
          }
        }
        &:nth-last-child(1) {
          .separate {
            height: 0;
@@ -524,15 +492,15 @@
    .name {
      font-weight: 600;
      font-size: 32rpx;
      margin-bottom: 16rpx;
      margin-bottom: 20rpx;
      color: #222222;
    }
    .desc {
      font-size: 26rpx;
      color: #ed4545;
         margin-top: 16rpx;
    }
    .gray {
      color: #999999;
    }
@@ -548,8 +516,14 @@
      background-color: #e9edff;
      color: $uni-color-primary;
    }
  }
    .status_img {
      position: absolute;
      right: 0rpx;
      top: 20rpx;
      width: 120rpx;
    }
  }
  .main_footer {
    padding-bottom: 64rpx;
    display: flex;
@@ -576,6 +550,7 @@
  .appr_modal {
    padding: 36rpx 30rpx 0;
    .line {
      height: 90rpx;
      display: flex;
@@ -584,6 +559,7 @@
      border-bottom: 1rpx solid #e4e4e4;
      margin-bottom: 20rpx;
    }
    .title {
      font-weight: 600;
      font-size: 32rpx;