import { upcloud_base_wh_outbound } from "@/config/serviceSettings";

const baseUrl = upcloud_base_wh_outbound;
import moment from "moment";
// const baseUrl = '/wrb1'
import { remote } from "@/views/EIS/remote/index.js";

const config = function (that) {
  return {
    remoteUrl: {
      url: baseUrl + "/wave/monitor-data",
      headers: {
        "Content-Type": "application/JSON",
      },
      method: "post",
    },
    items: [
      {
        span: 8,
        type: "row",
        label: "波次日期",
        // required: true,
        type: "date",
        name: "waveDate",
        placeholder: "请输入开始日期",
        value: moment().format("YYYY-MM-DD"),
        format: "YYYY-MM-DD",
        // showTime: true,
        style: "padding-right:5px;",
      },
      {
        span: 8,
        type: "input",
        name: "waveNo",
        label: "波次号",
        value: "",
        // options: [
        //   { label: "区域", value: 10 },
        //   { label: "接驳口", value: 20 },
        // ],
      },

      {
        span: 8,
        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) => {
                form.resetFields();
              },
            },
          },
        ],
      },
    ],
    columns: [
      {
        dataIndex: "waveNo",
        key: "waveNo",
        align: "center",
        title: "波次号",
      },
      {
        title: "波次创建时间",
        dataIndex: "createDate",
        align: "center",
        key: "createDate",
      },
      {
        title: "订单数",
        dataIndex: "orderWaveNum",
        ellipsis: true,
        align: "center",
        key: "orderWaveNum",
      },
      {
        title: "订单行数",
        key: "numberOfRows",
        ellipsis: true,
        dataIndex: "numberOfRows",
        align: "center",
      },
      {
        title: "挂起(订单)",
        dataIndex: "pendingOrders",
        align: "center",
        ellipsis: true,
        key: "pendingOrders",
      },
      {
        title: "补货（已完成/总应补单量）",
        type: "number",
        key: "replenishmentCompleted",
        ellipsis: true,
        dataIndex: "replenishmentCompleted",
        scopedSlots: { customRender: "replenishmentCompleted" },
        align: "center",
      },

      {
        title: "总应补单量",
        type: "number",
        hidden: true,
        key: "replenishmentAll",
        ellipsis: true,
        dataIndex: "replenishmentAll",
        // scopedSlots: { customRender: "replenishmentAll" },
        align: "center",
      },
      {
        title: "拣货（已完成/总订单数）",
        type: "number",
        key: "pickingCompleted",
        ellipsis: true,
        dataIndex: "pickingCompleted",
        scopedSlots: { customRender: "pickingCompleted" },
        align: "center",
      },
      {
        title: "复核打包（已完成/总订单数）",
        // type: "number",
        key: "reviewPackagingCompleted",
        ellipsis: true,
        dataIndex: "reviewPackagingCompleted",
        scopedSlots: { customRender: "reviewPackagingCompleted" },
        align: "center",
      },

      {
        title: "外复核（已完成/总订单数）",
        dataIndex: "thereView",
        align: "center",
        scopedSlots: { customRender: "thereView" },
        key: "thereView",
      },
      {
        title: "第一笔作业开始时间",
        type: "select",
        dataIndex: "firstStartTime",
        align: "center",
        key: "firstStartTime",
      },
    ],
  };
};

export default config;
