|
|
|
@ -0,0 +1,129 @@ |
|
|
|
<!-- 试剂/供试品/给药制剂弹窗 --> |
|
|
|
<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-model="selectType" @change="handleRadioChange" style="margin-bottom: 30px;"> |
|
|
|
<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" /> |
|
|
|
<template slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="onCancel">{{ $t('form.cancel') }}</el-button> |
|
|
|
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{ $t('form.saveConfirm') }}</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import SelectTable from '@/components/Template/SelectTable.vue'; |
|
|
|
import SelectDept from "@/views/business/comps/select/SelectDept"; |
|
|
|
import { public_sjList,public_gyzjList } from '@/api/business/public/public'; |
|
|
|
import { getSjSearchForm, getSjColumns,getGyzjSearchForm,getGyzjColumns,getGspSearchForm,getGspColumns } from '@/views/business/comps/template/formConfig/formConfig.js'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
const typeMap ={ |
|
|
|
sj: { |
|
|
|
searchForm: getSjSearchForm(), |
|
|
|
columns: getSjColumns(), |
|
|
|
listApi: public_sjList, |
|
|
|
}, |
|
|
|
gsp: { |
|
|
|
searchForm: getGspSearchForm(), |
|
|
|
columns: getGspColumns(), |
|
|
|
listApi: public_gspList, |
|
|
|
}, |
|
|
|
gyzj: { |
|
|
|
searchForm: getGyzjSearchForm(), |
|
|
|
columns: getGyzjColumns(), |
|
|
|
listApi: public_gyzjList, |
|
|
|
}, |
|
|
|
} |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SelectTable, |
|
|
|
SelectDept |
|
|
|
}, |
|
|
|
props: { |
|
|
|
type: { |
|
|
|
type: String, |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
title: { |
|
|
|
type: String, |
|
|
|
default: "page.business.resource.sj.xzsj", |
|
|
|
}, |
|
|
|
selectedCode: { |
|
|
|
type: String, |
|
|
|
default: "bh", |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
visible: false, |
|
|
|
selectedId: "", |
|
|
|
currentRow: {}, |
|
|
|
radio: 1, |
|
|
|
bzList: [], |
|
|
|
depart: "", |
|
|
|
studyFormId: '',//有个studyFormId需要从外面动态传过来 |
|
|
|
uuid: '',//为了标识eventBus的事件id, |
|
|
|
selectType: 'sj',//默认选择试剂列表 |
|
|
|
listApi: public_sjList, |
|
|
|
searchForm: getSjSearchForm(), |
|
|
|
columns: getSjColumns(), |
|
|
|
sourceFrom:"step",//来源 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isDisabled() { |
|
|
|
return !this.selectedId; |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
show(studyFormId, data) { |
|
|
|
if (data && data.uuid) {//为了标识eventBus的事件id |
|
|
|
this.uuid = data.uuid |
|
|
|
} |
|
|
|
//type:sj(试剂列表)gsp(供试品列表)gyzj(给药制剂列表) |
|
|
|
const {type = "sj"} = data; |
|
|
|
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.studyFormId = studyFormId |
|
|
|
}, |
|
|
|
onCancel() { |
|
|
|
this.visible = false |
|
|
|
this.$emit('cancel'); |
|
|
|
}, |
|
|
|
onSubmit() { |
|
|
|
let row = this.currentRow; |
|
|
|
this.$emit('submit', this.selectedId, row); |
|
|
|
// 触发eventBus事件 |
|
|
|
EventBus.$emit("onReagentSubmit", { uuid: this.uuid, selectedId: this.selectedId, row }); |
|
|
|
this.visible = false; |
|
|
|
}, |
|
|
|
//Radio改变时处理 |
|
|
|
handleRadioChange(val){ |
|
|
|
|
|
|
|
}, |
|
|
|
// 选择试剂时处理 |
|
|
|
handleSelect(code, row) { |
|
|
|
this.selectedId = code; |
|
|
|
this.currentRow = row; |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.header-row { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding: 20px 0; |
|
|
|
} |
|
|
|
</style> |