import {
  selectionBoxAll,
  StoreAreaselection,
  factorySelect,
  storeselectionBoxAll,
} from "@/services/system.js";
import { doFetch } from "@/utils/doFetch";

export default {
  jbsx: {
    title: "基本属性",
    type: "split",
    col: { span: 24 },
    name: ["jbsx"],
  },
  materieCode: {
    value: null,
    type: "input",
    title: "物料编码",
    name: ["materieCode"],
    required: true,
  },
  materieName: {
    value: null,
    type: "input",
    title: "物料名称",
    name: ["materieName"],
    required: true,
  },
  materieTypeId: {
    value: null,
    type: "treeselect",
    title: "物料类型",
    name: ["materieTypeId"],
    required: true,
    options: {
      database: (params) =>
        doFetch({
          url: "/ngic-workmanship/pmMaterieType/queryTreeList",
          params,
        }),
      params: {},
    },
  },
  materieControl: {
    value: "1",
    type: "select",
    title: "管控方式",
    name: ["materieControl"],
    required: true,
    options: {
      database: (params) =>
        doFetch({
          url: "/ngic-base-business/sysDic/queryMaterieControlSelect",
          params,
        }),
      params: {},
    },
  },
  specificationModel: {
    value: null,
    type: "input",
    title: "规格型号",
    name: ["specificationModel"],
    required: true,
  },
  issueType: {
    value:"2",
    type: "select",
    title: "发料类型",
    name: ["issueType"],
    required: true,
    options: {
      database: (params) =>
        doFetch({
          url: "/ngic-base-business/sysDic/queryMaterieTypeSelect",
          params,
        }),
      params: {},
    },
  },
  scsx: {
    title: "生产属性",
    type: "split",
    col: { span: 24 },
    name: ["scsx"],
  },
  ironLoss: {
    value: 0,
    type: "inputnumber",
    title: "铁损",
    max:999999,
    name: ["ironLoss"],
    required: false,
    precision: 3,
  },
  sheetThickness: {
    value: 0,
    type: "inputnumber",
    title: "片厚",
    max:999999,
    name: ["sheetThickness"],
    required: false,
    precision: 3,
  },
  // unilateralThickness: {
  //   value: 0,
  //   type: "inputnumber",
  //   title: "单边厚度",
  //   name: ["unilateralThickness"],
  //   required: false,
  //   precision: 3,
  // },
  shopSign: {
    value: null,
    type: "input",
    title: "牌号",
    name: ["shopSign"],
    required: false,
  },
  cksx: {
    title: "仓库属性",
    type: "split",
    name: ["cksx"],
    col: { span: 24 },
  },
  productionUnit: {
    value: null,
    type: "select",
    title: "库存单位",
    name: ["productionUnit"],
    required: false,
    options: {
      database: (params) =>
        doFetch({
          url: "/ngic-base-business/sysDic/queryMaterieUnitSelect",
          params,
        }),
      params: {},
    },
  },
  storeId: {
    value: null,
    type: "select",
    title: "默认仓库",
    name: ["storeId"],
    linked: true,
    required: false,
    options: {
      database: selectionBoxAll,
      params: {},
    },
  },
  storeAreaId: {
    value: null,
    type: "select",
    title: "默认库区",
    name: ["storeAreaId"],
    belinked: {
      options: {
        database: StoreAreaselection,
        params: {
          storeId: "linked",
        },
      },
    },
    linked: true,
    required: false,
  },

  // 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",
  //       },
  //     },
  //   },
  // },
};
