53a898a2ba118d1d5e3442914c4cc3b77b7c48e9.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <el-container style="height:100%;">
  3. <el-header style="display:flex;align-items:center;">
  4. <p>督查对象类别</p>
  5. <el-select v-model="currentDCType" placeholder="请选择督查类型" style="margin-left:10px;margin-right:15px">
  6. <el-option
  7. v-for="item in DCTypeOption"
  8. :key="item.value"
  9. :label="item.label"
  10. :value="item.value">
  11. </el-option>
  12. </el-select>
  13. <p>督查组分类</p>
  14. <el-select v-model="currentDcTermId" placeholder="请选择督查组分类" style="margin-left:10px;margin-right:15px">
  15. <el-option
  16. v-for="item in DCTermOption"
  17. :key="item.id"
  18. :label="item.nm"
  19. :value="item.id">
  20. </el-option>
  21. </el-select>
  22. <p>选择时间段</p>
  23. <el-date-picker v-model="sttm" type="date" value-format="yyyy-MM-dd"
  24. placeholder="选择日期" style="width: 130px;margin-left:10px"></el-date-picker>
  25. <span style="padding-left: 10px;padding-right: 10px;">至</span>
  26. <el-date-picker v-model="ettm" type="date" value-format="yyyy-MM-dd"
  27. placeholder="选择日期" style="width: 130px"></el-date-picker>
  28. <el-button type="primary" icon="el-icon-search" style="margin-left:20px;" plain @click="searchExecl">查询</el-button>
  29. <el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button>
  30. </el-header>
  31. <el-main id="dcjhMain">
  32. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%'}" v-loading="loading">
  33. <iframe ref="myIframe" id="frameMainDcjh" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  34. </div>
  35. </el-main>
  36. </el-container>
  37. </template>
  38. <script>
  39. import request from '../../../utils/gw_ajax_request.js';
  40. import {getArenGrpMen, addDczOthersMens,getPlanNodeByPersid,getTermByPersid,getPersPlanType} from "@api/duChaPlan.js";
  41. import {dateFormat} from '../../../utils/gw_date.js'
  42. export default {
  43. props: [],
  44. components: {
  45. },
  46. data() {
  47. return {
  48. currentDCType:'', // ptype
  49. DCTypeOption:[],
  50. currentDcTermId:'', // pid
  51. DCTermOption:[],
  52. loading:true,
  53. reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=dcjh_Sheet1.raq',
  54. excelName:'督查计划表',
  55. sttm:'',
  56. ettm:'',
  57. dxdcMainHeight: window.innerHeight-200,
  58. dxdcAsideHeight: window.innerHeight-90,
  59. windowHeight:window.innerHeight - 200,
  60. windowWidth:window.innerWidth - 50,
  61. }
  62. },
  63. computed:{
  64. userId:function(){
  65. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  66. },
  67. userInAllNode:function(){//当前登录用户所在的所有组信息
  68. return JSON.parse(localStorage.getItem("allNode"))? JSON.parse(localStorage.getItem("allNode")): []
  69. },
  70. guId:function(){
  71. return localStorage.getItem("guid")? localStorage.getItem("guid"): '000'
  72. },
  73. orgName(){
  74. return localStorage.getItem("orgName")? localStorage.getItem("orgName"): ''
  75. },
  76. userType(){
  77. return localStorage.getItem("userType")? localStorage.getItem("userType"): '1'
  78. },
  79. currentShowLists:function(){
  80. return this.currentShowList.filter(item => item.persName.indexOf(this.member_search) > -1)
  81. },
  82. isAdmin:function(){
  83. return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
  84. },
  85. },
  86. watch:{
  87. currentDCType:function(){
  88. // this.searchExecl()
  89. this.test_getDuChaPlanInformation();
  90. },
  91. currentDcTermId:function(){
  92. // this.searchExecl()
  93. },
  94. sttm(n,o){
  95. if(n == null){
  96. this.sttm = "";
  97. }
  98. },
  99. ettm(n,o){
  100. if(n == null){
  101. this.ettm = "";
  102. }
  103. }
  104. },
  105. mounted(){
  106. this.searchExecl()
  107. },
  108. methods:{
  109. getUserPlanType:function(){
  110. let _self = this;
  111. getPersPlanType(this.userId).then(res =>{
  112. this.DCTypeOption = res.data;
  113. this.DCTypeOption.forEach((option)=>{
  114. // option['value'] = Number(option['id']) + '';
  115. option['value'] = option['id'];
  116. option['label'] = option['name'];
  117. });
  118. this.DCTypeOption.unshift({'value':'','label':'全部'});
  119. this.currentDCType = this.DCTypeOption[0].value;
  120. this.test_getDuChaPlanInformation();
  121. });
  122. },
  123. test_getDuChaPlanInformation:function(){
  124. //当下折中方案,需要后续更改,提供所需接口后进行抛弃 @wxcwater
  125. getPlanNodeByPersid(this.userId,this.currentDCType.replace('00','')).then((res)=>{
  126. console.log(res);
  127. this.DCTermOption = res.data;
  128. this.DCTermOption.unshift({'id':'','nm':'全部'});
  129. this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
  130. });
  131. },
  132. // 获取Excel数据
  133. searchExecl(){
  134. this.loading = true;
  135. let _this = this;
  136. let iframe = document.getElementById("frameMainDcjh");
  137. let src = this.reportSrc;
  138. iframe.src= src
  139. + "&width=" + this.windowWidth
  140. + "&height=" + this.windowHeight
  141. + "&excelName=" + this.excelName
  142. + "&sttm=" + this.sttm
  143. + "&ettm=" + this.ettm
  144. + "&ptype=" + this.currentDCType
  145. + "&pid=" + this.currentDcTermId
  146. + "&persid=" + this.userId
  147. if (iframe.attachEvent){
  148. iframe.attachEvent("onload", function(){
  149. _this.loading = false;
  150. });
  151. } else {
  152. iframe.onload = function(){
  153. _this.loading = false;
  154. };
  155. }
  156. },
  157. // 导出Excel数据
  158. exportExecl(){
  159. v = window.frames["frameMainDcjh"];
  160. v.contentWindow.report1_saveAsExcel();
  161. },
  162. },
  163. activated() {
  164. this.getUserPlanType()
  165. }
  166. }
  167. </script>
  168. <style>
  169. </style>