jiangping
2024-06-07 73af3ed9fbcc616cdecc739fc4307163c19c5764
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;