luojie 1 month ago
parent
commit
6f8cc5a5d5
6 changed files with 134 additions and 105 deletions
  1. +26
    -21
      src/views/business/comps/template/comps/dl/DL008.vue
  2. +29
    -43
      src/views/business/comps/template/comps/dl/DL009.vue
  3. +16
    -8
      src/views/business/comps/template/comps/dl/DL010.vue
  4. +44
    -33
      src/views/business/comps/template/comps/dl/DL012.vue
  5. +11
    -0
      src/views/business/comps/template/comps/dl/DL014.vue
  6. +8
    -0
      src/views/business/comps/template/comps/dl/DL015.vue

+ 26
- 21
src/views/business/comps/template/comps/dl/DL008.vue View File

@ -47,18 +47,20 @@
@onRegentSubmit="onRegentSubmit" @onRegentSubmit="onRegentSubmit"
> >
</BaseInfoFormPackage> </BaseInfoFormPackage>
<CustomTable
:columns="cxqkColumns"
:ref="refConf.cxqk"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="cxqkFormData"
:prefixKey="`cxqkTable`"
:isBorder="true"
:showSort="false"
>
</CustomTable>
<template v-if="dynamicCxqkColumns.length > 0">
<CustomTable
:columns="cxqkColumns"
:ref="refConf.cxqk"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="cxqkFormData"
:prefixKey="`cxqkTable`"
:isBorder="true"
:showSort="false"
>
</CustomTable>
</template>
<BaseInfoFormPackage <BaseInfoFormPackage
:ref="refConf.cxqkwrqk" :ref="refConf.cxqkwrqk"
:formConfig="cxqkwrqkConfig" :formConfig="cxqkwrqkConfig"
@ -151,11 +153,10 @@ export default {
// '' // ''
label: 'template.dl.dl008.wrqk', label: 'template.dl.dl008.wrqk',
type: 'select', type: 'select',
span: 1,
options: this.getDictOptions('business_dl_ameswrqk'), options: this.getDictOptions('business_dl_ameswrqk'),
fillType: 'actFill', fillType: 'actFill',
otherCode: 'cxqkwrqkOther', otherCode: 'cxqkwrqkOther',
otherMaxlength:200,
otherMaxlength: 200,
showOtherLabel: false showOtherLabel: false
} }
} }
@ -351,9 +352,10 @@ export default {
rowIndex++ rowIndex++
} }
// 使
const headerLabel =
headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
// "123"
const headerLabel = headerValues.length > 1
? `${headerValues[0]}${headerValues.slice(1).join('')}`
: headerValues[0] || `菌种${colIndex}`
dynamicColumns.push({ dynamicColumns.push({
label: headerLabel, label: headerLabel,
@ -538,7 +540,9 @@ export default {
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
disabled: true, disabled: true,
width: 100
width: 180,
showWidth: 90,
} }
] ]
@ -554,8 +558,10 @@ export default {
rowIndex++ rowIndex++
} }
//
const headerLabel = headerValues.join(' ')
// "123"
const headerLabel = headerValues.length > 1
? `${headerValues[0]}${headerValues.slice(1).join('')}`
: headerValues[0] || `菌种${colIndex}`
columns.push({ columns.push({
label: headerLabel, label: headerLabel,
@ -563,7 +569,6 @@ export default {
bodyType: 'checkbox', bodyType: 'checkbox',
bodyFillType: 'actFill', bodyFillType: 'actFill',
checkboxLabel: '', checkboxLabel: '',
width: 150
}) })
}) })

+ 29
- 43
src/views/business/comps/template/comps/dl/DL009.vue View File

@ -57,6 +57,7 @@
<p>{{ $t('template.dl.dl009.jlsDesc') }}</p> <p>{{ $t('template.dl.dl009.jlsDesc') }}</p>
</div> </div>
<CustomTable <CustomTable
v-if="dynamicJgxxColumns.length > 0"
:columns="jgxxColumns" :columns="jgxxColumns"
:ref="refConf.jgxx" :ref="refConf.jgxx"
:showOperation="false" :showOperation="false"
@ -579,53 +580,22 @@ export default {
// //
if (key === 'jgxxQxbd') { if (key === 'jgxxQxbd') {
// 使
const currentYqsyData = this.formData.stepTableFormData
? JSON.parse(JSON.stringify(this.formData.stepTableFormData))
: []
const currentHeaderFields = this.formData.headerSelectFields
? JSON.parse(JSON.stringify(this.formData.headerSelectFields))
: {}
// 使 $nextTick tick
this.$nextTick(() => {
this.handleJgxxQxbdSelect(row)
// ref使formData
const yqsyTableRef = this.$refs[refConf.yqsy]
const savedYqsyData = JSON.parse(JSON.stringify(yqsyTableRef?.getDataSource() || []))
console.log('[DL009] 选择前序表单前,保存仪器数据:', savedYqsyData.length, '条')
// 使 $nextTick handleJgxxQxbdSelect
this.$nextTick(() => {
if (
currentYqsyData.length > 0 &&
(!this.formData.stepTableFormData ||
this.formData.stepTableFormData.length === 0)
) {
this.$set(this.formData, 'stepTableFormData', currentYqsyData)
//
const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) {
yqsyTableRef.updateDataSource(currentYqsyData)
}
}
// formDatawatch
if (savedYqsyData.length > 0) {
this.$set(this.formData, 'stepTableFormData', savedYqsyData)
}
//
if (
Object.keys(currentHeaderFields).length > 0 &&
(!this.formData.headerSelectFields ||
Object.keys(this.formData.headerSelectFields).length === 0)
) {
this.$set(
this.formData,
'headerSelectFields',
currentHeaderFields
)
}
})
})
this.handleJgxxQxbdSelect(row, savedYqsyData)
} }
}, },
// //
handleJgxxQxbdSelect(row) {
handleJgxxQxbdSelect(row, savedYqsyData) {
// //
this.isDataLoaded = false this.isDataLoaded = false
@ -664,7 +634,7 @@ export default {
} }
// 3. // 3.
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields)
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields, savedYqsyData)
} catch (error) { } catch (error) {
console.error('解析前序表单数据失败:', error) console.error('解析前序表单数据失败:', error)
this.clearJgxxTable() this.clearJgxxTable()
@ -775,7 +745,7 @@ export default {
}, },
// //
updateJgxxTable(columns, tableData, headerFields) {
updateJgxxTable(columns, tableData, headerFields, savedYqsyData) {
// //
this.dynamicJgxxColumns = columns this.dynamicJgxxColumns = columns
@ -804,6 +774,22 @@ export default {
this.$set(this.formData, 'stepTableFormData_1', tableData) this.$set(this.formData, 'stepTableFormData_1', tableData)
this.isDataLoaded = true this.isDataLoaded = true
// 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const currentData = yqsyTableRef?.getDataSource() || []
console.log('[DL009] updateJgxxTable $nextTick - 当前仪器数据:', currentData.length, '条')
console.log('[DL009] updateJgxxTable $nextTick - 保存的仪器数据:', savedYqsyData?.length, '条')
if (savedYqsyData && savedYqsyData.length > 0 && currentData.length === 0) {
console.log('[DL009] 恢复仪器数据')
// formData
this.$set(this.formData, 'stepTableFormData', savedYqsyData)
this.$nextTick(() => {
yqsyTableRef?.updateDataSource(savedYqsyData)
console.log('[DL009] 恢复后仪器数据:', yqsyTableRef?.getDataSource()?.length, '条')
})
}
}) })
}, },

+ 16
- 8
src/views/business/comps/template/comps/dl/DL010.vue View File

@ -67,8 +67,8 @@
></TableOpertaionDelete> ></TableOpertaionDelete>
</template> </template>
</CustomTable> </CustomTable>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
</div> </div>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
<BaseInfoFormPackage <BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz" fieldItemLabel="template.dl.dl007.bz"
@ -242,7 +242,8 @@ export default {
prop: 'dwbh', prop: 'dwbh',
bodyType: 'input', bodyType: 'input',
bodyMaxlength: 50, bodyMaxlength: 50,
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 180
}, },
{ {
label: 'template.dl.dl010.yslhnzsjyjrl', label: 'template.dl.dl010.yslhnzsjyjrl',
@ -253,7 +254,8 @@ export default {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyMaxlength: 10, bodyMaxlength: 10,
fillType: 'preFill', fillType: 'preFill',
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 260
}, },
{ {
label: 'template.dl.dl010.sjlhnzsjyjrl', label: 'template.dl.dl010.sjlhnzsjyjrl',
@ -265,7 +267,8 @@ export default {
copyFrom: 'yslhnzsjyjrl', copyFrom: 'yslhnzsjyjrl',
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
fillType: 'preFill'
fillType: 'preFill',
width: 260
}, },
{ {
label: 'template.dl.dl010.sjgs', label: 'template.dl.dl010.sjgs',
@ -273,6 +276,7 @@ export default {
bodyType: 'checkbox', bodyType: 'checkbox',
checkboxLabel: '', checkboxLabel: '',
bodyFillType: 'actFill', bodyFillType: 'actFill',
span: 3,
headerColumns: [ headerColumns: [
{ type: 'span', label: 'template.dl.dl010.sj' }, { type: 'span', label: 'template.dl.dl010.sj' },
{ {
@ -282,14 +286,16 @@ export default {
key: 'gs' key: 'gs'
}, },
{ type: 'span', label: 'template.dl.dl010.gusui' } { type: 'span', label: 'template.dl.dl010.gusui' }
]
],
width: 260
}, },
{ {
label: 'template.dl.dl010.lx', label: 'template.dl.dl010.lx',
prop: 'lx', prop: 'lx',
bodyType: 'checkbox', bodyType: 'checkbox',
checkboxLabel: '', checkboxLabel: '',
bodyFillType: 'actFill'
bodyFillType: 'actFill',
width: 100
}, },
{ {
label: 'template.dl.dl010.ysjrxq', label: 'template.dl.dl010.ysjrxq',
@ -300,7 +306,8 @@ export default {
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'ysjrxqUnit', headerSelectKey: 'ysjrxqUnit',
headerSelectTo: 'sjjrxqUnit', headerSelectTo: 'sjjrxqUnit',
headerOptions: this.getDictOptions('business_tjdw')
headerOptions: this.getDictOptions('business_tjdw'),
width: 180
}, },
{ {
label: 'template.dl.dl010.sjjrxq', label: 'template.dl.dl010.sjjrxq',
@ -312,7 +319,8 @@ export default {
compareTo: 'ysjrxq', compareTo: 'ysjrxq',
copyFrom: 'ysjrxq', copyFrom: 'ysjrxq',
headerSelectKey: 'sjjrxqUnit', headerSelectKey: 'sjjrxqUnit',
headerOptions: this.getDictOptions('business_tjdw')
headerOptions: this.getDictOptions('business_tjdw'),
width: 180
} }
] ]
} }

+ 44
- 33
src/views/business/comps/template/comps/dl/DL012.vue View File

@ -202,7 +202,7 @@ export default {
} }
] ]
}, },
//
// - formData zbhxbbh_
xbxxConfig() { xbxxConfig() {
const config = { const config = {
xbmc: { xbmc: {
@ -223,8 +223,19 @@ export default {
fillType: 'preFill' fillType: 'preFill'
} }
} }
for (let index = 1; index <= this.zbxbs; index++) {
config['zbhxbbh_' + index] = {
// formData zbhxbbh_
const zbhxbbhKeys = Object.keys(this.formData)
.filter(key => /^zbhxbbh_\d+$/.test(key))
.sort((a, b) => {
return parseInt(a.split('_')[1]) - parseInt(b.split('_')[1])
})
// zbhxbbh_1preFill
if (zbhxbbhKeys.length === 0) {
zbhxbbhKeys.push('zbhxbbh_1')
}
zbhxbbhKeys.forEach(key => {
const index = key.split('_')[1]
config[key] = {
label: 'template.dl.dl012.zbhxbbh', label: 'template.dl.dl012.zbhxbbh',
type: 'input', type: 'input',
subType: 'span', subType: 'span',
@ -232,20 +243,12 @@ export default {
subKey: 'zbhxbbhCodeSn_' + index, subKey: 'zbhxbbhCodeSn_' + index,
fillType: 'preFill' fillType: 'preFill'
} }
}
})
return [ return [
{ {
type: 'step', type: 'step',
config: { config: {
...config, ...config,
// zbhxbbh: {
// label: 'template.dl.dl012.zbhxbbh',
// type: 'input',
// subType: 'span',
// maxlength: 20,
// subKey: 'zbhxbbhCodeSn',
// fillType: 'preFill'
// },
zbhxbyjtj: { zbhxbyjtj: {
label: 'template.dl.dl012.zbhxbyjtj', label: 'template.dl.dl012.zbhxbyjtj',
type: 'inputNumber', type: 'inputNumber',
@ -254,7 +257,7 @@ export default {
fillType: 'preFill', fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'), subOptions: this.getDictOptions('business_nddw'),
maxlength: 10, maxlength: 10,
selectTo: 'zbhxbsjtjUnit' //
selectTo: 'zbhxbsjtjUnit'
}, },
zbhxbsjtj: { zbhxbsjtj: {
label: 'template.dl.dl012.zbhxbsjtj', label: 'template.dl.dl012.zbhxbsjtj',
@ -290,41 +293,49 @@ export default {
}) })
} }
//
const data = this.getFilledFormDataByRefs([refConf.xbxx])
const { zbxbs, zbhxbbh_1 } = data || {}
if (!zbxbs) return
try {
this.zbxbs = Number(zbxbs)
} catch (error) {
this.zbxbs = 1
}
if (this.fillType !== 'actFill') return
this.$nextTick(() => {
// actFill zbxbs zbhxbbh_1/2/3... formData
if (this.fillType === 'actFill') {
const data = this.getFilledFormDataByRefs([refConf.xbxx])
const { zbxbs, zbhxbbh_1 } = data || {}
if (!zbxbs) return
let count = 1
try {
count = Number(zbxbs)
} catch (error) {
count = 1
}
// this.formData xbxxConfig computed
const updateData = {} const updateData = {}
// 使
const formattedDate = moment().format('YYMMDD') const formattedDate = moment().format('YYMMDD')
for (let index = 1; index <= this.zbxbs; index++) {
for (let index = 1; index <= count; index++) {
const zbhxbbhKey = 'zbhxbbh_' + index const zbhxbbhKey = 'zbhxbbh_' + index
const codeSnKey = 'zbhxbbhCodeSn_' + index const codeSnKey = 'zbhxbbhCodeSn_' + index
//
if (!data[zbhxbbhKey]) { if (!data[zbhxbbhKey]) {
this.$set(this.formData, zbhxbbhKey, zbhxbbh_1)
updateData[zbhxbbhKey] = zbhxbbh_1 updateData[zbhxbbhKey] = zbhxbbh_1
} }
if (!data[codeSnKey]) { if (!data[codeSnKey]) {
updateData[codeSnKey] =
formattedDate + '-' + `${index}`.padStart(4, '0')
const codeSnVal = formattedDate + '-' + `${index}`.padStart(4, '0')
this.$set(this.formData, codeSnKey, codeSnVal)
updateData[codeSnKey] = codeSnVal
} }
} }
this.$refs[refConf.xbxx].batchUpdateFormData(updateData)
})
// formFields
if (Object.keys(updateData).length > 0) {
this.$nextTick(() => {
this.$refs[refConf.xbxx].batchUpdateFormData(updateData)
})
}
}
}, },
data() { data() {
return { return {
formData: {}, formData: {},
refConf,
zbxbs: 1
refConf
} }
}, },
methods: { methods: {

+ 11
- 0
src/views/business/comps/template/comps/dl/DL014.vue View File

@ -404,12 +404,14 @@ export default {
label: 'template.dl.dl014.jlzb', label: 'template.dl.dl014.jlzb',
prop: 'jlzb', prop: 'jlzb',
bodyType: 'input', bodyType: 'input',
width: 180,
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10 bodyMaxlength: 10
}, },
{ {
label: 'template.dl.dl014.xybh', label: 'template.dl.dl014.xybh',
prop: 'xybh', prop: 'xybh',
width: 180,
bodyType: 'sj', bodyType: 'sj',
bodyFillType: 'actFill' bodyFillType: 'actFill'
}, },
@ -417,6 +419,7 @@ export default {
label: 'template.dl.dl014.gysqgc', label: 'template.dl.dl014.gysqgc',
prop: 'gysqgc', prop: 'gysqgc',
bodyType: 'select', bodyType: 'select',
width: 180,
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyOptions: [ bodyOptions: [
{ label: '良好', value: '良好' }, { label: '良好', value: '良好' },
@ -432,6 +435,7 @@ export default {
bodyMaxlength: 10, bodyMaxlength: 10,
headerSelectKey: 'ysplyjrlUnit', headerSelectKey: 'ysplyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill' fillType: 'preFill'
}, },
{ {
@ -444,6 +448,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysplyjrl', copyFrom: 'ysplyjrl',
compareTo: 'ysplyjrl', compareTo: 'ysplyjrl',
width: 180,
fillType: 'preFill' fillType: 'preFill'
} }
] ]
@ -459,6 +464,7 @@ export default {
bodyMaxlength: 10, bodyMaxlength: 10,
headerSelectKey: 'yss9hhyjrlUnit', headerSelectKey: 'yss9hhyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill' fillType: 'preFill'
}, },
{ {
@ -471,6 +477,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'yss9hhyjrl', copyFrom: 'yss9hhyjrl',
compareTo: 'yss9hhyjrl', compareTo: 'yss9hhyjrl',
width: 180,
fillType: 'preFill' fillType: 'preFill'
} }
) )
@ -486,6 +493,7 @@ export default {
bodyMaxlength: 20, bodyMaxlength: 20,
bodySubType: 'gyzj', bodySubType: 'gyzj',
bodySubKey: 'gyzjbh', bodySubKey: 'gyzjbh',
width: 240,
bodySubFillType: 'actFill' bodySubFillType: 'actFill'
}, },
{ {
@ -496,6 +504,7 @@ export default {
bodyMaxlength: 10, bodyMaxlength: 10,
headerSelectKey: 'ysgspjrlUnit', headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill' fillType: 'preFill'
}, },
{ {
@ -507,6 +516,7 @@ export default {
headerSelectKey: 'ysgspjrlUnit', headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'), headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysgspjrl', copyFrom: 'ysgspjrl',
width: 180,
compareTo: 'ysgspjrl', compareTo: 'ysgspjrl',
fillType: 'preFill' fillType: 'preFill'
}, },
@ -515,6 +525,7 @@ export default {
prop: 'gyhzqk', prop: 'gyhzqk',
bodyType: 'select', bodyType: 'select',
bodyFillType: 'actFill', bodyFillType: 'actFill',
width: 180,
bodyOptions: [ bodyOptions: [
{ label: '严重', value: '严重' }, { label: '严重', value: '严重' },
{ label: '中等', value: '中等' }, { label: '中等', value: '中等' },

+ 8
- 0
src/views/business/comps/template/comps/dl/DL015.vue View File

@ -218,6 +218,7 @@ export default {
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
width: 180,
disabled: true disabled: true
}, },
{ {
@ -226,12 +227,14 @@ export default {
bodyType: 'input', bodyType: 'input',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyDisabled: true, bodyDisabled: true,
width: 180,
disabled: true disabled: true
}, },
{ {
label: 'template.dl.dl015.hyqszqk', label: 'template.dl.dl015.hyqszqk',
prop: 'hyqszqk', prop: 'hyqszqk',
bodyType: 'select', bodyType: 'select',
width: 180,
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyOptions: [ bodyOptions: [
{ label: '良好', value: '良好' }, { label: '良好', value: '良好' },
@ -243,6 +246,7 @@ export default {
label: 'template.dl.dl015.hyqcdjqk', label: 'template.dl.dl015.hyqcdjqk',
prop: 'hyqcdjqk', prop: 'hyqcdjqk',
bodyType: 'select', bodyType: 'select',
width: 180,
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyOptions: [ bodyOptions: [
{ label: '严重', value: '严重' }, { label: '严重', value: '严重' },
@ -255,6 +259,7 @@ export default {
label: 'template.dl.dl015.hyqqtqk', label: 'template.dl.dl015.hyqqtqk',
prop: 'hyqqtqk', prop: 'hyqqtqk',
bodyType: 'select', bodyType: 'select',
width: 180,
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyOptions: [ bodyOptions: [
{ label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' }, { label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' },
@ -264,6 +269,7 @@ export default {
{ {
label: 'template.dl.dl015.qqpyy', label: 'template.dl.dl015.qqpyy',
prop: 'qqpyy', prop: 'qqpyy',
width: 100,
bodyType: 'checkbox', bodyType: 'checkbox',
bodyFillType: 'actFill', bodyFillType: 'actFill',
checkboxLabel: '' checkboxLabel: ''
@ -271,12 +277,14 @@ export default {
{ {
label: 'template.dl.dl015.pbsxd', label: 'template.dl.dl015.pbsxd',
prop: 'pbsxd', prop: 'pbsxd',
width: 100,
bodyType: 'checkbox', bodyType: 'checkbox',
bodyFillType: 'actFill', bodyFillType: 'actFill',
checkboxLabel: '' checkboxLabel: ''
}, },
{ {
label: 'template.dl.dl015.pyybrl', label: 'template.dl.dl015.pyybrl',
width: 180,
prop: 'pyybrl', prop: 'pyybrl',
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',

Loading…
Cancel
Save