Эх сурвалжийг харах

检测看板、检测档案修改

cyy 1 жил өмнө
parent
commit
f5bf6a0ffb

+ 12 - 5
src/views/platform/bpmn/bpmInstHis/listType/CNASjiancedangan.vue

@@ -288,12 +288,16 @@ export default {
     },
   },
   created() {
+    // let sql =
+    //   "select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND(lei_bie_qu_fen_yu ='cnas'OR lei_bie_qu_fen_yu ='CNAS')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao   DESC limit 0,15";
     let sql =
-      "select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND(lei_bie_qu_fen_yu ='cnas'OR lei_bie_qu_fen_yu ='CNAS')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao   DESC limit 0,15";
+      "select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao   DESC limit 0,15";
     this.loadData(sql);
 
+    // let sumsql =
+    //   "select COUNT(*) AS sum  FROM  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND(lei_bie_qu_fen_yu ='cnas'OR lei_bie_qu_fen_yu ='CNAS')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
     let sumsql =
-      "select COUNT(*) AS sum  FROM  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND(lei_bie_qu_fen_yu ='cnas'OR lei_bie_qu_fen_yu ='CNAS')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
+      "select COUNT(*) AS sum  FROM  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托'  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
     curdPost("sql", sumsql).then((response) => {
       this.total = response.variables.data[0].sum;
     });
@@ -449,19 +453,22 @@ export default {
     },
     search() {
       let moreSql = this.selectSplit();
-      var sql ="select * from t_mjjcbg " +moreSql + " wei_tuo_lei_xing_ = '客户委托' AND lei_bie_qu_fen_yu = 'cnas' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit 0,15";
+      // var sql ="select * from t_mjjcbg " +moreSql + " wei_tuo_lei_xing_ = '客户委托' AND lei_bie_qu_fen_yu = 'cnas' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit 0,15";
+      var sql ="select * from t_mjjcbg " +moreSql + " wei_tuo_lei_xing_ = '客户委托' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit 0,15";
       console.log(sql,"21")
       this.loadData(sql);
     },
     handleSizeChange(value) {
       this.currentPage4 = 1;
-      let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND  lei_bie_qu_fen_yu ='CNAS'  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')  ORDER BY yang_pin_bian_hao  DESC limit 0,15" +value;
+      // let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND  lei_bie_qu_fen_yu ='CNAS'  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')  ORDER BY yang_pin_bian_hao  DESC limit 0,15" +value;
+      let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')  ORDER BY yang_pin_bian_hao  DESC limit 0,15" +value;
       this.pageSize =Number(value);
       this.loadData(sql);
     },
     handleCurrentChange(value) {
       console.log(this.pageSize)
-      let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND lei_bie_qu_fen_yu ='CNAS'  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit " + (value-1) * this.pageSize +","+ this.pageSize;
+      // let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' AND lei_bie_qu_fen_yu ='CNAS'  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit " + (value-1) * this.pageSize +","+ this.pageSize;
+      let sql ="select * from  t_mjjcbg WHERE  wei_tuo_lei_xing_ = '客户委托' and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成') ORDER BY yang_pin_bian_hao  DESC limit " + (value-1) * this.pageSize +","+ this.pageSize;
       console.log(sql,"1")
       this.loadData(sql);
     },

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

@@ -64,12 +64,12 @@
                         '检测项目',
                         // '检测类型',
                         '送检时间',
-                        '完成时间',
-                        '检测员'
+                        // '完成时间',
+                        // '检测员'
                     ],
                     data: [],
                     rowNum: 7,
-                    columnWidth: ['350','100','100','90'],
+                    columnWidth: ['450','250'],
 		            waitTime: 1500
                 },
                 middleCardData: {
@@ -143,19 +143,20 @@
                 let quarter = this.getDateRange('quarter')
                 let week = this.getDateRange('week')
                 // 获取委托数及受理数
-                const sql = `select wt.month as month, wt.accepted as accepted, wt2.today as today, wt2.week as week, wt2.quarter as quarter, wt2.year as year, jc.total as jcTotal, jc.finished as jcFinish, rw.task as task, rw.finished as rwFinish, bg.report as report, bg.process as process, bg.approval as approval, bg.finished as bgFinish
+                const sql = `select wt.month as month, wt.accepted as accepted, wt2.today as today, wt2.week as week, wt2.quarter as quarter, wt2.year as year, jc.total as jcTotal, jc.finished as jcFinish, rw.task as task, rw.finished as rwFinish, yp.task as yptask, yp.finished as ypFinish, bg.report as report, bg.process as process, bg.approval as approval, bg.finished as bgFinish, bg.uncompleted as uncompleted
                 from
                 (select count(id_) as month, count(zhuang_tai_ = '委托结束' or zhuang_tai_ = '已完成' or null) as accepted from t_mjwtsqb where create_time_ LIKE '${this.month}%') wt,
                 (select count(create_time_ like '${this.today}' or null) as today, count(create_time_ between '${week.start}' and '${week.end}' or null) as week, count(create_time_ between '${quarter.start}' and '${quarter.end}' or null) as quarter, count(create_time_ like '${this.year}%' or null) as year from t_mjwtsqb) wt2,
                 (select count(id_) as total, count(jian_ce_zhuang_ta = '已完成' or null) as finished from t_jchzb where create_time_ LIKE '${this.month}%') jc,
                 (select count(id_) as task, count(zhuang_tai_ = '已完成' or null) as finished from t_rwfpb where create_time_ LIKE '${this.month}%') rw,
-                (select count(id_) as report, count(zhuang_tai_ = '报告待审核' or null) as process, count(zhuang_tai_ = '报告待审批' or null) as approval, count(zhuang_tai_ = '完成' or null) as finished from t_mjjcbg where create_time_ LIKE '${this.month}%') bg`
+								(select count(id_) as task, count(jie_yang_zhuang_t = '已完成' or null) as finished from t_mjypb where create_time_ LIKE '${this.month}%') yp,
+                (select count(id_) as report, count(zhuang_tai_ != '完成' or null) as uncompleted, count(zhuang_tai_ = '报告待审核' or null) as process, count(zhuang_tai_ = '报告待审批' or null) as approval, count(zhuang_tai_ = '完成' or null) as finished from t_mjjcbg where create_time_ LIKE '${this.month}%') bg`
                 // console.log(sql)
                 curdPost('sql', sql).then(res => {
                     const data = res.variables.data
                     // console.log(data)
                     if ( data && data.length ) {
-                        const { month, accepted, approval, jcFinish, jcTotal, process, report, rwFinish, task, today, week, quarter, year, bgFinish } = data[0]
+                        const { month, accepted, approval, jcFinish, jcTotal, process, report, rwFinish, task, yptask, ypFinish, today, week, quarter, year, bgFinish, uncompleted } = data[0]
                         this.middleCardData.taskData = [month, jcTotal, task, report]
                         let result = [
                             // {
@@ -185,41 +186,41 @@
                             //     unit: '单'
                             // },
                             {
-                                title: '样品分配',
+                                title: '来样统计',
                                 children: [
                                     {
                                         label: '总数',
-                                        value: task
+                                        value: yptask
                                     },
                                     {
                                         label: '未完成',
-                                        value: task - rwFinish
+                                        value: yptask - ypFinish
                                     },
                                     {
                                         label: '已完成',
-                                        value: rwFinish
+                                        value: ypFinish
                                     }
                                 ],
                                 unit: '件'
                             },
-                            {
-                                title: '检测',
-                                children: [
-                                    {
-                                        label: '总数',
-                                        value: jcTotal
-                                    },
-                                    {
-                                        label: '未完成',
-                                        value: jcTotal - jcFinish
-                                    },
-                                    {
-                                        label: '已完成',
-                                        value: jcFinish
-                                    }
-                                ],
-                                unit: '项'
-                            },
+                            // {
+                            //     title: '检测',
+                            //     children: [
+                            //         {
+                            //             label: '总数',
+                            //             value: jcTotal
+                            //         },
+                            //         {
+                            //             label: '未完成',
+                            //             value: jcTotal - jcFinish
+                            //         },
+                            //         {
+                            //             label: '已完成',
+                            //             value: jcFinish
+                            //         }
+                            //     ],
+                            //     unit: '项'
+                            // },
                             {
                                 title: '报告',
                                 children: [
@@ -228,13 +229,13 @@
                                         value: report
                                     },
                                     {
-                                        label: '待审核',
-                                        value: process
-                                    },
-                                    {
-                                        label: '待审批',
-                                        value: approval
+                                        label: '进行中',
+                                        value: uncompleted
                                     },
+                                    // {
+                                    //     label: '待审批',
+                                    //     value: approval
+                                    // },
                                     {
                                         label: '已发放',
                                         value: bgFinish
@@ -251,13 +252,14 @@
             getMiddleData() {
                 // 获取检测数据
                 // 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_, IFNULL(jc.jian_ce_shi_jian_, '') as startDate, IFNULL(jc.update_time_, '') as endDate, ipe.NAME_ as names from ibps_party_employee ipe, t_mjjcnlfw tm, t_jchzb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.jian_ce_zhuang_ta = '已完成' and jc.jian_ce_shi_jian_ like '${this.month}%' order by jc.jian_ce_shi_jian_ desc`
+                // const sql1 = `select tm.jian_ce_xiang_mu_, IFNULL(jc.jian_ce_shi_jian_, '') as startDate from ibps_party_employee ipe, t_mjjcnlfw tm, t_jchzb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.jian_ce_zhuang_ta = '已完成' and jc.jian_ce_shi_jian_ like '${this.month}%' order by jc.jian_ce_shi_jian_ desc`
+                const sql1 = `select tm.jian_ce_xiang_mu_, IFNULL(jc.wei_tuo_ri_qi_, '') as startDate from t_mjjcbg ipe, t_mjjcnlfw tm, t_mjypb jc where jc.yang_pin_bian_hao = ipe.yang_pin_bian_hao and (FIND_IN_SET(tm.id_,jc.jian_ce_xiang_mu2) or  FIND_IN_SET(tm.id_,jc.tao_can_xiang_mu_)) and ipe.zhuang_tai_ = '完成' and jc.wei_tuo_ri_qi_ like '${this.month}%' order by jc.wei_tuo_ri_qi_ desc`
                 // 获取检测受理类型数据
                 let sqlStr = ''
                 this.acceptList.forEach((item, index) => {
                     sqlStr += `count(tm.jian_ce_lei_bie_ = '${item}' or null) as r${index}${index === this.acceptList.length - 1 ? '' : ', '}`
                 })
-                const sql2 = `select ${sqlStr} from t_jchzb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
+                const sql2 = `select ${sqlStr} from t_mjwtsqb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`
                 // console.log(sqlStr, sql2)
                 // 获取检测月度年度任务完成情况数据
                 const sql3 = `select rw.zhuang_tai_ as state, DATE_FORMAT(rw.create_time_, '%Y-%m-%d %H:%i:%s') as time from t_rwfpb rw where rw.create_time_ like '${this.year}%'`
@@ -273,10 +275,11 @@
                     // console.log(data1, data2)
 
                     this.tableData.data = []
+                    console.log(data1)
                     data1.forEach(item => {
                         item.startDate = item.startDate ? item.startDate.slice(0, 10) : ''
-                        item.endDate = item.endDate ? item.endDate.slice(0, 10) : ''
-                        item.names = item.names ? this.replaceSecondLetter(item.names) : ''
+                        // item.endDate = item.endDate ? item.endDate.slice(0, 10) : ''
+                        // item.names = item.names ? this.replaceSecondLetter(item.names) : ''
                         this.tableData.data.push(Object.values(item))
                     })
 
@@ -320,7 +323,7 @@
                     this.middleCardData.task = task
                     this.middleCardData.complete = complete
                     this.middleCardData.year = year
-                    this.middleCardData.flag = true
+                    // this.middleCardData.flag = true
                 })
             },
             // 获取底部图表数据
@@ -381,11 +384,14 @@
                     this.bottomCardData.trust = trust
                     this.bottomCardData.accepted = accepted
                     this.bottomCardData.reports = reports
+                    this.middleCardData.reports = reports
                     this.bottomCardData.compile = compile
                     // this.bottomCardData.task = task
                     // this.bottomCardData.complete = complete
                     // this.bottomCardData.year = year
                     this.bottomCardData.sample = sample
+                    this.middleCardData.flag = true
+
                     this.bottomCardData.flag = true
                     // console.log(this.bottomCardData)
                 })

+ 6 - 5
src/views/system/jbdHome/board/component/testing/bottomCard.vue

@@ -12,10 +12,10 @@
                 <div id="trust"></div>
             </div>
             <dv-decoration-2 :reverse="true" :dur="4" style="width:5px;height:100%;" />
-            <div :class="$style.item">
+            <!-- <div :class="$style.item">
                 <div id="sample"></div>
             </div>
-            <dv-decoration-2 :reverse="true" :dur="6" style="width:5px;height:100%;" />
+            <dv-decoration-2 :reverse="true" :dur="6" style="width:5px;height:100%;" /> -->
             <!-- <div :class="$style.item">
                 <div id="month"></div>
             </div>
@@ -65,12 +65,13 @@
         methods: {
             init() {
                 const trust = echarts.init(document.getElementById('trust'))
-                const sample = echarts.init(document.getElementById('sample'))
+                // const sample = echarts.init(document.getElementById('sample'))
                 const satisfied = echarts.init(document.getElementById('satisfied'))
                 const observe = echarts.init(document.getElementById('observe'))
 
                 // 设置图表数据
                 reportOption.series[0].data = this.info.reports
+                console.log(this.info.reports,'this.info.reports')
                 sampleOption.series[0].data = this.info.sample
                 // monthOption.series[0].data = this.info.task
                 // monthOption.series[1].data = this.info.complete
@@ -78,7 +79,7 @@
 
                 // 渲染
                 trust.setOption(reportOption)
-                sample.setOption(sampleOption)
+                // sample.setOption(sampleOption)
                 satisfied.setOption(satisfaction)
                 observe.setOption(contract)
             }
@@ -93,7 +94,7 @@
         width: 100%;
         height: 100%;
         .item {
-            width: 24%;
+            width: 32%;
             height: 100%;
             background-color: rgba(6, 30, 93, 0.5);
             > div {

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

@@ -29,7 +29,7 @@
 </template>
 <script>
     import echarts from 'echarts'
-    import { acceptOption, monthOption, taskOption } from '../../data'
+    import { acceptOption, monthOption, taskOption, reportOption, reportOptionTask } from '../../data'
     export default {
         name: 'topBar',
         props: {
@@ -83,12 +83,14 @@
                 acceptOption.color = this.info.config.colorList
                 monthOption.series[0].data = this.info.task
                 monthOption.series[1].data = this.info.complete
+                reportOptionTask.series[0].data = this.info.reports
+
                 // taskOption.series[0].data = this.info.taskData
                 // this.tableData = JSON.parse(JSON.stringify(this.info.tableData))
 
                 //渲染
                 accept.setOption(acceptOption)
-                month.setOption(monthOption)
+                month.setOption(reportOptionTask)
                 // task.setOption(taskOption)
             }
         }

+ 1 - 1
src/views/system/jbdHome/board/component/testing/topBar.vue

@@ -89,7 +89,7 @@
         align-items: center;
         background-color: rgba(6, 30, 93, 0.5);
         .item {
-            width: 33.3%;
+            width: 50%;
             // width: calc(100% / 13);
             height: 60%;
             padding: 12px 20px;

+ 88 - 0
src/views/system/jbdHome/board/data.js

@@ -473,6 +473,94 @@ export const trustOption = {
     }
 }
 
+export const reportOptionTask = {
+    title: {
+        show: true,
+        text: '检测任务月度完成量',
+        textStyle: {
+            color: '#fff',
+            fontSize: 20,
+            fontWeight: '600'
+        },
+        textAlign: 'center',
+        left: '50%',
+        top: '20px'
+    },
+    grid: {
+        top: '80px'
+    },
+    xAxis: {
+        type: 'category',
+        data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+        axisTick: {
+            alignWithLabel: true
+        },
+        axisLabel: {
+            style: {
+                fill: '#fff'
+            }
+        },
+        axisLine: {
+            lineStyle: {
+                color: '#fff'
+            }
+        }
+    },
+    yAxis: {
+        type: 'value',
+        name: '',
+        nameTextStyle: {
+            color: '#fff',
+            fontSize: 14
+        },
+        splitLine: {
+            show: false
+        },
+        axisLine: {
+            lineStyle: {
+                color: '#fff'
+            }
+        }
+    },
+    series: [{
+        type: 'bar',
+        name: '',
+        data: [],
+        barMaxWidth: '35px',
+        itemStyle: {
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                { offset: 0, color: "#83bff6" },
+                { offset: 0.5, color: "#188df0" },
+                { offset: 1, color: "#188df0" },
+            ])
+        },
+        emphasis: {
+            itemStyle: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    { offset: 0, color: "#2378f7" },
+                    { offset: 0.7, color: "#2378f7" },
+                    { offset: 1, color: "#83bff6" },
+                ])
+            }
+        },
+        label: {
+            show: true,
+            position: 'top',
+            textStyle: {
+                color: '#fff',
+                fontSize: 14
+            },
+            formatter (params) {
+                return params.value ? params.value : ''
+            }
+        }
+    }],
+    tooltip: {
+        show: true,
+        trigger: 'axis'
+    }
+}
+
 export const reportOption = {
     title: {
         show: true,