|
|
@@ -59,7 +59,7 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<div class="export-table">
|
|
|
- <el-button type="primary" size="small" @click="toggleSelection()">表格导出</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleDownloadTable">表格导出</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
@@ -156,6 +156,39 @@
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
+ * 导出表格
|
|
|
+ */
|
|
|
+ handleDownloadTable() {
|
|
|
+ var _this = this
|
|
|
+ var params = { data: {}}
|
|
|
+ if (_this.drom_options.label) {
|
|
|
+ params.data.build = _this.drom_options.label
|
|
|
+ }
|
|
|
+ if (_this.room_options.room_label) {
|
|
|
+ params.data.dom = _this.room_options.room_label
|
|
|
+ }
|
|
|
+ if (_this.select_riqi.select_day) {
|
|
|
+ params.data.begin_time = _this.select_riqi.select_day
|
|
|
+ }
|
|
|
+ if (JSON.stringify(params.data) == '{}') {
|
|
|
+ params = ''
|
|
|
+ }
|
|
|
+ this.$axios.post('/api/HotWaters/watertoComExcel.action', params)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res.data.downurl);
|
|
|
+ if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
|
|
|
+ .data) != '{}') {
|
|
|
+ window.open('https://jtishfw.ncjti.edu.cn/jxch-smartmp' + res.data.downurl)
|
|
|
+ } else {
|
|
|
+ _this.$message.error('【未获得】表格!');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // console.log(err);
|
|
|
+ _this.$message.error('【导出表格】请求异常: ' + err);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 改变页码
|
|
|
* @param {Object} val
|
|
|
*/
|
|
|
@@ -184,7 +217,7 @@
|
|
|
this.select_riqi.select_month = ""
|
|
|
this.select_riqi.select_day = ""
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.table.currentPage = 1
|
|
|
|
|
|
// 获取年月日消费总金额
|
|
|
@@ -261,7 +294,7 @@
|
|
|
// console.log(obj);
|
|
|
this.drom_options.value = obj.value
|
|
|
this.drom_options.label = obj.label
|
|
|
-
|
|
|
+
|
|
|
this.table.currentPage = 1
|
|
|
|
|
|
// 获取宿舍号,填充宿舍号下拉列表
|
|
|
@@ -285,7 +318,7 @@
|
|
|
this.room_options.room_label = obj.label
|
|
|
|
|
|
this.table.currentPage = 1
|
|
|
-
|
|
|
+
|
|
|
// 组合参数,刷新消费表格
|
|
|
this.selectParams()
|
|
|
},
|