Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
40f603ab8a
2 changed files with 14 additions and 93 deletions
  1. +0
    -91
      src/components/Template/StepFormPackage.vue
  2. +14
    -2
      src/components/Template/mixins/formPackageMixins.js

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

@ -101,14 +101,8 @@ export default {
}
},
mounted() {
EventBus.$on("onReagentSubmit",this.onReagentSubmit)
// EventBus.$on("onInstrumentSubmit",this.onInstrumentSubmit)
// EventBus.$on("onMixReagentSubmit",this.onMixReagentSubmit)
},
unmounted() {
EventBus.$off("onReagentSubmit",this.onReagentSubmit)
// EventBus.$off("onInstrumentSubmit",this.onInstrumentSubmit)
// EventBus.$off("onMixReagentSubmit",this.onMixReagentSubmit)
},
data() {
return {
@ -131,7 +125,6 @@ export default {
this.allFieldsConfig[key].sjSelectType = data.selectType;
}
this.formFields[`selectInfo_${key}`] = data.selectInfo;
console.log(this.formFields,"mmm")
// this.$emit("onRegentSubmit", {selectInfo:data,key,config:item});
},
getRegentItem(item,fieldCode="type"){
@ -209,7 +202,6 @@ console.log(this.formFields,"mmm")
}
}
}
console.log(sjResource,yqResource,"sjResource,yqResource")
return {
sjResource,
yqResource,
@ -233,28 +225,6 @@ console.log(this.formFields,"mmm")
fillType:sItem.fillType || "actFill",
}
},
// //
onMixReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.updateFormData(this.currentClickKey,data.selectedId)
if(data.selectType){
this.allFieldsConfig[this.currentClickKey].sjSelectType = data.selectType;
this.formFields[`selectInfo_${this.currentClickKey}`] = data.selectInfo;
}
this.$emit("onDialogSubmit",data,this.currentClickKey)
},
//
onReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.updateFormData(this.currentClickKey,data.selectedId)
},
// ,
onInstrumentSubmit(data){
if(data.uuid !== this.uuid) return;
this.updateFormData(this.currentClickKey,data.selectedId)
// this.formFields[this.currentClickKey] = data.selectedId;
this.formFields[`selectInfo_${this.currentClickKey}`] = data.selectInfo;
},
getClickableItem(sItem) {
return {
...sItem,
@ -262,67 +232,6 @@ console.log(this.formFields,"mmm")
}
},
handleClickInstrument(key,type) {
this.currentClickKey = key;
if(type === 'sj'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"1"
})
}else if(type === 'gyzj'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"3"
})
}else if(type === 'mjy'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"5"
})
}else if(type === 'gsp'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"7"
})
}else if(type === 'mix'){
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"1",
mixType:true,
})
}else if(type === 'xj'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"9",
})
}else if(type === 'xb'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"11",
})
}else if(type === 'yq'){
EventBus.$emit("showSelectInstrumentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
})
}
},
}
}
</script>

+ 14
- 2
src/components/Template/mixins/formPackageMixins.js View File

@ -46,9 +46,21 @@ export default {
},
methods: {
onSelectChange(){
onSelectChange(key, val, type) {
// 获取对应的配置
const currentConfig = this.allFieldsConfig[key];
if (currentConfig.selectTo) {
this.formFields[currentConfig.selectTo] = val;
}
this.onValueChangeCompareTo(key, val);
this.formFields[key] = val;
this.$emit("select", { key, value: val, type });
// 清除该表单项的错误状态
if (this.errors[key]) {
this.$set(this.errors, key, false);
}
},
//试剂/仪器等弹窗提交
onRegentSubmit(data,key,item){
this.updateFormData(key,data.selectedId);

Loading…
Cancel
Save