Browse Source

问题修改

hbchen 5 months ago
parent
commit
1d9e6c362b

+ 8 - 9
src/views/datasheet_manage/components/calculateEdbDia.vue

@@ -369,7 +369,6 @@ export default {
         relationDate: '',//关联的表格日期
         relationUid: '',//关联格子的uid
       },
-      baseSourceName:''
     }
   },
   mounted(){
@@ -453,6 +452,13 @@ export default {
       const res = await sheetInterface.getMixedCalculateData(params)
       if(res.Ret!==200) return 
 
+      let baseSourceName=''
+      await sheetInterface.getEdbBaseSource({EdbInfoId:this.selectEdbInfo.EdbInfoId}).then(res=>{
+        if(res.Ret == 200){
+          // 获取原始指标的来源
+          baseSourceName = res.Data.ExcelSource || ''
+        }
+      })
       this.showResult = true;
       
       this.chooseItem = {
@@ -461,7 +467,7 @@ export default {
         EdbInfoId: this.selectEdbInfo.EdbInfoId,
         InsertValue: res.Data.ShowValue||"",
         Str: JSON.stringify(params),
-        sourceName:this.baseSourceName||''
+        sourceName:baseSourceName||''
       }
 
       // if(!this.calculateShowData.length) return this.$message.warning('该日期无数据')
@@ -484,13 +490,6 @@ export default {
         : await dataBaseInterface.targetList({EdbInfoId:e.EdbInfoId,CurrentIndex: 1})
 
       if(res.Ret !== 200) return
-
-      sheetInterface.getEdbBaseSource({EdbInfoId:e.EdbInfoId}).then(res=>{
-        if(res.Ret == 200){
-          // 获取原始指标的来源
-          this.baseSourceName = res.Data.ExcelSource || ''
-        }
-      })
       
       const { EdbInfoId,EdbCode,EdbName,Frequency,Unit,StartDate,ModifyTime,PredictDataList,DataList,HaveOperaAuth } = res.Data.Item;
 

+ 11 - 5
src/views/datasheet_manage/components/insertDateDia.vue

@@ -165,12 +165,18 @@ export default {
         
         // 获取原始指标来源
         let baseSourceName=''
-        let SourceData = await sheetInterface.getEdbBaseSource({
-          EdbInfoId:this.selectEdbInfo.EdbInfoId
-        })
-        if(SourceData.Ret == 200){
-          baseSourceName = SourceData.Data.ExcelSource
+        if(this.dateChangeSelect==2){
+          // 获取指标日期的指标的原始来源
+          await sheetInterface.getEdbBaseSource({
+            EdbInfoId:this.selectEdbInfo.EdbInfoId
+          }).then(res=>{
+            if(res.Ret == 200){
+              baseSourceName = res.Data.ExcelSource || ''
+            }
+          })
         }
+
+
         backData = {
           insertValue: Data.Date,
           dataTimeType: this.dateChangeSelect,

+ 7 - 6
src/views/datasheet_manage/components/selectTargetValueDia.vue

@@ -180,19 +180,20 @@ export default {
       if(res.Ret !== 200) return
 
       this.result = res.Data;
-      console.log(this.result,'this.result');
       let value = (this.result.List&&this.result.List.length)
         ? this.result.List.find(_ => _.DataTime===this.result.Date) ? this.result.List.find(_ => _.DataTime===this.result.Date).Value.toString() : ''
         : ''
 
-      // 获取原始指标来源
       let baseSourceName=''
-      let SourceData = await sheetInterface.getEdbBaseSource({
+      // 获取指标日期的指标的原始来源
+      await sheetInterface.getEdbBaseSource({
         EdbInfoId:this.edbInfo.EdbInfoId
+      }).then(res=>{
+        if(res.Ret == 200){
+          baseSourceName = res.Data.ExcelSource || ''
+        }
       })
-      if(SourceData.Ret == 200){
-        baseSourceName = SourceData.Data.ExcelSource
-      }
+
       this.chooseItem = {
         relationDate: Date,
         relationUid: this.dateSelectForm.Type===2 ? this.dateSelectForm.relationUid : '',

+ 0 - 1
src/views/datasheet_manage/customSheetEdit.vue

@@ -259,7 +259,6 @@ export default {
         SortType: this.$refs.customTableRef.config.order===1 ? 'desc' : 'asc',
         Num: 12
       })
-      console.log(Data,'DataData');
       this.updateSourceFrom(Data.ExcelSource)
       this.$refs.customTableRef.updateEdbData({
         Data: Data.Data.map(_ => ({..._,DataTimeType: 1,})),