Przeglądaj źródła

检测管理看板调整

cfort 3 lat temu
rodzic
commit
29713e9801

+ 18 - 3
src/views/system/jbdHome/board/checkBoard.vue

@@ -40,6 +40,7 @@
 <script>
     import screenfull from 'screenfull'
     import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+    import { acceptList } from './data.js'
     export default {
         name: 'checkBoard',
         components: {
@@ -142,7 +143,7 @@
                 // console.log(sql)
                 curdPost('sql', sql).then(res => {
                     const data = res.variables.data
-                    console.log(data)
+                    // console.log(data)
                     
                     if ( data && data.length ) {
                         const { month, accepted, approval, jcFinish, jcTotal, process, report, rwFinish, task, today, week, quarter, bgFinish } = data[0]
@@ -242,7 +243,12 @@
                 // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rw.qi_wang_wan_cheng, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_rwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm where rw.jian_ce_yuan_ = ipe.ID_ and rw.jian_ce_xiang_mu_ = tm.id_ and rw.create_time_ like '${this.month}%'`
                 const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rwz.create_time_, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_lhrwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm, t_mjrwfpzb rwz where rwz.jian_ce_yuan_ = ipe.ID_ and rwz.jian_ce_xiang_mu_ = tm.id_ and rw.id_ = rwz.wai_jian_ and rw.create_time_ like '${this.month}%'`
                 // 获取检测受理类型数据
-                const sql2 = `select count(tm.jian_ce_lei_bie_ = '理化' or null) as lh, count(tm.jian_ce_lei_bie_ = '微生物' or null) as wsw, count(tm.jian_ce_lei_bie_ = '细胞活率' or null) as xbhl, count(tm.jian_ce_lei_bie_ = '残留检测' or null) as cljc, count(tm.jian_ce_lei_bie_ = '细胞鉴别' or null) as xbjb from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
+                let sqlStr = ''
+                acceptList.forEach((item, index) => {
+                    sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === acceptList.length - 1 ? '' : ', '}`
+                })
+                const sql2 = `select ${sqlStr} from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
+                // console.log(sqlStr, sql2)
 
                 Promise.all([
                     curdPost('sql', sql1),
@@ -257,7 +263,16 @@
                         this.middleCardData.tableData.data.push(Object.values(item))
                     })
 
-                    this.middleCardData.acceptData = Object.values(data2[0])
+                    let result = []
+                    let tempRes = Object.values(data2[0])
+                    acceptList.forEach((item, index) => {
+                        let o = {
+                            name: item,
+                            value: tempRes[index]
+                        }
+                        result.push(o)
+                    })
+                    this.middleCardData.acceptData = result
                     this.middleCardData.flag = true
                 }).catch(error => {
                     console.log(error)

+ 2 - 2
src/views/system/jbdHome/board/component/middleCard.vue

@@ -86,8 +86,8 @@
             width: 24%;
             height: 100%;
             background-color: rgba(6, 30, 93, 0.5);
-            &:last-child {
-                width: 49%;
+            &:first-child, &:last-child {
+                width: 36%;
             }
             .no_data {
                 font-size: 20px;

+ 121 - 1
src/views/system/jbdHome/board/data.js

@@ -1,6 +1,6 @@
 import echarts from "echarts"
 
-export const acceptOption = {
+export const acceptOption1 = {
     // 图表标题
     title: {
         show: true,
@@ -110,6 +110,126 @@ export const acceptOption = {
     }
 }
 
+export const acceptList = [
+    '无菌检查',
+    '支原体检查',
+    '内毒素',
+    '细胞计数与活率',
+    '免疫评估',
+    '细胞标志蛋白检测',
+    '干细胞三项诱导分化',
+    '细胞外源病毒因子检测',
+    '干细胞生物学效力检测',
+    'CAR-T',
+    '残留物检测',
+    '干细胞成瘤性检测',
+    '干细胞的免疫学反应检测',
+    '核型分析',
+    '细胞形态',
+    '感染八项',
+    '衣原体检查',
+    '结核杆菌',
+    '新项目与方法',
+    '基础科研'
+]
+
+const colors = [
+    '#d20962',
+    '#f47721',
+    '#7ac143',
+    '#00a78e',
+    '#00bce4',
+    '#7d3f98',
+    '#037ef3',
+    '#f85a40',
+    '#00c16e',
+    '#ffd900',
+    '#0cb9c1',
+    '#7552cc'
+]
+
+let colorList = []
+
+const getOptions = () => {
+    let res = []
+    colorList = []
+    acceptList.forEach(item => {
+        let random =  parseInt(Math.random() * 12)
+        let obj = {
+            name: item,
+            textStyle: {
+                color: colors[random]
+            }
+        }
+        res.push(obj)
+        colorList.push(colors[random])
+    })
+    return res
+}
+
+export const acceptOption = {
+    title: {
+        show: true,
+        text: '检测类型',
+        textStyle: {
+            color: '#fff',
+            fontSize: 20,
+            fontWeight: '600'
+        },
+        textAlign: 'center',
+        left: '50%',
+        top: '20px'
+    },
+    legend: {
+        type: 'scroll',
+        orient: 'vertical',
+        show: true,
+        // left: 'center',
+        // bottom: 10,
+        right: 10,
+        top: 50,
+        z: 3,
+        itemWidth: 25,
+        itemHeight: 14,
+        itemGap: 10,
+        data: getOptions()
+    },
+    series: [
+        {
+            name: '任务完成情况',
+            type: 'pie',
+            radius: '55%',
+            center: ['35%', '50%'],
+            data: [],
+            itemStyle: {
+                emphasis: {
+                    shadowBlur: 10,
+                    shadowOffsetX: 0,
+                    shadowColor: 'rgba(0, 0, 0, 0.5)'
+                },
+                normal: {
+                    label: {
+                        show: true,
+                        position: 'outer',
+                        // formatter: `占比:{d}%\n\n\r{b}:{c}`,
+                        formatter: `{b}:{c}`,
+                        fontSize: 12
+                    },
+                    labelLine: {
+                        show: true
+                    }
+                }
+            }
+        }
+    ],
+    color: colorList,
+    tooltip: {
+        show: true,
+        trigger: 'item',
+        formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
+    }
+}
+
 export const taskOption = {
     // 图表标题
     title: {