import { remote } from '@/views/EIS/remote'

const baseUrl = '/api/eis-xty-master-wz'
const config = {
  remoteUrl: {
    url: baseUrl + '/api/v1/order/history/bill/findAll',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 6,
      type: 'input',
      name: 'orderNo',
      label: '订单号',
      value: '',
    },
    {
      span: 6,
      type: 'input',
      name: 'orderType',
      label: '订单类型',
      value: '',
      options: [
        { value: 0, label: 'eis内部创建' },
        { value: 1, label: 'wms下发' },
      ],
    },
    {
      span: 6,
      type: 'input',
      name: 'wmsTaskId',
      label: 'wms订单任务号',
      value: '',
    },
    {
      span: 6,
      type: 'number',
      name: 'orderPriority',
      label: '订单优先级',
      value: '',
      //   ...remote('eis_cfg_auto_carry_container_type'),
    },

    {
      span: 6,
      type: 'select',
      name: 'orderTaskState',
      label: '订单任务进度',
      value: '',
      //   ...remote('eis_cfg_auto_carry_task_type'),
      options: [
        { value: 0, label: '创建' },
        { value: 10, label: '开始出库' },
        { value: 90, label: '完成' },
        { value: 92, label: '取消或关闭' },
      ],
    },

    {
      label: '创建开始时间',
      span: 6,
      type: 'date',
      name: 'createStartTime',
      placeholder: '请输入开始日期',
      value: '',
      format: 'YYYY-MM-DD HH:mm:ss',
      showTime: true,
    },
    {
      label: '创建完成时间',
      span: 6,
      type: 'date',
      name: 'createEndTime',
      placeholder: '请输入结束日期',
      format: 'YYYY-MM-DD hh:mm:ss',
      value: '',
    },
    {
      label: '完成开始时间',
      span: 6,
      type: 'date',
      name: 'completeStartTime',
      placeholder: '请输入开始日期',
      value: '',
      format: 'YYYY-MM-DD HH:mm:ss',
      showTime: true,
    },
    {
      label: '完成结束时间',
      span: 6,
      type: 'date',
      name: 'completeEndTime',
      placeholder: '请输入结束日期',
      format: 'YYYY-MM-DD hh:mm:ss',
      value: '',
    },
    {
      span: 6,
      type: 'buttonGroup',
      style: { textAlign: 'left', marginLeft: '50px' },
      options: [
        {
          value: '查询',
          icon: 'search',
          btnType: 'primary',
          style: 'margin-right:10px',
          htmlType: 'submit',
        },
        {
          value: '重置',
          icon: 'redo',
          style: 'margin-right:50px',
          on: {
            click: (event, form) => {
              console.log(form)
              form.resetFields()
            },
          },
        },
      ],
    },
  ],
  columns: [
    {
      dataIndex: 'orderNo',
      key: 'orderNo',
      align: 'center',
      ellipsis: true,
      title: '订单号',
    },
    {
      title: 'wms订单任务号',
      dataIndex: 'wmsTaskId',
      ellipsis: true,
      align: 'center',
      key: 'wmsTaskId',
    },
    {
      title: '波次号',
      key: 'waveNo',
      dataIndex: 'waveNo',
      align: 'center',
      //   ...remote('eis_cfg_auto_carry_task_type'),
    },
    {
      title: '订单类型',
      dataIndex: 'orderType',
      align: 'center',
      key: 'orderType',
    },
    {
      title: '订单优先级',
      dataIndex: 'orderPriority',
      align: 'center',
      key: 'orderPriority',
      //   ...remote('eis_cfg_auto_carry_container_type'),
      //   customRender(text) {
      //     text == 80 && (text = '空托盘垛')
      //     text == 90 && (text = '空托盘')
      //     return text
      //   }
    },
    {
      title: '订单任务进度',
      key: 'orderTaskState',
      dataIndex: 'orderTaskState',
      align: 'center',
      customRender(text) {
        text == 0 && (text = '创建')
        text == 10 && (text = '开始出库')
        text == 90 && (text = '完成')
        text == 92 && (text = '取消或关闭')
        return text
      },
      //   ...remote('eis_cfg_auto_carry_task_type'),
    },
    {
      title: '业务类型',
      dataIndex: 'businessType',
      align: 'center',
      key: 'businessType',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      align: 'center',
      key: 'createTime',
    },
    {
      title: '完成时间',
      dataIndex: 'completeTime',
      align: 'center',
      key: 'completeTime',
    },

    {
      title: '操作',
      key: 'operation',
      width: 180,
      scopedSlots: { customRender: 'operation' },
      //   fixed: 'right',
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: null,
    },
    {
      span: 24,
      type: 'number',
      name: 'orderPriority',
      label: '订单优先级',
      value: '',
      //   ...remote('eis_cfg_auto_carry_container_type'),
    },
  ],
  details: {
    capacity: '物料规格',
    chineseName: '商品名称',
    completeQty: '完成数量',
    createTime: '创建时间',
    goodsCode: '商品编码',
    hasOutQty: '已出库数量',
    id: 'id',
    lotId: '批号',
    orderNo: '订单号',
    planQty: '计划数量',
    sfShap: '异形(0 异形 1 标准)',
    status: '状态（0创建 92 取消）',
    wmsTaskId: 'Wms订单任务号',
  },
}
export default config
