b02f33b7dcb219ab90f6cc22a95adcd2cb9dd450.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <el-container style="height:100%;">
  3. <el-header style="display:flex;align-items:center;">
  4. <p class="pStyle">督查对象类别:</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 class="pStyle">机构:</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 class="pStyle">督查状态:</p>
  23. <el-select v-model="dcType" clearable placeholder="督查状态" style="margin-left:10px;margin-right:15px">
  24. <el-option label="未督查" value="0"></el-option>
  25. <el-option label="督查中" value="1"></el-option>
  26. <el-option label="已督查" value="2"></el-option>
  27. </el-select>
  28. <p class="pStyle">省份:</p>
  29. <el-input v-model="province" clearable style="width: 130px;margin-left:10px;margin-right:15px"></el-input>
  30. <p class="pStyle">选择月份:</p>
  31. <el-date-picker
  32. style="width: 130px;margin-left:10px"
  33. v-model="monthValue"
  34. value-format="yyyy-MM"
  35. type="month"
  36. placeholder="选择月份">
  37. </el-date-picker>
  38. <el-button type="primary" icon="el-icon-search" style="margin-left:20px;" @click="searchExecl">查询</el-button>
  39. <!--<el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button>-->
  40. </el-header>
  41. <el-main id="dcjhMain">
  42. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
  43. <iframe ref="myIframe" id="frameMainDcjh" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  44. </div>
  45. </el-main>
  46. </el-container>
  47. </template>
  48. <script>
  49. import request from '../../../utils/gw_ajax_request.js';
  50. import {getPersPlanType} from "@api/duChaPlan.js";
  51. export default {
  52. props: [],
  53. components: {
  54. },
  55. data() {
  56. return {
  57. currentDCType:'', // ptype
  58. DCTypeOption:[],
  59. currentDcTermId:'', // pid
  60. DCTermOption:[],
  61. loading:true,
  62. reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=dcjh_Sheet1.raq',
  63. excelName:'督查计划表',
  64. sttm:'',
  65. ettm:'',
  66. dxdcMainHeight: window.innerHeight - 70,
  67. windowHeight:window.innerHeight - 62,
  68. windowWidth:window.innerWidth - 10,
  69. monthValue:'',
  70. province:'',
  71. dcType: '1', // 督查状态
  72. }
  73. },
  74. computed:{
  75. userId:function(){
  76. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  77. }
  78. },
  79. watch:{
  80. currentDCType:function(){
  81. // this.searchExecl()
  82. },
  83. currentDcTermId:function(){
  84. // this.searchExecl()
  85. },
  86. sttm(n,o){
  87. if(n == null){
  88. this.sttm = "";
  89. }
  90. },
  91. ettm(n,o){
  92. if(n == null){
  93. this.ettm = "";
  94. }
  95. },
  96. monthValue(n,o){
  97. if(n == null){
  98. this.monthValue = "";
  99. }
  100. }
  101. },
  102. mounted(){
  103. this.getUserPlanType();
  104. },
  105. methods:{
  106. getUserPlanType:function(){
  107. getPersPlanType(this.userId).then(res =>{
  108. this.DCTypeOption = res.data;
  109. this.DCTypeOption.forEach((option)=>{
  110. // option['value'] = Number(option['id']) + '';
  111. option['value'] = option['id'];
  112. option['label'] = option['name'];
  113. });
  114. this.DCTypeOption.unshift({'value':'','label':'全部'});
  115. this.currentDCType = this.DCTypeOption[0].value;
  116. this.getOrgOption();
  117. });
  118. },
  119. getOrgOption(){
  120. request.get('/dc/bis/insp/org/getOrgList').then((res)=>{
  121. if(res.success){
  122. this.DCTermOption = res.data;
  123. this.DCTermOption.forEach((option)=>{
  124. // option['value'] = Number(option['id']) + '';
  125. option['id'] = option['orgId'];
  126. option['nm'] = option['orgNm'];
  127. });
  128. this.DCTermOption.unshift({'id':'','nm':'全部'});
  129. this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
  130. this.searchExecl();
  131. }
  132. });
  133. },
  134. // 获取Excel数据
  135. searchExecl(){
  136. this.loading = true;
  137. let _this = this;
  138. let iframe = document.getElementById("frameMainDcjh");
  139. let src = this.reportSrc;
  140. iframe.src= src
  141. + "&width=" + this.windowWidth
  142. + "&height=" + this.windowHeight
  143. + "&excelName=" + this.excelName
  144. + "&sttm=" + this.sttm
  145. + "&ettm=" + this.ettm
  146. + "&ptype=" + this.currentDCType
  147. + "&pid=" + this.currentDcTermId
  148. + "&persid=" + this.userId
  149. + "&dt=" + this.monthValue
  150. + "&adnm=" + this.province
  151. + "&dcType=" + this.dcType
  152. if (iframe.attachEvent){
  153. iframe.attachEvent("onload", function(){
  154. _this.loading = false;
  155. });
  156. } else {
  157. iframe.onload = function(){
  158. _this.loading = false;
  159. };
  160. }
  161. },
  162. // 导出Excel数据
  163. exportExecl(){
  164. v = window.frames["frameMainDcjh"];
  165. v.contentWindow.report1_saveAsExcel();
  166. },
  167. },
  168. activated() {
  169. this.getUserPlanType();
  170. }
  171. }
  172. </script>
  173. <style>
  174. #dcjhMain {
  175. overflow: hidden;
  176. padding:0;
  177. }
  178. .pStyle{
  179. font-size: 14px;
  180. color: #606266;
  181. }
  182. </style>