<template>
  <div class="cmain">
    <el-form ref="form" :model="form" :rules="rules" label-width="110px">
      <div class="bos">
        <div class="lab">
          <div class="bsg"></div>
          <div class="tit">企业信息</div>
        </div>
        <el-form-item label="企业名称" prop="companyName">
          <el-input v-model="form.companyName" :disabled="param.detail" clearable />
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="企业负责人" prop="director">
              <el-input v-model="form.director" clearable :disabled="param.detail" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号" prop="phone">
              <el-input v-model="form.phone" clearable :disabled="param.detail" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="联系地址" prop="address">
              <el-input type="textarea" v-model="form.address" rows="4" clearable :disabled="param.detail" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="营业执照" prop="business">
              <ImageUpload v-model="form.business" :isShowTip="false" :limit="1" :read="param.detail"></ImageUpload>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="bos">
        <div class="lab">
          <div class="bsg"></div>
          <div class="tit">对公账户信息</div>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="开户行" prop="bankName">
              <el-input v-model="form.bankName" :disabled="param.detail" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="对公账号" prop="bankAccount">
              <el-input v-model="form.bankAccount" :disabled="param.detail" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="开户许可证" prop="b1">
          <ImageUpload v-model="form.b1" :isShowTip="false" :limit="1" :read="param.detail"></ImageUpload>
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {},
      rules: {
        companyName: [{ required: true, message: '不能为空', trigger: 'blur' }],
        director: [{ required: true, message: '不能为空', trigger: 'blur' }],
        phone: [{ required: true, message: '不能为空', trigger: 'blur' }],
        address: [{ required: true, message: '不能为空', trigger: 'blur' }],
        business: [{ required: true, message: '不能为空', trigger: 'blur' }],
        bankName: [{ required: true, message: '不能为空', trigger: 'blur' }],
        bankAccount: [{ required: true, message: '不能为空', trigger: 'blur' }],
        b1: [{ required: true, message: '不能为空', trigger: 'blur' }]
      }
    };
  },
  props: {
    param: {
      type: Object,
      default: () => {
        return {};
      }
    },
    layerid: {
      type: String
    }
  },
  mounted() {
    if (this.param.id) {
      this.ajax({ url: '/work/company/index' }).then((response) => {
        this.form = response.data;
      });
    }
  },
  methods: {}
};
</script>
