leiqunqing
2026-01-19 ba8aa925e7901381ceb394adb53eca8723d1c4c5
´úÂë¹ÜÀí/WIDESEAWCS_Client/src/views/basicinfo/scanStation.vue
@@ -15,10 +15,14 @@
<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",
@@ -33,17 +37,6 @@
      stationCode: "", 
      stationName: "",
      stationEndProduct: "",
      stationComponentQty: "",
      stationComponent1: "",
      stationComponent2: "",
      stationComponent3: "",
      stationComponent4: "",
      stationComponent5: "",
      stationComponent6: "",
      stationComponent7: "",
      stationComponent8: "",
      stationComponent9: "",
      stationComponent10: "",
    });
    
    const editFormOptions = ref([
@@ -53,116 +46,38 @@
          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,
        },
      ],
      [
        {
          title: "零件数量",
          field: "stationComponentQty",
          type: "input",
          width: 200,
          require: true
        },
        {
          title: "零件1",
          field: "stationComponent1",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "零件2",
          field: "stationComponent2",
          type: "input",
          width: 200,
          require: false
        }
      ],
      [
        {
          title: "零件3",
          field: "stationComponent3",
          type: "input",
          width: 200,
          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",
          type: "input",
          width: 200,
          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,
        },
      ],
    ]);
    const searchFormFields = ref({
@@ -177,7 +92,12 @@
      [
        { 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: "creater", type: "like" },
@@ -213,84 +133,12 @@
      {
        field: "stationEndProduct",
        title: "站台成品",
        type: "string",
        width: 200,
        align: "left",
        type: "select",
        bind: {
          key: "value",
          data: stationEndProductList, // ç»‘定全局接口数据
      },
      {
        field: "stationComponentQty",
        title: "零件数量",
        type: "int",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent1",
        title: "零件1",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "stationComponent2",
        title: "零件2",
        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",
        link: true,
        width: 200,
        align: "left",
      },
@@ -332,6 +180,22 @@
      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 {
      table,
      extend,