// "autoPickUpSign (integer, optional)": "自动提货签到 数据字典WHETHER:0否，1是",

// "defaultDeliveryRail (number, optional)": "默认送货围栏(km)",
// "deliveryPicture (integer, optional)": "送货图片 数据字典WHETHER:0否，1是",
// "deliverySign (integer, optional)": "送达签到 数据字典WHETHER:0否，1是",

export const setMainColumns = (self,expData) => {
  return [
    { dataIndex: 'id', title: 'ID', hidden: true },
    { dataIndex: 'code', title: '供应商编码' },
    { dataIndex: 'name', title: '供应商名称' },
    { dataIndex: 'shortName', title: '供应商简称' },
    { dataIndex: 'cargoOwnerName', title: '所属货主' },
    { dataIndex: 'departmentName', title: '部门' },
    {
      dataIndex: 'contractNature',
      title: '合作性质',
      align: 'center',
      customRender: (text, data) => {
        if (Array.isArray(self.options.CONTRACT_NATURE)) {
          let value = self.options.CONTRACT_NATURE.find((item) => item.value === text);
          return value ? value.label : text;
        }
        return text;
      }
    }, //数据字典 CONTRACT_NATURE 1-合同 2-临时"
    {
      dataIndex: 'statusName',
      title: '状态',
      align: 'center',
      customRender: (text, data) => {
        return self._c('a-badge', {
          attrs: {
            color: data.status === 10 ? 'cyan' : 'red',
            text
          }
        });
      }
    },
    { dataIndex: 'taxRegisterNumber', title: '税务登记号' },
    { dataIndex: 'businessLicenseNumber', title: '营业执照号' },
    // { dataIndex: '', title: '道路许可证' },
    { dataIndex: 'memo', title: '备注', width: 120 },
    { dataIndex: 'contact', title: '联系人', width: 120 },
    { dataIndex: 'phoneNumber', title: '手机号', width: 120 },
    { dataIndex: 'landlineNumber', title: '座机号', width: 120 },
    { dataIndex: 'email', title: '邮箱', width: 120 },
    { dataIndex: 'postCode', title: '邮编', width: 120 },

    {
      dataIndex: 'provinceCityDistrict',
      title: '省市区',
      customRender: (text, data) => {
        const { provinceName, cityName, districtName } = data;
        let arr = [provinceName, cityName, districtName].filter((item) => item&&item);
        return arr.join('-');
      }
    },

    { dataIndex: 'address', title: '详细地址' },
    { dataIndex: 'longitude', title: '经度' },
    { dataIndex: 'latitude', title: '纬度' },
    { dataIndex: 'legalman', title: '法人代表' },
    { dataIndex: 'invoice', title: '发票抬头', width: 200 },
    { dataIndex: 'invoiceTaxNumber', title: '税号', width: 200 },
    { dataIndex: 'registeredCapital', title: '注册资金', width: 200 },
    {
      dataIndex: 'bank',
      title: '开户行',
      width: 200,
      customRender: (text, data) => {
        if (Array.isArray(self.options.BANK)) {
          let value = self.options.BANK.find((item) => item.value === text);
          return value ? value.label : text;
        }
        return text;
      }
    }, //字典
    { dataIndex: 'bankAccount', title: '银行账号', width: 200 },
    { dataIndex: 'established', title: '成立时间', width: 200 },
    { dataIndex: 'registeredAddress', title: '注册地址', width: 200 },
    { dataIndex: 'pickUpSignName', title: '提货签到' ,align: 'center'}, //数据字典WHETHER:0否，1是",
    { dataIndex: 'pickUpPictureName', title: '提货图片',align: 'center' }, //数据字典WHETHER:0否，1是"
    { dataIndex: 'defaultPickUpRail', title: '默认提货围栏(KM)',align: 'center' },
    { dataIndex: 'deliverySignName', title: '送达签到' ,align: 'center'}, // 数据字典WHETHER:0否，1是",
    { dataIndex: 'deliveryPictureName', title: '送达图片',align: 'center' },
    { dataIndex: 'defaultDeliveryRail', title: '默认送达围栏(km)',align: 'center' },
    ...expData,
    { dataIndex: 'createperson', title: '创建人', width: 100 },
    { dataIndex: 'createtime', title: '创建时间', width: 150 },
    { dataIndex: 'updateperson', title: '修改人', width: 100 },
    { dataIndex: 'updatetime', title: '修改时间', width: 150 },

    {
      key: 'operation',
      title: '操作',
      width: 240,
      fixed: 'right',
      align: 'center',
      scopedSlots: { customRender: 'operation' }
    }
  ];
};
