Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
cb1a56e958
1 changed files with 101 additions and 102 deletions
  1. +101
    -102
      src/views/business/comps/template/comps/dl/DL018.vue

+ 101
- 102
src/views/business/comps/template/comps/dl/DL018.vue View File

@ -11,24 +11,22 @@
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl018.xbxx" label="template.dl.dl018.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData" @onRegentSubmit="onRegentSubmit"
/>
<BaseInfoFormPackage fieldItemLabel="template.dl.dl018.xbxx" label="template.dl.dl018.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData"
@onRegentSubmit="onRegentSubmit" />
<LineLabel label="template.dl.dl018.xbczqk" />
<CustomTable
@headerSelectChange="onHeaderSelectChange"
fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
@beforeSaveRecord = "beforeSaveRecord"
:showAddRow="false" :showOperation="false"
ref="stepTableRef" :columns="stepColumns" :formData="tableFormData">
<!-- <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<LineLabel label="template.dl.dl018.xbczqk" />
<CustomTable @headerSelectChange="onHeaderSelectChange"
fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
@beforeSaveRecord="beforeSaveRecord" :showAddRow="false" :showOperation="false"
ref="stepTableRef" :columns="stepColumns" :formData="tableFormData">
<!-- <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
:row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow">
</TableOpertaion>
</template> -->
</CustomTable>
</CustomTable>
<LineLabel label="template.dl.dl018.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
@ -56,10 +54,10 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion
export default {
name: "DL018",
dicts: [
'business_dl_qsxjbltj','business_tjdw'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
dicts: [
'business_dl_qsxjbltj', 'business_tjdw'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
@ -68,13 +66,13 @@ export default {
},
},
computed: {
//
tableFormData() {
return {
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: {}
}
},
//
tableFormData() {
return {
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: {}
}
},
//
remarkConig() {
return [
@ -139,7 +137,7 @@ export default {
}
]
},
//
//
swypyjInfoFormConfig() {
return [
{
@ -150,16 +148,16 @@ export default {
label: 'template.dl.dl018.qxbd',
type: 'qxbd',
fillType: 'actFill',
qxbdType:'DL014',
filledCodes:['bdmc','bdbh'],
qxbdType: 'DL014',
filledCodes: ['bdmc', 'bdbh'],
},
bltj: {
bltj: {
label: 'template.dl.dl018.bltj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_dl_qsxjbltj'),
otherCode: 'bltjOther',
showOtherLabel:false
showOtherLabel: false
},
}
}
@ -174,7 +172,7 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
@ -183,7 +181,7 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
@ -192,13 +190,14 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
subodySubKeybKey: 'rsks',
bodySubButtonName: 'template.dl.dl018.ksButton',
showBodySub:this.fillType === "actFill",
bodySubType: 'button',
bodySubFillType: 'actFill',
subodySubKeybKey: 'rsks',
bodySubButtonName: 'template.dl.dl018.ksButton',
showBodySub: this.fillType === "actFill",
},
{
label: "template.dl.dl018.rsjs",
@ -206,13 +205,14 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
subodySubKeybKey: 'rsjs',
bodySubButtonName: 'template.dl.dl018.jsButton',
showBodySub:this.fillType === "actFill",
bodySubType: 'button',
bodySubFillType: 'actFill',
subodySubKeybKey: 'rsjs',
bodySubButtonName: 'template.dl.dl018.jsButton',
showBodySub: this.fillType === "actFill",
},
{
label: "template.dl.dl018.zs",
@ -260,69 +260,69 @@ export default {
mounted() {
},
methods: {
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'qxbd') {
try {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'qxbd') {
try {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
if (stepTableFormData.length === 0) {
//
this.$set(this.formData, 'stepTableFormData', [])
this.$message.warning('前序表单中没有剂量组数据')
return
}
if (stepTableFormData.length === 0) {
//
this.$set(this.formData, 'stepTableFormData', [])
this.$message.warning('前序表单中没有剂量组数据')
return
}
//
const itemData = stepTableFormData.map(item => ({
jlzb: item.jlzb || '', //
xybh: item.xybh || '', //
rsks: '', //
rsjs: '', //
zs: '', //
ys: '', //
zy: '', //
yx: '', //
tj: '', //
}))
// 使 $set formData CustomTable
this.$set(this.formData, 'stepTableFormData', itemData)
//
const itemData = stepTableFormData.map(item => ({
jlzb: item.jlzb || '', //
xybh: item.xybh || '', //
rsks: '', //
rsjs: '', //
zs: '', //
ys: '', //
zy: '', //
yx: '', //
tj: '', //
}))
// 使 $set formData CustomTable
this.$set(this.formData, 'stepTableFormData', itemData)
this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`)
} catch (error) {
this.$set(this.formData, 'stepTableFormData', [])
console.error('解析前序表单数据失败:', error)
this.$message.error('解析前序表单数据失败')
}
}
},
//table header
onHeaderSelectChange(data){
const {key, headerSelectFields,dataSource=[]} = data;
this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`)
} catch (error) {
this.$set(this.formData, 'stepTableFormData', [])
console.error('解析前序表单数据失败:', error)
this.$message.error('解析前序表单数据失败')
}
}
},
//table header
onHeaderSelectChange(data) {
const { key, headerSelectFields, dataSource = [] } = data;
const keys = [
'targetStartSolutionVolumeUnit',
'targetDiluentVolumeUnit',
'targetSolutionConcentrationUnit',
'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 = {
subTargetStartSolution,
headerSelectFields
}
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params)
}
},
beforeSaveRecord(data){
beforeSaveRecord(data) {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields,data);
this.onCommonVerifyNdException(formFields, data);
},
configComplete(val) {
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
@ -332,8 +332,8 @@ export default {
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId:this.formData.id,
studyId:this.formData.studyId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total,
kcdw: unit,
}
@ -342,30 +342,30 @@ export default {
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"]);
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
//
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
const tableFromHyqk = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
const tableFromHyqk = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
return this.resourceTmp;
},
//
@ -383,5 +383,4 @@ export default {
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>
<style rel="stylesheet/scss" lang="scss"></style>

Loading…
Cancel
Save