Browse Source

配合后端修改接口

乐菲 1 month ago
parent
commit
52b457e719

+ 24 - 2
src/views/wms/quality/iqcInspection/components/InspectDetail.vue

@@ -1291,7 +1291,18 @@ export default {
           completed,
           actualList: actualListForPC,
         } = item;
-        actualListForPC.push(actual1, actual2, actual3, actual4, actual5);
+
+        // 确保将null值转换为空字符串
+        const convertToEmptyString = (value) =>
+          value === null || value === undefined ? "" : value;
+
+        actualListForPC.push(
+          convertToEmptyString(actual1),
+          convertToEmptyString(actual2),
+          convertToEmptyString(actual3),
+          convertToEmptyString(actual4),
+          convertToEmptyString(actual5)
+        );
         return {
           id,
           singleResult,
@@ -1314,7 +1325,18 @@ export default {
     handleQualified(row) {
       const { id, actual1, actual2, actual3, actual4, actual5 } = row;
       const qualifyList = [];
-      qualifyList.push(actual1, actual2, actual3, actual4, actual5);
+
+      // 确保将null值转换为空字符串
+      const convertToEmptyString = (value) =>
+        value === null || value === undefined ? "" : value;
+
+      qualifyList.push(
+        convertToEmptyString(actual1),
+        convertToEmptyString(actual2),
+        convertToEmptyString(actual3),
+        convertToEmptyString(actual4),
+        convertToEmptyString(actual5)
+      );
       const params = {
         id,
         actualListForPC: qualifyList,

+ 66 - 82
src/views/wms/quality/iqcInspection/components/PeelingForce.vue

@@ -10,11 +10,9 @@
   >
     <el-row :gutter="10" class="mb20">
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          size="mini"
-          @click="handleViewWaveform"
-        >查看波形图</el-button>
+        <el-button type="primary" size="mini" @click="handleViewWaveform"
+          >查看波形图</el-button
+        >
       </el-col>
     </el-row>
     <!-- 列表 -->
@@ -37,26 +35,10 @@
           <span v-else>\</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="第1区间平均荷重(gf)"
-        align="center"
-        prop="avg1"
-      />
-      <el-table-column
-        label="第2区间平均荷重(gf)"
-        align="center"
-        prop="avg2"
-      />
-      <el-table-column
-        label="第3区间平均荷重(gf)"
-        align="center"
-        prop="avg3"
-      />
-      <el-table-column
-        label="第4区间平均荷重(gf)"
-        align="center"
-        prop="avg4"
-      />
+      <el-table-column label="第1区间平均荷重(gf)" align="center" prop="avg1" />
+      <el-table-column label="第2区间平均荷重(gf)" align="center" prop="avg2" />
+      <el-table-column label="第3区间平均荷重(gf)" align="center" prop="avg3" />
+      <el-table-column label="第4区间平均荷重(gf)" align="center" prop="avg4" />
       <el-table-column
         label="剥离区间最大荷重(gf)"
         align="center"
@@ -80,29 +62,28 @@
 
     <!-- 查看波形图 -->
     <IssuePrinit ref="issuePrint" />
-
   </el-dialog>
 </template>
 
 <script>
-import { getPeelingList } from '@/api/wms/quality/iqcInspectionExecute'
+import { getPeelingList } from "@/api/wms/quality/iqcInspectionExecute";
 // import { createMaterialItem, modifyMaterialItem } from '@/api/wms/quality/inspectionCase'
-import IssuePrinit from '@/views/wms/output/productionIssue/issueDetails/IssuePrinit.vue'
+import IssuePrinit from "@/views/wms/output/productionIssue/issueDetails/IssuePrinit.vue";
 
 export default {
-  name: 'AddInspectionItems',
+  name: "AddInspectionItems",
   components: {
-    IssuePrinit
+    IssuePrinit,
   },
   props: {
     inspectionType: {
       type: Number,
-      default: 0
+      default: 0,
     },
     caselist: {
       type: Array,
-      default: () => []
-    }
+      default: () => [],
+    },
   },
   data() {
     return {
@@ -124,19 +105,19 @@ export default {
       // 选中的
       selectList: [],
       // 弹出层标题
-      title: '',
-      caseTitle: '',
+      title: "",
+      caseTitle: "",
       // 物料编码,modify时传
-      materialNo: '',
+      materialNo: "",
       // 是否显示弹出层
       open: false,
-      dom: '',
+      dom: "",
       // 查询参数
       queryParams: {
         pageNo: 1,
         pageSize: 10,
         materialLots: null,
-        resultId: null
+        resultId: null,
       },
       sn: null,
       //
@@ -146,26 +127,31 @@ export default {
       isLoading: false,
       // 表单校验
       rules: {
-        inspectionNo: [{ required: true, message: '检验项编码不能为空', trigger: 'blur' }],
-        inspectionName: [{ required: true, message: '检验项名称不能为空', trigger: 'blur' }]
-      }
-    }
+        inspectionNo: [
+          { required: true, message: "检验项编码不能为空", trigger: "blur" },
+        ],
+        inspectionName: [
+          { required: true, message: "检验项名称不能为空", trigger: "blur" },
+        ],
+      },
+    };
   },
   methods: {
     /** 查询列表 */
     getList() {
-      this.loading = true
-      // 执行查询
-      getPeelingList(this.queryParams).then(response => {
-        this.list = response.data
-      }).finally(() => {
-        this.loading = false
-      })
+      // this.loading = true
+      // // 执行查询
+      // getPeelingList(this.queryParams).then(response => {
+      //   this.list = response.data
+      // }).finally(() => {
+      //   this.loading = false
+      // })
+      this.loading = false;
     },
     /** 取消按钮 */
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     /** 表单重置 */
     reset() {
@@ -178,63 +164,61 @@ export default {
         minValue: undefined,
         standValue: undefined,
         maxValue: undefined,
-        code: undefined
-      }
-      this.resetForm('form')
+        code: undefined,
+      };
+      this.resetForm("form");
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNo = 1
-      this.getList()
+      this.queryParams.pageNo = 1;
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset()
-      this.open = true
-      this.title = '添加检验项管理'
+      this.reset();
+      this.open = true;
+      this.title = "添加检验项管理";
     },
     dialogOpen() {
       this.$nextTick(() => {
-        this.getList()
-      })
+        this.getList();
+      });
     },
     dialogClose() {
-      const { queryParams } = this
-      queryParams.pageNo = 1
-      queryParams.pageSize = 10
-      this.selectList = []
-      this.getList()
+      const { queryParams } = this;
+      queryParams.pageNo = 1;
+      queryParams.pageSize = 10;
+      this.selectList = [];
+      this.getList();
     },
     getOnlyRowKey(row) {
-      return row.id
+      return row.id;
     },
     // 数据转换
     formatScientific(row, column, cellValue) {
-      const scientificNotation = /\d(?:\.(\d*))?e([+-]\d+)/
+      const scientificNotation = /\d(?:\.(\d*))?e([+-]\d+)/;
       if (scientificNotation.test(cellValue) === true) {
-        return parseFloat(cellValue).toFixed(7)
+        return parseFloat(cellValue).toFixed(7);
       } else {
-        return cellValue
+        return cellValue;
       }
     },
     // 查看波形图
     handleViewWaveform() {
       if (this.list && this.list[0]?.url) {
-        const { url } = this.list[0]
-        this.$refs.issuePrint.title = '查看波形图'
-        this.$refs.issuePrint.src = url
-        this.$refs.issuePrint.dialogVisible = true
+        const { url } = this.list[0];
+        this.$refs.issuePrint.title = "查看波形图";
+        this.$refs.issuePrint.src = url;
+        this.$refs.issuePrint.dialogVisible = true;
       } else {
-        this.$modal.msgWarning(this.list ? '暂无可展示的波形图!' : '暂无数据')
+        this.$modal.msgWarning(this.list ? "暂无可展示的波形图!" : "暂无数据");
       }
-    }
-
-  }
-}
+    },
+  },
+};
 </script>
-