// 货主管理配置
import { upcloud_base_common } from '@/config/serviceSettings'
const src = upcloud_base_common + '/dict/listbytype?dicttypeCodes='
//新增字段
let ColConfig = {
  labelCol: { span: 16 },
  wrapperCol: { span: 8 }
}
const newfield = [
  // 1、增加字段：是否商品拦截。
  {
    type: 'SwitchValue',
    name: 'isItemIntercept',
    ...ColConfig,
    span: 6,
    label: '是否商品拦截',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ],
    on: {
      change(value) {}
    }
  },

  // 2、增加字段：是否供应商拦截。
  {
    type: 'SwitchValue',
    name: 'isSupplierIntercept',
    ...ColConfig,
    span: 6,
    label: '是否供应商拦截',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 3、增加字段：是否客户拦截。
  {
    type: 'SwitchValue',
    name: 'isCustomerIntercept',
    ...ColConfig,
    span: 6,
    label: '是否客户拦截',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 4、增加字段：入库是否扫码。
  {
    type: 'SwitchValue',
    name: 'isInstockScanCode',
    ...ColConfig,
    span: 6,
    label: '入库是否扫码',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 5、增加字段：出库是否扫码。
  {
    type: 'SwitchValue',
    name: 'isOutstockScanCode',
    ...ColConfig,
    span: 6,
    label: '出库是否扫码',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 6、增加字段：是否允许多次收货。
  {
    type: 'SwitchValue',
    name: 'isMtlRcv',
    span: 6,
    label: '是否允许多次收货',
    ...ColConfig,
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 7、增加字段：是否允许代管入库。
  {
    type: 'SwitchValue',
    name: 'isHostedRcv',
    ...ColConfig,
    span: 6,
    label: '是否允许代管入库',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 8、增加字段：ERP下传的移库是否可以驳回。
  {
    type: 'SwitchValue',
    name: 'isMoveReject',
    span: 6,
    label: 'ERP下传的移库是否可以驳回',
    ...ColConfig,
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },
  {
    type: 'SwitchValue',
    name: 'isErpCheckReturn',
    span: 6,
    label: 'ERP审核后的移库单是否回传',
    ...ColConfig,
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 9、增加字段：是否对接码上放心平台。
  {
    type: 'SwitchValue',
    name: 'isCodeSecurePlat',
    ...ColConfig,
    span: 6,
    label: '是否对接码上放心平台',
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },

  // 10、增加字段：批号个数上限
  {
    type: 'input',
    name: 'lotNumUpper',
    labelCol: { span: 9 },
    wrapperColl: { span: 5 },
    span: 6,
    label: '批号个数上限',
    value: ''
  },
  {
    type: 'SwitchValue',
    name: 'isMainCargoOwner',
    span: 6,
    label: '是否本部货主',
    ...ColConfig,
    value: 1,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  }
]
const custom = {
  custom: [
    {
      type: 'input',
      name: 'cargoOwnerCode',
      span: 6,
      label: '货主编码',
      //   required: true,
      value: '',
      rules: [{ max: 30, message: '输入框内容过长,最多输入30个字符' }]
    },
    {
      type: 'input',
      name: 'cargoOwnerName',
      span: 6,
      label: '货主名称',
      //   required: true,
      value: '',
      rules: [{ max: 30, message: '输入框内容过长,最多输入30个字符' }]
    },
    {
      type: 'select',
      name: 'cargoOwnerType',
      span: 6,
      label: '货主类型',
      //   required: true,
      value: '',
      autoLoad: true,
      remoteUrl: { url: src + 'cargoowner_type', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      },
      on: {
        change(label, value, rowData, form) {
          //   form.setFieldsValue({
          //     contactName: '123456'
          //   })
        }
      }
    },
    {
      //   required: true,
      type: 'select',
      name: 'status',
      label: '货主状态',
      span: 6,
      value: '',
      options: [
        { label: '待审核', value: 0 },
        { label: '审核通过', value: 1 },
        { label: '驳回', value: 2 },
        { label: '作废', value: 3 }
      ]
    },
    {
      //   required: true,g
      type: 'select',
      name: 'cargoOwnerProp',
      label: '货主属性',
      span: 6,
      value: '',
      options: [
        // 流通,生产
        { label: '流通', value: '0' },
        { label: '生产', value: '1' }
      ]
    },
    {
      type: 'input',
      name: 'zjm',
      span: 6,
      label: '货主助记码',
      // required: true,
      value: '',
      rules: [{ max: 10, message: '输入框内容过长,最多输入10个字符' }]
    },
    {
      type: 'input',
      name: 'industry',
      span: 6,
      label: '所属行业',
      // required: true,
      value: '',
      rules: [{ max: 20, message: '输入框内容过长,最多输入20个字符' }]
    },
    // {
    //   type: 'select',
    //   name: 'enterpriseType',
    //   span: 6,
    //   label: '企业类型',
    //   required: true,
    //   value: '',
    //   autoLoad: true,
    //   remoteUrl: { url: src + 'enterprise_type', method: 'post' },
    //   replaceFields: {
    //     value: 'dictCode',
    //     label: 'dictName'
    //   },
    //   on: {
    //     change(label, value, rowData, form) {
    //     }
    //   }
    // },
    // enterpriseId:"[string] 企业ID"

    // {
    //   type: 'input',
    //   name: 'contactName',
    //   span: 6,
    //   label: '联系人',
    //   value: '',
    //   rules: [{ max: 10, message: '输入框内容过长,最多输入10个字符' }]
    // },
    {
      type: 'input',
      name: 'phone',
      span: 6,
      label: '联系电话',
      value: '',
      rules: [{ max: 20, message: '输入框内容过长,最多输入20个字符' }]
    },
    {
      type: 'input',
      name: 'phoneMobile',
      span: 6,
      label: '手机',
      value: '',
      rules: [{ max: 20, message: '输入框内容过长,最多输入20个字符' }]
    },
    // {
    //   type: 'input',
    //   name: 'bankName',
    //   span: 6,
    //   label: '开户银行',
    //   value: ''
    // },
    {
      type: 'input',
      name: 'bankName',
      span: 6,
      label: '开户银行',
      //   required: true,
      value: '',
      rules: [{ max: 30, message: '输入框内容过长,最多输入30个字符' }]
      //   autoLoad: true,
      //   remoteUrl: { url: src + 'containertype', method: 'post' },
      //   replaceFields: {
      //     value: 'dictCode',
      //     label: 'dictName'
      //   },
      //   on: {
      //     change(label, value, rowData, form) {
      //     }
      //   }
    },
    {
      type: 'input',
      name: 'bankAccountName',
      span: 6,
      label: '开户人',
      value: '',
      rules: [{ max: 10, message: '输入框内容过长,最多输入10个字符' }]
    },
    {
      type: 'input',
      name: 'bankAccountNum',
      span: 6,
      label: '银行账户',
      value: '',
      rules: [{ max: 30, message: '输入框内容过长,最多输入30个字符' }]
    },
    {
      type: 'input',
      name: 'invoiceTitle',
      span: 6,
      label: '发票抬头',
      value: '',
      rules: [{ max: 50, message: '输入框内容过长,最多输入50个字符' }]
    },
    // {
    //   type: 'select',
    //   label: '选择地址',
    //   name: 'address1q',
    //   span: 6,
    //   scopedSlots: { customRender: 'diy' }
    // },
    {
      type: 'input',
      name: 'zipCode',
      span: 6,
      label: '邮编',
      value: '',
      rules: [{ max: 15, message: '输入框内容过长,最多输入15个字符' }]
    },

    {
      type: 'input',
      name: 'address',
      span: 6,
      // labelCol: { span: 1, offset: 1 },
      label: '注册地址',
      value: '',
      rules: [{ max: 100, message: '输入框内容过长,最多输入100个字符' }]
    },

    {
      type: 'input',
      name: 'enterpriseType',
      span: 6,
      // labelCol: { span: 1, offset: 1 },
      label: '企业类型',
      value: '',
      rules: [{ max: 50, message: '输入框内容过长,最多输入100个字符' }]
    },

    {
      type: 'input',
      name: 'contactName',
      span: 6,
      // labelCol: { span: 1, offset: 1 },
      label: '联系人',
      value: '',
      rules: [{ max: 20, message: '输入框内容过长,最多输入100个字符' }]
    },
    {
      type: 'input',
      name: 'email',
      span: 6,
      // labelCol: { span: 1, offset: 1 },
      label: '联系地址',
      value: '',
      rules: [{ max: 100, message: '输入框内容过长,最多输入100个字符' }]
    },

    {
      type: 'textarea',
      name: 'cargoOwnerDesc',
      labelCol: { span: 1 },
      span: 24,
      //   rows: 2,
      label: '备注',
      value: '',
      rules: [{ max: 100, message: '输入框内容过长,最多输入100个字符' }]
      //   list: [
      //     {
      //       type: 'textarea',
      //       name: 'cargoOwnerDesc',
      //       span: 6,
      //       //   labelCol: { span: 3, offset: 1 },
      //       style: {
      //         height: '100px'
      //       },
      //       label: '备注',
      //       value: ''
      //     }
      //   ]
    },
    ...newfield
  ],
  Healthcustom: [
    {
      type: 'select',
      name: 'businessScope',
      span: 6,
      label: '业务范围',
      value: '医疗',

      autoLoad: true,
      remoteUrl: { url: src + 'pub_pharm_code_info_businesstype', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      },
      on: {
        change(label, value, rowData, form) {}
      }
    },
    // businesstype
    {
      type: 'select',
      name: 'isBusinessLicense',
      span: 6,
      label: '是否三证合一',
      value: '1',
      options: [
        { value: '1', label: '是' },
        { value: '0', label: '否' }
      ]
    }
  ],
  HealthScopecolumns: [
    { dataIndex: 'id', title: 'id', hidden: true },
    {
      dataIndex: 'scopeType',
      title: '所属经营范围',
      align: 'center',
      // required: true,
      type: 'select',
      autoLoad: true,
      remoteUrl: { url: src + 'Business_scope', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      },
      on: {
        change({ label, value, rowData, form }) {}
      }
    },
    {
      dataIndex: 'scopeName',
      title: '经营范围名称',
      align: 'center',
      // required: true,
      type: 'select',
      autoLoad: true,
      remoteUrl: { url: src + 'scope_name', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      },
      on: {
        change({ label, value, rowData, form }) {}
      }
    },
    {
      dataIndex: 'scopeCode',
      title: '经营案范围编码',
      align: 'center',
      // required: true,
      type: 'edit',
      rules: [{ max: 50, message: '输入框内容过长,最多输入50个字符' }]
    }
  ],
  HealthLicensecolumns: [
    // {
    //   dataIndex: 'licenseDictId',
    //   title: '证件名称',
    //   align: 'center',
    //   // required: true,
    //   type: 'select',
    //   options: [
    //     { value: 1, label: '是' },
    //     { value: 0, label: '否' }
    //   ]
    // },
    {
      type: 'edit',
      dataIndex: 'licenseName',
      label: '证件名称',
      required: true,
      title: '证件名称',
      rules: {
        type: 'string',
        message: '最大长度不能超过60个',
        max: 60
      }
    },
    {
      dataIndex: 'licenseNumber',
      title: '证件编码',
      align: 'center',
      required: true,
      type: 'edit',
      rules: [{ max: 32, message: '输入框内容过长,最多输入32个字符' }]
      // hidden: true,
    },
    {
      dataIndex: 'licenseState',
      title: '证件状态',
      align: 'center',
      //   required: true,
      type: 'select',
      value: '1',
      options: [
        { value: '1', label: '有效' },
        { value: '0', label: '过期' }
      ]
      // hidden: true,
    },
    {
      dataIndex: 'startAt',
      title: '证件起始日期',
      align: 'center',
      //   required: true,
      width: 200,
      type: 'date'
      // hidden: true,
    },
    {
      dataIndex: 'endAt',
      title: '证件截止日期',
      align: 'center',
      //   required: true,
      width: 200,
      type: 'date'
      // hidden: true,
    },
    {
      dataIndex: 'picUpload',
      title: '图片文件',
      align: 'center',
      // required: true,
      width: 200,
      scopedSlots: { customRender: 'file' }
      // type: 'select'
    }
  ]
}

export default custom
