Table 表格導出功能

在這里插入圖片描述

<Card class="clearfix"><p slot="title"><Icon type="ios-list"></Icon>收入信息</p><!-- 導出1 --><div class="daochu1"><!-- 導出按鈕 --><div class="search"><Buttontype="warning"icon="ios-download-outline"@click="exportExcel1"class="searchButton">導出</Button></div><!-- 詳細列表 --><Tableref="table"border:row-class-name="rowClassName":columns="queryColumns1":data="queryinfoList1"style="width: 100%; top: 10px"@on-sort-change="sortTime"></Table></div><!-- 分頁 --><div style="margin-top: 20px; overflow: hidden"><div style="float: right"><Page:total="count"show-elevator@on-change="onchangePage"></Page></div></div></Card>
// 導出列表頭 1queryColumns11: [{title: "項目名稱",key: "projectName",align: "center",width: 200,},{title: "收入類型",key: "revenueType",align: "center",width: 150,},{title: "年度",key: "year",align: "center",width: 150,},{title: "1月",key: "monthAmount1",align: "center",width: 150,},{title: "2月",key: "monthAmount2",align: "center",width: 150,},{title: "3月",key: "monthAmount3",align: "center",width: 150,},{title: "4月",key: "monthAmount4",align: "center",width: 150,},{title: "5月",key: "monthAmount5",align: "center",width: 150,},{title: "6月",key: "monthAmount6",align: "center",width: 150,},{title: "7月",key: "monthAmount7",align: "center",width: 150,},{title: "8月",key: "monthAmount8",align: "center",width: 150,},{title: "9月",key: "monthAmount9",align: "center",width: 150,},{title: "10月",key: "monthAmount10",align: "center",width: 150,},{title: "11月",key: "monthAmount11",align: "center",width: 150,},{title: "12月",key: "monthAmount12",align: "center",width: 150,},{title: "年度累計",key: "monthAmount13",align: "center",width: 200,},{title: "更新時間",key: "updateTime",align: "center",width: 200,},],
 //導出收入信息exportExcel1() {this.$Spin.show({render: (h) => {return h("div", [h("Icon", {class: "demo-spin-icon-load",props: {type: "load-c",size: 50,},}),h("div", "努力記載中...."),]);},});this.excell = [];new Promise((resolve, reject) => {ApiDrug.exportincomeExport({}).then((response) => {let res = response.result;res.forEach((item, index) => {item.monthAmount1 = item.monthAmount["1"];item.monthAmount2 = item.monthAmount["2"];item.monthAmount3 = item.monthAmount["3"];item.monthAmount4 = item.monthAmount["4"];item.monthAmount5 = item.monthAmount["5"];item.monthAmount6 = item.monthAmount["6"];item.monthAmount7 = item.monthAmount["7"];item.monthAmount8 = item.monthAmount["8"];item.monthAmount9 = item.monthAmount["9"];item.monthAmount10 = item.monthAmount["10"];item.monthAmount11 = item.monthAmount["11"];item.monthAmount12 = item.monthAmount["12"];item.monthAmount13 = 0;if (item.revenueType == "2") {item.revenueType = "藥品服務費收入";}if (item.revenueType == "3") {item.revenueType = "特藥服務費收入";}if (item.revenueType == "4") {item.revenueType = "直保經紀費";}if (item.revenueType == "5") {item.revenueType = "再保經紀費";}if (item.revenueType == "6") {item.revenueType = "廣告費";}for (const key in item.monthAmount) {item.monthAmount13 += item.monthAmount[key];}});this.excel = response.result;this.excell = this.excel;//   導出方法   利用Vue 的 ref 獲取所需的dom節點進行方法設置this.$refs.table.exportCsv({//導出文件標題filename: "收入信息",//導出文件集合(內容)columns: this.queryColumns11.filter((col, index) => index < 100000),data: this.excel.filter((data, index) => index < 100000),});this.$Spin.hide();resolve();}).catch((error) => {this.$Spin.hide();reject(error);});});},

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/247866.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/247866.shtml
英文地址,請注明出處:http://en.pswp.cn/news/247866.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

iOS開發 簡單實現視頻音頻的邊下邊播

直接切入主題&#xff0c;要實現的功能是&#xff1a;1、ios視頻音頻邊緩存邊播放&#xff0c;緩存時可以在已下載的部分拖拽進度條。2、緩存到一半退出&#xff0c;再次播放同一地址的視頻時&#xff0c;視頻繼續下載&#xff0c;并且緩存進度已經走到上一次下載的位置。3、無…

volatile的原理和實現機制

volatile到底如何保證可見性和禁止指令重排序的。 “觀察加入volatile關鍵字和沒有加入volatile關鍵字時所生成的匯編代碼發現&#xff0c;加入volatile關鍵字時&#xff0c;會多出一個lock前綴指令” lock前綴指令實際上相當于一個內存屏障&#xff08;也成內存柵欄&#xff0…

Table城市代碼翻譯

// data 數據變量 eara&#xff1a;[]// 接口調用 getChinaList() {return fetch({url: "/api/v1/china/city/search",method: "GET"});},// table 欄中的 render 函數 render: (h, params) > {return h("span",this.dictCodesCommon(params.…

iOS中的WiFi與硬件通信

WiFi通信是指手機通過WiFi與外部設備建立連接&#xff0c;并與外部設備進行交互、通信。手機與外部設備的WiFi通信通常是使用Socket來實現的&#xff0c;在這里先介紹一個第三方Socket庫&#xff08;CocoaAsyncSocket&#xff09;來實現WiFi通信。 CocoaAsyncSocket支持TCP和U…

MongoDB查詢報錯:class com.mongodb.MongoSecurityException: Exception authenticating MongoCredential...

異常日志&#xff1a; 2019-05-30 10:10:24,252 [http-nio-8080-exec-1] DEBUG [java.sql.Connection] - ooo Connection Opened 2019-05-30 10:10:24,258 [http-nio-8080-exec-1] DEBUG [java.sql.PreparedStatement] - > Executing: insert into client_config ( appid, …

動態添加后的數據轉換 — 后臺接收數據

let data this.projectPersonnel.map(item > {let obj {}obj.member item.people.map(info > {return info.id})obj.member JSON.stringify(obj.member)obj.projectId idobj.teamId item.name.idreturn obj})

iOS開發--地圖與定位

iOS開發--地圖與定位 概覽 現在很多社交、電商、團購應用都引入了地圖和定位功能&#xff0c;似乎地圖功能不再是地圖應用和導航應用所特有的。的確&#xff0c;有了地圖和定位功能確實讓我們的生活更加豐富多彩&#xff0c;極大的改變了我們的生活方式。例如你到了一個陌生的地…

CTO、技術總監、首席架構師的區別

項目經理是項目的直接負責人&#xff0c;這個角色相當于一個中間接口&#xff0c;不管是團隊成員還是需求方&#xff08;客戶&#xff09;&#xff0c;或者是上級領導&#xff0c;有事都直接找他&#xff0c;所以這個職位著重 于管理與溝通。一般來說&#xff0c;項目經理的工作…

iview組件庫 - 穿梭欄設置

<Modalv-model"modal1"title"項目藥品上下架維護"width"1020":mask-closable"false"on-ok"addOk()"><Col span"36"><Selectfilterableon-change"onChangeProject"placeholder"請先…

如何優雅地使用Sublime Text3

Sublime Text&#xff1a;一款具有代碼高亮、語法提示、自動完成且反應快速的編輯器軟件&#xff0c;不僅具有華麗的界面&#xff0c;還支持插件擴展機制&#xff0c;用她來寫代碼&#xff0c;絕對是一種享受。相比于難于上手的Vim&#xff0c;浮腫沉重的Eclipse&#xff0c;VS…

題目:有一分數序列:2/1,3/2,5/3,8/5,13/8,21/13... 求出這個數列的前20項之和。...

題目&#xff1a;有一分數序列&#xff1a;2/1&#xff0c;3/2&#xff0c;5/3&#xff0c;8/5&#xff0c;13/8&#xff0c;21/13... 求出這個數列的前20項之和。 程序分析&#xff1a;請抓住分子與分母的變化規律。 public class 第二十題求數列之和 {public static void mai…

iview 組件 設置頭像更換

基于iview 組件 設置頭像更換 <!-- 頭像更換 --><div style"width: 100%;height:100%;"><div style"height: 100%;"><Upload :on-success"uploadSuccess" :show-upload-list"false" accept"image/png, i…

HTML的target屬性中_blank、_self、_parent、_top含義

_blank 瀏覽器會另開一個新窗口顯示鏈接_self&#xff0c;在同一框架或窗口中打開所鏈接的文檔。 此參數為默認值&#xff0c;通常不用指定。 _parent&#xff0c;將鏈接的文件載入含有該鏈接框架的父框架集或父窗口中。 如果含有該鏈接的框架不是嵌套的&#xff0c;則在瀏覽…

Windows 聚焦的鎖屏壁紙設置為桌面壁紙

需求&#xff1a; Windows的鎖屏壁紙偶爾遇到非常喜歡的壁紙&#xff0c;想設置為桌面壁紙。 步驟如下&#xff1a; 1. “Windows 聚焦”的鎖屏壁紙都保存在隱藏文件夾 --- Assets里。 a. 打開“資源管理器 b. 在地址欄復制粘貼下方路徑后按回車鍵&#xff0c;即可快速跳轉至這…

VUE藥監碼掃描

<!-- 藥監碼 --><div class"divContent"><div class"headDiv"><div class"spanA">請掃描相關藥監碼</div></div><button class"scanBtn" clickscan_img()>掃描藥監碼</button><bu…

Chrome 控制臺的console用法收集

Chrome 控制臺console的用法 大家都有用過各種類型的瀏覽器&#xff0c;每種瀏覽器都有自己的特色&#xff0c;本人拙見&#xff0c;在我用過的瀏覽器當中&#xff0c;我是最喜歡Chrome的&#xff0c;因為它對于調試腳本及前端設計調試都有它比其它瀏覽器有過之而無不及的地方。…

面向對象思想封裝狙擊手狙擊敵人

需求&#xff1a;狙擊手xxx使用xx槍&#xff0c;射擊敵人xxx,敵人生命值歸0&#xff0c;應聲倒下分析設計類&#xff1a; 封裝狙擊手類 屬性&#xff1a; 名字 行為&#xff1a;撿槍   裝彈   射擊封裝槍類 屬性&#xff1a; 型號 行為&#xff1a;射擊封裝彈夾類 屬性&…

JavaScript 字符串處理方法總結

變量從字符串轉換成int和float型 var weightincrease "2.5kg";undefinedparseInt(weightincrease);2parseFloat(weightincrease);2.5 字符串處理方法var words "魚神是個帥哥";undefinedwords.length6words.charAt(0);"魚"words.charAt(words.…

【js】vue 2.5.1 源碼學習(二) 策略合并

一、 整體思路1 首先是代碼的大體構造&#xff0c;先判斷引入代碼的環境&#xff0c;即對應amd 和cmd的處理2 vue_init 需要借助 initMinxin >>> // 初始化選項1: 規范 2: 合并策略。3 mergeOptions 選項合并 一個或者多個對象合并&#xff0c;并且生成一個…

解決公眾號的加載問題

相關組件內設置的方法&#xff08;方法可以多處組件運用&#xff09; <x-input on-change"changeinp" on-blur"temporaryRepair();" on-enter"temporaryRepair();" name"mobile" :show-clear"false" placeholder"…