<template>
  <div class="dialog" v-if="dialogForm">
    <div class="head_box">
      <span class="title">爆破作业项目信息详情</span>
      <div>
        <el-button size="small" @click="close">关闭</el-button>
      </div>
    </div>
    <div class="cntinfo">
      <el-form :model="listQuery" :label-width="230" label-position="left">
        <div class="form-row">
          <el-form-item label="爆破作业项目业务流水号">
            <el-input v-model="listQuery.ywlsh" placeholder="请输入业务流水号"/>
          </el-form-item>
          <el-form-item label="行政区划">
            <el-input v-model="listQuery.xzqh" placeholder="请输入行政区划"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="项目名称">
            <el-input v-model="listQuery.xmmc" placeholder="请输入项目名称"/>
          </el-form-item>
          <el-form-item label="项目级别">
            <el-input v-model="listQuery.xmjb" placeholder="请输入项目级别"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="委托单位名称">
            <el-input v-model="listQuery.wtdwmc" placeholder="请输入委托单位名称"/>
          </el-form-item>
          <el-form-item label="作业开始时间">
            <el-date-picker v-model="listQuery.zyksrq" type="datetime" style="width:100%" placeholder="请选择作业开始时间"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="作业结束时间">
            <el-date-picker v-model="listQuery.zyjsrq" type="datetime" style="width:100%" placeholder="请选择作业结束时间"/>
          </el-form-item>
          <el-form-item label="设计施工单位">
            <el-input v-model="listQuery.sjsgdw" placeholder="请输入设计施工单位"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="安全评估单位">
            <el-input v-model="listQuery.aqpgdw" placeholder="请输入安全评估单位"/>
          </el-form-item>
          <el-form-item label="安全监理单位">
            <el-input v-model="listQuery.aqjldw" placeholder="请输入安全监理单位"/>
          </el-form-item>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const dialogForm = ref(false);
const listQuery = ref({});

// 初始化数据
const init = (type, row) => {
  dialogForm.value = true;
  if (row) {
    listQuery.value = { ...row };
  } else {
    listQuery.value = {};
  }
};

const close = () => {
  dialogForm.value = false;
  listQuery.value = {};
};

defineExpose({init});
</script>

<style lang="scss" scoped>
.dialog {
  padding: 20px;

  :deep(.el-form-item__label) {
    background-color: #F7FAFB;
    padding: 0px 8px;
    color: #000;
    font-weight: 500;
    border: 1px solid #E3E7ED;
  }

  .head_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .cntinfo{
    height: calc(100% - 70px);
    overflow: hidden;
    overflow-y: auto;
  }

  .form-row {
    display: flex;
    
    .el-form-item {
      flex: 1;
    }
  }

   ::v-deep .el-input__inner{
    height: 36px !important;
    line-height: 36px !important;
    border-radius: 0;
    color: #777575;
  }
}
.el-form-item--default{
  margin-bottom: 0px;
}
</style>
