4ff20d35 by lxs Committed by lihua

数据定价更新

1 parent 1f86e613
......@@ -15,6 +15,8 @@ import { getAllFlowData } from '@/api/modules/queryService';
import {
getConfigureList,
deleteConfigure,
getConfigureDetail,
addCopyConfigure
} from '@/api/modules/dataPricing';
const router = useRouter();
......@@ -95,7 +97,7 @@ const tableInfo = ref({
// 过滤
const filterVal = (val, name) => {
if(typeMap.value[name]){
if (typeMap.value[name]) {
const data = typeMap.value[name].find(item => item.value == val);
return data?.label || '--';
}
......@@ -172,17 +174,43 @@ const tableBtnClick = (scope, btn) => {
}
}
);
} else if(type == 'copy'){ //复制
router.push(
{
name: 'priceModel',
query: {
guid: row.guid,
name: `${row.modelName}_副本`,
type
} else if (type == 'copy') { //复制
ElMessageBox.confirm('是否确定复制该模型?', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
getConfigureDetail({ guid: row.guid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
let params = { ...data };
delete params.createTime;
delete params.createUserName;
delete params.pricingDimensionalityRSVOS;
const pricingDimensionalityRSVOS = data.pricingDimensionalityRSVOS || [];
pricingDimensionalityRSVOS.map(p => {
p.pricingTargetRQVOS = p.pricingTargetRSVOS || [];
delete p.pricingTargetRSVOS;
});
params.pricingDimensionalityRQVOS = pricingDimensionalityRSVOS;
addCopyConfigure(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: "复制定价配置成功",
});
getTableData();
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
});
}
);
}).catch(() => {
})
});
} else if (type === 'del') { // 删除
open('确定要删除该条数据吗?', 'warning');
}
......
......@@ -15,8 +15,7 @@ import {
getDemandTreeList,
getConfigureDetail,
saveConfigure,
updateConfigure,
addCopyConfigure
updateConfigure
} from '@/api/modules/dataPricing';
const { proxy } = getCurrentInstance() as any;
......@@ -28,7 +27,6 @@ const fullPath = route.fullPath;
const userData = JSON.parse(localStorage.userData);
const guid = route.query.guid;
const modelName = route.query.name;
const detailType = route.query.type;
const loading = ref(false);
const flowDetail: any = ref({});
......@@ -794,7 +792,6 @@ const getModelDetail = () => {
getConfigureDetail({ guid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
detailType == 'copy' && (data.modelName = `${data.modelName}_副本`);
flowDetail.value = data;
getDataTypeList()
}
......@@ -993,22 +990,6 @@ const btnClick = async (btn, row: any = null) => {
};
if (guid) {
params.guid = guid
if (detailType == 'copy') {
addCopyConfigure(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: "复制定价配置成功",
});
toPath()
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
} else {
updateConfigure(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
......@@ -1023,7 +1004,6 @@ const btnClick = async (btn, row: any = null) => {
}).catch(() => {
loading.value = false;
});
}
} else {
saveConfigure(params).then((res: any) => {
loading.value = false;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!