<template>
  <div>
    <zj-form-container ref="formRef" :formData="formData" :formRules="formRules">
      <zj-form-module title="基础信息" label-width="110px" :formData="formData" :formItems="formItems" :column="3">
      </zj-form-module>
    </zj-form-container>
    <div v-if="type === 0 || type === 1" style="text-align: right">
      <!-- <el-button size="mini" @click="submit">确定</el-button>
      <el-button size="mini" @click="reset">重置</el-button> -->
    </div>
  </div>
</template>

<script>
import { workerApplyDetail } from '@/api/difficultyExpenseApproval.js'
import { dateFormat } from '@/utils/util'
import pagingTransfer from '@/components/paging-transfer.vue'
import { EventBus } from '@/utils/eventBus'
import { required } from '@/components/template/rules_verify.js'
import { getWebsit } from '@/api/customerManagement.js'
export default {
  props: {
    type: {
      type: Number,
      default: null
    },
    item: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      disabled: this.type === 2,
      formData: {},
      formRules: {}
    }
  },
  computed: {
    formItems() {
      return []
    }
  },

  created() {
    // 获取详情
    if (this.type !== 0) {
      workerApplyDetail({
        id: this.item.id
      }).then(res => {
        this.formData = { ...res.data }
      })
    }
  },
  methods: {
    submit() {
      this.$refs['formRef'].validate(valid => {
        if (valid) {
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    reset() {
      Object.assign(this.$data, this.$options.data())
    }
  }
}
</script>

<style lang="scss" scoped></style>
