695593266@qq.com 2 ay önce
ebeveyn
işleme
941bf11dbd

+ 115 - 31
src/views/produce/components/qualityInspection/components/selfInspectionReporting.vue

@@ -202,8 +202,9 @@
         row-key="id"
         :columns="columns"
         :datasource="form.items"
-        cache-key="mes-selfInspectionRequest-20251201"
+        cache-key="mes-selfInspectionReporting-20260417"
         :need-page="false"
+        :fit="false"
         @refresh="getData"
         :selection.sync="selection"
         style="width: 100%"
@@ -237,13 +238,12 @@
         </template>
 
         <template v-slot:defaultValue="{ row }">
-          <div
-            style="width: 100%; display: flex; justify-content: space-between"
-          >
-            <div style="width: 17%">
+          <div class="process-param-cell">
+            <div class="process-param-symbol">
               <DictSelection
                 clearable
                 dictName="数学字符"
+                value-name="dictValue"
                 disabled
                 v-model="row.symbol"
               ></DictSelection>
@@ -255,18 +255,15 @@
               placement="top"
               v-if="row.textType == 3"
             >
-              <div
-                style="
-                  display: flex;
-                  align-items: center;
-                  justify-content: space-between;
-                  width: 65%;
-                "
-              >
-                <el-input style="width: 45%" v-model="row.minValue" disabled />
-                <span>&nbsp;&nbsp;-</span>
+              <div class="process-param-range">
+                <el-input
+                  class="process-param-range-input"
+                  v-model="row.minValue"
+                  disabled
+                />
+                <span class="process-param-range-sep">&nbsp;&nbsp;-</span>
                 <el-input
-                  style="width: 45%; margin-left: 10px"
+                  class="process-param-range-input process-param-range-input--tail"
                   v-model="row.maxValue"
                   disabled
                 />
@@ -279,7 +276,7 @@
               placement="top"
               v-else
             >
-              <div style="width: 65%">
+              <div class="process-param-default">
                 <el-input
                   v-model="row.defaultValue"
                   placeholder="请输入"
@@ -288,9 +285,10 @@
               </div>
             </el-tooltip>
 
-            <div style="width: 17%">
+            <div class="process-param-unit">
               <DictSelection
                 dictName="工艺参数单位"
+                value-name="dictValue"
                 clearable
                 filterable
                 disabled
@@ -471,7 +469,7 @@
             slot: 'defaultValue',
             align: 'center',
             label: '工艺参数',
-            minWidth: 340
+            minWidth: 380
           },
           {
             prop: 'toolList',
@@ -739,6 +737,27 @@
         return true;
       },
 
+      parseInspectionNumber(val) {
+        if (val === null || val === undefined) return NaN;
+        if (typeof val === 'number') {
+          return Number.isFinite(val) ? val : NaN;
+        }
+        const s = String(val)
+          .trim()
+          .replace(/\uFF0E/g, '.')
+          .replace(/./g, '.')
+          .replace(/[,,]/g, '.');
+        if (s === '') return NaN;
+        const n = Number(s);
+        return Number.isFinite(n) ? n : NaN;
+      },
+
+      nearlyEqualNumbers(a, b) {
+        const diff = Math.abs(a - b);
+        const scale = Math.abs(a) + Math.abs(b) || 1;
+        return diff < Number.EPSILON * scale * 10;
+      },
+
       calcCheckResult(row, field) {
         const rawValue = row[field];
 
@@ -748,8 +767,8 @@
           return;
         }
 
-        const value = Number(rawValue);
-        if (isNaN(value)) return;
+        const value = this.parseInspectionNumber(rawValue);
+        if (Number.isNaN(value)) return;
 
         let pass = true;
 
@@ -757,26 +776,35 @@
           '≥': '>=',
           '≤': '<=',
           '>': '>',
-          '<': '<'
+          '<': '<',
+          '=': '='
         };
 
         const symbol = symbolMap[row.symbol] || row.symbol;
         if (row.textType == 3) {
-          let min = Number(row.minValue);
-          let max = Number(row.maxValue);
+          let min = this.parseInspectionNumber(row.minValue);
+          let max = this.parseInspectionNumber(row.maxValue);
 
-          if (isNaN(min) && isNaN(max)) return;
+          if (Number.isNaN(min) && Number.isNaN(max)) return;
 
           // 自动排序区间
-          if (!isNaN(min) && !isNaN(max) && min > max) {
+          if (!Number.isNaN(min) && !Number.isNaN(max) && min > max) {
             [min, max] = [max, min];
           }
 
-          if (!isNaN(min) && value < min) pass = false;
-          if (!isNaN(max) && value > max) pass = false;
+          if (!Number.isNaN(min) && value < min) pass = false;
+          if (!Number.isNaN(max) && value > max) pass = false;
         } else {
-          const defaultVal = Number(row.defaultValue);
-          if (isNaN(defaultVal)) return;
+          const rawDefault = row.defaultValue;
+          if (
+            rawDefault === '' ||
+            rawDefault === null ||
+            rawDefault === undefined
+          ) {
+            return;
+          }
+          const defaultVal = this.parseInspectionNumber(rawDefault);
+          if (Number.isNaN(defaultVal)) return;
 
           switch (symbol) {
             case '>':
@@ -792,7 +820,7 @@
               pass = value <= defaultVal;
               break;
             case '=':
-              pass = value == defaultVal;
+              pass = this.nearlyEqualNumbers(value, defaultVal);
               break;
           }
         }
@@ -861,4 +889,60 @@
     text-align: right;
     background: #fff;
   }
+
+  .process-param-cell {
+    display: flex;
+    align-items: center;
+    width: 100%;
+    gap: 8px;
+  }
+
+  .process-param-symbol {
+    flex: 0 0 60px;
+    width: 60px;
+    min-width: 60px;
+  }
+
+  .process-param-default {
+    flex: 1;
+    min-width: 0;
+  }
+
+  .process-param-range {
+    display: flex;
+    align-items: center;
+    flex: 1;
+    min-width: 0;
+    gap: 8px;
+  }
+
+  .process-param-range-input {
+    flex: 1;
+    min-width: 0;
+  }
+
+  .process-param-range-input--tail {
+    margin-left: 0;
+  }
+
+  .process-param-range-sep {
+    flex-shrink: 0;
+  }
+
+  .process-param-unit {
+    flex: 0 0 80px;
+    width: 80px;
+    min-width: 80px;
+  }
+
+  .process-param-symbol ::v-deep .el-select,
+  .process-param-unit ::v-deep .el-select {
+    width: 100%;
+  }
+
+  .process-param-symbol ::v-deep .el-input__inner,
+  .process-param-unit ::v-deep .el-input__inner {
+    padding-left: 8px;
+    padding-right: 28px;
+  }
 </style>

+ 4 - 0
src/views/produce/components/qualityInspection/components/selfInspectionRequest.vue

@@ -109,8 +109,10 @@
         cache-key="mes-selfInspectionRequest-20251201"
         autoAmendPage
         :need-page="false"
+        :fit="false"
         @refresh="getData"
         :selection.sync="selection"
+        style="width: 100%"
       >
         <template v-slot:toolbar>
           <el-button
@@ -149,6 +151,7 @@
               <DictSelection
                 clearable
                 dictName="数学字符"
+                value-name="dictValue"
                 :disabled="!isAdd"
                 v-model="row.symbol"
               ></DictSelection>
@@ -189,6 +192,7 @@
             <div style="width: 13%">
               <DictSelection
                 dictName="工艺参数单位"
+                value-name="dictValue"
                 clearable
                 filterable
                 :disabled="!isAdd"

+ 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: {