|
@@ -21,6 +21,8 @@
|
|
|
</div>
|
|
|
</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>
|
|
|
<div class="content" v-if="list.length>0">
|
|
|
<table width="auto" border="0">
|
|
|
<thead class="border-head">
|
|
@@ -28,11 +30,15 @@
|
|
|
<td v-for="(val,index) in labelArr" :key="`${val}_${index}`">
|
|
|
{{ val }}
|
|
|
</td>
|
|
|
+ <td v-if="haveSummation && summationView">操作</td>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<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>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
@@ -54,8 +60,17 @@
|
|
|
// 广期所数据
|
|
|
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,
|
|
@@ -66,9 +81,13 @@ export default {
|
|
|
Unit: "单位",
|
|
|
Frequency: "频度",
|
|
|
StartDate: "起始日期",
|
|
|
- EndDate: "最新日期"
|
|
|
+ EndDate: "最新日期",
|
|
|
+ // Operations:"操作"
|
|
|
},
|
|
|
+ summationView:true,// 当前是否是合计
|
|
|
+ haveSummation:false, // 是否有合计
|
|
|
time:'',
|
|
|
+ topLevelType:'',
|
|
|
type:'',
|
|
|
typeList:[],
|
|
|
defaultShowNodes:[],
|
|
@@ -102,11 +121,11 @@ export default {
|
|
|
this.typeList=res.Data || []
|
|
|
try {
|
|
|
this.type=this.typeList[0].Children[0].BaseFromTradeGuangzhouClassifyId
|
|
|
+ this.topLevelType = this.typeList[0].BaseFromTradeGuangzhouClassifyId
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.treeRef.setCurrentKey(this.type);
|
|
|
});
|
|
|
this.defaultShowNodes=[this.typeList[0].BaseFromTradeGuangzhouClassifyId,this.typeList[0].Children[0].BaseFromTradeGuangzhouClassifyId]
|
|
|
- // this.getNumList()
|
|
|
} catch (error) {
|
|
|
console.error('Data的返回存在问题或为空');
|
|
|
}
|
|
@@ -124,10 +143,12 @@ export default {
|
|
|
handleChangeType(data, node) {
|
|
|
if (data.BaseFromTradeGuangzhouClassifyId == this.type || (!data.ParentId)) return;
|
|
|
this.type = data.BaseFromTradeGuangzhouClassifyId
|
|
|
+ this.topLevelType = data.ParentId
|
|
|
this.getNumList()
|
|
|
},
|
|
|
// 获取合约号
|
|
|
async getNumList(){
|
|
|
+ this.loading=true
|
|
|
guangqiInterface.getContractList({
|
|
|
BaseFromTradeGuangzhouClassifyId:this.type,
|
|
|
TradeDate:this.time,
|
|
@@ -136,10 +157,13 @@ export default {
|
|
|
this.numList=res.Data||[]
|
|
|
this.num=this.numList[0]?this.numList[0].BaseFromTradeGuangzhouContractId||'':''
|
|
|
this.getData()
|
|
|
+ }else{
|
|
|
+ this.loading=false
|
|
|
}
|
|
|
+ }).catch(()=>{
|
|
|
+ this.loading=false
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
getData(){
|
|
|
$('.content').animate({scrollTop:0},0)
|
|
|
this.loading=true
|
|
@@ -152,9 +176,17 @@ export default {
|
|
|
this.list=res.Data || []
|
|
|
}
|
|
|
}).finally(()=>{
|
|
|
+ this.haveSummation = this.topLevelType == 4
|
|
|
this.loading=false
|
|
|
})
|
|
|
-
|
|
|
+ },
|
|
|
+ detailView(){
|
|
|
+ // TODO: 详情接口对接
|
|
|
+ this.summationView=false
|
|
|
+ },
|
|
|
+ excelExport(){
|
|
|
+ // TODO: 导出接口对接
|
|
|
+ downloadByFlow('Export','xlsx','si2312一次性交割卖方仓单详情')
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -167,6 +199,12 @@ export default {
|
|
|
.right-wrap{
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+ .export-button{
|
|
|
+ align-self: flex-start;
|
|
|
+ padding:0 40px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
.content{
|
|
|
flex-grow: 1;
|
|
|
min-height: 90%;
|