Przeglądaj źródła

修改工位的判断条件

695593266@qq.com 1 dzień temu
rodzic
commit
23f0bb400b

+ 24 - 0
src/views/productionPlan/components/gantt/components/GanttFilterBar.vue

@@ -104,6 +104,7 @@
     border-radius: 0;
     background: transparent;
     box-shadow: none;
+    overflow: hidden;
   }
 
   .calendar-filters {
@@ -114,8 +115,10 @@
   }
 
   .calendar-toolbar.gantt-filter-inline .calendar-filters {
+    height: 30px;
     flex-wrap: nowrap;
     gap: 5px;
+    overflow: hidden;
   }
 
   .calendar-filter-item {
@@ -142,6 +145,7 @@
 
   .calendar-toolbar.gantt-filter-inline .calendar-filter-item :deep(.el-input) {
     width: 138px;
+    flex: 0 0 138px;
   }
 
   .calendar-filter-item :deep(.el-input__inner) {
@@ -150,12 +154,31 @@
     border-radius: 6px;
     background: #fbfdff;
     color: #364152;
+    line-height: 28px;
   }
 
   .calendar-toolbar.gantt-filter-inline
     .calendar-filter-item
     :deep(.el-input__inner) {
     height: 26px;
+    line-height: 26px;
+    padding-right: 28px;
+  }
+
+  .calendar-filter-item :deep(.el-input__suffix),
+  .calendar-filter-item :deep(.el-input__prefix) {
+    top: 0;
+    display: inline-flex;
+    align-items: center;
+    height: 100%;
+  }
+
+  .calendar-filter-item :deep(.el-input__icon) {
+    display: inline-flex;
+    align-items: center;
+    justify-content: center;
+    height: 100%;
+    line-height: 1;
   }
 
   .calendar-filter-item :deep(.el-input__inner:focus) {
@@ -172,6 +195,7 @@
   .calendar-toolbar.gantt-filter-inline .calendar-filters > .el-button {
     height: 26px;
     padding: 6px 9px;
+    line-height: 1;
   }
 
   @media (max-width: 1440px) {

+ 2 - 1
src/views/productionPlan/components/gantt/project-gantt.vue

@@ -1656,8 +1656,9 @@
     flex: 1 1 auto;
     min-width: 0;
     overflow-x: auto;
+    overflow-y: hidden;
     flex-wrap: nowrap;
-    padding-bottom: 1px;
+    min-height: 30px;
   }
   .view-switch-left::-webkit-scrollbar {
     height: 4px;

+ 17 - 3
src/views/productionPlan/components/newFactoryProductionScheduling/TaskConfigPanel.vue

@@ -1252,6 +1252,16 @@
           .map((item) => this.normalizeDeviceSnapshotCode(item))
           .filter(Boolean);
       },
+      isDispatchDeviceSnapshotCodeMatched(row, snapshotCodes = {}) {
+        return this.getDispatchDeviceSnapshotCandidateCodes(row).some(
+          (code) => snapshotCodes[code]
+        );
+      },
+      hasDispatchDeviceSnapshotMatchedRow(snapshotCodes = {}) {
+        return this.dispatchObjectRows.some((row) =>
+          this.isDispatchDeviceSnapshotCodeMatched(row, snapshotCodes)
+        );
+      },
       isDeviceSnapshotLocked(row) {
         if (!this.orderDispatchStyle || !row) {
           return false;
@@ -1267,9 +1277,13 @@
           return false;
         }
         const snapshotCodes = this.dispatchDeviceSnapshotMap[requestKey] || {};
-        return !this.getDispatchDeviceSnapshotCandidateCodes(row).some(
-          (code) => snapshotCodes[code]
-        );
+        if (
+          !Object.keys(snapshotCodes).length ||
+          !this.hasDispatchDeviceSnapshotMatchedRow(snapshotCodes)
+        ) {
+          return false;
+        }
+        return !this.isDispatchDeviceSnapshotCodeMatched(row, snapshotCodes);
       },
       clearDeviceSnapshotLockedSelections() {
         this.dispatchObjectRows.forEach((row) => {

+ 18 - 7
src/views/workOrder/components/chooseStation.vue

@@ -78,7 +78,8 @@
         sourceTaskId: '',
         type: '',
         teamId: '',
-        deviceSnapshotLockedCodes: []
+        deviceSnapshotAllowedCodes: [],
+        deviceSnapshotRestrictionEnabled: false
       };
     },
 
@@ -191,17 +192,27 @@
     },
 
     methods: {
-      open(id, list = [], index, type, teamId, deviceSnapshotLockedCodes = []) {
+      open(
+        id,
+        list = [],
+        index,
+        type,
+        teamId,
+        deviceSnapshotAllowedCodes = [],
+        deviceSnapshotRestrictionEnabled = false
+      ) {
         this.dispatchVisible = true;
         this.index = index;
         this.workCenterId = id;
         this.type = type;
         this.teamId = teamId;
-        this.deviceSnapshotLockedCodes = Array.isArray(
-          deviceSnapshotLockedCodes
+        this.deviceSnapshotAllowedCodes = Array.isArray(
+          deviceSnapshotAllowedCodes
         )
-          ? deviceSnapshotLockedCodes.map((item) => String(item).trim())
+          ? deviceSnapshotAllowedCodes.map((item) => String(item).trim())
           : [];
+        this.deviceSnapshotRestrictionEnabled =
+          deviceSnapshotRestrictionEnabled;
 
         this.allSelection = Array.isArray(list) ? list : [];
 
@@ -225,7 +236,7 @@
       },
 
       isDeviceSnapshotLocked(row) {
-        if (!row) {
+        if (!row || !this.deviceSnapshotRestrictionEnabled) {
           return false;
         }
         const candidateCodes = [
@@ -237,7 +248,7 @@
           .filter((item) => item !== null && item !== undefined && item !== '')
           .map((item) => String(item).trim());
         return !candidateCodes.some((code) =>
-          this.deviceSnapshotLockedCodes.includes(code)
+          this.deviceSnapshotAllowedCodes.includes(code)
         );
       },
 

+ 40 - 7
src/views/workOrder/mixins/planDotLineRelease.js

@@ -279,7 +279,9 @@ export default {
           this.handleClick({ name: this.processId });
         }
         console.log(this.processList, '工序列表');
-      } catch (err) {}
+      } catch (err) {
+        console.warn(err);
+      }
     },
     // 选择工作中心
     async changeWork(e) {
@@ -420,6 +422,35 @@ export default {
         .map((item) => this.normalizeDeviceSnapshotCode(item))
         .filter(Boolean);
     },
+    isDeviceSnapshotCodeMatched(row, snapshotCodes) {
+      if (!row || !snapshotCodes) {
+        return false;
+      }
+      return this.getDeviceSnapshotCandidateCodes(row).some(
+        (code) => snapshotCodes[code]
+      );
+    },
+    isDeviceSnapshotRestrictionEnabled(process = null) {
+      const taskId = process?.id || this.processId;
+      const requestKey = this.getDeviceSnapshotRequestKey(taskId);
+      if (
+        !requestKey ||
+        !Object.prototype.hasOwnProperty.call(
+          this.deviceSnapshotMap,
+          requestKey
+        )
+      ) {
+        return false;
+      }
+      const snapshotCodes = this.deviceSnapshotMap[requestKey] || {};
+      if (Object.keys(snapshotCodes).length === 0) {
+        return false;
+      }
+      const list = Array.isArray(process?.list) ? process.list : [];
+      return list.some((row) =>
+        this.isDeviceSnapshotCodeMatched(row, snapshotCodes)
+      );
+    },
     isDeviceSnapshotLocked(row, process = null) {
       if (!row) {
         return false;
@@ -436,14 +467,15 @@ export default {
         return false;
       }
       const snapshotCodes = this.deviceSnapshotMap[requestKey] || {};
-      return !this.getDeviceSnapshotCandidateCodes(row).some(
-        (code) => snapshotCodes[code]
-      );
+      if (!this.isDeviceSnapshotRestrictionEnabled(process)) {
+        return false;
+      }
+      return !this.isDeviceSnapshotCodeMatched(row, snapshotCodes);
     },
     getDeviceSnapshotLockTip() {
       return '该工序已制定设备类型';
     },
-    getDeviceSnapshotLockedCodes(process) {
+    getDeviceSnapshotAllowedCodes(process) {
       const requestKey = this.getDeviceSnapshotRequestKey(
         process?.id || this.processId
       );
@@ -612,7 +644,7 @@ export default {
         }
         if (item.quantity == 0) {
           this.$message.warning('请检查所选数据的数量不能为0');
-          digit = false;
+          flag = false;
           return;
         }
 
@@ -706,7 +738,8 @@ export default {
         index,
         1,
         this.form.teamId,
-        this.getDeviceSnapshotLockedCodes(item)
+        this.getDeviceSnapshotAllowedCodes(item),
+        this.isDeviceSnapshotRestrictionEnabled(item)
       );
     },