diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index 4c4e536..96487f6 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -290,7 +290,24 @@ @update:error="errors[key] = false" :item="getRegentItem(sItem)" :value="formFields[key]" /> {{ $t(sItem.subText) }} - + + + + @@ -394,7 +411,15 @@ export default { return { ...sItem, key: sItem.subKey, - fillType: sItem.subFillType || sItem.fillType + fillType: sItem.fourthFillType || sItem.fillType + } + }, + getFourthButtonItem(sItem) { + return { + ...sItem, + key: sItem.fourthKey, + buttonName:sItem.fourthButtonName, + fillType: sItem.fourthFillType || sItem.fillType } }, // 处理fqyq变化 diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 1abcb5f..180e26f 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -67,11 +67,11 @@ export default { }, getRegentItem(item, fieldCode = "type") { const type = item[fieldCode]; - console.log(item, "type") + const fillType = fieldCode === "type" ? item.fillType : (item.subFillType || item.fillType); return { label: "", type, - fillType: item.subFillType || item.fillType, + fillType, parentLabel: item.label, filledCodes: item.filledCodes, qxbdType: item.qxbdType, @@ -184,6 +184,20 @@ export default { } return config; }, + //获取第三个的配置 + getThirdItem(sItem) { + const config = { + label: "", + options: sItem.thirdOptions || [], + fillType: sItem.thirdFillType, + parentLabel: sItem.label, + maxlength: sItem.thirdMaxlength || 50, + } + if (sItem.thirdDisabled) { + config.disabled = sItem.thirdDisabled; + } + return config; + }, // 根据formConfig回填form表单数据 handleFormField(update = false) { const result = {}; @@ -235,6 +249,24 @@ export default { } config[subKey] = { label: currentConfig.label, subKey, type: currentConfig.subType, fillType: currentConfig.subFillType || currentConfig.fillType, selectTo: currentConfig.selectTo } } + if(currentConfig.thirdKey){ + const { thirdKey } = currentConfig; + if (update) { + result[thirdKey] = formFields[thirdKey] || formData[thirdKey] || ''; + } else { + result[thirdKey] = formFields[thirdKey] || formData[thirdKey] || ''; + } + config[thirdKey] = { label: currentConfig.label, thirdKey, type: currentConfig.thirdType, fillType: currentConfig.thirdFillType, selectTo: currentConfig.selectTo } + } + if(currentConfig.fourthKey){ + const { fourthKey } = currentConfig; + if (update) { + result[fourthKey] = formFields[fourthKey] || formData[fourthKey] || ''; + } else { + result[fourthKey] = formFields[fourthKey] || formData[fourthKey] || ''; + } + config[fourthKey] = { label: currentConfig.label, fourthKey, type: currentConfig.fourthType, fillType: currentConfig.fourthFillType, selectTo: currentConfig.selectTo } + } // 检查compareTo字段 if (currentConfig.compareTo && formData[currentConfig.compareTo] && result[key]) { diff --git a/src/views/business/comps/template/comps/gsp/GSP005.vue b/src/views/business/comps/template/comps/gsp/GSP005.vue index 7a17326..4e1d604 100644 --- a/src/views/business/comps/template/comps/gsp/GSP005.vue +++ b/src/views/business/comps/template/comps/gsp/GSP005.vue @@ -338,12 +338,19 @@ export default { }, sywzsjclz: { label: 'template.gsp.GSP005.sywzsjclz', - type: "inputNumber", - subType: "select", - subKey: "sywzsjclzUnit", + type: "yq", + subType: "inputNumber", + subKey: "sywzsjclzValue", + thirdType: "select", + thirdKey: "sywzsjclzUnit", + thirdFillType: "preFill", fillType: "actFill", - subFillType: "preFill", - subOptions: this.getDictOptions('business_zldw'), + subFillType: "actFill", + fourthType: "button", + fourthKey: "sywzsjclzButtonValue", + fourthFillType: "actFill", + fourthButtonName:"获取值", + thirdOptions: this.getDictOptions('business_zldw'), maxlength: 10 }, rjbhph: {