import { doFetch } from "@/utils/doFetch";
import {
  factorySelect,
  shopSelectByFactory,
  StoreAreaselection,
  storeselectionBoxAll,
} from "@/services/system";
export default {
  storePositionCode: {
    value: null,
    type: "input",
    title: "库位编码",
    name: ["storePositionCode"],
    required: true,
  },
  storePositionName: {
    value: null,
    type: "input",
    title: "库位名称",
    name: ["storePositionName"],
    required: true,
  },
  factoryId: {
    value: null,
    type: "select",
    title: "所属工厂",
    name: ["factoryId"],
    required: true,
    options: {
      database: factorySelect,
      params: {},
    },
    linked: true,
  },
  storeId: {
    value: null,
    type: "select",
    title: "所属仓库",
    name: ["storeId"],
    required: true,
    linked: true,
    belinked: {
      options: {
        database: storeselectionBoxAll,
        params: {
          factoryId: "linked",
        },
      },
    },
  },
  storeAreaId: {
    value: null,
    type: "select",
    title: "所属库区",
    name: ["storeAreaId"],
    required: true,
    belinked: {
      options: {
        database: StoreAreaselection,
        params: {
          storeId: "linked",
        },
      },
    },
    linked: true,
  },

  status: {
    value: 1,
    type: "select",
    name: ["status"],
    title: "库位状态",
    required: false,
    options: [
      {
        label: "启用",
        value: 1,
      },
      {
        label: "停用",
        value: 2,
      },
    ],
  },
  /* `isMovePosition` 是对象中表示表单字段的属性。它的类型为“radio”，这意味着它将在表单中呈现为单选按钮组。用户可以选择“是”（是）或“否”（否）作为该字段的值。 */
  /* `isMovePosition` 是对象中表示表单字段的属性。它的类型为“radio”，这意味着它将在表单中呈现为单选按钮组。用户可以选择“是”（是）或“否”（否）作为该字段的值。 */
  isMovePosition: {
    value: 1,
    type: "select",
    name: ["isMovePosition"],
    title: "是否为移库库位",
    required: false,
    options: [
      {
        label: "是",
        value: 1,
      },
      {
        label: "否",
        value: 0,
      },
    ],
  },
  wzpz: {
    type: "split",
    title: "位置配置",
    name: ["wzpz"],
    col: { span: 24 },
  },
  row: {
    value: null,
    type: "input",
    title: "排",
    name: ["row"],
    required: true,
  },
  line: {
    value: null,
    type: "input",
    title: "列",
    name: ["line"],
    required: true,
  },
  level: {
    value: null,
    type: "input",
    title: "层",
    name: ["level"],
    required: true,
    allowHalf: true,
  },
  roadway: {
    value: null,
    type: "input",
    title: "巷道",
    name: ["roadway"],
    required: true,
    allowHalf: true,
  },

  remark: {
    value: null,
    type: "textarea",
    title: "备注",
    name: ["remark"],
    required: false,
    col: { span: 24 },
  },
};
