/*
 * @Date: 2022-10-17 09:09:15
 * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
 * @LastEditTime: 2023-06-14 17:24:35
 * @FilePath: /upcloud-wms-henanyiyao-web/src/views/kzyWMS/inBound/printLibrary/noticePrinting/config/detail/basic-data.js
 * @Description: cyk
 */
import { rcvTypeOptions } from "../../../../config/options";
import { genWarehouseAuthSearchModal, genCargoownerAuthSearchModal } from "../../../../../SearchModal";
import { upcloud_base_common } from "@/config/serviceSettings";
import moment from "moment";
let grid = {
  labelCol: { span: 6 },
  span: 8,
};

export const basicData = function (self) {
  return {
    searchItems: [
      ...genWarehouseAuthSearchModal(1, true, false, null, null, grid),
      ...genCargoownerAuthSearchModal(1, true, false, null, null, grid, { mapper: { cargoOwnerId: "mtlOwnerId" } }),
      { type: "input", name: "billNo", label: "单据查询", value: "", ...grid },
      { type: "input", name: "rcvNo", label: "收货单号", value: "", ...grid },
      { type: "input", name: "shipperZjm", label: "单位助记码", value: "", ...grid },
      {
        type: "date",
        name: "startTime",
        format: "YYYY-MM-DD",
        label: "开始日期",
        value: moment().subtract(1, "week").format("YYYY-MM-DD"),
        ...grid,
      },
      {
        type: "date",
        name: "endTime",
        format: "YYYY-MM-DD",
        label: "结束日期",
        value: moment().format("YYYY-MM-DD"),
        ...grid,
      },
      {
        type: "select",
        name: "printStatus",
        label: "打印状态",
        value: "",
        options: [
          {
            label: "未打印",
            value: "0",
          },
          {
            label: "已打印",
            value: "1",
          },
        ],
        ...grid,
      },
      // { type: 'input', name: 'printCount', label: '打印份数', value: '', ...grid },
    ],
    columns: [
      { hidden: true, title: "taskRqcId", dataIndex: "taskRqcId", key: "taskRqcId" },
      { hidden: true, title: "rcvHeaderId", dataIndex: "rcvHeaderId", key: "rcvHeaderId" },
      { title: "单据编号", dataIndex: "asnAutoBillNum", key: "asnAutoBillNum", width: 120 },
      { title: "收货单号", dataIndex: "rcvNo", key: "rcvNo", width: 120 },
      { title: "日期", dataIndex: "rcvDate", key: "rcvDate", width: 140 },
      { title: "货主编码", dataIndex: "mtlOwnerNum", key: "mtlOwnerNum", width: 100 },
      { title: "货主名称", dataIndex: "mtlOwnerName", key: "mtlOwnerName", width: 180 },
      { title: "单位编号", dataIndex: "vendorNum", key: "vendorNum", width: 90 },
      { title: "单位名称", dataIndex: "vendorName", key: "vendorName", width: 120 },
      // { title: "商品助记码", dataIndex: "itemZjm", key: "itemZjm", width: 120 },
      { title: "单位助记码", dataIndex: "shipperZjm", key: "shipperZjm", width: 120 },
      // { title: "单位识别", dataIndex: "warehouseName", key: "warehouseName", width: 120 },
      { title: "部门编号", dataIndex: "orgnNum", key: "orgnNum", width: 90 },
      // { title: "部门名称", dataIndex: "executorUser", key: "executorUser", width: 90 },
      {
        title: "入库类型",
        dataIndex: "rcvType",
        width: 140,
        // scopedSlots: { customRender: 'rcvReason1' }
        autoLoad: true,
        remoteUrl: { url: upcloud_base_common + "/dict/listbytype?dicttypeCodes=oms_asn_bill_type", method: "post" },
        replaceFields: {
          value: "dictCode",
          // value: 'dictName',
          label: "dictName",
        },
      },
      // {
      //   title: "到货方式", dataIndex: "arrivalMode", key: "arrivalMode", width: 150,
      // customRender(text) {
      // let item = rcvTypeOptions.find(t => t.value == text);
      // if (item) {
      //   return item.title;
      // } else return '';
      // }
      // },
      { title: "采购员", dataIndex: "buyerMane", key: "buyerMane", width: 150 },
      { title: "操作员", dataIndex: "executorUser", key: "executorUser", width: 150 },
      // { title: "验收员", dataIndex: "srcAutoBillNum", key: "srcAutoBillNum", width: 150 },
      // { title: "备注", dataIndex: "comments", key: "comments", width: 60 },
    ],
  };
};
