Jelajahi Sumber

更新检测档案,更改首页待办已办展示

cfort 3 tahun lalu
induk
melakukan
0b2ce7201b

+ 1 - 1
src/views/infosManage/externalFiles/externalFiles.vue

@@ -30,7 +30,7 @@
 </template>
 <script>
 import ActionUtils from '@/utils/action'
-// import { getFileType, getFileByUserId } from '@/api/permission/file'
+import { getFileType, getFileByUserId } from '@/api/permission/file'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 export default {
     components: {

+ 1 - 1
src/views/infosManage/internalFiles/internalFiles.vue

@@ -30,7 +30,7 @@
 </template>
 <script>
 import ActionUtils from '@/utils/action'
-// import { getFileType, getFileByUserId } from '@/api/permission/file'
+import { getFileType, getFileByUserId } from '@/api/permission/file'
 import IbpsAttachment from '@/business/platform/file/attachment/selector'
 export default {
     components: {

+ 87 - 44
src/views/platform/bpmn/bpmInstHis/listType/CMARecord.vue

@@ -32,12 +32,16 @@
                 </el-table-column>
                 <el-table-column prop="he_tong_id_" label="合同编号" width="100">
                     <template slot-scope="scope">
-                        {{ scope.row.he_tong_bian_hao_ | getContractID(contractList) }}
+                        {{ scope.row.he_tong_id_ | getID(contractList) }}
                     </template>
                 </el-table-column>
                 <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="150"></el-table-column>
                 <el-table-column prop="jian_ce_kai_shi_s" label="检测时间" width="100"></el-table-column>
-                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150"></el-table-column>
+                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150">
+                    <template slot-scope="scope">
+                        {{ scope.row.wei_tuo_id_ | getID(trustList) }}
+                    </template>
+                </el-table-column>
                 <!-- <el-table-column prop="wei_tuo_dan_wei_" label="委托单位"></el-table-column> -->
                 <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column>
                 <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="150"></el-table-column>
@@ -58,15 +62,15 @@
                             <template v-for="(item ,index) in reportList">
                                 <div v-if="item.hasItem">
                                     <el-popover placement="left" width="200" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row.id_)">
+                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row, item.key)">
                                             <i class="el-icon-s-order"></i> {{item.name}}
                                         </div>
                                         <div class="three-item">
                                             <div
-                                                v-for="item in testingList"
-                                                :key="item.id_"
+                                                v-for="i in testingList"
+                                                :key="i.id_"
                                                 class="operate-item"
-                                                @click="formEvent(item.jian_ce_xiang_mu_)"
+                                                @click="consult(i)"
                                             >
                                                 {{ item.jian_ce_xiang_mu_ }}
                                             </div>
@@ -77,7 +81,7 @@
                                     v-else
                                     :key="index"
                                     class="operate-item"
-                                    @click="alertReport(item.path, scope.row.id_)"
+                                    @click="alertReport(item.path, scope.row[item.key])"
                                 >
                                     <i class="el-icon-s-order"></i> {{item.name}}
                                 </div>
@@ -135,42 +139,68 @@
         }
     ]
     const reportList = [
-        {
-            name: '合同',
-            path: '',
-            hasItem: false
-        },
+        // {
+        //     name: '合同',
+        //     key: 'he_tong_id_',
+        //     path: '',
+        //     hasItem: false
+        // },
         {
             name: '检测委托单',
+            key: 'wei_tuo_id_',
             path: '43罗湖/LHXBJY-QP-7-01-FQ-05 检测委托单.rpx',
             hasItem: false
         },
         {
             name: '检测报告',
-            path: '43罗湖/LHCNAS 检测报告.rpx',
-            hasItem: false
-        },
-        {
-            name: '检测报告审批表',
-            path: '43罗湖/检测报告审批表.rpx',
+            key: 'id_',
+            path: '43罗湖/LHCNAS-CMA 检测报告.rpx',
             hasItem: false
         },
+        // {
+        //     name: '检测报告审批表',
+        //     key: 'id_',
+        //     path: '43罗湖/检测报告审批表.rpx',
+        //     hasItem: false
+        // },
         {
             name: '检测记录',
+            key: 'testing',
             path: '43罗湖/LHJC 检测记录.rpx',
             hasItem: true
         },
         {
             name: '附件',
+            key: 'file',
             path: '',
             hasItem: true
         }
     ]
+
+    // 非通用检测项目编号及报表路径
+    const specialTest = [
+        {
+            id: '1-1',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '1-2',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '2',
+            path: '43罗湖/LHXBJY-JC-SOP-002-FQ-01 支原体检测(培养法).rpx'
+        },
+        {
+            id: '3',
+            path: '43罗湖/LHXBJY-JC-SOP-003-FQ-01 细菌内毒素检查记录表.rpx'
+        }
+    ]
     export default {
         filters: {
-            getContractID (v, arr) {
+            getID (v, arr) {
                 let result = arr.find(item => item.id_ === v)
-                return result ? result.he_tong_bian_hao_ : ''
+                return result ? result.name_ : v
             },
             getYear (v) {
                 return v ? v.slice(0, 4) : ''
@@ -194,17 +224,17 @@
                 tableData: [],
                 testingList: [],
                 contractList: [],
-                triggerType: 'click',
+                trustList: [],
                 srcUrl: '',
                 globalSql: ''
             }
         },
         created () {
-            // this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
-            this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
+            // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
             let sql = `${this.globalSql} order by create_time_ desc limit 0,20`
             this.loadData(sql)
-            let sumsql = `select count(*) as total  from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            let sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ = '已完成' and bao_gao_lei_bie_ = '${this.type}'`
             curdPost('sql', sumsql).then((response) => {
                 this.total = response.variables.data[0].total
             })
@@ -220,35 +250,48 @@
                     }
 
                     this.tableData = data
-                    let idList = []
+                    let ids = {
+                        contract: [],
+                        trust: []
+                    }
                     data.forEach(item => {
-                        idList.push(item.he_tong_bian_hao_)
+                        ids.contract.push(item.he_tong_id_)
+                        ids.trust.push(item.wei_tuo_id_)
                     })
                     // 获取合同数据用于转换
-                    let sql1 = `select id_, he_tong_bian_hao_ from t_bjd where find_in_set(id_, '${idList.join(',')}')`
+                    let sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
+                    let sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
+                    console.log(sql1, sql2)
                     curdPost('sql', sql1).then(res1 => {
                         this.contractList = res1.variables && res1.variables.data
                     })
+                    curdPost('sql', sql2).then(res2 => {
+                        this.trustList = res2.variables && res2.variables.data
+                    })
                 })
             },
-            getDetail (value) {
-                let sql1 = `select b.id_ ,c.jian_ce_xiang_mu2 from t_lhjcbgb a join t_lhjczb b on a.jian_ce_shen_qing = b.shen_qing_dan_id_ join t_lhypb c on a.jian_ce_shen_qing = c.wai_jian_ where a.id_ = '${value}'`
-                curdPost('sql', sql1).then((res1) => {
-                    let temp = res1.variables && res1.variables.data
-                    this.reportId = temp[0].id_
-                    let sql2 = `select id_, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, '${temp[0].jian_ce_xiang_mu2}')`
-                    curdPost('sql', sql2).then((res2) => {
-                        this.testingList = res2.variables && res2.variables.data
+            getDetail (row, type) {
+                const { yang_pin_bian_hao } = row
+                // 获取检测项目数据
+                if (type === 'testing') {
+                    let sql = `select id_, xiang_mu_bian_hao, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, (select jian_ce_xiang_mu_ from t_lhypb where yang_pin_bian_hao = '${yang_pin_bian_hao}'))`
+                    curdPost('sql', sql).then(res => {
+                        this.testingList = res.variables && res.variables.data
                     })
-                })
+                    return
+                }
+                // 获取附件信息,委托表【fu_jian_, biao_qian_tu_pian】字段,检测总表【fu_jian_, wen_dang_fu_jian_, kuai_zhao_fu_jian】字段,报告表【bao_gao_pdf_, gai_zhang_jian_pd】字段
+                if (type === 'file') {
+                    let sql = `select `
+                }
+
             },
-            formEvent (itemName) {
-                console.log(itemName)
+            consult (data) {
+                let isSpecial = !!specialTest.find(i => i.id === data.xiang_mu_bian_hao)
+                let path = isSpecial ? isSpecial.path : '43罗湖/LHJC 检测记录.rpx'
+                this.alertReport(path, data.id_)
             },
             // 组装查询SQL
-            selectSplit () {
-                
-            },
             search () {
                 const {year, client, report} = this.searchParam
                 const paramsList = {
@@ -275,9 +318,9 @@
                 let sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
                 this.loadData(sql)
             },
-            alertReport (vlues, id_) {
-                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${vlues}&id_=${id_}`
-                this.visible = true;
+            alertReport (path, id) {
+                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
+                this.visible = true
             }
         }
     }

+ 86 - 43
src/views/platform/bpmn/bpmInstHis/listType/CNASRecord.vue

@@ -32,12 +32,16 @@
                 </el-table-column>
                 <el-table-column prop="he_tong_id_" label="合同编号" width="100">
                     <template slot-scope="scope">
-                        {{ scope.row.he_tong_bian_hao_ | getContractID(contractList) }}
+                        {{ scope.row.he_tong_id_ | getID(contractList) }}
                     </template>
                 </el-table-column>
                 <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="150"></el-table-column>
                 <el-table-column prop="jian_ce_kai_shi_s" label="检测时间" width="100"></el-table-column>
-                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150"></el-table-column>
+                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150">
+                    <template slot-scope="scope">
+                        {{ scope.row.wei_tuo_id_ | getID(trustList) }}
+                    </template>
+                </el-table-column>
                 <!-- <el-table-column prop="wei_tuo_dan_wei_" label="委托单位"></el-table-column> -->
                 <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column>
                 <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="150"></el-table-column>
@@ -58,15 +62,15 @@
                             <template v-for="(item ,index) in reportList">
                                 <div v-if="item.hasItem">
                                     <el-popover placement="left" width="200" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row.id_)">
+                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row, item.key)">
                                             <i class="el-icon-s-order"></i> {{item.name}}
                                         </div>
                                         <div class="three-item">
                                             <div
-                                                v-for="item in testingList"
-                                                :key="item.id_"
+                                                v-for="i in testingList"
+                                                :key="i.id_"
                                                 class="operate-item"
-                                                @click="formEvent(item.jian_ce_xiang_mu_)"
+                                                @click="consult(i)"
                                             >
                                                 {{ item.jian_ce_xiang_mu_ }}
                                             </div>
@@ -77,7 +81,7 @@
                                     v-else
                                     :key="index"
                                     class="operate-item"
-                                    @click="alertReport(item.path, scope.row.id_)"
+                                    @click="alertReport(item.path, scope.row[item.key])"
                                 >
                                     <i class="el-icon-s-order"></i> {{item.name}}
                                 </div>
@@ -135,42 +139,68 @@
         }
     ]
     const reportList = [
-        {
-            name: '合同',
-            path: '',
-            hasItem: false
-        },
+        // {
+        //     name: '合同',
+        //     key: 'he_tong_id_',
+        //     path: '',
+        //     hasItem: false
+        // },
         {
             name: '检测委托单',
+            key: 'wei_tuo_id_',
             path: '43罗湖/LHXBJY-QP-7-01-FQ-05 检测委托单.rpx',
             hasItem: false
         },
         {
             name: '检测报告',
+            key: 'id_',
             path: '43罗湖/LHCNAS 检测报告.rpx',
             hasItem: false
         },
-        {
-            name: '检测报告审批表',
-            path: '43罗湖/检测报告审批表.rpx',
-            hasItem: false
-        },
+        // {
+        //     name: '检测报告审批表',
+        //     key: 'id_',
+        //     path: '43罗湖/检测报告审批表.rpx',
+        //     hasItem: false
+        // },
         {
             name: '检测记录',
+            key: 'testing',
             path: '43罗湖/LHJC 检测记录.rpx',
             hasItem: true
         },
         {
             name: '附件',
+            key: 'file',
             path: '',
             hasItem: true
         }
     ]
+
+    // 非通用检测项目编号及报表路径
+    const specialTest = [
+        {
+            id: '1-1',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '1-2',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '2',
+            path: '43罗湖/LHXBJY-JC-SOP-002-FQ-01 支原体检测(培养法).rpx'
+        },
+        {
+            id: '3',
+            path: '43罗湖/LHXBJY-JC-SOP-003-FQ-01 细菌内毒素检查记录表.rpx'
+        }
+    ]
     export default {
         filters: {
-            getContractID (v, arr) {
+            getID (v, arr) {
                 let result = arr.find(item => item.id_ === v)
-                return result ? result.he_tong_bian_hao_ : ''
+                return result ? result.name_ : v
             },
             getYear (v) {
                 return v ? v.slice(0, 4) : ''
@@ -194,17 +224,17 @@
                 tableData: [],
                 testingList: [],
                 contractList: [],
-                triggerType: 'click',
+                trustList: [],
                 srcUrl: '',
                 globalSql: ''
             }
         },
         created () {
-            // this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
-            this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
+            // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
             let sql = `${this.globalSql} order by create_time_ desc limit 0,20`
             this.loadData(sql)
-            let sumsql = `select count(*) as total  from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            let sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ = '已完成' and bao_gao_lei_bie_ = '${this.type}'`
             curdPost('sql', sumsql).then((response) => {
                 this.total = response.variables.data[0].total
             })
@@ -220,35 +250,48 @@
                     }
 
                     this.tableData = data
-                    let idList = []
+                    let ids = {
+                        contract: [],
+                        trust: []
+                    }
                     data.forEach(item => {
-                        idList.push(item.he_tong_bian_hao_)
+                        ids.contract.push(item.he_tong_id_)
+                        ids.trust.push(item.wei_tuo_id_)
                     })
                     // 获取合同数据用于转换
-                    let sql1 = `select id_, he_tong_bian_hao_ from t_bjd where find_in_set(id_, '${idList.join(',')}')`
+                    let sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
+                    let sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
+                    console.log(sql1, sql2)
                     curdPost('sql', sql1).then(res1 => {
                         this.contractList = res1.variables && res1.variables.data
                     })
+                    curdPost('sql', sql2).then(res2 => {
+                        this.trustList = res2.variables && res2.variables.data
+                    })
                 })
             },
-            getDetail (value) {
-                let sql1 = `select b.id_ ,c.jian_ce_xiang_mu2 from t_lhjcbgb a join t_lhjczb b on a.jian_ce_shen_qing = b.shen_qing_dan_id_ join t_lhypb c on a.jian_ce_shen_qing = c.wai_jian_ where a.id_ = '${value}'`
-                curdPost('sql', sql1).then((res1) => {
-                    let temp = res1.variables && res1.variables.data
-                    this.reportId = temp[0].id_
-                    let sql2 = `select id_, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, '${temp[0].jian_ce_xiang_mu2}')`
-                    curdPost('sql', sql2).then((res2) => {
-                        this.testingList = res2.variables && res2.variables.data
+            getDetail (row, type) {
+                const { yang_pin_bian_hao } = row
+                // 获取检测项目数据
+                if (type === 'testing') {
+                    let sql = `select id_, xiang_mu_bian_hao, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, (select jian_ce_xiang_mu_ from t_lhypb where yang_pin_bian_hao = '${yang_pin_bian_hao}'))`
+                    curdPost('sql', sql).then(res => {
+                        this.testingList = res.variables && res.variables.data
                     })
-                })
+                    return
+                }
+                // 获取附件信息,委托表【fu_jian_, biao_qian_tu_pian】字段,检测总表【fu_jian_, wen_dang_fu_jian_, kuai_zhao_fu_jian】字段,报告表【bao_gao_pdf_, gai_zhang_jian_pd】字段
+                if (type === 'file') {
+                    let sql = `select `
+                }
+
             },
-            formEvent (itemName) {
-                console.log(itemName)
+            consult (data) {
+                let isSpecial = !!specialTest.find(i => i.id === data.xiang_mu_bian_hao)
+                let path = isSpecial ? isSpecial.path : '43罗湖/LHJC 检测记录.rpx'
+                this.alertReport(path, data.id_)
             },
             // 组装查询SQL
-            selectSplit () {
-                
-            },
             search () {
                 const {year, client, report} = this.searchParam
                 const paramsList = {
@@ -275,9 +318,9 @@
                 let sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
                 this.loadData(sql)
             },
-            alertReport (vlues, id_) {
-                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${vlues}&id_=${id_}`
-                this.visible = true;
+            alertReport (path, id) {
+                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
+                this.visible = true
             }
         }
     }

+ 87 - 44
src/views/platform/bpmn/bpmInstHis/listType/FEIRecord.vue

@@ -32,12 +32,16 @@
                 </el-table-column>
                 <el-table-column prop="he_tong_id_" label="合同编号" width="100">
                     <template slot-scope="scope">
-                        {{ scope.row.he_tong_bian_hao_ | getContractID(contractList) }}
+                        {{ scope.row.he_tong_id_ | getID(contractList) }}
                     </template>
                 </el-table-column>
                 <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="150"></el-table-column>
                 <el-table-column prop="jian_ce_kai_shi_s" label="检测时间" width="100"></el-table-column>
-                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150"></el-table-column>
+                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150">
+                    <template slot-scope="scope">
+                        {{ scope.row.wei_tuo_id_ | getID(trustList) }}
+                    </template>
+                </el-table-column>
                 <!-- <el-table-column prop="wei_tuo_dan_wei_" label="委托单位"></el-table-column> -->
                 <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column>
                 <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="150"></el-table-column>
@@ -58,15 +62,15 @@
                             <template v-for="(item ,index) in reportList">
                                 <div v-if="item.hasItem">
                                     <el-popover placement="left" width="200" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row.id_)">
+                                        <div class="operate-item" slot="reference" @click="getDetail(scope.row, item.key)">
                                             <i class="el-icon-s-order"></i> {{item.name}}
                                         </div>
                                         <div class="three-item">
                                             <div
-                                                v-for="item in testingList"
-                                                :key="item.id_"
+                                                v-for="i in testingList"
+                                                :key="i.id_"
                                                 class="operate-item"
-                                                @click="formEvent(item.jian_ce_xiang_mu_)"
+                                                @click="consult(i)"
                                             >
                                                 {{ item.jian_ce_xiang_mu_ }}
                                             </div>
@@ -77,7 +81,7 @@
                                     v-else
                                     :key="index"
                                     class="operate-item"
-                                    @click="alertReport(item.path, scope.row.id_)"
+                                    @click="alertReport(item.path, scope.row[item.key])"
                                 >
                                     <i class="el-icon-s-order"></i> {{item.name}}
                                 </div>
@@ -135,42 +139,68 @@
         }
     ]
     const reportList = [
-        {
-            name: '合同',
-            path: '',
-            hasItem: false
-        },
+        // {
+        //     name: '合同',
+        //     key: 'he_tong_id_',
+        //     path: '',
+        //     hasItem: false
+        // },
         {
             name: '检测委托单',
+            key: 'wei_tuo_id_',
             path: '43罗湖/LHXBJY-QP-7-01-FQ-05 检测委托单.rpx',
             hasItem: false
         },
         {
             name: '检测报告',
-            path: '43罗湖/LHCNAS 检测报告.rpx',
-            hasItem: false
-        },
-        {
-            name: '检测报告审批表',
-            path: '43罗湖/检测报告审批表.rpx',
+            key: 'id_',
+            path: '43罗湖/LH非 检测报告.rpx',
             hasItem: false
         },
+        // {
+        //     name: '检测报告审批表',
+        //     key: 'id_',
+        //     path: '43罗湖/检测报告审批表.rpx',
+        //     hasItem: false
+        // },
         {
             name: '检测记录',
+            key: 'testing',
             path: '43罗湖/LHJC 检测记录.rpx',
             hasItem: true
         },
         {
             name: '附件',
+            key: 'file',
             path: '',
             hasItem: true
         }
     ]
+
+    // 非通用检测项目编号及报表路径
+    const specialTest = [
+        {
+            id: '1-1',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '1-2',
+            path: '43罗湖/LHXBJY-JC-SOP-001-FQ-01 无菌检测记录表.rpx'
+        },
+        {
+            id: '2',
+            path: '43罗湖/LHXBJY-JC-SOP-002-FQ-01 支原体检测(培养法).rpx'
+        },
+        {
+            id: '3',
+            path: '43罗湖/LHXBJY-JC-SOP-003-FQ-01 细菌内毒素检查记录表.rpx'
+        }
+    ]
     export default {
         filters: {
-            getContractID (v, arr) {
+            getID (v, arr) {
                 let result = arr.find(item => item.id_ === v)
-                return result ? result.he_tong_bian_hao_ : ''
+                return result ? result.name_ : v
             },
             getYear (v) {
                 return v ? v.slice(0, 4) : ''
@@ -194,17 +224,17 @@
                 tableData: [],
                 testingList: [],
                 contractList: [],
-                triggerType: 'click',
+                trustList: [],
                 srcUrl: '',
                 globalSql: ''
             }
         },
         created () {
-            // this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
-            this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ = '完成' and bao_gao_lei_bie_ = '${this.type}'`
+            // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
             let sql = `${this.globalSql} order by create_time_ desc limit 0,20`
             this.loadData(sql)
-            let sumsql = `select count(*) as total  from t_lhjcbgb where bao_gao_lei_bie_ = '${this.type}'`
+            let sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ = '已完成' and bao_gao_lei_bie_ = '${this.type}'`
             curdPost('sql', sumsql).then((response) => {
                 this.total = response.variables.data[0].total
             })
@@ -220,35 +250,48 @@
                     }
 
                     this.tableData = data
-                    let idList = []
+                    let ids = {
+                        contract: [],
+                        trust: []
+                    }
                     data.forEach(item => {
-                        idList.push(item.he_tong_bian_hao_)
+                        ids.contract.push(item.he_tong_id_)
+                        ids.trust.push(item.wei_tuo_id_)
                     })
                     // 获取合同数据用于转换
-                    let sql1 = `select id_, he_tong_bian_hao_ from t_bjd where find_in_set(id_, '${idList.join(',')}')`
+                    let sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
+                    let sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
+                    console.log(sql1, sql2)
                     curdPost('sql', sql1).then(res1 => {
                         this.contractList = res1.variables && res1.variables.data
                     })
+                    curdPost('sql', sql2).then(res2 => {
+                        this.trustList = res2.variables && res2.variables.data
+                    })
                 })
             },
-            getDetail (value) {
-                let sql1 = `select b.id_ ,c.jian_ce_xiang_mu2 from t_lhjcbgb a join t_lhjczb b on a.jian_ce_shen_qing = b.shen_qing_dan_id_ join t_lhypb c on a.jian_ce_shen_qing = c.wai_jian_ where a.id_ = '${value}'`
-                curdPost('sql', sql1).then((res1) => {
-                    let temp = res1.variables && res1.variables.data
-                    this.reportId = temp[0].id_
-                    let sql2 = `select id_, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, '${temp[0].jian_ce_xiang_mu2}')`
-                    curdPost('sql', sql2).then((res2) => {
-                        this.testingList = res2.variables && res2.variables.data
+            getDetail (row, type) {
+                const { yang_pin_bian_hao } = row
+                // 获取检测项目数据
+                if (type === 'testing') {
+                    let sql = `select id_, xiang_mu_bian_hao, jian_ce_xiang_mu_ from t_mjjcnlfw where find_in_set(id_, (select jian_ce_xiang_mu_ from t_lhypb where yang_pin_bian_hao = '${yang_pin_bian_hao}'))`
+                    curdPost('sql', sql).then(res => {
+                        this.testingList = res.variables && res.variables.data
                     })
-                })
+                    return
+                }
+                // 获取附件信息,委托表【fu_jian_, biao_qian_tu_pian】字段,检测总表【fu_jian_, wen_dang_fu_jian_, kuai_zhao_fu_jian】字段,报告表【bao_gao_pdf_, gai_zhang_jian_pd】字段
+                if (type === 'file') {
+                    let sql = `select `
+                }
+
             },
-            formEvent (itemName) {
-                console.log(itemName)
+            consult (data) {
+                let isSpecial = !!specialTest.find(i => i.id === data.xiang_mu_bian_hao)
+                let path = isSpecial ? isSpecial.path : '43罗湖/LHJC 检测记录.rpx'
+                this.alertReport(path, data.id_)
             },
             // 组装查询SQL
-            selectSplit () {
-                
-            },
             search () {
                 const {year, client, report} = this.searchParam
                 const paramsList = {
@@ -275,9 +318,9 @@
                 let sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
                 this.loadData(sql)
             },
-            alertReport (vlues, id_) {
-                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${vlues}&id_=${id_}`
-                this.visible = true;
+            alertReport (path, id) {
+                this.srcUrl = `${this.$reportPash.replace('show', 'pdf')}${path}&id_=${id}`
+                this.visible = true
             }
         }
     }

+ 34 - 75
src/views/system/dashboard/components/new-home.vue

@@ -20,60 +20,47 @@
                             @row-click="handleLinkClick"
                             :row-class-name="tableRowClassName"
                         >
-                            <el-table-column show-overflow-tooltip label="年份" width="60">
-                                <template slot-scope="scope">
-                                    {{ getParenthesesStr(scope.row.subject)[0] }}
-                                </template>
-                            </el-table-column>
+                            <!-- <el-table-column show-overflow-tooltip label="年份" width="60">
+                                <template slot-scope="scope">{{ getParenthesesStr(scope.row.subject)[0] }}</template>
+                            </el-table-column> -->
                             <el-table-column
                                 prop="subject"
                                 label="事务名称"
                                 show-overflow-tooltip
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.subject.split('(')[0] }}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.subject.split('(')[0] }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 show-overflow-tooltip
-                                width="100"
+                                width="80"
                                 label="状态"
                             >
-                                <template slot-scope="scope">
-                                    {{ '待' + scope.row.name }}
-                                </template>
+                                <template slot-scope="scope">{{ '待' + scope.row.name }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 prop="startDept"
                                 show-overflow-tooltip
-                                width="80"
+                                width="100"
                                 label="发起部门"
                             />
-
                             <el-table-column
-                                prop="forwardBy"
+                                prop="submitBy"
                                 show-overflow-tooltip
                                 width="100"
-                                label="任务提交人"
+                                label="任务发起人"
                             />
-
                             <el-table-column
-                                prop="submitBy"
+                                prop="forwardBy"
                                 show-overflow-tooltip
                                 width="100"
-                                label="任务发起人"
+                                label="任务提交人"
                             />
-
                             <el-table-column
                                 show-overflow-tooltip
                                 width="145"
                                 label="时间"
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.createTime.slice(0, 16) }}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.createTime.slice(0, 16) }}</template>
                             </el-table-column>
                         </el-table>
                         <div>
@@ -99,7 +86,6 @@
                     @close="visible => (dialogFormVisible = visible)"
                 />
             </el-col>
-
             <el-col :span="12" class="firstcol">
                 <!-- 展开工作栏-->
                 <div
@@ -141,81 +127,54 @@
                             size="mini"
                             @row-click="handleLinkClickOrver"
                         >
-                            <el-table-column
+                            <!-- <el-table-column
                                 show-overflow-tooltip
                                 label="年份"
                                 width="60"
                             >
-                                <template slot-scope="scope">
-                                    {{ getParenthesesStr(scope.row.subject)[0] }}
-                                </template>
-                            </el-table-column>
-
+                                <template slot-scope="scope">{{ getParenthesesStr(scope.row.subject)[0] }}</template>
+                            </el-table-column> -->
                             <el-table-column
                                 prop="subject"
                                 label="事务名称"
                                 show-overflow-tooltip
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.subject.split('(')[0] }}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.subject.split('(')[0] }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 show-overflow-tooltip
                                 label="状态"
-                                width="100"
+                                width="80"
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.curNode ? scope.row.status == 'running' ? '已发起' : '已' + scope.row.curNode : contOfValue(scope.row.status) }}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.curNode ? scope.row.status == 'running' ? '已发起' : '已' + scope.row.curNode : contOfValue(scope.row.status) }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 show-overflow-tooltip
                                 label="发起部门"
-                                width="80"
+                                width="100"
                             >
-                                <template slot-scope="scope">
-                                    {{ getParenthesesStr(scope.row.subject)[1] }}
-                                </template>
+                                <template slot-scope="scope">{{ getParenthesesStr(scope.row.subject)[1] }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 show-overflow-tooltip
                                 label="任务提交人"
                                 width="100"
                             >
-                                <template slot-scope="scope">
-                                    {{ getParenthesesStr(scope.row.subject)[2] }}
-                                </template>
+                                <template slot-scope="scope">{{ getParenthesesStr(scope.row.subject)[2] }}</template>
                             </el-table-column>
-
                             <el-table-column
                                 show-overflow-tooltip
                                 label="任务发起人"
                                 width="100"
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.createBy | getUserName(userList)}}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.createBy | getUserName(userList)}}</template>
                             </el-table-column>
-
-                            <!-- <el-table-column
-                                prop="submitBy"
-                                show-overflow-tooltip
-                                width="100"
-                                label="任务发起人2"
-                            /> -->
-
                             <el-table-column
                                 show-overflow-tooltip
                                 width="145"
                                 label="办理时间"
                             >
-                                <template slot-scope="scope">
-                                    {{ scope.row.createTime.slice(0, 16) }}
-                                </template>
+                                <template slot-scope="scope">{{ scope.row.createTime.slice(0, 16) }}</template>
                             </el-table-column>
                         </el-table>
                         <div>
@@ -445,6 +404,12 @@
     import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
     import ActionUtils from '@/utils/action'
 
+    const taskState = {
+        running: '已发起',
+        end: '已结束',
+        manualend: '已结束'
+    }
+
     export default {
         components: { BpmnFormrender, homeCalendar },
         name: 'calendar',
@@ -488,7 +453,8 @@
                 orverPagination: { page: 1, limit: 10 },
                 sorts: {},
                 timer: null,
-                processName: ''
+                processName: '',
+                userList: []
             }
         },
         mounted: function () {
@@ -552,17 +518,10 @@
                 this.pagination.page = val
                 this.getWait()
             },
-            /* 将状态码遍历成结果*/
+            /* 转换状态码*/
             contOfValue(cont) {
-                if (cont == 'running') {
-                    return '已发起'
-                } else if (cont == 'end') {
-                    return '已结束'
-                } else if (cont == 'manualend') {
-                    return '已结束'
-                } else {
-                    return '暂停'
-                }
+                let s = taskState[cont]
+                return s ? s : '暂停'
             },
             /* 待办任务*/
             getWait() {