|
|
@@ -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
|
|
|
}
|
|
|
}
|
|
|
}
|