leiqunqing
2026-02-06 15b3879cd259108e7ebb755fe02c190f28f1e20c
´úÂë¹ÜÀí/WIDESEAWCS_Client/src/views/basicinfo/scanStation.vue
@@ -15,37 +15,34 @@
<script>
import extend from "@/extension/basicinfo/scanStation.js";
import { ref, defineComponent } from "vue";
import { ref, defineComponent, onMounted } from "vue";
import axios from "axios";
export default defineComponent({
  setup() {
    // å…¨å±€ä¸‹æ‹‰æ•°æ®æºå˜é‡ - æ‰€æœ‰ä¸‹æ‹‰æ¡†å…±ç”¨ï¼Œä¸€å¤„赋值,三处复用
    const stationEndProductList = ref([]);
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "扫描工位",
      name: "scanStation",
      url: "/scanStation/",
      sortName: "createDate",
      url: "/scanStation/",
      sortName: "createDate",
    });
    // ã€ä¿®æ”¹1】新增组装人员、首件/末件流水号字段,移除不存在的isScanned
    const editFormFields = ref({
      id: "",
      stationCode: "",
      stationCode: "",
      stationName: "",
      stationEndProduct: "",
      stationComponentQty: "",
      stationComponent1: "",
      stationComponent2: "",
      stationComponent3: "",
      stationComponent4: "",
      stationComponent5: "",
      stationComponent6: "",
      stationComponent7: "",
      stationComponent8: "",
      stationComponent9: "",
      stationComponent10: "",
      assembleUser: "", // ç»„装人员
      firstProductSn: "", // é¦–件流水号
      lastProductSn: "", // æœ«ä»¶æµæ°´å·
    });
    const editFormOptions = ref([
      [
        {
@@ -53,122 +50,76 @@
          field: "stationCode",
          type: "input",
          width: 200,
          require: true
          require: true,
        },
      ],
      [
        {
          title: "站台名称",
          field: "stationName",
          type: "input",
          width: 200,
          require: true
          require: true,
        },
      ],
      [
        {
          title: "站台成品",
          field: "stationEndProduct",
          type: "input",
          type: "select",
          data: stationEndProductList, // ç»‘定全局接口数据
          width: 200,
          require: false
        }
          require: false,
        },
      ],
      // ã€ä¿®æ”¹2】移除isScanned下拉框,新增组装人员输入框
      [
        {
          title: "零件数量",
          field: "stationComponentQty",
          title: "组装人员",
          field: "assembleUser",
          type: "input",
          width: 200,
          require: true
          require: false, // åŽç«¯å…è®¸ä¸ºç©ºï¼Œæ•…设为非必填
        },
        {
          title: "零件1",
          field: "stationComponent1",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "零件2",
          field: "stationComponent2",
          type: "input",
          width: 200,
          require: false
        }
      ],
      // ã€æ–°å¢žã€‘首件流水号输入框
      [
        {
          title: "零件3",
          field: "stationComponent3",
          title: "首件流水号",
          field: "firstProductSn",
          type: "input",
          width: 200,
          require: false
          width: 300, // æµæ°´å·è¾ƒé•¿ï¼ŒåŠ å®½è¾“å…¥æ¡†
          require: false,
        },
        {
          title: "零件4",
          field: "stationComponent4",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "零件5",
          field: "stationComponent5",
          type: "input",
          width: 200,
          require: false
        }
      ],
      // ã€æ–°å¢žã€‘末件流水号输入框
      [
        {
          title: "零件6",
          field: "stationComponent6",
          title: "末件流水号",
          field: "lastProductSn",
          type: "input",
          width: 200,
          require: false
          width: 300,
          require: false,
        },
        {
          title: "零件7",
          field: "stationComponent7",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "零件8",
          field: "stationComponent8",
          type: "input",
          width: 200,
          require: false
        }
      ],
      [
        {
          title: "零件9",
          field: "stationComponent9",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "零件10",
          field: "stationComponent10",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "主键ID",
          field: "id",
          type: "input",
          width: 100,
          hidden: true,
          readonly: true
        }
      ]
          readonly: true,
        },
      ],
    ]);
    // ã€ä¿®æ”¹3】搜索表单移除isScanned,新增组装人员(流水号一般不做搜索,故不新增)
    const searchFormFields = ref({
      stationCode: "",
      stationName: "",
      stationEndProduct: "",
      assembleUser: "", // æ–°å¢žç»„装人员搜索
      creater: "",
      createDate: "",
    });
@@ -177,9 +128,16 @@
      [
        { title: "站台编号", field: "stationCode", type: "like" },
        { title: "站台名称", field: "stationName", type: "like" },
        { title: "站台成品", field: "stationEndProduct", type: "like" },
        {
          title: "站台成品",
          field: "stationEndProduct",
          type: "select-search",
          data: stationEndProductList, // ç»‘定全局接口数据
        },
        { title: "组装人员", field: "assembleUser", type: "like" }, // æ–°å¢žç»„装人员模糊搜索
      ],
      [
        // ã€ä¿®æ”¹4】移除搜索栏的isScanned下拉框
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
@@ -213,85 +171,35 @@
      {
        field: "stationEndProduct",
        title: "站台成品",
        type: "string",
        type: "select",
        bind: {
          key: "value",
          data: stationEndProductList, // ç»‘定全局接口数据
        },
        link: true,
        width: 200,
        align: "left",
      },
      // ã€ä¿®æ”¹5】移除表格的isScanned列,新增以下三列
      {
        field: "stationComponentQty",
        title: "零件数量",
        type: "int",
        width: 200,
        field: "assembleUser",
        title: "组装人员",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "stationComponent1",
        title: "零件1",
        field: "firstProductSn",
        title: "首件流水号",
        type: "string",
        width: 200,
        width: 220,
        align: "left",
      },
      {
        field: "stationComponent2",
        title: "零件2",
        field: "lastProductSn",
        title: "末件流水号",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent3",
        title: "零件3",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent4",
        title: "零件4",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent5",
        title: "零件5",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent6",
        title: "零件6",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent7",
        title: "零件7",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent8",
        title: "零件8",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent9",
        title: "零件9",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent10",
        title: "零件10",
        type: "string",
        width: 200,
        width: 220,
        align: "left",
      },
      {
@@ -323,13 +231,29 @@
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "",
      table: "",
      columns: [],
      sortName: "",
      key: "",
    });
    // ã€ä¿ç•™åŽŸæœ‰é€»è¾‘ã€‘èŽ·å–ç«™å°æˆå“ä¸‹æ‹‰æ•°æ®
    const getStationEndProductData = async () => {
      try {
        const res = await axios.get("/api/formula/getEndProductList");
        stationEndProductList.value = (res.data?.data || []).map(
          (item) => item || { key: "", value: "", disabled: false }
        );
      } catch (error) {
        stationEndProductList.value = [];
        console.error("获取站台成品数据失败:", error);
      }
    };
    onMounted(() => {
      getStationEndProductData();
    });
    return {
@@ -344,4 +268,4 @@
    };
  },
});
</script>
</script>