diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 9b75591..01bbfb7 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -686,7 +686,7 @@ export default { } else if (col.bodyType === "checkbox") { // checkbox类型的校验逻辑 // checkbox只在actFill时进行必填校验 - if (!col.bodyDisabled && this.templateFillType === 'actFill') { + if (!col.bodyDisabled && this.templateFillType === 'actFill' && !col.isNeedCheck) { // 单个checkbox:值必须为true // checkbox组:至少选中一个 const hasChecked = Array.isArray(mainValue) ? mainValue.length > 0 : mainValue === true; diff --git a/src/views/business/comps/template/comps/bl/BL001.vue b/src/views/business/comps/template/comps/bl/BL001.vue index 418b1bf..de98507 100644 --- a/src/views/business/comps/template/comps/bl/BL001.vue +++ b/src/views/business/comps/template/comps/bl/BL001.vue @@ -251,9 +251,6 @@ export default { bodyType: 'checkboxTree', bodyFillType: 'actFill', width: 280, - bodyLayout: 'horizontal',//水平 - optionCode:"ypmcTaOptions", - noBorder: true, bodyOptions: this.ypmcTaOptions, }, { @@ -318,10 +315,7 @@ export default { } }, mounted() { - if(this.fillType === "actFill"){ - console.log(this.formData, "this.formData") - this.ypmcTaOptions = this.formData.ypmcTaOptions || [] - } + this.getTabletoCheck() }, methods: { // 删除表格行 @@ -331,25 +325,11 @@ export default { // 获取已填写的表单数据 getFilledFormData() { - const filledData = this.getFilledFormDataByRefs(refNames); - if(this.formData.ypmcTaOptions){ - filledData.ypmcTaOptions = this.formData.ypmcTaOptions - } - return filledData + return this.getFilledFormDataByRefs(refNames) }, // 获取填写完成的表单数据 async getFormData() { - const formData = await this.validFields(); - if(this.fillType === "preFill" && !!formData){ - const filledData = this.getFilledFormData(); - const {stepTableFormData_1 = []} = filledData; - const options = stepTableFormData_1.map(item => ({ - value: item.ypmc, - label: item.ypmc, - })) - formData.ypmcTaOptions = options - } - return formData + return await this.validFormFields(refNames) }, // 只做校验 async validFields() { @@ -358,9 +338,9 @@ export default { getResource() { // const stepResource = this.$refs.yqsyTableRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp }, // 保存 @@ -377,6 +357,24 @@ export default { ) }, + //获取表格数据并赋值 + getTabletoCheck() { + let { stepTableFormData_1 = [] } = this.getFilledFormData() + const firstList = stepTableFormData_1 + .filter(item => item && item.ypmc && item.ypmc.trim()) // 严格过滤空值 + .map(item => ({ + label: item.ypmc, + value: item.ypmc, + })) + // 去重优化 + .filter((item, index, arr) => { + return arr.findIndex(i => i.value === item.value) === index; + }); + // 响应式更新 + this.$nextTick(()=>{ + this.ypmcTaOptions = firstList; + }) + }, } } diff --git a/src/views/business/comps/template/comps/bl/BL002.vue b/src/views/business/comps/template/comps/bl/BL002.vue index eeb255d..9ff31c5 100644 --- a/src/views/business/comps/template/comps/bl/BL002.vue +++ b/src/views/business/comps/template/comps/bl/BL002.vue @@ -210,24 +210,18 @@ export default { { label: 'template.bl.bl002.smryqrxx', prop: "smryqrxx", - bodyType: "radio", + isNeedCheck: true, + bodyType: "checkbox", bodyFillType: "actFill", - bodyOptions: [ - {value:'图像命名准确',label:'图像命名准确'}, - {value:'图像命名不准确',label:'图像命名不准确'}, - ], checkboxLabel: 'template.bl.bl002.txmmzq' }, { label: 'template.bl.bl002.ztblxjqrxx', prop: "ztblxjqrxx", - bodyType: 'radio', + isNeedCheck: true, + bodyType: 'checkbox', bodyFillType: 'actFill', - bodyOptions: [ - {value:'图像完整清晰',label:'图像完整清晰'}, - {value:'图像不完整清晰',label:'图像不完整清晰'}, - ], - // checkboxLabel: 'template.bl.bl002.txwzqx' + checkboxLabel: 'template.bl.bl002.txwzqx' }, ] }, @@ -238,6 +232,19 @@ export default { refConf } }, + mounted() { + let { stepTableFormData = [] } = this.getFilledFormData() + if( stepTableFormData && stepTableFormData.length >0 ){ + stepTableFormData.map((item,index)=>{ + if(!item.smryqrxx && item.smryqrxx !== false){ + this.$refs.yqsyTableRef.updateDataSourceByRowIndex(index, {...item,smryqrxx:false}) + } + if(!item.ztblxjqrxx && item.ztblxjqrxx !== false){ + this.$refs.yqsyTableRef.updateDataSourceByRowIndex(index, {...item,ztblxjqrxx:false}) + } + }) + } + }, methods: { // 删除表格行 async deleteTableRow(rowIndex, refName) { @@ -258,9 +265,9 @@ export default { getResource() { // const stepResource = this.$refs.yqsyTableRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp }, // 保存 async onSave() { diff --git a/src/views/business/comps/template/comps/dj/DJ001.vue b/src/views/business/comps/template/comps/dj/DJ001.vue index 14e7fde..cefdef0 100644 --- a/src/views/business/comps/template/comps/dj/DJ001.vue +++ b/src/views/business/comps/template/comps/dj/DJ001.vue @@ -231,9 +231,9 @@ export default { getResource() { //使用的试剂、仪器 // const stepResource = this.$refs.stepRef.getStepResource() - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp; + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp; }, //保存 async onSave() { diff --git a/src/views/business/comps/template/comps/dj/DJ002.vue b/src/views/business/comps/template/comps/dj/DJ002.vue index dc3634e..2a98555 100644 --- a/src/views/business/comps/template/comps/dj/DJ002.vue +++ b/src/views/business/comps/template/comps/dj/DJ002.vue @@ -237,10 +237,7 @@ export default { prop: "ypmcTa", bodyType: 'checkboxTree', bodyFillType: 'actFill', - bodyOptions: [ - {value:1,label:'正常'}, - {value:0,label:'偏离'}, - ], + bodyOptions: this.ypmcCheckOptions }, { label: 'template.dj.dj003.cysj', @@ -297,9 +294,13 @@ export default { data() { return { formData: {}, - refConf + refConf, + ypmcCheckOptions:[] } }, + mounted() { + this.getTabletoCheck() + }, methods: { // 删除表格行 async deleteTableRow(rowIndex, refName) { @@ -321,9 +322,9 @@ export default { getResource() { // const stepResource = this.$refs.yqsyTableRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp }, // 保存 @@ -338,7 +339,24 @@ export default { moment().format('YYYY/MM/DD HH:mm'), { isUpdateRecord: true, signData } ) - + }, + //获取表格数据并赋值 + getTabletoCheck() { + let { stepTableFormData_1 = [] } = this.getFilledFormData() + const firstList = stepTableFormData_1 + .filter(item => item && item.ypmc && item.ypmc.trim()) // 严格过滤空值 + .map(item => ({ + label: item.ypmc, + value: item.ypmc, + })) + // 去重优化 + .filter((item, index, arr) => { + return arr.findIndex(i => i.value === item.value) === index; + }); + // 响应式更新 + this.$nextTick(()=>{ + this.ypmcCheckOptions = firstList; + }) }, } } diff --git a/src/views/business/comps/template/comps/dj/DJ003.vue b/src/views/business/comps/template/comps/dj/DJ003.vue index 209b82f..99ef70f 100644 --- a/src/views/business/comps/template/comps/dj/DJ003.vue +++ b/src/views/business/comps/template/comps/dj/DJ003.vue @@ -274,9 +274,9 @@ export default { getResource() { // const stepResource = this.$refs.yqsyTableRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp }, // 保存 diff --git a/src/views/business/comps/template/comps/dl/DL004.vue b/src/views/business/comps/template/comps/dl/DL004.vue index ab294d7..9dd10c2 100644 --- a/src/views/business/comps/template/comps/dl/DL004.vue +++ b/src/views/business/comps/template/comps/dl/DL004.vue @@ -280,9 +280,9 @@ export default { getResource() { // const stepResource = this.$refs.yqsyTableRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = [] + this.yqResourceTmp = [] + return this.resourceTmp }, onRegentSubmit(e) { const { selectInfo, key, rowIndex } = e diff --git a/src/views/business/comps/template/comps/dl/DL005.vue b/src/views/business/comps/template/comps/dl/DL005.vue index 65b1157..5e69418 100644 --- a/src/views/business/comps/template/comps/dl/DL005.vue +++ b/src/views/business/comps/template/comps/dl/DL005.vue @@ -25,7 +25,7 @@ :formConfig="czInfoFormConfig" :formData="formData" /> - + diff --git a/src/views/business/comps/template/comps/dl/DL006.vue b/src/views/business/comps/template/comps/dl/DL006.vue index c785fde..1770176 100644 --- a/src/views/business/comps/template/comps/dl/DL006.vue +++ b/src/views/business/comps/template/comps/dl/DL006.vue @@ -472,11 +472,11 @@ export default { return await this.validFormFields(refNames) }, getResource() { - // const stepResource = this.$refs.yqsyTableRef.getStepResource() + const stepResource = this.$refs.stepRef.getStepResource() // 使用的试剂、仪器 - // this.resourceTmp = stepResource.sjResource || [] - // this.yqResourceTmp = stepResource.yqResource || [] - // return this.resourceTmp + this.resourceTmp = stepResource.sjResource || [] + this.yqResourceTmp = stepResource.yqResource || [] + return this.resourceTmp }, onRegentSubmit(e) { console.log(e,909090) @@ -502,7 +502,7 @@ export default { 1: { s9hhybh: { label: 'template.dl.dl006.s9hhybh', - type: 'input', + type: 'sj', fillType: 'actFill', maxlength: 4, }, @@ -519,7 +519,7 @@ export default { other: { pbsbh: { label: 'template.dl.dl006.pbsbh', - type: 'input', + type: 'sj', fillType: 'actFill', maxlength: 4, }, @@ -595,6 +595,7 @@ export default { prop: `czrxm_${i}`, label: 'template.dl.dl006.jzbh', bodyType: 'checkbox', + isNeedCheck: true, bodyFillType: 'actFill', // 修复:actFill改为preFill,与数据填充类型匹配 width: 300, checkboxLabel:'',