import {
  factorySelect,
  shopSelectByFactory,
  productionLineSelectByShop,
} from "@/services/system";
import { workingProcedureByShop } from "@/services/craft";
export default {
  collectionSiteCode: {
    value: null,
    type: "input",
    title: "站点编号",
    name: ["collectionSiteCode"],
    required: true,
  },
  collectionSiteName: {
    value: null,
    type: "input",
    title: "站点名称",
    name: ["collectionSiteName"],
    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,
  },
  productionLineId: {
    value: null,
    type: "select",
    title: "所属产线",
    name: ["productionLineId"],
    required: true,
    belinked: {
      options: {
        database: productionLineSelectByShop,
        params: { shopId: "linked", factoryId: "linked" },
      },
    },
  },
  workingProcedureId: {
    value: null,
    type: "select",
    title: "工序",
    name: ["workingProcedureId"],
    required: true,
    belinked: {
      options: {
        database: workingProcedureByShop,
        params: { shopId: "linked", factoryId: "linked" },
      },
    },
  },
  remark: {
    value: null,
    type: "textarea",
    title: "描述",
    name: ["remark"],
    required: false,
    col: { span: 24 },
  },
};