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', pykssj: 'Cultivation Start Time',
pyjssj: 'Cultivation End Time', pyjssj: 'Cultivation End Time',
jsButton: 'End', jsButton: 'End',
yqsyxxEmpty: 'Please add instrument usage information first'
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
}, },
dl008: { dl008: {
...common, ...common,
@ -89,8 +89,8 @@ export default {
jzbh2: 'Strain Number', jzbh2: 'Strain Number',
jzbh3: 'Strain Number', jzbh3: 'Strain Number',
jzbh4: '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: { dl009: {
...common, ...common,
@ -107,8 +107,8 @@ export default {
czqkDesc: 'Precipitation codes: "P-" = "None"; "P+" = "Slight"; "P++" = "Moderate"; "P+++" = "Severe".', 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";', 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;', 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: { dl010: {
...common, ...common,
@ -194,7 +194,9 @@ export default {
zxg: 'Lower Left Grid (cells)', zxg: 'Lower Left Grid (cells)',
yxg: 'Lower Right Grid (cells)', yxg: 'Lower Right Grid (cells)',
cdxxTime: 'Time {index}', 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: { dl014: {
...common, ...common,
@ -221,7 +223,8 @@ export default {
sjgspjrl: 'Actual Test Article Volume', sjgspjrl: 'Actual Test Article Volume',
gyhzqk: 'Post-dose Status', gyhzqk: 'Post-dose Status',
qrButton: 'Confirm', qrButton: 'Confirm',
wcButton: 'Complete'
wcButton: 'Complete',
yqsyxxEmpty: 'Instrument usage information has not been filled in, please fill in before submitting'
}, },
dl015: { dl015: {
...common, ...common,

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

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

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

@ -142,7 +142,8 @@ export default {
type: 'select', type: 'select',
options: this.getDictOptions('business_sydd'), options: this.getDictOptions('business_sydd'),
fillType: 'actFill', fillType: 'actFill',
otherCode: 'syddOther'
otherCode: 'syddOther',
otherMaxlength: 50
} }
} }
}, },
@ -220,10 +221,10 @@ export default {
disabled: true disabled: true
}, },
pyjssj: { pyjssj: {
// TODOinputdateTime
label: 'template.dl.dl007.pyjssj', label: 'template.dl.dl007.pyjssj',
type: 'input', type: 'input',
fillType: 'actFill', fillType: 'actFill',
maxlength: 200,
subType: 'button', subType: 'button',
subKey: 'pyjssjButton', subKey: 'pyjssjButton',
buttonName: 'template.dl.dl007.jsButton' 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'), options: this.getDictOptions('business_dl_ameswrqk'),
fillType: 'actFill', fillType: 'actFill',
otherCode: 'cxqkwrqkOther', otherCode: 'cxqkwrqkOther',
otherMaxlength:200,
showOtherLabel: false showOtherLabel: false
} }
} }
@ -307,14 +308,20 @@ export default {
const headerSelectFields = this.formData.headerSelectFields || {} const headerSelectFields = this.formData.headerSelectFields || {}
// //
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return return
} }
// jzbh Label // jzbh Label
const firstRow = stepTableFormData_1[0] 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) { if (labelKeys.length === 0) {
return return
} }
@ -335,7 +342,7 @@ export default {
// headerSelectFields // headerSelectFields
labelKeys.sort().forEach((labelKey, index) => { labelKeys.sort().forEach((labelKey, index) => {
const colIndex = index + 1 const colIndex = index + 1
// headerSelectFields 1_1, 1_2, 1_3 // headerSelectFields 1_1, 1_2, 1_3
const headerValues = [] const headerValues = []
let rowIndex = 1 let rowIndex = 1
@ -343,10 +350,11 @@ export default {
headerValues.push(headerSelectFields[`${colIndex}_${rowIndex}`]) headerValues.push(headerSelectFields[`${colIndex}_${rowIndex}`])
rowIndex++ rowIndex++
} }
// 使 // 使
const headerLabel = headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
const headerLabel =
headerValues.length > 0 ? headerValues.join(' ') : `菌种${colIndex}`
dynamicColumns.push({ dynamicColumns.push({
label: headerLabel, label: headerLabel,
prop: `jzbh${colIndex}`, prop: `jzbh${colIndex}`,
@ -382,19 +390,19 @@ export default {
// //
getFilledFormData() { getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames) const baseData = this.getFilledFormDataByRefs(refNames)
// //
const cxqkTableRef = this.$refs[refConf.cxqk] const cxqkTableRef = this.$refs[refConf.cxqk]
if (cxqkTableRef) { if (cxqkTableRef) {
const cxqkData = cxqkTableRef.getFilledFormData() const cxqkData = cxqkTableRef.getFilledFormData()
baseData.stepTableFormData_1 = cxqkData.stepTableFormData || [] baseData.stepTableFormData_1 = cxqkData.stepTableFormData || []
} }
// headerSelectFields // headerSelectFields
if (this.formData.headerSelectFields) { if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields baseData.headerSelectFields = this.formData.headerSelectFields
} }
return baseData return baseData
}, },
// //
@ -404,24 +412,25 @@ export default {
}, },
// //
async validFields() { async validFields() {
// 1. 使 actFill
// actFill
if (this.fillType === 'actFill') { if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy] const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || [] const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) { if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl008.yqsyxxEmpty')) this.$message.warning(this.$t('template.dl.dl008.yqsyxxEmpty'))
return Promise.reject(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. // 3.
@ -457,7 +466,7 @@ export default {
this.handleCxqkQxbdSelect(row) this.handleCxqkQxbdSelect(row)
} }
}, },
// //
handleYqbhSelect(row, rowIndex) { handleYqbhSelect(row, rowIndex) {
const params = { const params = {
@ -467,15 +476,15 @@ export default {
} }
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
}, },
// //
handleCxqkQxbdSelect(row) { handleCxqkQxbdSelect(row) {
// //
this.isDataLoaded = false this.isDataLoaded = false
try { try {
const bdnr = JSON.parse(row.bdnr) const bdnr = JSON.parse(row.bdnr)
const headerFields = bdnr.headerFields || {} const headerFields = bdnr.headerFields || {}
const stepTableFormData_1 = bdnr.stepTableFormData_1 || [] const stepTableFormData_1 = bdnr.stepTableFormData_1 || []
@ -493,7 +502,10 @@ export default {
} }
// 2. // 2.
const tableData = this.generateTableData(stepTableFormData_1, dynamicColumns.columnKeys)
const tableData = this.generateTableData(
stepTableFormData_1,
dynamicColumns.columnKeys
)
if (tableData.length === 0) { if (tableData.length === 0) {
this.clearCxqkTable() this.clearCxqkTable()
return return
@ -501,18 +513,17 @@ export default {
// 3. // 3.
this.updateCxqkTable(dynamicColumns.columns, tableData, headerFields) this.updateCxqkTable(dynamicColumns.columns, tableData, headerFields)
} catch (error) { } catch (error) {
console.error('解析前序表单数据失败:', error) console.error('解析前序表单数据失败:', error)
this.clearCxqkTable() this.clearCxqkTable()
} }
}, },
// //
generateDynamicColumns(headerFields) { generateDynamicColumns(headerFields) {
// _1 key // _1 key
const columnKeys = Object.keys(headerFields) 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])) .sort((a, b) => parseInt(a.split('_')[0]) - parseInt(b.split('_')[0]))
if (columnKeys.length === 0) { if (columnKeys.length === 0) {
@ -534,7 +545,7 @@ export default {
columnKeys.forEach((key, index) => { columnKeys.forEach((key, index) => {
const colIndex = index + 1 const colIndex = index + 1
const baseColIndex = key.split('_')[0] // "1_1" -> "1" const baseColIndex = key.split('_')[0] // "1_1" -> "1"
// headerFields 1_1, 1_2, 1_3 // headerFields 1_1, 1_2, 1_3
const headerValues = [] const headerValues = []
let rowIndex = 1 let rowIndex = 1
@ -542,10 +553,10 @@ export default {
headerValues.push(headerFields[`${baseColIndex}_${rowIndex}`]) headerValues.push(headerFields[`${baseColIndex}_${rowIndex}`])
rowIndex++ rowIndex++
} }
// //
const headerLabel = headerValues.join(' ') const headerLabel = headerValues.join(' ')
columns.push({ columns.push({
label: headerLabel, label: headerLabel,
prop: `jzbh${colIndex}`, prop: `jzbh${colIndex}`,
@ -558,42 +569,42 @@ export default {
return { columns, columnKeys } return { columns, columnKeys }
}, },
// //
generateTableData(stepTableFormData_1, columnKeys) { generateTableData(stepTableFormData_1, columnKeys) {
const tableData = [] const tableData = []
stepTableFormData_1.forEach((item) => { stepTableFormData_1.forEach((item) => {
const rowData = { jlzb: item.jlzb || '' } const rowData = { jlzb: item.jlzb || '' }
columnKeys.forEach((_key, index) => { columnKeys.forEach((_key, index) => {
const colIndex = index + 1 const colIndex = index + 1
const valueKey = `jzbh${colIndex}` const valueKey = `jzbh${colIndex}`
// DL006 label // DL006 label
// DL006 使 czrxm_${index}Label // DL006 使 czrxm_${index}Label
const labelValue = item[`czrxm_${index}Label`] || '' const labelValue = item[`czrxm_${index}Label`] || ''
rowData[`${valueKey}Label`] = labelValue rowData[`${valueKey}Label`] = labelValue
rowData[valueKey] = '' // rowData[valueKey] = '' //
}) })
tableData.push(rowData) tableData.push(rowData)
}) })
return tableData return tableData
}, },
// //
updateCxqkTable(columns, tableData, headerFields) { updateCxqkTable(columns, tableData, headerFields) {
// //
this.dynamicCxqkColumns = columns this.dynamicCxqkColumns = columns
// headerFields formData // headerFields formData
if (!this.formData.headerSelectFields) { if (!this.formData.headerSelectFields) {
this.$set(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]) this.$set(this.formData.headerSelectFields, key, headerFields[key])
}) })
@ -602,19 +613,21 @@ export default {
if (tableRef) { if (tableRef) {
// //
tableRef.updateDataSource(tableData) tableRef.updateDataSource(tableData)
// oldLocalDataSource // oldLocalDataSource
// //
this.$nextTick(() => { 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.$set(this.formData, 'stepTableFormData_1', tableData)
this.isDataLoaded = true this.isDataLoaded = true
}) })
}, },
// //
clearCxqkTable() { clearCxqkTable() {
this.dynamicCxqkColumns = [] 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 || {} const headerSelectFields = this.formData.headerSelectFields || {}
// //
if (!stepTableFormData_1 || stepTableFormData_1.length === 0 || this.isDataLoaded) {
if (
!stepTableFormData_1 ||
stepTableFormData_1.length === 0 ||
this.isDataLoaded
) {
return return
} }
// jzbh Label // jzbh Label
const firstRow = stepTableFormData_1[0] const firstRow = stepTableFormData_1[0]
const jzbhKeys = Object.keys(firstRow) 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) => { .sort((a, b) => {
const numA = parseInt(a.replace('jzbh', '')) const numA = parseInt(a.replace('jzbh', ''))
const numB = parseInt(b.replace('jzbh', '')) const numB = parseInt(b.replace('jzbh', ''))
return numA - numB return numA - numB
}) })
if (jzbhKeys.length === 0) { if (jzbhKeys.length === 0) {
return return
} }
@ -373,10 +377,11 @@ export default {
// headerSelectFields // headerSelectFields
jzbhKeys.forEach((_jzbhKey, index) => { jzbhKeys.forEach((_jzbhKey, index) => {
const colIndex = index + 1 const colIndex = index + 1
// headerSelectFields T-A02 // headerSelectFields T-A02
const jzbhLabel = headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
const jzbhLabel =
headerSelectFields[`${colIndex}_1`] || `菌种${colIndex}`
// //
dynamicColumns.push({ dynamicColumns.push({
label: jzbhLabel, label: jzbhLabel,
@ -418,15 +423,19 @@ export default {
// //
this.dynamicJgxxColumns = dynamicColumns this.dynamicJgxxColumns = dynamicColumns
// headerSelectFields formData.headerSelectFields // headerSelectFields formData.headerSelectFields
if (!this.formData.headerSelectFields) { if (!this.formData.headerSelectFields) {
this.$set(this.formData, 'headerSelectFields', {}) this.$set(this.formData, 'headerSelectFields', {})
} }
Object.keys(headerSelectFields).forEach((key) => { Object.keys(headerSelectFields).forEach((key) => {
this.$set(this.formData.headerSelectFields, key, headerSelectFields[key])
this.$set(
this.formData.headerSelectFields,
key,
headerSelectFields[key]
)
}) })
this.isDataLoaded = true this.isDataLoaded = true
// //
@ -434,11 +443,13 @@ export default {
const tableRef = this.$refs[refConf.jgxx] const tableRef = this.$refs[refConf.jgxx]
if (tableRef) { if (tableRef) {
tableRef.updateDataSource(stepTableFormData_1) tableRef.updateDataSource(stepTableFormData_1)
// oldLocalDataSource // oldLocalDataSource
// //
this.$nextTick(() => { 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() { initializeYqsyTableFromFormData() {
try { try {
const stepTableFormData = this.formData.stepTableFormData const stepTableFormData = this.formData.stepTableFormData
if (!stepTableFormData || stepTableFormData.length === 0) { if (!stepTableFormData || stepTableFormData.length === 0) {
return return
} }
@ -459,10 +470,12 @@ export default {
const tableRef = this.$refs[refConf.yqsy] const tableRef = this.$refs[refConf.yqsy]
if (tableRef) { if (tableRef) {
tableRef.updateDataSource(stepTableFormData) tableRef.updateDataSource(stepTableFormData)
// oldLocalDataSource // oldLocalDataSource
this.$nextTick(() => { 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() { getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames) const baseData = this.getFilledFormDataByRefs(refNames)
// 使 // 使
const yqsyTableRef = this.$refs[refConf.yqsy] const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) { if (yqsyTableRef) {
@ -481,7 +494,7 @@ export default {
// 使 stepTableFormData // 使 stepTableFormData
baseData.stepTableFormData = yqsyData.stepTableFormData || [] baseData.stepTableFormData = yqsyData.stepTableFormData || []
} }
// //
const jgxxTableRef = this.$refs[refConf.jgxx] const jgxxTableRef = this.$refs[refConf.jgxx]
if (jgxxTableRef) { if (jgxxTableRef) {
@ -489,46 +502,47 @@ export default {
// stepTableFormData_1 // stepTableFormData_1
baseData.stepTableFormData_1 = jgxxData.stepTableFormData || [] baseData.stepTableFormData_1 = jgxxData.stepTableFormData || []
} }
// headerSelectFields // headerSelectFields
if (this.formData.headerSelectFields) { if (this.formData.headerSelectFields) {
baseData.headerSelectFields = this.formData.headerSelectFields baseData.headerSelectFields = this.formData.headerSelectFields
} }
return baseData return baseData
}, },
// //
async getFormData() { async getFormData() {
// //
const validResult = await this.validFields() const validResult = await this.validFields()
// headerSelectFields // headerSelectFields
if (validResult) { if (validResult) {
return this.getFilledFormData() return this.getFilledFormData()
} }
return validResult return validResult
}, },
// //
async validFields() { async validFields() {
// 1. 使 actFill
// actFill
if (this.fillType === 'actFill') { if (this.fillType === 'actFill') {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy] const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || [] const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) { if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl009.yqsyxxEmpty')) this.$message.warning(this.$t('template.dl.dl009.yqsyxxEmpty'))
return Promise.reject(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. // 3.
@ -566,28 +580,44 @@ 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)) : {}
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 // 使 $nextTick tick
this.$nextTick(() => { this.$nextTick(() => {
this.handleJgxxQxbdSelect(row) this.handleJgxxQxbdSelect(row)
// 使 $nextTick handleJgxxQxbdSelect // 使 $nextTick handleJgxxQxbdSelect
this.$nextTick(() => { 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) this.$set(this.formData, 'stepTableFormData', currentYqsyData)
// //
const yqsyTableRef = this.$refs[refConf.yqsy] const yqsyTableRef = this.$refs[refConf.yqsy]
if (yqsyTableRef) { if (yqsyTableRef) {
yqsyTableRef.updateDataSource(currentYqsyData) 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) { if (this.dynamicJgxxColumns.length === 0) {
return return
} }
// select bodyOptions // select bodyOptions
this.dynamicJgxxColumns.forEach(col => {
this.dynamicJgxxColumns.forEach((col) => {
if (col.bodyType === 'select') { if (col.bodyType === 'select') {
if (col.prop.startsWith('czqk')) { if (col.prop.startsWith('czqk')) {
col.bodyOptions = this.getDictOptions('business_dl_amescdqk') 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', type: 'select',
options: this.getDictOptions('business_dwzs'), options: this.getDictOptions('business_dwzs'),
fillType: 'preFill', fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'dwzsOther' otherCode: 'dwzsOther'
} }
} }
@ -210,6 +211,7 @@ export default {
type: 'select', type: 'select',
options: this.getDictOptions('business_cjbw'), options: this.getDictOptions('business_cjbw'),
fillType: 'preFill', fillType: 'preFill',
otherMaxlength: 50,
otherCode: 'cjbwOther' otherCode: 'cjbwOther'
} }
} }
@ -479,16 +481,16 @@ export default {
// 使 // 使
this.resourceTmp = sjxxStepResource.sjResource || [] this.resourceTmp = sjxxStepResource.sjResource || []
this.yqResourceTmp = sjxxStepResource.yqResource || [] this.yqResourceTmp = sjxxStepResource.yqResource || []
// //
const sjxxTableData = this.$refs.sjxxTableRef?.getFilledFormData() const sjxxTableData = this.$refs.sjxxTableRef?.getFilledFormData()
const sjxxList = sjxxTableData?.stepTableFormData || [] const sjxxList = sjxxTableData?.stepTableFormData || []
const headerSelectFields = sjxxTableData?.headerSelectFields || {} const headerSelectFields = sjxxTableData?.headerSelectFields || {}
// 0.9% // 0.9%
// //
const sjxxResource = [] const sjxxResource = []
sjxxList.forEach((item) => { sjxxList.forEach((item) => {
// 0.9% // 0.9%
if (item.sjlhnzsjyjrl) { if (item.sjlhnzsjyjrl) {
@ -510,7 +512,7 @@ export default {
yxzqdw: null // yxzqdw: null //
}) })
} }
// //
if (item.sjjrxq) { if (item.sjjrxq) {
sjxxResource.push({ sjxxResource.push({
@ -532,7 +534,7 @@ export default {
}) })
} }
}) })
// //
return [...this.resourceTmp, ...sjxxResource] return [...this.resourceTmp, ...sjxxResource]
}, },

Loading…
Cancel
Save