| 
					
				 | 
			
			
				@@ -7,7 +7,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <div class="m-wrap"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-date-picker v-model="mouth" type="month" placeholder="选择月"></el-date-picker> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <div class="newBand" @click="exportSalar">导出课酬</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="newBand" @click="exportSalar" v-permission="'export/teacherSalary'">导出课酬</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-tooltip placement="top" popper-class="mTooltip"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <div slot="content"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             将只导出当前选择月份已结算的课程课酬。 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,6 +20,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {exportTeacherSalary} from '@/api/generalSettings' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import axios from 'axios' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getToken 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} from '@/utils/auth' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import qs from 'qs' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: "reportForm", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -34,26 +39,40 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.$message.error('请选择导出月份') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      exportTeacherSalary({date:this.mouth}).then(res=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(res.code == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-           let blob = new Blob([res.data], { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              type: 'application/vnd.ms-excel;charset=utf-8' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let objectUrl = URL.createObjectURL(blob) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let link = document.createElement("a") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let nowTime = new Date() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              nowTime.getHours() + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              '' + nowTime.getMinutes() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let fname = '课酬导出' + new Date().getTime() //下载文件的名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            link.href = objectUrl 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            link.setAttribute("download", fname) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            document.body.appendChild(link) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            link.click() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       let url = '/api-web/export/teacherSalary' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let data = {date:this.mouth} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const options = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        method: 'POST', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        headers: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          'Authorization': getToken() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        data: qs.stringify(data), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        responseType: 'blob' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$confirm('您确定导出发放清单', '提示', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        confirmButtonText: '确定', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cancelButtonText: '取消', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: 'warning' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        axios(options).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let blob = new Blob([res.data], { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type: 'application/vnd.ms-excel;charset=utf-8' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let objectUrl = URL.createObjectURL(blob) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let link = document.createElement("a") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let nowTime = new Date() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let fname =  ymd + '课酬' //下载文件的名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          link.href = objectUrl 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          link.setAttribute("download", fname) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          document.body.appendChild(link) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          link.click() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }).catch(() => { }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    
			 |