ソースを参照

体系运行记录盒更新不符合项归档方式

cfort 3 年 前
コミット
d62eb7fdc0

+ 46 - 13
src/views/platform/bpmn/bpmInstHis/corresponding/index.js

@@ -22,17 +22,50 @@ export const listTypeData = {
     '1022458306758705152': 'sheBeiYanShou', // 设备验收
 }
 
-// 特殊类型,内审管审特殊处理
-export const specialType = {
-    '859879582994530304': [
-        '首次会议签到',
-        '首次会议纪要',
-        '不符合项汇总',
-        '末次会议签到',
-        '末次会议纪要',
-        '不符合项整改'
-    ],
-    '859879751135789056': [
-        
-    ]
+// 内审管审类型ID
+const neishen = '859879582994530304'
+const guanshen = '859879751135789056'
+
+let specialType = {}
+let specialBtn = {}
+let specialParams = {}
+let specialTable = {}
+let specialField = {}
+
+specialType[neishen] = [
+    '首次会议签到',
+    '首次会议纪要',
+    '不符合项汇总',
+    '末次会议签到',
+    '末次会议纪要',
+    '不符合项整改'
+]
+specialType[guanshen] = [
+    
+]
+
+specialBtn[neishen] = {
+    label: '不符合项报告与纠正措施记录',
+    desc: '改进'
+}
+specialBtn[guanshen] = {
+    label: '改进项与跟踪验证',
+    desc: '整改'
+}
+
+specialParams[neishen] = 'zheng_gai_qian_ji as beforeImprove, zheng_gai_hou_jia as afterImprove, bian_zhi_ri_qi_ as flag'
+specialParams[guanshen] = 'gai_jin_qian_jian as beforeImprove, fu_jian_ as afterImprove, bian_hao_ as flag'
+
+specialTable[neishen] = 't_bfhxbgyjzcsjlbx'
+specialTable[guanshen] = 't_glpsjhb'
+
+specialField[neishen] = 'ji_hua_zong_wai_j'
+specialField[guanshen] = 'zong_wai_jian_'
+
+export {
+    specialType,
+    specialBtn,
+    specialParams,
+    specialTable,
+    specialField
 }

+ 113 - 11
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -41,14 +41,63 @@
                     trigger="click"
                     @show="getReportAndFile(scope.row)"
                 >
-                    <!-- 触发事件 -->
-                    <!-- @click="handleAction('detail',null,null,scope.row)"-->
-                    <div class="div_test el-icon-s-order" slot="reference">查阅记录</div>
-                    <!-- 弹框内容 -->
+                    <!-- 二级菜单,内审管审特有 -->
+                    <template v-if="specialType.hasOwnProperty(typeId)">
+                        <el-popover
+                            :ref="'popover3-' + scope.row.id"
+                            placement="left"
+                            width="350"
+                            popper-class="popverClass"
+                            trigger="click"
+                        >
+                            <div class="sub_operation el-icon-s-order" slot="reference">{{ specialBtn[typeId].label }}</div>
+                            <div v-if="record.special && record.special.length" class="div_content">
+                                <div v-for="item in record.special" class="content_item">
+                                    <div class="sub_content">
+                                        <div class="title">{{ specialBtn[typeId].desc }}项{{ item.flag }}</div>
+                                        <div class="sub_item">
+                                            <div class="desc">{{ specialBtn[typeId].desc }}前</div>
+                                            <ibps-attachment
+                                                v-model="item.beforeImprove"
+                                                placeholder="请选择"
+                                                :download="true"
+                                                :readonly="true"
+                                                accept="*"
+                                                :multiple="true"
+                                                upload-type="attachment"
+                                                store="id"
+                                                media-type=""
+                                                media=""
+                                                style="width: 100%;"
+                                            />
+                                        </div>
+                                        <div class="sub_item">
+                                            <div class="desc">{{ specialBtn[typeId].desc }}后</div>
+                                            <ibps-attachment
+                                                v-model="item.afterImprove"
+                                                placeholder="请选择"
+                                                :download="true"
+                                                :readonly="true"
+                                                accept="*"
+                                                :multiple="true"
+                                                upload-type="attachment"
+                                                store="id"
+                                                media-type=""
+                                                media=""
+                                                style="width: 100%;"
+                                            />
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div v-else>无对应数据</div>
+                        </el-popover>
+                    </template>
+                    <div class="div_operation el-icon-s-order" slot="reference">查阅记录</div>
                     <div class="div_content">
                         <!-- 获取所有输出报告-->
                         <template v-if="record.report.length">
-                            <div v-for="item in record.report" class="content_butts">
+                            <div v-for="item in record.report" class="content_item">
                                 <span style="cursor: pointer;" @click="openReport(item, record.bizKey)">
                                     <i class="el-icon-tickets" style="font-size: 18px;"/>
                                     <!-- 截取表单名称 -->
@@ -57,7 +106,7 @@
                                 <br/>
                             </div>
                         </template>
-                        <div v-if="record.file.length" class="content_butts">
+                        <div v-if="record.file.length" class="content_item">
                             <ibps-attachment
                                 v-model="fileId"
                                 placeholder="请选择"
@@ -72,6 +121,7 @@
                                 style="width: 100%;"
                             />
                         </div>
+                        <div v-if="!record.report.length && !record.file.length">无报表及附件数据</div>
                     </div>
                 </el-popover>
             </template>
@@ -110,7 +160,8 @@
     import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
     import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
     import IbpsAttachment from '@/business/platform/file/attachment/selector'
-    import { specialType } from './corresponding/index'
+    import { specialType, specialBtn, specialParams, specialTable, specialField } from './corresponding/index'
+    
     export default {
         components: {
             IbpsTypeTree,
@@ -152,6 +203,7 @@
                     file: [],
                     table: [],
                     field: [],
+                    special: [],
                     bizKey: ''
                 },
                 title: '',
@@ -163,6 +215,8 @@
                 sorts: {},
                 // 默认过滤部分分类
                 hasPermission: true,
+                specialType,
+                specialBtn,
                 listConfig: {
                     toolbars: [
                         { key: 'search' }
@@ -252,6 +306,15 @@
             },
             // 获取报表数据及附件数据
             getReportAndFile({ procDefKey, bizKey, subject }) {
+                // 每次获取前先清除原先数据
+                this.record = {
+                    report: [],
+                    file: [],
+                    table: [],
+                    field: [],
+                    special: [],
+                    bizKey: ''
+                }
                 if (this.isDisable) {
                     this.$message.error('请勿快速点击!');
                     return
@@ -266,18 +329,20 @@
                     file: temp.fu_jian_nei_rong_ ? temp.fu_jian_nei_rong_.split('.') : [],
                     table: temp.shi_fou_zi_biao_ ? temp.shi_fou_zi_biao_.split('.') : [],
                     field: temp.guan_lian_zi_duan ? temp.guan_lian_zi_duan.split('.') : [],
+                    special: [],
                     bizKey
                 }
                 let typeIndex = ''
                 // 特殊类型处理
-                if (specialType.hasOwnProperty(this.typeId)) {
-                    specialType[this.typeId].forEach((item, index) => {
+                if (this.specialType.hasOwnProperty(this.typeId)) {
+                    this.specialType[this.typeId].forEach((item, index) => {
                         // 判断当前流程在哪一步,以此决定报表展示
                         if (subject.includes(item)) {
                             // 数组下标+2为当前报表文件排序
                             typeIndex = index + 2
                         }
                     })
+                    this.getSpecicalFile(bizKey)
                 }
                 console.log(typeIndex)
                 if (typeIndex !== '') {
@@ -341,6 +406,15 @@
                 }
                 return value
             },
+            // 获取内审管审文件
+            getSpecicalFile(id) {
+                let sql = `select ${specialParams[this.typeId]} from ${specialTable[this.typeId]} where ${specialField[this.typeId]} = '${id}'`
+                // console.log(sql)
+                curdPost('sql', sql).then(res => {
+                    const { data = [] } = res.variables || {}
+                    this.record.special = data
+                })
+            },
             // 打开报表
             openReport(path, id) {
                 this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
@@ -472,9 +546,37 @@
             margin-top: -8px;
         }
     }
-    .main-container .div_test {
+    .div_operation {
         cursor: pointer;
     }
+    .sub_operation {
+        width: 100%;
+        height: 20px;
+        line-height: 20px;
+        color: #08c0b7;
+        // color: #85ce61;
+        cursor: pointer;
+        &:before {
+            font-size: 18px;
+            margin-right: 5px;
+        }
+    }
+    .sub_content {
+        .title {
+            margin-bottom: 4px;
+            font-weight: bold;
+        }
+        .sub_item {
+            display: flex;
+            align-items: center;
+            .desc {
+                margin-top: 6px;
+            }
+            > div:last-child {
+                width: calc(100% - 45px) !important;
+            }
+        }
+    }
     .main-container .el-popover.popverClass {
         .div_content {
             .content_checkbox {
@@ -485,7 +587,7 @@
                 }
                 z-index: 999;
             }
-            .content_butts {
+            .content_item {
                 z-index: 999;
                 margin-top: 20px;
                 display: flex;