<template xmlns='http://www.w3.org/1999/html' xmlns='http://www.w3.org/1999/html'>
  <a-spin :spinning='confirmLoading'>
    <j-form-container :disabled='formDisabled'>
      <a-form-model ref='form' :model='model' :rules='validatorRules' slot='detail'>
        <a-row>

          <a-col :span="24">
            <div style="text-align: center;font-size: larger;margin-bottom: 10px">地块信息填报</div>
          </a-col>


          <a-col :span="24">
            <a-form-model-item label='地块名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='dk'>
              <a-col :span="22">
                <a-input v-model='model.dk' placeholder='请输入地块名称'></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("dkmc")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>

          <a-col :span="24">
            <a-form-model-item label='证书类型' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='zslx'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.zslx' dictCode='zslx' placeholder='请选择证书类型'/>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item v-if="model.zslx=='无'" label='证书/合同/文件编号' :labelCol='labelCol' :wrapperCol='wrapperCol'
                               prop='wjbh'>
              <a-col :span="22">
                <a-input v-model="model.wjbh='无'" placeholder='请输入证书/合同/文件编号'></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("wjbh")'></a-icon>
              </a-col>

            </a-form-model-item>

            <a-form-model-item v-else label='证书/合同/文件编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='wjbh'>
              <a-col :span="22">
                <a-input v-model="model.wjbh" placeholder='请输入证书/合同/文件编号'></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("wjbh")'></a-icon>
              </a-col>

            </a-form-model-item>

          </a-col>
          <a-col :span="24">
            <a-form-model-item label='土地使用权人' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='tdsyqr'>
              <a-col :span="22">
                <a-input v-model='model.tdsyqr' placeholder='请输入土地使用权人'></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("tdsyqr")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <!--                <a-col :span="24">

                            <a-form-model-item label="是否共用宗" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfgyz">
                              <a-col :span="22">
                              <j-dict-select-tag type="list" v-model="model.sfgyz" dictCode="sfgyz" placeholder="请选择是否共用宗" />
                              </a-col>
                            </a-form-model-item>
                          </a-col>
                          <a-col :span="24">
                            <a-form-model-item label="总建筑面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zjzmj">
                              <a-col :span="22">
                              <a-input-number v-model="model.zjzmj" placeholder="请输入总建筑面积" :disabled='zjzmjDisabled' style="width: 100%" />
                              </a-col>
                              <a-col :span="2">
                                <a-icon class='info' type='question-circle-o' @click='info("zjzmj")'></a-icon>
                              </a-col>
                            </a-form-model-item>
                          </a-col>
                          &lt;!&ndash; <span class='example'>示例：无</span>&ndash;&gt;
                            <a-col :span="24">
                        <a-form-model-item label='容积率' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjrjl'>
                          <a-col :span="22">
                          <a-input-number v-model='model.sjrjl' placeholder='请输入容积率' style='width: 100%' />
                          </a-col>
                          <a-col :span="2">
                          <a-icon class='info' type='question-circle-o' @click='info("sjrjl")'></a-icon>
                          </a-col>
                        </a-form-model-item>
                            </a-col>-->
          <a-col :span="24">
            <a-form-model-item label='取得方式' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='syqsyfs'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.syqsyfs' dictCode='qdfs' placeholder='请选择取得方式'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("syqsyfs")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='批准用途' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='pzyt'>
              <a-col :span="22">
                <j-category-select v-model="model.pzyt" pcode="A04" placeholder="请选择批准用途"/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjyt")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='实际用途' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjyt'>
              <a-col :span="22">
                <a-input v-model="model.sjyt" placeholder="请输入实际用途"/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjyt")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>

          <a-col :span="24">
            <a-form-model-item label="行政区划" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xzqh">
              <a-col :span="22">
                <j-area-linkage type="cascader" v-model="model.xzqh" placeholder="请输入省市区"/>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='坐落位置' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='zlwz'>
              <a-col :span="22">
                <a-textarea v-model='model.zlwz' rows='4' placeholder='请输入坐落位置'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("zlwz")'></a-icon>
              </a-col>
              <a-icon class='location' type='environment' @click="location()"></a-icon>
            </a-form-model-item>
          </a-col>
          <a-col v-show="false" :span="24">
            <a-form-model-item label='土地面积单位' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjzytdmjdw'>
              <a-col :span="22">
                <a-input v-model='model.sjzytdmjdw' placeholder='土地面积单位' disabled></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjzytdmjdw")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='实际占用土地面积（平方米）' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjzytdmj'>
              <a-col :span="22">
                <a-input-number v-model='model.sjzytdmj' placeholder='请输入实际占用土地面积' style='width: 100%'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjzytdmj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='其中证载使用土地面积（平方米）' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qzpzsymj'>
              <a-col :span="22">
                <a-input-number v-model='model.qzpzsymj' placeholder='请输入其中证载使用面积' style='width: 100%'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("qzpzsymj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col v-show="false" :span="24">
            <a-form-model-item label='建筑面积单位' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjsyjzmjdw'>
              <a-col :span="22">
                <a-input v-model='model.sjsyjzmjdw' placeholder='建筑面积单位' disabled></a-input>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjsyjzmjdw")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='实际使用建筑面积（平方米）' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sjsyjzmj'>
              <a-col :span="22">
                <a-input-number v-model='model.sjsyjzmj' placeholder='请输入实际使用建筑面积' style='width: 100%'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("sjsyjzmj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='其中证载使用建筑面积（平方米）' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qzpzsymj2'>
              <a-col :span="22">
                <a-input-number v-model='model.qzpzsymj2' placeholder='请输入其中证载使用建筑面积' style='width: 100%'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("qzpzsymj2")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='权属起始时间' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qsqssj'>
              <a-col :span="22">
                <j-date placeholder='请选择权属起始时间' v-model='model.qsqssj' style='width: 100%'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("qsqssj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='权属期限' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qsqx'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.qsqx' dictCode='qsqx' placeholder='请选择权属期限'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("qsqx")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='权属到期时间' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qsdqsj'>
              <a-col :span="22">
                <j-date placeholder='请选择权属到期时间' v-model='model.qsdqsj' style='width: 100%' :disabled-date="dateDisabled"
                        :disabled='disableqsqx'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("qsdqsj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>

          <a-col :span="24">
            <a-form-model-item label='担保、抵押、查封情况' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='dbdycfqk'>
              <a-col :span="22">
                <j-multi-select-tag type='list_multi' v-model='model.dbdycfqk' dictCode='dbdycfqk'
                                    placeholder='请选择担保、抵押、查封情况'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("dbdycfqk")'></a-icon>
              </a-col>
              <!-- <span class='example'>示例：无</span>-->
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='出租出借情况' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='czcjqk'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.czcjqk' dictCode='czcjqk' placeholder='请选择出租出借情况'/>
              </a-col>
              <!--                  <a-col :span="2">
                                  <a-icon class='info' type='question-circle-o' @click='info("dbdycfqk")'></a-icon>
                                </a-col>-->
              <!-- <span class='example'>示例：无</span>-->
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='权益受损情况' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='qyssqk'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.qyssqk' dictCode='qyssqk' placeholder='请选择权益受损情况'/>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='土地使用现状' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='tdsyxz'>
              <a-col :span="22">
                <j-dict-select-tag type='list' v-model='model.tdsyxz' dictCode='tdsyxz' placeholder='请选择土地使用现状'/>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("tdsyxz")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <!--  <a-col :span="24">
<a-form-model-item label="意向盘活方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxphfs">
<a-col :span="22">
<j-dict-select-tag type="list" v-model="model.yxphfs" :disabled='uploadDisabled' dictCode="yxphfs" placeholder="请选择意向盘活方式" />
</a-col>
<a-col :span="2">
<a-icon class='info' type='question-circle-o' @click='info("yxphfs")'></a-icon>
</a-col>
</a-form-model-item>
            </a-col>
              <a-col :span="24">
<a-form-model-item label="意向盘活主体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yxphzt">
<a-col :span="22">
<j-dict-select-tag type="list" v-model="model.yxphzt" :disabled='uploadDisabled' dictCode="yxphzt" placeholder="请选择意向盘活主体" />
</a-col>
<a-col :span="2">
<a-icon class='info' type='question-circle-o' @click='info("yxphzt")'></a-icon>
</a-col>
</a-form-model-item>
              </a-col>-->
          <a-col :span="24">
            <a-form-model-item label="闲置低效用地照片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xczp">
              <a-col :span="22">
                <j-image-upload isMultiple v-model="model.xczp" :disabled='uploadDisabled'></j-image-upload>
              </a-col>
            </a-form-model-item>
          </a-col>


          <a-col :span="24">
            <!--   <a-form-model-item label="统一社会信用代码证书" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tyshxydmzs">
                 <a-col :span="22">
                 <j-upload v-model='model.tyshxydmzs'></j-upload>
                 </a-col>
                 <a-col :span="2">
                   <a-icon class='info' type='question-circle-o' @click='info("tyshxydmzs")'></a-icon>
                 </a-col>
               </a-form-model-item>-->
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="土地资产权属证明材料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tdzcqszmcl">

              <j-upload v-model='model.tdzcqszmcl'></j-upload>
              <a-col :span="22">

              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("tdzcqszmcl")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="房屋资产权属证明材料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fwzcqszmcl">
              <a-col :span="22">
                <j-upload v-model='model.fwzcqszmcl'></j-upload>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("fwzcqszmcl")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="坐标位置相关证明材料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zbwzxgzmcl">
              <j-upload v-model='model.zbwzxgzmcl'></j-upload>
              <a-col :span="22">

              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("zbwzxgzmcl")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='其他资料' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='xgwj'>
              <a-col :span="22">
                <j-upload v-model='model.xgwj'></j-upload>
              </a-col>
              <a-col :span="2">
                <a-icon class='info' type='question-circle-o' @click='info("xgwj")'></a-icon>
              </a-col>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label='备注' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='bz'>
              <a-col :span="22">
                <a-textarea style="width:85%" v-model='model.bz' rows='4' placeholder='请输入备注'/>
              </a-col>
            </a-form-model-item>
            <a-form-model-item v-show="false" label='经度' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='lng'>
              <a-col :span="22">
                <a-input style="width:85%" v-model='model.lng' rows='4' placeholder='请输入经度'/>
              </a-col>
            </a-form-model-item>
            <a-form-model-item v-show="false" label='维度' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='lat'>
              <a-col :span="22">
                <a-input style="width:85%" v-model='model.lat' rows='4' placeholder='请输入维度' />
              </a-col>
            </a-form-model-item>

          </a-col>
          <a-col :span="24">
            <a-form-model-item label="审核是否通过" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shzt">
              <j-dict-select-tag type="list" v-model="model.shzt" dictCode="shzt" placeholder="请选择审核是否通过" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="审核意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shyj">
              <a-textarea v-model="model.shyj" rows="4" placeholder="请输入审核意见" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shren">
              <j-dict-select-tag type="list" v-model="model.shren" dictCode="shzt" placeholder="审核人" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <!--    <a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shr">
                  <a-input v-model="model.shr" placeholder="请输入审核人"  ></a-input>
                </a-form-model-item>-->
            <a-form-model-item label="审核日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shrq">
              <j-date placeholder="请选择审核日期" v-model="model.shrq" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
          <!--              </div>-->
        </a-row>

      </a-form-model>
      <JpupMap ref="map" @position="getposition" :lats=this.lat :lngs=this.lng></JpupMap>
    </j-form-container>

  </a-spin>


</template>

<script>

import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
import JPopup from "../../../components/jeecg/JPopup";
import JpupMap from "@views/map/JpupMap";


import moment from 'moment'

export default {
  name: 'QcSsgqzysytdqkForm',
  components: {JPopup, JpupMap},
  props: {
    //表单禁用
    disabled: {
      type: Boolean,
      default: false,
      required: false,

    },
    postion: {},
    toqyxx: {}
  },
  data() {
    let validatexczp = (rule, value, callback) => {
      if (this.model.tdsyxz === "闲置,低效土地" && !value) {
        this.$message.warn('闲置,低效土地需上传现场图片')
        callback(new Error('闲置,低效土地请上传图片'));
      } else {
        callback()
      }
    };
    let validatefwzmcl = (rule, value, callback) => {
      if (this.model.qzpzsymj2 > 0 && !value) {
        this.$message.warn('请上传房屋资产权属证明材料！')
        callback(new Error('请上传房屋资产权属证明材料！'));

      } else {
        callback()
      }
    };
    let validatezjzmj = (rule, value, callback) => {
      if (this.model.sfgyz === "是" && !value) {
        this.$message.warn('必须填写总建筑面积！')
        callback(new Error('必须填写总建筑面积！'));
      } else {
        callback()
      }
    };
    let validateyxph = (rule, value, callback) => {
      if (this.model.tdsyxz === "闲置,低效土地" && !value) {
        this.$message.warn('需要填写意向盘活方式和意向盘活主体！')
        callback(new Error('需要填写意向盘活方式和意向盘活主体！'));
      } else {
        callback()
      }
    };
    let validatelatlng = (rule, value, callback) => {
      if (this.model.lat === " " ||this.model.lng === " "  && !value) {
        this.$message.warn('需要填写意向盘活方式和意向盘活主体！')
        callback(new Error('需要填写意向盘活方式和意向盘活主体！'));
      } else {
        callback()
      }
    };
    return {
      param: {},
      lat: '',
      lng: '',
      disableqsqx: false,
      model: {
        // qsqx:''
        sjsyjzmjdw: '平方米',
        sjzytdmjdw: '平方米',
        fgld: '',
        lng: '',
        lat: '',
        zlwz: ''
      },
      labelCol: {
        xs: {span: 24},
        sm: {span: 5}
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 16}
      },
      confirmLoading: false,
      validatorRules: {
        sjzytdmjdw: [
          {required: true, message: '请选择占用土地单位!'}
        ],
        sjsyjzmjdw: [
          {required: true, message: '请选择建筑面积单位!'}
        ],
        dk: [
          {required: true, message: '请输入地块名称!'}
        ],
        zslx: [
          {required: true, message: '请输入证书类型!'}
        ],
        wjbh: [
          {required: true, message: '请输入证书/合同/文件编号!'}
        ],

        tdsyqr: [
          {required: true, message: '请输入土地使用权人!'}
        ],
        sjzytdmj: [
          {required: true, message: '请输入实际占用土地面积!'},
          {pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'}
        ],
        qzpzsymj: [
          {required: true, message: '请输入其中批准使用面积!'},
          {pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'}
        ],
        sjsyjzmj: [
          {required: true, message: '请输入实际使用建筑面积!'},
          {pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'}
        ],

        xzqh: [
          {
            required: true, message: '请输入行政区划!'
          }
        ],
        czcjqk: [
          {
            required: true, message: '请选择出租出借情况!'
          }
        ],
        qzpzsymj2: [
          {required: true, message: '请输入其中批准使用面积!'},
          {pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'}
        ],
        syqsyfs: [
          {required: true, message: '请输入使用权使用方式!'}
        ],
        zlwz: [
          {required: true, message: '请输入坐落位置!'}
        ],
        sjyt: [
          {required: true, message: '请输入实际用途!'}
        ],
        qsqssj: [
          {required: true, message: '请输入权属起始时间!'}
        ],
        qsdqsj: [
          {required: true, message: '请输入权属到期时间!'}
        ],
        tdsyxz: [
          {required: true, message: '请输入土地使用现状!'}
        ],
        dbdycfqk: [
          {required: true, message: '请输入担保、抵押、查封情况!'}
        ],
        xgwj: [
          {required: false, message: '请输入附件材料!'}
        ],
        tdzcqszmcl: [
          {required: true, message: '请输入土地资产权属证明材料!'},
        ],

        sfgyz: [
          {required: true, message: '请输入是否共用宗!'},
        ],
        fwzcqszmcl: [{
          validator: validatefwzmcl,
        }
        ],
        zbwzxgzmcl: [
          {required: true, message: '请输入坐标位置相关证明材料!'},
        ],
        fwzmcl: [{
          validator: validatefwzmcl,
        }],
        xczp: [{
          validator: validatexczp,
        }],

        zjzmj: [{
          validator: validatezjzmj,
        }],
        yxphfs: [{
          validator: validateyxph,
        }],
        yxphzt: [{
          validator: validateyxph,
        }],
        sjdw: [
          {required: true, message: '请输入上级单位名称!'},
        ],
        tyshxydm: [
          {required: true, message: '请输入统一社会信用编码!'},
        ],
        qyssqk: [
          {required: true, message: '请选择权益受损情况!'},
        ],
        qylx: [
          {required: true, message: '请输入企业类型!'},
        ],
        gyzccgbl: [
          {required: true, message: '请输入国有资产持股比例!'},

        ],
        orgType: [
          {required: true, message: '请输入单位级别!'},
        ],
       /* lat: [
          {required: true, message: '请输入维度!'},
        ],
        lng: [
          {required: true, message: '请输入经度!'},
        ],*/
        tyshxydmzs: [
          {required: true, message: '请输入统一社会信用代码证书!'},
        ],
        sfsjtdzc: [
          {required: true, message: '请输入是否涉及省内土地资产!'},
        ],
        fgld: [
          {required: true, message: '请输入分管领导姓名!'},
        ],
        fgldsjh: [
          {required: true, message: '请输入分管领导手机号!'},
        ],
        tbr: [
          {required: true, message: '请输入联络人姓名!'},
        ],
        sjh: [
          {required: true, message: '请输入手机号!'},
        ],
        pzyt: [{
          required: true, message: '请输入批准用途!'
        }]
      },
      url: {
        add: '/qcsb/qcSsgqzysytdqk/add2',
        edit: '/qcsb/qcSsgqzysytdqk/edit',
        edit1: '/qcsb/qcSsgqzysytdqk/edit1',
        queryById: '/qcsb/qcSsgqzysytdqk/queryById',
        stag:'qcsb/qcSsgqzysytdqk/addStag'
      },
      disabledDate: '',
      isShow: true,
      formInfo: {
        qymc: '以《企业法人营业执照》上的用地单位名称为准。',
        dkmc: "例如：棘洪滩水库、农校宿舍区土地、艾滋病管理区土地。",
        tyshxybm: '填写长度为18 位的用于用地单位身份识别的代码。',
        qylx: '分国有全资公司、国有控股公司。',
        gyzccgbl: '国有投入资本占公司总资本的比例。',
        dk: '',
        wjlx: '',
        sjsyjzmjdw: '根据不动产登记证书、房屋所有权证书及相关权属证明材料的面积单位填写。',
        sjzytdmjdw: '根据不动产登记证书、国有土地使用权证、土地出让合同、划拨决定书及相关权属证明材料的面积单位填写。',
        wjbh: '根据不动产登记证书、国有土地使用权证、土地出让合同、划拨决定书及相关权属证明等材料记录如实填写。',
        tdsyqr: '指不动产权证（或土地使用权证）上记载的土地使用权人；若己获供地批准但未取得土地证的，以《建设用地批准书》中用地单位名称为准；其他无不动产权证（或土地使用权证）的情况，则填《企业法人营业执照》上的用地单位名称。',
        sjzytdmj: '根据实际占用的土地面积据实填写，租用、借用土地不在填报范围。',
        qzpzsymj: '批准使用面积：根据不动产登记证书、国有土地使用权证、土地出让合同、划拨决定书及相关权属证明材料的面积填写。',
        sjsyjzmj: '根据实际使用的建筑面积据实填写，租用、借用建筑面积不在填报范围。',
        qzpzsymj2: '批准使用面积：根据不动产登记证书、房屋所有权证书及相关权属证明材料的面积填写，如无建筑物的可填“0”。',
        zjzmj: '总建筑面积于物业或开发商处获取。',
        sjrjl: '根据相关证书、合同、文件等填写；无相关证书、合同、文件的可根据“容积率=建筑面积/用地面积”进行估算，如无地上建筑物的可填“0”。',
        syqsyfs: '土地使用权人或用地企业取得该地块的方式，分出让、划拨、作价出资、转让四种方式，不包含出租出借情况。',
        zlwz: '根据不动产登记证书、国有土地使用权证、土地出让合同、划拨决定书及相关权属证明等材料记录填写；如无相关权属证明材料的需填制地块坐落详细位置，需具体到乡镇、村、门牌号（示例：山东省XX市XX区（县）XX街道（镇）XX路（村）XX号）。',
        pzyt: '地类（用途）：分国有建设用地、国有农用地、国有未利用地。国有建设用地需填到一级地类，具体为商服用地、工矿仓储用地、住宅用地、公共管理与公共服务用地、特殊用地、交通运输用地、水域及水利设施用地、其他土地。',
        sjyt: '根据不动产登记证书、国有土地使用权证、土地出让合同、划拨决定书及相关权属证明等材料记录填写，如无相关权属证明材料的据实填写。',
        qsqssj: '合法用地的，按供地批准时间填写（以《建设用地批准书》批准时间为准）；属于历史遗留问题的，以认定或到期用地行为时间填写（按相应证明文件，如处罚决定书填写），划拨用地到期时间可填“长期”。',
        qsdqsj: '合法用地的，按供地批准时间填写（以《建设用地批准书》批准时间为准）；属于历史遗留问题的，以认定或到期用地行为时间填写（按相应证明文件，如处罚决定书填写），划拨用地到期时间可填“长期”。',
        tdsyxz: '根据企业当前占有使用土地状态据实填写，具体分为正常使用、闲置低效等类型。\n' +
          '1.闲置土地：\n' +
          '（1）土地使用者依法取得土地使用权后，未经市人民政府或土地行政主管部门同意，超过动工开发日期起满一年未动工开发的。\n' +
          '（2）超过动工开发日期满2年未完成项目投资总额百分之二十五的。\n' +
          '（3）已动工建设，但开发建设面积占应动工开发建设面积不足三分之一或者已投资额占总投资额不足百分二十五，且未经建设主管部门同意，中止开发建设满一年的土地。\n' +
          '（4）以出让方式取得国有建设用地使用权，超过出让合同约定竣工日期一年未竣工的。\n' +
          '2.低效用地：建设用地中的布局散乱、利用粗放、用途不合理、建筑危旧的城镇存量建设用地，权属清晰、不存在争议。\n' +
          '（1）产业转型升级类：国家产业政策规定的禁止类、淘汰类产业用地；不符合安全生产和环保要求的用地；“退二进三”产业用地。 \n' +
          '（2）城镇更新改造类：布局散乱、设施落后，规划确定改造的 老城区、城中村、棚户区、老工业区等。 \n' +
          '（3）用地效益提升类：投资强度、容积率、地均产出强度等控 制指标明显低于地方行业平均水平的产业用地；参照“亩产效益” 评价改革确定的“限制发展类”企业名单认定的产业用地。 \n',
        czmj: '根据企业对外出租（出借）面积情况据实填写。',
        cjmj: '根据企业对外出租（出借）面积情况据实填写。',
        cjksrq: '根据企业对外出租（出借）面积情况据实填写。',
        cjjsrq: '根据企业对外出租（出借）面积情况据实填写。',
        dbdycfqk: '根据土地是否存在担保、抵押、查封等情况，据实填写。若不存在填否。',
        bz: '',
        xgwj: '无相关证件的上传划拨决定书、出让合同。',
        tyshxydmzs: '上传统一社会信用代码证书。',
        tdzcqszmcl: '请上传土地使用权证书、不动产权证书、划拨决定书、批复文件等',
        fwzcqszmcl: '请上传房屋所有权证书、不动产权证书、规划许可证书、竣工许可证书、批复文件等',
        zbwzxgzmcl: '请上传宗地图、红线、勘测定界图、矢量数据等'
      }
    }
  },
  watch: {
    'model.qsqx'(newData, oldData) {

      if (newData === '长期') {
        this.disableqsqx = true
        this.model.qsdqsj = '9999-12-31'
      } else if (newData === '' || newData == null) {
        this.disableqsqx = false
        if (this.model.qsdqsj != '') {

        } else {
          this.model.qsdqsj = moment().format("YYYY-MM-DD");
        }

      } else {

        this.disableqsqx = true;
        let day = parseInt(this.model.qsqssj.slice(8)) - 1;
        let month = parseInt(this.model.qsqssj.slice(5, 7));
        let year = parseInt(this.model.qsqssj.slice(0, 4)) + parseInt(newData);
        this.model.qsdqsj = year + '-' + month + '-' + day;
        console.log(this.model.qsdqsj);

      }
    }
  },

  computed: {
    formDisabled() {
      return this.disabled
    },
    uploadDisabled() {
      if (this.model.tdsyxz === "闲置,低效土地") {
        return false;
      } else {
        return true
      }
    },
    zjzmjDisabled() {
      if (this.model.sfgyz === "是") {
        return false;
      } else {
        return true
      }
    }
  },
  created() {
    //备份model原始值
    this.modelDefault = JSON.parse(JSON.stringify(this.model))
  },
  methods: {
    getposition(val) {
      this.model.lng = val.lng;
      this.model.lat = val.lat;
      this.model.zlwz = val.address
    },
    location() {
      this.lng = this.model.lng
      this.lat = this.model.lat
      console.log("点击", this.lng)
      this.$refs.map.visible = true;
    },
    change(val) {
      if (val === '国有全资公司') {
        this.model.gyzccgbl = 100;
        this.blDisable = true;
      } else {
        this.model.gyzccgbl = 0;
        this.blDisable = false;
      }
    },
    add1() {
      if (this.toqyxx.createBy != null) {
        this.model.createBy = this.toqyxx.createBy
      }
      if (this.toqyxx.sjdw != null) {
        this.model.sjdw = this.toqyxx.sjdw
      }
      if (this.toqyxx.tyshxydm != null) {
        this.model.tyshxydm = this.toqyxx.tyshxydm
      }
      if (this.toqyxx.orgType != null) {
        this.model.orgType = this.toqyxx.orgType
      }
      if (this.toqyxx.qylx != null) {
        this.model.qylx = this.toqyxx.qylx
      }
      if (this.toqyxx.sfsjtdzc != null) {
        this.model.sfsjtdzc = this.toqyxx.sfsjtdzc
      }
      if (this.toqyxx.fgldsjh != null) {
        this.model.fgldsjh = this.toqyxx.fgldsjh
      }
      if (this.toqyxx.tbr != null) {
        this.model.tbr = this.toqyxx.tbr
      }
      if (this.toqyxx.sjh != null) {
        this.model.sjh = this.toqyxx.sjh
      }
      if (this.toqyxx.zjh != null) {
        this.model.zjh = this.toqyxx.zjh
      }
      if (this.toqyxx.fgld != null) {
        this.model.fgld = this.toqyxx.fgld
      }
      this.visible = true
    },
    add() {
      this.edit(this.modelDefault)
    },

    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
    },
    edit1(record) {
      this.model = Object.assign({}, record)
      this.visible = true
    },
    //暂存
    stagForm(){
      const that = this
      that.confirmLoading = true
      let httpurl = ''
      let method = ''
      that.model.zczt=1;
      if (!this.model.id) {
        httpurl += this.url.stag
        method = 'post'
      } else {
        httpurl += this.url.stag
        method = 'post'
      }
      httpAction(httpurl, this.model, method).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          that.$emit('ok')
        } else {
          that.$message.warning(res.message)
        }
      }).finally(() => {
        that.confirmLoading = false
      })
    },


    submitForm() {
      if (this.postion.lat != '' && this.postion.lng != '') {
        this.model.lat = this.postion.lat;
        this.model.lng = this.postion.lng;
      };
    /*  if(this.model.lat == '' && this.model.lng == ''){
        this.$info({
          title: '说明',
          content: (<div><p>请点击坐落位置后的定位按钮，选择地块相应位置</p></div>),
          onOk() {
          }
        })
      }*/
      const that = this
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          let startTime = moment(this.model.qsqssj);
          let endTime = moment(this.model.qsdqsj);
          if (endTime.valueOf() < startTime.valueOf()) {
            this.$message.error('请检查权属到期时间是否正确！');
            return
          }
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        }

      })
    },
    submitForm1() {
      if (this.postion.lat != '' && this.postion.lng != '') {
        this.model.lat = this.postion.lat;
        this.model.lng = this.postion.lng;
      };
      /*  if(this.model.lat == '' && this.model.lng == ''){
          this.$info({
            title: '说明',
            content: (<div><p>请点击坐落位置后的定位按钮，选择地块相应位置</p></div>),
            onOk() {
            }
          })
        }*/
      const that = this
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          let startTime = moment(this.model.qsqssj);
          let endTime = moment(this.model.qsdqsj);
          if (endTime.valueOf() < startTime.valueOf()) {
            this.$message.error('请检查权属到期时间是否正确！');
            return
          }
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit1
            method = 'put'
          }
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        }

      })
    },
    popupCallback(value, row) {
      this.model = Object.assign(this.model, row);
    },
    /**
     *点击提示
     */
    info(name) {
      if (name === 'tdsyxz') {
        this.$info({
          title: '说明',
          width: 500,
          content: (<div><h2>根据企业当前占有使用土地状态据实填写，具体分为正常使用、闲置、低效等类型。</h2><h3>1.闲置土地：</h3>
            <p>（1）土地使用者依法取得土地使用权后，未经市人民政府或土地行政主管部门同意，超过动工开发日期起满一年未动工开发的；</p><p>（2）超过动工开发日期满2年未完成项目投资总额百分之二十五的；</p>
            <p>（3）已动工建设，但开发建设面积占应动工开发建设面积不足三分之一或者已投资额占总投资额不足百分二十五，且未经建设主管部门同意，中止开发建设满一年的土地。</p>
            <p>（4）以出让方式取得国有建设用地使用权，超过出让合同约定竣工日期一年未竣工的。</p><p>（5）法律、法规规定的其他情形。</p>
            <h3>2.低效用地：建设用地中的布局散乱、利用粗放、用途不合理、建筑危旧的城镇存量建设用地，权属清晰、不存在争议。</h3><p>（1）产业转型升级类：国家产业政策规定的禁止类、淘汰类产
              业用地；不符合安全生产和环保要求的用地；“退二进三”产业用地。</p><p>（2）城镇更新改造类：布局散乱、设施落后，规划确定改造的 老城区、城中村、棚户区、老工业区等。 </p>
            <p>（3）用地效益提升类：投资强度、容积率、地均产出强度等控 制指标明显低于地方行业平均水平的产业用地；参照“亩产效益” 评价改革确定的“限制发展类”企业名单认定的产业用地。</p>
            <h3>3.其他：请在备注中文字描述。</h3></div>),
          onOk() {
          }
        })
      } else {
        this.$info({
          title: '说明',
          content: (<div><p>{this.formInfo[name]}</p></div>),
          onOk() {
          }
        })
      }

    },
    dateDisabled(val) { // 这里val指日期选择组件可接受的禁用日期 默认传入的是当前日期 并不是日期选择期现在选中的日期
      const startTime = moment(this.model.qsqssj)
      return val.valueOf() < startTime.valueOf() // 禁用这之外的日期
    }
  }
}
</script>
<style lang='less' scoped>

table {
  border: 0px solid #444;
  border-spacing: 0;
  width: 85%;
  height: 85%;
  margin: auto;
}

.example {
  width: 100px;
}

table tr, table th {
  border-bottom: 0px solid #444
}

table td, table th {
  border-right: 0px solid #444;
  border-bottom: 0px solid #444;
  padding: 5px;
  text-align: center;
}

table tr td:last-child {
  border-right: 0
}

table tr:last-child td {
  border-bottom: 0
}

th {
  height: 60px;
  position: relative;
}

td {
  height: 50px;
  width: 50%;
  position: relative;
}

th > div {
  display: flex;
  align-items: center;
}

.info {
  /*position: absolute;
  right: -10%;
  top: 40%;*/
  color: red;
  margin-left: 5px;
}

.location {
  cursor: hand;
  font-size: 16px;
  color: blue;
  margin-left: 5px;
}

.ant-input-number {
  width: 100%;
}
</style>
<style lang='less'>
table .ant-form-item-children {
  display: flex;
  align-items: center;
}

table .ant-form-item-label {
  display: flex;
  justify-content: flex-end;
  line-height: 16px; //这个数值视具体情况而定
  flex: 0 0 23.333333%;
  max-width: 33.33333333%;

  label { //这是关键
    text-align: right;
    //color: #8a8a8a;
    padding-right: 2px;
    font-size: 14px;
    white-space: normal;
    display: inline-block;
    line-height: 32px;

    &:after {
      //content: none !important;      //解决上面的样式label后面会有空格
    }
  }
}


table .ant-form-item {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

table .ant-form-item-control-wrapper {
  flex: 1 1 0;
  max-width: 66.66666667%;
}
</style>