Quellcode durchsuchen

大方室间质评看板调整

shenqilong vor 1 Jahr
Ursprung
Commit
cd1b5c56fd

+ 11 - 3
src/views/InterLaboratory/interStatistics/botChart.vue

@@ -1,10 +1,10 @@
 <template>
     <div class="pieView">
-        <div style="  height:14%;line-height:30px;text-align: left;padding-left: 10px;color: white;">
+        <div style="height:10%;line-height:30px;text-align: left;padding-left: 10px;padding-top: 10px; margin-bottom: -50px; color: white;">
             {{ info.title || "" }}
         </div>
-        <div style="width: 100%; height: 86%; display: inline-block; overflow: hidden">
-            <div :id="info.id" style="width: 100%; height: 95%; overflow: hidden" />
+        <div style="width: 100%; height: 95%; display: inline-block; overflow: hidden">
+            <div :id="info.id" style="width: 100%; height: 100%; overflow: hidden;padding-right: 10px;" />
         </div>
 
     </div>
@@ -36,6 +36,8 @@ export default {
                 },
                 toolbox: {
                     feature: {
+
+                        bottom: '10',
                         dataView: { show: true, readOnly: false },
                         magicType: { show: true, type: ['line', 'bar'] },
                         restore: { show: true },
@@ -43,6 +45,9 @@ export default {
                     }
                 },
                 legend: {
+                    orient: 'vertical',
+                    left: 'center',
+                    bottom: 'bottom',
                     data: [],
                     textStyle: {
                         color: '#ffff',
@@ -83,6 +88,7 @@ export default {
                 ],
                 series: [
                     {
+                        barMaxWidth: 30,
                         name: '',
                         type: 'line',
                         yAxisIndex: 1,
@@ -94,6 +100,7 @@ export default {
                         data: []
                     },
                     {
+                        barMaxWidth: 30,
                         name: '',
                         type: 'bar',
                         tooltip: {
@@ -104,6 +111,7 @@ export default {
                         data: []
                     },
                     {
+                        barMaxWidth: 30,
                         name: '',
                         type: 'bar',
                         tooltip: {

+ 65 - 38
src/views/InterLaboratory/interStatistics/index.vue

@@ -42,9 +42,9 @@
                         <div style="margin-right:10px;">选择年份</div>
                         <yearrange st :year-values="yearValues" :size="size" :value-format="valueFormat" />
                     </div>
-                    <div style="display: flex; text-align: center; height:38px; line-height: 38px;width: 25%;position: absolute; left: 33%;top:16%;z-index:1">
-                        <div style="margin-right:10px;">活动名称</div>
-                        <el-select v-model="activityValue" clearable filterable placeholder="请选择">
+                    <div style="display: flex; text-align: center; height:38px; line-height: 38px;width: 25%;position: absolute; left: 33%;top:15%;z-index:1">
+                        <div style="margin-right:10px;font-size: 14px;">活动名称</div>
+                        <el-select v-model="activityValue" size="small" clearable filterable placeholder="请选择">
                             <el-option
                                 v-for="item in activityList"
                                 :key="item.value"
@@ -287,39 +287,66 @@ export default {
                 }
             })
         },
-        getList2 () {
+        async getList2 () {
             this.result = []
             const yearStr = `('${this.yearArr.join("', '")}')`
-            const sql = `select LEFT(bi_dui_lei_xing_, 2) as leixing,LEFT(zhu_biao_shi_jian, 4) as niandu, COALESCE(COUNT(*), 0) as count FROM t_sjzphdjhylxqb where left(zhu_biao_shi_jian, 4) in ${yearStr} GROUP BY CONCAT(LEFT(zhu_biao_shi_jian, 4), ' ', LEFT(bi_dui_lei_xing_, 2))`
-            this.$common.request('sql', sql).then((res) => {
-                const data = res.variables.data
-                // console.log(data)
-
-                this.result.push(['product', '能力验证', '室间质评'])
-
-                for (var item of this.yearArr) {
-                    const arr = []
-
-                    arr[0] = item
-
-                    const m = data.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
-                    const n = data.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
-                    // console.log(m, n)
-
-                    if (m) {
-                        arr[1] = m.count
-                    } else {
-                        arr[1] = 0
-                    }
-                    if (n) {
-                        arr[2] = n.count
-                    } else {
-                        arr[2] = 0
-                    }
+            // const sql = `select LEFT(bi_dui_lei_xing_, 2) as leixing,LEFT(zhu_biao_shi_jian, 4) as niandu, COALESCE(COUNT(*), 0) as count FROM t_sjzphdjhylxqb where left(zhu_biao_shi_jian, 4) in ${yearStr} GROUP BY CONCAT(LEFT(zhu_biao_shi_jian, 4), ' ', LEFT(bi_dui_lei_xing_, 2))`
+            // this.$common.request('sql', sql).then((res) => {
+            //     const data = res.variables.data
+            //     // console.log(data)
+
+            //     this.result.push(['product', '能力验证', '室间质评'])
+
+            //     for (var item of this.yearArr) {
+            //         const arr = []
+
+            //         arr[0] = item
+
+            //         const m = data.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
+            //         const n = data.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
+            //         // console.log(m, n)
+
+            //         if (m) {
+            //             arr[1] = m.count
+            //         } else {
+            //             arr[1] = 0
+            //         }
+            //         if (n) {
+            //             arr[2] = n.count
+            //         } else {
+            //             arr[2] = 0
+            //         }
+
+            //         this.result.push(arr)
+            //     }
+            // })
+            let data1 = []
+            let data2 = []
+            const sql1 = `select 年度 as niandu,LEFT(能力验证类型, 2) as leixing,COUNT(*) AS count FROM v_sjzpjgpj WHERE 状态 ='已完成' and 年度 in ${yearStr} GROUP BY LEFT(能力验证类型, 2)`
+            const sql2 = `select LEFT(bian_zhi_shi_jian, 4) as niandu,'实验室' as leixing, COALESCE(COUNT(*), 0) AS count from t_sysbdjlb bian_zhi_shi_jian where shi_fou_guo_shen_ = '已完成' and LEFT(bian_zhi_shi_jian, 4) IN ${yearStr}`
 
-                    this.result.push(arr)
-                }
+            await this.$common.request('sql', sql1).then((res) => {
+                data1 = res.variables.data
             })
+            await this.$common.request('sql', sql2).then((res) => {
+                data2 = res.variables.data
+            })
+            this.result.push(['product', '能力验证', '室间质评', '实验室', '其它'])
+            for (var item of this.yearArr) {
+                const m = data1.find((v) => { return v.niandu === item + '' && v.leixing === '能力' })
+                const n = data1.find((v) => { return v.niandu === item + '' && v.leixing === '室间' })
+                const f = data2.find((v) => { return v.niandu === item + '' && v.leixing === '实验室' })
+                const g = data1.find((v) => { return v.niandu === item + '' && v.leixing !== '能力' && v.leixing !== '室间' })
+
+                const arr = []
+                arr[0] = item
+                arr[1] = m ? m.count : 0
+                arr[2] = n ? n.count : 0
+                arr[3] = f ? f.count : 0
+                arr[4] = g ? g.count : 0
+                this.result.push(arr)
+                console.log(this.result)
+            }
         },
 
         getList3 () {
@@ -337,9 +364,9 @@ export default {
                     // 总数
                     this.result1.push((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0))
                     // 不合格数
-                    this.result2.push(f ? f.count : 0)
+                    this.result2.push((f ? f.count : 0) + (n ? n.count : 0))
                     // 不合格率
-                    this.result3.push(((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) === 0 ? 0 : (f ? f.count : 0) / ((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) * 100)
+                    this.result3.push((((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) === 0 ? 0 : ((f ? f.count : 0) + (n ? n.count : 0)) / ((m ? m.count : 0) + (n ? n.count : 0) + (f ? f.count : 0)) * 100).toFixed(2))
                     // console.log(this.result1, this.result2, this.result3)
                 }
             })
@@ -370,7 +397,7 @@ export default {
                 // 计划
                 this.list2.push(n ? n.count : 0)
                 // 覆盖率率
-                this.list3.push((m ? m.count : 0) === 0 ? 0 : (n ? n.count : 0) / (m ? m.count : 0) * 100)
+                this.list3.push(((m ? m.count : 0) === 0 ? 0 : (n ? n.count : 0) / (m ? m.count : 0) * 100).toFixed(2))
             }
         },
 
@@ -403,10 +430,10 @@ export default {
 
                 // 无室间质评计划项目数
                 this.data1.push((m ? m.count : 0) - (n ? n.count : 0))
-                // 室比对项目数
+                // 实验室比对项目数
                 this.data2.push(f ? f.count : 0)
                 // 比对率
-                this.data3.push((m ? m.count : 0) - (n ? n.count : 0) === 0 ? 0 : (f ? f.count : 0) / ((m ? m.count : 0) - (n ? n.count : 0)) * 100)
+                this.data3.push(((m ? m.count : 0) - (n ? n.count : 0) === 0 ? 0 : (f ? f.count : 0) / ((m ? m.count : 0) - (n ? n.count : 0)) * 100).toFixed(2))
             }
             // console.log(this.data1, this.data2, this.data3)
         }
@@ -478,7 +505,7 @@ export default {
   display: flex;
   overflow: hidden;
   box-sizing: border-box;
-  height: 50%;
+  height: 52%;
   width: 100%;
   .botleft{
     height: 100%;

+ 17 - 7
src/views/InterLaboratory/interStatistics/topLeftChart.vue

@@ -1,10 +1,10 @@
 <template>
     <div class="pieView">
-        <div style="  height:14%;line-height:30px;text-align: left;padding-left: 10px;color: white;">
+        <div style="  height:14%;line-height:30px;text-align: left;padding-left: 10px;padding-left: 10px;padding-top: 10px; margin-bottom: -50px;color: white;">
             {{ info.title || "" }}
         </div>
-        <div style="width: 100%; height: 86%; display: inline-block; overflow: hidden">
-            <div id="topLeftChart" style="width: 100%; height: 95%; overflow: hidden" />
+        <div style="width: 100%; height: 95%; display: inline-block; overflow: hidden;padding-left: 10px;">
+            <div id="topLeftChart" style="width: 100%; height: 100%; overflow: hidden" />
         </div>
 
     </div>
@@ -31,13 +31,22 @@ export default {
                         type: 'shadow'
                     }
                 },
+                // grid: {
+                //     left: '3%',
+                //     right: '4%',
+                //     bottom: '3%',
+                //     containLabel: true
+                // },
                 grid: {
-                    left: '3%',
-                    right: '4%',
-                    bottom: '3%',
-                    containLabel: true
+                    x: 50,
+                    y: 50,
+                    x2: 50,
+                    y2: 50
                 },
                 legend: {
+                    orient: 'vertical',
+                    left: 'center',
+                    bottom: 'bottom',
                     textStyle: {
                         color: '#ffff',
                         fontSize: 12
@@ -63,6 +72,7 @@ export default {
                         name: '计划项目',
                         type: 'bar',
                         barWidth: '60%',
+                        barMaxWidth: 30,
                         data: []
                     }
                 ]

+ 13 - 4
src/views/InterLaboratory/interStatistics/topRightChart.vue

@@ -1,10 +1,10 @@
 <template>
     <div class="pieView">
-        <div style="  height:14%;line-height:30px;text-align: left;padding-left: 10px;color: white;">
+        <div style="  height:14%;line-height:30px;text-align: left;padding-left: 10px;padding-left: 10px;padding-top: 10px; margin-bottom: -50px;color: white;">
             {{ info.title || "" }}
         </div>
-        <div style="width: 100%; height: 86%; display: inline-block; overflow: hidden">
-            <div id="topRightChart" style="width: 100%; height: 95%; overflow: hidden" />
+        <div style="width: 100%; height: 95%; display: inline-block; overflow: hidden">
+            <div id="topRightChart" style="width: 100%; height: 100%; overflow: hidden" />
         </div>
 
     </div>
@@ -25,7 +25,16 @@ export default {
         return {
             showChart: true,
             option: {
+                grid: {
+                    x: 50,
+                    y: 50,
+                    x2: 50,
+                    y2: 50
+                },
                 legend: {
+                    orient: 'vertical',
+                    left: 'center',
+                    bottom: 'bottom',
                     textStyle: {
                         color: '#ffff',
                         fontSize: 12
@@ -45,7 +54,7 @@ export default {
                 yAxis: {},
                 // Declare several bar series, each will be mapped
                 // to a column of dataset.source by default.
-                series: [{ type: 'bar' }, { type: 'bar' }]
+                series: [{ barMaxWidth: 30, type: 'bar' }, { barMaxWidth: 30, type: 'bar' }, { barMaxWidth: 30, type: 'bar' }, { barMaxWidth: 30, type: 'bar' }]
             }
 
         }