3a01acdb0500e5146d44387d9c8028edbf076495.svn-base 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <el-row>
  3. <el-col :span="4">
  4. <div class="left_tree_title" style="margin: 10px;">年度:
  5. <el-select v-model="year" placeholder="请选择" style="width: 60%;">
  6. <el-option v-for="item in yearList" :key="item.id" :label="item.year" :value="item.year">
  7. </el-option>
  8. </el-select>
  9. </div>
  10. <provTreeList rootCode="000000" rootType="1" :style="{'max-height':dxdcAsideHeight+'px'}"
  11. @provTreeSelectChange="provTreeSelectChangeHandler"></provTreeList>
  12. </el-col>
  13. <el-col :span="20">
  14. <el-card :body-style="{'padding-top':'10px'}">
  15. <div class="block">
  16. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  17. <el-date-picker v-model="findTime" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
  18. start-placeholder="开始日期" end-placeholder="结束日期" style="width: 280px;">
  19. </el-date-picker>
  20. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查类别</span>
  21. <el-select v-model="objtypeArr" filterable placeholder="请选择" multiple clearable @change="objtypeChange" style="width: 260px;">
  22. <el-option v-for="item in supervisionObjlist" :key="item.id" :label="item.name"
  23. :value="item.id">
  24. </el-option>
  25. </el-select>
  26. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">业务处室</span>
  27. <el-select v-model="dutydepArr" placeholder="请选择" multiple clearable @change="dutydepChange" style="width: 260px;">
  28. <el-option :label="obj" :value="obj" v-for="obj in orgList" :key="obj">
  29. </el-option>
  30. </el-select>
  31. <el-button type="primary" icon="el-icon-download" style="float: right;margin:0 5px"
  32. @click="exportExecl">导出</el-button>
  33. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px"
  34. @click="searchExecl">查询</el-button>
  35. </div>
  36. </el-card>
  37. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  38. <form id="formMain2" ref="formMain2" target="frameMain2" :action="reportSrc" method="post">
  39. <input type="hidden" name="width" v-model="windowWidth">
  40. <input type="hidden" name="height" v-model="windowHeight">
  41. <input type="hidden" name="adCode" v-model="adCode">
  42. <input type="hidden" name="sttm" v-model="sttm">
  43. <input type="hidden" name="ettm" v-model="ettm">
  44. <input type="hidden" name="year" v-model="year">
  45. <input type="hidden" name="objtype" v-model="objtype">
  46. <input type="hidden" name="dutydep" v-model="dutydep">
  47. </form>
  48. <div style="width: 100%;height: 100%;" v-loading="loading">
  49. <iframe ref="frameMain2" name="frameMain2" id="frameMain2" src frameborder="0" width="100%"
  50. height="100%" style="overflow: auto"></iframe>
  51. </div>
  52. </el-card>
  53. </el-col>
  54. </el-row>
  55. </template>
  56. <script>
  57. import request from '@util/gw_ajax_request.js'
  58. import { dateFormat, getFirstDayOfMonth } from '../../utils/gw_date.js';
  59. import provTreeList from '@widget/provTreeListWithCheckBox.vue'
  60. import { getYearList } from '@api/jcOneMapApi'
  61. import { getPersPlanType } from '@api/duChaPlan.js'
  62. export default {
  63. props: ['ids', 'newYear'],
  64. data() {
  65. return {
  66. pid: "000",
  67. pidNodes: [],
  68. type: "001",
  69. dxdcMainHeight: window.innerHeight - 200,
  70. dxdcAsideHeight: window.innerHeight - 180,
  71. windowHeight: window.innerHeight - 200,
  72. windowWidth: window.innerWidth - 350,
  73. reportSrc:
  74. // "/JsReport/reportFiles/reportjsp/showReport.jsp?raq=sk02_xxsk.raq",
  75. "/demo/reportJsp/showReport.jsp?rpx=dc_pblm_total",
  76. radioTable: 1,
  77. loading: true,
  78. leftCol: 4,
  79. rightCol: 20,
  80. excelName: "",
  81. findTime: [new Date().getFullYear()+"-01-01", dateFormat(new Date(), 'yyyy-MM-dd')],
  82. sttm: new Date().getFullYear()+"-01-01",
  83. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  84. treeWidth: 250,
  85. objtype: '',
  86. adCode: '',
  87. yearList: [],
  88. year: '',
  89. supervisionObjlist: [], //督查对象列表
  90. orgList: [],
  91. dutydep: [],
  92. objtypeArr: [],
  93. dutydepArr: []
  94. };
  95. },
  96. components: {
  97. provTreeList
  98. },
  99. computed: {
  100. persId() {
  101. return localStorage.getItem('userid') ? localStorage.getItem('userid') : ''
  102. },
  103. },
  104. mounted() {
  105. this.getSupervisionObjlist()
  106. this.getYearlists();
  107. this.getOrgList()
  108. setTimeout(()=>{
  109. this.searchExecl()
  110. }, 500)
  111. },
  112. methods: {
  113. getYearlists() {
  114. getYearList().then(res => {
  115. this.yearList = res.data;
  116. let lastItemIndex = this.yearList.length - 1
  117. this.year = this.yearList[lastItemIndex].year
  118. })
  119. },
  120. // 获取Excel数据
  121. searchExecl() {
  122. this.loading = true;
  123. // 使用form表单post提交,彻底解决参数值过长的问题
  124. this.$refs.formMain2.submit();
  125. // 使用_this
  126. let _this = this;
  127. this.$refs.frameMain2.onload = function () {
  128. _this.loading = false;
  129. };
  130. },
  131. // 导出Excel数据
  132. exportExecl() {
  133. v = window.frames["frameMain2"];
  134. // 调用子页面的js方法
  135. // v.contentWindow.report1_saveAsExcel();
  136. console.log(v)
  137. console.log(v.contentWindow)
  138. v.report1_saveAsExcel();
  139. },
  140. provTreeSelectChangeHandler(params) {
  141. this.adCode = params;
  142. console.log(params)
  143. },
  144. // 获取督查类别
  145. getSupervisionObjlist() {
  146. getPersPlanType(this.persId).then(res => {
  147. if (res.success && res.data.length) {
  148. this.supervisionObjlist = res.data
  149. } else {
  150. this.$message.warning('暂未分配督查类别')
  151. }
  152. }).catch(err => {
  153. this.$message.warning('系统异常')
  154. })
  155. },
  156. // 获取责任处室列表
  157. getOrgList() {
  158. request.get('/att/insp/type/duty/arrayByOrgId').then(res => {
  159. if (res.success) {
  160. this.orgList = res.data
  161. } else {
  162. this.$message.warning(res.message)
  163. }
  164. })
  165. },
  166. objtypeChange(val){
  167. if(val.length){
  168. this.objtype = val.join(',')
  169. }else{
  170. this.objtype = ''
  171. }
  172. },
  173. dutydepChange(val){
  174. if(val.length){
  175. this.dutydep = val.join(',')
  176. }else{
  177. this.dutydep = ''
  178. }
  179. }
  180. },
  181. watch: {
  182. findTime(n, o) {
  183. if (!n) {
  184. this.sttm = "";
  185. this.ettm = "";
  186. } else {
  187. this.sttm = n[0];
  188. this.ettm = n[1];
  189. }
  190. }
  191. },
  192. activated() {
  193. this.searchExecl();
  194. }
  195. };
  196. </script>
  197. <style scoped>
  198. </style>