<template>
  <div class="info-div">
    <div class="title-div">下面的是写死为1001这条保险公司的-----详细信息</div>
    <a-form-model ref="form" layout="vertical">
      <a-row :gutter="30">
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="保险公司名称">
            <a-input v-model="detailObj.longName" placeholder="保险公司名称" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="保险公司英文名称">
            <a-input
              v-model="detailObj.englishName"
              placeholder="保险公司英文名称"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="国家">
            <a-input v-model="detailObj.country" placeholder="国家" />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="30">
        <a-col :lg="3" :sm="12">
          <a-form-model-item label="有效">
            <a-select v-model="detailObj.status" placeholder="请选择" disabled>
              <a-select-option value="1">有效</a-select-option>
              <a-select-option value="2">无效</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="9" :sm="12">
          <a-row :gutter="30">
            <a-col :lg="12" :sm="12">
              <a-form-model-item label="合同起始日期">
                <a-date-picker
                  v-model="detailObj.startDate"
                  format="YYYY年MM月DD日"
                  placeholder="选择日期"
                />
              </a-form-model-item>
            </a-col>
            <a-col :lg="12" :sm="12">
              <a-form-model-item label="合同终止日期">
                <a-date-picker
                  v-model="detailObj.endDate"
                  format="YYYY年MM月DD日"
                  placeholder="选择日期"
                />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <a-col :lg="10" :sm="12">
          <a-form-model-item label="保险公司地址">
            <a-input v-model="detailObj.address" placeholder="保险公司地址" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="网络联系人">
            <a-input
              v-model="detailObj.contactPerson"
              placeholder="请输入联系人"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="理赔件邮寄地址">
            <a-input
              v-model="detailObj.claimAddress"
              placeholder="理赔件邮寄地址"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="4" :sm="12">
          <a-form-model-item label="保险公司联系电话">
            <a-input
              v-model="detailObj.contactPhone"
              placeholder="保险公司联系电话"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="客服电话">
            <a-input v-model="detailObj.customerTel" placeholder="客服电话" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="预授权电话">
            <a-input v-model="detailObj.authorTel" placeholder="预授权电话" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="保险公司邮件地址">
            <a-input v-model="detailObj.email" placeholder="保险公司邮件地址" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="客服邮件地址">
            <a-input
              v-model="detailObj.customerEmail"
              placeholder="客服邮件地址"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="预授权邮件地址">
            <a-input
              v-model="detailObj.authorEmail"
              placeholder="预授权邮件地址"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="理赔邮件地址">
            <a-input
              v-model="detailObj.claimEmail"
              placeholder="理赔邮件地址"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="保险公司Protal链接">
            <a-input
              v-model="detailObj.portalUrl"
              placeholder="保险公司Protal链接"
            />
          </a-form-model-item>
        </a-col>
        <a-col :lg="4" :sm="12">
          <a-form-model-item label="登录名">
            <a-input v-model="detailObj.loginName" placeholder="登录名" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="6" :sm="12">
          <a-form-model-item label="密码">
            <a-input
              type="password"
              v-model="detailObj.loginPwd"
              placeholder="密码"
            />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :sm="24" class="none-label">
          <a-form-model-item label="button">
            <a-button type="primary" @click="handlerSava">
              <Icon name="ssiadd" :size="14" />新建
            </a-button>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
  </div>
</template>

<script>
export default {
  data() {
    return {
      detailObj: {}
    }
  },
  created(){
    this.getDetail()
  },
  methods: {
    //获取详细信息
    getDetail() {
      this.$apis
        .PAYORDETAIL({
          id: 1001,
        })
        .then((res) => {
          if (res.returnCode == "0000") {
            this.detailObj = res.content || {};
          } else {
            this.$message.error(res.returnMsg);
          }
        });
    },
    //新建保存
    handlerSava(){
      this.$apis
        .CREATEPAY({
          ...this.detailObj
        })
        .then((res) => {
          if (res.returnCode == "0000") {
            this.$message.success("新建成功");
          } else {
            this.$message.error(res.returnMsg);
          }
        });
    }
  },
};
</script>

<style lang="less" scoped>
.info-div{
  margin-top: 16px;
}
.title-div {
  line-height: 56px;
  color: #252631;
}
</style>
