Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
ca72880e98
5 changed files with 71 additions and 26 deletions
  1. +38
    -15
      src/components/Template/StepFormPackage.vue
  2. +7
    -0
      src/components/Template/mixins/formPackageMixins.js
  3. +1
    -1
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  4. +7
    -1
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  5. +18
    -9
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue

+ 38
- 15
src/components/Template/StepFormPackage.vue View File

@ -122,16 +122,15 @@ export default {
const item = allFieldsConfig[key];
if(item.type === "xb" || item.type === "regent" || item.type === "gsp" || item.type === "mix"){
if(formFields[key]){
this.formFields[`selectType_${key}`] = item.sjSelectType;
let o = {
type:item.sjSelectType || formFields[`selectType_${key}`] ,
...formFields[`selectInfo_${key}`],
value:formFields[key],
}
if(item.ylCode){
o.yl = formFields[item.ylCode];//
o.syl = formFields[item.ylCode];//
}
if(item.dwCode){
o.dw = formFields[item.dwCode];//
o.syldw = formFields[item.dwCode];//
}
sjResource.push(o);
}
@ -140,11 +139,11 @@ export default {
yqResource.push({
type:item.type,
value:formFields[key],
...formFields[`selectInfo_${key}`],
});
}
}
}
console.log(sjResource,"sjResource")
return {
sjResource,
yqResource,
@ -171,21 +170,24 @@ export default {
// //
onMixReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
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)
},
//
onReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
this.updateFormData(this.currentClickKey,data.selectedId)
},
// ,
onInstrumentSubmit(data){
if(data.uuid !== this.uuid) return;
this.formFields[this.currentClickKey] = data.selectedId;
this.updateFormData(this.currentClickKey,data.selectedId)
// this.formFields[this.currentClickKey] = data.selectedId;
this.formFields[`selectInfo_${this.currentClickKey}`] = data.selectInfo;
},
getClickableItem(sItem) {
return {
@ -196,34 +198,55 @@ export default {
},
handleClickInstrument(key,type) {
this.currentClickKey = key;
if(type === 'regent'){
if(type === 'regent'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"sj"
type:"1"
})
}else if(type === 'gsp'){
}else if(type === 'gyzj'){//
EventBus.$emit("showSelectMixReagentDialog",{
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:'step',
type:"gsp"
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:"sj",
type:"1",
mixType:true,
})
}else if(type === 'xb'){
}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:"xb",
type:"11",
})
}else if(type === 'instrument'){
EventBus.$emit("showSelectInstrumentDialog",{

+ 7
- 0
src/components/Template/mixins/formPackageMixins.js View File

@ -34,6 +34,7 @@ export default {
data() {
return {
uuid: getuuid(),
oldFormFields: {},
}
},
mounted() {
@ -122,6 +123,7 @@ export default {
updateFormData(key, value) {
// 深拷贝当前表单数据,避免直接修改原数据
const cloneFormFields = JSON.parse(JSON.stringify(this.formFields));
this.oldFormFields[key] = cloneFormFields[key];
this.showEditSignDialog();
this.formFields[key] = value;
@ -293,6 +295,11 @@ export default {
}
}
});
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
const selectInfoKeys = Object.keys(formData).filter(key => key.startsWith("selectInfo_"));
selectInfoKeys.forEach(key => {
result[key] = formData[key];
})
// 更新表单字段
this.formFields = result;
this.allFieldsConfig = config;

+ 1
- 1
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -25,7 +25,7 @@
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
<!-- <button @click="onSave">提交</button> -->
<button @click="onSave">提交</button>
</div>
</div>
</template>

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

@ -113,8 +113,14 @@ export default {
onSubmit() {
let row = this.currentRow;
this.$emit('submit', this.selectedId,row);
const selectInfo = {
mc: row.mc,
bh: row.bh,
xh: row.xh,
jzrq: row.jzrq,
}
// eventBus
EventBus.$emit("onInstrumentSubmit",{uuid:this.uuid,selectedId:this.selectedId,row});
EventBus.$emit("onInstrumentSubmit",{selectInfo,uuid:this.uuid,selectedId:this.selectedId,row});
this.visible = false;
},
handleSelect(code,row) {

+ 18
- 9
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -3,9 +3,9 @@
<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-button label="sj">试剂列表</el-radio-button>
<el-radio-button label="gsp">供试品列表</el-radio-button>
<el-radio-button label="gyzj">给药制剂列表</el-radio-button>
<el-radio-button label="1">试剂列表</el-radio-button>
<el-radio-button label="7">供试品列表</el-radio-button>
<el-radio-button label="3">给药制剂列表</el-radio-button>
</el-radio-group>
<SelectTable ref="selectSjRef" :columns="columns" :selectedId="selectedId" :searchForm="searchForm"
:studyFormId="studyFormId" :listApi="listApi" :selectedCode="selectedCode" @radioSelect="handleSelect" />
@ -29,25 +29,25 @@ import { public_sjList, public_gyzjList, public_gspList, public_xbList } from '@
import { getSjSearchForm, getSjColumns, getGyzjSearchForm, getGyzjColumns, getGspSearchForm, getGspColumns, getXbSearchForm, getXbColumns } from '@/views/business/comps/template/formConfig/formConfig.js';
import { EventBus } from "@/utils/eventBus";
const typeMap = {
sj: {
'1': {
searchForm: getSjSearchForm(),
columns: getSjColumns(),
listApi: public_sjList,
title:"选择试剂"
},
gsp: {
'7': {
searchForm: getGspSearchForm(),
columns: getGspColumns(),
listApi: public_gspList,
title:"选择供试品"
},
xb: {
"11": {
searchForm: getXbSearchForm(),
columns: getXbColumns(),
listApi: public_xbList,
title:"选择细胞"
},
gyzj: {
"3": {
searchForm: getGyzjSearchForm(),
columns: getGyzjColumns(),
listApi: public_gyzjList,
@ -81,7 +81,7 @@ export default {
depart: "",
studyFormId: '',//studyFormId
uuid: '',//eventBusid,
selectType: 'sj',//
selectType: '1',//
listApi: public_sjList,
searchForm: getSjSearchForm(),
columns: getSjColumns(),
@ -140,9 +140,18 @@ export default {
onSubmit() {
let row = this.currentRow;
const selectedValue = this.otherChecked ? this.otherReagent : this.selectedId;
const selectInfo = {
mc: row.mc,
bh: row.bh,
nd: row.nd,
ly: row.ly,
nddw: row.nddw,
sxrq: row.sxrq,
type: Number(this.selectType),
}
this.$emit('submit', selectedValue, row);
// eventBus
EventBus.$emit("onMixReagentSubmit", { uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType });
EventBus.$emit("onMixReagentSubmit", { selectInfo, uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType });
this.visible = false;
},
//

Loading…
Cancel
Save