import {
  urbanArea
} from '@/assets/js/districtCode'
export const formRules = () => {
  return [{
      label: '基本信息',
      type: 'divider',
      colWidth: 24,
    }, {
      field: 'cmpCode',
      label: '社会信用代码',
      placeholder: '社会信用代码',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入社会信用代码',
        trigger: 'blur'
      }]
    }, {
      field: 'name',
      label: '门店名称',
      placeholder: '门店名称',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入门店名称',
        trigger: 'blur'
      }]
    }, {
      field: 'contact',
      label: '联系人',
      placeholder: '联系人',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入联系人',
        trigger: 'blur'
      }]
    }, {
      field: 'contactPhone',
      label: '联系人电话',
      placeholder: '联系人电话',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入联系人电话',
        trigger: 'blur'
      }]
    }, {
      field: 'cityRegion',
      type: 'cascader',
      label: '所在城市/地区',
      placeholder: '请选择',
      colWidth: 24,
      rules: [{
        required: true,
        message: '请选择所在城市/地区',
        trigger: 'change,blur'
      }],
      options: urbanArea(),
    }, {
      field: 'address',
      label: '详细地址',
      placeholder: '详细地址',
      type: 'input',
      colWidth: 24,
      rules: [{
        required: true,
        message: '请输入详细地址',
        trigger: 'blur'
      }]
    }, {
      field: 'description',
      label: '描述',
      placeholder: '描述',
      type: 'textarea',
      colWidth: 24,
    }, {
      label: '《燃气经营许可证》信息',
      type: 'divider',
      colWidth: 24,
    }, {
      field: 'certificateNo',
      label: '许可证编号',
      placeholder: '许可证编号',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入许可证编号',
        trigger: 'blur'
      }]
    }, {
      field: 'type',
      label: '经营类别',
      placeholder: '经营类别',
      type: 'select',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入经营类别址',
        trigger: 'blur'
      }],
      options: [{
        value: 9,
        label: '瓶装燃气（液化石油气、城镇用二甲醚）'
      }]
    }, {
      field: 'businessArea',
      label: '经营区域',
      placeholder: '经营区域',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入经营区域',
        trigger: 'blur'
      }]
    }, {
      field: 'legalPerson',
      label: '法人姓名',
      placeholder: '法人姓名',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入法人姓名',
        trigger: 'blur'
      }]
    }, {
      field: 'issueAuthority',
      label: '发证部门',
      placeholder: '发证部门',
      type: 'input',
      colWidth: 12,
      rules: [{
        required: true,
        message: '请输入发证部门',
        trigger: 'blur'
      }]
    }, {
      field: 'issueTime',
      label: '发证时间',
      placeholder: '发证时间',
      type: 'time',
      colWidth: 12,
      rules: [{
        type: 'string',
        required: true,
        message: '请选择发证时间',
        trigger: 'change,blur'
      }]
    }, {
      field: 'startTime',
      label: '开始时间',
      placeholder: '开始时间',
      type: 'time',
      colWidth: 12,
      rules: [{
        type: 'string',
        required: true,
        message: '请选择开始时间',
        trigger: 'change,blur'
      }]
    }, {
      field: 'expireTime',
      label: '证件有效期',
      placeholder: '证件有效期',
      type: 'time',
      colWidth: 12,
      rules: [{
        type: 'string',
        required: true,
        message: '请选择证件有效期',
        trigger: 'change,blur'
      }]
    },
    // {
    //   label: '附件',
    //   type: 'divider',
    //   colWidth: 24,
    // }, {
    //   field: 'T_sn',
    //   label: '营业执照',
    //   type: 'singleUpload',
    //   colWidth: 6,
    //   rules: [{
    //     required: false,
    //     message: '请选择营业执照',
    //     trigger: 'change,blur'
    //   }],
    // }, {
    //   field: 'T_sn',
    //   label: '燃气经营许可证',
    //   type: 'singleUpload',
    //   colWidth: 6,
    //   rules: [{
    //     required: false,
    //     message: '请选择燃气经营许可证',
    //     trigger: 'change,blur'
    //   }],
    // },
  ]
}
export const rules = () => {
  return [{
    field: 'name',
    label: '门店名称',
    colWidth: '200',
    align: 'center',
    fixed: 'left',
  }, {
    field: 'provStore.contact',
    label: '联系人',
    colWidth: '120',
    align: 'center',
  }, {
    field: 'provStore.contactPhone',
    label: '联系电话',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.district',
    label: '所在区/县',
    colWidth: '100',
    align: 'center',
    options: urbanArea(),
  }, {
    field: 'provStore.address',
    label: '地址',
    colWidth: '200',
    align: 'center',
  }, {
    field: 'provStore.lng',
    label: '经度',
    colWidth: '100',
    align: 'center',
  }, {
    field: 'provStore.lat',
    label: '纬度',
    colWidth: '100',
    align: 'center',
  }, {
    field: 'provStore.certificateNo',
    label: '许可证编号',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.type',
    label: '经营类别',
    colWidth: '150',
    align: 'center',
    options: [{
      value: 9,
      label: '瓶装燃气（液化石油气、城镇用二甲醚）'
    }]
  }, {
    field: 'provStore.businessArea',
    label: '经营区域',
    align: 'center',
  }, {
    field: 'provStore.legalPerson',
    label: '法人姓名',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.issueAuthority',
    label: '发证部门',
    colWidth: '200',
    align: 'center',
  }, {
    field: 'provStore.issueTime',
    label: '发证时间',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.startTime',
    label: '开始时间',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.expireTime',
    label: '证件有效期',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.description',
    label: '描述',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'provStore.cmpCode',
    label: '所属企业登记编码',
    colWidth: '150',
    align: 'center',
  }, {
    field: 'action',
    label: '操作',
    colWidth: '360px',
    align: 'center',
    labelButton: [{
      type: 'add',
      label: '新增子级',
      icon: 'el-icon-plus',
      style: 'primary',
    }, {
      type: 'edit',
      label: '修改',
      icon: 'el-icon-edit',
      style: 'primary',
    }, {
      type: 'entry',
      label: '进入',
      style: 'primary',
    }, {
      type: 'logs',
      label: '详情',
      icon: 'el-icon-tickets',
      style: 'info',
    }, {
      type: 'del',
      label: '删除',
      icon: 'el-icon-delete',
      style: 'danger',
    }]
  }]
}
