linweizeng 2 лет назад
Родитель
Сommit
25776017fb

+ 163 - 0
src/views/system/jbdScan/approve/approve.vue

@@ -0,0 +1,163 @@
+<template>
+    <div>
+        <el-dialog
+            title="核查计划进度情况"
+            :visible.sync="generalShow"
+            width="80%"
+            top="0"
+            append-to-body
+            custom-class="customClass"
+            @close="close"
+        >
+            <div>
+                <div class="step">
+                    <el-steps :active="activeIndex" finish-status="success" align-center>
+                        <el-step v-for="(item,index) in stepList" :key="index" :title="item.title" :description="item.post" @click.native="activeClick(index + 1)" />
+                    </el-steps>
+                </div>
+                <div class="stopCenter">
+                    <div>
+                        <div class="tableTop">
+                            <el-alert
+                                title="核查进度率"
+                                type="success"
+                                :description="description"
+                                :closable="false"
+                            />
+                        </div>
+                        <div>
+                            <div ref="Echart" class="chart" />
+                        </div>
+                    </div>
+                </div>
+                <div class="tableLin">
+                    <div class="tableTop">
+                        <el-alert
+                            :title="getIndexName(clickIndex)"
+                            type="success"
+                            :closable="false"
+                        />
+                    </div>
+                    <div>
+                        <appComOne ref="appCom" :click-index="clickIndex" :active-index="activeIndex" :table-data="tableData" />
+                    </div>
+
+                </div>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import approveJS from './approveJS'
+import appComOne from './compnent/appComOne'
+export default {
+    components: { appComOne },
+    mixins: [approveJS],
+    props: {
+        show: {
+            type: Boolean,
+            default: false
+        },
+        generalList: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        }
+    },
+    data () {
+        return {
+            generalShow: this.show,
+            id: '',
+            clickIndex: 2,
+            activeIndex: 1,
+            stepList: [
+                {
+                    stepIndex: 11,
+                    title: '计划编制',
+                    post: '质量负责人'
+                },
+                {
+                    stepIndex: 22,
+                    title: '实施计划编制',
+                    post: '组长'
+                },
+                {
+                    stepIndex: 33,
+                    title: '条款核查',
+                    post: '组员'
+                },
+                {
+                    stepIndex: 44,
+                    title: '实施计划审核',
+                    post: '组长'
+                },
+                {
+                    stepIndex: 55,
+                    title: '结果确认',
+                    post: '质量负责人'
+                }
+            ],
+            tableData: [],
+            description: `核查计划项目进度计分:'待分配'计1分, '待核查'计2分, '待审核'计3分, '待确认'计4分, '已结束'计5分,核查进度率 = 各项计划项目进度计分之和 / 计划项目总数 / 5 * 100`
+        }
+    },
+    watch: {
+        show: {
+            handler () {
+                // this.generalShow = this.show
+            },
+            deep: true,
+            immediate: true
+        }
+    },
+    created () {
+        this.id = this.generalList[0].id_
+        this.getJiHuaZhuangTai(this.id)
+    },
+    methods: {
+        close () {
+            this.$emit('generalClose', false)
+        },
+        activeClick (index) {
+            if (this.activeIndex < index - 1) {
+                return this.$message.error('任务进度没到,请点击其他节点切换')
+            }
+            this.getShiShiData(this.id)
+            this.$refs.appCom.switchWatch(index)
+            this.clickIndex = index
+        },
+        getIndexName (index) {
+            console.log(this.clickIndex)
+            const name = this.stepList[this.clickIndex - 1 === 5 ? 4 : this.clickIndex - 1].title || ''
+            return name
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .customClass .el-dialog__header{
+    border-bottom: none;
+}
+/deep/ .customClass .el-dialog__footer{
+    border-top: none;
+}
+.step{
+    margin: 20px 30px;
+}
+.tableLin{
+    margin: 0 30px 20px 30px;
+}
+.stopCenter{
+    margin: 0 30px 20px 30px;
+}
+.tableTop{
+    margin-bottom: 10px;
+}
+.chart{
+    width: 100%;
+    height: 250px;
+}
+</style>

+ 114 - 0
src/views/system/jbdScan/approve/approveJS.js

@@ -0,0 +1,114 @@
+import echarts from 'echarts'
+export default {
+    data () {
+        return {
+            typeList: ['待分配', '待核查', '待审核', '待确认', '已结束']
+        }
+    },
+
+    methods: {
+        getJiHuaZhuangTai (id) {
+            const sql = `select * from t_rkzztkhcjh where id_ = '${id}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                if (data.length > 0) {
+                    const index = this.typeList.findIndex(item => item === data[0].shi_fou_guo_shen_)
+                    const addIndex = index + 1
+                    this.activeIndex = addIndex
+                    this.clickIndex = addIndex + 1
+                    this.getShiShiData(id, this.activeIndex)
+                    this.getJiHuaZiBiaoJiSuan(id)
+                    this.getOption()
+                }
+            })
+        },
+        getJiHuaZiBiaoJiSuan (id) {
+            const sql = `select * from t_rkzztkhcjhzb where parent_id_ = '${id}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                if (data.length > 0) {
+                    const list = []
+                    data.forEach(item => {
+                        const showIndex = this.typeList.findIndex(it => it === item.shi_fou_guo_shen_)
+                        list.push(showIndex + 1)
+                    })
+                    const sum = list.reduce((total, current) => total + current)
+                    const dataLength = data.length
+                    const totalMs = sum / dataLength / 5 * 100
+                    this.getOption(totalMs)
+                }
+            })
+        },
+        getShiShiData (id, activeIndex) {
+            const sql = `select a.*,c.NAME_ as zuYuanPosiName,d.NAME_ as zuYuanName,e.NAME_ as zuZhangName,g.NAME_ as zuZhangBnMen from t_rkzztkhcjhzb a left join t_rkzztkhcjhzb b on a.id_ = b.ji_hua_zi_biao_id left join ibps_party_position c on a.bian_zhi_bu_men_ = c.ID_ left join ibps_party_employee d on a.zu_yuan_ = d.ID_ left join t_hcssjhb f on b.parent_id_ = f.id_ left join ibps_party_position g on f.bian_zhi_bu_men_ = g.ID_ left join ibps_party_employee e on f.bian_zhi_ren_ = e.ID_ where a.parent_id_ = '${id}' order by a.tiao_kuan_hao_`
+
+            // if (activeIndex === 1) {
+            //     sql = `select * from t_rkzztkhcjhzb where parent_id_ = '${id}' order by tiao_kuan_hao_`
+            // }
+            // if (activeIndex === 2 || activeIndex === 3 || activeIndex === 4) {
+            // }
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                if (data.length > 0) {
+                    this.tableData = data
+                }
+            })
+        },
+        getOption (totalMs = 0) {
+            const option = {
+                series: [
+                    {
+                        type: 'gauge',
+                        min: 0,
+                        max: 100,
+                        animationDuration: 3000,
+                        axisLine: {
+                            lineStyle: {
+                                width: 30,
+                                color: [
+                                    [0.3, '#fd666d'],
+                                    [0.7, '#37a2da'],
+                                    [1, '#67e0e3']
+                                ]
+                            }
+                        },
+                        pointer: {
+                            itemStyle: {
+                                color: 'auto'
+                            }
+                        },
+                        axisTick: {
+                            distance: -30,
+                            length: 8,
+                            lineStyle: {
+                                color: '#fff',
+                                width: 2
+                            }
+                        },
+                        splitLine: {
+                            distance: -30,
+                            length: 30,
+                            lineStyle: {
+                                color: '#fff',
+                                width: 4
+                            }
+                        },
+                        axisLabel: {
+                            show: true
+                        },
+                        detail: {
+                            valueAnimation: true,
+                            formatter: '{value} %',
+                            color: 'auto',
+                            top: '100%',
+                            offsetCenter: [0, '75%']
+                        },
+                        data: [{ value: totalMs, top: '100%' }]
+                    }
+                ]
+            }
+            const accept = echarts.init(this.$refs.Echart)
+            accept.setOption(JSON.parse(JSON.stringify(option)))
+        }
+    }
+}

+ 102 - 0
src/views/system/jbdScan/approve/approveJSON.json

@@ -0,0 +1,102 @@
+{
+    "list1": [{
+        "name": "条款号",
+        "value": "tiao_kuan_hao_",
+        "width": "50"
+    },{
+        "name": "条款名称",
+        "value": "tiao_kuan_ming_ch",
+        "width": "50"
+    },{
+        "name": "状态",
+        "value": "shi_fou_guo_shen_",
+        "width": "50"
+    }],
+    "list2": [{
+        "name": "条款号",
+        "value": "tiao_kuan_hao_",
+        "width": "50"
+    },{
+        "name": "条款名称",
+        "value": "tiao_kuan_ming_ch",
+        "width": "50"
+    },{
+        "name": "状态",
+        "value": "shi_fou_guo_shen_",
+        "width": "50"
+    },{
+        "name": "实施部门",
+        "value": "zuZhangBnMen",
+        "width": "50"
+    },{
+        "name": "实施组长",
+        "value": "zuZhangName",
+        "width": "50"
+    }],
+    "list3": [{
+        "name": "条款号",
+        "value": "tiao_kuan_hao_",
+        "width": "50"
+    },{
+        "name": "条款名称",
+        "value": "tiao_kuan_ming_ch",
+        "width": "50"
+    },{
+        "name": "状态",
+        "value": "shi_fou_guo_shen_",
+        "width": "50"
+    },{
+        "name": "核查部门",
+        "value": "zuYuanPosiName",
+        "width": "50"
+    },{
+        "name": "核查人",
+        "value": "zuYuanName",
+        "width": "50"
+    },{
+        "name": "核查结果",
+        "value": "he_cha_jie_guo_",
+        "width": "50"
+    },{
+        "name": "核查情况说明",
+        "value": "he_cha_qing_kuang",
+        "width": "100"
+    }],
+    "list4": [{
+        "name": "条款号",
+        "value": "tiao_kuan_hao_",
+        "width": "50"
+    },{
+        "name": "条款名称",
+        "value": "tiao_kuan_ming_ch",
+        "width": "50"
+    },{
+        "name": "状态",
+        "value": "shi_fou_guo_shen_",
+        "width": "50"
+    },{
+        "name": "核查部门",
+        "value": "zuYuanPosiName",
+        "width": "50"
+    },{
+        "name": "核查人",
+        "value": "zuYuanName",
+        "width": "50"
+    },{
+        "name": "核查结果",
+        "value": "he_cha_jie_guo_",
+        "width": "50"
+    },{
+        "name": "核查情况说明",
+        "value": "he_cha_qing_kuang",
+        "width": "100"
+    },{
+        "name": "审核结论",
+        "value": "shen_he_",
+        "width": "50"
+    },{
+        "name": "审核原因",
+        "value": "shen_he_yuan_yin_",
+        "width": "100"
+    }]
+}

+ 68 - 0
src/views/system/jbdScan/approve/compnent/appComOne.vue

@@ -0,0 +1,68 @@
+<template>
+    <div>
+        <el-table :data="tableData" :border="true" style="with: 100%">
+            <el-table-column v-for="(item,index) in jiHuaList" :key="index" :prop="item.value" :label="item.name" :width="item.width" align="center" />
+        </el-table>
+    </div>
+</template>
+<script>
+import approveJS from '../approveJS'
+import approveJSON from '../approveJSON.json'
+export default {
+    mixins: [approveJS],
+    props: {
+        tableData: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        },
+        activeIndex: {
+            type: Number,
+            default: 1
+        },
+        clickIndex: {
+            type: Number,
+            default: 2
+        }
+    },
+    data () {
+        return {
+            jiHuaList: approveJSON.list2
+        }
+    },
+    watch: {
+        clickIndex: {
+            handler (newVal, oldVal) {
+                this.switchWatch(this.clickIndex)
+            },
+            deep: true,
+            immediate: true
+        }
+    },
+    methods: {
+        switchWatch (index) {
+            console.log(index)
+            switch (index) {
+                case 1:
+                    this.jiHuaList = approveJSON.list1
+                    break
+                case 2:
+                    this.jiHuaList = approveJSON.list2
+                    break
+                case 3:
+                    this.jiHuaList = approveJSON.list3
+                    break
+                case 4:
+                case 5:
+                case 6:
+                    this.jiHuaList = approveJSON.list4
+                    break
+            }
+        }
+    }
+}
+</script>
+<style lang="less" scoped>
+
+</style>

+ 3 - 1
src/views/system/jbdScan/generalModules.vue

@@ -7,10 +7,12 @@
 <script>
 /* 共同调用类, 与脚本统一调用。*/
 import satisfaction from './satisfaction/satisfaction.vue'
+import approve from './approve/approve.vue'
 
 export default {
     components: {
-        satisfaction
+        satisfaction,
+        approve
     },
     props: {
         currentType: {

+ 1 - 8
src/views/system/jbdScan/satisfaction/satisfactionJS.js

@@ -16,7 +16,6 @@ export default {
                 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_)
@@ -133,7 +132,7 @@ export default {
                     },
                     textAlign: 'center',
                     left: '50%',
-                    top: '0px'
+                    top: '10px'
                 },
                 legend: {
                     orient: 'horizontal',
@@ -144,12 +143,6 @@ export default {
                     // itemWidth: 25,
                     // itemHeight: 14,
                     // itemGap: 10,
-                    // {
-                    //     name: '未完成',
-                    //     textStyle: {
-                    //         color: '#ff6347'
-                    //     }
-                    // },
                     data: legendData
                 },
                 series: [