4ff20d35 by lxs Committed by lihua

数据定价更新

1 parent 1f86e613
...@@ -15,6 +15,8 @@ import { getAllFlowData } from '@/api/modules/queryService'; ...@@ -15,6 +15,8 @@ import { getAllFlowData } from '@/api/modules/queryService';
15 import { 15 import {
16 getConfigureList, 16 getConfigureList,
17 deleteConfigure, 17 deleteConfigure,
18 getConfigureDetail,
19 addCopyConfigure
18 } from '@/api/modules/dataPricing'; 20 } from '@/api/modules/dataPricing';
19 21
20 const router = useRouter(); 22 const router = useRouter();
...@@ -95,7 +97,7 @@ const tableInfo = ref({ ...@@ -95,7 +97,7 @@ const tableInfo = ref({
95 97
96 // 过滤 98 // 过滤
97 const filterVal = (val, name) => { 99 const filterVal = (val, name) => {
98 if(typeMap.value[name]){ 100 if (typeMap.value[name]) {
99 const data = typeMap.value[name].find(item => item.value == val); 101 const data = typeMap.value[name].find(item => item.value == val);
100 return data?.label || '--'; 102 return data?.label || '--';
101 } 103 }
...@@ -172,17 +174,43 @@ const tableBtnClick = (scope, btn) => { ...@@ -172,17 +174,43 @@ const tableBtnClick = (scope, btn) => {
172 } 174 }
173 } 175 }
174 ); 176 );
175 } else if(type == 'copy'){ //复制 177 } else if (type == 'copy') { //复制
176 router.push( 178 ElMessageBox.confirm('是否确定复制该模型?', "提示", {
177 { 179 confirmButtonText: "确定",
178 name: 'priceModel', 180 cancelButtonText: "取消",
179 query: { 181 type: 'warning',
180 guid: row.guid, 182 }).then(() => {
181 name: `${row.modelName}_副本`, 183 getConfigureDetail({ guid: row.guid }).then((res: any) => {
182 type 184 if (res.code == proxy.$passCode) {
185 const data = res.data || {};
186 let params = { ...data };
187 delete params.createTime;
188 delete params.createUserName;
189 delete params.pricingDimensionalityRSVOS;
190 const pricingDimensionalityRSVOS = data.pricingDimensionalityRSVOS || [];
191 pricingDimensionalityRSVOS.map(p => {
192 p.pricingTargetRQVOS = p.pricingTargetRSVOS || [];
193 delete p.pricingTargetRSVOS;
194 });
195 params.pricingDimensionalityRQVOS = pricingDimensionalityRSVOS;
196 addCopyConfigure(params).then((res: any) => {
197 if (res.code == proxy.$passCode) {
198 ElMessage({
199 type: "success",
200 message: "复制定价配置成功",
201 });
202 getTableData();
203 } else {
204 proxy.$ElMessage.error(res.msg);
205 }
206 }).catch(() => {
207
208 });
183 } 209 }
184 } 210 }).catch(() => {
185 ); 211
212 })
213 });
186 } else if (type === 'del') { // 删除 214 } else if (type === 'del') { // 删除
187 open('确定要删除该条数据吗?', 'warning'); 215 open('确定要删除该条数据吗?', 'warning');
188 } 216 }
......
...@@ -15,8 +15,7 @@ import { ...@@ -15,8 +15,7 @@ import {
15 getDemandTreeList, 15 getDemandTreeList,
16 getConfigureDetail, 16 getConfigureDetail,
17 saveConfigure, 17 saveConfigure,
18 updateConfigure, 18 updateConfigure
19 addCopyConfigure
20 } from '@/api/modules/dataPricing'; 19 } from '@/api/modules/dataPricing';
21 20
22 const { proxy } = getCurrentInstance() as any; 21 const { proxy } = getCurrentInstance() as any;
...@@ -28,7 +27,6 @@ const fullPath = route.fullPath; ...@@ -28,7 +27,6 @@ const fullPath = route.fullPath;
28 const userData = JSON.parse(localStorage.userData); 27 const userData = JSON.parse(localStorage.userData);
29 const guid = route.query.guid; 28 const guid = route.query.guid;
30 const modelName = route.query.name; 29 const modelName = route.query.name;
31 const detailType = route.query.type;
32 30
33 const loading = ref(false); 31 const loading = ref(false);
34 const flowDetail: any = ref({}); 32 const flowDetail: any = ref({});
...@@ -794,7 +792,6 @@ const getModelDetail = () => { ...@@ -794,7 +792,6 @@ const getModelDetail = () => {
794 getConfigureDetail({ guid }).then((res: any) => { 792 getConfigureDetail({ guid }).then((res: any) => {
795 if (res.code == proxy.$passCode) { 793 if (res.code == proxy.$passCode) {
796 const data = res.data || {}; 794 const data = res.data || {};
797 detailType == 'copy' && (data.modelName = `${data.modelName}_副本`);
798 flowDetail.value = data; 795 flowDetail.value = data;
799 getDataTypeList() 796 getDataTypeList()
800 } 797 }
...@@ -993,37 +990,20 @@ const btnClick = async (btn, row: any = null) => { ...@@ -993,37 +990,20 @@ const btnClick = async (btn, row: any = null) => {
993 }; 990 };
994 if (guid) { 991 if (guid) {
995 params.guid = guid 992 params.guid = guid
996 if (detailType == 'copy') { 993 updateConfigure(params).then((res: any) => {
997 addCopyConfigure(params).then((res: any) => { 994 loading.value = false;
998 loading.value = false; 995 if (res.code == proxy.$passCode) {
999 if (res.code == proxy.$passCode) { 996 ElMessage({
1000 ElMessage({ 997 type: "success",
1001 type: "success", 998 message: guid ? "编辑定价配置成功" : "新增定价配置成功",
1002 message: "复制定价配置成功", 999 });
1003 }); 1000 toPath()
1004 toPath() 1001 } else {
1005 } else { 1002 proxy.$ElMessage.error(res.msg);
1006 proxy.$ElMessage.error(res.msg); 1003 }
1007 } 1004 }).catch(() => {
1008 }).catch(() => { 1005 loading.value = false;
1009 loading.value = false; 1006 });
1010 });
1011 } else {
1012 updateConfigure(params).then((res: any) => {
1013 loading.value = false;
1014 if (res.code == proxy.$passCode) {
1015 ElMessage({
1016 type: "success",
1017 message: guid ? "编辑定价配置成功" : "新增定价配置成功",
1018 });
1019 toPath()
1020 } else {
1021 proxy.$ElMessage.error(res.msg);
1022 }
1023 }).catch(() => {
1024 loading.value = false;
1025 });
1026 }
1027 } else { 1007 } else {
1028 saveConfigure(params).then((res: any) => { 1008 saveConfigure(params).then((res: any) => {
1029 loading.value = false; 1009 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!