Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
c26f977e4b
7 changed files with 327 additions and 6 deletions
  1. +16
    -0
      src/api/business/public/public.js
  2. +1
    -1
      src/components/Template/StepComponents/ry/czdd.vue
  3. +48
    -0
      src/components/Template/StepComponents/ry/czhj.vue
  4. +9
    -3
      src/components/Template/StepFormPackage.vue
  5. +2
    -2
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  6. +129
    -0
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue
  7. +122
    -0
      src/views/business/comps/template/formConfig/formConfig.js

+ 16
- 0
src/api/business/public/public.js View File

@ -83,3 +83,19 @@ export function public_yqList(query) {
params: query
})
}
// 给药制剂列表
export function public_gyzjList(query) {
return request({
url: '/system/business/public/gyzjList',
method: 'get',
params: query
})
}
// 供试品列表
export function public_gspList(query) {
return request({
url: '/system/business/public/gspList',
method: 'get',
params: query
})
}

+ 1
- 1
src/components/Template/StepComponents/ry/czdd.vue View File

@ -1,3 +1,4 @@
<!-- 操作地点 -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
</template>
@ -11,7 +12,6 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{

+ 48
- 0
src/components/Template/StepComponents/ry/czhj.vue View File

@ -0,0 +1,48 @@
<!-- 操作环境 -->
<template>
<StepFormPackage ref = "stepFormPackageRef" :form-config="formConfig" :formData = "formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
export default {
mixins: [stepMixins],
components: {
StepFormPackage
},
computed: {
formConfig() {
return [{
config:{
text1:{
label:"选择在",
type:"text",
},
ddsys:{
type:"input",
fillType:"preFill",
},
yq:{
type:"instrument",
fillType:"actFill",
},
text2:{
label:"环境下,操作下预计在",
type:"text",
},
ytczhj:{
type:"input",
}
}
}]
}
},
}
</script>
<style lang="scss" scoped>
</style>

+ 9
- 3
src/components/Template/StepFormPackage.vue View File

@ -79,9 +79,11 @@ export default {
},
mounted() {
EventBus.$on("onReagentSubmit",this.onReagentSubmit)
EventBus.$on("onInstrumentSubmit",this.onInstrumentSubmit)
},
unmounted() {
EventBus.$off("onReagentSubmit",this.onReagentSubmit)
EventBus.$off("onInstrumentSubmit",this.onInstrumentSubmit)
},
data() {
return {
@ -100,6 +102,11 @@ export default {
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
},
// ,
onInstrumentSubmit(data){
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
},
getClickableItem(sItem) {
return {
...sItem,
@ -120,9 +127,8 @@ export default {
})
}
},
onSelectReagentSubmit(reagent){
this.formFields[this.currentClickKey] = reagent
},
}
}
</script>

+ 2
- 2
src/views/business/comps/template/dialog/SelectInstrumentDialog.vue View File

@ -73,7 +73,7 @@ export default {
label: '来源(厂家)',
},
{
prop: 'nddw',
prop: 'jzrq',
label: '下次校准时间',
},
],
@ -112,7 +112,7 @@ export default {
let row = this.currentRow;
this.$emit('submit', this.selectedId,row);
// eventBus
EventBus.$emit("onReagentSubmit",{uuid:this.uuid,selectedId:this.selectedId,row});
EventBus.$emit("onInstrumentSubmit",{uuid:this.uuid,selectedId:this.selectedId,row});
this.visible = false;
},
handleSelect(code,row) {

+ 129
- 0
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -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: '',//eventBusid,
selectType: 'sj',//
listApi: public_sjList,
searchForm: getSjSearchForm(),
columns: getSjColumns(),
sourceFrom:"step",//
}
},
computed: {
isDisabled() {
return !this.selectedId;
}
},
methods: {
show(studyFormId, data) {
if (data && data.uuid) {//eventBusid
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>

+ 122
- 0
src/views/business/comps/template/formConfig/formConfig.js View File

@ -0,0 +1,122 @@
// 试剂列表查询表单
export const getSjSearchForm = () => {
return {
mc: {
label: 'page.business.resource.sj.sjmc',
},
bh: {
label: 'page.business.resource.sj.sjbh',
},
studyName: {
label: 'page.business.resource.sj.sssy',
},
}
}
// 供试品列表查询表单
export const getGspSearchForm = () => {
return {
mc: {
label: '名称/代号',
},
bh: {
label: 'page.business.resource.sj.sjbh',
},
ph: {
label: '物质批号',
},
}
}
// 给药制剂列表查询表单
export const getGyzjSearchForm = () => {
return {
mc: {
label: 'page.business.resource.sj.sjmc',
},
bh: {
label: 'page.business.resource.sj.sjbh',
},
studyMc: {
label: 'page.business.resource.sj.sssy',
},
}
}
// 试剂列表表格列
export const getSjColumns = () => {
return [
{
prop: 'mc',
label: 'page.business.resource.sj.sjmc',
},
{
prop: 'bh',
label: 'page.business.resource.sj.sjbh',
},
{
prop: 'nd',
label: 'page.business.resource.sj.sjnd',
},
{
prop: 'nddw',
label: 'page.business.resource.gsp.nddw',
},
{
prop: 'sxr',
label: 'page.business.resource.sj.sxr',
},
{
prop: 'studyName',
label: 'page.business.resource.sj.sssy',
},
]
}
// 供试品列表表格列
export const getGspColumns = () => {
return [
{
prop: 'mc',
label: '名称/代号',
},
{
prop: 'bh',
label: 'page.business.resource.sj.sjbh',
},
{
prop: 'yxq',
label: '有效期',
},
{
prop: 'ph',
label: '物质批号',
},
]
}
// 给药制剂列表表格列
export const getGyzjColumns = () => {
return [
{
prop: 'mc',
label: 'page.business.resource.sj.sjmc',
},
{
prop: 'bh',
label: 'page.business.resource.sj.sjbh',
},
{
prop: 'nd',
label: 'page.business.resource.sj.sjnd',
},
{
prop: 'nddw',
label: 'page.business.resource.gsp.nddw',
},
{
prop: 'sxr',
label: 'page.business.resource.sj.sxr',
},
{
prop: 'studyName',
label: 'page.business.resource.sj.sssy',
},
]
}

Loading…
Cancel
Save