Преглед изворни кода

去除首页过期事务逻辑,检测看板调整

cfort пре 2 година
родитељ
комит
ef2eabfd3a

+ 3 - 3
src/views/system/dashboard/components/new-home.vue

@@ -80,7 +80,7 @@
                                 >
                                     <template slot-scope="scope">{{ '待' + scope.row.name }}</template>
                                 </el-table-column>
-                                <el-table-column show-overflow-tooltip width="100">
+                                <!-- <el-table-column show-overflow-tooltip width="100">
                                     <template slot="header" slot-scope="scope">
                                         <span>办理进度</span>
                                         <el-tooltip effect="dark" placement="top">
@@ -95,7 +95,7 @@
                                     <template slot-scope="scope">
                                         <el-tag :type="scope.row.state ? stateOption[scope.row.state].type : ''">{{ scope.row.state ? stateOption[scope.row.state].label : '待办理' }}</el-tag>
                                     </template>
-                                </el-table-column>
+                                </el-table-column> -->
                                 <el-table-column
                                     prop="startDept"
                                     show-overflow-tooltip
@@ -467,7 +467,7 @@
                                 this.dataList = dataResult.sort((a, b) => b.createTime.localeCompare(a.createTime))
                                 this.paginate = pageResult
                             })
-                            this.urgeToManager()
+                            // this.urgeToManager()
                         } else {
                             this.dataList = dataResult
                             this.paginate = pageResult

+ 39 - 8
src/views/system/jbdHome/board/checkBoard.vue

@@ -267,14 +267,17 @@
                     sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === this.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}%'`
+                const sql3 = `select count(shi_fou_ji_shi_ = '是' or null) as timely, count(shi_fou_ji_shi_ = '否' or null) as untimely, count(zhuang_tai_ != '已完成' or null) as incomplete from t_lhjczb where create_time_ like '${this.month}%'`
                 // console.log(sqlStr, sql2)
 
                 Promise.all([ 
                     curdPost('sql', sql1),
-                    curdPost('sql', sql2)
-                ]).then(([res1, res2]) => {
+                    curdPost('sql', sql2),
+                    curdPost('sql', sql3)
+                ]).then(([res1, res2, res3]) => {
                     const data1 = res1.variables.data
                     const data2 = res2.variables.data
+                    const data3 = res3.variables.data
                     // console.log(data1, data2)
 
                     this.tableData.data = []
@@ -298,8 +301,35 @@
                     result.sort((a, b) => b.value - a.value)
                     // 根据排序后数据重新生成图例
                     const newRes = result.slice(0, 12).map(i => i.name)
+                    const completionRate = [
+                        {
+                            name: '及时',
+                            value: data3[0].timely
+                        },
+                        {
+                            name: '不及时',
+                            value: data3[0].untimely
+                        },
+                        {
+                            name: '未完成',
+                            value: data3[0].incomplete
+                        },
+                        // {
+                        //     value: data3[0].timely + data3[0].untimely + data3[0].incomplete,
+                        //     itemStyle: {
+                        //         color: 'none',
+                        //         decal: {
+                        //             symbol: 'none'
+                        //         }
+                        //     },
+                        //     label: {
+                        //         show: false
+                        //     }
+                        // }
+                    ]
                     this.middleCardData.config = this.getOptions(newRes)
                     this.middleCardData.acceptData = result.slice(0, 12)
+                    this.middleCardData.completionRate = completionRate
                     this.middleCardData.flag = true
                 }).catch(error => {
                     console.log(error)
@@ -310,11 +340,12 @@
                 // 获取检测委托受理情况数据
                 const sql1 = `select tm.wei_tuo_zhuang_ta as state, DATE_FORMAT(tm.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhwtsqb tm where tm.create_time_ like '${this.year}%'`
                 // 获取检测月度年度任务完成情况数据
-                const sql2 = `select rw.zhuang_tai_ as state, DATE_FORMAT(rw.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhrwfpb rw where rw.create_time_ like '${this.year}%'`
+                // const sql2 = `select rw.zhuang_tai_ as state, DATE_FORMAT(rw.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhrwfpb rw where rw.create_time_ like '${this.year}%'`
+                const sql2 = `select zhuang_tai_ as state, DATE_FORMAT(create_time_, '%Y-%m-%d %H:%i:%s') as time from t_lhjczb where create_time_ like '${this.year}%'`
                 // 获取已委托样品数量
                 const sql3 = `select count(yp.id_) as unReceive from t_lhypb yp, t_lhwtsqb wt where yp.parent_id_ = wt.id_ and yp.create_time_ like '${this.month}%'`
                 // 获取样品 收样/留样/不合格数量
-                const sql4 = `select count(a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_jie_guo_ = '残缺' or null) as incomplete from (select id_, shi_fou_liu_yang_, yan_shou_jie_guo_ from t_lhypdjb where create_time_ like '${this.month}%' group by yang_ben_bian_hao) as a`
+                const sql4 = `select (a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_jie_guo_ = '残缺' or null) as incomplete from (select id_, shi_fou_liu_yang_, yan_shou_jie_guo_ from t_lhypdjb where create_time_ like '${this.month}%' group by yang_ben_bian_hao) as a`
                 Promise.all([
                     curdPost('sql', sql1),
                     curdPost('sql', sql2),
@@ -349,13 +380,13 @@
                     let taskCount = task.reduce((pre, cur) => pre + cur)
                     let completeCount = complete.reduce((pre, cur) => pre + cur)
                     let year = [
-                        {
-                            name: '未完成',
-                            value: taskCount - completeCount
-                        },
                         {
                             name: '已完成',
                             value: completeCount
+                        },
+                        {
+                            name: '未完成',
+                            value: taskCount - completeCount
                         }
                     ]
                     let sample = [data3[0].unReceive - data4[0].receive, data4[0].receive, data4[0].incomplete, data4[0].keep]

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

@@ -84,7 +84,9 @@
                 acceptOption.series[0].data = this.info.acceptData
                 acceptOption.legend.data = this.info.config.option
                 acceptOption.color = this.info.config.colorList
-                taskOption.series[0].data = this.info.taskData
+                taskOption.series[0].data = this.info.completionRate
+
+                // taskOption.series[0].data = this.info.taskData
                 // this.tableData = JSON.parse(JSON.stringify(this.tableData))
 
                 //渲染
@@ -102,11 +104,11 @@
         width: 100%;
         height: 100%;
         .item {
-            width: 20%;
+            width: 28%;
             height: 100%;
             background-color: rgba(6, 30, 93, 0.5);
             &:first-child, &:last-child {
-                width: 38%;
+                width: 34%;
             }
             .no_data {
                 font-size: 20px;

+ 119 - 16
src/views/system/jbdHome/board/data.js

@@ -158,7 +158,7 @@ let colorList = []
 export const acceptOption = {
     title: {
         show: true,
-        text: '检测类型',
+        text: '检测任务类型(月度)',
         textStyle: {
             color: '#fff',
             fontSize: 20,
@@ -205,8 +205,8 @@ export const acceptOption = {
                     label: {
                         show: true,
                         position: 'outer',
-                        // formatter: `占比:{d}%\n\n\r{b}:{c}`,
-                        formatter: `{b}:{c}`,
+                        formatter: `数量:{c} 占比:{d}%`,
+                        // formatter: `{b}:{c}`,
                         fontSize: 14
                     },
                     labelLine: {
@@ -224,11 +224,12 @@ export const acceptOption = {
     }
 }
 
-export const taskOption = {
+// 原任务统计
+export const taskOptionOld = {
     // 图表标题
     title: {
         show: true,
-        text: '检测任务情况',
+        text: '检测过程数据(月度)',
         textStyle: {
             color: '#fff',
             fontSize: 20,
@@ -319,6 +320,109 @@ export const taskOption = {
     }
 }
 
+// 任务及时完成率
+export const taskOption = {
+    title: {
+        show: true,
+        text: '任务及时完成率(月度)',
+        textStyle: {
+            color: '#fff',
+            fontSize: 20,
+            fontWeight: '600'
+        },
+        textAlign: 'center',
+        left: '50%',
+        top: '20px'
+    },
+    legend: {
+        orient: 'horizontal',
+        show: true,
+        left: 'center',
+        bottom: 10,
+        z: 3,
+        itemWidth: 25,
+        itemHeight: 14,
+        itemGap: 10,
+        data: [
+            {
+                name: '及时',
+                textStyle: {
+                    color: '#00a78e'
+                }
+            },
+            {
+                name: '不及时',
+                textStyle: {
+                    color: '#d20962'
+                }
+            },
+            {
+                name: '未完成',
+                textStyle: {
+                    color: '#f47721'
+                }
+            }
+        ]
+    },
+    series: [
+        {
+            name: '任务完成情况',
+            type: 'pie',
+            // radius: ['40%', '70%'],
+            avoidLabelOverlap: true,
+            // startAngle: 180,
+            radius: '55%',
+            // center: ['50%', '70%'],
+            data: [],
+            itemStyle: {
+                emphasis: {
+                    shadowBlur: 10,
+                    shadowOffsetX: 0,
+                    shadowColor: 'rgba(0, 0, 0, 0.5)'
+                },
+                normal: {
+                    label: {
+                        show: true,
+                        position: 'outer',
+                        // formatter: `占比:{d}%\t{b}:{c}`,
+                        formatter: `数量:{c} 占比:{d}%`,
+                        fontSize: 14
+                    },
+                    labelLine: {
+                        show: true
+                    }
+                }
+            },
+            // label: {
+            //     alignTo: 'edge',
+            //     minMargin: 5,
+            //     edgeDistance: 10,
+            //     lineHeight: 15
+            // },
+            // labelLine: {
+            //     length: -5,
+            //     length2: 0,
+            //     maxSurfaceAngle: 80
+            // },
+            // labelLayout (params) {
+            //     const isLeft = params.labelRect.x < myChart.getWidth() / 2
+            //     const points = params.labelLinePoints
+            //     // Update the end point.
+            //     points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
+            //     return {
+            //         labelLinePoints: points
+            //     }
+            // }
+        }
+    ],
+    color: ['#00a78e', '#d20962', '#f47721'],
+    tooltip: {
+        show: true,
+        trigger: 'item',
+        formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
+    }
+}
+
 export const trustOption = {
     legend: {
         data: [
@@ -342,7 +446,7 @@ export const trustOption = {
     },
     title: {
         show: true,
-        text: '检测委托受理量',
+        text: '检测委托受理量(月度)',
         textStyle: {
             color: '#fff',
             fontSize: 20,
@@ -454,7 +558,7 @@ export const trustOption = {
                     return params.value ? params.value : ''
                 }
             }
-        } 
+        }
     ],
     tooltip: {
         show: true,
@@ -565,7 +669,7 @@ export const monthOption = {
     },
     title: {
         show: true,
-        text: '检测任务月度完成量',
+        text: '检测任务完成量(月度)',
         textStyle: {
             color: '#fff',
             fontSize: 20,
@@ -678,7 +782,6 @@ export const monthOption = {
                 }
             }
         }
-        
     ],
     tooltip: {
         show: true,
@@ -689,7 +792,7 @@ export const monthOption = {
 export const yearOption = {
     title: {
         show: true,
-        text: '检测任务年度完成量',
+        text: '检测任务完成量(年度)',
         textStyle: {
             color: '#fff',
             fontSize: 20,
@@ -710,15 +813,15 @@ export const yearOption = {
         itemGap: 10,
         data: [
             {
-                name: '完成',
+                name: '完成',
                 textStyle: {
-                    color: '#ff6347'
+                    color: '#00a78e'
                 }
             },
             {
-                name: '完成',
+                name: '完成',
                 textStyle: {
-                    color: '#3f3'
+                    color: '#d20962'
                 }
             }
         ]
@@ -741,7 +844,7 @@ export const yearOption = {
                         show: true,
                         position: 'outer',
                         // formatter: `占比:{d}%\t{b}:{c}`,
-                        formatter: `{b}:{c}\t占比:{d}%`,
+                        formatter: `数量:{c} 占比:{d}%`,
                         fontSize: 14
                     },
                     labelLine: {
@@ -751,7 +854,7 @@ export const yearOption = {
             }
         }
     ],
-    color: ['#ff6347', '#3f3'],
+    color: ['#00a78e', '#d20962'],
     tooltip: {
         show: true,
         trigger: 'item',