0c16ed30 by lxs

数据定价更新

1 parent 59e44231
...@@ -149,7 +149,7 @@ const setFormItems = (info = null) => { ...@@ -149,7 +149,7 @@ const setFormItems = (info = null) => {
149 const builtIndicators = datas.builtIndicators || buildInData.value || []; 149 const builtIndicators = datas.builtIndicators || buildInData.value || [];
150 let buildData = {}; 150 let buildData = {};
151 builtIndicators.map(item => { 151 builtIndicators.map(item => {
152 buildData[`build_${item.guid}`] = item.targetValue; 152 buildData[`build_${item.guid}`] = item.isInputParameter != 'Y' ? changeNum(item.targetValue, 2) : item.targetValue != '' && item.targetValue != null ? parseFloat(item.targetValue).toFixed(2) : '';
153 }); 153 });
154 datas = { ...datas, ...dictData, ...buildData }; 154 datas = { ...datas, ...dictData, ...buildData };
155 baseConfigFormItems.value.map(item => { 155 baseConfigFormItems.value.map(item => {
...@@ -274,10 +274,8 @@ const getDetail = () => { ...@@ -274,10 +274,8 @@ const getDetail = () => {
274 typeMap.value.modelGuid.unshift(mtem); 274 typeMap.value.modelGuid.unshift(mtem);
275 baseConfigFormItems.value[0].options.unshift(mtem); 275 baseConfigFormItems.value[0].options.unshift(mtem);
276 }; 276 };
277 setTimeout(() => { 277 getModelInfo(flowDetail.value.modelGuid);
278 getModelInfo(flowDetail.value.modelGuid); 278 getDataTypeList()
279 getDataTypeList()
280 }, 200)
281 } 279 }
282 }).catch(() => { 280 }).catch(() => {
283 loading.value = false; 281 loading.value = false;
...@@ -374,18 +372,20 @@ const setBuildInFormItems = (buildList) => { ...@@ -374,18 +372,20 @@ const setBuildInFormItems = (buildList) => {
374 buildInData.value.push({ 372 buildInData.value.push({
375 guid: b.guid, 373 guid: b.guid,
376 targetName: buildName, 374 targetName: buildName,
377 targetValue: b.defaultValue || '' 375 targetValue: b.defaultValue || '',
376 isInputParameter: b.isInputParameter,
378 }) 377 })
379 baseConfigFormItems.value.push({ 378 baseConfigFormItems.value.push({
380 label: buildName, 379 label: buildName,
381 type: 'input', 380 type: 'input',
382 placeholder: '', 381 placeholder: '',
383 field: buildField, 382 field: buildField,
384 default: guid ? '' : b.isInputParameter != 'Y' ? changeNum(b.defaultValue, 2) : b.defaultValue != '' && b.defaultValue != null ? parseFloat(b.defaultValue).toFixed(2) : '', 383 default: '',
385 inputType: 'moneyNumber', 384 inputType: 'moneyNumber',
386 maxlength: 18, 385 maxlength: 18,
387 clearable: true, 386 clearable: true,
388 disabled: b.isInputParameter != 'Y' 387 disabled: b.isInputParameter != 'Y',
388 required: true
389 }); 389 });
390 baseConfigFormRules.value[buildField] = [ 390 baseConfigFormRules.value[buildField] = [
391 { required: true, message: `请填写${buildName}`, trigger: 'blur' }, 391 { required: true, message: `请填写${buildName}`, trigger: 'blur' },
...@@ -660,8 +660,7 @@ const matchTableFields = (rData, tData) => { ...@@ -660,8 +660,7 @@ const matchTableFields = (rData, tData) => {
660 }, 0); 660 }, 0);
661 } 661 }
662 662
663 const setRowData = (rowData, dGuid) => { 663 const setRowData = (rowData, dGuid, detailDataTable) => {
664 const detailDataTable = (flowDetail.value.dataPricingDemandmatchingRQVOS || []).find(f => f.dataTableGuid == dGuid);
665 if (guid && dGuid == rowData.dataTableGuid) { 664 if (guid && dGuid == rowData.dataTableGuid) {
666 const pricingDemandField = detailDataTable?.pricingDemandFieldRQVOS || []; 665 const pricingDemandField = detailDataTable?.pricingDemandFieldRQVOS || [];
667 rowData.dataFields.map(f => { 666 rowData.dataFields.map(f => {
...@@ -677,12 +676,13 @@ const setRowData = (rowData, dGuid) => { ...@@ -677,12 +676,13 @@ const setRowData = (rowData, dGuid) => {
677 return accumulator + Number(currentValue.dataFieldsNum); 676 return accumulator + Number(currentValue.dataFieldsNum);
678 }, 0); 677 }, 0);
679 resourceTableAllNum.value = tableData.value.filter(item => item.dataTableGuid != '' && item.dataTableGuid != null).length; 678 resourceTableAllNum.value = tableData.value.filter(item => item.dataTableGuid != '' && item.dataTableGuid != null).length;
680 return detailDataTable.dataTableGuid || '';
681 } 679 }
682 680
683 const setTableRowData = (dGuid, rIndex, setRow = true) => { 681 const setTableRowData = (dGuid, rIndex, setRow = true) => {
684 let rowData = tableData.value[rIndex], currDataTableGuid = ""; 682 let rowData = tableData.value[rIndex];
685 setRow && (currDataTableGuid = setRowData(rowData, dGuid)); 683 const detailDataTable = (flowDetail.value.dataPricingDemandmatchingRQVOS || []).find(f => f.dataTableGuid == dGuid);
684 setRow && setRowData(rowData, dGuid, detailDataTable);
685 const currDataTableGuid = detailDataTable?.dataTableGuid || '';
686 if (dGuid) { 686 if (dGuid) {
687 tableLoading.value = true; 687 tableLoading.value = true;
688 getRegisterCatalogTableDetail(dGuid).then((res: any) => { 688 getRegisterCatalogTableDetail(dGuid).then((res: any) => {
...@@ -865,9 +865,15 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => { ...@@ -865,9 +865,15 @@ const getCalculateParams = (baseConfigFormObj, baseConfigFormInfo) => {
865 } 865 }
866 } 866 }
867 buildInData.value.map(item => { 867 buildInData.value.map(item => {
868 let targetValue = baseConfigFormInfo[`build_${item.guid}`];
869 if(typeof targetValue === 'string'){
870 if(/^[+-]?\d{1,3}(,\d{3})*(\.\d{2})?$/.test(targetValue)){
871 targetValue = parseFloat(targetValue.replace(/,/g, ''))
872 }
873 }
868 builtInTarget.push({ 874 builtInTarget.push({
869 ...item, 875 ...item,
870 targetValue: baseConfigFormInfo[`build_${item.guid}`], 876 targetValue
871 }) 877 })
872 }) 878 })
873 params.dictionaryJson = Object.keys(dictionaryJson).length ? JSON.stringify(dictionaryJson) : ''; 879 params.dictionaryJson = Object.keys(dictionaryJson).length ? JSON.stringify(dictionaryJson) : '';
...@@ -954,7 +960,7 @@ const checkForm = (type) => { ...@@ -954,7 +960,7 @@ const checkForm = (type) => {
954 message: '下载报告请求失败', 960 message: '下载报告请求失败',
955 }); 961 });
956 }) 962 })
957 } else if(type == 'submit') { 963 } else if (type == 'submit') {
958 let params = { 964 let params = {
959 ...paramsInfo, 965 ...paramsInfo,
960 dataTransactionPrice: dataTransactionPrice.value, 966 dataTransactionPrice: dataTransactionPrice.value,
...@@ -992,6 +998,11 @@ const btnClick = async (btn, row: any = null) => { ...@@ -992,6 +998,11 @@ const btnClick = async (btn, row: any = null) => {
992 expendTableRef.value.toggleRowExpansion(row); 998 expendTableRef.value.toggleRowExpansion(row);
993 } else if (type == 'calculate' || type == 'submit') { 999 } else if (type == 'calculate' || type == 'submit') {
994 if (type == 'submit') { 1000 if (type == 'submit') {
1001 const errorMsgText = document.querySelectorAll('.el-form-item__error');
1002 if (errorMsgText.length) {
1003 ElMessage.info('请修改错误提示项内容后,再操作');
1004 return
1005 }
995 ElMessageBox.confirm(dataTransactionPrice.value === '' ? '是否直接计算价格并提交' : '请确认当前数据交易价格是否为最新计算结果', '提示', { 1006 ElMessageBox.confirm(dataTransactionPrice.value === '' ? '是否直接计算价格并提交' : '请确认当前数据交易价格是否为最新计算结果', '提示', {
996 confirmButtonText: '确定', 1007 confirmButtonText: '确定',
997 cancelButtonText: '取消', 1008 cancelButtonText: '取消',
...@@ -1055,11 +1066,9 @@ onBeforeMount(() => { ...@@ -1055,11 +1066,9 @@ onBeforeMount(() => {
1055 getDetail(); 1066 getDetail();
1056 } else { 1067 } else {
1057 getDataTypeList(); 1068 getDataTypeList();
1058 getModel()
1059 } 1069 }
1060 }) 1070 })
1061 onMounted(() => { 1071 onMounted(() => {
1062 getModel()
1063 }) 1072 })
1064 </script> 1073 </script>
1065 <template> 1074 <template>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!