import {
  factorySelect,
  shopSelectByFactory,
  sectionSelectByShop,
} from "@/services/system";
export default {
  workingProcedureCode: {
    value: null,
    type: "input",
    title: "工序编号",
    name: ["workingProcedureCode"],
    required: true,
  },
  workingProcedureName: {
    value: null,
    type: "input",
    title: "工序名称",
    name: ["workingProcedureName"],
    required: true,
  },
  factoryId: {
    value: null,
    type: "select",
    title: "所属工厂",
    name: ["factoryId"],
    required: true,
    options: {
      database: factorySelect,
      params: {},
    },
    linked: true,
  },
  shopId: {
    value: null,
    type: "select",
    title: "所属车间",
    name: ["shopId"],
    required: true,
    belinked: {
      options: {
        database: shopSelectByFactory,
        params: { factoryId: "linked" },
      },
    },
    linked: true,
  },
  sectionId: {
    value: null,
    type: "select",
    title: "所属工段",
    name: ["sectionId"],
    required: true,
    belinked: {
      options: {
        database: sectionSelectByShop,
        params: { shopId: "linked", factoryId: "linked" },
      },
    },
  },
  workingProcedureType: {
    value: null,
    type: "select",
    title: "工序类型",
    name: ["workingProcedureType"],
    required: true,
    options: [
      {
        label: "生产",
        value: 1,
      },
      {
        label: "检验",
        value: 2,
      },
      {
        label: "包装",
        value: 3,
      },
    ],
  },
  collectionMode: {
    value: null,
    type: "select",
    title: "采集方式",
    name: ["collectionMode"],
    required: true,
    options: [
      {
        label: "上下线",
        value: 1,
      },
      {
        label: "一次",
        value: 2,
      },
      {
        label: "投料",
        value: 3,
      },
    ],
  },
  remark: {
    value: null,
    type: "textarea",
    title: "描述",
    name: ["remark"],
    required: false,
    col: { span: 24 },
  },
};
