Просмотр исходного кода

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-qms into dengfei

695593266@qq.com 10 месяцев назад
Родитель
Сommit
b5354cf27a

+ 93 - 7
src/views/inspectionWork/components/sampleListDialog.vue

@@ -20,32 +20,78 @@
                 prop="qualitySchemeTemplateCode"
                 prop="qualitySchemeTemplateCode"
                 align="center"
                 align="center"
               >
               >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.qualitySchemeTemplateCode }}
+                  </span>
+                </template>
               </el-table-column>
               </el-table-column>
               <el-table-column
               <el-table-column
                 label="质检方案名称"
                 label="质检方案名称"
                 prop="qualitySchemeTemplateName"
                 prop="qualitySchemeTemplateName"
                 align="center"
                 align="center"
-              ></el-table-column>
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.qualitySchemeTemplateName }}
+                  </span>
+                </template>
+              </el-table-column>
               <el-table-column
               <el-table-column
                 label="质检类型"
                 label="质检类型"
                 prop="categoryLevelClassName"
                 prop="categoryLevelClassName"
                 align="center"
                 align="center"
-              ></el-table-column>
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.categoryLevelClassName }}
+                  </span>
+                </template>
+              </el-table-column>
               <el-table-column
               <el-table-column
                 label="质检项编码"
                 label="质检项编码"
                 prop="inspectionCode"
                 prop="inspectionCode"
                 align="center"
                 align="center"
-              ></el-table-column>
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.inspectionCode }}
+                  </span>
+                </template>
+              </el-table-column>
               <el-table-column
               <el-table-column
                 label="质检项名称"
                 label="质检项名称"
                 prop="inspectionName"
                 prop="inspectionName"
                 align="center"
                 align="center"
-              ></el-table-column>
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.inspectionName }}
+                  </span>
+                </template>
+              </el-table-column>
               <el-table-column
               <el-table-column
                 label="工艺参数"
                 label="工艺参数"
                 prop="defaultValue"
                 prop="defaultValue"
                 align="center"
                 align="center"
               >
               >
+                <template slot-scope="scope">
+                  <!-- <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.defaultValue }}
+                  </span> -->
+                  <div style="display: flex; justify-content: center" :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    <span>{{ scope.row.symbol }}</span>
+                    <span v-if="scope.row.textType == 3">
+                      {{ scope.row.minValue }}-{{ scope.row.maxValue }}
+                    </span>
+
+                    <span v-else>
+                      <span>{{ scope.row.defaultValue }}</span>
+                    </span>
+
+                    {{ scope.row.unitName }}
+                  </div>
+                </template>
               </el-table-column>
               </el-table-column>
               <el-table-column label="质检工具" prop="" align="center">
               <el-table-column label="质检工具" prop="" align="center">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
@@ -65,6 +111,8 @@
               >
               >
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                   <el-input
                   <el-input
+                    :class="scope.row.qualityResults === 2 ? 'warn' : ''"
+                    @blur="(e) => inputResultContent(e, scope.row)"
                     v-model="scope.row.qualityResultContent"
                     v-model="scope.row.qualityResultContent"
                     placeholder="请输入内容"
                     placeholder="请输入内容"
                     :disabled="type == 'detail'"
                     :disabled="type == 'detail'"
@@ -234,16 +282,19 @@
         this.tableData = [];
         this.tableData = [];
         this.rowIndex = index;
         this.rowIndex = index;
         this.type = type;
         this.type = type;
+        console.log(list, 'list +++++++++');
         // console.log(list, 'lklllllllllllllllllkkkkkkkkkkkkkkkkkkkkk', list[0].qualityResults);
         // console.log(list, 'lklllllllllllllllllkkkkkkkkkkkkkkkkkkkkk', list[0].qualityResults);
         //如果质检项qualitySampleTemplateList只有一条数据且质检结果是让步接收
         //如果质检项qualitySampleTemplateList只有一条数据且质检结果是让步接收
         if (list[0].qualitySampleTemplateList.length == 1) {
         if (list[0].qualitySampleTemplateList.length == 1) {
           for (let i = 0; i < list[0].qualitySampleTemplateList.length; i++) {
           for (let i = 0; i < list[0].qualitySampleTemplateList.length; i++) {
-            list[0].qualitySampleTemplateList[i].qualityResults =
-              list[0].qualityResults;
+            list[0].qualitySampleTemplateList[i].qualityResults = list[0]
+              .qualityResults
+              ? list[0].qualityResults
+              : 1;
           }
           }
         }
         }
         this.tableData = JSON.parse(JSON.stringify(list));
         this.tableData = JSON.parse(JSON.stringify(list));
-        console.log( this.tableData,'33333333333333333');
+        console.log(this.tableData, '33333333333333333');
 
 
         this.visible = true;
         this.visible = true;
       },
       },
@@ -265,7 +316,33 @@
         });
         });
         return getQualityValue;
         return getQualityValue;
       },
       },
+      inputResultContent(e, row) {
+        console.log(row, 'row row row');
+        console.log(e, 'eeeeeeeee');
+        if (row.textType == '1') {
+          if (row.qualityResultContent != row.defaultValue) {
+            this.$set(row, 'qualityResults', 2);
+          } else {
+            this.$set(row, 'qualityResults', 1);
+          }
+          return;
+        }
+        if (row.textType == '3') {
+          let num = Number(row.qualityResultContent)
+          if(num == NaN){
+             this.$set(row, 'qualityResults', 2);
+            return;
+          }
+          console.log(num,'num')
+          if(num >= Number(row.minValue) && num <= Number(row.maxValue)){
+            this.$set(row, 'qualityResults', 1);
+          }else{
+             this.$set(row, 'qualityResults', 2);
+          }
+        }
 
 
+        console.log(row, 'row 11111111111');
+      },
       handleClose() {
       handleClose() {
         this.visible = false;
         this.visible = false;
       },
       },
@@ -284,3 +361,12 @@
     }
     }
   };
   };
 </script>
 </script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 2 - 0
src/views/unqualifiedProduct/unqualifiedList/components/factoryAdd.vue

@@ -1044,6 +1044,8 @@
           if (this.form.productInfoList.length) {
           if (this.form.productInfoList.length) {
             this.form.productInfoList.map((item, index) => {
             this.form.productInfoList.map((item, index) => {
               delete item.selectionRowShow;
               delete item.selectionRowShow;
+              item.productCode = item.categoryCode;
+              item.productName = item.categoryName;
               if (item.bomVersionList && item.bomVersionList.length) {
               if (item.bomVersionList && item.bomVersionList.length) {
                 item.bomCategoryName = item.bomVersionList[0].name;
                 item.bomCategoryName = item.bomVersionList[0].name;
                 item.bomCategoryVersions = item.bomVersionList[0].versions;
                 item.bomCategoryVersions = item.bomVersionList[0].versions;