|
|
|
@ -2,16 +2,16 @@ |
|
|
|
<template> |
|
|
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t(title)" @close="onCancel" |
|
|
|
:visible.sync="visible" append-to-body width="80%"> |
|
|
|
<el-radio-group v-show = "mixType" v-model="selectType" @change="handleShowTableInfo" class="mt-20 mb-20"> |
|
|
|
<el-radio-group v-show="mixType" v-model="selectType" @change="handleShowTableInfo" class="mt-20 mb-20"> |
|
|
|
<el-radio-button label="sj">试剂列表</el-radio-button> |
|
|
|
<el-radio-button label="gsp">供试品列表</el-radio-button> |
|
|
|
<el-radio-button label="gyzj">给药制剂列表</el-radio-button> |
|
|
|
</el-radio-group> |
|
|
|
<SelectTable ref="selectSjRef" :columns="columns" :selectedId="selectedId" :searchForm="searchForm" |
|
|
|
:studyFormId="studyFormId" :listApi="listApi" :selectedCode="selectedCode" @radioSelect="handleSelect" /> |
|
|
|
|
|
|
|
<!-- 只有步骤才会又这个选项 --> |
|
|
|
<div v-if = "sourceFrom === 'step'" class="other-reagent"> |
|
|
|
|
|
|
|
<!-- 只有步骤才会又这个选项 --> |
|
|
|
<div v-if="sourceFrom === 'step'" class="other-reagent"> |
|
|
|
<el-checkbox v-model="otherChecked" @change="handleOtherChange">其他</el-checkbox> |
|
|
|
<el-input class="other-reagent-input" v-model="otherReagent"></el-input> |
|
|
|
</div> |
|
|
|
@ -25,26 +25,35 @@ |
|
|
|
<script> |
|
|
|
import SelectTable from '@/components/Template/SelectTable.vue'; |
|
|
|
import SelectDept from "@/views/business/comps/select/SelectDept"; |
|
|
|
import { public_sjList,public_gyzjList,public_gspList } from '@/api/business/public/public'; |
|
|
|
import { getSjSearchForm, getSjColumns,getGyzjSearchForm,getGyzjColumns,getGspSearchForm,getGspColumns } from '@/views/business/comps/template/formConfig/formConfig.js'; |
|
|
|
import { public_sjList, public_gyzjList, public_gspList, public_xbList } from '@/api/business/public/public'; |
|
|
|
import { getSjSearchForm, getSjColumns, getGyzjSearchForm, getGyzjColumns, getGspSearchForm, getGspColumns, getXbSearchForm, getXbColumns } from '@/views/business/comps/template/formConfig/formConfig.js'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
const typeMap ={ |
|
|
|
const typeMap = { |
|
|
|
sj: { |
|
|
|
searchForm: getSjSearchForm(), |
|
|
|
columns: getSjColumns(), |
|
|
|
listApi: public_sjList, |
|
|
|
title:"选择试剂" |
|
|
|
}, |
|
|
|
gsp: { |
|
|
|
searchForm: getGspSearchForm(), |
|
|
|
columns: getGspColumns(), |
|
|
|
listApi: public_gspList, |
|
|
|
title:"选择供试品" |
|
|
|
}, |
|
|
|
xb: { |
|
|
|
searchForm: getXbSearchForm(), |
|
|
|
columns: getXbColumns(), |
|
|
|
listApi: public_xbList, |
|
|
|
title:"选择细胞" |
|
|
|
}, |
|
|
|
gyzj: { |
|
|
|
searchForm: getGyzjSearchForm(), |
|
|
|
columns: getGyzjColumns(), |
|
|
|
listApi: public_gyzjList, |
|
|
|
title:"选择给药制剂" |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SelectTable, |
|
|
|
@ -55,10 +64,7 @@ export default { |
|
|
|
type: String, |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
title: { |
|
|
|
type: String, |
|
|
|
default: "page.business.resource.sj.xzsj", |
|
|
|
}, |
|
|
|
|
|
|
|
selectedCode: { |
|
|
|
type: String, |
|
|
|
default: "bh", |
|
|
|
@ -79,14 +85,15 @@ export default { |
|
|
|
listApi: public_sjList, |
|
|
|
searchForm: getSjSearchForm(), |
|
|
|
columns: getSjColumns(), |
|
|
|
sourceFrom:"step",//来源 |
|
|
|
sourceFrom: "step",//来源 |
|
|
|
otherReagent: "",//其他试剂 |
|
|
|
mixType: false,//是否是混合试剂 |
|
|
|
title:"选择试剂" |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isDisabled() { |
|
|
|
if(this.otherChecked && this.otherReagent){//如果选中了其他,那么就不校验是否选择了试剂 |
|
|
|
if (this.otherChecked && this.otherReagent) {//如果选中了其他,那么就不校验是否选择了试剂 |
|
|
|
return false; |
|
|
|
} |
|
|
|
return !this.selectedId; |
|
|
|
@ -98,29 +105,30 @@ export default { |
|
|
|
this.uuid = data.uuid |
|
|
|
} |
|
|
|
//type:sj(试剂列表)gsp(供试品列表)gyzj(给药制剂列表) |
|
|
|
const {type,sourceFrom = "step",mixType = false} = data; |
|
|
|
const { type, sourceFrom = "step", mixType = false } = data; |
|
|
|
this.mixType = mixType; |
|
|
|
this.sourceFrom = sourceFrom; |
|
|
|
this.studyFormId = studyFormId; |
|
|
|
this.visible = true; |
|
|
|
this.handleShowTableInfo(type); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
handleOtherChange(val){ |
|
|
|
handleOtherChange(val) { |
|
|
|
this.otherChecked = val; |
|
|
|
if(val){//如果选中了其他,那么就清空选中的id |
|
|
|
if (val) {//如果选中了其他,那么就清空选中的id |
|
|
|
this.selectedId = ""; |
|
|
|
this.currentRow = {}; |
|
|
|
} |
|
|
|
}, |
|
|
|
handleShowTableInfo(type){ |
|
|
|
handleShowTableInfo(type) { |
|
|
|
this.selectType = type; |
|
|
|
this.searchForm = typeMap[type].searchForm; |
|
|
|
this.columns = typeMap[type].columns; |
|
|
|
this.listApi = typeMap[type].listApi; |
|
|
|
this.listApi = typeMap[type].listApi || this.listApi; |
|
|
|
this.title = typeMap[type].title || this.title; |
|
|
|
setTimeout(() => { |
|
|
|
if(this.$refs.selectSjRef){ |
|
|
|
if (this.$refs.selectSjRef) { |
|
|
|
this.$refs.selectSjRef.show() |
|
|
|
} |
|
|
|
}, 10); |
|
|
|
@ -152,19 +160,23 @@ export default { |
|
|
|
align-items: center; |
|
|
|
padding: 20px 0; |
|
|
|
} |
|
|
|
.other-reagent{ |
|
|
|
|
|
|
|
.other-reagent { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding:20px 0; |
|
|
|
padding: 20px 0; |
|
|
|
} |
|
|
|
.other-reagent-input{ |
|
|
|
|
|
|
|
.other-reagent-input { |
|
|
|
width: 200px; |
|
|
|
margin-left: 5px; |
|
|
|
} |
|
|
|
.mt-20{ |
|
|
|
|
|
|
|
.mt-20 { |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
.mb-20{ |
|
|
|
|
|
|
|
.mb-20 { |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
</style> |