548a324b9e03a84df1a75b306a5bef498336f6d1.svn-base 7.7 KB

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