3703e25a by lxs Committed by lihua

数据定价对接计算接口

1 parent 79543f62
......@@ -905,16 +905,15 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => {
const getCalculatPrice = async (params) => {
try {
const res: any = await calculatPrice(params);
loading.value = false;
if (res.code === proxy.$passCode) {
const data = res.data || {};
return data; // 返回计算结果以便后续使用
} else {
proxy.$ElMessage.error(res.msg);
loading.value = false;
throw new Error(res.msg); // 抛出错误以便 catch 捕获
}
} catch (error) {
console.error('计算价格失败:', error);
loading.value = false;
throw error; // 重新抛出错误
}
......@@ -933,8 +932,10 @@ const checkForm = (type) => {
const priceData = await getCalculatPrice(paramsInfo);
// 显示结果
dataTransactionPrice.value = priceData.transactionPrice.toFixed(2);
if (type == 'export') {
loading.value = true;
if (type == 'calculate') {
loading.value = false;
} else if (type == 'export') {
const exportOut = {
one: priceData.one,
two: priceData.two,
......@@ -958,12 +959,11 @@ const checkForm = (type) => {
message: '下载报告请求失败',
});
})
} else if (type == 'submit') {
} else {
let params = {
...paramsInfo,
dataTransactionPrice: dataTransactionPrice.value,
}
loading.value = true;
savePrice(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!