

<template>
  <a-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">

        <a-form-item label=" " :colon="false"  :labelCol="labelCol" :wrapperCol="wrapperCol">
          请使用企业对公账户打款到以下账户：
        </a-form-item>
        <div class="ant-alert ant-alert-info">

          <a-form-item label="公司名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
            樟树市慧灵工XXXXX有限公司
          </a-form-item>

          <a-form-item label="银行卡号" :labelCol="labelCol" :wrapperCol="wrapperCol">
            622848043312345676
          </a-form-item>
          <a-form-item label="开户银行" :labelCol="labelCol" :wrapperCol="wrapperCol">
            中国银行新区宝龙支行
          </a-form-item>
        </div>

      </a-form>
    </a-spin>
    <HlgPaymentCompanyListModal ref="CompanyList" @ok="getCompany"></HlgPaymentCompanyListModal>
  </a-modal>
</template>

<script>

  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import JDate from '@/components/jeecg/JDate'
  import HlgPaymentCompanyListModal from './HlgPaymentCompanyListModal'

  export default {
    name: 'HlgPaymentRechargeModal',
    components: {
      JDate,
      HlgPaymentCompanyListModal
    },
    data() {
      return {
        fileList: [],
        form: this.$form.createForm(this),
        title: '操作',
        width: 800,
        visible: false,
        is_show: true,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },

        confirmLoading: false,
        validatorRules: {
          company_name: { rules: [{ required: true, message: '请输入账户姓名!' }] },
          idcardNumber: { rules: [{ required: true, message: '请输入身份证号!' }] },
          cardNumber: { rules: [{ required: true, message: '请输入银行卡号!' }] },
          bnkflg: { rules: [{ required: true, validator: this.checkBnkflg }] }
          // eacbnk: { rules: [{ required: is_show, message: '请输入他行开户行!' }] },
          // rcveaa: { rules: [{ required: is_show, message: '请输入他行开户地址!' }] }
        },
        url: {
          add: '/hlgpayment/hlgPaymentDetail/add',
          edit: '/hlgpayment/hlgPaymentDetail/edit'
        }

      }
    },
    created() {
    },
    methods: {
      add() {
        this.edit({})
      },
      edit(record) {
        this.form.resetFields()
        this.model = Object.assign({}, record)
        this.visible = true
      },
      close() {
        this.$emit('close')
        this.$destroyAll()
        this.visible = false
      },
      handleOk() {
        const that = this
        // 触发表单验证
        this.form.validateFields((err, values) => {
          if (!err) {

          }
        })
      },

      onSearch() {
        this.$refs.CompanyList.add()
        this.$refs.CompanyList.title = '企业列表'
        this.$refs.CompanyList.disableSubmit = false
      },
      handleChange(value) {
        console.log(value)
      },
      handleCancel() {
        this.close()
      },
      beforeUpload(file) {
        this.fileList = [...this.fileList, file]
        console.log(this.fileList)
        return false
      },
      normFile(info) {
        console.log(info)
        if (info.test) {
          this.$error({
            title: '导入失败',
            content: '单次付款明细不能超过999条',
            okText: '确定'
          })
        }

        if (info.test2) {
          this.$confirm({
            title: '提示',
            content: '您的公司在2019.11.10支付过相同人数相同金额的付款单，是否要继续导入？',
            okText: '继续导入',
            onOk: () => {
              //do something
            },
            onCancel:()=>{
              this.$destroyAll()
            }
          })
        }

      },
      getCompany(data) {
        console.log(data)
      }


    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>