瀏覽代碼

ETA1.6.0广期所 完成

hbchen 1 年之前
父節點
當前提交
be8b68f5ef
共有 2 個文件被更改,包括 65 次插入17 次删除
  1. 18 0
      src/api/modules/thirdBaseApi.js
  2. 47 17
      src/views/dataEntry_manage/thirdBase/gqExchangeData.vue

+ 18 - 0
src/api/modules/thirdBaseApi.js

@@ -811,6 +811,24 @@ const guangqiInterface={
 	getIndexDataList:params=>{
 		return http.get('/data_source/gfex/index_data',params);
 	},
+	/**
+ * 获取指标数据详情(一次性交割卖方仓单查询)
+ * @param {} params 
+ * BaseFromTradeGuangzhouIndexId TradeDate
+ * @returns 
+ */
+	getIndexDataDetail:params=>{
+		return http.get('/data_source/gfex/index/detail',params);
+	},
+	/**
+ * 导出指标数据详情(一次性交割卖方仓单查询)
+ * @param {} params 
+ * BaseFromTradeGuangzhouIndexId TradeDate
+ * @returns 
+ */
+	exportIndexDataDetail:params=>{
+		return http.get('/data_source/gfex/index/detail/export',params);
+	},
 }
 
 export { 

+ 47 - 17
src/views/dataEntry_manage/thirdBase/gqExchangeData.vue

@@ -22,7 +22,7 @@
         </div>
         <div class="right-wrap box" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
             <el-button v-if="list.length>0 && haveSummation && (!summationView)" 
-                class="export-button" type="primary" plain @click="excelExport">导出Excel</el-button>
+                class="export-button" type="primary" plain @click="excelExport" :loading="exportBtnload">导出Excel</el-button>
             <div class="content" v-if="list.length>0">
                 <table width="auto" border="0">
                     <thead class="border-head">
@@ -37,7 +37,7 @@
                         <tr v-for="item in list" :key="item.BaseFromTradeGuangzhouIndexId">
                             <td v-for="(val,key) in labelArr" :key="key">{{item[key]}}</td>
                             <td v-if="haveSummation && summationView">
-                                <el-button type="text" @click="detailView">查看详情</el-button>
+                                <el-button type="text" @click="detailView(item)">查看详情</el-button>
                             </td>
                         </tr>
                     </tbody>
@@ -60,17 +60,8 @@
 // 广期所数据
 import { guangqiInterface } from "@/api/api.js";
 import {waitRequestReturn} from '@/utils/common.js'
-import {downloadByFlow} from '@/utils/common.js'
 export default {
     name: "gqExchangeData",
-    watch:{
-        type(value){
-            this.summationView=true
-        },
-        time(value){
-            this.summationView=true
-        }
-    },
     data() {
         return {
             isLeftWrapShow:true,
@@ -95,15 +86,35 @@ export default {
             num:'',
             list:[],
             loading:false,
+            tradeIndexId:'',
+            exportApi:process.env.VUE_APP_API_ROOT + "/data_source/gfex/index/detail/export",
+            exportBtnload:false
         };
     },
+    watch:{
+        type(value){
+            this.summationView=true
+        },
+        time(value){
+            this.summationView=true
+        }
+    },
+    computed:{
+        exportUrl(){
+            let url=this.exportApi + 
+                `?${localStorage.getItem("auth") || ""}&BaseFromTradeGuangzhouIndexId=${this.tradeIndexId}&TradeDate=${this.time}`
+            return this.escapeStr(url);
+        }
+    },
     created () {
         this.getClassifyListFun()  
         this.getNewtestDateFun()  
         waitRequestReturn(()=> this.type && this.time,this.getNumList,10)
     },
     methods: {
-
+        escapeStr(str) {
+            return str.replace(/#/g, escape("#")).replace(/;/g, escape(";"));
+        },
         handleChangeNum(e){
             this.num=e.BaseFromTradeGuangzhouContractId
             this.getData()
@@ -180,13 +191,32 @@ export default {
                 this.loading=false
             })
         },
-        detailView(){
-            // TODO: 详情接口对接
-            this.summationView=false
+        detailView(item){
+            this.loading=true
+            this.tradeIndexId = item.BaseFromTradeGuangzhouIndexId
+            let params={
+                BaseFromTradeGuangzhouIndexId:item.BaseFromTradeGuangzhouIndexId,
+                TradeDate:this.time
+            }
+            guangqiInterface.getIndexDataDetail(params).then(res=>{
+                if(res.Ret == 200){
+                    this.list=res.Data || []
+                    this.summationView=false
+                }
+            })
+            .finally(()=>{
+                this.loading=false
+            })
         },
         excelExport(){
-            // TODO: 导出接口对接
-            downloadByFlow('Export','xlsx','si2312一次性交割卖方仓单详情')
+            this.exportBtnload = true;
+            const link = document.createElement("a");
+            link.href = this.exportUrl;
+            link.download = "";
+            link.click();
+            setTimeout(() => {
+                this.exportBtnload = false;
+            }, 2000);
         }
     }
 };