Ver Fonte

Merge branch 'master' of http://47.101.207.123:3000/gbtomr/digital-agric

gr há 1 ano atrás
pai
commit
4bfc6826d1
2 ficheiros alterados com 84 adições e 58 exclusões
  1. 28 1
      src/services/znfx.js
  2. 56 57
      src/views/deck/pages/znfx_sub/ZnfxNcpzl.vue

+ 28 - 1
src/services/znfx.js

@@ -86,4 +86,31 @@ export function GetHistoryLand() {
     url: `nyd/get_history_land_statistics`,
     method: "get"
   })
-}
+}
+
+//智慧速测-检测合格率和总数统计
+export function GetPassRateAndCount() {
+  return request({
+    url: 'http://101.132.114.72:8080/cmnw_trans/trans/zhsc/statistics',
+    method: 'get'
+  })
+}
+
+//当年的检测项目分类统计
+export function GetProjectStatictics(){
+  return request({
+    url: 'http://101.132.114.72:8080/cmnw_trans/trans/zhsc/statistics_checkProject',
+    method: 'get'
+  })
+}
+
+//实时速测数据情况
+export function GetActualData(params) {
+  return request({
+    url: 'http://101.132.114.72:8080/cmnw_trans/trans/zhsc/list',
+    method: 'get',
+    params: {
+      ...params
+    }
+  })
+}

+ 56 - 57
src/views/deck/pages/znfx_sub/ZnfxNcpzl.vue

@@ -19,24 +19,24 @@
     <div class="panel-check panel-default" v-if="listShow_check">
       <main>
         <div class="pc-sort">
-          <el-input v-model="check_sort.ztmc" style="width: 45%;" class="select-default" placeholder="请输入被检测主体名称"></el-input>
+          <el-input v-model="check_sort.beCheckedUnit" style="width: 45%;" class="select-default" placeholder="请输入被检测主体名称"></el-input>
           <el-select v-model="check_sort.period" style="width: 20%;" class="select-default" popper-class="select-default-popper">
-            <el-option v-for="item in ['近七天']" :key="item" :label="item" :value="item"></el-option>
+            <el-option v-for="item in ['近七天','近一个月','近一年']" :key="item" :label="item" :value="item"></el-option>
           </el-select>
-          <el-select v-model="check_sort.result" style="width: 20%;" class="select-default" popper-class="select-default-popper">
-            <el-option v-for="item in ['全部','合格','不合格']" :key="item" :label="item" :value="item"></el-option>
+          <el-select v-model="check_sort.verdictID" style="width: 20%;" class="select-default" popper-class="select-default-popper">
+            <el-option v-for="item in ['合格','不合格']" :key="item" :label="item" :value="item"></el-option>
           </el-select>
-          <span class="button-default">查询</span>
+          <span class="button-default" @click="toQuery()">查询</span>
         </div>
         <el-table :data="check_tableData" class="table-default" height="86%">
           <el-table-column label="序号" type="index" />
-          <el-table-column label="检测时间" prop="time" min-width="80" show-overflow-tooltip/>
-          <el-table-column label="被检测主体" prop="bjczt" min-width="110" show-overflow-tooltip/>
-          <el-table-column label="检测项目" prop="jcxm" min-width="100" show-overflow-tooltip/>
-          <el-table-column label="检测品种" prop="jcpz" min-width="70" show-overflow-tooltip/>
+          <el-table-column label="检测时间" prop="checkDate" min-width="80" show-overflow-tooltip/>
+          <el-table-column label="被检测主体" prop="beCheckedUnit" min-width="110" show-overflow-tooltip/>
+          <el-table-column label="检测项目" prop="checkProject" min-width="100" show-overflow-tooltip/>
+          <el-table-column label="检测品种" prop="sampleName" min-width="70" show-overflow-tooltip/>
           <el-table-column label="检测结果" min-width="70" show-overflow-tooltip>
             <template #default="scope">
-              <span :class="{'table-row-alert':scope.row.jcjg==='不合格'}">{{ scope.row.jcjg }}</span>
+              <span :class="{'table-row-alert':scope.row.resultText==='阳性'}">{{ scope.row.resultText === '阴性' ? '合格' : '不合格' }}</span>
             </template>
           </el-table-column>
         </el-table>
@@ -49,12 +49,12 @@
           <li v-for="item in data_clb1" :key="item.type">
             <div>
               <div>
-                <span class="clb1-num">{{ item.percent }}</span><span class="clb1-unit">%</span>
+                <span class="clb1-num">{{ item.heGeLV }}</span><span class="clb1-unit">%</span>
               </div>
               <span>{{ item.type }}</span>
             </div>
             <div>
-              <span>总数(次)</span><span class="clb1-num">{{ item.count }}</span>
+              <span>总数(次)</span><span class="clb1-num">{{ item.zongShu }}</span>
             </div>
           </li>
         </ul>
@@ -62,25 +62,25 @@
       <span class="box-title2">实时检测情况</span>
       <div class="cl-b2">
         <el-table :data="data_clb2" class="table-default" height="20vh">
-          <el-table-column label="品种" prop="pz" min-width="50" show-overflow-tooltip/>
-          <el-table-column label="检测项目" prop="jcxm" min-width="100" show-overflow-tooltip/>
+          <el-table-column label="品种" prop="sampleName" min-width="50" show-overflow-tooltip/>
+          <el-table-column label="检测项目" prop="checkProject" min-width="100" show-overflow-tooltip/>
           <el-table-column label="检测结果" min-width="70" show-overflow-tooltip>
             <template #default="scope">
-              <div class="table-row-jcjg" :class="{'is-danger':scope.row.jcjg.indexOf('阳性')!==-1}">
-                <span>{{ scope.row.jcjg.slice(0,2) }}</span>
-                <span>{{ scope.row.jcjg.slice(2) }}</span>
+              <div class="table-row-jcjg" :class="{'is-danger':scope.row.resultText.indexOf('阳性')!==-1}">
+                <span>{{ scope.row.resultText }}</span>
+                <span>{{ scope.row.resultValue }}</span>
               </div>
             </template>
           </el-table-column>
-          <el-table-column label="时间" prop="time" min-width="80" show-overflow-tooltip/>
+          <el-table-column label="时间" prop="checkDate" min-width="80" show-overflow-tooltip/>
         </el-table>
       </div>
       <span class="box-title2">检测项目占比(今年)</span>
       <ul class="cl-b3">
-        <li v-for="(item, index) in data_clb3" :key="item.catagory">
+        <li v-for="(item, index) in data_clb3" :key="item.checkProject">
           <span>{{ (index+1).toString().padStart(2,0) }}</span>
-          <span>{{ item.catagory }}</span>
-          <span>{{ item.count.toLocaleString() }}</span>
+          <span>{{ item.checkProject }}</span>
+          <span>{{ item.zongShu.toLocaleString() }}</span>
           <span>次</span>
         </li>
       </ul>
@@ -155,14 +155,15 @@
 </template>
 
 <script>
+import { GetPassRateAndCount,GetProjectStatictics,GetActualData } from '@/services/znfx'
 
 export default {
   name: 'ZnfxNcpzl',
   data() {
     return {
       data_clb1: [
-        { type: '近7天', percent: 98, count: 91233 },
-        { type: '今年', percent: 96, count: 91233 },
+        { type: '近7天', heGeLV: 98, zongShu: 91233, key: 'sevenDay' },
+        { type: '今年', heGeLV: 96, zongShu: 91233, key: 'year' },
       ],
       sort_rcxc: {
         year: '',
@@ -170,19 +171,14 @@ export default {
       },
       yearArr: [],
       monthArr: [],
-      data_clb2: [
-        { pz: '生菜', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcjg:'阴性4.4', time: '2023-06-06' },
-        { pz: '西芹', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcjg:'阳性4.4', time: '2023-06-06' },
-        { pz: '小青菜', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcjg:'阴性4.4', time: '2023-06-06' },
-        { pz: '莴笋', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcjg:'阴性4.4', time: '2023-06-06' }
-      ],
+      data_clb2: [],
       data_clb3: [
-        { catagory: '农药残留(有机磷和氨基甲酸酯类)', count: 3212 },
-        { catagory: '烯酰吗啉', count: 3212 },
-        { catagory: '噻虫嗪', count: 3212 },
-        { catagory: '啶虫脒', count: 3212 },
-        { catagory: '腐霉利', count: 3212 },
-        { catagory: '毒死婢', count: 3212 },
+        // { checkProject: '农药残留(有机磷和氨基甲酸酯类)', zongShu: 3212 },
+        // { checkProject: '烯酰吗啉', zongShu: 3212 },
+        // { checkProject: '噻虫嗪', zongShu: 3212 },
+        // { checkProject: '啶虫脒', zongShu: 3212 },
+        // { checkProject: '腐霉利', zongShu: 3212 },
+        // { checkProject: '毒死婢', zongShu: 3212 },
       ],
       data_clb4: [
         { ztmc: 'XXXX经营社', sample:'绿叶菜', result: '待复检' },
@@ -249,26 +245,10 @@ export default {
       ],
       listShow_check: false,
       check_sort: {
-        ztmc: '',
-        period: '近七天',
-        result: '全部'
+          pageIndex: 1,
+          pageSize: 10
       },
-      check_tableData: [
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-        { time: '2023.06.04', bjczt: '崇明区XXX果蔬合作社', jcxm: '农药残留(有机磷和氨基甲酸酯类)', jcpz: '小青菜', jcjg: '不合格' },
-      ]
+      check_tableData: []
     }
   },
   mounted() {
@@ -276,6 +256,17 @@ export default {
     this.sort_rcxc.year = new Date().getFullYear()
     this.getMonthArr()
     this.sort_rcxc.month = new Date().getMonth()+1
+
+    GetPassRateAndCount().then(res => {
+        this.data_clb1.forEach(i => {
+            i.heGeLV = res.data[i.key].heGeLV
+            i.zongShu = res.data[i.key].zongShu
+        })
+    })
+    GetProjectStatictics().then(res => {
+      this.data_clb3 = res.data
+    })
+    this.toQuery()
   },
   methods: {
     getRecentYears() {
@@ -305,6 +296,12 @@ export default {
     },
     openCheckList() {
       this.listShow_check = true
+    },
+    toQuery(){
+        GetActualData(this.check_sort).then(res => {
+          this.data_clb2 = res.data
+          this.check_tableData = res.data
+        })
     }
   }
 }
@@ -418,7 +415,6 @@ export default {
         display: block;
         margin: 12px 0;
       }
-      
     }
   }
 }
@@ -435,7 +431,10 @@ export default {
 }
 
 .cl-b3 {
-  margin-left: 10px;
+    max-height: 20vh;
+    overflow-y: auto;
+    margin-left: 10px;
+padding-top: 20px;
   li {
     height: 38px;
     background: linear-gradient(90deg, rgba(192,196,204,0.08), rgba(192,196,204,0.01));
@@ -564,4 +563,4 @@ export default {
     }
   }
 }
-</style>
+</style>