Browse Source

feat:[模板管理][代码合并]

lkf
luojie 2 months ago
parent
commit
6ecd0a1ba9
5 changed files with 157 additions and 5 deletions
  1. +8
    -0
      src/api/business/public/public.js
  2. +5
    -0
      src/components/Template/StepFormPackage.vue
  3. +10
    -3
      src/views/business/comps/template/TemplateTable.vue
  4. +132
    -0
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  5. +2
    -2
      vue.config.js

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

@ -75,3 +75,11 @@ export function public_bzList(query) {
params: query
})
}
// 仪器列表
export function public_yqList(query) {
return request({
url: '/system/business/public/yqList',
method: 'get',
params: query
})
}

+ 5
- 0
src/components/Template/StepFormPackage.vue View File

@ -113,6 +113,11 @@ export default {
studyFormId:this.templateData.id,
uuid:this.uuid,
})
}else if(type === 'instrument'){
EventBus.$emit("showSelectInstrumentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
})
}
},
onSelectReagentSubmit(reagent){

+ 10
- 3
src/views/business/comps/template/TemplateTable.vue View File

@ -4,8 +4,8 @@
</component>
<SubPackageDialog ref = "subPackageDialogRef"></SubPackageDialog>
<TagPrintDialog ref = "tagPrintDialogRef"></TagPrintDialog>
<SelectReagentDialog ref="selectReagentDialogRef">
</SelectReagentDialog>
<SelectReagentDialog ref="selectReagentDialogRef"/>
<SelectInstrumentDialog ref="selectInstrumentDialogRef"/>
</div>
</template>
@ -15,6 +15,8 @@ import { EventBus } from "@/utils/eventBus";
import SubPackageDialog from "./dialog/SubPackageDialog.vue";//
import TagPrintDialog from "./dialog/PrintTagDialog.vue";//
import SelectReagentDialog from "./dialog/SelectReagentDialog.vue";//
import SelectInstrumentDialog from "./dialog/SelectInstrumentDialog.vue";//
//
import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue";
@ -42,7 +44,7 @@ import MJYLQSQD from "./comps/gsp/MJYLQSQD.vue";
export default {
name: "TemplateTable",
components: {
SubPackageDialog,TagPrintDialog,SelectReagentDialog,
SubPackageDialog,TagPrintDialog,SelectReagentDialog,SelectInstrumentDialog,
//
MJYLQSQD, SYWZPZJHB,
//
@ -169,6 +171,10 @@ export default {
EventBus.$on("showTagPrintDialog",(data)=>{
this.$refs.tagPrintDialogRef.show(data)
})
//
EventBus.$on("showSelectInstrumentDialog",(data)=>{
this.$refs.selectInstrumentDialogRef.show(data.studyFormId,data)
})
//
EventBus.$on("showSelectReagentDialog",(data)=>{
this.$refs.selectReagentDialogRef.show(data.studyFormId,data)
@ -180,6 +186,7 @@ export default {
EventBus.$off("showSubPackageDialog");
EventBus.$off("showTagPrintDialog");
EventBus.$off("showSelectReagentDialog");
EventBus.$off("showSelectInstrumentDialog");
},
methods: {
async getFormData() {

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

@ -0,0 +1,132 @@
<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%">
<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_yqList } from '@/api/business/public/public';
import { EventBus } from "@/utils/eventBus";
export default {
components: {
SelectTable,
SelectDept
},
props: {
type: {
type: String,
default: "",
},
title: {
type: String,
default: "选择仪器",
},
selectedCode: {
type: String,
default: "bh",
},
listApi: {
type: Function,
default: public_yqList,
},
searchForm: {
type: Object,
default: () => {
return {
mc: {
label:'仪器名称',
},
bh: {
label:'仪器编号',
},
ly: {
label:'来源',
},
}
},
},
columns: {
type: Array,
default: () => [
{
prop: 'mc',
label: '仪器名称',
},
{
prop: 'bh',
label: '仪器编号',
},
{
prop: 'ly',
label: '来源(厂家)',
},
{
prop: 'nddw',
label: '下次校准时间',
},
],
},
},
data() {
return {
visible:false,
selectedId: "",
currentRow: {},
studyFormId:'',//studyFormId
uuid:'',//eventBusid,
}
},
computed: {
isDisabled() {
return !this.selectedId;
}
},
methods: {
show(studyFormId,data){
if(data && data.uuid) {//eventBusid
this.uuid = data.uuid
}
if(this.$refs.selectSjRef){
this.$refs.selectSjRef.show()
}
this.visible = true
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;
},
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>

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
// target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save