Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
4b50da8d3a
2 changed files with 103 additions and 107 deletions
  1. +2
    -2
      src/components/Template/BaseInfoFormPackage.vue
  2. +101
    -105
      src/views/business/comps/template/comps/dl/DL023.vue

+ 2
- 2
src/components/Template/BaseInfoFormPackage.vue View File

@ -167,9 +167,9 @@
:error="errors[key]" @update:error="errors[key] = false" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</div> </div>
<div v-else-if="sItem.type === 'select'" class="flex flex1">
<div v-else-if="sItem.type === 'select' ||sItem.type === 'radio'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="select" :item="sItem" style="width: auto;flex:1" v-model="formFields[key]"
:type="sItem.type" :item="sItem" style="width: auto;flex:1" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)" @copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)"
:error="errors[key]" @update:error="errors[key] = false" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />

+ 101
- 105
src/views/business/comps/template/comps/dl/DL023.vue View File

@ -8,27 +8,21 @@
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<!-- 仪器使用信息 -->
<LineLabel label="template.dl.dl023.yqsyxx" />
<CustomTable
:ref="`tableRef`"
:columns="yqsyxxColumns"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:formData="formData"
operationWidth = "80px"
:showAddRow="fillType === 'actFill'"
:showOperation="fillType === 'actFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
</template>
</CustomTable>
<!-- 仪器使用信息 -->
<LineLabel label="template.dl.dl023.yqsyxx" />
<CustomTable :ref="`tableRef`" :columns="yqsyxxColumns" @onRegentSubmit="(e) => onRegentSubmit(e)"
:formData="formData" operationWidth="80px" :showAddRow="fillType === 'actFill'"
:showOperation="fillType === 'actFill'">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="deleteRow"></TableOpertaionDelete>
</template>
</CustomTable>
<LineLabel label="template.dl.dl023.czjl" />
<!-- 操作记录 -->
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
:formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" />
<LineLabel label="template.dl.dl023.czjl" />
<!-- 操作记录 -->
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div> </div>
@ -52,10 +46,10 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion
export default { export default {
name: "dl023", name: "dl023",
dicts: [
'business_dl_xbmc'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
dicts: [
'business_dl_xbmc'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -103,67 +97,70 @@ export default {
} }
] ]
}, },
//yqsyxxColumns使
yqsyxxColumns() {
//yqsyxxColumns使
yqsyxxColumns() {
return [{ return [{
label: 'template.dl.dl023.yqbh', label: 'template.dl.dl023.yqbh',
prop: 'yqbh', prop: 'yqbh',
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
disabled: true
},{
disabled: true
}, {
label: 'template.dl.dl023.yqmc', label: 'template.dl.dl023.yqmc',
prop: 'yqmc', prop: 'yqmc',
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
disabled: true
},{
disabled: true
}, {
label: 'template.dl.dl023.yqxh', label: 'template.dl.dl023.yqxh',
prop: 'yqxh', prop: 'yqxh',
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
disabled: true
},{
disabled: true
}, {
label: 'template.dl.dl023.xcrq', label: 'template.dl.dl023.xcrq',
prop: 'xcrq', prop: 'xcrq',
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
disabled: true
disabled: true
}] }]
}, },
//
//
stepFormConfig() { stepFormConfig() {
return [ return [
{ {
type: "cellItem",
type: "step",
config: { config: {
dwzshxbx: {
dwzshxbx: {
// span:1, // span:1,
label: 'template.dl.dl023.dwzshxbx', label: 'template.dl.dl023.dwzshxbx',
type: 'qxbd',
type: 'radio',
fillType: 'actFill', fillType: 'actFill',
filledCodes:['bdmc','bdbh'],
options:[
{label:"动物种属",value:"动物种属"},
{label:"细胞系",value:"细胞系"}
]
}, },
sydd: {
sydd: {
label: 'template.dl.dl023.sydd', label: 'template.dl.dl023.sydd',
type: 'select', type: 'select',
fillType: 'actFill', fillType: 'actFill',
options: this.getDictOptions('business_dl_sydd'), options: this.getDictOptions('business_dl_sydd'),
otherCode: 'syddOther', otherCode: 'syddOther',
showOtherLabel:false
showOtherLabel: false
},
zwbh: {
label: 'template.dl.dl023.zwbh',
type: 'input',
fillType: 'actFill',
bodyMaxlength: 50,
}, },
zwbh:{
label: 'template.dl.dl023.zwbh',
type: 'input',
fillType: 'actFill',
bodyMaxlength: 50,
},
uvazsjl: {
uvazsjl: {
label: "template.dl.dl023.uvazsjl", label: "template.dl.dl023.uvazsjl",
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
@ -172,32 +169,32 @@ export default {
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
}, },
zszsj:{
span:1,
label: 'template.dl.dl023.zszsj',
type: 'input',
with:100,
fillType: 'actFill',
bodyMaxlength: 50,
},
zskssj: {
label: 'template.dl.dl023.zskssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
subKey: 'zskssj',
buttonName: 'template.dl.dl023.ksButton',
},
zsjssj: {
label: 'template.dl.dl023.zsjssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
subKey: 'zsjssj',
buttonName: 'template.dl.dl023.jsButton',
},
zszsj: {
span: 1,
label: 'template.dl.dl023.zszsj',
type: 'input',
with: 100,
fillType: 'actFill',
bodyMaxlength: 50,
},
zskssj: {
label: 'template.dl.dl023.zskssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
subKey: 'zskssj',
buttonName: 'template.dl.dl023.ksButton',
},
zsjssj: {
label: 'template.dl.dl023.zsjssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
subKey: 'zsjssj',
buttonName: 'template.dl.dl023.jsButton',
},
} }
} }
] ]
@ -211,46 +208,46 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
//
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
console.log('选择仪器编号预留===',row)
// if (key === 'yqbh' && this.$refs.yqsyTableRef) {
// const params = {
// yqmc: row.mc,
// yqxh: row.xh,
// xccsjzjdrq: row.jzrq
// }
// this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
// }
},
onFormSelect(fields){
//
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
console.log('选择仪器编号预留===', row)
// if (key === 'yqbh' && this.$refs.yqsyTableRef) {
// const params = {
// yqmc: row.mc,
// yqxh: row.xh,
// xccsjzjdrq: row.jzrq
// }
// this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
// }
},
onFormSelect(fields) {
this.onHandleBlur(fields) this.onHandleBlur(fields)
}, },
//table header
onHeaderSelectChange(data){
const {key, headerSelectFields,dataSource=[]} = data;
//table header
onHeaderSelectChange(data) {
const { key, headerSelectFields, dataSource = [] } = data;
const keys = [ const keys = [
'targetStartSolutionVolumeUnit', 'targetStartSolutionVolumeUnit',
'targetDiluentVolumeUnit', 'targetDiluentVolumeUnit',
'targetSolutionConcentrationUnit', 'targetSolutionConcentrationUnit',
'targetSolutionVolumeUnit', 'targetSolutionVolumeUnit',
] ]
if(keys.includes(key)){
const {targetStartSolution,subTargetStartSolution} = this.$refs.swypyjInfoRef?.getFilledFormData();
if (keys.includes(key)) {
const { targetStartSolution, subTargetStartSolution } = this.$refs.swypyjInfoRef?.getFilledFormData();
const params = { const params = {
subTargetStartSolution, subTargetStartSolution,
headerSelectFields headerSelectFields
} }
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params)
} }
}, },
beforeSaveRecord(data){
beforeSaveRecord(data) {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData(); const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields,data);
this.onCommonVerifyNdException(formFields, data);
}, },
configComplete(val) {
configComplete(val) {
const { rowData, headerSelectFields } = val; const { rowData, headerSelectFields } = val;
//(+) //(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
@ -260,14 +257,14 @@ export default {
nd: rowData.actSolutionConcentration,// nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId, studySubjectId: this.formData.studySubjectId,
studyFormId:this.formData.id,
studyId:this.formData.studyId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
} }
this.configCompleteRequest(postData); this.configCompleteRequest(postData);
}, },
//
//
subPackageSubmit(data) { subPackageSubmit(data) {
const { fzsj, rowData, headerSelectFields } = data; const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj; const { fzList = [], dw = "", mybh } = fzsj;
@ -286,7 +283,7 @@ export default {
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId, studySubjectId: this.formData.studySubjectId,
studyFormId:this.formData.id,
studyFormId: this.formData.id,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);
@ -294,11 +291,11 @@ export default {
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef","remarkRef","tableRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "remarkRef", "tableRef"])
}, },
// //
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef","remarkRef","tableRef"]);
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "remarkRef", "tableRef"]);
return content; return content;
}, },
getResource() { getResource() {
@ -323,5 +320,4 @@ export default {
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss">
</style>
<style rel="stylesheet/scss" lang="scss"></style>

Loading…
Cancel
Save