From cd410558db0d54fe1e21ec691fe886177d357ae5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 21 四月 2025 15:29:54 +0800
Subject: [PATCH] 1.项检分析-数据分析修改

---
 src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue       |    1 
 src/views/business/materialOrder/copperOrder.vue                                       |   13 ---
 src/views/CNAS/personnel/personnelInfo/tabs/training-record.vue                        |   16 ----
 src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue |   12 ---
 src/views/business/materialOrderComponents/materialOrder/showInfo.vue                  |    6 -
 src/components/echarts/DataComparison.vue                                              |  131 ++++++++++++++++++++------------
 src/views/business/inspectionView/index.vue                                            |   14 ---
 src/views/business/inspectionTask/inspection.vue                                       |   14 ---
 src/views/business/materialOrder/copperView.vue                                        |   13 ---
 9 files changed, 83 insertions(+), 137 deletions(-)

diff --git a/src/components/echarts/DataComparison.vue b/src/components/echarts/DataComparison.vue
index 19d65e7..fd62924 100644
--- a/src/components/echarts/DataComparison.vue
+++ b/src/components/echarts/DataComparison.vue
@@ -163,7 +163,7 @@
                      :legend="legend2"
                      :lineColors="lineColors"
                      :series="echartsSeries2"
-                     :tooltip="tooltip"
+                     :tooltip="tooltip1"
                      :xAxis="xAxis"
                      :yAxis="yAxis2"
                      style="height: 40vh;"></Echarts>
@@ -190,6 +190,7 @@
 
 <script>
 import Echarts from "./echarts.vue";
+import {getRawSupplierCompare} from "@/api/statisticalCharts/dataAnalysis";
 
 export default {
   name: "DataComparison",
@@ -277,6 +278,20 @@
           type: 'shadow'
         }
       },
+      tooltip1: {
+        trigger: 'axis',
+        axisPointer: {
+          type: 'shadow'
+        },
+        formatter: (params) => {
+          // params 鏄竴涓暟缁勶紝鍖呭惈褰撳墠榧犳爣鎮仠鐨勬墍鏈夌郴鍒楃殑鏁版嵁
+          return params.map(param => {
+            const value = param.value; // 鑾峰彇褰撳墠鏁版嵁鐐圭殑鍊�
+            const name = param.seriesName; // 鑾峰彇绯诲垪鍚嶇О
+            return `${name}: ${Math.round(value)}%`; // 鏍煎紡鍖栦负鐧惧垎姣斿舰寮�
+          }).join('<br>'); // 姣忎釜绯诲垪鍗犱竴琛�
+        }
+      },
       xAxis: [{
         type: 'category',
         data: ['1', '2', '3', '4', '5']
@@ -351,7 +366,10 @@
       yAxis2: [{
         type: 'value',
         min: 0,
-        max: 1,
+        max: 100,
+        axisLabel: {
+          formatter: '{value}%' // 鍦ㄦ瘡涓埢搴﹀�煎悗娣诲姞鐧惧垎姣旂鍙�
+        }
       }],
       echartsSeries2: [
         {
@@ -360,7 +378,7 @@
           label: {
             show: true,
             position: 'top',
-            formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
+            formatter: (params) => params.value + '%'
           },
           data: [],
         },
@@ -370,7 +388,7 @@
           label: {
             show: true,
             position: 'top',
-            formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
+            formatter: (params) => params.value + '%'
           },
           data: [],
         }
@@ -389,43 +407,65 @@
   },
   // 鏂规硶闆嗗悎
   methods: {
-    getInfo () {
-      this.localData = this.comparisonData.localData === null ? ['', '', '', '', '','','', '', ''] : this.comparisonData.localData
-      this.localData = this.localData.map((number, index) => index === 7 ? `${Math.round(number * 100)}%` : number)
-      this.echartsSeries3[0].data = this.localData.slice(0, 5)
-      this.localULC = this.comparisonData.localULC
-      this.localLCL = this.comparisonData.localLCL
-      this.localAverage = this.comparisonData.localAverage
-      this.localRange = this.comparisonData.localRange
+    getInfo() {
+      const { localData, localULC, localLCL, localAverage, localRange } = this.comparisonData;
+      // 鍒濆鍖� localData锛岀‘淇濇湁榛樿鍊�
+      this.localData = localData === null
+        ? ['', '', '', '', '', '', '', '', '']
+        : localData.map((number, index) => index === 7 ? `${Math.round(number * 100)}%` : number);
+      // 鏇存柊鍥捐〃鏁版嵁
+      this.echartsSeries3[0].data = this.localData.slice(0, 5);
+      this.localULC = localULC;
+      this.localLCL = localLCL;
+      this.localAverage = localAverage;
+      this.localRange = localRange;
     },
-    getInfo1 () {
-      this.echartsSeries1[0].data = []
-      this.supplierData = this.comparisonData1.supplierData === null ? ['', '', '', '', '','','', '', ''] : this.comparisonData1.supplierData
-      this.localData = this.comparisonData1.localData === null ? ['', '', '', '', '','','', '', ''] : this.comparisonData1.localData
-      this.localData = this.localData.map((number, index) => index === 7 ? `${Math.round(number * 100)}%` : number)
-      this.echartsSeries3[0].data = this.localData.slice(0, 5)
-      this.echartsSeries[0].data = this.supplierData
-      this.echartsSeries[1].data = this.localData
-      this.absoluteDeviation = this.comparisonData1.absoluteDeviation === null ? ['', '', '', '', '','','', '', ''] : this.comparisonData1.absoluteDeviation
-      this.echartsSeries2[1].data = this.absoluteDeviation
-      this.absoluteDeviation = this.absoluteDeviation.map(number => `${Math.round(number * 100)}%`) // 缁濆鍋忓樊鐧惧垎姣旇浆鎹�
-      this.average = this.comparisonData1.average === null ? ['', '', '', '', '','','', '', ''] : this.comparisonData1.average
-      this.echartsSeries2[0].data = this.average
-      this.average = this.average.map(number => `${Math.round(number * 100)}%`) // 骞冲潎鍊肩櫨鍒嗘瘮杞崲
-      this.supplierULC = this.comparisonData1.supplierULC === null ? ['', '', '', '', ''] : this.comparisonData1.supplierULC
-      this.echartsSeries1[0].data.push(this.supplierULC[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.supplierLCL = this.comparisonData1.supplierLCL === null ? ['', '', '', '', ''] : this.comparisonData1.supplierLCL
-      this.echartsSeries1[1].data.push(this.supplierLCL[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.supplierAverage = this.comparisonData1.supplierAverage === null ? ['', '', '', '', ''] : this.comparisonData1.supplierAverage
-      this.echartsSeries1[2].data.push(this.supplierAverage[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.supplierRange = this.comparisonData1.supplierRange === null ? ['', '', '', '', ''] : this.comparisonData1.supplierRange
-      this.localULC = this.comparisonData1.localULC
-      this.echartsSeries1[0].data.push(this.localULC[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.localLCL = this.comparisonData1.localLCL
-      this.echartsSeries1[1].data.push(this.localLCL[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.localAverage = this.comparisonData1.localAverage
-      this.echartsSeries1[2].data.push(this.localAverage[0]) // 娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
-      this.localRange = this.comparisonData1.localRange
+    getInfo1() {
+      const {
+        supplierData,
+        localData,
+        absoluteDeviation,
+        average,
+        supplierULC,
+        supplierLCL,
+        supplierAverage,
+        supplierRange,
+        localULC,
+        localLCL,
+        localAverage,
+        localRange,
+      } = this.comparisonData1;
+      // 杈呭姪鍑芥暟锛氬鐞嗙┖鏁版嵁骞惰浆鎹㈢櫨鍒嗘瘮
+      const processPercentageData = (data, defaultValue = ['', '', '', '', '', '', '', '', '']) =>
+        data === null ? defaultValue : data.map((number, index) => index === 7 ? `${Math.round(number * 100)}%` : number);
+      // 杈呭姪鍑芥暟锛氬鐞嗙┖鏁板�煎瀷鏁版嵁
+      const processNumericData = (data, defaultValue = ['', '', '', '', '']) =>
+        data === null ? defaultValue : data;
+      // 鍒濆鍖栨暟鎹�
+      this.supplierData = processPercentageData(supplierData);
+      this.localData = processPercentageData(localData);
+      this.absoluteDeviation = processPercentageData(absoluteDeviation).map(number => `${Math.round(number * 100)}%`);
+      this.average = processPercentageData(average).map(number => `${Math.round(number * 100)}%`);
+      // 鏇存柊鍥捐〃鏁版嵁
+      this.echartsSeries1[0].data = [];
+      this.echartsSeries3[0].data = this.localData.slice(0, 5);
+      this.echartsSeries[0].data = this.supplierData;
+      this.echartsSeries[1].data = this.localData;
+      this.echartsSeries2[1].data = this.comparisonData1.absoluteDeviation.map(value => value * 100);
+      this.echartsSeries2[0].data = this.comparisonData1.average.map(value => value * 100);
+      // 澶勭悊渚涘簲鍟嗗拰鏈湴鐨勬爣鍑嗗樊瀵规瘮鏁版嵁
+      this.supplierULC = processNumericData(supplierULC);
+      this.supplierLCL = processNumericData(supplierLCL);
+      this.supplierAverage = processNumericData(supplierAverage);
+      this.supplierRange = processNumericData(supplierRange);
+      this.localULC = processNumericData(localULC);
+      this.localLCL = processNumericData(localLCL);
+      this.localAverage = processNumericData(localAverage);
+      this.localRange = processNumericData(localRange);
+      // 鏇存柊娴嬮噺鏁版嵁鏍囧噯宸姣旀煴鐘跺浘鏁版嵁
+      this.echartsSeries1[0].data.push(this.supplierULC[0], this.localULC[0]);
+      this.echartsSeries1[1].data.push(this.supplierLCL[0], this.localLCL[0]);
+      this.echartsSeries1[2].data.push(this.supplierAverage[0], this.localAverage[0]);
     },
     submitForm () {
       this.$refs['supplierForm'].validate((valid) => {
@@ -435,12 +475,7 @@
             itemNames: this.selectRow.itemNames,
             supplierDataList: Object.values(this.supplierForm)
           }
-          this.$axios.post(this.$api.dataAnalysis.getRawSupplierCompare, params, {
-            headers: {
-              'Content-Type': 'application/json'
-            },
-            noQs: true
-          }).then(res => {
+          getRawSupplierCompare(params).then(res => {
             this.comparisonData1 = res.data
             this.getInfo1()
           })
@@ -459,8 +494,8 @@
 
 <style scoped>
 .title {
-  height: 60px;
-  line-height: 60px;
+  height: 40px;
+  line-height: 40px;
 }
 .container {
   width: calc(100% - 20px);
diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/training-record.vue b/src/views/CNAS/personnel/personnelInfo/tabs/training-record.vue
index 57c6947..52d1c4b 100644
--- a/src/views/CNAS/personnel/personnelInfo/tabs/training-record.vue
+++ b/src/views/CNAS/personnel/personnelInfo/tabs/training-record.vue
@@ -169,22 +169,6 @@
     this.getPersonnelTraining(this.departId);
   },
   methods: {
-    // exportExcel() {
-    //   this.outLoading = true;
-    //   const name = this.isDepartment ? 'departmentId' : 'userId';
-    //   this.$axios.get(this.$api.personal.personTrackRecordExport + `&${name}=` + this.departId, { responseType: 'blob' }).then(res => {
-    //     this.outLoading = false;
-    //     this.$message.success('瀵煎嚭鎴愬姛');
-    //     const blob = new Blob([res], { type: 'application/octet-stream' });
-    //     const url = URL.createObjectURL(blob);
-    //     const link = document.createElement('a');
-    //     link.href = url;
-    //     link.download = '鍩硅璁板綍.xlsx';
-    //     link.click();
-    //   }).catch(err => {
-    //     this.outLoading = false;
-    //   })
-    // },
     // 鏌ヨ
     refreshTable() {
       this.getPersonnelTraining(this.departId);
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
index 5d2f2c8..c96c0bb 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
@@ -461,18 +461,6 @@
         this.personList = data;
       });
     },
-    // getSupervisedUserList () {
-    //   this.$axios.get(this.$api.user.selectDepartmentLimsUserList).then(res => {
-    //     let data = []
-    //     res.data.forEach(a => {
-    //       data.push({
-    //         label: a.name,
-    //         value: a.id
-    //       })
-    //     })
-    //     this.supervisedUserList = data
-    //   })
-    // },
   }
 };
 </script>
diff --git a/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
index be50c66..aabb2dc 100644
--- a/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
+++ b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
@@ -248,7 +248,6 @@
   methods: {
     // 鏂板
     openAdd() {
-      // this.$refs.ValueTable.openAddDia(this.$api.manageRecordIssueRecycle.addManageRecordIssueRecycle);
       this.addInfo = {}
       this.title = '鏂板'
       this.addDialogVisible = true;
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index cfaa862..f648679 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -1641,20 +1641,6 @@
         this.comparisonList = this.dictToValue(response.data);
       });
     },
-    // 鑾峰彇妫�楠屽�间负涓嬫媺鏃剁殑涓嬫媺鍒楄〃
-    // selectEnumByCategoryOfSelect(val) {
-    //   this.enumList = [];
-    //   if (val === undefined || val === null) {
-    //     return;
-    //   }
-    //   this.$axios
-    //     .post(this.$api.enums.selectEnumByCategory, {
-    //       category: val,
-    //     })
-    //     .then((res) => {
-    //       this.enumList = res.data;
-    //     });
-    // },
     tableRowClassName({ row, rowIndex }) {
       row.index = rowIndex + 1;
     },
diff --git a/src/views/business/inspectionView/index.vue b/src/views/business/inspectionView/index.vue
index f160492..c7f43c5 100644
--- a/src/views/business/inspectionView/index.vue
+++ b/src/views/business/inspectionView/index.vue
@@ -1639,20 +1639,6 @@
         this.comparisonList = this.dictToValue(response.data);
       });
     },
-    // 鑾峰彇妫�楠屽�间负涓嬫媺鏃剁殑涓嬫媺鍒楄〃
-    // selectEnumByCategoryOfSelect(val) {
-    //   this.enumList = [];
-    //   if (val === undefined || val === null) {
-    //     return;
-    //   }
-    //   this.$axios
-    //     .post(this.$api.enums.selectEnumByCategory, {
-    //       category: val,
-    //     })
-    //     .then((res) => {
-    //       this.enumList = res.data;
-    //     });
-    // },
     tableRowClassName({ row, rowIndex }) {
       row.index = rowIndex + 1;
     },
diff --git a/src/views/business/materialOrder/copperOrder.vue b/src/views/business/materialOrder/copperOrder.vue
index 7613887..fd8bbdd 100644
--- a/src/views/business/materialOrder/copperOrder.vue
+++ b/src/views/business/materialOrder/copperOrder.vue
@@ -1496,19 +1496,6 @@
       })
       // this.searchTemList()
     },
-    // searchTemList () {
-    //   this.temperatureList = []
-    //   this.$axios.post(this.$api.enums.selectEnumByCategory, {
-    //     category: "鐢靛姏娓╁害寰幆妫�楠�"
-    //   }).then(res => {
-    //     if (res.data.length > 0) {
-    //       this.temperatureEngList = res.data
-    //       res.data.forEach(item => {
-    //         this.temperatureList.push(item.label)
-    //       })
-    //     }
-    //   })
-    // },
     changeModel() {
       this.sampleList.forEach(a => {
         let obj = this.sampleIds.find(b => b == a.id)
diff --git a/src/views/business/materialOrder/copperView.vue b/src/views/business/materialOrder/copperView.vue
index 7a5a8f8..9d0595b 100644
--- a/src/views/business/materialOrder/copperView.vue
+++ b/src/views/business/materialOrder/copperView.vue
@@ -1495,19 +1495,6 @@
       })
       // this.searchTemList()
     },
-    // searchTemList () {
-    //   this.temperatureList = []
-    //   this.$axios.post(this.$api.enums.selectEnumByCategory, {
-    //     category: "鐢靛姏娓╁害寰幆妫�楠�"
-    //   }).then(res => {
-    //     if (res.data.length > 0) {
-    //       this.temperatureEngList = res.data
-    //       res.data.forEach(item => {
-    //         this.temperatureList.push(item.label)
-    //       })
-    //     }
-    //   })
-    // },
     changeModel() {
       this.sampleList.forEach(a => {
         let obj = this.sampleIds.find(b => b == a.id)
diff --git a/src/views/business/materialOrderComponents/materialOrder/showInfo.vue b/src/views/business/materialOrderComponents/materialOrder/showInfo.vue
index 1a902e7..4dab747 100644
--- a/src/views/business/materialOrderComponents/materialOrder/showInfo.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/showInfo.vue
@@ -34,12 +34,6 @@
   methods: {
     getInfo (id) {
       console.log('id----', id)
-      this.$axios.get(this.$api.rawMaterialOrder.getIndustryChain + '?id=' + id).then(res => {
-        if (res.code === 200 && res.data !== null) {
-          this.infoLIst = JSON.parse(res.data)
-          console.log('this.infoLIst----', this.infoLIst)
-        }
-      })
     }
   },
 }

--
Gitblit v1.9.3