数据定价对接计算接口
Showing
1 changed file
with
2 additions
and
65 deletions
| ... | @@ -967,17 +967,15 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => { | ... | @@ -967,17 +967,15 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => { |
| 967 | const getCalculatPrice = async (params) => { | 967 | const getCalculatPrice = async (params) => { |
| 968 | try { | 968 | try { |
| 969 | const res: any = await calculatPrice(params); | 969 | const res: any = await calculatPrice(params); |
| 970 | loading.value = false; | ||
| 971 | if (res.code === proxy.$passCode) { | 970 | if (res.code === proxy.$passCode) { |
| 972 | const data = res.data || {}; | 971 | const data = res.data || {}; |
| 973 | console.log('getCalculatPrice', data); | ||
| 974 | return data; // 返回计算结果以便后续使用 | 972 | return data; // 返回计算结果以便后续使用 |
| 975 | } else { | 973 | } else { |
| 976 | proxy.$ElMessage.error(res.msg); | 974 | proxy.$ElMessage.error(res.msg); |
| 975 | loading.value = false; | ||
| 977 | throw new Error(res.msg); // 抛出错误以便 catch 捕获 | 976 | throw new Error(res.msg); // 抛出错误以便 catch 捕获 |
| 978 | } | 977 | } |
| 979 | } catch (error) { | 978 | } catch (error) { |
| 980 | console.error('计算价格失败:', error); | ||
| 981 | loading.value = false; | 979 | loading.value = false; |
| 982 | throw error; // 重新抛出错误 | 980 | throw error; // 重新抛出错误 |
| 983 | } | 981 | } |
| ... | @@ -998,65 +996,8 @@ const checkForm = (type) => { | ... | @@ -998,65 +996,8 @@ const checkForm = (type) => { |
| 998 | dataTransactionPrice.value = priceData.transactionPrice.toFixed(2); | 996 | dataTransactionPrice.value = priceData.transactionPrice.toFixed(2); |
| 999 | 997 | ||
| 1000 | if (type == 'calculate') { | 998 | if (type == 'calculate') { |
| 1001 | // const { signatoryData, resultInfo } = reporting(baseConfigFormInfo); | 999 | loading.value = false; |
| 1002 | // exportData.value = resultInfo; | ||
| 1003 | // calculatePrice(signatoryData); | ||
| 1004 | } else if (type == 'export') { | 1000 | } else if (type == 'export') { |
| 1005 | // const { signatoryData, resultInfo } = reporting(baseConfigFormInfo); | ||
| 1006 | // exportData.value = resultInfo; | ||
| 1007 | // !dataTransactionPrice.value && calculatePrice(signatoryData); | ||
| 1008 | // loading.value = true; | ||
| 1009 | // let exportOut: any = {}; | ||
| 1010 | // // 估值对象信息 | ||
| 1011 | // const damName = typeMap.value.dataResourceGuid.find(f => f.damGuid == baseConfigFormInfo.dataResourceGuid)?.damName || ''; | ||
| 1012 | // exportOut.one = `因${baseConfigFormInfo.belongingEntityGuid}拟了解其所持有的\"${damName}\"相关数据资源的价格,为此需对该行为涉及的数据资源在不同应用场景下,基于数据资源持有单位的性质、信息化程度、数据稀缺性、需求匹配等情况下,为上述经济行为提供定价参考依据。`; | ||
| 1013 | // exportOut.two = `估值对象:${baseConfigFormInfo.belongingEntityGuid}持有的\"${damName}\"`; | ||
| 1014 | // // 估值范围信息 | ||
| 1015 | // const damNames = demandTableList.value.map(item => item.menuName) | ||
| 1016 | // let rangStr = `包含${damNames.join('、')}等${damNames.length}张表单,${damNames.length}张表共计${demandTableFieldAllNum.value}个字段`; | ||
| 1017 | // const dataTimeliness = pricingTargetList.value.find(p => p.dictionaryName == '时效性'); | ||
| 1018 | // const dataTimelinessStr = dataTimeliness ? typeMap.value[`dict_${dataTimeliness.guid}`].find(f => f.value == baseConfigFormInfo[`dict_${dataTimeliness.guid}`])?.label || '' : ''; | ||
| 1019 | // rangStr += dataTimelinessStr ? `,时间跨度为${dataTimelinessStr}的数据` : `的数据`; | ||
| 1020 | // damNames.length && (exportOut.two = `${exportOut.two}\n估值范围:${rangStr}`); | ||
| 1021 | // // 字典 | ||
| 1022 | // let dictList: any = [], hasModelScore = false; | ||
| 1023 | // const dictStr = exportData.value.map(e => { | ||
| 1024 | // // 检查是否有质量模型评分 | ||
| 1025 | // hasModelScore = hasModelScore || e.pricingTargetRSVOS.some( | ||
| 1026 | // t => t.targetType === '2' && t.functionName === '1' | ||
| 1027 | // ); | ||
| 1028 | |||
| 1029 | // // 只有当维度指标数大于1时才处理明细 | ||
| 1030 | // if (e.pricingTargetRSVOS.length > 1) { | ||
| 1031 | // const targetStr = e.pricingTargetRSVOS | ||
| 1032 | // .map(t => `${t.targetName}为${changeNum(t.tNum, 2)}`) | ||
| 1033 | // .join('、'); | ||
| 1034 | |||
| 1035 | // dictList.push(`${e.dimensionalityName}为${changeNum(e.sNum, 2)},其中${targetStr}`); | ||
| 1036 | // } | ||
| 1037 | |||
| 1038 | // return `${e.dimensionalityName}为${changeNum(e.sNum, 2)}`; | ||
| 1039 | // }) | ||
| 1040 | // let dictListStr = `${dictStr.join(',')}。\n${dictList.join(';\n')}` | ||
| 1041 | // // 质量模型 | ||
| 1042 | // if (hasModelScore) { | ||
| 1043 | // const { largeCategoryScoreList = [], qualityScore = 0 } = qualityScoreData.value; | ||
| 1044 | // const qualityParts = [ | ||
| 1045 | // `数据的总体质量得分为${changeNum(qualityScore, 2)}` | ||
| 1046 | // ]; | ||
| 1047 | |||
| 1048 | // if (largeCategoryScoreList.length) { | ||
| 1049 | // const categoryScores = largeCategoryScoreList.map( | ||
| 1050 | // q => `${q.largeCategoryName}方面得分为${changeNum(q.largeCategoryScore || 0, 2)}` | ||
| 1051 | // ); | ||
| 1052 | // qualityParts.push(`其中${categoryScores.join(',')}`); | ||
| 1053 | // } | ||
| 1054 | |||
| 1055 | // dictListStr += `;\n${qualityParts.join('。')}`; | ||
| 1056 | // } | ||
| 1057 | // exportOut.three = `${baseConfigFormInfo.belongingEntityGuid}持有的"${damName}"的数据(患者人次)单价为${changeNum(dataTransactionPrice.value, 2)}元${dictListStr ? `;其中${dictListStr}` : '。'}`; | ||
| 1058 | |||
| 1059 | loading.value = true; | ||
| 1060 | const exportOut = { | 1001 | const exportOut = { |
| 1061 | one: priceData.one, | 1002 | one: priceData.one, |
| 1062 | two: priceData.two, | 1003 | two: priceData.two, |
| ... | @@ -1081,14 +1022,10 @@ const checkForm = (type) => { | ... | @@ -1081,14 +1022,10 @@ const checkForm = (type) => { |
| 1081 | }); | 1022 | }); |
| 1082 | }) | 1023 | }) |
| 1083 | } else { | 1024 | } else { |
| 1084 | // const { signatoryData, resultInfo } = reporting(baseConfigFormInfo); | ||
| 1085 | // exportData.value = resultInfo; | ||
| 1086 | // !dataTransactionPrice.value && calculatePrice(signatoryData); | ||
| 1087 | let params = { | 1025 | let params = { |
| 1088 | ...paramsInfo, | 1026 | ...paramsInfo, |
| 1089 | dataTransactionPrice: dataTransactionPrice.value, | 1027 | dataTransactionPrice: dataTransactionPrice.value, |
| 1090 | } | 1028 | } |
| 1091 | loading.value = true; | ||
| 1092 | savePrice(params).then((res: any) => { | 1029 | savePrice(params).then((res: any) => { |
| 1093 | loading.value = false; | 1030 | loading.value = false; |
| 1094 | if (res.code == proxy.$passCode) { | 1031 | if (res.code == proxy.$passCode) { | ... | ... |
-
Please register or sign in to post a comment