瀏覽代碼

修改bug

695593266@qq.com 2 月之前
父節點
當前提交
5635a2594f

+ 17 - 5
src/views/produceOrder/components/chooseStation.vue

@@ -59,7 +59,9 @@
         },
         allSelection: [],
         index: '',
-        sourceTaskId: ''
+        sourceTaskId: '',
+        type: '',
+        teamId: ''
       };
     },
 
@@ -171,10 +173,12 @@
     },
 
     methods: {
-      open(id, list = [], index) {
+      open(id, list = [], index, type, teamId) {
         this.dispatchVisible = true;
         this.index = index;
         this.workCenterId = id;
+        this.type = type;
+        this.teamId = teamId;
 
         this.allSelection = Array.isArray(list) ? list : [];
 
@@ -208,12 +212,20 @@
       datasource({ page, limit }) {
         const notInIdsStr = this.allSelection.map((item) => item.id).join(',');
 
-        return getFactoryworkstation({
+        const params = {
           pageNum: page,
           size: limit,
-          workCenterId: this.workCenterId,
           notInIdsStr
-        });
+        };
+
+        // 根据 type 决定传递哪些参数
+        if (this.type === 1) {
+          params.teamId = this.teamId;
+        } else if (this.type === 2) {
+          params.workCenterId = this.workCenterId;
+        }
+
+        return getFactoryworkstation(params);
       },
 
       handleSelectionChange(val) {

+ 14 - 5
src/views/produceOrder/components/releaseDialog/index.vue

@@ -741,7 +741,9 @@
         this.$refs.chooseStationRef.open(
           this.form.workCenterId,
           item.list,
-          index
+          index,
+          2,
+          this.form.teamId
         );
       },
 
@@ -846,18 +848,23 @@
 
         const nextSelection = (process.selection || []).filter((item) => {
           const currentKey =
-            item && typeof item === 'object' ? this.getRowUniqueKey(item) : item;
+            item && typeof item === 'object'
+              ? this.getRowUniqueKey(item)
+              : item;
           return currentKey !== rowKey;
         });
         this.$set(process, 'selection', nextSelection);
 
         this.$nextTick(() => {
           const tabIndex =
-            process.index ?? this.processList.findIndex((item) => item === process);
+            process.index ??
+            this.processList.findIndex((item) => item === process);
           const tab = `tableRef${tabIndex}`;
           const selectedKeys = nextSelection
             .map((item) =>
-              item && typeof item === 'object' ? this.getRowUniqueKey(item) : item
+              item && typeof item === 'object'
+                ? this.getRowUniqueKey(item)
+                : item
             )
             .filter(Boolean);
           this.$refs[tab]?.[0]?.setSelectedRowKeys?.(selectedKeys);
@@ -1329,7 +1336,9 @@
           );
           const mergedList = [
             ...dataRow.list,
-            ...syncedLocalNewList.filter((i) => !existingIds.has(i.id || i.__tempKey))
+            ...syncedLocalNewList.filter(
+              (i) => !existingIds.has(i.id || i.__tempKey)
+            )
           ];
 
           // 更新新增工位状态

+ 14 - 5
src/views/produceOrder/components/releaseDialog/planDotLineReleaseDialog.vue

@@ -749,7 +749,9 @@
         this.$refs.chooseStationRef.open(
           this.form.workCenterId,
           item.list,
-          index
+          index,
+          1,
+          this.form.teamId
         );
       },
 
@@ -833,18 +835,23 @@
 
         const nextSelection = (process.selection || []).filter((item) => {
           const currentKey =
-            item && typeof item === 'object' ? this.getRowUniqueKey(item) : item;
+            item && typeof item === 'object'
+              ? this.getRowUniqueKey(item)
+              : item;
           return currentKey !== rowKey;
         });
         this.$set(process, 'selection', nextSelection);
 
         this.$nextTick(() => {
           const tabIndex =
-            process.index ?? this.processList.findIndex((item) => item === process);
+            process.index ??
+            this.processList.findIndex((item) => item === process);
           const tab = `tableRef${tabIndex}`;
           const selectedKeys = nextSelection
             .map((item) =>
-              item && typeof item === 'object' ? this.getRowUniqueKey(item) : item
+              item && typeof item === 'object'
+                ? this.getRowUniqueKey(item)
+                : item
             )
             .filter(Boolean);
           this.$refs[tab]?.[0]?.setSelectedRowKeys?.(selectedKeys);
@@ -1177,7 +1184,9 @@
           );
           const mergedList = [
             ...dataRow.list,
-            ...syncedLocalNewList.filter((i) => !existingIds.has(i.id || i.__tempKey))
+            ...syncedLocalNewList.filter(
+              (i) => !existingIds.has(i.id || i.__tempKey)
+            )
           ];
 
           // 更新新增工位状态

+ 2 - 2
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086', // 开发环境
@@ -45,7 +45,7 @@ module.exports = {
         // target: 'http://192.168.1.251:18186', // 测试环境
         // target: 'http://192.168.1.251:18087',
         // target: 'http://116.163.22.90:86/api', // 嘉实生产
-        target: 'http://aiot.zoomwin.com.cn:51001/api',
+        // target: 'http://aiot.zoomwin.com.cn:51001/api',
         // target: 'http://f222326r53.imwork.net',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {