Browse Source

FIx[模板管理]DL018-22-23-24完善

ouqian
lslaiwy 1 month ago
parent
commit
0fe4e7d2e8
4 changed files with 136 additions and 185 deletions
  1. +107
    -129
      src/views/business/comps/template/comps/dl/DL018.vue
  2. +1
    -43
      src/views/business/comps/template/comps/dl/DL022.vue
  3. +9
    -1
      src/views/business/comps/template/comps/dl/DL023.vue
  4. +19
    -12
      src/views/business/comps/template/comps/dl/DL024.vue

+ 107
- 129
src/views/business/comps/template/comps/dl/DL018.vue View File

@ -11,23 +11,20 @@
<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"
@clickButton="clickButton"
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>
<LineLabel label="template.dl.dl018.xbczqk" />
<CustomTable
fieldItemLabel="template.common.operationSteps"
@clickButton="handleClickButton"
:showAddRow="false" :showOperation="false"
ref="stepTableRef" :prefixKey = "`tableSecond`" :columns="stepColumns" :formData="tableFormData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow(rowIndex,'secondTable')" ></TableOpertaionDelete>
</template>
</CustomTable>
<LineLabel label="template.dl.dl018.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
@ -52,13 +49,14 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
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: {
@ -67,13 +65,13 @@ export default {
},
},
computed: {
//
tableFormData() {
return {
stepTableFormData: [{}],
headerSelectFields: {}
}
},
//
tableFormData() {
return {
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: {}
}
},
//
remarkConig() {
return [
@ -138,7 +136,7 @@ export default {
}
]
},
//
//
swypyjInfoFormConfig() {
return [
{
@ -149,16 +147,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
},
}
}
@ -173,7 +171,7 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
@ -182,38 +180,34 @@ export default {
width: 180,
bodyType: "input",
bodyFillType: "actFill",
disabled: true,
disabled: true,
bodyDisabled: true,
},
{
label: "template.dl.dl018.rsks",
prop: "rsks",
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
bodySubFillType: 'actFill',
bodySubKey: 'rsks',
bodySubType: 'button',
bodySubButtonName: 'template.dl.dl018.ksButton',
showBodySub: this.fillType === "actFill",
bodySubKey: 'rsks1',
bodySubFillType: 'actFill',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 280,
bodyMaxlength: 50,
},
{
label: "template.dl.dl018.rsjs",
prop: "rsjs",
width: 180,
bodyType: "input",
bodyFillType: "actFill",
// disabled: true,
// showOtherLabel: false,
bodySubType: 'button',
bodySubType: 'button',
bodySubButtonName: 'template.dl.dl018.jsButton',
bodySubKey: 'rsjs1',
bodySubFillType: 'actFill',
bodySubKey: 'rsjs',
bodySubButtonName: 'template.dl.dl018.jsButton',
showBodySub: this.fillType === "actFill",
bodyFillType: 'actFill',
bodyDisabled: true,
width: 280,
bodyMaxlength: 50,
},
{
label: "template.dl.dl018.zs",
@ -261,115 +255,98 @@ export default {
mounted() {
},
methods: {
clickButton(e,rowIndex) {
console.log(e,rowIndex)
//
handleClickButton(e, rowIndex) {
const arrStr = typeof e === 'string' ? e.slice(0, -1) : '';
const updateData = { [arrStr]: moment().format('YYYY/MM/DD HH:mm') };
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, updateData);
// console.log(this.getFilledFormData())
},
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)
}
},
beforeSaveRecord(data) {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields, data);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total,
kcdw: unit,
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
}
this.configCompleteRequest(postData);
},
//
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;
},
//
@ -387,4 +364,5 @@ export default {
}
};
</script>
<style rel="stylesheet/scss" lang="scss"></style>
<style rel="stylesheet/scss" lang="scss">
</style>

+ 1
- 43
src/views/business/comps/template/comps/dl/DL022.vue View File

@ -244,7 +244,6 @@ export default {
onAddRow() {
this.$refs.tableRef.addRow({
jblx: [{value: undefined}],
id: getuuid(),
})
},
onFormSelect(fields) {
@ -272,48 +271,7 @@ export default {
const formFields = this.$refs.swypyjInfoRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields, data);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
studyId: this.formData.studyId,
kc: total,
kcdw: unit,
}
this.configCompleteRequest(postData);
},
//
subPackageSubmit(data) {
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
if (fzList && fzList.length > 0) {
const list = fzList.map((item) => {
return {
bh: mybh + item.preCode + item.subCode,
kc: item.num,
kcdw: dw,
}
})
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyFormId: this.formData.id,
list: list
}
this.subPackageRequest(postData);
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "remarkRef", "tableRef"])

+ 9
- 1
src/views/business/comps/template/comps/dl/DL023.vue View File

@ -22,7 +22,7 @@
<LineLabel label="template.dl.dl023.czjl" />
<!-- 操作记录 -->
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
@select="onSelect" :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
@select="onSelect" @clickButton="handleClickButton" :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
@ -43,6 +43,7 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "dl023",
@ -210,6 +211,13 @@ export default {
mounted() {
},
methods: {
//
handleClickButton(item,signData) {
const arrStr = item.subKey;
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value,{isUpdateRecord:true,signData});
// console.log(this.getFilledFormData())
},
onSelect(e) {
const { key, value } = e
if (key === "dwzshxbx") {//

+ 19
- 12
src/views/business/comps/template/comps/dl/DL024.vue View File

@ -15,12 +15,15 @@
<!-- 操作记录 -->
<div class="template-form-item">
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
:formConfig="stepFormConfig" @blur="onHandleBlur" @onRegentSubmit="onRegentSubmit"
:formConfig="stepFormConfig"
@blur="onHandleBlur"
@clickButton="handleClickButton"
@onRegentSubmit="onRegentSubmit"
:formData="formData" />
<CustomTable
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
:formData="tableFormData"
operationWidth = "80px"
:prefixKey = "`table`"
fieldItemLabel = "template.dl.dl024.gcqk"
@ -52,6 +55,7 @@ import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "dl024",
@ -183,7 +187,7 @@ export default {
bodyType: 'input',
bodyFillType: 'actFill',
width: 100,
bodyMaxlength: 50,
bodyDisabled: true,
}
]
},
@ -196,6 +200,13 @@ export default {
mounted() {
},
methods: {
//
handleClickButton(item,signData) {
const arrStr = item.subKey;
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value,{isUpdateRecord:true,signData});
// console.log(this.getFilledFormData())
},
//
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
@ -205,7 +216,7 @@ export default {
//
const bdnr = JSON.parse(row.bdnr)
//
const stepTableFormData = bdnr.jlzTableData || []
const stepTableFormData = bdnr.stepTableFormData || []
if (stepTableFormData.length === 0) {
//
@ -213,12 +224,13 @@ export default {
this.$message.warning('前序表单中没有细胞编号数据')
return
}
console.log('选择仪器编号预留=2==',stepTableFormData)
//
const itemData = stepTableFormData.map(item => ({
xbbh: item.jlzb || '', //
xbbh: item.jzlybh || '', //
}))
// 使 $set formData CustomTable
console.log('选择仪器编号预留=3==',itemData)
this.$set(this.formData, 'stepTableFormData', itemData)
this.$message.success(`已从前序表单加载 ${itemData.length} 条细胞编号数据`)
@ -249,19 +261,14 @@ export default {
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || []
//
this.resourceTmp = stepResource.sjResource || []
const tableFromHyqk = tableList
this.resourceTmp = tableList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk]
return this.resourceTmp;
},
//

Loading…
Cancel
Save