eddb9351ba304a27fb31c59e48707b2abac1510e.svn-base 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. <addvSearch
  15. style="width: 130px;margin-left:10px;margin-right:15px"
  16. v-model="province"
  17. :maxHeight='300'
  18. :maxWidth='250'
  19. :rootAddCode="curAdcode_long"
  20. :level='"1"'
  21. :nameOrCode="'name'"
  22. ></addvSearch>
  23. <p>选择月份</p>
  24. <el-date-picker
  25. style="width: 130px;margin-left:10px"
  26. v-model="monthValue"
  27. value-format="yyyy-MM"
  28. type="month"
  29. placeholder="选择月份">
  30. </el-date-picker>
  31. <el-button type="primary" icon="el-icon-search" style="margin-left:20px;" plain @click="searchExecl">查询</el-button>
  32. <el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button>
  33. </el-header>
  34. <el-main id="dcjhMain">
  35. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%'}" v-loading="loading">
  36. <iframe ref="myIframe" id="frameMainDcjh" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  37. </div>
  38. </el-main>
  39. </el-container>
  40. </template>
  41. <script>
  42. import request from '../../../utils/gw_ajax_request.js';
  43. import {getArenGrpMen, addDczOthersMens,getPlanNodeByPersid,getTermByPersid,getPersPlanType} from "@api/duChaPlan.js";
  44. import {dateFormat} from '../../../utils/gw_date.js'
  45. import addvSearch from "../../../widgets/addvSearch.vue"
  46. import {curAdcode_long} from '@util/global_variable.js'
  47. export default {
  48. props: [],
  49. components: {
  50. addvSearch
  51. },
  52. data() {
  53. return {
  54. currentDCType:'', // ptype
  55. DCTypeOption:[],
  56. currentDcTermId:'', // pid
  57. DCTermOption:[],
  58. loading:true,
  59. reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=/sheng/dcjh_Sheet2.raq',
  60. excelName:'督查计划表',
  61. sttm:'',
  62. ettm:'',
  63. dxdcMainHeight: window.innerHeight-130,
  64. windowHeight:window.innerHeight - 130,
  65. windowWidth:window.innerWidth - 10,
  66. monthValue:'',
  67. province: ''
  68. }
  69. },
  70. computed:{
  71. userId:function(){
  72. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  73. },
  74. userInAllNode:function(){//当前登录用户所在的所有组信息
  75. return JSON.parse(localStorage.getItem("allNode"))? JSON.parse(localStorage.getItem("allNode")): []
  76. },
  77. guId:function(){
  78. return localStorage.getItem("guid")? localStorage.getItem("guid"): '000'
  79. },
  80. orgName(){
  81. return localStorage.getItem("orgName")? localStorage.getItem("orgName"): ''
  82. },
  83. userType(){
  84. return localStorage.getItem("userType")? localStorage.getItem("userType"): '1'
  85. },
  86. currentShowLists:function(){
  87. return this.currentShowList.filter(item => item.persName.indexOf(this.member_search) > -1)
  88. },
  89. isAdmin:function(){
  90. return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
  91. },
  92. curAdcode_long(){
  93. return curAdcode_long
  94. },
  95. // 默认用户所属的默认省份 金水能看到所有的
  96. defaultProvince(){
  97. if(localStorage.getItem('currentOrgNm') && localStorage.getItem('currentOrgNm') != '北京金水公司'){
  98. return localStorage.getItem('currentOrgNm')
  99. }else{
  100. return ''
  101. }
  102. }
  103. },
  104. watch:{
  105. currentDCType:function(){
  106. // this.searchExecl()
  107. // this.test_getDuChaPlanInformation();
  108. },
  109. currentDcTermId:function(){
  110. // this.searchExecl()
  111. },
  112. sttm(n,o){
  113. if(n == null){
  114. this.sttm = "";
  115. }
  116. },
  117. ettm(n,o){
  118. if(n == null){
  119. this.ettm = "";
  120. }
  121. },
  122. monthValue(n,o){
  123. if(n == null){
  124. this.monthValue = "";
  125. }
  126. }
  127. },
  128. mounted(){
  129. // this.searchExecl()
  130. },
  131. methods:{
  132. getUserPlanType:function(){
  133. let _self = this;
  134. getPersPlanType(this.userId).then(res =>{
  135. this.DCTypeOption = res.data;
  136. this.DCTypeOption.forEach((option)=>{
  137. // option['value'] = Number(option['id']) + '';
  138. option['value'] = option['id'];
  139. option['label'] = option['name'];
  140. });
  141. this.DCTypeOption.unshift({'value':'','label':'全部'});
  142. this.currentDCType = this.DCTypeOption[0].value;
  143. // this.test_getDuChaPlanInformation();
  144. this.getOrgOption();
  145. });
  146. },
  147. test_getDuChaPlanInformation:function(){
  148. //当下折中方案,需要后续更改,提供所需接口后进行抛弃 @wxcwater
  149. getPlanNodeByPersid(this.userId,this.currentDCType.replace('00','')).then((res)=>{
  150. console.log(res);
  151. this.DCTermOption = res.data;
  152. this.DCTermOption.unshift({'id':'','nm':'全部'});
  153. this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
  154. });
  155. },
  156. getOrgOption(){
  157. request.get('/dc/bis/insp/org/getOrgList').then((res)=>{
  158. if(res.success){
  159. this.DCTermOption = res.data;
  160. this.DCTermOption.forEach((option)=>{
  161. // option['value'] = Number(option['id']) + '';
  162. option['id'] = option['orgId'];
  163. option['nm'] = option['orgNm'];
  164. });
  165. this.DCTermOption.unshift({'id':'','nm':'全部'});
  166. this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
  167. this.searchExecl();
  168. }
  169. });
  170. },
  171. // 获取Excel数据
  172. searchExecl(){
  173. this.loading = true;
  174. let _this = this;
  175. let iframe = document.getElementById("frameMainDcjh");
  176. let src = this.reportSrc;
  177. this.province = this.province == '' ? this.defaultProvince : this.province
  178. iframe.src= src
  179. + "&width=" + this.windowWidth
  180. + "&height=" + this.windowHeight
  181. + "&excelName=" + this.excelName
  182. + "&sttm=" + this.sttm
  183. + "&ettm=" + this.ettm
  184. + "&ptype=" + this.currentDCType
  185. + "&pid=" + this.currentDcTermId
  186. + "&persid=" + this.userId
  187. + "&dt=" + this.monthValue
  188. + "&adnm=" + this.province
  189. if (iframe.attachEvent){
  190. iframe.attachEvent("onload", function(){
  191. _this.loading = false;
  192. });
  193. } else {
  194. iframe.onload = function(){
  195. _this.loading = false;
  196. };
  197. }
  198. },
  199. // 导出Excel数据
  200. exportExecl(){
  201. v = window.frames["frameMainDcjh"];
  202. v.contentWindow.report1_saveAsExcel();
  203. },
  204. },
  205. activated() {
  206. this.getUserPlanType();
  207. }
  208. }
  209. </script>
  210. <style>
  211. #dcjhMain {
  212. overflow: hidden;
  213. padding:0;
  214. }
  215. </style>