4e3d8fc0fa82adf20c7030d1475276ba059967c9.svn-base 9.6 KB

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