Browse Source

多工位绑定

qinhb 1 year ago
parent
commit
7200d4cdb9
2 changed files with 11 additions and 3 deletions
  1. 8 0
      src/api/station/index.ts
  2. 3 3
      src/views/base/modeling/factory/index.vue

+ 8 - 0
src/api/station/index.ts

@@ -15,6 +15,14 @@ export function updateStation(data: Station) {
     data: data,
   });
 }
+export function bindStation(data: Station) {
+  return request({
+    url: "/api/v1/base/station/bind",
+    method: "post",
+    data: data,
+  });
+}
+
 
 /**
  * 工位绑定设备

+ 3 - 3
src/views/base/modeling/factory/index.vue

@@ -77,7 +77,7 @@ const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 import { updateWorkShop } from "@/api/workShop";
 
 import { updateProductionLine } from "@/api/productionLine";
-import { updateStation } from "@/api/station";
+import {bindStation, updateStation} from "@/api/station";
 // 公共弹窗相关
 const ctableRef = ref(null);
 const workShopRef = ref(null);
@@ -272,8 +272,8 @@ const onSelectedLineFinish = (selectedValue) => {
 const onSelectedStationFinish = (selectedValue) => {
   formData.value.code = selectedValue.code;
   formData.value.parentCode = factory.value.code;
-  formData.value.id = selectedValue.id;
-  updateStation(formData.value).then((data: any) => {
+  formData.value.ids = selectedValue.id;
+  bindStation(formData.value).then((data: any) => {
     ElMessage({
       message: data.msg,
       type: "success",