Browse Source

fix:[模板管理][DL007~DL009核对]

ouqian
欧骞 1 month ago
parent
commit
2cc706b6e7
6 changed files with 156 additions and 107 deletions
  1. +10
    -7
      src/lang/en/template/dl.js
  2. +8
    -8
      src/lang/zh/template/dl.js
  3. +3
    -2
      src/views/business/comps/template/comps/dl/DL007.vue
  4. +57
    -44
      src/views/business/comps/template/comps/dl/DL008.vue
  5. +71
    -41
      src/views/business/comps/template/comps/dl/DL009.vue
  6. +7
    -5
      src/views/business/comps/template/comps/dl/DL010.vue

+ 10
- 7
src/lang/en/template/dl.js View File

@ -78,7 +78,7 @@ export default {
pykssj: 'Cultivation Start Time',
pyjssj: 'Cultivation End Time',
jsButton: 'End',
yqsyxxEmpty: 'Please add instrument usage information first'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
},
dl008: {
...common,
@ -89,8 +89,8 @@ export default {
jzbh2: 'Strain Number',
jzbh3: 'Strain Number',
jzbh4: 'Strain Number',
yqsyxxEmpty: 'Instrument usage information cannot be empty',
cxqkEmpty: 'Imaging status cannot be empty'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
cxqkEmpty: 'Imaging status has not been filled in, please fill in before submitting'
},
dl009: {
...common,
@ -107,8 +107,8 @@ export default {
czqkDesc: 'Precipitation codes: "P-" = "None"; "P+" = "Slight"; "P++" = "Moderate"; "P+++" = "Severe".',
bjjtDesc: 'Background lawn codes: "N" = "Normal"; "R1" = "Weak, lawn covers 70%-90% of plate area"; "R2" = "Medium, lawn covers 40%-70% of plate area"; "R3" = "Strong, lawn covers 10%-40% of plate area"; "A" = "Absent, no lawn on plate"; "O" = "Precipitation present, affecting lawn assessment";',
jlsDesc: 'Colony count special case: "*" indicates pinpoint colonies visible on plate;',
yqsyxxEmpty: 'Instrument usage information cannot be empty',
jgxxEmpty: 'Result information cannot be empty'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
jgxxEmpty: 'Result information has not been filled in, please fill in before submitting'
},
dl010: {
...common,
@ -194,7 +194,9 @@ export default {
zxg: 'Lower Left Grid (cells)',
yxg: 'Lower Right Grid (cells)',
cdxxTime: 'Time {index}',
addCdxx: 'Add'
addCdxx: 'Add',
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting',
cdxxEmpty: 'Measurement information has not been filled in, please fill in before submitting'
},
dl014: {
...common,
@ -221,7 +223,8 @@ export default {
sjgspjrl: 'Actual Test Article Volume',
gyhzqk: 'Post-dose Status',
qrButton: 'Confirm',
wcButton: 'Complete'
wcButton: 'Complete',
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
},
dl015: {
...common,

+ 8
- 8
src/lang/zh/template/dl.js View File

@ -81,7 +81,7 @@ export default {
pykssj: '培养开始时间',
pyjssj: '培养结束时间',
jsButton: '结束',
yqsyxxEmpty: '请先添加仪器使用信息'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交'
},
dl008: {
...common,
@ -92,8 +92,8 @@ export default {
jzbh2: '菌种编号',
jzbh3: '菌种编号',
jzbh4: '菌种编号',
yqsyxxEmpty: '仪器使用信息不能为空',
cxqkEmpty: '成像情况不能为空'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
cxqkEmpty: '成像情况还未填写,请填写后再提交'
},
dl009: {
...common,
@ -110,8 +110,8 @@ export default {
czqkDesc: '沉淀量以代码填入:"P-" 代表 "无沉淀";"P+" 代表 "少量";"P++" 代表 "中等";"P+++" 代表 "严重"。',
bjjtDesc: '背景菌苔以代码填入:"N" 代表 "正常";"R1" 代表 "弱,菌苔约占平皿面积 70%-90%";"R2" 代表 "中,菌苔约占平皿面积 40%-70%";"R3" 代表 "强,菌苔约占平皿面积 10%-40%";"A" 代表 "消失,平皿上无菌苔";"O" 代表 "产生沉淀,影响背景菌苔判断";',
jlsDesc: '菌落数特殊情况:"*" 该平皿可见针尖样菌落;',
yqsyxxEmpty: '仪器使用信息不能为空',
jgxxEmpty: '结果信息不能为空'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
jgxxEmpty: '结果信息还未填写,请填写后再提交'
},
dl010: {
...common,
@ -198,8 +198,8 @@ export default {
yxg: '右下格(个)',
cdxxTime: '第{index}次',
addCdxx: '新增',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交',
cdxxEmpty: '测定信息不能为空,请添加后再提交'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交',
cdxxEmpty: '测定信息还未填写,请填写后再提交'
},
dl014: {
...common,
@ -227,7 +227,7 @@ export default {
gyhzqk: '给药后状态情况',
qrButton: '确认',
wcButton: '完成',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交'
yqsyxxEmpty: '仪器使用信息还未填写,请填写后再提交'
},
dl015: {
...common,

+ 3
- 2
src/views/business/comps/template/comps/dl/DL007.vue View File

@ -142,7 +142,8 @@ export default {
type: 'select',
options: this.getDictOptions('business_sydd'),
fillType: 'actFill',
otherCode: 'syddOther'
otherCode: 'syddOther',
otherMaxlength: 50
}
}
},
@ -220,10 +221,10 @@ export default {
disabled: true
},
pyjssj: {
// TODOinputdateTime
label: 'template.dl.dl007.pyjssj',
type: 'input',
fillType: 'actFill',
maxlength: 200,
subType: 'button',
subKey: 'pyjssjButton',
buttonName: 'template.dl.dl007.jsButton'

+ 57
- 44
src/views/business/comps/template/comps/dl/DL008.vue View File

@ -155,6 +155,7 @@ export default {
options: this.getDictOptions('business_dl_ameswrqk'),
fillType: 'actFill',
otherCode: 'cxqkwrqkOther',
otherMaxlength:200,
showOtherLabel: false
}
}
@ -307,14 +308,20 @@ export default {
const headerSelectFields = this.formData.headerSelectFields || {}
//
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return
}
// jzbh Label
const firstRow = stepTableFormData_1[0]
const labelKeys = Object.keys(firstRow).filter(key => key.match(/^jzbh\d+Label$/))
const labelKeys = Object.keys(firstRow).filter((key) =>
key.match(/^jzbh\d+Label$/)
)
if (labelKeys.length === 0) {
return
}
@ -335,7 +342,7 @@ export default {
// headerSelectFields
labelKeys.sort().forEach((labelKey, index) => {
const colIndex = index + 1
// headerSelectFields 1_1, 1_2, 1_3
const headerValues = []
let rowIndex = 1
@ -343,10 +350,11 @@ export default {
headerValues.push(headerSelectFields[`${colIndex}_${rowIndex}`])
rowIndex++
}
// 使
const headerLabel = headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
const headerLabel =
headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
dynamicColumns.push({
label: headerLabel,
prop: `jzbh${colIndex}`,
@ -382,19 +390,19 @@ export default {
//
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
//
const cxqkTableRef = this.$refs[refConf.cxqk]
if (cxqkTableRef) {
const cxqkData = cxqkTableRef.getFilledFormData()
baseData.stepTableFormData_1 = cxqkData.stepTableFormData || []
}
// headerSelectFields
if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields
}
return baseData
},
//
@ -404,24 +412,25 @@ export default {
},
//
async validFields() {
// 1. 使 actFill
// actFill
if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl008.yqsyxxEmpty'))
}
}
// 2.
const cxqkTableRef = this.$refs[refConf.cxqk]
const cxqkTableData = cxqkTableRef?.getDataSource() || []
if (cxqkTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.cxqkEmpty'))
return Promise.reject(this.$t('template.dl.dl008.cxqkEmpty'))
// 2.
const cxqkTableRef = this.$refs[refConf.cxqk]
const cxqkTableData = cxqkTableRef?.getDataSource() || []
if (cxqkTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.cxqkEmpty'))
return Promise.reject(this.$t('template.dl.dl008.cxqkEmpty'))
}
}
// 3.
@ -457,7 +466,7 @@ export default {
this.handleCxqkQxbdSelect(row)
}
},
//
handleYqbhSelect(row, rowIndex) {
const params = {
@ -467,15 +476,15 @@ export default {
}
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
},
//
handleCxqkQxbdSelect(row) {
//
this.isDataLoaded = false
try {
const bdnr = JSON.parse(row.bdnr)
const headerFields = bdnr.headerFields || {}
const stepTableFormData_1 = bdnr.stepTableFormData_1 || []
@ -493,7 +502,10 @@ export default {
}
// 2.
const tableData = this.generateTableData(stepTableFormData_1, dynamicColumns.columnKeys)
const tableData = this.generateTableData(
stepTableFormData_1,
dynamicColumns.columnKeys
)
if (tableData.length === 0) {
this.clearCxqkTable()
return
@ -501,18 +513,17 @@ export default {
// 3.
this.updateCxqkTable(dynamicColumns.columns, tableData, headerFields)
} catch (error) {
console.error('解析前序表单数据失败:', error)
this.clearCxqkTable()
}
},
//
generateDynamicColumns(headerFields) {
// _1 key
const columnKeys = Object.keys(headerFields)
.filter(key => key.endsWith('_1'))
.filter((key) => key.endsWith('_1'))
.sort((a, b) => parseInt(a.split('_')[0]) - parseInt(b.split('_')[0]))
if (columnKeys.length === 0) {
@ -534,7 +545,7 @@ export default {
columnKeys.forEach((key, index) => {
const colIndex = index + 1
const baseColIndex = key.split('_')[0] // "1_1" -> "1"
// headerFields 1_1, 1_2, 1_3
const headerValues = []
let rowIndex = 1
@ -542,10 +553,10 @@ export default {
headerValues.push(headerFields[`${baseColIndex}_${rowIndex}`])
rowIndex++
}
//
const headerLabel = headerValues.join(' ')
columns.push({
label: headerLabel,
prop: `jzbh${colIndex}`,
@ -558,42 +569,42 @@ export default {
return { columns, columnKeys }
},
//
generateTableData(stepTableFormData_1, columnKeys) {
const tableData = []
stepTableFormData_1.forEach((item) => {
const rowData = { jlzb: item.jlzb || '' }
columnKeys.forEach((_key, index) => {
const colIndex = index + 1
const valueKey = `jzbh${colIndex}`
// DL006 label
// DL006 使 czrxm_${index}Label
const labelValue = item[`czrxm_${index}Label`] || ''
rowData[`${valueKey}Label`] = labelValue
rowData[valueKey] = '' //
})
tableData.push(rowData)
})
return tableData
},
//
updateCxqkTable(columns, tableData, headerFields) {
//
this.dynamicCxqkColumns = columns
// headerFields formData
if (!this.formData.headerSelectFields) {
this.$set(this.formData, 'headerSelectFields', {})
}
Object.keys(headerFields).forEach(key => {
Object.keys(headerFields).forEach((key) => {
this.$set(this.formData.headerSelectFields, key, headerFields[key])
})
@ -602,19 +613,21 @@ export default {
if (tableRef) {
//
tableRef.updateDataSource(tableData)
// oldLocalDataSource
//
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
this.$set(this.formData, 'stepTableFormData_1', tableData)
this.isDataLoaded = true
})
},
//
clearCxqkTable() {
this.dynamicCxqkColumns = []

+ 71
- 41
src/views/business/comps/template/comps/dl/DL009.vue View File

@ -339,20 +339,24 @@ export default {
const headerSelectFields = this.formData.headerSelectFields || {}
//
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return
}
// jzbh Label
const firstRow = stepTableFormData_1[0]
const jzbhKeys = Object.keys(firstRow)
.filter(key => key.match(/^jzbh\d+$/) && !key.endsWith('Label'))
.filter((key) => key.match(/^jzbh\d+$/) && !key.endsWith('Label'))
.sort((a, b) => {
const numA = parseInt(a.replace('jzbh', ''))
const numB = parseInt(b.replace('jzbh', ''))
return numA - numB
})
if (jzbhKeys.length === 0) {
return
}
@ -373,10 +377,11 @@ export default {
// headerSelectFields
jzbhKeys.forEach((_jzbhKey, index) => {
const colIndex = index + 1
// headerSelectFields T-A02
const jzbhLabel = headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
const jzbhLabel =
headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
//
dynamicColumns.push({
label: jzbhLabel,
@ -418,15 +423,19 @@ export default {
//
this.dynamicJgxxColumns = dynamicColumns
// headerSelectFields formData.headerSelectFields
if (!this.formData.headerSelectFields) {
this.$set(this.formData, 'headerSelectFields', {})
}
Object.keys(headerSelectFields).forEach((key) => {
this.$set(this.formData.headerSelectFields, key, headerSelectFields[key])
this.$set(
this.formData.headerSelectFields,
key,
headerSelectFields[key]
)
})
this.isDataLoaded = true
//
@ -434,11 +443,13 @@ export default {
const tableRef = this.$refs[refConf.jgxx]
if (tableRef) {
tableRef.updateDataSource(stepTableFormData_1)
// oldLocalDataSource
//
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
})
@ -450,7 +461,7 @@ export default {
initializeYqsyTableFromFormData() {
try {
const stepTableFormData = this.formData.stepTableFormData
if (!stepTableFormData || stepTableFormData.length === 0) {
return
}
@ -459,10 +470,12 @@ export default {
const tableRef = this.$refs[refConf.yqsy]
if (tableRef) {
tableRef.updateDataSource(stepTableFormData)
// oldLocalDataSource
this.$nextTick(() => {
tableRef.oldLocalDataSource = JSON.parse(JSON.stringify(tableRef.localDataSource))
tableRef.oldLocalDataSource = JSON.parse(
JSON.stringify(tableRef.localDataSource)
)
})
}
})
@ -473,7 +486,7 @@ export default {
//
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
// 使
const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) {
@ -481,7 +494,7 @@ export default {
// 使 stepTableFormData
baseData.stepTableFormData = yqsyData.stepTableFormData || []
}
//
const jgxxTableRef = this.$refs[refConf.jgxx]
if (jgxxTableRef) {
@ -489,46 +502,47 @@ export default {
// stepTableFormData_1
baseData.stepTableFormData_1 = jgxxData.stepTableFormData || []
}
// headerSelectFields
if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields
}
return baseData
},
//
async getFormData() {
//
const validResult = await this.validFields()
// headerSelectFields
if (validResult) {
return this.getFilledFormData()
}
return validResult
},
//
async validFields() {
// 1. 使 actFill
// actFill
if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.yqsyxxEmpty'))
}
}
// 2.
const jgxxTableRef = this.$refs[refConf.jgxx]
const jgxxTableData = jgxxTableRef?.getDataSource() || []
if (jgxxTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.jgxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.jgxxEmpty'))
// 2.
const jgxxTableRef = this.$refs[refConf.jgxx]
const jgxxTableData = jgxxTableRef?.getDataSource() || []
if (jgxxTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.jgxxEmpty'))
return Promise.reject(this.$t('template.dl.dl009.jgxxEmpty'))
}
}
// 3.
@ -566,28 +580,44 @@ 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)) : {}
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)
// 使 $nextTick handleJgxxQxbdSelect
this.$nextTick(() => {
if (currentYqsyData.length > 0 && (!this.formData.stepTableFormData || this.formData.stepTableFormData.length === 0)) {
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)
}
}
//
if (Object.keys(currentHeaderFields).length > 0 && (!this.formData.headerSelectFields || Object.keys(this.formData.headerSelectFields).length === 0)) {
this.$set(this.formData, 'headerSelectFields', currentHeaderFields)
if (
Object.keys(currentHeaderFields).length > 0 &&
(!this.formData.headerSelectFields ||
Object.keys(this.formData.headerSelectFields).length === 0)
) {
this.$set(
this.formData,
'headerSelectFields',
currentHeaderFields
)
}
})
})
@ -791,9 +821,9 @@ export default {
if (this.dynamicJgxxColumns.length === 0) {
return
}
// select bodyOptions
this.dynamicJgxxColumns.forEach(col => {
this.dynamicJgxxColumns.forEach((col) => {
if (col.bodyType === 'select') {
if (col.prop.startsWith('czqk')) {
col.bodyOptions = this.getDictOptions('business_dl_amescdqk')

+ 7
- 5
src/views/business/comps/template/comps/dl/DL010.vue View File

@ -173,6 +173,7 @@ export default {
type: 'select',
options: this.getDictOptions('business_dwzs'),
fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'dwzsOther'
}
}
@ -210,6 +211,7 @@ export default {
type: 'select',
options: this.getDictOptions('business_cjbw'),
fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'cjbwOther'
}
}
@ -479,16 +481,16 @@ export default {
// 使
this.resourceTmp = sjxxStepResource.sjResource || []
this.yqResourceTmp = sjxxStepResource.yqResource || []
//
const sjxxTableData = this.$refs.sjxxTableRef?.getFilledFormData()
const sjxxList = sjxxTableData?.stepTableFormData || []
const headerSelectFields = sjxxTableData?.headerSelectFields || {}
// 0.9%
//
const sjxxResource = []
sjxxList.forEach((item) => {
// 0.9%
if (item.sjlhnzsjyjrl) {
@ -510,7 +512,7 @@ export default {
yxzqdw: null //
})
}
//
if (item.sjjrxq) {
sjxxResource.push({
@ -532,7 +534,7 @@ export default {
})
}
})
//
return [...this.resourceTmp, ...sjxxResource]
},

Loading…
Cancel
Save