Przeglądaj źródła

新版风险控制模块开发

luoaoxuan 1 rok temu
rodzic
commit
30a3376750

+ 707 - 0
src/views/platform/risk/riskDetail.vue

@@ -0,0 +1,707 @@
+<template>
+    <div>
+        <el-dialog
+            :title="title"
+            center
+            :visible.sync="dialogVisible"
+            width="90%"
+            append-to-body
+            top
+            style="margin-top:5vh"
+            :close-on-click-modal="false"
+            :show-close="false"
+            :close-on-press-escape="false"
+        >
+            <div v-loading="loading" class="contain">
+                <div class="info">
+                    <div class="item">
+                        <span>部门:</span>
+                        <ibps-user-selector
+                            style="width:60%"
+                            type="position"
+                            :value="position"
+                            readonly-text="text"
+                            :disabled="true"
+                            :multiple="false"
+                            size="mini"
+                        />
+                    </div>
+                    <div class="item">
+                        <span>评估人:</span>
+                        <ibps-user-selector
+                            style="width:60%"
+                            type="user"
+                            :value="userId"
+                            readonly-text="text"
+                            :disabled="true"
+                            :multiple="false"
+                            size="mini"
+                        />
+                    </div>
+                    <div class="item">
+                        <span>编制时间:</span>
+                        <el-date-picker
+                            v-model="time"
+                            type="datetime"
+                            placeholder="选择日期时间"
+                            :readonly="true"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            size="mini"
+                        />
+                    </div>
+                </div>
+                <el-alert
+                    title="说明"
+                    type="success"
+                    :closable="false"
+                    description="1、风险指数=严重度X发生频度、风险应对优先对高风险、频次高的风险采取措施。2,风险等级判定:RPN=Severity(严重程度)×Possibility(发生的频度)。"
+                />
+                <div class="tab">
+                    <el-tabs v-model="activeName">
+                        <el-tab-pane v-for="(item) in content" :key="item.label" :label="item.label" :name="item.label">
+                            <div class="text">
+                                <pre>{{ item.value }}</pre>
+                            </div>
+                        </el-tab-pane>
+                    </el-tabs>
+                </div>
+                <el-alert
+                    title=""
+                    type="success"
+                    :closable="false"
+                    description="风险应对选择风险降低后,请选择对应的措施制定人,以便开启后续部门风险改进记录流程"
+                />
+                <div class="choose">
+                    <span>选择风险项:</span>
+                    <!-- 模版弹窗 -->
+                    <ibps-custom-dialog
+                        v-model="form.xuan_ze_feng_xian"
+                        size="mini"
+                        template-key="fxkdhk"
+                        multiple
+                        type="dialog"
+                        class="custom-dialog"
+                        placeholder="请选择风险项"
+                        style="width:80%"
+                        icon="el-icon-search"
+                        :disabled="readonly===0?true:readonly"
+                    />
+                </div>
+                <div class="table">
+                    <el-table :data="tableList" border>
+                        <el-table-column
+                            prop=""
+                            label="序号"
+                            type="index"
+                            width="100"
+                            :index="showIndex"
+                        />
+                        <el-table-column
+                            prop="yao_su_tiao_kuan_"
+                            label="要素条款"
+                            width="120"
+                        />
+                        <el-table-column
+                            prop="gong_zuo_huan_jie"
+                            label="工作环节"
+                            width="150"
+                        >
+                            <template slot-scope="{row}">
+                                <el-input v-model="row.gong_zuo_huan_jie" type="textarea" :rows="2" size="mini" :readonly="readonly" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="gong_zuo_miao_shu"
+                            label="工作描述"
+                            width="150"
+                        >
+                            <template slot-scope="{row}">
+                                <el-input v-model="row.gong_zuo_miao_shu" type="textarea" :rows="2" size="mini" :readonly="readonly" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="feng_xian_miao_sh"
+                            label="风险描述"
+                            width="150"
+                        >
+                            <template slot-scope="{row}">
+                                <el-input v-model="row.feng_xian_miao_sh" type="textarea" :rows="2" size="mini" :readonly="readonly" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="xian_xing_kong_zh"
+                            label="现行控制方法"
+                            width="150"
+                        >
+                            <template slot-scope="{row}">
+                                <el-input v-model="row.xian_xing_kong_zh" type="textarea" :rows="2" size="mini" :readonly="readonly" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yan_zhong_cheng_d"
+                            label="严重程度"
+                            width="100"
+                        >
+                            <template slot-scope="{row}">
+                                <el-select v-model="row.yan_zhong_cheng_d" placeholder="请选择" :disabled="readonly" size="mini" @change="culRate(row)">
+                                    <el-option
+                                        v-for="item in yan_zhong_cheng_d_List"
+                                        :key="item"
+                                        :label="item"
+                                        :value="item"
+                                    />
+                                </el-select>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="fa_sheng_pin_du_"
+                            label="发生频度"
+                            width="100"
+                        >
+                            <template slot-scope="{row}">
+                                <el-select v-model="row.fa_sheng_pin_du_" placeholder="请选择" :disabled="readonly" size="mini" @change="culRate(row)">
+                                    <el-option
+                                        v-for="item in fa_sheng_pin_du_List"
+                                        :key="item"
+                                        :label="item"
+                                        :value="item"
+                                    />
+                                </el-select>
+                            </template>
+
+                        </el-table-column>
+                        <el-table-column
+                            prop="feng_xian_zhi_shu"
+                            label="风险指数"
+                            width="100"
+                        />
+                        <el-table-column
+                            prop="feng_xian_deng_ji"
+                            label="风险等级"
+                            width="100"
+                        />
+                        <el-table-column
+                            prop="feng_xian_ying_du"
+                            label="风险应对"
+                            width="120"
+                        >
+                            <template slot-scope="{row}">
+                                <el-select v-model="row.feng_xian_ying_du" placeholder="请选择" :disabled="readonly" size="mini">
+                                    <el-option
+                                        v-for="item in ['风险降低','风险接受','风险回避']"
+                                        :key="item"
+                                        :label="item"
+                                        :value="item"
+                                    />
+                                </el-select>
+                            </template>
+
+                        </el-table-column>
+                        <el-table-column
+                            prop="zhi_ding_ren_"
+                            label="措施制定人"
+                            width="100"
+                        >
+                            <template slot-scope="{row}">
+                                <ibps-user-selector
+                                    v-model="row.zhi_ding_ren_"
+                                    type="user"
+                                    readonly-text="text"
+                                    :disabled="readonly"
+                                    :multiple="false"
+                                    size="mini"
+                                />
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="ni_cai_qu_cuo_shi"
+                            label="拟采取控制措施"
+                            width="120"
+                        >
+                            <template slot-scope="{row}">
+                                <el-input v-model="row.ni_cai_qu_cuo_shi" type="textarea" :rows="2" size="mini" :readonly="readonly" />
+                            </template>
+                        </el-table-column>
+                        <!-- <el-table-column prop="" label="操作" width="100" fixed="right">
+                            <template slot-scope="{row}">
+                                <el-button type="primary" size="mini">编辑</el-button>
+                            </template>
+                        </el-table-column> -->
+                    </el-table>
+                </div>
+
+                <!-- <el-pagination
+                    style="margin-top: 5px; padding-bottom: 10px"
+                    :current-page="pagination.currentPage"
+                    :page-sizes="[10, 20,30, 50]"
+                    :page-size="pagination.pageSize"
+                    layout="prev,pager,next,jumper,sizes,->,total"
+                    :total="categoryList.length"
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                /> -->
+            </div>
+
+            <span slot="footer" class="dialog-footer">
+                <el-button v-if="!readonly" type="primary" size="mini" @click="submit">提 交</el-button>
+                <el-button v-if="!readonly" type="primary" size="mini" @click="save">保 存</el-button>
+                <el-button size="mini" @click="close">关 闭</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import dayjs from 'dayjs'
+import ibpsUserSelector from '@/business/platform/org/selector'
+export default {
+    components: {
+        ibpsUserSelector,
+        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+    },
+    data () {
+        const { userId, position, level } = this.$store.getters
+        return {
+            form: {
+                xuan_ze_feng_xian: ''
+            },
+            activeName: '严重程度分级描述',
+            content: [
+                { label: '严重程度分级描述', value: `1级:轻微,不会对检验科人员、设备、环境、形象造成损害;不会对检验质量造成影响;造成轻微的财产损失;无检验科信息泄露。
+2级:一般,对检验科人员、设备、环境、形象造成轻微损害,对检验质量和TAT造成影响,能通过现场及时处置解决或缓解出现的损害和影响;造成一定的财产损失;未造成投诉;无检验科信息泄露。
+3级:较严重,对检验科人员、设备、环境、形象造成损害,对检验质量和TAT造成影响,无法通过现场及时处置解决或缓解出现的损害和影响;被投诉至检验科管理层;造成较大的财产的损失;有检验科信息泄露。
+4级:严重,对检验科人员造成较大伤害;对仪器设备造成损坏;对周边较少的人员或环境产生损害;对检验质量、TAT、临床诊疗造成严重影响;造成重大的的经济损失;被投诉至上级主管部门;造成不良的社会影响。
+5级:非常严重,对检验科人员造成重大伤害甚至死亡;对仪器设备造成损毁;极度影响检验质量和TAT,对临床造成极大误诊致使病人死亡;对周边人员或环境产生重大损害;造成恶劣的社会影响;导致检验科停工停业 ` },
+                { label: '发生概率分级表说明', value: `1级:基本不可能发生,评估范围内未发生过,类似区域/行业也极少发生
+2级:较不可能发生,评估范围内未发生过,类似区域/行业偶有发生
+3级:可能发生,评估范围内发生过,类似区域/行业也偶有发生; 评估范围内未发生过,但类似区域/行业发生频率较高
+4级:很有可能发生,评估范围内发生频率较高
+5级:必定会发生,评估范围内发生频率很高` },
+                { label: '风险等级及应对措施说明', value: `中风险级:5-11,可采取措施降低风险。
+低风险级:1-4,风险较低,当采取措施消除风险引起的成本比风险本身引起的损失较大时,接受风险。
+高风险级:12-25,应采取措施规避或降低风险。` }
+            ],
+            yan_zhong_cheng_d_List: ['1', '2', '3', '4', '5'],
+            fa_sheng_pin_du_List: ['1', '2', '3', '4', '5'],
+            userId: userId,
+            position: position,
+            level: level.second || level.first,
+            time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+            params: {},
+            rowParams: {},
+            refresh: true,
+            loading: false,
+            title: '',
+            pagination: {
+                pageSize: 10,
+                currentPage: 1
+            },
+            dialogVisible: false,
+            tableList: [],
+            Ids: [],
+            fengXianJiSuan: []
+        }
+    },
+    computed: {
+        showPaperList () {
+            const start = (this.pagination.currentPage - 1) * this.pagination.pageSize
+            const end = start + this.pagination.pageSize
+            return this.categoryList.slice(start, end)
+        },
+        readonly () {
+            if (this.rowParams.bian_zhi_ren_) {
+                return true
+            } else {
+                if (this.tableList.length) {
+                    return this.tableList.every(item => item.shi_fou_guo_shen_ === '已完成')
+                } else {
+                    return false
+                }
+            }
+        }
+    },
+    watch: {
+        params: {
+            handler (val) {
+                this.getTableData()
+            }
+        },
+        rowParams: {
+            handler (val) {
+                this.getTableData()
+            }
+        },
+        'form.xuan_ze_feng_xian': {
+            handler (data) {
+                this.loading = true
+                data = data.split(',')
+                data = "'" + data.join("','") + "'"
+                const sql = `select * from t_fxkzb where  id_ in (${data}) ORDER BY FIELD(id_, ${data})`
+                this.$common.request('sql', sql).then(response => {
+                    let data1 = []
+                    if (response.variables != null && response.variables.data != null && response.variables.data.length > 0) {
+                        data1 = response.variables.data
+                        // console.log(data1)
+                        for (const item of data1) {
+                            const chongfu = this.tableList.find(i => i.shi_bie_xiang_ === item.id_)
+                            if (!chongfu) {
+                                this.tableList.push({
+                                    di_dian_: this.level,
+                                    bian_zhi_ren_: this.userId,
+                                    bian_zhi_bu_men_: this.position,
+                                    bian_zhi_shi_jian: this.time,
+                                    parent_id_: this.params.id_,
+
+                                    shi_bie_xiang_: item.id_,
+                                    yao_su_tiao_kuan_: item.tiao_kuan_,
+                                    gong_zuo_huan_jie: item.huan_jie_,
+                                    gong_zuo_miao_shu: item.gong_zuo_miao_shu,
+                                    feng_xian_miao_sh: item.feng_xian_miao_sh
+                                })
+                            }
+                        }
+                    }
+                    this.tableList.forEach(item => {
+                        const cunZai = data1.find(i => i.id_ === item.shi_bie_xiang_)
+                        if (!cunZai) {
+                            this.tableList = this.tableList.filter(ii => ii.shi_bie_xiang_ !== item.shi_bie_xiang_)
+                        }
+                    })
+                    this.loading = false
+                })
+            }
+        }
+    },
+    methods: {
+        async getTableData () {
+            this.loading = true
+            // console.log(this.params)
+            if (!this.params.id_) return
+            let sql = ''
+            if (this.readonly) {
+                sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.rowParams.bian_zhi_ren_}'`
+            } else {
+                sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.userId}'`
+            }
+            const { variables: { data }} = await this.$common.request('sql', sql)
+            if (data.length > 0) {
+                // console.log('data', data)
+                this.form.xuan_ze_feng_xian = data[0].xuan_ze_feng_xian
+                this.tableList = data
+                // 存储原始数据的 id 数组
+                this.Ids = this.tableList.map(item => item.shi_bie_xiang_)
+            } else {
+                this.tableList = []
+                this.Ids = []
+            }
+
+            // 获取风险等级相关
+            const degreeSql = `select yan_zhong_cheng_d, fen_ji_, miao_shu_ FROM t_yzcdfjbzb WHERE parent_id_ =(select id_ FROM t_yzcdfjb WHERE fen_lei_ ='严重程度' and di_dian_ = ${this.level} ORDER BY create_time_ DESC LIMIT 1) ORDER BY fen_ji_ ASC`
+            const gailvSql = `select yan_zhong_cheng_d, fen_ji_, miao_shu_ FROM t_yzcdfjbzb WHERE parent_id_ =(select id_ FROM t_yzcdfjb WHERE fen_lei_ ='发生概率' and di_dian_ = ${this.level} ORDER BY create_time_ DESC LIMIT 1) ORDER BY fen_ji_ ASC`
+            const dengjiSql = `select yan_zhong_cheng_d, fen_ji_, miao_shu_ FROM t_yzcdfjbzb WHERE parent_id_ =(select id_ FROM t_yzcdfjb WHERE fen_lei_ ='风险等级' and di_dian_ = ${this.level} ORDER BY create_time_ DESC LIMIT 1) ORDER BY fen_ji_ ASC`
+            Promise.all([
+                this.$common.request('sql', degreeSql),
+                this.$common.request('sql', gailvSql),
+                this.$common.request('sql', dengjiSql)
+            ]).then(responses => {
+                let degreeData = []
+                let gailvData = []
+                let dengjiData = []
+
+                if (responses[0].variables != null && responses[0].variables.data != null && responses[0].variables.data.length > 0) {
+                    degreeData = responses[0].variables.data
+                }
+                if (responses[1].variables != null && responses[1].variables.data != null && responses[1].variables.data.length > 0) {
+                    gailvData = responses[1].variables.data
+                }
+                if (responses[2].variables != null && responses[2].variables.data != null && responses[2].variables.data.length > 0) {
+                    dengjiData = responses[2].variables.data
+                }
+                let degreeWord = ''
+                let gailvWord = ''
+                let dengjiWord = ''
+                for (const el of degreeData) {
+                    degreeWord += `${el.fen_ji_}级:${el.yan_zhong_cheng_d},${el.miao_shu_}\n`
+                }
+                for (const el of gailvData) {
+                    gailvWord += `${el.fen_ji_}级:${el.yan_zhong_cheng_d},${el.miao_shu_}\n`
+                }
+                for (const el of dengjiData) {
+                    dengjiWord += `${el.fen_ji_}级:${el.yan_zhong_cheng_d},${el.miao_shu_}\n`
+                }
+                this.content[0].value = degreeWord
+                this.content[1].value = gailvWord
+                this.content[2].value = dengjiWord
+                this.yan_zhong_cheng_d_List = degreeData.map(item => item.fen_ji_)
+                this.fa_sheng_pin_du_List = gailvData.map(item => item.fen_ji_)
+                this.fengXianJiSuan = dengjiData
+                this.loading = false
+            }).catch(error => {
+                // 处理错误
+                console.error('Error fetching data:', error)
+                this.loading = false
+            })
+        },
+        // 选择器切换
+        onSelectorChange () {
+            this.pagination = {
+                pageSize: 10,
+                currentPage: 1
+            }
+        },
+
+        // 当前页码改变
+        handleCurrentChange (val) {
+            this.pagination.currentPage = val
+        },
+        // 页码选择器改变
+        handleSizeChange (val) {
+            this.pagination.pageSize = val
+            this.pagination.currentPage = 1
+        },
+        // 分页连续序号
+        showIndex (index) {
+            return index + 1 + (this.pagination.currentPage - 1) * this.pagination.pageSize
+        },
+        close () {
+            this.dialogVisible = false
+            setTimeout(() => {
+                this.rowParams = {}
+                this.params = {}
+                this.form.xuan_ze_feng_xian = ''
+            }, 500)
+        },
+        open (val, row) {
+            this.params = val
+            if (row) {
+                this.rowParams = row
+            }
+            this.dialogVisible = true
+        },
+        // 计算风险指数
+        culRate (row) {
+            if (row.yan_zhong_cheng_d && row.fa_sheng_pin_du_) {
+                let degree = ''
+                let rate = ''
+                rate = +row.yan_zhong_cheng_d * +row.fa_sheng_pin_du_
+                if (this.fengXianJiSuan.length === 0) {
+                    if (rate >= 1 && rate <= 4) {
+                        degree = '低风险'
+                    }
+                    if (rate >= 5 && rate <= 11) {
+                        degree = '中风险'
+                    }
+                    if (rate >= 12 && rate <= 25) {
+                        degree = '高风险'
+                    }
+                } else {
+                    for (let i = 0; i < this.fengXianJiSuan.length; i++) {
+                        const item = this.fengXianJiSuan[i]
+                        if (item.yan_zhong_cheng_d) {
+                            const [a, b] = item.yan_zhong_cheng_d.split('-')
+                            if (a && b) {
+                                if (rate >= +a && rate <= +b) {
+                                    degree = item.fen_ji_
+                                    break
+                                }
+                            }
+                        }
+                    }
+                }
+
+                this.$set(row, 'feng_xian_ying_du', (!row.feng_xian_ying_du && degree === '低风险') ? '风险接受' : '风险降低')
+                row.feng_xian_zhi_shu = rate + ''
+                row.feng_xian_deng_ji = degree
+            }
+        },
+        check () {
+            if (this.tableList.length === 0) {
+                this.$message.warning('请选择风险项!')
+                return false
+            }
+            for (let i = 0; i < this.tableList.length; i++) {
+                const item = this.tableList[i]
+                if (!item.feng_xian_zhi_shu) {
+                    this.$message.warning(`请检查第${i + 1}行数据是否填写完整!`)
+                    return false
+                }
+                if (item.feng_xian_ying_du !== '风险接受' && !item.zhi_ding_ren_) {
+                    this.$message.warning(`第${i + 1}行缺少措施指定人!`)
+                    return false
+                }
+                // 格式化成需要的数据
+                item.xuan_ze_feng_xian = this.form.xuan_ze_feng_xian
+                delete item.create_by_
+                delete item.create_time_
+            }
+            return true
+        },
+        submit () {
+            // console.log(this.Ids)
+            if (this.Ids.length === 0) return this.$message.warning('请填写风险识别项保存后再提交!')
+            this.$confirm('提交后不可再修改,请再次确认并保存后进行提交操作,时是否继续?', '提示', {
+                confirmButtonText: '继续',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(async () => {
+                // 先查询状态
+                let sql = ''
+                if (this.readonly) {
+                    sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.rowParams.bian_zhi_ren_}'`
+                } else {
+                    sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.userId}'`
+                }
+                const { variables: { data }} = await this.$common.request('sql', sql)
+                if (data.length > 0 && data.every(item => item.shi_fou_guo_shen_ === '已完成')) {
+                    return this.$message('已提交,不可再次提交!')
+                }
+                const sql2 = `select * from t_fxpgjlb2 where id_='${this.params.id_}'`
+                const { variables: { data: data2 }} = await this.$common.request('sql', sql2)
+                if (data2.length > 0 && data2[0].shi_fou_guo_shen_ === '已完成') {
+                    return this.$message('已结束,不可再次提交!')
+                }
+
+                const params = {
+                    tableName: 't_fxsbpgb2',
+                    updList: this.Ids.map(item => ({
+                        where: {
+                            shi_bie_xiang_: item,
+                            bian_zhi_ren_: this.userId,
+                            parent_id_: this.params.id_
+                        },
+                        param: {
+                            shi_fou_guo_shen_: '已完成'
+                        }
+                    }))
+                }
+                console.log(params)
+                await this.$common.request('update', params)
+                console.log('提交成功')
+                this.$message({
+                    type: 'success',
+                    message: '提交成功!'
+                })
+                this.close()
+            }).catch(() => {
+
+            })
+        },
+        async save () {
+            if (!this.check()) return
+            let sql = ''
+            if (this.readonly) {
+                sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.rowParams.bian_zhi_ren_}'`
+            } else {
+                sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_='${this.userId}'`
+            }
+            const { variables: { data }} = await this.$common.request('sql', sql)
+            if (data.length > 0 && data.every(item => item.shi_fou_guo_shen_ === '已完成')) {
+                return this.$message('已提交,不可再次提交!')
+            }
+            const sql2 = `select * from t_fxpgjlb2 where id_='${this.params.id_}'`
+            const { variables: { data: data2 }} = await this.$common.request('sql', sql2)
+            if (data2.length > 0 && data2[0].shi_fou_guo_shen_ === '已完成') {
+                return this.$message('已结束,不可再次提交!')
+            }
+
+            // console.log(this.tableList)
+            const curIds = this.tableList.map(item => item.shi_bie_xiang_)
+
+            // 计算需要增加项
+            const addedIds = this.tableList.filter(item => !this.Ids.includes(item.shi_bie_xiang_))
+            // 计算需要更新项
+            const updatedIds = this.tableList.filter(item => this.Ids.includes(item.shi_bie_xiang_))
+            // 计算需要删除项
+            const deletedIds = this.Ids.filter(id => !curIds.includes(id))
+            console.log(addedIds, updatedIds, deletedIds)
+
+            // 新增
+            if (addedIds.length > 0) {
+                const params = {
+                    tableName: 't_fxsbpgb2',
+                    paramWhere: addedIds
+                }
+                console.log(params)
+                await this.$common.request('add', params)
+                console.log('添加成功')
+            }
+            // 更新
+            if (updatedIds.length > 0) {
+                const params = {
+                    tableName: 't_fxsbpgb2',
+                    updList: updatedIds.map(item => ({
+                        where: {
+                            id_: item.id_
+                        },
+                        param: {
+                            ...item,
+                            xuan_ze_feng_xian: this.form.xuan_ze_feng_xian
+                        }
+                    }))
+                }
+                console.log(params)
+                await this.$common.request('update', params)
+                console.log('更新成功')
+            }
+            // 删除
+            if (deletedIds.length > 0) {
+                const sql3 = `select * from t_fxsbpgb2 where bian_zhi_ren_='${this.userId}' and parent_id_='${this.params.id_}' and shi_bie_xiang_ in (${deletedIds.map(id => `'${id}'`).join(', ')})`
+                const { variables: { data: data3 }} = await this.$common.request('sql', sql3)
+                if (data3.length > 0) {
+                    // console.log('data3', data3)
+                    const params = {
+                        tableName: 't_fxsbpgb2',
+                        paramWhere: {
+                            id_: data3.map(item => item.id_).join(',')
+                        }
+                    }
+                    console.log(params)
+                    await this.$common.request('delete', params)
+                    console.log('删除成功')
+                }
+            }
+            await this.getTableData()
+            this.$message.success('保存成功')
+            // this.close()
+        }
+    }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.contain{
+    padding: 20px;
+    .info{
+        padding: 0;
+        display: flex;
+        justify-content: space-around;
+        align-items: center;
+        width: 80%;
+        margin: 0 auto;
+        .item{
+            display: flex;
+            align-items: center;
+            width: 30%;
+        }
+
+    }
+    .tab{
+        pre{
+            overflow: auto;
+            margin: 0;
+            padding-bottom: 10px;
+        }
+    }
+    .choose{
+            display: flex;
+            align-items: center;
+            margin: 10px 0;
+        }
+    .table{
+        height:300px;
+        overflow: auto;
+        margin-top: 20px;
+    }
+}
+</style>

+ 186 - 0
src/views/platform/risk/riskPeopleTable.vue

@@ -0,0 +1,186 @@
+<template>
+    <div class="paper-table">
+        <el-table
+            ref="elTable"
+            :data="tableList"
+            border
+            stripe
+            highlight-current-row
+            header-row-class-name="exam-table-header"
+            style="width: 100%"
+            class="exam-table"
+        >
+            <el-table-column label="序号" type="index" width="80" />
+            <el-table-column prop="bian_zhi_ren_" label="评估人" width="100">
+                <template slot-scope="{row}">
+                    <ibps-user-selector
+                        type="user"
+                        :value="row.bian_zhi_ren_"
+                        readonly-text="text"
+                        :disabled="true"
+                        :multiple="false"
+                    />
+                </template>
+            </el-table-column>
+            <el-table-column prop="bian_zhi_bu_men_" label="部门" width="140">
+                <template slot-scope="{row}">
+                    <ibps-user-selector
+                        type="position"
+                        :value="row.bian_zhi_bu_men_"
+                        readonly-text="text"
+                        :disabled="true"
+                        :multiple="false"
+                    />
+                </template>
+            </el-table-column>
+            <el-table-column prop="feng_xian_shu_" label="风险数" width="80" />
+            <el-table-column prop="feng_xian_c_" label="风险等级分布情况" />
+            <el-table-column prop="shi_fou_guo_shen_" label="识别状态" width="140">
+                <template slot-scope="{row}">
+                    <el-tag :type="row.shi_fou_guo_shen_==='已完成'?'success':'danger'">{{ row.shi_fou_guo_shen_ }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="" label="操作" width="200">
+                <template slot-scope="{row}">
+                    <el-button type="primary" size="mini" :disabled="row.shi_fou_guo_shen_!=='已完成' || (params&&params.shi_fou_guo_shen_==='已完成')" @click="goBack(row)">退回</el-button>
+                    <el-button type="primary" size="mini" @click="goDetail(row)">详情</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <RiskDetail ref="RiskDetailRef" />
+    </div>
+</template>
+
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+import RiskDetail from './riskDetail.vue'
+
+export default {
+    components: {
+        ibpsUserSelector,
+        RiskDetail
+    },
+    props: {
+        params: {
+            type: Object,
+            default: () => {}
+        },
+        peopleIds: {
+            type: String,
+            default: ''
+        }
+    },
+    data () {
+        return {
+            tableList: [],
+            detail: []
+        }
+    },
+    watch: {
+        peopleIds: {
+            handler (val) {
+                this.getPeopleList()
+            }
+            // immediate: true
+        }
+    },
+    mounted () {
+        this.getPeopleList()
+    },
+    methods: {
+        // 获取人员部门
+        getPersonPosition (id) {
+            const userList = this.$store.getters.userList
+            const bianzhiUserid = userList.find(i => i.userId === id)
+            if (bianzhiUserid) {
+                return bianzhiUserid.positionId
+            }
+        },
+        getPersonStatus (id) {
+            const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
+            if (tempList.length) {
+                return tempList.every(i => i.shi_fou_guo_shen_ === '已完成') ? '已完成' : '未完成'
+            } else {
+                return '未完成'
+            }
+        },
+        getRiskCount (id) {
+            const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
+            if (tempList.length) return tempList.length
+        },
+        getRiskCategory (id) {
+            const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
+            if (tempList.length) {
+                const myMap = new Map()
+                tempList.forEach(item => {
+                    const category = item.feng_xian_deng_ji
+                    if (!myMap.has(category)) {
+                        myMap.set(category, 0)
+                    }
+                    myMap.set(category, myMap.get(category) + 1)
+                })
+                return `低风险:${myMap.get('低风险') || 0};中风险:${myMap.get('中风险') || 0};高风险:${myMap.get('高风险') || 0};`
+            }
+        },
+        async getPeopleList () {
+            // console.log('zi', data)
+            // this.tableList = data
+            if (this.peopleIds) {
+                const sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}'`
+                const { variables: { data }} = await this.$common.request('sql', sql)
+                this.detail = data
+                // console.log(data)
+                const people = this.peopleIds.split(',')
+                if (people.length > 0) {
+                    this.tableList = people.map(item => {
+                        return {
+                            bian_zhi_ren_: item,
+                            bian_zhi_bu_men_: this.getPersonPosition(item),
+                            shi_fou_guo_shen_: this.getPersonStatus(item),
+                            feng_xian_shu_: this.getRiskCount(item),
+                            feng_xian_c_: this.getRiskCategory(item)
+                        }
+                    })
+                }
+            }
+        },
+        goDetail (row) {
+            this.$refs.RiskDetailRef.open(this.params, row)
+        },
+        goBack (row) {
+            this.$confirm('退回操作后评估人可再次修改识别项,是否继续?', '提示', {
+                confirmButtonText: '继续',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(async () => {
+                const params = {
+                    tableName: 't_fxsbpgb2',
+                    updList: [{
+                        where: {
+                            bian_zhi_ren_: row.bian_zhi_ren_,
+                            parent_id_: this.params.id_
+                        },
+                        param: {
+                            shi_fou_guo_shen_: '编制中'
+                        }
+                    }]
+                }
+                console.log(params)
+                await this.$common.request('update', params)
+                console.log('退回成功')
+                await this.getPeopleList()
+                this.$message({
+                    type: 'success',
+                    message: '退回成功!'
+                })
+            }).catch(() => {
+
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 750 - 0
src/views/platform/risk/riskV2.vue

@@ -0,0 +1,750 @@
+<template>
+    <el-dialog
+        v-loading="loading"
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+        append-to-body
+        fullscreen
+        class="dialog paper-detail-dialog"
+        top="0"
+    >
+        <div class="container">
+            <div class="left" :style="{width:initWidth}">
+                <el-descriptions title="" direction="vertical" :column="5" border size="mini">
+                    <el-descriptions-item label="年度" class="aaaa">
+                        <span class="required-star">*</span>
+                        <el-date-picker
+                            v-model="infoFxssbData.nian_du_"
+                            type="year"
+                            placeholder="选择年"
+                            :readonly="readonly"
+                            value-format="yyyy"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="编制部门:">
+                        <ibps-user-selector
+                            type="position"
+                            :value="infoFxssbData.bian_zhi_bu_men_"
+                            readonly-text="text"
+                            :disabled="true"
+                            :multiple="false"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="编制人">
+                        <ibps-user-selector
+                            type="user"
+                            :value="infoFxssbData.bian_zhi_ren_"
+                            readonly-text="text"
+                            :disabled="true"
+                            :multiple="true"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="编制时间">
+                        <el-date-picker
+                            v-model="infoFxssbData.bian_zhi_shi_jian"
+                            type="datetime"
+                            placeholder="选择日期时间"
+                            :readonly="true"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="评估编号">
+                        {{ infoFxssbData.ji_hua_bian_hao_ }}
+                    </el-descriptions-item>
+                    <el-descriptions-item label="组长">
+                        <ibps-user-selector
+                            type="user"
+                            :value="infoFxssbData.zu_chang_id_"
+                            readonly-text="text"
+                            :disabled="true"
+                            :multiple="true"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="评估开始时间">
+                        <span class="required-star">*</span>
+                        <el-date-picker
+                            v-model="infoFxssbData.kai_shi_ri_qi_"
+                            type="date"
+                            placeholder="选择日期"
+                            :readonly="readonly"
+                            value-format="yyyy-MM-dd"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="评估结束时间">
+                        <span class="required-star">*</span>
+                        <el-date-picker
+                            v-model="infoFxssbData.jie_shu_ri_qi_"
+                            type="date"
+                            placeholder="选择日期"
+                            :readonly="readonly"
+                            value-format="yyyy-MM-dd"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="报告完成时间">
+                        <span class="required-star">*</span>
+                        <el-date-picker
+                            v-model="infoFxssbData.bao_gao_shi_jian_"
+                            type="date"
+                            placeholder="选择日期"
+                            :readonly="readonly"
+                            value-format="yyyy-MM-dd"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="风险类型">
+                        <el-select v-model="infoFxssbData.feng_xian_lei_xin" :disabled="readonly" placeholder="请选择" size="mini">
+                            <el-option
+                                v-for="item in ['质量','安全']"
+                                :key="item"
+                                :label="item"
+                                :value="item"
+                            />
+                        </el-select>
+                    </el-descriptions-item>
+                    <el-descriptions-item label="时机" :span="1">
+                        <el-select v-model="infoFxssbData.shi_ji_" :disabled="readonly" placeholder="请选择" size="mini">
+                            <el-option
+                                v-for="item in ['定期评估','新增活动','不良事件','程序变化','业务变化']"
+                                :key="item"
+                                :label="item"
+                                :value="item"
+                            />
+                        </el-select>
+
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="范围" :span="2">
+                        <el-input v-model="infoFxssbData.fan_wei_" :readonly="readonly" size="mini" />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="方法" :span="2">
+                        <el-input v-model="infoFxssbData.fang_fa_" :readonly="readonly" size="mini" />
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="目的" :span="5">
+                        <el-input v-model="infoFxssbData.mu_di_" :readonly="readonly" size="mini" />
+                    </el-descriptions-item>
+                    <el-descriptions-item label="依据文件" :span="5">
+                        <!-- 模版弹窗 -->
+                        <ibps-custom-dialog
+                            v-if="!readonly"
+                            v-model="infoFxssbData.yi_ju_wen_jian_id"
+                            template-key="nsyjwjxz"
+                            multiple
+                            type="dialog"
+                            class="custom-dialog"
+                            placeholder="请选择依据文件"
+                            size="mini"
+                            icon="el-icon-search"
+                        />
+                        <pre style="margin:0">{{ infoFxssbData.yi_ju_wen_jian_ }}</pre>
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="首次会议时间" :span="1">
+                        <span class="required-star">*</span>
+                        <el-date-picker
+                            v-model="infoFxssbData.hui_yi_shi_jian_"
+                            type="datetime"
+                            placeholder="选择日期时间"
+                            default-time="12:00:00"
+                            :readonly="readonly"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            size="mini"
+                        />
+
+                    </el-descriptions-item>
+                    <el-descriptions-item label="参会人员" :span="4">
+                        <div style="display:flex">
+                            <span class="required-star">*</span>
+                            <ibps-user-selector
+                                v-model="infoFxssbData.can_hui_ren_yuan_"
+                                style="width:100%"
+                                type="user"
+                                readonly-text="text"
+                                :disabled="readonly"
+                                :multiple="true"
+                                size="mini"
+                            />
+                        </div>
+
+                    </el-descriptions-item>
+                    <el-descriptions-item label="会议附件" :span="5">
+                        <ibps-attachment
+                            v-model="infoFxssbData.hui_yi_fu_jian_"
+                            :download="true"
+                            multiple
+                            accept="*"
+                            :readonly="readonly"
+                            size="mini"
+                        />
+                    </el-descriptions-item>
+
+                    <el-descriptions-item label="事务说明 " :span="5">
+                        <el-input v-model="infoFxssbData.shi_wu_shuo_ming_" :readonly="readonly" size="mini" /></el-descriptions-item>
+                    <el-descriptions-item label="评估人员 " :span="5">
+                        <div style="display:flex">
+                            <span class="required-star">*</span>
+                            <ibps-user-selector
+                                v-model="infoFxssbData.ping_gu_ren_yuan_"
+                                type="user"
+                                style="width:100%"
+                                readonly-text="text"
+                                :disabled="readonly"
+                                :multiple="true"
+                                size="mini"
+                            />
+                        </div>
+
+                    </el-descriptions-item>
+                </el-descriptions>
+
+                <div v-if="isEdit && userId===infoFxssbData.zu_chang_id_" style="margin-top:20px">
+                    <el-alert
+                        title="根据评估人员选定的风险识别项给每个措施制定人推送风险改进流程"
+                        type="success"
+                        :closable="false"
+                    />
+                    <RiskPeopleTable ref="RiskPeopleTableRef" :params="params" :people-ids="infoFxssbData.ping_gu_ren_yuan_" />
+                </div>
+
+            </div>
+        </div>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
+
+        <!-- <data-template-formrender-dialog
+            :visible="DialogVisible"
+            form-key="fxbg"
+            :pk-value="pkValue"
+            :readonly="readonly"
+            @close="visible => DialogVisible = visible"
+        /> -->
+        <RiskDetail ref="RiskDetailRef" />
+
+    </el-dialog>
+</template>
+
+<script>
+import dayjs from 'dayjs'
+import Tab from './tab.vue'
+import Recognition from './recognition.vue'
+import RiskPeopleTable from './riskPeopleTable.vue'
+import ibpsUserSelector from '@/business/platform/org/selector'
+import RiskDetail from './riskDetail.vue'
+
+import IbpsAttachment from '@/business/platform/file/attachment/selector'
+import DataFormrender from '@/business/platform/data/templaterender/form'
+import DataTemplateFormrenderDialog from '@/business/platform/data/templaterender/form/dialog.vue'
+
+export default {
+    components: {
+        RiskDetail,
+        RiskPeopleTable,
+        Tab,
+        Recognition,
+        ibpsUserSelector,
+        IbpsAttachment,
+        DataFormrender,
+        DataTemplateFormrenderDialog,
+        IbpsCustomDialog: () => import('@/business/platform/data/templaterender/custom-dialog')
+    },
+    props: {
+        params: {
+            type: Object,
+            default: function () {
+                return {}
+            }
+        }
+    },
+    data () {
+        const { userId, position, level } = this.$store.getters
+        return {
+            userId: userId,
+            position: position,
+            level: level.second || level.first,
+            pkValue: '',
+            readonly: true,
+            DialogVisible: false,
+            loading: false,
+            dialogVisible: true,
+            title: '风险评估与措施',
+            toolbars: [
+                { key: 'refresh', label: '刷新', hidden: () => { return this.userId !== this.infoFxssbData.zu_chang_id_ || !this.isEdit || (this.params && this.params.shi_fou_guo_shen_ === '已完成') } },
+                { key: 'save', label: '保存', hidden: () => { return this.userId !== this.infoFxssbData.zu_chang_id_ || (this.params && this.params.shi_fou_guo_shen_ === '已完成') } },
+                { key: 'sendMsg', label: '提醒评估人', icon: 'el-icon-bell', hidden: () => { return this.userId !== this.infoFxssbData.zu_chang_id_ || !this.isEdit || (this.params && this.params.shi_fou_guo_shen_ === '已完成') } },
+                { key: 'peizhifengxian', label: '更新风险库', type: 'info', icon: 'el-icon-setting', hidden: () => { return this.userId !== this.infoFxssbData.zu_chang_id_ || !this.isEdit } },
+                { key: 'submit', label: '提交', icon: 'el-icon-finished', type: 'success', hidden: () => { return this.userId !== this.infoFxssbData.zu_chang_id_ || !this.isEdit || (this.params && this.params.shi_fou_guo_shen_ === '已完成') } },
+                { key: 'cancel', label: '退出' }
+            ],
+            infoFxssbData: {
+                nian_du_: '',
+                bian_zhi_bu_men_: '',
+                bian_zhi_ren_: '',
+                bian_zhi_shi_jian: '',
+                zu_chang_: '',
+                zu_chang_id_: '',
+                kai_shi_ri_qi_: '',
+                jie_shu_ri_qi_: '',
+                bao_gao_shi_jian_: '',
+                feng_xian_lei_xin: '',
+                shi_ji_: '',
+                fan_wei_: '',
+                fang_fa_: '',
+                mu_di_: '',
+                yi_ju_wen_jian_id: '',
+                yi_ju_wen_jian_: '',
+                hui_yi_shi_jian_: '',
+                can_hui_ren_yuan_: '',
+                hui_yi_fu_jian_: '',
+                shi_wu_shuo_ming_: '',
+                ping_gu_ren_yuan_: '',
+                ji_hua_bian_hao_: ''
+
+            },
+            initWidth: '1280px',
+            isEdit: false,
+            isPingGuRen: false,
+            Ids: []
+        }
+    },
+    watch: {
+        'infoFxssbData.yi_ju_wen_jian_id': {
+            handler (val) {
+                const sql = `select * from yijuwenjianxuanze where id_ in ('${val.replace(/,/g, "','")}') order by id_`
+                this.$common.request('sql', sql).then(response => {
+                    const conts = response.variables.data
+                    let fileName = ''
+                    let num = 1
+                    conts.forEach((item, index) => {
+                        fileName += `${num}、${item.name_}\n`
+                        num = num + 1
+                    })
+                    this.infoFxssbData.yi_ju_wen_jian_ = fileName
+                })
+            },
+            immediate: true
+
+        },
+        'infoFxssbData.zu_chang_id_': {
+            handler (val) {
+                if (val) {
+                    const userList = this.$store.getters.userList
+                    const bianzhiUserid = userList.find(i => i.userId === val)
+                    if (bianzhiUserid) {
+                        this.infoFxssbData.zu_chang_ = bianzhiUserid.userName
+                    }
+                }
+            }
+        }
+    },
+
+    mounted () {
+        this.init()
+    },
+    beforeDestroy () {
+        if (this.msg) {
+            this.msg.close()
+        }
+    },
+    methods: {
+        // 提交
+        async goSubmit () {
+            // 先检查状态
+            const sql2 = `select * from t_fxpgjlb2 where id_='${this.params.id_}'`
+            const { variables: { data: data2 }} = await this.$common.request('sql', sql2)
+            if (data2.length > 0 && data2[0].shi_fou_guo_shen_ === '已完成') {
+                return this.$message('已结束,不可再次提交!')
+            }
+
+            const sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}'`
+            const { variables: { data }} = await this.$common.request('sql', sql)
+            if (data.length > 0 && data.every(item => item.shi_fou_guo_shen_ === '已完成')) {
+                this.$confirm('提交后不可再次更改,是否继续?', '提示', {
+                    confirmButtonText: '继续',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(async () => {
+                    // 1.修改状态为已完成
+                    const updateParamsRecord = {
+                        tableName: 't_fxpgjlb2',
+                        updList: [{
+                            where: {
+                                id_: this.params.id_
+                            },
+                            param: {
+                                shi_fou_guo_shen_: '已完成'
+                            }
+                        }]
+                    }
+                    await this.$common.request('update', updateParamsRecord)
+                    // console.log(data)
+                    // 2.推送给措施制定人下一个流程
+                    let count = 0
+                    const addParams = {
+                        tableName: 't_fxkzcsb2',
+                        paramWhere: data.map(item => {
+                            if (item.feng_xian_ying_du !== '风险接受' && item.zhi_ding_ren_) {
+                                count++
+                                return {
+                                    di_dian_: this.level,
+                                    shi_fou_guo_shen_: '已编制',
+                                    bian_zhi_ren_: item.zhi_ding_ren_,
+                                    bian_zhi_bu_men_: this.getPersonPosition(item.zhi_ding_ren_),
+                                    bian_zhi_shi_jian: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+                                    gai_jin_bian_hao_: ('FXGJ-' + dayjs().format('YYYYMMDDHHmmss')) + count,
+                                    // zheng_gai_qi_xian:'',
+                                    yao_su_tiao_kuan_: item.yao_su_tiao_kuan_,
+                                    gong_zuo_huan_jie: item.gong_zuo_huan_jie,
+                                    gong_zuo_miao_shu: item.gong_zuo_miao_shu,
+                                    feng_xian_miao_sh: item.feng_xian_miao_sh,
+                                    // gai_jin_cuo_shi_:item.gai_jin_cuo_shi_,
+                                    // wan_cheng_shi_jia
+                                    // ping_gu_ren_:item.bian_zhi_ren_,
+                                    // ping_gu_shi_jian_:
+                                    zu_chang_: this.infoFxssbData.zu_chang_,
+                                    zu_chang_id_: this.infoFxssbData.zu_chang_id_,
+                                    shi_wu_shuo_ming_: this.infoFxssbData.shi_wu_shuo_ming_,
+                                    // yan_zhong_cheng_d: item.yan_zhong_cheng_d,
+                                    // fa_sheng_pin_du_: item.fa_sheng_pin_du_,
+                                    // feng_xian_zhi_shu: item.feng_xian_zhi_shu,
+                                    // feng_xian_deng_ji: item.feng_xian_deng_ji,
+                                    // feng_xian_ying_du: item.feng_xian_ying_du,
+                                    yuan_zhi_shu_: item.feng_xian_zhi_shu,
+                                    // deng_ji_shuo_ming:'',
+                                    kong_zhi_fang_fa_: item.xian_xing_kong_zh,
+                                    // gai_lv_shuo_ming_:'',
+                                    // cuo_shi_shuo_ming:'',
+                                    feng_xian_lei_xin: this.infoFxssbData.feng_xian_lei_xin,
+                                    qian_fu_jian_: this.infoFxssbData.yi_ju_wen_jian_id,
+                                    ji_hua_bian_hao_: this.infoFxssbData.ji_hua_bian_hao_,
+                                    ni_cai_qu_kong_zh: item.ni_cai_qu_cuo_shi
+                                }
+                            }
+                        }).filter(i => i !== undefined),
+                        formKey: 'fxcscsbV2',
+                        defKey: 'Process_1li9h0n'
+                    }
+                    console.log(addParams)
+                    if (addParams.paramWhere.length) {
+                        await this.$common.request('add', addParams)
+                        // 3.推送给组长 评估报告流程
+                        const addParams2 = {
+                            tableName: 't_fxkzbg',
+                            paramWhere: [{
+                                di_dian_: this.level,
+                                shi_fou_guo_shen_: '已编制',
+                                bian_zhi_ren_: this.infoFxssbData.zu_chang_id_,
+                                bian_zhi_bu_men_: this.getPersonPosition(this.infoFxssbData.zu_chang_id_),
+                                bian_zhi_shi_jian: dayjs().format('YYYY-MM-DD HH:mm'),
+                                zu_chang_: this.infoFxssbData.zu_chang_,
+                                zu_chang_id_: this.infoFxssbData.zu_chang_id_,
+                                feng_xian_lei_xin: this.infoFxssbData.feng_xian_lei_xin,
+                                kai_shi_ri_qi_: this.infoFxssbData.kai_shi_ri_qi_,
+                                jie_shu_ri_qi_: this.infoFxssbData.jie_shu_ri_qi_,
+                                wan_cheng_ri_qi_: this.infoFxssbData.bao_gao_shi_jian_,
+                                shi_wu_shuo_ming_: this.infoFxssbData.shi_wu_shuo_ming_,
+                                ji_hua_bian_hao_: this.infoFxssbData.ji_hua_bian_hao_,
+                                hui_yi_wen_jian_: this.infoFxssbData.hui_yi_fu_jian_
+                            }],
+                            formKey: 'fxbg',
+                            defKey: 'Process_0mrlsj7'
+                        }
+                        console.log(addParams2)
+                        await this.$common.request('add', addParams2)
+                        console.log('流程推送成功')
+                    } else {
+                        console.log('无需推送')
+                    }
+
+                    // 4.主动生成快照 todo
+                    // let formName='风险管理/风险控制与评价表V2.rpx'
+
+                    this.$message.success('提交成功')
+                    this.closeDialog(true)
+                })
+                    .catch(() => {
+
+                    })
+            } else {
+                this.$message.warning('存在未提交风险识别项的在评估人员,请提醒提交后再进行操作!')
+                return
+            }
+        },
+        goPeizhifengxian () {
+            const buttons = document.querySelector('button[name="peizhifengxian"]')
+            if (buttons) {
+                buttons.click()
+            }
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.closeDialog(true)
+                    break
+                case 'record':
+                    this.goRecord()
+                    break
+                case 'save':
+                    this.goSave()
+                    break
+                case 'submit':
+                    this.goSubmit()
+                    break
+                case 'refresh':
+                    this.goRefresh()
+                    break
+                case 'sendMsg':
+                    this.goSendMsg()
+                    break
+                case 'peizhifengxian':
+                    this.goPeizhifengxian()
+                    break
+                default:
+                    break
+            }
+        },
+
+        // 推送消息给评估人
+        async goSendMsg () {
+            const sql2 = `select * from t_fxpgjlb2 where id_='${this.params.id_}'`
+            const { variables: { data: data2 }} = await this.$common.request('sql', sql2)
+            if (data2.length > 0 && data2[0].shi_fou_guo_shen_ === '已完成') {
+                return this.$message('已结束,不可推送消息!')
+            }
+            this.$confirm('此操作将通知所有评估人,是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                // console.log(this.Ids)
+                const allRequests = []
+                this.Ids.forEach(item => {
+                    allRequests.push(this.$common.sendMsg({
+                        subject: '风险识别项待填写提醒',
+                        content: `您有一份风险识别项待填写,请前往-风险控制-风险评估与措施页面填写,计划编号:${this.infoFxssbData.ji_hua_bian_hao_},组长:${this.infoFxssbData.zu_chang_}。如已提交请忽略。`,
+                        receiverId: item,
+                        canreplay: '0',
+                        skipTypeMsg: JSON.stringify({
+                            skipType: 3,
+                            pathInfo: '/tygl/fxkzV2/fxpgycslb' // 路由
+                        })
+                    }))
+                })
+                Promise.all(allRequests).then(() => {
+                    this.$message({
+                        type: 'success',
+                        message: '推送成功!'
+                    })
+                })
+                    .catch(() => {
+                        this.$message({
+                            type: 'warning',
+                            message: '推送失败!'
+                        })
+                    })
+            }).catch(() => {
+
+            })
+        },
+        // 获取人员部门
+        getPersonPosition (id) {
+            const userList = this.$store.getters.userList
+            const bianzhiUserid = userList.find(i => i.userId === id)
+            if (bianzhiUserid) {
+                return bianzhiUserid.positionId
+            }
+        },
+        checkRequired () {
+            return this.infoFxssbData.nian_du_ && this.infoFxssbData.kai_shi_ri_qi_ && this.infoFxssbData.jie_shu_ri_qi_ && this.infoFxssbData.bao_gao_shi_jian_ && this.infoFxssbData.hui_yi_shi_jian_ && this.infoFxssbData.can_hui_ren_yuan_ && this.infoFxssbData.ping_gu_ren_yuan_
+        },
+        async goAdd () {
+            try {
+                const addParamsRecord = {
+                    tableName: 't_fxpgjlb2',
+                    paramWhere: [this.infoFxssbData]
+                }
+                const { variables: { cont }} = await this.$common.request('add', addParamsRecord)
+                if (cont.length) {
+                    this.$message.success('添加成功')
+                    this.closeDialog(true)
+                }
+            } catch (error) {
+                console.log(error)
+                this.$message.warning('添加失败')
+            }
+        },
+        async goEdit () {
+            try {
+                // 先检查状态
+                const sql2 = `select * from t_fxpgjlb2 where id_='${this.params.id_}'`
+                const { variables: { data: data2 }} = await this.$common.request('sql', sql2)
+                if (data2.length > 0 && data2[0].shi_fou_guo_shen_ === '已完成') {
+                    return this.$message('已结束,不可再次编辑!')
+                }
+
+                const updateParamsRecord = {
+                    tableName: 't_fxpgjlb2',
+                    updList: [{
+                        where: {
+                            id_: this.params.id_
+                        },
+                        param: this.infoFxssbData
+                    }]
+                }
+                await this.$common.request('update', updateParamsRecord)
+                this.$message.success('修改成功')
+                this.closeDialog(true)
+
+                // 当前人员数组
+                const curIds = this.infoFxssbData.ping_gu_ren_yuan_.split(',')
+
+                // 计算需要增加项
+                const addedIds = curIds.filter(item => !this.Ids.includes(item))
+                // 计算需要更新项
+                const updatedIds = curIds.filter(item => this.Ids.includes(item))
+                // 计算需要删除项
+                const deletedIds = this.Ids.filter(id => !curIds.includes(id))
+                console.log(addedIds, updatedIds, deletedIds)
+                // 删除
+                if (deletedIds.length > 0) {
+                    const sql3 = `select *from t_fxsbpgb2 where parent_id_='${this.params.id_}' and bian_zhi_ren_ in (${deletedIds.map(id => `'${id}'`).join(', ')})`
+                    const { variables: { data: data3 }} = await this.$common.request('sql', sql3)
+                    // console.log(data3)
+                    if (data3.length > 0) {
+                        const params = {
+                            tableName: 't_fxsbpgb2',
+                            paramWhere: {
+                                id_: data3.map(item => item.id_).join(',')
+                            }
+                        }
+                        console.log(params)
+                        await this.$common.request('delete', params)
+                        console.log('删除成功')
+                    }
+                }
+            } catch (error) {
+                console.log(error)
+                this.$message.warning('修改失败')
+            }
+        },
+        goSave () {
+            // console.log(this.infoFxssbData)
+            if (!this.checkRequired()) {
+                return this.$message.warning('请检查必填项是否填写完整!')
+            }
+            if (this.isEdit) {
+                this.goEdit()
+            } else {
+                this.goAdd()
+            }
+        },
+        // 刷新
+        async goRefresh () {
+            this.loading = true
+            await this.$refs.RiskPeopleTableRef.getPeopleList()
+            this.loading = false
+        },
+        // 关闭当前窗口
+        closeDialog (needRefresh) {
+            this.dialogVisible = false
+            if (needRefresh) {
+                this.$emit('close')
+            }
+            if (this.msg) {
+                this.msg.close()
+            }
+        },
+        init () {
+            // console.log(this.params)
+            this.isEdit = this.params && this.params.id_
+            if (this.isEdit) {
+                this.infoFxssbData = this.params
+                if (this.params.ping_gu_ren_yuan_) {
+                    this.Ids = this.params.ping_gu_ren_yuan_.split(',')
+                }
+                this.readonly = this.infoFxssbData.zu_chang_id_ !== this.userId
+                if (this.params.shi_fou_guo_shen_ === '已完成') this.readonly = true
+                this.isPingGuRen = this.params.ping_gu_ren_yuan_.indexOf(this.userId) >= 0
+                if (!this.msg && this.isPingGuRen && this.params && this.params.shi_fou_guo_shen_ !== '已完成') {
+                    this.msg = this.$notify.warning({
+                        title: '您有一份风险识别评估表待填写!',
+                        message: '点击前往填写',
+                        showClose: false,
+                        duration: 0,
+                        onClick: () => {
+                            this.$refs.RiskDetailRef.open(this.params)
+                        }
+                    })
+                }
+            } else {
+                this.readonly = false
+                this.infoFxssbData.di_dian_ = this.level
+                this.infoFxssbData.ji_hua_bian_hao_ = 'FX-' + dayjs().format('YYYYMMDDHHmmss')
+                this.infoFxssbData.nian_du_ = dayjs().format('YYYY')
+                this.infoFxssbData.bian_zhi_bu_men_ = this.position
+                this.infoFxssbData.bian_zhi_ren_ = this.userId
+                this.infoFxssbData.bian_zhi_shi_jian = dayjs().format('YYYY-MM-DD HH:mm:ss')
+                this.infoFxssbData.zu_chang_id_ = this.userId
+                this.infoFxssbData.kai_shi_ri_qi_ = dayjs().format('YYYY-MM-DD')
+                this.infoFxssbData.jie_shu_ri_qi_ = dayjs().format('YYYY-MM-DD')
+                this.infoFxssbData.feng_xian_lei_xin = '质量'
+                this.infoFxssbData.shi_ji_ = '定期评估'
+                this.infoFxssbData.fan_wei_ = '本实验室与质量相关所有活动'
+                this.infoFxssbData.fang_fa_ = '定量风险评估法'
+                this.infoFxssbData.mu_di_ = '通过对实验室(质量活动)进行风险评估,识别实验室在(质量活动)方面存在的潜在风险,评估风险影响程度,制定风险管理策略,减少不利后果发生的概率和影响程度。'
+                this.infoFxssbData.hui_yi_shi_jian_ = dayjs().format('YYYY-MM-DD HH:mm:ss')
+                this.$nextTick(() => {
+                    this.infoFxssbData.shi_wu_shuo_ming_ = `年度:${this.infoFxssbData.nian_du_};组长:${this.infoFxssbData.zu_chang_};评估开始日期:${this.infoFxssbData.kai_shi_ri_qi_};风险类型:${this.infoFxssbData.feng_xian_lei_xin}`
+                })
+            }
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.paper-detail-dialog {
+    ::v-deep {
+        .el-dialog__header {
+            text-align: center;
+        }
+    }
+.container {
+        display: flex;
+        width: 100%;
+        justify-content: center;
+
+        .left{
+            height: calc(100vh - 135px);
+            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+            padding:10px;
+            overflow-y: auto;
+        }
+        .right{
+            height: calc(100vh - 135px);
+            flex: 1;
+            padding:10px;
+            .text{
+                line-height: 1.5;
+            }
+            overflow-y: auto;
+        }
+    }
+}
+.required-star {
+  color: red;
+  margin-right: 4px;
+}
+</style>