Bladeren bron

update 列表弹出框 自定义组件

linweizeng 2 jaren geleden
bovenliggende
commit
f2a8631bd0

+ 18 - 2
src/business/platform/data/templaterender/templates/list.vue

@@ -246,6 +246,7 @@
             :obj="obj"
             @scanOff="scanOff"
         />
+        <generalModules v-if="generalShow" :general-show="generalShow" :current-type="currentType" :general-list="generalList" @generalClose="generalClose" />
         <print :show="showPrint" :list="printList" :type="printType" />
         <labelPrint :show="showPrintYi" :list="printList" :type="printType" />
 
@@ -315,6 +316,7 @@ import IbpsImport from '@/plugins/import'
 import Vue from 'vue'
 Vue.component('ibps-data-template-render-dialog', () => import('@/business/platform/data/templaterender/preview/dialog.vue'))
 import xlsxFile from '@/business/platform/data/templaterender/templates/compenent/xlsxFile.vue'
+import generalModules from '@/views/system/jbdScan/generalModules.vue'
 
 export default {
     name: 'list',
@@ -336,7 +338,8 @@ export default {
         importTable,
         Print: () => import('../components/print'),
         LabelPrint: () => import('../components/labelPrint'),
-        xlsxFile
+        xlsxFile,
+        generalModules
 
         // BpmnFormrender
         // DataTemplateFormat
@@ -438,7 +441,11 @@ export default {
             position: null,
             importList: [],
             importVlaue: null,
-            snapshotFile: ''
+            snapshotFile: '',
+
+            generalShow: false,
+            currentType: '',
+            generalList: []
         }
     },
     computed: {
@@ -805,6 +812,14 @@ export default {
             this.scanVisible = true
             this.scanName = val
         },
+        generalClick (val, list) {
+            this.currentType = val
+            this.generalList = list
+            this.generalShow = true
+        },
+        generalClose (val = false) {
+            this.generalShow = val
+        },
         // /*按钮传参*/
         scanHandlerObj (val, obj) {
             this.scanVisible = true
@@ -1227,6 +1242,7 @@ export default {
                 rowHandle: rowHandle,
                 searchForm: searchForms.length > 0 ? { forms: searchForms } : null
             }
+            console.log(this.listConfig)
 
             // 判断地点是否第一层级
             const position = this.$store.getters.userInfo.positions

+ 54 - 0
src/views/system/jbdScan/generalModules.vue

@@ -0,0 +1,54 @@
+<template>
+    <div>
+        <component :is="currentType" :show.sync="show" :general-list="generalList" @generalClose="generalClose" />
+    </div>
+</template>
+
+<script>
+import { handled } from '@/api/platform/office/bpmReceived'
+/* 共同调用类, 与脚本统一调用。*/
+import satisfaction from './satisfaction/satisfaction.vue'
+
+export default {
+    components: {
+        satisfaction
+    },
+    props: {
+        currentType: {
+            type: String,
+            default: 'satisfaction'
+        },
+        generalShow: {
+            type: Boolean,
+            default: false
+        },
+        generalList: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        }
+    },
+    data () {
+        return {
+            show: this.generalShow
+
+        }
+    },
+    watch: {
+        // generalShow: {
+        //     handler () {
+        //         this.show = this.generalShow
+        //     },
+        //     deep: true,
+        //     immediate: true
+        // }
+    },
+    methods: {
+        generalClose (val) {
+            this.show = val
+            this.$emit('generalClose', val)
+        }
+    }
+}
+</script>

+ 100 - 0
src/views/system/jbdScan/satisfaction/satisfaction.vue

@@ -0,0 +1,100 @@
+<template>
+    <div>
+        <el-dialog
+            title="满意度统计图"
+            :visible.sync="generalShow"
+            width="80%"
+            top="0"
+            append-to-body
+            custom-class="customClass"
+            @close="close"
+        >
+            <div>
+                <div class="topBorder">
+                    <div ref="Echart" class="chart" />
+                </div>
+                <div class="centerBorder">
+                    <div class="cenSin" style="border-right: 1px solid #ccc">
+                        <div ref="Echart1" class="chart" />
+                    </div>
+                    <div class="cenSin">
+                        <div ref="Echart2" class="chart" />
+                    </div>
+                </div>
+                <div class="centerBorder">
+                    <div class="cenSin" style="border-right: 1px solid #ccc">
+                        <div ref="Echart3" class="chart" />
+                    </div>
+                    <div class="cenSin">
+                        <div ref="Echart4" class="chart" />
+                    </div>
+                </div>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import satisfactionJS from './satisfactionJS'
+export default {
+    mixins: [satisfactionJS],
+    props: {
+        show: {
+            type: Boolean,
+            default: false
+        },
+        generalList: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        }
+    },
+    data () {
+        return {
+            generalShow: this.show,
+            id: ''
+        }
+    },
+    watch: {
+        show: {
+            handler () {
+                // this.generalShow = this.show
+            },
+            deep: true,
+            immediate: true
+        }
+    },
+    methods: {
+        close () {
+            this.$emit('generalClose', false)
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .customClass .el-dialog__header{
+    border-bottom: none;
+}
+/deep/ .customClass .el-dialog__footer{
+    border-top: none;
+}
+
+.topBorder{
+    // border-bottom: 1px solid #ccc;
+}
+.chart{
+    width: 100%;
+    height: 300px;
+}
+.centerBorder{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    border-top: 1px solid #ccc;
+    .cenSin{
+        width: 48%;
+    }
+}
+</style>

+ 197 - 0
src/views/system/jbdScan/satisfaction/satisfactionJS.js

@@ -0,0 +1,197 @@
+import { datasetTypeOptions } from '@/business/platform/data/constants/index'
+import echarts from 'echarts'
+const radius = window.innerWidth > 1600 ? '55%' : '45%'
+export default {
+    data () {
+
+    },
+    created () {
+        this.id = this.generalList[0].id_
+        this.getManYiDuZiBiao(this.id)
+    },
+    methods: {
+        getManYIDuPeiZhi () {
+            const second = this.$store.getters.level.second
+            return new Promise((resolve, reject) => {
+                const sql = `select * from t_myddcpzb where di_dian_ = '${second}' order by create_time_ desc LIMIT 1`
+                this.$common.request('sql', sql).then(res => {
+                    const { data = [] } = res.variables || {}
+                    console.log(data)
+                    if (data.length > 0) {
+                        const list = []
+                        list.push('1.' + data[0].pei_zhi_1_)
+                        list.push('2.' + data[0].pei_zhi_2_)
+                        list.push('3.' + data[0].pei_zhi_3_)
+                        list.push('4.' + data[0].pei_zhi_4_)
+                        list.push('5.' + data[0].pei_zhi_5_)
+                        resolve(list)
+                    } else {
+                        const list = ['1.服务态度', '2.检验服务能力', '3.检验报告及时性', '4.检验结果准确率', '5.工作规范性']
+                        resolve(list)
+                    }
+                })
+            })
+        },
+        getManYiDuZiBiao (id) {
+            this.getManYIDuPeiZhi().then(resData => {
+                const legendData = []
+                resData.forEach(item => {
+                    const obj = {
+                        name: item
+                    }
+                    legendData.push(obj)
+                })
+                const sql = `select * from t_yhmyddctjzb where parent_id_ = '${id}' order by xu_hao_`
+                this.$common.request('sql', sql).then((res) => {
+                    const { data = [] } = res.variables || {}
+                    if (data.length > 0) {
+                        const list = []
+                        const list1 = []
+                        const list2 = []
+                        const list3 = []
+                        const list4 = []
+                        const titleData = {
+                            title: '小计',
+                            color: '#ff6347'
+                        }
+                        const titleData1 = {
+                            title: '住院患者',
+                            color: '#00c16e'
+                        }
+                        const titleData2 = {
+                            title: '门诊患者',
+                            color: '#d20962'
+                        }
+                        const titleData3 = {
+                            title: '医务人员',
+                            color: '#0cb9c1'
+                        }
+                        const titleData4 = {
+                            title: '员工',
+                            color: '#7552cc'
+                        }
+                        data.forEach((item, index) => {
+                            const obj = {
+                                name: resData[index],
+                                value: item.xiao_ji_
+                            }
+                            list.push(obj)
+                            const obj1 = {
+                                name: resData[index],
+                                value: item.fen_shu_1_
+                            }
+                            list1.push(obj1)
+                            const obj2 = {
+                                name: resData[index],
+                                value: item.fen_shu_2_
+                            }
+                            list2.push(obj2)
+
+                            const obj3 = {
+                                name: resData[index],
+                                value: item.fen_shu_3_
+                            }
+                            list3.push(obj3)
+
+                            const obj4 = {
+                                name: resData[index],
+                                value: item.fen_shu_4_
+                            }
+                            list4.push(obj4)
+                        })
+
+                        const accept = echarts.init(this.$refs.Echart)
+                        accept.setOption(JSON.parse(JSON.stringify(this.barData(legendData, list, titleData))))
+
+                        const accept1 = echarts.init(this.$refs.Echart1)
+                        accept1.setOption(JSON.parse(JSON.stringify(this.barData(legendData, list1, titleData1))))
+
+                        const accept2 = echarts.init(this.$refs.Echart2)
+                        accept2.setOption(JSON.parse(JSON.stringify(this.barData(legendData, list2, titleData2))))
+
+                        const accept3 = echarts.init(this.$refs.Echart3)
+                        accept3.setOption(JSON.parse(JSON.stringify(this.barData(legendData, list3, titleData3))))
+
+                        const accept4 = echarts.init(this.$refs.Echart4)
+                        accept4.setOption(JSON.parse(JSON.stringify(this.barData(legendData, list4, titleData4))))
+                    }else{
+                        this.close()
+                        this.$message.error('统计的数据已经被清除,请检查数据是否被清除')
+                    }
+                })
+            })
+        },
+        barData (legendData, seriesData, titleData) {
+            const barData = {
+                title: {
+                    show: true,
+                    text: titleData.title,
+                    textStyle: {
+                        color: titleData.color,
+                        fontSize: 20,
+                        fontWeight: '600'
+                    },
+                    textAlign: 'center',
+                    left: '50%',
+                    top: '0px'
+                },
+                legend: {
+                    orient: 'horizontal',
+                    show: true,
+                    left: 'center',
+                    bottom: 10,
+                    z: 3,
+                    // itemWidth: 25,
+                    // itemHeight: 14,
+                    // itemGap: 10,
+                    // {
+                    //     name: '未完成',
+                    //     textStyle: {
+                    //         color: '#ff6347'
+                    //     }
+                    // },
+                    data: legendData
+                },
+                series: [
+                    {
+                        name: '任务完成情况',
+                        type: 'pie',
+                        radius,
+                        center: ['50%', '50%'],
+                        data: seriesData,
+                        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}\n占比:{d}%`,
+                                    fontSize: 14
+                                },
+                                labelLine: {
+                                    show: true
+                                }
+                            }
+                        }
+                    }
+                ],
+                color: ['#f85a40',
+                    '#00c16e',
+                    '#d20962',
+                    '#0cb9c1',
+                    '#7552cc'],
+                tooltip: {
+                    show: true,
+                    trigger: 'item',
+                    formatter: '评价内容<br/>{b}:{c}<br/>占比:{d}%'
+                }
+            }
+            return barData
+        }
+    }
+}