<template>
  <div class="settle-payment">
    <el-form
      ref="ruleFormRef"
      :model="ruleForm"
      :rules="rules"
      label-position="top"
      label-width="150px"
      class="rule-form-orange"
    >
      <el-form-item label="供应商收款账户名" prop="bankAccountName">
        <el-input
          v-model="ruleForm.bankAccountName"
          placeholder="请输入供应商收款账户名" disabled
        />
      </el-form-item>
      <el-form-item label="收款账号" prop="bankAccount">
        <el-input
          v-model="ruleForm.bankAccount"
          placeholder="请输入收款账号" disabled
        />
      </el-form-item>
      <el-form-item label="收款账号开户行" prop="bankName">
        <el-input
          v-model="ruleForm.bankName"
          placeholder="请输入收款账号开户行" disabled
        />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {
        bankName: '',
        bankAccount: '',
        bankAccountName: '',
        id: ''
      },
      rules: {
        bankName: [{ required: true, message: '请输入供应商收款账户名', trigger: 'blur' }],
        bankAccount: [{ required: true, message: '请输入收款账号', trigger: 'blur' }],
        bankAccountName: [{ required: true, message: '请输入收款账号开户行', trigger: 'blur' }]
      }
    }
  },
  watch: {
    'info.mathId': {
      handler(newV) {
        if (newV) {
          Object.keys(this.ruleForm).forEach(key => {
            this.ruleForm[key] = this.info.purchContractSettlePayment[key] || ''
          })
        }
      },
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
.contract-base-info {
}
</style>
