数据定价更新
Showing
2 changed files
with
248 additions
and
132 deletions
| ... | @@ -53,7 +53,10 @@ const diseaseData: any = ref([]); | ... | @@ -53,7 +53,10 @@ const diseaseData: any = ref([]); |
| 53 | const qualityScoreData: any = ref({}); | 53 | const qualityScoreData: any = ref({}); |
| 54 | const disScore: any = ref([]); | 54 | const disScore: any = ref([]); |
| 55 | const exportData: any = ref([]); | 55 | const exportData: any = ref([]); |
| 56 | const dataUsage = ref(''); | 56 | const dataUsage = ref({ |
| 57 | field: '', | ||
| 58 | dictValue: '' | ||
| 59 | }); | ||
| 57 | // 基础设置 | 60 | // 基础设置 |
| 58 | const baseConfigFormRef = ref(); | 61 | const baseConfigFormRef = ref(); |
| 59 | const baseConfigFormItems: any = ref([ | 62 | const baseConfigFormItems: any = ref([ |
| ... | @@ -93,7 +96,6 @@ const baseConfigFormItems: any = ref([ | ... | @@ -93,7 +96,6 @@ const baseConfigFormItems: any = ref([ |
| 93 | placeholder: '', | 96 | placeholder: '', |
| 94 | field: 'belongingEntityGuid', | 97 | field: 'belongingEntityGuid', |
| 95 | default: '', | 98 | default: '', |
| 96 | options: [], | ||
| 97 | clearable: true, | 99 | clearable: true, |
| 98 | disabled: true | 100 | disabled: true |
| 99 | }, | 101 | }, |
| ... | @@ -145,6 +147,7 @@ const setFormItems = (info = null) => { | ... | @@ -145,6 +147,7 @@ const setFormItems = (info = null) => { |
| 145 | datas = { ...datas, ...dData }; | 147 | datas = { ...datas, ...dData }; |
| 146 | baseConfigFormItems.value.map(item => { | 148 | baseConfigFormItems.value.map(item => { |
| 147 | item.default = datas[item.field] || ''; | 149 | item.default = datas[item.field] || ''; |
| 150 | item.label == '数据用途' && (dataUsage.value.dictValue = datas[item.field] || ''); | ||
| 148 | }) | 151 | }) |
| 149 | nextTick(() => { | 152 | nextTick(() => { |
| 150 | baseConfigFormRef.value.ruleFormRef?.clearValidate(); | 153 | baseConfigFormRef.value.ruleFormRef?.clearValidate(); |
| ... | @@ -256,7 +259,7 @@ const getDetail = () => { | ... | @@ -256,7 +259,7 @@ const getDetail = () => { |
| 256 | const data = res.data || {}; | 259 | const data = res.data || {}; |
| 257 | flowDetail.value = data; | 260 | flowDetail.value = data; |
| 258 | dataTransactionPrice.value = flowDetail.value.dataTransactionPrice; | 261 | dataTransactionPrice.value = flowDetail.value.dataTransactionPrice; |
| 259 | dataUsage.value = data.dataUsage || ''; | 262 | dataUsage.value.dictValue = data.dataUsage || ''; |
| 260 | const mItem = typeMap.value.modelGuid.find(m => m.guid == flowDetail.value.modelGuid); | 263 | const mItem = typeMap.value.modelGuid.find(m => m.guid == flowDetail.value.modelGuid); |
| 261 | if (!mItem) { | 264 | if (!mItem) { |
| 262 | const mtem = { guid: flowDetail.value.modelGuid, modelName: flowDetail.value.modelName }; | 265 | const mtem = { guid: flowDetail.value.modelGuid, modelName: flowDetail.value.modelName }; |
| ... | @@ -284,8 +287,96 @@ const getDataTypeList = () => { | ... | @@ -284,8 +287,96 @@ const getDataTypeList = () => { |
| 284 | ) | 287 | ) |
| 285 | } | 288 | } |
| 286 | } | 289 | } |
| 287 | const setFormItemData = () => { | 290 | |
| 288 | let dictionaryList: any = [], diseaseList: any = []; | 291 | // 设置数据字典选项 |
| 292 | const setDictFormItems = (dictList) => { | ||
| 293 | dictList.map(d => { | ||
| 294 | const dictName = d.dictionaryName; | ||
| 295 | const dictField = `dict_${d.guid}`; | ||
| 296 | baseConfigFormItems.value.push({ | ||
| 297 | label: dictName, | ||
| 298 | type: 'select', | ||
| 299 | placeholder: '请输入', | ||
| 300 | field: dictField, | ||
| 301 | default: '', | ||
| 302 | options: [], | ||
| 303 | clearable: true, | ||
| 304 | filterable: true, | ||
| 305 | required: true, | ||
| 306 | }); | ||
| 307 | baseConfigFormRules.value[dictField] = { required: true, trigger: 'change', message: `请选择${dictName}` }; | ||
| 308 | dictName == '数据用途' && (dataUsage.value.field = dictField); | ||
| 309 | (() => { | ||
| 310 | if (typeMap.value[dictField] == undefined) { | ||
| 311 | getDataType(dictName, dictField) | ||
| 312 | } else { | ||
| 313 | let item = baseConfigFormItems.value.find(item => item.field == dictField); | ||
| 314 | item && (item.options = typeMap.value[dictField]); | ||
| 315 | } | ||
| 316 | })() | ||
| 317 | }) | ||
| 318 | } | ||
| 319 | |||
| 320 | // 设置疾病选项 | ||
| 321 | const setDiseaseFormItems = () => { | ||
| 322 | baseConfigFormItems.value.push({ | ||
| 323 | label: '所属疾病', | ||
| 324 | type: 'cascader', | ||
| 325 | placeholder: '请选择', | ||
| 326 | field: 'diseaseGuid', | ||
| 327 | default: '', | ||
| 328 | options: [], | ||
| 329 | showAllLevels: false, | ||
| 330 | props: { | ||
| 331 | checkStrictly: true, | ||
| 332 | label: "diseaseName", | ||
| 333 | value: "guid", | ||
| 334 | children: 'childList', | ||
| 335 | emitPath: false | ||
| 336 | }, | ||
| 337 | filterable: true, | ||
| 338 | clearable: true, | ||
| 339 | required: true, | ||
| 340 | }); | ||
| 341 | baseConfigFormRules.value.diseaseGuid = { required: true, trigger: 'change', message: "请选择所属疾病" }; | ||
| 342 | if (typeMap.value['diseaseGuid'] == undefined) { | ||
| 343 | getDiseaseData(); | ||
| 344 | } else { | ||
| 345 | let item = baseConfigFormItems.value.find(item => item.field == 'diseaseGuid'); | ||
| 346 | if (item) { | ||
| 347 | item.options = typeMap.value['diseaseGuid']; | ||
| 348 | const diseaseData = typeMap.value.diseaseGuid.find(m => m.guid == flowDetail.value.diseaseGuid); | ||
| 349 | if (!diseaseData) { | ||
| 350 | item.options.unshift({ | ||
| 351 | guid: flowDetail.value.diseaseGuid, | ||
| 352 | diseaseName: flowDetail.value.diseaseName | ||
| 353 | }); | ||
| 354 | } | ||
| 355 | } | ||
| 356 | } | ||
| 357 | } | ||
| 358 | |||
| 359 | // 设置内置指标选项 | ||
| 360 | const setBuildInFormItems = (buildList) => { | ||
| 361 | buildList.map(b => { | ||
| 362 | const buildName = b.targetName; | ||
| 363 | const buildField = `build_${b.guid}`; | ||
| 364 | baseConfigFormItems.value.push({ | ||
| 365 | label: buildName, | ||
| 366 | type: 'input', | ||
| 367 | placeholder: '', | ||
| 368 | field: buildField, | ||
| 369 | default: b.defaultValue || '', | ||
| 370 | clearable: true, | ||
| 371 | disabled: b.isInputParameter == 'Y' | ||
| 372 | }); | ||
| 373 | baseConfigFormRules.value[buildField] = { required: true, trigger: 'blur', message: `请填写${buildName}` }; | ||
| 374 | }) | ||
| 375 | }; | ||
| 376 | |||
| 377 | // 添加表单选项数据 | ||
| 378 | const setFormItemData = async () => { | ||
| 379 | let dictionaryList: any = [], diseaseList: any = [], buildInList: any = []; | ||
| 289 | pricingTargetList.value.map(item => { | 380 | pricingTargetList.value.map(item => { |
| 290 | switch (item.targetType) { | 381 | switch (item.targetType) { |
| 291 | case '2': | 382 | case '2': |
| ... | @@ -294,6 +385,9 @@ const setFormItemData = () => { | ... | @@ -294,6 +385,9 @@ const setFormItemData = () => { |
| 294 | case '3': | 385 | case '3': |
| 295 | dictionaryList.push(item); | 386 | dictionaryList.push(item); |
| 296 | break; | 387 | break; |
| 388 | case '1': | ||
| 389 | buildInList.push(item); | ||
| 390 | break; | ||
| 297 | default: | 391 | default: |
| 298 | break; | 392 | break; |
| 299 | } | 393 | } |
| ... | @@ -315,68 +409,12 @@ const setFormItemData = () => { | ... | @@ -315,68 +409,12 @@ const setFormItemData = () => { |
| 315 | } | 409 | } |
| 316 | } | 410 | } |
| 317 | // 添加所属疾病 | 411 | // 添加所属疾病 |
| 318 | if (diseaseList.length > 0) { | 412 | diseaseList.length > 0 && await setDiseaseFormItems(); |
| 319 | baseConfigFormItems.value.push({ | ||
| 320 | label: '所属疾病', | ||
| 321 | type: 'cascader', | ||
| 322 | placeholder: '请选择', | ||
| 323 | field: 'diseaseGuid', | ||
| 324 | default: '', | ||
| 325 | options: [], | ||
| 326 | showAllLevels: false, | ||
| 327 | props: { | ||
| 328 | checkStrictly: true, | ||
| 329 | label: "diseaseName", | ||
| 330 | value: "guid", | ||
| 331 | children: 'childList', | ||
| 332 | emitPath: false | ||
| 333 | }, | ||
| 334 | filterable: true, | ||
| 335 | clearable: true, | ||
| 336 | required: true, | ||
| 337 | }); | ||
| 338 | baseConfigFormRules.value.diseaseGuid = { required: true, trigger: 'change', message: "请选择所属疾病" }; | ||
| 339 | if (typeMap.value['diseaseGuid'] == undefined) { | ||
| 340 | getDiseaseData(); | ||
| 341 | } else { | ||
| 342 | let item = baseConfigFormItems.value.find(item => item.field == 'diseaseGuid'); | ||
| 343 | if (item) { | ||
| 344 | item.options = typeMap.value['diseaseGuid']; | ||
| 345 | const diseaseData = typeMap.value.diseaseGuid.find(m => m.guid == flowDetail.value.diseaseGuid); | ||
| 346 | if (!diseaseData) { | ||
| 347 | item.options.unshift({ | ||
| 348 | guid: flowDetail.value.diseaseGuid, | ||
| 349 | diseaseName: flowDetail.value.diseaseName | ||
| 350 | }); | ||
| 351 | } | ||
| 352 | } | ||
| 353 | } | ||
| 354 | } | ||
| 355 | // 添加数据字典 | 413 | // 添加数据字典 |
| 356 | dictionaryList.map(d => { | 414 | dictionaryList.length > 0 && await setDictFormItems(dictionaryList); |
| 357 | const dictName = d.dictionaryName; | 415 | // 添加内置指标 |
| 358 | const dictField = `dict_${d.guid}`; | 416 | buildInList.length > 0 && await setBuildInFormItems(buildInList); |
| 359 | baseConfigFormItems.value.push({ | 417 | |
| 360 | label: dictName, | ||
| 361 | type: 'select', | ||
| 362 | placeholder: '请输入', | ||
| 363 | field: dictField, | ||
| 364 | default: '', | ||
| 365 | options: [], | ||
| 366 | clearable: true, | ||
| 367 | filterable: true, | ||
| 368 | required: true, | ||
| 369 | }); | ||
| 370 | baseConfigFormRules.value[dictField] = { required: true, trigger: 'change', message: `请选择${dictName}` }; | ||
| 371 | (() => { | ||
| 372 | if (typeMap.value[dictField] == undefined) { | ||
| 373 | getDataType(dictName, dictField) | ||
| 374 | } else { | ||
| 375 | let item = baseConfigFormItems.value.find(item => item.field == dictField); | ||
| 376 | item && (item.options = typeMap.value[dictField]); | ||
| 377 | } | ||
| 378 | })() | ||
| 379 | }) | ||
| 380 | setTimeout(() => { | 418 | setTimeout(() => { |
| 381 | baseConfigFormRef.value.ruleFormRef?.clearValidate(); | 419 | baseConfigFormRef.value.ruleFormRef?.clearValidate(); |
| 382 | }, 100) | 420 | }, 100) |
| ... | @@ -566,6 +604,22 @@ const getResourceInfo = (sGuid) => { | ... | @@ -566,6 +604,22 @@ const getResourceInfo = (sGuid) => { |
| 566 | loading.value = false; | 604 | loading.value = false; |
| 567 | } | 605 | } |
| 568 | } | 606 | } |
| 607 | |||
| 608 | const matchTableFields = (rData, tData) => { | ||
| 609 | rData.dataFields.map(t => { | ||
| 610 | const match = tData.find(d => d.chName == t.fieldName); | ||
| 611 | if (match) { | ||
| 612 | t.chName = match.chName; | ||
| 613 | t.enName = match.enName; | ||
| 614 | } | ||
| 615 | }) | ||
| 616 | rData.dataFieldsNum = rData.dataFields.filter(item => item.chName != '' && item.chName != null).length; | ||
| 617 | resourceTableFieldAllNum.value = tableData.value.reduce((accumulator, currentValue) => { | ||
| 618 | return accumulator + Number(currentValue.dataFieldsNum); | ||
| 619 | }, 0); | ||
| 620 | } | ||
| 621 | |||
| 622 | |||
| 569 | const setTableRowData = (dGuid, rIndex) => { | 623 | const setTableRowData = (dGuid, rIndex) => { |
| 570 | let rowData = tableData.value[rIndex]; | 624 | let rowData = tableData.value[rIndex]; |
| 571 | if (guid && dGuid == rowData.dataTableGuid) { | 625 | if (guid && dGuid == rowData.dataTableGuid) { |
| ... | @@ -590,7 +644,86 @@ const setTableRowData = (dGuid, rIndex) => { | ... | @@ -590,7 +644,86 @@ const setTableRowData = (dGuid, rIndex) => { |
| 590 | tableLoading.value = false; | 644 | tableLoading.value = false; |
| 591 | if (res.code == proxy.$passCode) { | 645 | if (res.code == proxy.$passCode) { |
| 592 | const data = res.data || {}; | 646 | const data = res.data || {}; |
| 593 | const damTableField = data.damCatalogTableField || []; | 647 | // const damTableField = data.damCatalogTableField || []; |
| 648 | const damTableField = [ | ||
| 649 | { | ||
| 650 | "guid": "dec5a8a8b4bc4ba0b879105f89c1b245", | ||
| 651 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 652 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 653 | "enName": "patient_id", | ||
| 654 | "chName": "编号", | ||
| 655 | "isRequired": "Y", | ||
| 656 | "orderNum": 1, | ||
| 657 | "bizState": "Y", | ||
| 658 | "createTime": "2025-07-01 13:09:46" | ||
| 659 | }, | ||
| 660 | { | ||
| 661 | "guid": "28c1d258fca448e6b22f59c0c6e566e6", | ||
| 662 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 663 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 664 | "enName": "patient_xm", | ||
| 665 | "chName": "姓名缩写", | ||
| 666 | "isRequired": "Y", | ||
| 667 | "orderNum": 4, | ||
| 668 | "bizState": "Y", | ||
| 669 | "createTime": "2025-07-01 13:09:46" | ||
| 670 | }, | ||
| 671 | { | ||
| 672 | "guid": "08b27a077049434bbdee0c6ab51c8b1a", | ||
| 673 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 674 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 675 | "enName": "patient_sj", | ||
| 676 | "chName": "时间", | ||
| 677 | "isRequired": "Y", | ||
| 678 | "orderNum": 5, | ||
| 679 | "bizState": "Y", | ||
| 680 | "createTime": "2025-07-01 13:09:46" | ||
| 681 | }, | ||
| 682 | { | ||
| 683 | "guid": "a0d536a24fb64102acdd3f142f5eda77", | ||
| 684 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 685 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 686 | "enName": "patient_sf", | ||
| 687 | "chName": "随访次数", | ||
| 688 | "isRequired": "Y", | ||
| 689 | "orderNum": 6, | ||
| 690 | "bizState": "Y", | ||
| 691 | "createTime": "2025-07-01 13:09:46" | ||
| 692 | }, | ||
| 693 | { | ||
| 694 | "guid": "5402d6915458404aa59115fbff40c965", | ||
| 695 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 696 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 697 | "enName": "patient_sg", | ||
| 698 | "chName": "身高", | ||
| 699 | "isRequired": "Y", | ||
| 700 | "orderNum": 7, | ||
| 701 | "bizState": "Y", | ||
| 702 | "createTime": "2025-07-01 13:09:46" | ||
| 703 | }, | ||
| 704 | { | ||
| 705 | "guid": "752ee34845044ad2bbe30f5b738a1ef0", | ||
| 706 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 707 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 708 | "enName": "patient_igf", | ||
| 709 | "chName": "IGF-1", | ||
| 710 | "isRequired": "Y", | ||
| 711 | "orderNum": 8, | ||
| 712 | "bizState": "Y", | ||
| 713 | "createTime": "2025-07-01 13:09:46" | ||
| 714 | }, | ||
| 715 | { | ||
| 716 | "guid": "8dce74c208184f958f0ac8587fe66839", | ||
| 717 | "tenantGuid": "f150638598f74d1bb2d9c542aaf2296c", | ||
| 718 | "relationMenuGuid": "4c2042543d3c413c851f483c3d5e854a", | ||
| 719 | "enName": "patient_tz", | ||
| 720 | "chName": "体重", | ||
| 721 | "isRequired": "Y", | ||
| 722 | "orderNum": 8, | ||
| 723 | "bizState": "Y", | ||
| 724 | "createTime": "2025-07-01 13:09:46" | ||
| 725 | } | ||
| 726 | ]; | ||
| 594 | const damFieldOptions = damTableField.map(d => { | 727 | const damFieldOptions = damTableField.map(d => { |
| 595 | return { | 728 | return { |
| 596 | ...d, | 729 | ...d, |
| ... | @@ -600,16 +733,9 @@ const setTableRowData = (dGuid, rIndex) => { | ... | @@ -600,16 +733,9 @@ const setTableRowData = (dGuid, rIndex) => { |
| 600 | }) | 733 | }) |
| 601 | rowData.dataFields.map(t => { | 734 | rowData.dataFields.map(t => { |
| 602 | t.damFieldTable = JSON.parse(JSON.stringify(damFieldOptions)); | 735 | t.damFieldTable = JSON.parse(JSON.stringify(damFieldOptions)); |
| 603 | const match = damFieldOptions.find(d => d.chName == t.fieldName); | ||
| 604 | if (match) { | ||
| 605 | t.chName = match.chName; | ||
| 606 | t.enName = match.enName; | ||
| 607 | } | ||
| 608 | }) | 736 | }) |
| 609 | rowData.dataFieldsNum = rowData.dataFields.filter(item => item.chName != '' && item.chName != null).length; | 737 | // 匹配 |
| 610 | resourceTableFieldAllNum.value = tableData.value.reduce((accumulator, currentValue) => { | 738 | !guid && matchTableFields(rowData, damTableField); |
| 611 | return accumulator + Number(currentValue.dataFieldsNum); | ||
| 612 | }, 0); | ||
| 613 | // console.log('rowData', rowData) | 739 | // console.log('rowData', rowData) |
| 614 | } else { | 740 | } else { |
| 615 | proxy.$ElMessage.error(res.msg); | 741 | proxy.$ElMessage.error(res.msg); |
| ... | @@ -629,6 +755,7 @@ const changeDatasource = () => { | ... | @@ -629,6 +755,7 @@ const changeDatasource = () => { |
| 629 | } | 755 | } |
| 630 | }) | 756 | }) |
| 631 | } | 757 | } |
| 758 | |||
| 632 | const cascaderChange = (val) => { | 759 | const cascaderChange = (val) => { |
| 633 | disScore.value = []; | 760 | disScore.value = []; |
| 634 | if (val) { | 761 | if (val) { |
| ... | @@ -663,6 +790,9 @@ const selectChange = async (val, row, info) => { | ... | @@ -663,6 +790,9 @@ const selectChange = async (val, row, info) => { |
| 663 | } else { | 790 | } else { |
| 664 | changeDatasource(); | 791 | changeDatasource(); |
| 665 | } | 792 | } |
| 793 | } else if (row.field == dataUsage.value.field) { | ||
| 794 | dataUsage.value.dictValue = val || ''; | ||
| 795 | setFormItems(info); | ||
| 666 | } else if (row.field == 'dataTableGuid') { | 796 | } else if (row.field == 'dataTableGuid') { |
| 667 | setTableRowData(val, info.$index) | 797 | setTableRowData(val, info.$index) |
| 668 | } else if (row.field == 'chName') { | 798 | } else if (row.field == 'chName') { |
| ... | @@ -721,6 +851,7 @@ const toPath = () => { | ... | @@ -721,6 +851,7 @@ const toPath = () => { |
| 721 | name: 'priceCalculate', | 851 | name: 'priceCalculate', |
| 722 | }) | 852 | }) |
| 723 | } | 853 | } |
| 854 | |||
| 724 | // 获取维度公式计算结果 | 855 | // 获取维度公式计算结果 |
| 725 | const getSignatory = (row) => { | 856 | const getSignatory = (row) => { |
| 726 | let formulaVal = 0; | 857 | let formulaVal = 0; |
| ... | @@ -790,7 +921,7 @@ const reporting = (formInfo) => { | ... | @@ -790,7 +921,7 @@ const reporting = (formInfo) => { |
| 790 | tNum = parseFloat(dictionary?.value || t.defaultValue || 0); | 921 | tNum = parseFloat(dictionary?.value || t.defaultValue || 0); |
| 791 | tCustomize = `默认值${parseFloat(dictionary?.value || t.defaultValue || 0)}`; | 922 | tCustomize = `默认值${parseFloat(dictionary?.value || t.defaultValue || 0)}`; |
| 792 | } | 923 | } |
| 793 | t.dictionaryName == '数据用途' && (dataUsage.value = pVal.value || ''); | 924 | t.dictionaryName == '数据用途' && (dataUsage.value.dictValue = pVal.value || ''); |
| 794 | } | 925 | } |
| 795 | } else if (t.targetType == '2') {// 指标类型-系统功能 | 926 | } else if (t.targetType == '2') {// 指标类型-系统功能 |
| 796 | if (t.functionName == '1') { // 功能名称-质量评价模型 | 927 | if (t.functionName == '1') { // 功能名称-质量评价模型 |
| ... | @@ -925,7 +1056,7 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => { | ... | @@ -925,7 +1056,7 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => { |
| 925 | belongingTheme: baseConfigFormInfo.belongingTheme, | 1056 | belongingTheme: baseConfigFormInfo.belongingTheme, |
| 926 | diseaseGuid, | 1057 | diseaseGuid, |
| 927 | diseaseName: '', | 1058 | diseaseName: '', |
| 928 | dataUsage: dataUsage.value | 1059 | dataUsage: dataUsage.value.dictValue |
| 929 | }; | 1060 | }; |
| 930 | if (diseaseGuid) { | 1061 | if (diseaseGuid) { |
| 931 | const parentsData = baseConfigFormObj.getCascaderCheckedData(); | 1062 | const parentsData = baseConfigFormObj.getCascaderCheckedData(); |
| ... | @@ -970,7 +1101,6 @@ const getCalculatPrice = async (params) => { | ... | @@ -970,7 +1101,6 @@ const getCalculatPrice = async (params) => { |
| 970 | loading.value = false; | 1101 | loading.value = false; |
| 971 | if (res.code === proxy.$passCode) { | 1102 | if (res.code === proxy.$passCode) { |
| 972 | const data = res.data || {}; | 1103 | const data = res.data || {}; |
| 973 | console.log('getCalculatPrice', data); | ||
| 974 | return data; // 返回计算结果以便后续使用 | 1104 | return data; // 返回计算结果以便后续使用 |
| 975 | } else { | 1105 | } else { |
| 976 | proxy.$ElMessage.error(res.msg); | 1106 | proxy.$ElMessage.error(res.msg); | ... | ... |
| ... | @@ -222,7 +222,7 @@ const signatoryFormItems: any = ref([ | ... | @@ -222,7 +222,7 @@ const signatoryFormItems: any = ref([ |
| 222 | placeholder: '请输入', | 222 | placeholder: '请输入', |
| 223 | field: 'weight', | 223 | field: 'weight', |
| 224 | default: '', | 224 | default: '', |
| 225 | inputType: 'factorNumber', | 225 | inputType: 'scoreNumber', |
| 226 | maxlength: 10, | 226 | maxlength: 10, |
| 227 | clearable: true, | 227 | clearable: true, |
| 228 | }, | 228 | }, |
| ... | @@ -314,7 +314,7 @@ const targetFormItems: any = ref([ | ... | @@ -314,7 +314,7 @@ const targetFormItems: any = ref([ |
| 314 | placeholder: '请输入', | 314 | placeholder: '请输入', |
| 315 | field: 'weight', | 315 | field: 'weight', |
| 316 | default: '', | 316 | default: '', |
| 317 | inputType: 'factorNumber', | 317 | inputType: 'scoreNumber', |
| 318 | maxlength: 10, | 318 | maxlength: 10, |
| 319 | clearable: true, | 319 | clearable: true, |
| 320 | required: true, | 320 | required: true, |
| ... | @@ -354,7 +354,7 @@ const targetFormItems: any = ref([ | ... | @@ -354,7 +354,7 @@ const targetFormItems: any = ref([ |
| 354 | placeholder: '请输入', | 354 | placeholder: '请输入', |
| 355 | field: 'defaultValue', | 355 | field: 'defaultValue', |
| 356 | default: '', | 356 | default: '', |
| 357 | inputType: 'factorNumber', | 357 | inputType: 'moneyNumber', |
| 358 | maxlength: 18, | 358 | maxlength: 18, |
| 359 | clearable: true, | 359 | clearable: true, |
| 360 | required: false | 360 | required: false |
| ... | @@ -548,35 +548,44 @@ const drawerInfo: any = ref({ | ... | @@ -548,35 +548,44 @@ const drawerInfo: any = ref({ |
| 548 | }); | 548 | }); |
| 549 | 549 | ||
| 550 | const setTableField = (data) => { | 550 | const setTableField = (data) => { |
| 551 | tableData.value = []; | 551 | // tableData.value = []; |
| 552 | const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; | 552 | // const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; |
| 553 | const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; | 553 | // const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; |
| 554 | // if (dictionaryType.value == '1') { | 554 | // if (dictionaryJson.length) { |
| 555 | // const tData = JSON.parse(JSON.stringify(mergeTableData)); | 555 | // dictionaryJson.map(item => { |
| 556 | // if (dictionaryJson.length) { | 556 | // tableData.value.push({ |
| 557 | // tData.map((item, i) => { | 557 | // label: item.name, |
| 558 | // item.factor = dictionaryJson[i]?.value || ''; | 558 | // factor: item.value || '', |
| 559 | // }) | 559 | // }) |
| 560 | // } | 560 | // }) |
| 561 | // tableData.value = tData; | ||
| 562 | // getMergeRow(); | ||
| 563 | // } else { | 561 | // } else { |
| 564 | if (dictionaryJson.length) { | 562 | // data.map((item: any) => { |
| 565 | dictionaryJson.map(item => { | 563 | // tableData.value.push({ |
| 566 | tableData.value.push({ | 564 | // label: item.label, |
| 567 | label: item.name, | 565 | // factor: '', |
| 568 | factor: item.value || '', | 566 | // }) |
| 569 | }) | 567 | // }) |
| 570 | }) | ||
| 571 | } else { | ||
| 572 | data.map((item: any) => { | ||
| 573 | tableData.value.push({ | ||
| 574 | label: item.label, | ||
| 575 | factor: '', | ||
| 576 | }) | ||
| 577 | }) | ||
| 578 | } | ||
| 579 | // } | 568 | // } |
| 569 | |||
| 570 | tableData.value = []; | ||
| 571 | const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; | ||
| 572 | const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; | ||
| 573 | |||
| 574 | // 创建已有数据的映射表,以 label 为键 | ||
| 575 | const existingDataMap = {}; | ||
| 576 | if (dictionaryJson.length) { | ||
| 577 | dictionaryJson.forEach(item => { | ||
| 578 | existingDataMap[item.name] = item.value || ''; | ||
| 579 | }); | ||
| 580 | } | ||
| 581 | |||
| 582 | // 遍历最新数据,如果有匹配的已有数据则使用其值 | ||
| 583 | data.forEach((item: any) => { | ||
| 584 | tableData.value.push({ | ||
| 585 | label: item.label, | ||
| 586 | factor: existingDataMap[item.label] || '', // 使用已有值或空字符串 | ||
| 587 | }); | ||
| 588 | }); | ||
| 580 | } | 589 | } |
| 581 | 590 | ||
| 582 | const getDictionaryRuleData = () => { | 591 | const getDictionaryRuleData = () => { |
| ... | @@ -833,6 +842,7 @@ const selectChange = async (val, row, info) => { | ... | @@ -833,6 +842,7 @@ const selectChange = async (val, row, info) => { |
| 833 | await setFormItems(tInfo, 'target'); | 842 | await setFormItems(tInfo, 'target'); |
| 834 | if (row.field == 'targetType') { | 843 | if (row.field == 'targetType') { |
| 835 | targetFormItems.value[3].default = val == '1' ? 'N' : 'Y'; | 844 | targetFormItems.value[3].default = val == '1' ? 'N' : 'Y'; |
| 845 | targetFormItems.value[4].default = val == '1' ? 'N' : 'Y'; | ||
| 836 | } | 846 | } |
| 837 | } | 847 | } |
| 838 | } | 848 | } |
| ... | @@ -1265,30 +1275,6 @@ onMounted(() => { | ... | @@ -1265,30 +1275,6 @@ onMounted(() => { |
| 1265 | <template v-if="showFactorTable"> | 1275 | <template v-if="showFactorTable"> |
| 1266 | <span class="required_mark" style="line-height: 21px;">字典值对应因子</span> | 1276 | <span class="required_mark" style="line-height: 21px;">字典值对应因子</span> |
| 1267 | <div class="table_panel"> | 1277 | <div class="table_panel"> |
| 1268 | <!-- <el-table border :data="tableData" :span-method="tableSpanMethod" tooltip-effect="light" style="height: 100%;" | ||
| 1269 | v-if="dictionaryType == '1'"> | ||
| 1270 | <el-table-column label="医院等级"> | ||
| 1271 | <el-table-column prop="level" label="级别" width="100" /> | ||
| 1272 | <el-table-column prop="grade" label="等次" width="100" /> | ||
| 1273 | </el-table-column> | ||
| 1274 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ||
| 1275 | <template #default="scope"> | ||
| 1276 | <el-input v-model="scope.row.factor" placeholder="请输入" | ||
| 1277 | @change="(val) => inputChange(val, scope, 'factor')" | ||
| 1278 | @input="(val) => inputEventChange(val, scope, 'factor')" /> | ||
| 1279 | </template> | ||
| 1280 | </el-table-column> | ||
| 1281 | </el-table> | ||
| 1282 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;" v-else> | ||
| 1283 | <el-table-column label="字典名称" prop="label" width="140" /> | ||
| 1284 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ||
| 1285 | <template #default="scope"> | ||
| 1286 | <el-input v-model="scope.row.factor" placeholder="请输入" | ||
| 1287 | @change="(val) => inputChange(val, scope, 'factor')" | ||
| 1288 | @input="(val) => inputEventChange(val, scope, 'factor')" /> | ||
| 1289 | </template> | ||
| 1290 | </el-table-column> | ||
| 1291 | </el-table> --> | ||
| 1292 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;"> | 1278 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;"> |
| 1293 | <el-table-column label="字典名称" prop="label" width="140" /> | 1279 | <el-table-column label="字典名称" prop="label" width="140" /> |
| 1294 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | 1280 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ... | ... |
-
Please register or sign in to post a comment