
export function divider(self, value) {
  return {
    label: '',
    span: 24,
    itemHeight: '60px',
    labelCol: { span: 0 },
    wrapperCol: { span: 24 },
    type: () => {
      return self._c('a-divider', { attrs: { orientation: 'left' } }, [self._v(value)])
    },
  }
}
//发货商
import consignee from './consignee'
import shipper from './shipper'





export const viewGetFormList = (self, expData = []) => {
  let inputType = 'txt'
  let searchModalType = 'txt'
  let selectMode = 'txt'
  let e = []
  if (expData.length > 0) {
    e = expData.map((item) => {
      return { ...item }
    })
    e.forEach((item) => {
      let type = item.type
      Object.defineProperty(item, 'type', {
        get() {
          return self.st === 1 ? 'txt' : type
        },
      })
    })
    e = [divider(self, '扩展信息'), ...e]
  }

  let parcelTable = []
  if (self.parcelTable) {
    parcelTable = [
      {
        span: 24,
        itemHeight: 'auto',
        wrapperCol: { span: 24 },
        scopedSlots: { customRender: 'table_2' },
      },
    ]
  }
  //【订单管理】修改订单界面，运单号、货主、订单号、WMS单号 不能修改，置灰显示
  return [
    divider(self, '基本信息'),
    { name: 'shipbillId', label: 'id', hidden: true, value: '' },
    { name: 'status', label: '状态', hidden: true, value: '' },
    {
      name: 'shipbillNo',
      label: '运单号',
      value: '运单号自动生成',
      disabled: true,
      type: inputType,
    },
    {
      name: 'cargoOwnerName',
      label: '所属货主',
      type: 'txt'
    },

    {
      name: 'orderNo',
      label: '订单号',
      type: 'txt',
    },
    {
      name: 'wmsOrderNo',
      label: ' WMS单号',
      type: 'txt',
    },
    {

      name: 'orderType',
      label: '订单类型',
      allowClear: false,
      required: true,
      mode: selectMode,
      type: 'select',
      value: 1,
      get options() {
        //订单类型 数据字典ORDER_TYPE：1普通 2紧急 3加急
        return self.options.ORDER_TYPE
      },
    },


    {
      name: 'deliveryMethodTypeName',
      label: '配送方式',
      type: 'txt',
    },
    {
      name: 'orderBusinessTypeName',
      label: '业务类型',
      type: 'txt',

    },
    {
      name: 'transportTypeName',
      label: '运输模式',
      type: 'txt',
    },
    {
      name: 'temperatureRequirementName',
      label: '温度要求',
      type: 'txt',
    },
    {
      name: 'departmentName',
      label: '所属部门',
      type: 'txt'
    },
    {
      name: 'memo',
      label: '备注',
      type: self.st == 1 ? 'txt' : 'input',
      span: 12,
      labelCol: { span: 3 },
      wrapperCol: { span: 20 },
      value: '',
    },
    divider(self, '时间信息'),
    {
      name: 'orderDate',
      label: '下单时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
    },
    {
      name: 'submitDate',
      label: '提交时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
    },
    {
      name: 'auditDate',
      label: '审核时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
      style: 'margin-right:10%',
    },
    {
      name: 'startDate',
      label: '启运时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
    },
    {
      name: 'deliveryDate',
      label: '送达时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
      style: 'margin-right:40%',
    },
    {
      name: 'receiptDate',
      label: '回单时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
    },
    {
      name: 'originalBackDate',
      label: '正本回单时间',
      type: 'txt',
      value: '',
      format: 'YYYY-MM-DD',
      valueFrom: 'YYYY-MM-DD',
      placeholder: '年/月/日',
      style: 'margin-right:40%',
    },
    {
      name: 'transportAging',
      label: '时效',
      type: 'txt',
      value: '',
      unit: '小时',
      min: 0,
    },
    ...e,
    ...shipper(self), //发货方
    ...consignee(self), //收货方
    {
      span: 24,
      itemHeight: 'auto',
      wrapperCol: { span: 24 },
      scopedSlots: { customRender: 'table' },
    },
    divider(self, '承运信息'),
    {
      name: 'carrierTypeName',
      label: '承运方类型',
      type: 'txt',
      style: 'margin-right:75%',
    },
    {
      label: '司机',
      name: 'driverName',
      type: 'txt',
      get hidden() {
        return self.carrierType !== 2
      },
    },
    {
      type: 'txt',
      name: 'driverPhoneNumber',
      label: '司机手机号',
      get hidden() {
        return self.carrierType !== 2
      },
    },
    {
      type: 'txt',
      get hidden() {
        return self.carrierType !== 2
      },
      name: 'affiliationName',
      label: '隶属机构',
      style: 'margin-right:25%',
    },
    {
      type: 'txt',
      label: '车辆',
      name: 'vehicleName',
      get hidden() {
        return self.carrierType !== 2
      }
    },

    {
      get hidden() {
        return self.carrierType !== 2
      },
      type: 'txt',
      label: '车型',
      name: 'vehicleTypeName'
    },
    {
      get hidden() {
        return self.carrierType !== 2
      },
      type: 'txt',
      label: '装载率',
      // readOnly: true,
      name: 'weightLoadingRate',
    },

    {
      get hidden() {
        return self.carrierType !== 1
      },
      type: 'txt',
      itemHeight: '80px',
      label: '承运商编码',
      name: 'carrierCode',
    },
    {
      get hidden() {
        return self.carrierType !== 1
      },
      type: 'txt',
      itemHeight: '80px',
      name: 'carrierName',
      label: '承运商名称',
    }
  ]
}
