Pārlūkot izejas kodu

Merge branch 'bug5664' into custom

ldong 2 mēneši atpakaļ
vecāks
revīzija
c0a77cc82d
1 mainītis faili ar 29 papildinājumiem un 14 dzēšanām
  1. 29 14
      src/views/dataEntry_manage/dataEntry/index.vue

+ 29 - 14
src/views/dataEntry_manage/dataEntry/index.vue

@@ -240,12 +240,12 @@ export default {
 
     exportUrl() {
       let exportDataurl = process.env.VUE_APP_API_ROOT + "/entry/export/dataList";
-
+      // console.log(this.momentType)
       let str = `${exportDataurl}?ClassifyId=${
-        this.selectClassifyId
+        this.momentType=='detail'?0:this.selectClassifyId
       }&TradeCode=${
         this.selectedEdb ? this.selectedEdb : ''
-      }&StartDate=&EndDate=&Mobile=&${localStorage.getItem("auth")}`;
+      }&Frequency=${this.momentType=='detail'?'':this.frequencySelect}&StartDate=&EndDate=&Mobile=&${localStorage.getItem("auth")}`;
       return str.replace(/#/g, encodeURIComponent("#")).replace(/;/g, encodeURIComponent(";"));
     },
     frequencyArr(){
@@ -256,16 +256,18 @@ export default {
     search_txt(nval) {
       if(!nval) return
 
-      this.selectClassifyId = 0;
+      // this.selectClassifyId = 0;
+      this.momentType='detail'
 			this.selectedEdb = nval;
 
-			this.selectNode = this.searchOptions.find(_ => _.TradeCode===nval).UniqueCode;
+			// this.selectNode = this.searchOptions.find(_ => _.TradeCode===nval).UniqueCode;
     }
   },
   data() {
     return {
       tableSearch:{},
       frequencySelect:'',
+      momentType:"",//当前选中类型 菜单or详情
       defaultProp: {
         label: 'ClassifyName',
         children: 'Child',
@@ -340,11 +342,17 @@ export default {
     changeFrequency(){
       this.selectedEdb=''
       this.pageNo = 1;
+      this.getClassify()
+      if(this.momentType){
+        this.defaultShowNodes=[this.selectNode]
+        this.momentType='list'
+      }
       this.getTableData()
     },
     lookDetailHandle(row) {
-      this.selectClassifyId = 0;
-			this.selectNode = '';
+      // this.selectClassifyId = 0;
+			// this.selectNode = '';
+      this.momentType='detail'
 			this.selectedEdb = row.TradeCode;
     },
 
@@ -359,6 +367,7 @@ export default {
 
     //加载子指标
     async getLazyTreeData(node,resolve,maxLevel=2) {
+      // console.log(node)
       if(node.level===0){
 				resolve(this.classifyList)
 			}else if(node.level>0&&node.level<maxLevel){
@@ -366,9 +375,13 @@ export default {
 				resolve(node.data.Child||[])
 			}else{
 				let arr=[]
-				const res=await dataInterence.getClassifyLoadChild({
+        let params={
           ClassifyId: node.data.ClassifyId
-        })
+        }
+        if(this.frequencySelect){
+          params['Frequency']=this.frequencySelect
+        }
+				const res=await dataInterence.getClassifyLoadChild(params)
 				if (res.Ret === 200) {
 					const temarr = res.Data.List || [];
 					arr=temarr.map(item=>{
@@ -384,7 +397,7 @@ export default {
 
     async getTableData() {
       this.tableSearch={
-        ClassifyId: this.selectClassifyId,
+        ClassifyId:this.momentType?this.selectClassifyId:0,
         CurrentIndex: this.pageNo,
         PageSize: this.pageSize,
         Frequency:this.frequencySelect
@@ -435,11 +448,14 @@ export default {
 
     //选中节点
     nodeChange(data,node) {
-      this.selectClassifyId = !data.TradeCode?data.ClassifyId:0;
-			this.selectNode = data.UniqueCode;
+      if(!data.TradeCode){
+        this.selectClassifyId = data.ClassifyId;
+        this.selectNode = data.UniqueCode;
+      }
 			this.selectedEdb = data.TradeCode;
+      this.momentType= !data.TradeCode?'list':'detail'
       
-      if(this.selectClassifyId){
+      if(this.momentType=='list'){
         this.pageNo = 1;
         this.getTableData();
       }
@@ -650,6 +666,5 @@ export default {
 			padding-right: 10px !important;
 		}
 	}
-
 } 
 </style>