import moment from 'moment'
import { upcloud_base_common } from "@/config/serviceSettings";
const config = {
  remoteUrl: {
    url: upcloud_base_common+'/dxilog/page',
    headers: {
      'Content-Type': 'application/JSON'
    },
    method: 'get'
  },
  items: [
    {
      span: 6,
      type: 'select',
      name: 'transFlag',
      label: '传输是否成功',
      options: [
        { label: '全部', value: '' },
        { label: '成功', value: 'Y' },
        { label: '失败', value: 'N' }
      ],
      value: ''
    },
    {
      span: 6,
      type: 'input',
      name: 'transId',
      label: '下发ID',
      value: ''
    },
    {
      span: 6,
      type: 'select',
      name: 'etlType',
      label: '类型',
      options: [
        { label: '全部', value: '' },
        { label: '货主资料', value: 'bases_cargo' },
        { label: '委托生产企业', value: 'bases_cargo_oem' },
        { label: '企业部门', value: 'bases_dept' },
        { label: '供应商资料', value: 'bases_vend' },
        { label: '客户资料', value: 'bases_cust' },
        { label: '商品资料', value: 'bases_item' },
        { label: '地址', value: 'bases_addr' },
        { label: '仓库', value: 'bases_branch' },
        { label: '仓-货主-供应商关系', value: 'ctrl_vend' },
        { label: '仓-货主-客户关系', value: 'ctrl_cust' },
        { label: '仓-货主-商品关系', value: 'ctrl_item' },
        { label: '仓-货主-商品转换关系', value: 'ctrl_carg' },
        { label: 'ASN收货单下传', value: 'in_asn_o2w' },
        { label: 'ASN收货单上传', value: 'in_asn_rcv_w2o' },
        { label: 'ASN上架单回传', value: 'in_asn_w2o' },
        { label: '出库订单下传', value: 'out_do_o2w' },
        { label: '出库订单上传', value: 'out_do_w2o' },
        { label: '盘点损溢单上传', value: 'op_pl_w2o' },
        { label: '盘点损溢OMS审核下传', value: 'op_pl_audit_o2w' },
        { label: '盘点损溢WMS终审上传', value: 'op_pl_audit_w2o' },
        { label: 'OMS损溢单下传', value: 'op_pl_o2w' },
        { label: '移库单上传', value: 'op_mv_w2o' },
        { label: '移库单OMS审核下传', value: 'op_mv_audit_o2w' },
        { label: '移库单WMS审核上传', value: 'op_mv_audit_w2o' },
        { label: 'OMS移库单下传', value: 'op_mv_o2w' },
        { label: 'OMS货主转换单下传', value: 'op_cargo_ex_o2w' },
        { label: 'OMS货主转换单上传', value: 'op_cargo_ex_audit_w2o' },
        { label: '商品批号日期上传', value: 'op_itemlot_w2o' },
        { label: '商品批号日期下传', value: 'op_itemlot_audit_o2w' },
        { label: '商品批号日期修改结果回传', value: 'op_itemlot_audit_w2o' },
        { label: 'OMS批号修改下发', value: 'op_itemlot_o2w' },
        { label: '供应商证照下传', value: 'bases_vend_certificate' },
        { label: '客户证照下传', value: 'bases_cust_certificate' },
        { label: '货主证照下传', value: 'bases_cargo_certificate' },
        { label: '商品证照下传', value: 'bases_item_certificate' },
        { label: '职员资料下传', value: 'base_empyee' },
        { label: '线路资料下传', value: 'bases_route' },
        { label: '监管码扫描信息上传', value: 'gsp_supervision_code' },
        { label: 'WMS不合格品报损(GSP)上传', value: 'gsp_pl_w2o' },
        { label: 'OMS不合格品报损(GSP)下传', value: 'gsp_pl_o2w' },
        { label: 'WMS报损(GSP)上传', value: 'gsp_pl_audit_w2o' },
        { label: 'GSP养护上传', value: 'gsp_upkeep_w2o' },
        { label: 'GSP销毁上传', value: 'gsp_destroy_audit_w2o' },
        { label: 'WMS库存同步', value: 'base_inv_w2o' }
      ],
      value: ''
    },

    {
      span: 6,
      type: 'row',
      label: '起始日期',
      list: [
        {
          type: 'date',
          name: 'startDate',
          placeholder: '请输入开始日期',
          value: moment().format('YYYY-MM-DD'),
          format: 'YYYY-MM-DD',
          style: 'padding-right:5px;'
        },
        {
          type: 'date',
          name: 'endDate',
          placeholder: '请输入结束日期',
          format: 'YYYY-MM-DD',
          value: ''
        }
      ]
    },
    {
      span: 24,
      type: 'buttonGroup',
      style: { textAlign: 'right' },
      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: 'logId',
      key: 'logId',
      align: 'center',
      ellipsis: true,
      title: 'id',
      hidden: true,
      width: 230
    },
    {
      dataIndex: 'etlType',
      key: 'etlType',
      align: 'center',
      ellipsis: true,
      title: '传输类型'
    },
    {
      title: '传输的值',
      dataIndex: 'etlValue',
      align: 'center',
      ellipsis: true,
      key: 'etlValue'
    },
    {
      title: '创建人用户名',
      dataIndex: 'creatorName',
      align: 'center',
      ellipsis: true,
      key: 'creatorName'
      //   customRender(text) {
      //     text == 1 && (text = '出库口')
      //     text == 2 && (text = '在线拣选')
      //     return text
      //   }
    },
    {
      title: '传输是否成功',
      dataIndex: 'transFlag',
      ellipsis: true,
      align: 'center',
      key: 'transFlag',
      customRender(text) {
        text == 'N' && (text = '失败')
        text == 'Y' && (text = '成功')
        return text
      }
    },
    {
      title: '下发ID',
      dataIndex: 'transId',
      ellipsis: true,
      align: 'center',
      key: 'transId'
    },
    {
      title: '创建时间',
      key: 'gmtCreate',
      dataIndex: 'gmtCreate',
      ellipsis: true,
      align: 'center'
      //   customRender(text) {
      //     text == 1 && (text = '存储位')
      //     text == 2 && (text = '工作位')
      //     text == 3 && (text = '输送线点位')
      //     return text
      //   }
    },
    {
      title: '修改时间',
      dataIndex: 'gmtModified',
      ellipsis: true,
      align: 'center',
      key: 'gmtModified'
    },
    {
      title: '备注',
      dataIndex: 'remark',
      ellipsis: true,
      align: 'center',
      key: 'remark'
    }
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'stationNo',
      required: true,
      label: '站台编号',
      value: ''
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: ''
    },
    {
      span: 24,
      type: 'input',
      hidden: true,
      name: 'createTime',
      label: 'createTime',
      value: ''
    },
    {
      span: 24,
      type: 'input',
      name: 'areaNo',
      required: true,
      label: '站台区域',
      value: ''
    },

    {
      span: 24,
      type: 'select',
      required: true,
      name: 'type',
      label: '站台类型',
      value: 1,
      options: [
        { label: '出库口', value: 1 },
        { label: '在线拣选', value: 2 }
      ]
    },
    {
      span: 24,
      type: 'radio',
      required: true,
      name: 'isLock',
      label: '是否锁定',
      value: 0,
      options: [
        {
          value: 0,
          label: '开启'
        },
        {
          value: 1,
          label: '关闭'
        }
      ]
    },
    {
      span: 24,
      type: 'radio',
      name: 'claim',
      required: true,
      label: '是否索取',
      value: 1,
      options: [
        {
          value: 0,
          label: '不索取'
        },
        {
          value: 1,
          label: '索取'
        }
      ]
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间'
  }
}
export default config
