• wangxl's avatar
    333 · b56a1391
    wangxl authored
    b56a1391
edit.vue 2.02 KB
<template>
  <div class="app-content" style="height: 65vh;overflow: auto;">
    <a-spin :spinning="loading" style="width: 100%;height: 100%;">
      <div style="height: calc(100% - 36px);overflow:auto;">
        <info-edit :formData.sync="formData" @load="onLoad" @sub="save" ref="infoEdit" />
      </div>
      <div style="text-align:center;width:100%; height: 36px;">
        <a-button type="primary" @click="submit">保存</a-button>
      </div>
    </a-spin>
  </div>
</template>

<script>

import infoEdit from '@/views/basicSetting/unit/components/infoEdit'
import { getUnitComplete, setUnitComplete } from '@/views/utils/auth'

export default {
  name: "unitInfoEdit2",
  components: {
    infoEdit
  },
  data () {
    return {
      formData: {
        id: null,
        unitName: null,
        unitType: null,
        unitAddress: null,
        linkName: null,
        telephone: null,
        email: null,
        fax: null,
        organizationCode: null,
        registeredAddress: null,
        postCode: null,
        legalPerson: null,
        workforce: null,
        specializedPersonnel: null,
        researchPersonnel: null,
        depositBank: null,
        bankAccount: null,
        depositBankAddress: null,
        interbankNumber: null,
      },
      loading: false
    }
  },
  created () {
    this.getAppUnitInfo()
  },
  methods: {
    getAppUnitInfo () {
      this.loading = true
      this.$api.unit.getAppUnitInfo().then(({ data = {} }) => {
        if (data) {
          this.formData = data.unit
          if (data.isComplete) {
            setUnitComplete(data.isComplete)
            this.$emit('sub', data.isComplete)
          }
        }
        this.loading = false
      }).catch(() => {
        this.loading = false
      })
    },
    submit () {
      this.$refs.infoEdit.submit()
    },
    onLoad (value) {
      this.loading = value
    },
    save (value) {
      this.$emit('sub', value)
    },
  }
}
</script>
<style scoped lang="less">
::v-deep .ant-spin-container {
  width: 100%;
  height: 100%;
}
</style>