| | |
| | | |
| | | <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", |
| | | }); |
| | | |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | stationCode: "", |
| | | stationCode: "", |
| | | stationName: "", |
| | | stationEndProduct: "", |
| | | stationComponentQty: "", |
| | | stationComponent1: "", |
| | | stationComponent2: "", |
| | | stationComponent3: "", |
| | | stationComponent4: "", |
| | | stationComponent5: "", |
| | | stationComponent6: "", |
| | | stationComponent7: "", |
| | | stationComponent8: "", |
| | | stationComponent9: "", |
| | | stationComponent10: "", |
| | | }); |
| | | |
| | | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | |
| | | 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({ |
| | |
| | | [ |
| | | { 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" }, |
| | |
| | | { |
| | | field: "stationEndProduct", |
| | | title: "ç«å°æå", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | 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", |
| | | type: "select", |
| | | bind: { |
| | | key: "value", |
| | | data: stationEndProductList, // ç»å®å
¨å±æ¥å£æ°æ® |
| | | }, |
| | | link: true, |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | |
| | | 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, |
| | |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | </script> |