/*
 * @Date: 2023-05-08 21:49:41
 * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
 * @LastEditTime: 2023-07-07 16:45:43
 * @FilePath: /upcloud-wms-henanyiyao-web/src/views/kzyWMS/SearchModal/container_inbound.js
 * @Description: cyk
 */
import { upcloud_base_wh, upcloud_base_common } from "@/config/serviceSettings";
// 容器 ——> 依赖 仓库

export const container_inbound = {
  remoteUrl: { url: upcloud_base_wh + "/container/page", method: "get" },

  // 组件用于form组件时，隐藏表单项含id code
  items: [
    { hidden: true, type: "input", name: "containerId", label: "ID", value: "" },
    // { hidden: true, type: 'input', name: 'containerCode', label: '编码', value: '' },
  ],

  // seach-modal配置
  defSearchConfig: {
    name: "containerCode",
    label: "容器",
    title: "容器",
    value: "",
    rowKey: "containerId",
    destroyOnClose: true,
    targetClick: true,
    targetValueKey: "containerCode",
  },

  // modal的搜索栏
  defToolBar: {
    items: [
      { type: "input", name: "containerCode", label: "容器编码", value: "" },
      {
        type: "select",
        name: "containerType",
        label: "容器类型",
        remoteUrl: {
          url: upcloud_base_common + "/dict/listbytype?dicttypeCodes=pub_container_containertype",
          method: "post",
        },
        value: "2",
        autoLoad: true,
        // disabled: true,
        replaceFields: {
          value: "dictCode",
          label: "dictName",
        },
      },
    ],
  },

  // modal的table配置
  defTableCol: [
    { dataIndex: "containerId", title: "ID", hidden: true },
    { dataIndex: "containerCode", title: "容器编码" },
    {
      dataIndex: "containerType",
      title: "容器类型",
      remoteUrl: {
        url: upcloud_base_common + "/dict/listbytype?dicttypeCodes=pub_container_containertype",
        method: "post",
      },
      replaceFields: {
        value: "dictCode",
        label: "dictName",
      },
    },
    { title: "长", key: "containerLen", dataIndex: "containerLen" },
    { title: "宽", key: "containerWid", dataIndex: "containerWid" },
    { title: "高", key: "containerHgt", dataIndex: "containerHgt" },
    { title: "体积", key: "containerVol", dataIndex: "containerVol" },
    { title: "重量限制", key: "containerWgtlmt", dataIndex: "containerWgtlmt" },
    { title: "装填百分比", key: "containerPercent", dataIndex: "containerPercent" },
  ],
};
