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"
>
</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
:ref="refConf.cxqkwrqk"
:formConfig="cxqkwrqkConfig"
@ -151,11 +153,10 @@ export default {
// ''
label: 'template.dl.dl008.wrqk',
type: 'select',
span: 1,
options: this.getDictOptions('business_dl_ameswrqk'),
fillType: 'actFill',
otherCode: 'cxqkwrqkOther',
otherMaxlength:200,
otherMaxlength: 200,
showOtherLabel: false
}
}
@ -351,9 +352,10 @@ export default {
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({
label: headerLabel,
@ -538,7 +540,9 @@ export default {
bodyFillType: 'actFill',
bodyDisabled: true,
disabled: true,
width: 100
width: 180,
showWidth: 90,
}
]
@ -554,8 +558,10 @@ export default {
rowIndex++
}
//
const headerLabel = headerValues.join(' ')
// "123"
const headerLabel = headerValues.length > 1
? `${headerValues[0]}${headerValues.slice(1).join('')}`
: headerValues[0] || `菌种${colIndex}`
columns.push({
label: headerLabel,
@ -563,7 +569,6 @@ export default {
bodyType: 'checkbox',
bodyFillType: 'actFill',
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>
</div>
<CustomTable
v-if="dynamicJgxxColumns.length > 0"
:columns="jgxxColumns"
:ref="refConf.jgxx"
:showOperation="false"
@ -579,53 +580,22 @@ export default {
//
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
@ -664,7 +634,7 @@ export default {
}
// 3.
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields)
this.updateJgxxTable(dynamicColumns.columns, tableData, headerFields, savedYqsyData)
} catch (error) {
console.error('解析前序表单数据失败:', error)
this.clearJgxxTable()
@ -775,7 +745,7 @@ export default {
},
//
updateJgxxTable(columns, tableData, headerFields) {
updateJgxxTable(columns, tableData, headerFields, savedYqsyData) {
//
this.dynamicJgxxColumns = columns
@ -804,6 +774,22 @@ export default {
this.$set(this.formData, 'stepTableFormData_1', tableData)
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>
</template>
</CustomTable>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
</div>
<Step :ref="refConf.sjxxStep" :formData="formData.stepData" />
<BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz"
@ -242,7 +242,8 @@ export default {
prop: 'dwbh',
bodyType: 'input',
bodyMaxlength: 50,
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 180
},
{
label: 'template.dl.dl010.yslhnzsjyjrl',
@ -253,7 +254,8 @@ export default {
bodyType: 'inputNumber',
bodyMaxlength: 10,
fillType: 'preFill',
bodyFillType: 'preFill'
bodyFillType: 'preFill',
width: 260
},
{
label: 'template.dl.dl010.sjlhnzsjyjrl',
@ -265,7 +267,8 @@ export default {
copyFrom: 'yslhnzsjyjrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
fillType: 'preFill'
fillType: 'preFill',
width: 260
},
{
label: 'template.dl.dl010.sjgs',
@ -273,6 +276,7 @@ export default {
bodyType: 'checkbox',
checkboxLabel: '',
bodyFillType: 'actFill',
span: 3,
headerColumns: [
{ type: 'span', label: 'template.dl.dl010.sj' },
{
@ -282,14 +286,16 @@ export default {
key: 'gs'
},
{ type: 'span', label: 'template.dl.dl010.gusui' }
]
],
width: 260
},
{
label: 'template.dl.dl010.lx',
prop: 'lx',
bodyType: 'checkbox',
checkboxLabel: '',
bodyFillType: 'actFill'
bodyFillType: 'actFill',
width: 100
},
{
label: 'template.dl.dl010.ysjrxq',
@ -300,7 +306,8 @@ export default {
fillType: 'preFill',
headerSelectKey: 'ysjrxqUnit',
headerSelectTo: 'sjjrxqUnit',
headerOptions: this.getDictOptions('business_tjdw')
headerOptions: this.getDictOptions('business_tjdw'),
width: 180
},
{
label: 'template.dl.dl010.sjjrxq',
@ -312,7 +319,8 @@ export default {
compareTo: 'ysjrxq',
copyFrom: 'ysjrxq',
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() {
const config = {
xbmc: {
@ -223,8 +223,19 @@ export default {
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',
type: 'input',
subType: 'span',
@ -232,20 +243,12 @@ export default {
subKey: 'zbhxbbhCodeSn_' + index,
fillType: 'preFill'
}
}
})
return [
{
type: 'step',
config: {
...config,
// zbhxbbh: {
// label: 'template.dl.dl012.zbhxbbh',
// type: 'input',
// subType: 'span',
// maxlength: 20,
// subKey: 'zbhxbbhCodeSn',
// fillType: 'preFill'
// },
zbhxbyjtj: {
label: 'template.dl.dl012.zbhxbyjtj',
type: 'inputNumber',
@ -254,7 +257,7 @@ export default {
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
maxlength: 10,
selectTo: 'zbhxbsjtjUnit' //
selectTo: 'zbhxbsjtjUnit'
},
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 formattedDate = moment().format('YYMMDD')
for (let index = 1; index <= this.zbxbs; index++) {
for (let index = 1; index <= count; index++) {
const zbhxbbhKey = 'zbhxbbh_' + index
const codeSnKey = 'zbhxbbhCodeSn_' + index
//
if (!data[zbhxbbhKey]) {
this.$set(this.formData, zbhxbbhKey, zbhxbbh_1)
updateData[zbhxbbhKey] = zbhxbbh_1
}
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() {
return {
formData: {},
refConf,
zbxbs: 1
refConf
}
},
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',
prop: 'jlzb',
bodyType: 'input',
width: 180,
bodyFillType: 'preFill',
bodyMaxlength: 10
},
{
label: 'template.dl.dl014.xybh',
prop: 'xybh',
width: 180,
bodyType: 'sj',
bodyFillType: 'actFill'
},
@ -417,6 +419,7 @@ export default {
label: 'template.dl.dl014.gysqgc',
prop: 'gysqgc',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '良好', value: '良好' },
@ -432,6 +435,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'ysplyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -444,6 +448,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysplyjrl',
compareTo: 'ysplyjrl',
width: 180,
fillType: 'preFill'
}
]
@ -459,6 +464,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'yss9hhyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -471,6 +477,7 @@ export default {
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'yss9hhyjrl',
compareTo: 'yss9hhyjrl',
width: 180,
fillType: 'preFill'
}
)
@ -486,6 +493,7 @@ export default {
bodyMaxlength: 20,
bodySubType: 'gyzj',
bodySubKey: 'gyzjbh',
width: 240,
bodySubFillType: 'actFill'
},
{
@ -496,6 +504,7 @@ export default {
bodyMaxlength: 10,
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
width: 180,
fillType: 'preFill'
},
{
@ -507,6 +516,7 @@ export default {
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
copyFrom: 'ysgspjrl',
width: 180,
compareTo: 'ysgspjrl',
fillType: 'preFill'
},
@ -515,6 +525,7 @@ export default {
prop: 'gyhzqk',
bodyType: 'select',
bodyFillType: 'actFill',
width: 180,
bodyOptions: [
{ 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',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 180,
disabled: true
},
{
@ -226,12 +227,14 @@ export default {
bodyType: 'input',
bodyFillType: 'actFill',
bodyDisabled: true,
width: 180,
disabled: true
},
{
label: 'template.dl.dl015.hyqszqk',
prop: 'hyqszqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '良好', value: '良好' },
@ -243,6 +246,7 @@ export default {
label: 'template.dl.dl015.hyqcdjqk',
prop: 'hyqcdjqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '严重', value: '严重' },
@ -255,6 +259,7 @@ export default {
label: 'template.dl.dl015.hyqqtqk',
prop: 'hyqqtqk',
bodyType: 'select',
width: 180,
bodyFillType: 'actFill',
bodyOptions: [
{ label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' },
@ -264,6 +269,7 @@ export default {
{
label: 'template.dl.dl015.qqpyy',
prop: 'qqpyy',
width: 100,
bodyType: 'checkbox',
bodyFillType: 'actFill',
checkboxLabel: ''
@ -271,12 +277,14 @@ export default {
{
label: 'template.dl.dl015.pbsxd',
prop: 'pbsxd',
width: 100,
bodyType: 'checkbox',
bodyFillType: 'actFill',
checkboxLabel: ''
},
{
label: 'template.dl.dl015.pyybrl',
width: 180,
prop: 'pyybrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',

Loading…
Cancel
Save