liukangdong
2024-05-30 2edfe17a39cb5aa653318cad9474d18fbdaa204e
admin/src/components/business/OperaCarUseBookWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,522 @@
<template>
  <GlobalWindow
      :title="title"
      :visible.sync="visible"
      @confirm="confirm"
  >
    <div class="modal_wrap">
      <div class="modal_content">
        <div class="header">
          <div class="left">
            <div class="h1">公务车申请</div>
            <div class="time">提交时间:{{model.createDate}}</div>
          </div>
          <span class="right"  v-if="model.status === 0">申请中</span>
          <span class="right"  v-if="model.status === 1">待审批</span>
          <span class="right" style="background:#53b76f " v-if="model.status === 2">审批通过</span>
          <span class="right" style="background:#dc362e " v-if="model.status === 3">审批不通过</span>
          <span class="right" style="background:#dc362e " v-if="model.status === 4">已取消</span>
        </div>
        <div class="info">
          <div class="title">公务车申请信息</div>
          <div class="list">
            <div class="item" style="width: 100%">
              <div class="label">申请人</div>
              <div class="value">{{model.memberName || ''}} {{model.memberPhone || ''}} ({{model.companyName || ''}})</div>
            </div>
            <div class="item">
              <div class="label">申请车辆</div>
              <div class="value">{{model.carCode || ''}}</div>
            </div>
            <div class="item">
              <div class="label">司机信息</div>
              <div class="value" v-if="model.driverId !=null">{{model.driverName || ''}} {{model.driverPhone || ''}}</div>
              <div class="value" v-if="model.driverId ==null">未指派</div>
            </div>
            <div class="item"  >
            <div class="label">用车事由</div>
            <div class="value">{{model.content}}</div>
          </div>
            <div class="item">
              <div class="label">乘车人员</div>
              <div class="value">{{model.memberNames || ''}}</div>
            </div>
            <div class="item">
              <div class="label">目的地类别</div>
              <div class="value status-green" v-if="model.type === 0">【市内用车】</div>
              <spdivan class="value status-red"   v-if="model.type === 1">【市内用车】</spdivan>
            </div>
            <div class="item">
              <div class="label">目的地</div>
              <div class="value">{{model.addr || ''}}</div>
            </div>
            <div class="item">
              <div class="label">预计出发时间</div>
              <div class="value">{{model.planUseDate || ''}}</div>
            </div>
            <div class="item">
              <div class="label">用车时段</div>
              <div class="value">始:{{model.startTime || ''}}<br>æ­¢:{{model.endTime || ''}}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="side">
        <div class="side_title">审批流程</div>
        <div class="list"  v-if="model.approveDateVO !=null && model.approveDateVO.approveList !=null">
          <div class="item" v-for="(item,index) in model.approveDateVO.approveList" :key="item.id">
            <div class="separate" v-if=" (index < model.approveDateVO.approveList.length-1)"></div>
            <div class="info">
              <img src="@/assets/icons/ic_tongguo.png"   class="iconnew" v-if="(item.status ==2)"/>
              <img src="@/assets/icons/ic_dangqian.png"   class="iconnew"  v-if="(item.status==1)"/>
              <img src="@/assets/icons/ic_jujue.png"  class="iconnew"  v-if="(item.status==3)"></i>
              <img src="@/assets/icons/ic_grep.png"  class="iconnew" v-if="(item.status==null || item.status==0 )"></i>
              <div style="display: inline" v-if="item.approveType ===0">
                <img v-if="item.faceImg!=null && item.faceImg !=''" :src="item.faceImg" class="avatar" alt="" />
                <img v-if="item.faceImg ==null ||item.faceImg ==''"  src="@/assets/avatar/man.png" class="avatar" alt="" />
              </div>
              <div style="display: inline" v-if="item.approveType ===1">
                <img v-if="item.status === 1"  src="@/assets/icons/ic_chaosong.png" class="avatar" alt="" />
                <img  v-if="item.status != 1"  src="@/assets/icons/ic_duoren.png" class="avatar" alt="" />
              </div>
              <div class="content">
                <div class="line">
                  <div class="name">{{ item.title}}</div>
                  <div class="time">{{ item.createDate }}</div>
                </div>
                <div class="line">
                  <div class="company">
                    {{ item.createUserName }} {{ item.companyName }}
                    <div style="display: inline" v-if="item.statusInfo!=null && item.statusInfo!=''">
                       <span class="status-green">{{item.statusInfo||''}}</span>)
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div v-if="item.approveType != 1 " class="remark">
              {{ item.checkInfo ||'水电费反反复复反反复复方法方法方法方法方法方法方法方法方法方法方法方法发发发' }}
            </div>
            <div v-if="item.approveType == 1 "  class="childList">
              <div style="display: inline" v-for="item1 in item.approveList" :key="item1.id">
                <img v-if="item1.faceImg!=null && item1.faceImg !=''" :src="item1.faceImg" class="avatar" alt="" />
                <img v-if="item1.faceImg ==null ||item1.faceImg ==''"  src="@/assets/avatar/man.png" class="avatar" alt="" />
                <span style="display: inline-block"> {{item1.memberName}}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--  -->
    <template   v-slot:footer>
      <el-button @click="isShowProblem = true"  type="primary"  v-if="model.approveDateVO!=null&& model.approveDateVO.canBeApproved!=null &&model.approveDateVO.canBeApproved ==1 "  class="status-red">同意</el-button>
      <el-button @click="isBackProblem=true"  type="danger"  v-if="model.approveDateVO!=null&& model.approveDateVO.canBeApproved!=null &&model.approveDateVO.canBeApproved ==1 "  >拒绝</el-button>
      <el-button @click="visible=false">返回</el-button>
    </template>
    <el-dialog
        append-to-body
        title="同意申请"
        class="dialogCl"
        :visible.sync="isShowProblem"
        width="480px"
    >
      <el-form :model="dealForm" ref="dealForm" >
        <el-form-item label="派车司机" prop="driverId" required v-if="model.approveDateVO!=null && model.approveDateVO.drvierParam ===1">
          <el-select v-model="transForm.driverId" style="width: 300px"  filterable clearable placeholder="请选择派遣司机">
            <el-option
                v-for="item in memberList"
                :key="item.id"
                :label="item.name+'-'+item.phone"
                :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="同意说明">
          <el-input
              type="textarea"
              placeholder="请填写说明"
              :rows="4"
              v-model="backForm.checkInfo"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowProblem = false">取消</el-button>
        <el-button type="primary" :loading="dealing" @click="dealDo">确定</el-button>
      </span>
    </el-dialog>
    <el-dialog
        append-to-body
        title="拒绝申请"
        class="dialogCl"
        :visible.sync="isBackProblem"
        width="600px"
    >
      <el-form :model="backForm"  ref="backForm" label-width="100px">
        <el-form-item label="拒绝说明">
          <el-input
              type="textarea"
              placeholder="请填写说明"
              :rows="4"
              v-model="backForm.checkInfo"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isBackProblem= false">取消</el-button>
        <el-button type="primary" :loading="dealing" @click="backDo">确定</el-button>
      </span>
    </el-dialog>
  </GlobalWindow>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { driveList } from '@/api/business/member'
import { mapState } from 'vuex'
export default {
  name: 'OperaCarUseBookWindow',
  components: { GlobalWindow },
  extends: BaseOpera,
  data () {
    return {
      title: '公务车申请',
      visible: false,
      dataId: null,
      model: { },
      dealing: false,
      isShowProblem: false,
      isBackProblem: false,
      memberList: [],
      dealForm: {
        driveId: null,
        checkInfo: null
      },
      backForm: {
        checkInfo: null
      }
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.config({
      api: '/business/carUseBook',
      'field.id': 'id'
    })
  },
  methods: {
    dealDo () {
      this.$refs.dealForm.validate((valid) => {
        if (!valid) {
          return
        }
        this.$dialog.actionConfirm('操作确认', '您确认提交该隐患处理情况吗?')
          .then(() => {
            this.dealing = true
            this.api.dealHiddenDanger({
              id: this.dataId,
              status: 1,
              driverId: this.dealForm.driveId,
              checkInfo: this.dealForm.checkInfo
            })
              .then(res => {
                this.$tip.apiSuccess('处理成功')
                this.getDetail()
                this.isShowProblem = false
              })
              .finally(() => {
                this.dealing = false
              })
          })
      })
    },
    backDo () {
      this.$refs.backForm.validate((valid) => {
        if (!valid) {
          return
        }
        this.$dialog.actionConfirm('操作确认', '您确认退回该隐患处理情况吗?')
          .then(() => {
            this.dealing = true
            this.api.dealHiddenDanger({
              id: this.dataId,
              status: 2,
              checkInfo: this.backForm.checkInfo
            })
              .then(res => {
                this.$tip.apiSuccess('退回成功')
                this.getDetail()
                this.isBackProblem = false
              })
              .catch(e => {
              })
              .finally(() => {
                this.dealing = false
              })
          })
      })
    },
    open (title, target) {
      this.title = title
      this.visible = true
      this.model = {}
      this.dataId = target.id
      this.$nextTick(() => {
        this.memberList = []
        this.dealForm = {
          driveId: null,
          checkInfo: null
        }
        this.backForm = {
          checkInfo: null
        }
        this.getDetail()
      })
    },
    getDetail () {
      this.api.detail(this.dataId)
        .then(res => {
          this.model = res
          this.dealForm.driveId = res.driveId
        })
    },
    handleTransfer () {
      this.isShowTransfer = true
      this.loadMemberList()
    },
    loadMemberList () {
      driveList({}).then(res => {
        this.memberList = res
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.side_title{
  font-weight: 600;
  font-size: 18px;
  color: #111111;
  margin-bottom: 20px;
  margin-left: 20px;
  margin-top: 20px;
}
.upload_box {
  width: 84px;
  height: 84px;
  border-radius: 4px;
  background-color: #f7f7f7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #999999;
  border: 1px solid #e4e4e4;
  .icon {
    font-size: 24px;
  }
  .text {
    font-size: 12px;
  }
}
.modal_wrap {
  display: flex;
  height: 100%;
  .modal_content {
    flex: 1;
    padding: 0px 30px;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    .title {
      font-weight: 600;
      font-size: 18px;
      color: #333333;
      margin-bottom: 20px;
      margin-top: 30px;
    }
    .info {
      .list {
        display: flex;
        flex-wrap: wrap;
        .item {
          display: flex;
          width: 40%;
          margin-bottom: 20px;
          &:nth-of-type(2n) {
            width: 60%;
          }
          .label {
            color: #888888;
            width: 100px;
          }
          .value {
            color: #111111;
          }
        }
      }
    }
    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 30px;
      margin: 0 -30px;
      border-radius: 8px 8px 0 0;
      background: linear-gradient(to right, #f2f6fe, #cadffa);
      .h1 {
        font-weight: 600;
        font-size: 22px;
        color: #111111;
        margin-bottom: 8px;
      }
      .time {
        font-size: 14px;
        color: #999999;
      }
      .right {
        height: 40px;
        font-size: 16px;
        color: #ffffff;
        line-height: 40px;
        padding: 0 20px;
        background: #207ff7;
        box-shadow: 4px 4px 0px 0px rgba(32, 127, 247, 0.16);
        border-radius: 16px 0px 16px 0px;
      }
    }
    .table_info {
      .name_wrap {
        display: flex;
        align-items: center;
        .avatar {
          width: 40px;
          height: 40px;
          border-radius: 50%;
          margin-right: 12px;
        }
        .content {
          .line {
            display: flex;
          }
          .tag {
            color: #b2cbf9;
            border: 1px solid #b2cbf9;
            padding: 0px 4px;
            border-radius: 4px;
            margin-left: 6px;
          }
        }
      }
    }
  }
  .side {
    height: 100%;
    width: 420px;
    background: #ffffff;
    border-left: 20px solid #f7f7f7;
    .list {
      .item {
        padding: 8px 0;
        position: relative;
        .separate {
          position: absolute;
          border-left: 2px dashed #cccccc;
          left: 31px;
          height: calc(100% - 24px);
          top: 34px;
        }
        .info {
          display: flex;
          align-items: center;
          margin-left: 20px;
          .icon {
            position: relative;
            z-index: 11;
            color: #53b76f;
            font-size: 24px;
          }
          .icon1 {
            position: relative;
            z-index: 11;
            color: deepskyblue;
            font-size: 24px;
          }
          .icon2 {
            position: relative;
            z-index: 11;
            color: #dc362e;
            font-size: 24px;
          }
          .iconnew{
            width: 24px;
            height: 24px;
          }
          .icon3 {
            position: relative;
            z-index: 11;
            color:gray;
            font-size: 24px;
          }
          .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin: 0 12px 0 16px;
            border: 1px solid;
          }
          .content {
            flex: 1;
            .line {
              display: flex;
              justify-content: space-between;
              align-content: center;
              margin-bottom: 6px;
              .name {
                font-weight: 600;
                font-size: 16px;
                color: #111111;
              }
              .time {
                color: #888888;
              }
              .company {
                font-size: 13px;
                color: #888888;
                .status {
                  color: #00ba67;
                }
              }
            }
          }
        }
        .remark {
          background: #f7f7f7;
          border-radius: 4px;
          padding: 13px 15px;
          color: #666666;
          margin-left: 120px;
        }
        .childList {
          margin-left: 120px;
        }
      }
    }
  }
}
</style>