<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    okText="保存"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭"
    footer=""
  >
    <!-- 邱东宝 增加modal按钮调整到顶部 1-->
    <template>
      <div style="position: absolute;left: 10%;top:13px;">
        <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;margin-right: 8px">转为填报信息</a-button>
        <a-button @click="handleCancel">关闭</a-button>
        <a-button v-if="!disableSubmit" @click="stagInfo" style="margin-bottom: 0;margin-left: 8px">暂存</a-button>
      </div>

    </template>
    <!--邱东宝 增加modal按钮调整到顶部 end-->
    <apply-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
    <qc-ssgqzysytdqk-form ref="realForm" @ok="submitCallback" :postion="this.model" :toqyxx="this.toDk"
                          :disabled="disa"></qc-ssgqzysytdqk-form>
  </j-modal>
</template>

<script>

import QcSsgqzysytdqkForm from "@views/sydwqcsb/sydwdwzc/modules/QcSsgqzysytdqkForm";
import Map from "@views/map/components/Map";

export default {
  name: 'QcSsgqzysytdqkModal',
  components: {
    QcSsgqzysytdqkForm,
    Map
  },
  props: {
    toDk: {}
  },
  data() {
    return {
      title: '',
      width: 896,
      visible: false,
      disableSubmit: false,

      disa: false,
      model: {
        lng: '',
        lat: ''
      },
      lats: '',
      lngs: ''
    }
  },
  watch: {},
  methods: {
    getposition(val) {
      console.log('传对象', val)
      this.model.lng = val.lng;
      this.model.lat = val.lat;
    },
    add1() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add1();
      })
    },
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add();
      })
    },
    edit(record) {
      /*   this.lats=record.lat;
         this.lngs=record.lng
         console.log(6666666666666,this.lats,this.lngs)*/
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record);
      })
    },

    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      this.disa = true
      this.$refs.realForm.submitForm();
      this.disa = false
    },
    stagInfo(){
      this.$refs.realForm.stagForm();
    },
    submitCallback() {
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel() {
      this.$emit('ok');
      this.close()
    }
  }
}
</script>