<!--车辆排班   保养弹框-->
<template>
  <el-dialog title="保养用车" :visible.sync="baoyang" width="10%">
    <el-form :model="currentItem"  ref="currentItem" label-width="120px">
        <el-form-item label="车牌号:">
          <span>{{currentItem.item.numberPlate}}</span>
        </el-form-item>
      <el-form-item label="所属公司:">
        <span>{{currentItem.item.subordinateBranchName}}</span>
      </el-form-item>
      <el-form-item label="提车保养公司:">
        <span>{{currentItem.item.parkCompanyName}}</span>
      </el-form-item>
      <el-form-item label="还车公司:">
        <span>{{currentItem.item.destinationBranchCompanyName}}</span>
      </el-form-item>
      <el-form-item label="保养人:">
        <span>{{currentItem.ii.vehicleBookRecord.bookUserName}}</span>
      </el-form-item>
      <el-form-item label="预定时间:">
        <span>{{currentItem.ii.vehicleBookRecord.bookStartDate}}~{{currentItem.ii.vehicleBookRecord.bookEndDate}}</span>
      </el-form-item>
      <el-form-item label="用途:">
        <span>保养</span>
      </el-form-item>
      <el-form-item label="保养项目:">
        <span></span>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel()">取消用车</el-button>
      <el-button type="primary" @click="handelOk()">确 定</el-button>
    </div>
  </el-dialog>
</template>
<script>
  import {mapGetters} from 'vuex';
  import ElRow from "element-ui/packages/row/src/row";
  import ElCol from "element-ui/packages/col/src/col";
  import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
  export default {
    components: {
      ElFormItem,
      ElCol,
      ElRow},
    props: ["currentItem"],
    name: 'vehicleMaintenanceModal',
    data() {
      return {
        baoyang:false,
      }
    },
    created() {
      console.log(this.currentItem);
    },
    watch: {
      baoyang(newValue, oldValue){
        if(!newValue){
          this.$emit("baoyangDialogEvent", false);
        }
      },
    },
    mounted() {
      this.baoyang = true;
    },
    methods: {
      /**
       * 保养-弹框-取消
       * */
      cancel() {
        console.log("保养取消用车");
        this.$emit("baoyangDialogEvent", true);
      },
      /**
       * 保养-确定用车
       * */
      handelOk(){
        console.log("保养确定用车");
        this.$emit("baoyangDialogEvent", true);
      }
    }
  }
</script>

