<template>
  <div class="dialog" v-if="dialogForm">
    <div class="head_box">
      <span class="title">承接车辆交接信息{{ title }}</span>
      <div>
        <el-button type="primary" v-if="title != '详情'" size="small" :loading="loading" @click="submit">保存</el-button>
        <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="01131213"/>
          </el-form-item>
          <el-form-item label="承接车辆">
            <el-input v-model="listQuery.jdchphm" placeholder="藏G.123456"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="送车人姓名">
            <el-input v-model="listQuery.czxm" placeholder="张三"/>
          </el-form-item>
          <el-form-item label="送车人证件号码">
            <el-input v-model="listQuery.czzjhm" placeholder="511123456789012345"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="送车人联系电话">
            <el-input v-model="listQuery.czlxdh" placeholder="15222222222"/>
          </el-form-item>
          <el-form-item label="收车时间">
            <el-input v-model="listQuery.scsj" placeholder="2025/1/20 10:00:00"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="收车人姓名">
            <el-input v-model="listQuery.sqrxm" placeholder="李四"/>
          </el-form-item>
          <el-form-item label="收车人证件号码">
            <el-input v-model="listQuery.sqrzjhm" placeholder="511123456789012444"/>
          </el-form-item>
        </div>

        <div class="form-row">
          <el-form-item label="收车人联系方式">
            <el-input v-model="listQuery.sqrlxfs" placeholder="15211111111"/>
          </el-form-item>
          <el-form-item label="取车时间">
            <el-input v-model="listQuery.qcsj" placeholder="2025/1/20 10:00:00"/>
          </el-form-item>
        </div>
      </el-form>
    </div>
    
  </div>
</template>

<script setup>
import { ref, reactive } from 'vue';
import { Plus } from '@element-plus/icons-vue';

const dialogForm = ref(false);
const activeName = ref('basic');
const title = ref('详情');
const listQuery = ref({
  captureImages: [
    {img:require('@/assets/images/person.png')},
    {img:require('@/assets/images/person.png')},
    {img:require('@/assets/images/person.png')},
  ],
  list: [
    {xm:'张三',zjhm:'510183199626565555'},
    {xm:'张三',zjhm:'510183199626565555'},
    {xm:'张三',zjhm:'510183199626565555'},
    {xm:'张三',zjhm:'510183199626565555'},
    {xm:'张三',zjhm:'510183199626565555'},
  ]
});

const areaOptions = ref([]); // 区域选项数据

// 提交
const submit = ()=>{
  elform.value.validate((valid) => {
    if (!valid) return false;
    // loading.value = true;
    let params = { ...listQuery.value}
    let url = title.value == '新增' ? '/mosty-lzcj/tbDwYy/insert' :'/mosty-lzcj/tbDwYy/update'
    // qcckPost(params, url).then((res) => {
    //   proxy.$message({ type: "success", message: title.value+'成功'});
    //   close()
    //   emit("updateDate",modelLx.value);
    // }).catch(()=>{
    //   loading.value = false;
    // });
  });
}

// 初始化数据
const init = (type, row,) => {
  dialogForm.value = true;
  title.value = type == 'add' ? '新增' : type == 'eidt' ? '编辑' : '详情'
  // 根据type和row初始化表单数据
};

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

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;
  }

  .labelTileile{
    background-color: #F7FAFB;
    border: 1px solid #E3E7ED;
    line-height: 30px;
    padding-left: 8px;
    // text-align: center;
    margin-top: 10px;
  }
  .image-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  
    
    .image-item {
      width: 150px;
      height: 150px;
      border: 1px solid #dcdfe6;
      
      .el-image {
        width: 100%;
        height: 100%;
      }
    }
  }

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

  .upload-group {
    display: flex;
    // gap: 20px;
    
    .el-form-item {
      flex: 1;
    }
  }

  .unit {
    margin-left: 5px;
  }
   ::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>