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


        <a-form-item label="商户名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
          {{model.companyName}}
        </a-form-item>
          
        <a-form-item label="税号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          {{model.dutyParagraph}}
        </a-form-item>

        <a-form-item label="所在地" :labelCol="labelCol" :wrapperCol="wrapperCol">
         {{model.provinceCityCountry}}
        </a-form-item>

        <!--<a-form-item label="营业执照" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
          <!--<img :src="getAvatarView()" :preview="getAvatarView()" alt="营业执照" style="height:124px;max-width:124px"/>-->
        <!--</a-form-item>-->

      </a-form>
    </a-spin>

  </a-modal>
</template>

<script>

  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import JDate from '@/components/jeecg/JDate'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  
  export default {
    name: "HlwCompanyBusinessModal",
    components: {
      JDate,
    },
    data () {
      return {
        form: this.$form.createForm(this),
        title:"操作",
        width:800,
        bodyStyle: {
          paddingTop: '20px',
          paddingBottom:'20px',
          maxHeight: (window.innerHeight * 0.62) + 'px',
          'overflow-y': 'auto'
        },
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        headers: {},
        uploadLoading: false,
        confirmLoading: false,
        validatorRules:{
        name:{rules: [{ required: true, message: '请输入姓名!' }]},
        phone:{rules: [{ required: true, message: '请输入电话!' }]},
        idcardNumber:{rules: [{ required: true, message: '请输入身份证号!' }]},
        gender:{},
        cardNumber:{},
        type:{},
        },
        url: {
          add: "/hwuser/hwUser/add",
          edit: "/hwuser/hwUser/edit",
          fileUpload: window._CONFIG['domianURL'] + '/hpSys/common/ossUpload',
          imgerver: window._CONFIG['imgDomainOssURL']
        }
     
      }
    },
    created () {
    },
    computed: {
      uploadAction: function() {
        return this.url.fileUpload
      }
    },
    methods: {
      add () {
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        if (record.hasOwnProperty('id') && record.businessLicense) {
          this.picUrl = 'Has no pic url yet'
        }
        this.visible = true;
      },
      close () {
        this.visible = false;
      },
      handleCancel () {
        this.close()
      },
      handleOk(){
        this.close()
      },
      // getAvatarView() {
      //   if(this.model.businessLicense){
      //     if( this.model.businessLicense.indexOf("http")!=-1){
      //       return this.model.businessLicense
      //     }else{
      //       return this.url.imgerver + this.model.businessLicense
      //     }
      //   }
      // },

    }
  }
</script>
<style lang="less" scoped>
  .avatar-uploader > .ant-upload {
    width: 104px;
    height: 104px;
  }

  .ant-upload-select-picture-card i {
    font-size: 49px;
    color: #999;
  }

  .ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
  }
</style>