import {
  startStatus,
  WaybillStatus
} from '@/assets/js/blockSort'
export const employee = () => {
  return [{
    field: 'selection',
    label: '多选',
    align: 'center',
  }, {
    field: 'waybillNo',
    label: '运单号',
    align: 'center',
  }, {
    field: 'status',
    label: '状态',
    align: 'center',
    options: WaybillStatus()
  }, {
    field: 'senderAddressName',
    label: '寄件人',
    align: 'center',
  }, {
    field: 'consigneeAddressName',
    label: '收件人',
    align: 'center',
  }, {
    field: 'createdAt',
    label: '下单时间',
    align: 'center',
  }, {
    field: 'printUser.nickName',
    label: '制单人',
    align: 'center',
  }, {
    field: 'action',
    label: '操作',
    colWidth: '370px',
    align: 'center',
    labelButton: [{
      type: 'pdf',
      label: '下载PDF',
      icon: 'el-icon-download',
      style: 'warning',
    },{
      type: 'logs',
      label: '详情',
      icon: 'el-icon-tickets',
      style: 'success',
    }, {
      type: 'edit',
      label: '编辑',
      icon: 'el-icon-edit',
      style: 'primary',
    }, {
      type: 'send',
      label: '派单',
      icon: 'el-icon-tickets',
      style: 'primary',
    }, {
      type: 'del',
      label: '删除',
      icon: 'el-icon-delete',
      style: 'danger',
    }]
  }]
}

export const formRules = () => {
  return [{
    field: 'temperatureInterval',
    type: 'select',
    label: '温度需求',
    placeholder: '请选择',
    colWidth: 12,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'blur,change'
    }],
    options: [{
        label: '常温',
        value: '常温',
      },
      {
        label: '冷藏(2-8℃℃)',
        value: '冷藏(2-8℃℃)',
      },
      {
        label: '冷藏(0-5℃℃)',
        value: '冷藏(0-5℃℃)',
      },
      {
        label: '冷冻(0℃以下)',
        value: '冷冻(0℃以下)',
      }
    ],
  }, {
    field: 'deliveryCondition',
    type: 'select',
    label: '配送要求',
    placeholder: '请选择',
    colWidth: 12,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'blur,change'
    }],
    options: [{
        label: '保温箱',
        value: '保温箱',
      },
      {
        label: '冷藏车',
        value: '冷藏车',
      },
      {
        label: '航空',
        value: '航空',
      },
      {
        label: '医药整车',
        value: '医药整车',
      }
    ],
  }, {
    field: 'cargoType',
    type: 'select',
    label: '货物类型',
    placeholder: '请选择',
    colWidth: 12,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'blur,change'
    }],
    options: [{
        label: '药品',
        value: '药品',
      },
      {
        label: '试剂',
        value: '试剂',
      },
      {
        label: '血液制品',
        value: '血液制品',
      },
      {
        label: '疫苗',
        value: '疫苗',
      },
      {
        label: '其它',
        value: '其它',
      }
    ],
  }, {
    field: 'customerName',
    type: 'input',
    label: '下单客户',
    placeholder: '请输入',
    colWidth: 12,
    multiple: false,
    rules: [{
      required: false,
      message: '请选择',
      trigger: 'blur,change'
    }],
  }, {
    field: 'remark',
    label: '备注',
    placeholder: '备注',
    type: 'textarea',
    colWidth: 24,
  }, ]
}

export const addressBook = () => {
  return [{
    field: 'name',
    label: '姓名',
    align: 'center',
  }, {
    field: 'phone',
    label: '电话',
    align: 'center',
  }, {
    field: 'region',
    label: '省市区',
    align: 'center',
  }, {
    field: 'address',
    label: '详细地址',
    align: 'center',
  }, ]
}

export const sendList = () => {
  return [{
    field: 'type',
    label: '类型',
    placeholder: '类型',
    type: 'radio',
    colWidth: 24,
    rules: [{
      required: true,
      message: '选择类型',
      trigger: 'blur,change'
    }],
    options: [{
        label: '仓管',
        value: 2,
      },
      {
        label: '司机',
        value: 3,
      },
    ]
  }, {
    field: 'printUserId',
    type: 'searchSelect',
    label: '制单人',
    placeholder: '请选择制单人',
    colWidth: 24,
    multiple: false,
    rules: [{
      required: true,
      message: '请选择制单人',
      trigger: 'blur,change'
    }],
    options: [],
  }]
}
