18b92d48098e307a9d070a404af5fc4a37c31c6f.svn-base 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'padding-top':'10px'}">
  5. <div class="block">
  6. <span class="demonstration" style="margin-right: 5px">选择时间段</span>
  7. <el-date-picker
  8. v-model="findTime"
  9. type="daterange"
  10. value-format="yyyy-MM-dd"
  11. range-separator="至"
  12. start-placeholder="开始日期"
  13. end-placeholder="结束日期">
  14. </el-date-picker>
  15. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">督查状态</span>
  16. <el-select v-model="dcType" clearable placeholder="督查状态">
  17. <el-option label="未督查" value="0"></el-option>
  18. <el-option label="督查中" value="1"></el-option>
  19. <el-option label="已督查" value="2"></el-option>
  20. </el-select>
  21. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">问题类别</span>
  22. <!--<el-select v-model="type" clearable placeholder="问题类别">-->
  23. <!--<el-option v-for="(item,index) in inspPblmsNameList" :label="item.inspPblmsName"-->
  24. <!--:value="item.inspPblmsName" :key="index"></el-option>-->
  25. <!--</el-select>-->
  26. <el-select v-model="type" value-key="items" placeholder="请选择" @change="problemListChange" clearable>
  27. <el-option v-for="(item,index) in problemList" :key="index" :label="item.name" :value="item">
  28. </el-option>
  29. </el-select>
  30. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">检查项目</span>
  31. <!--<el-select v-model="check" clearable placeholder="检查项目">-->
  32. <!--<el-option v-for="(item,index) in checkPointList" :label="item.checkPoint"-->
  33. <!--:value="item.checkPoint" :key="index"></el-option>-->
  34. <!--</el-select>-->
  35. <el-select v-model="check" value-key="items" placeholder="请选择" clearable>
  36. <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.name" :value="item">
  37. </el-option>
  38. </el-select>
  39. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">严重等级</span>
  40. <el-select v-model="level" clearable placeholder="严重等级">
  41. <el-option
  42. v-for="item in supervisionState"
  43. :key="item.value"
  44. :label="item.label"
  45. :value="item.value"
  46. ></el-option>
  47. </el-select>
  48. <el-button type="primary" icon="el-icon-download"
  49. style="float: right;margin:0 5px"
  50. @click="exportExecl">导出</el-button>
  51. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  52. </div>
  53. </el-card>
  54. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  55. <form :id="formId" :target="iframeId" :action="reportSrc" method="post">
  56. <input type="hidden" name="width" v-model="windowWidth">
  57. <input type="hidden" name="height" v-model="windowHeight">
  58. <input type="hidden" name="ids" v-model="ids">
  59. <input type="hidden" name="excelName" v-model="excelName">
  60. <input type="hidden" name="sttm" v-model="sttm">
  61. <input type="hidden" name="ettm" v-model="ettm">
  62. <input type="hidden" name="year" v-model="newYear">
  63. <input type="hidden" name="state" v-model="dcType">
  64. <input type="hidden" id="type" name="type" v-model="type.name">
  65. <input type="hidden" id="check" name="check" v-model="check.name">
  66. <input type="hidden" id="level" name="level" v-model="level">
  67. </form>
  68. <div style="width: 100%;height: 100%;" v-loading="loading">
  69. <iframe :id="iframeId" :name="iframeId" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  70. </div>
  71. </el-card>
  72. </el-col>
  73. </el-row>
  74. </template>
  75. <script>
  76. import {dateFormat,getFirstDayOfMonth} from '../../../utils/gw_date.js';
  77. import request from '@util/gw_ajax_request'
  78. export default {
  79. props: ['ids','newYear'],
  80. data() {
  81. return {
  82. // ids:[],
  83. pid:'000',
  84. pidNodes:[],
  85. dxdcMainHeight: window.innerHeight-215,
  86. dxdcAsideHeight: window.innerHeight-180,
  87. windowHeight:window.innerHeight - 200,
  88. windowWidth:window.innerWidth - 350,
  89. // reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=sz04_problemIdentified4.raq',
  90. reportSrc:'/JsReport/reportFiles/reportjsp/showReport_pages.jsp?raq=sz04_problemIdentified4.raq',
  91. radioTable:1,
  92. loading:true,
  93. leftCol:4,
  94. rightCol:20,
  95. excelName:'附表4-检查发现问题汇总表',
  96. monthValue:dateFormat(new Date(), 'yyyy-MM'),
  97. formId:'formMain4',
  98. iframeId:'frameMain4',
  99. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  100. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  101. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  102. treeWidth: 250,
  103. dcType: '0',
  104. problemList: [],
  105. checkPointList: [],
  106. inspPblmsNameList: [],
  107. supervisionState: [
  108. {
  109. value: "0",
  110. label: "一般"
  111. },
  112. {
  113. value: "1",
  114. label: "较重"
  115. },
  116. {
  117. value: "2",
  118. label: "严重"
  119. },
  120. {
  121. value: "3",
  122. label: "特别严重"
  123. }
  124. ],
  125. level: "",
  126. type: "",
  127. check: "",
  128. currentCheckPointList:[]
  129. }
  130. },
  131. computed: {
  132. userId: function () {
  133. return localStorage.getItem("userid")
  134. ? localStorage.getItem("userid")
  135. : "1098101939614724096";
  136. }
  137. },
  138. methods: {
  139. // 获取Excel数据
  140. searchExecl(){
  141. this.loading = true;
  142. // 使用form表单post提交,彻底解决参数值过长的问题
  143. document.getElementById(this.formId).submit();
  144. // 使用_this
  145. let _this = this;
  146. document.getElementById(this.iframeId).onload = function(){
  147. _this.loading = false;
  148. };
  149. },
  150. // 导出Excel数据
  151. exportExecl(){
  152. let v = window.frames[`${this.iframeId}`];
  153. v.report1_saveAsExcel();
  154. },
  155. unique(arr1, val) {
  156. const res = new Map();
  157. return arr1.filter((a) => !res.has(a[val]) && res.set(a[val], 1))
  158. },
  159. getproblemSmallType() {
  160. // request.get('/dc/insp/pblms/getPblmType', {
  161. // params: {
  162. // type: 6,
  163. // pguid: '60000000000000000000000000000000'
  164. // }
  165. // }).then(res => {
  166. // if (res.success) {
  167. // this.$nextTick(() => {
  168. // this.problemList = res.data;
  169. // this.checkPointList = this.unique(this.problemList, "checkPoint");
  170. // this.inspPblmsNameList = this.unique(this.problemList, "inspPblmsName");
  171. // console.log(this.inspPblmsNameList, this.checkPointList);
  172. // })
  173. // }
  174. // })
  175. request.get('/dc/insp/pblms/getAllPblmsByType/6').then(res => {
  176. if (res.success) {
  177. this.problemList = res.data;
  178. }
  179. })
  180. },
  181. problemListChange: function (item) {
  182. this.currentCheckPointList = item.items;
  183. }
  184. },
  185. watch:{
  186. findTime(n,o){
  187. if(!n){
  188. this.sttm = "";
  189. this.ettm = "";
  190. }else{
  191. this.sttm = n[0];
  192. this.ettm = n[1];
  193. }
  194. }
  195. },
  196. activated() {
  197. this.searchExecl();
  198. this.getproblemSmallType();
  199. }
  200. }
  201. </script>
  202. <style scoped>
  203. </style>