<template>
  <el-dialog title="订单详情" :visible.sync="isVisible">
    <el-form>
      <el-row>
        <el-col :span="12">
          <el-form-item label="订单号">
            <span>{{row.no}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="支付时间">
            <span>{{row.updTime}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="订单状态">
            <span v-if="row.status == '2'">取消</span>
            <span v-if="row.status == '3'">待付款</span>
            <span v-if="row.status == '4'">待出行</span>
            <span v-if="row.status == '5'">出行中</span>
            <span v-if="row.status == '6'">已完成</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="用户ID/实名">
            <span>{{row.userId}}</span>/<span>{{row.username}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="配车">
            <span>{{row.vehicleNumberPlat}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="出发地">
            <span>{{row.startCompanyName}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="目的地">
            <span>{{row.name}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="活动日期">
            <span>{{dateFormat(row.orderTourDetail.startTime)}}</span> ~
            <span>{{dateFormat(row.orderTourDetail.endTime)}}</span>
          </el-form-item>
        </el-col>
      </el-row>
      <!--<table class="orderDetail">
				<tr>
					<td>房车</td>
					<td>租借天数</td>
					<td>费用明细</td>
				</tr>
				<tr>
					<td>{{form.name}}{{tourCostDetail}}</td>
					<td>{{form.orderRentVehicleDetail.dayNum}}天</td>
					<td>{{tourCostDetail}}</td>
				</tr>
				<tr>
					<td ></td>
					<td ></td>
					<td >共计:{{form.realAmount}}</td>
				</tr>
			</table>-->
    </el-form>

    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <el-button type="primary" @click="sure">确 定</el-button>
    </div>
  </el-dialog>
</template>
<script>
  import {
    page,
    saveOrderViolation
  } from 'api/order/rentVehicle';
  import {mapGetters} from 'vuex';
  import {
    formatDate
  } from '../../../utils/dateFormattor';
  import {
    getToken
  } from '../../../utils/auth';
  import {
    getOneIllegalRow
  } from 'api/order/rentVehicle';
  import ElRow from "element-ui/packages/row/src/row";
  import ElInput from "../../../../node_modules/element-ui/packages/input/src/input.vue";
  import ElCol from "element-ui/packages/col/src/col";
  import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
  import ElForm from "../../../../node_modules/element-ui/packages/form/src/form.vue";
  export default {
    props: ["row"],
    name: 'illegalDialog',
    components: {
      ElForm,
      ElFormItem,
      ElCol,
      ElInput,
      ElRow
    },
    data() {
      return {
        isVisible: false,
        tableData:[],
      }
    },
    created() {
        
    },
    watch: {
      isVisible(newValue, oldValue){
        if(!newValue){
          this.$emit('detailEvent', false);
        }
      },
    },
    mounted() {
      let that = this;
      this.isVisible = true;
    },
    computed: {
      ...mapGetters([
        'elements',
      ]),
      getHeaderWithToken() {
        return {Authorization: getToken()};
      }
    },
    methods: {
      /**
       * 弹框-取消
       * */
      cancel() {
        this.$emit('detailEvent', false);
      },
      sure:function(){
          this.$emit('detailEvent', false);
      },
      /**
       * 格式化时间
       * @param timestamp
       * @returns {*}
       */
      dateFormat(timestamp) {
        let date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
        var Week=['周日','周一','周二','周三','周四','周五','周六'];
        var str = formatDate(date, 'yyyy/MM/dd')
        return str+' '+Week[date.getDay()];
      },
    }
  }
</script>
<style>
  .el-form-item__content{
    display: inline-block;
  }
</style>
