import { QN_BASEURL } from "../serviceSettings";
const baseUrl = QN_BASEURL;

const config = function (that) {
  return {
    remoteUrl: {
      url: baseUrl + "/api/v1/pc/allotmentTaskRecordList",
      headers: {
        "Content-Type": "application/JSON",
      },
      method: "post",
    },
    items: [
      {
        span: 8,
        type: "input",
        name: "billNo",
        label: "订单编号",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "id",
        label: "任务汇总ID",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "itemId",
        label: "商品ID",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "itemName",
        label: "商品名称",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "itemCode",
        label: "商品条码",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "lotNo",
        label: "批号",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "logeGirdNo",
        label: "落格格口号",
        value: "",
      },
      {
        span: 8,
        type: "input",
        name: "wcsTaskId",
        label: "wms-taskid",
        value: "",
      },
      {
        span: 8,
        type: "select",
        name: "sendStatus",
        label: "下发mcs状态",
        value: "",
        options: [
          //  0未发送 1已发送 2发送失败
          {
            value: 0,
            label: "未发送",
          },
          {
            value: 1,
            label: "已发送",
          },
          {
            value: 2,
            label: "发送失败",
          },
        ],
      },
      {
        span: 8,
        type: "select",
        name: "scanStatus",
        label: "扫码状态",
        value: "",
        options: [
          // 0、未扫描，1、已扫描
          {
            value: 0,
            label: "未扫描",
          },
          {
            value: 1,
            label: "已扫描",
          },
        ],
      },
      {
        span: 8,
        type: "select",
        name: "logeStatus",
        label: "落格状态",
        value: "",
        options: [
          // 0、未落格，1、已落格 2:落格至异常格口 3:商品丢失
          {
            value: 0,
            label: "未落格",
          },
          {
            value: 1,
            label: "已落格",
          },
          {
            value: 2,
            label: "落格至异常格口",
          },
          {
            value: 3,
            label: "商品丢失",
          },
        ],
      },

      {
        span: 8,
        type: "select",
        name: "allotmentType",
        label: "供包类型",
        value: "",
        options: [
          // 0商品供包 1首营、质检票据供包 2.清单、发票供包
          {
            value: 0,
            label: "商品供包",
          },
          {
            value: 1,
            label: "首营、质检票据供包",
          },
          {
            value: 2,
            label: "清单、发票供包",
          },
        ],
      },

      {
        span: 16,
        type: "row",
        label: "创建日期",
        labelCol: { span: 4 },
        wrapperCol: { span: 19 },
        style: { textAlign: "left" },
        name: "ff",
        list: [
          {
            type: "date",
            name: "createTimeStart",
            placeholder: "请输入开始日期",
            value: "",
            format: "YYYY-MM-DD HH:mm:ss",
            showTime: true,
            style: "padding-right:5px;",
          },
          {
            type: "date",
            name: "createTimeEnd",
            placeholder: "请输入结束日期",
            format: "YYYY-MM-DD HH:mm:ss",
            showTime: true,
            value: "",
          },
        ],
      },

      {
        span: 8,
        type: "buttonGroup",
        style: { textAlign: "left" },
        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();
                // that.containerToOffShelfFun()
              },
            },
          },
        ],
      },
    ],
    columns: [
      {
        dataIndex: "id",
        key: "id",
        align: "center",
        ellipsis: true,
        // hidden: true,
        title: "任务汇总ID",
      },
      {
        title: "订单ID",
        dataIndex: "billNo",
        align: "center",
        ellipsis: true,
        key: "billNo",
      },
      {
        title: "商品ID",
        dataIndex: "itemId",
        align: "center",
        ellipsis: true,
        key: "itemId",
      },
      {
        title: "商品名称",
        key: "itemName",
        ellipsis: true,
        dataIndex: "itemName",
        align: "center",
      },

      {
        title: "商品条码",
        dataIndex: "itemCode",
        align: "center",
        key: "itemCode",
        ellipsis: true,
      },
      {
        title: "批号",
        dataIndex: "lotNo",
        align: "center",
        key: "lotNo",
        ellipsis: true,
      },
      {
        title: "计划数量",
        dataIndex: "planQty",
        align: "center",
        key: "planQty",
        ellipsis: true,
      },
      {
        title: "复核数量",
        dataIndex: "qty",
        align: "center",
        key: "qty",
        ellipsis: true,
      },
      {
        title: "wcs-taskid",
        dataIndex: "wcsTaskId",
        align: "center",
        key: "wcsTaskId",
        ellipsis: true,
      },
      {
        title: "所去格口号",
        dataIndex: "crea-teTime",
        align: "center",
        key: "createTi-me",
        ellipsis: true,
      },
      {
        title: "下发mcs状态",
        dataIndex: "creat0eTime",
        align: "center",
        key: "createT0ime",
        ellipsis: true,
      },
      {
        title: "扫码状态",
        dataIndex: "scanStatus",
        align: "center",
        key: "scanStatus",
        ellipsis: true,
        customRender(text) {
          // \ 0、未扫描，1、已扫描
          text == 0 && (text = "未扫描");
          text == 1 && (text = "已扫描");
          return text;
        },
      },
      {
        title: "落格状态",
        dataIndex: "logeStatus",
        align: "center",
        key: "logeStatus",
        ellipsis: true,
        customRender(text) {
          // 0、未落格，1、已落格
          text == 0 && (text = "未落格");
          text == 1 && (text = "已落格");
          text == 2 && (text = "落格至异常格口");
          text == 3 && (text = "商品丢失");
          return text;
        },
        // 0、未落格，1、已落格 2:落格至异常格口 3:商品丢失
      },
      {
        title: "最终落格格口号",
        dataIndex: "logeGirdNo",
        align: "center",
        key: "logeGirdNo",
        ellipsis: true,
      },
      {
        title: "供包类型",
        dataIndex: "allotmentType",
        align: "center",
        key: "allotmentType",
        ellipsis: true,
        customRender(text) {
          // 0商品供包 1首营、质检票据供包 2.清单、发票供包
          text == 0 && (text = "商品供包");
          text == 1 && (text = "首营、质检票据供包");
          text == 2 && (text = "清单、发票供包");

          return text;
        },
      },
      {
        title: "任务下发时间",
        dataIndex: "taskIssueDate",
        align: "center",
        key: "taskIssueDate",
        ellipsis: true,
      },
      {
        title: "扫描时间",
        dataIndex: "scanDate",
        align: "center",
        key: "scanDate",
        ellipsis: true,
      },
      {
        title: "落格时间",
        dataIndex: "fallLatticeDate",
        align: "center",
        key: "fallLatticeDate",
        ellipsis: true,
      },
      {
        title: "创建时间",
        dataIndex: "createTime",
        align: "center",
        key: "createTime",
        ellipsis: true,
      },
      {
        title: "操作",
        key: "operation",
        width: 150,
        scopedSlots: { customRender: "operation" },
        fixed: "right",
        align: "center",
      },
    ],
    columns1: [
      {
        title: "任务汇总ID",
        dataIndex: "id",
        align: "center",
        key: "id",
        ellipsis: true,
      },
      {
        title: "订单ID",
        dataIndex: "billNo",
        align: "center",
        key: "billNo",
        ellipsis: true,
      },
      {
        title: "商品ID",
        dataIndex: "itemId",
        align: "center",
        key: "itemId",
        ellipsis: true,
      },
      {
        title: "商品名称",
        dataIndex: "itemName",
        align: "center",
        key: "itemName",
        ellipsis: true,
      },
      {
        title: "商品条码",
        dataIndex: "itemCode",
        align: "center",
        key: "itemCode",
        ellipsis: true,
      },
      {
        title: "批号",
        dataIndex: "lotNo",
        align: "center",
        key: "lotNo",
        ellipsis: true,
      },
      {
        title: "药监码/商品条码",
        dataIndex: "code",
        align: "center",
        key: "code",
        ellipsis: true,
      },
      {
        title: "创建时间",
        dataIndex: "createTime",
        align: "center",
        key: "createTime",
        ellipsis: true,
      },
    ],
  };
};

export default config;
