import { upcloud_base_common } from "@/config/serviceSettings";
const src = upcloud_base_common+'/dict/listbytype?dicttypeCodes='
export const columns = [
    {
      dataIndex: 'billno',
      sorter:(a,b)=>(a.billno? a.billno : '').localeCompare((b.billno? b.billno : '')),
      title: '订单编号',
      width: 120
    },
    {
      dataIndex: 'shippername',
      sorter:(a,b)=>(a.shippername? a.shippername : '').localeCompare((b.shippername? b.shippername : '')),
      ellipsis: true,
      width: 200,
      title: '收货单位名称'
    },
    {
      dataIndex: 'remark',
      sorter:(a,b)=>(a.remark? a.remark : '').localeCompare((b.remark? b.remark : '')),
      ellipsis: true,
      width: 100,
      title: '备注'
    },
    {
      dataIndex: 'createby',
      sorter:(a,b)=>(a.createby? a.createby : '').localeCompare((b.createby? b.createby : '')),
      width: 100,
      title: '录入人'
    },
    {
      dataIndex: 'createdate',
      sorter:(a,b)=>(a.createdate? a.createdate : '').localeCompare((b.createdate? b.createdate : '')),
      width: 150,
      title: '录入时间'
    },
    {
      dataIndex: 'billDate',
      sorter:(a,b)=>(a.billDate? a.billDate : '').localeCompare((b.billDate? b.billDate : '')),
      width: 150,
      title: '制单日期'
    },
    {
      dataIndex: 'salespersonName',
      sorter:(a,b)=>(a.salespersonName? a.salespersonName : '').localeCompare((b.salespersonName? b.salespersonName : '')),
      title: '业务员',
      width: 150
    },
    {
      dataIndex: 'billtype',
      sorter:(a,b)=>(a.billtype? a.billtype : '').localeCompare((b.billtype? b.billtype : '')),
      title: '交货类型',
      width: 120,
      remoteUrl: { url: src + 'do_bill_type', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      }
    },
    {
      dataIndex: 'lineCode',
      sorter:(a,b)=>(a.lineCode? a.lineCode : '').localeCompare((b.lineCode? b.lineCode : '')),
      width: 100,
      title: '运输路线编码'
    },
    {
      dataIndex: 'lineName',
      sorter:(a,b)=>(a.lineName? a.lineName : '').localeCompare((b.lineName? b.lineName : '')),
      width: 100,
      title: '运输路线名称'
    },
    {
      dataIndex: 'partlyRed',
      title: '部分红冲状态',
      width: 100,
      customRender: (text, record) => {
        if (text == 1) {
          return '部分红冲'
        } else {
          if(record.isCancelled == 1) {
            return '完全红冲'
          } else {
            return '未红冲'
          }
        }
      },
    sorter:(a,b)=>(a.partlyRed? a.partlyRed : '').localeCompare((b.partlyRed? b.partlyRed : '')),},
  
    {
      dataIndex: 'saleBranchname1',
      sorter:(a,b)=>(a.saleBranchname1? a.saleBranchname1 : '').localeCompare((b.saleBranchname1? b.saleBranchname1 : '')),
      title: '要货部门',
      width: 150,
    },
    {
      dataIndex: 'arrivalMode',
      sorter:(a,b)=>(a.arrivalMode? a.arrivalMode : '').localeCompare((b.arrivalMode? b.arrivalMode : '')),
      title: '提货方式',
      width: 150,
      remoteUrl: { url: src + 'pub_workstage_delivertype', method: 'post' },
      replaceFields: {
        value: 'dictCode',
        label: 'dictName'
      }
    },
    {
      dataIndex: 'shipLineId',
      sorter:(a,b)=>(a.shipLineId? a.shipLineId : '').localeCompare((b.shipLineId? b.shipLineId : '')),
      title: '配送路线',
      width: 150,
    },
    {
      dataIndex: 'attainDate',
      sorter:(a,b)=>(a.attainDate? a.attainDate : '').localeCompare((b.attainDate? b.attainDate : '')),
      title: '预定到货日',
      width: 150,
    },
    {
      dataIndex: 'custPerson',
      sorter:(a,b)=>(a.custPerson? a.custPerson : '').localeCompare((b.custPerson? b.custPerson : '')),
      width: 100,
      title: '收货联系人'
    },
    {
      dataIndex: 'custPersonTel',
      sorter:(a,b)=>(a.custPersonTel? a.custPersonTel : '').localeCompare((b.custPersonTel? b.custPersonTel : '')),
      width: 150,
      title: '收货联系人电话'
    },
    {
      dataIndex: 'receiveAddress',
      sorter:(a,b)=>(a.receiveAddress? a.receiveAddress : '').localeCompare((b.receiveAddress? b.receiveAddress : '')),
      ellipsis: true,
      width: 200,
      title: '收货地址'
    },
    {
      dataIndex: 'receiveCityName',
      sorter:(a,b)=>(a.receiveCityName? a.receiveCityName : '').localeCompare((b.receiveCityName? b.receiveCityName : '')),
      width: 100,
      title: '收货市'
    },
    {
      dataIndex: 'receiveCityNo',
      sorter:(a,b)=>(a.receiveCityNo? a.receiveCityNo : '').localeCompare((b.receiveCityNo? b.receiveCityNo : '')),
      width: 100,
      title: '收货市编号'
    },
  
    {
      dataIndex: 'receiveDistrictNo',
      sorter:(a,b)=>(a.receiveDistrictNo? a.receiveDistrictNo : '').localeCompare((b.receiveDistrictNo? b.receiveDistrictNo : '')),
      width: 120,
      title: '收货区/县编号'
    },
    {
      dataIndex: 'shippercode',
      sorter:(a,b)=>(a.shippercode? a.shippercode : '').localeCompare((b.shippercode? b.shippercode : '')),
      width: 100,
      title: '收货单位类型'
    },
    {
      dataIndex: 'shipTerm',
      sorter:(a,b)=>(a.shipTerm? a.shipTerm : '').localeCompare((b.shipTerm? b.shipTerm : '')),
      width: 100,
      title: '运输条件'
    },
    {
      dataIndex: 'priorityLevel',
      sorter:(a,b)=>(a.priorityLevel? a.priorityLevel : '').localeCompare((b.priorityLevel? b.priorityLevel : '')),
      width: 120,
      title: '订单紧急等级'
    },
    {
      dataIndex: 'paymentdaytype',
      sorter:(a,b)=>(a.paymentdaytype? a.paymentdaytype : '').localeCompare((b.paymentdaytype? b.paymentdaytype : '')),
      ellipsis: true,
      width: 100,
      title: '账期类型',
    },
    {
      dataIndex: 'salesContrNumb',
      sorter:(a,b)=>(a.salesContrNumb? a.salesContrNumb : '').localeCompare((b.salesContrNumb? b.salesContrNumb : '')),
      title: '购销合同号',
      width: 150,
    },
    {
      dataIndex: 'carrierName',
      sorter:(a,b)=>(a.carrierName? a.carrierName : '').localeCompare((b.carrierName? b.carrierName : '')),
      ellipsis: true,
      title: '承运商名称',
      width: 100,
    },
    {
      dataIndex: 'advdeliverydate',
      sorter:(a,b)=>(a.advdeliverydate? a.advdeliverydate : '').localeCompare((b.advdeliverydate? b.advdeliverydate : '')),
      title: '预约送货日期',
      width: 200,
    },
    {
      dataIndex: 'branchAddress',
      sorter:(a,b)=>(a.branchAddress? a.branchAddress : '').localeCompare((b.branchAddress? b.branchAddress : '')),
      title: '出库仓库详细地址',
      width: 150,
    },
    {
      dataIndex: 'saleBranchname',
      sorter:(a,b)=>(a.saleBranchname? a.saleBranchname : '').localeCompare((b.saleBranchname? b.saleBranchname : '')),
      title: '部门',
      width: 100,
    },
    {
      dataIndex: 'branchAddress10',
      sorter:(a,b)=>(a.branchAddress10? a.branchAddress10 : '').localeCompare((b.branchAddress10? b.branchAddress10 : '')),
      title: '客户采购计划单号',
      width: 200,
    },
    {
      dataIndex: 'branchAddress11',
      sorter:(a,b)=>(a.branchAddress11? a.branchAddress11 : '').localeCompare((b.branchAddress11? b.branchAddress11 : '')),
      title: '要货业务员',
      width: 100,
    },
    {
      dataIndex: 'branchAddress12',
      sorter:(a,b)=>(a.branchAddress12? a.branchAddress12 : '').localeCompare((b.branchAddress12? b.branchAddress12 : '')),
      title: '品规数',
      width: 100,
    },
    {
      dataIndex: 'branchAddress13',
      sorter:(a,b)=>(a.branchAddress13? a.branchAddress13 : '').localeCompare((b.branchAddress13? b.branchAddress13 : '')),
      title: '零货品规数',
      width: 100,
    },
    {
      dataIndex: 'brancharea',
      sorter:(a,b)=>(a.brancharea? a.brancharea : '').localeCompare((b.brancharea? b.brancharea : '')),
      title: '出库仓库库区',
      width: 150,
    },
    {
      dataIndex: 'branchcode',
      sorter:(a,b)=>(a.branchcode? a.branchcode : '').localeCompare((b.branchcode? b.branchcode : '')),
      width: 100,
      title: '出库仓库编号'
    },
    {
      dataIndex: 'branchname',
      sorter:(a,b)=>(a.branchname? a.branchname : '').localeCompare((b.branchname? b.branchname : '')),
      width: 100,
      title: '出库仓库名称'
    },
    {
      dataIndex: 'closedReason',
      sorter:(a,b)=>(a.closedReason? a.closedReason : '').localeCompare((b.closedReason? b.closedReason : '')),
      width: 100,
      title: '作废原因'
    },
    {
      dataIndex: 'containersNum',
      sorter:(a,b)=>(a.containersNum? a.containersNum : '').localeCompare((b.containersNum? b.containersNum : '')),
      width: 100,
      title: '包装数量'
    },
    {
      dataIndex: 'totBoxNum',
      sorter:(a,b)=>(a.totBoxNum? a.totBoxNum : '').localeCompare((b.totBoxNum? b.totBoxNum : '')),
      width: 100,
      title: '总拼箱数'
    },
    {
      dataIndex: 'totPcs',
      sorter:(a,b)=>(a.totPcs? a.totPcs : '').localeCompare((b.totPcs? b.totPcs : '')),
      width: 100,
      title: '总件数'
    },
    {
      dataIndex: 'totQty',
      sorter:(a,b)=>(a.totQty? a.totQty : '').localeCompare((b.totQty? b.totQty : '')),
      width: 100,
      title: '折合件数'
    },
    {
      dataIndex: 'totVolume',
      sorter:(a,b)=>(a.totVolume? a.totVolume : '').localeCompare((b.totVolume? b.totVolume : '')),
      width: 100,
      title: '总体积'
    },
    {
      dataIndex: 'totWeight',
      sorter:(a,b)=>(a.totWeight? a.totWeight : '').localeCompare((b.totWeight? b.totWeight : '')),
      width: 100,
      title: '总重量'
    },
    {
      dataIndex: 'totamt',
      sorter:(a,b)=>(a.totamt? a.totamt : '').localeCompare((b.totamt? b.totamt : '')),
      width: 100,
      title: '总含税金额'
    },
    {
      dataIndex: 'totnetamt',
      sorter:(a,b)=>(a.totnetamt? a.totnetamt : '').localeCompare((b.totnetamt? b.totnetamt : '')),
      width: 100,
      title: '总未税金额'
    },
    {
      dataIndex: 'branchareacode',
      sorter:(a,b)=>(a.branchareacode? a.branchareacode : '').localeCompare((b.branchareacode? b.branchareacode : '')),
      width: 150,
      title: '出库仓库库区编码'
    },
  
    {
      dataIndex: 'carriercode',
      sorter:(a,b)=>(a.carriercode? a.carriercode : '').localeCompare((b.carriercode? b.carriercode : '')),
      width: 100,
      title: '物流商编码'
    },
    {
      dataIndex: 'salespersonCode',
      sorter:(a,b)=>(a.salespersonCode? a.salespersonCode : '').localeCompare((b.salespersonCode? b.salespersonCode : '')),
      width: 100,
      title: '业务员编码'
    },
    {
      dataIndex: 'excReason',
      sorter:(a,b)=>(a.excReason? a.excReason : '').localeCompare((b.excReason? b.excReason : '')),
      width: 100,
      title: '异常原因'
    },
    {
      dataIndex: 'status',
      sorter:(a,b)=>(a.status? a.status : '').localeCompare((b.status? b.status : '')),
      width: 100,
      title: '状态',
      scopedSlots: { customRender: 'isEnable' }
    },
    {
      dataIndex: 'consignorcode',
      sorter:(a,b)=>(a.consignorcode? a.consignorcode : '').localeCompare((b.consignorcode? b.consignorcode : '')),
      width: 100,
      title: '货主编码'
    },
    {
      dataIndex: 'consignorname',
      sorter:(a,b)=>(a.consignorname? a.consignorname : '').localeCompare((b.consignorname? b.consignorname : '')),
      title: '货主名称',
      width: 200,
      ellipsis: true
    },
    {
      dataIndex: 'action',
      title: '操作',
      scopedSlots: { customRender: 'action' },
      width: 140,
      fixed: 'right'
    }
  ]

export const singleColumns = [
    {
      type: 'txt',
      dataIndex: 'itemHealthCategory',
      width: '100px',
      title: '商品大类'
    },
    {
      type: 'txt',
      width: '150px',
      dataIndex: 'itemcode',
      title: '商品编号'
    },
    {
      type: 'txt',
      width: '200px',
      dataIndex: 'itemname',
      ellipsis: true,
      title: '商品名称',
      width: '200px'
    },
    {
      type: 'txt',
      dataIndex: 'itemSpecs',
      title: '商品规格',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'itemHealthListedLicensor',
      width: '150px',
      title: '上市许可持有人'
    },
    {
      type: 'txt',
      dataIndex: 'manufacturer',
      width: '200px',
      title: '生产厂家',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'productionPlace',
      title: '产地',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'itemHealthRegisterNbr',
      width: '150px',
      title: '注册证号'
    },
    {
      type: 'txt',
      dataIndex: 'packUnits',
      title: '包装单位',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'lotNo',
      title: '批号',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'pdateFrom',
      title: '生产日期',
      width: '150px'
    },
    {
      type: 'edit',
      dataIndex: 'itemQty',
      title: '数量',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'itemPcs',
      title: '件数',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'itemOdd',
      title: '零数',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'packTypeNum',
      title: '包装数量',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'approvalNumber',
      title: '批准文号',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'amt',
      title: '含税金额',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'batchNo',
      title: '批次号',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'closedReason',
      title: '作废原因',
      width: '150px'
    },
    {
      type: 'txt',
      dataIndex: 'colorCode',
      title: '颜色',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'consignorname',
      width: '200px',
      title: '货主名称'
    },
    {
      type: 'txt',
      dataIndex: 'freeQty',
      title: '赠品数量',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'itemVolume',
      title: '体积',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'machType',
      title: '加工类型',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'price',
      title: '含税单价',
      width: '100px'
    },
  
    {
      type: 'txt',
      dataIndex: 'sizeCode',
      title: '尺寸',
      width: '80px'
    },
    {
      type: 'txt',
      dataIndex: 'tniAmt',
      title: '未税金额',
      width: '100px'
    },
    {
      type: 'txt',
      dataIndex: 'tniPrice',
      title: '未税单价',
      width: '100px'
    },
    {
      type: 'txt',
      width: '150px',
      dataIndex: 'typeCode',
      title: '商品大类编码'
    },
    {
      type: 'txt',
      width: '150px',
      dataIndex: 'typeName',
      title: '商品大类名称'
    },
    {
      type: 'txt',
      width: '150px',
      dataIndex: 'validUntil',
      title: '有效期至'
    },
    {
      type: 'txt',
      width: '150px',
      dataIndex: 'vendorItemcode',
      title: '供应商商品编号'
    },
    {
      type: 'txt',
      dataIndex: 'itemHealthIsDouble',
      width: '150px',
      title: '是否双人复核',
      customRender: (text, record) => {
        if (text == '0') {
          return '单人'
        } else if (text == '1') {
          return '双人'
        }
      }
    },
    { type: 'txt', dataIndex: 'specification', width: '100px', title: '商品规格' },
    { type: 'txt', dataIndex: 'itemHealthApprovalNbr', width: '100px', title: '批准文号' },
    {
      type: 'txt',
      dataIndex: 'isCaseOrPiece',
      width: '100px',
      title: '整散标志',
      customRender: (text, record) => {
        if (text == '0') {
          return '整散合一'
        } else if (text == '1') {
          return '整散分离'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'itemHealthSuperviseflag',
      width: '100px',
      title: '是否监管',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'itemIsValuable',
      width: '100px',
      title: '是否贵重商品',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'itemIsFragile',
      width: '100px',
      title: '是否易碎',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'isBacteria',
      width: '100px',
      title: '是否无菌',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'isDelegate',
      width: '100px',
      title: '是否委托生产',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    {
      type: 'txt',
      dataIndex: 'isHosted',
      width: '100px',
      title: '商品是否代管',
      customRender: (text, record) => {
        if (text == '0') {
          return '否'
        } else if (text == '1') {
          return '是'
        }
      }
    },
    { type: 'txt', dataIndex: 'itemAssistantCode', width: '100px', title: '助记码' },
    { type: 'txt', dataIndex: 'cargoOwnerCode', width: '100px', title: '货主编码' },
    { type: 'txt', dataIndex: 'countryOriginId', width: '150px', title: '产地' },
    { type: 'txt', dataIndex: 'itemHealthProduceLicense', width: '150px', title: '生产企业许可证号' },
    { type: 'txt', dataIndex: 'caseConversionRate', width: '100px', title: '包装数量' },
    { type: 'txt', dataIndex: 'itemHealthRecordNbr', width: '100px', title: '备案号' },
    { type: 'txt', dataIndex: 'volume', width: '100px', title: '箱体积' },
    { type: 'txt', dataIndex: 'weight', width: '100px', title: '箱重量' },
    {
      dataIndex: 'action',
      title: '操作',
      scopedSlots: { customRender: 'action' },
      width: 140,
      fixed: 'right'
    }
  ]