cf2d87d6427fe1853485e5e497cd8eccd816aa77.svn-base 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <!--
  2. * @description: 按照全国左侧树分组的形式,新开此组件,原来report_jcbg_doc已更名为(福建)
  3. * @fileName: report_jcbg_doc_group.vue
  4. * @author: 张昀朝
  5. * @date: 2020-05-28 14:27:44
  6. * @后台人员: 李海潮
  7. * @version: V0.0.1
  8. * @modify_description:
  9. * @modify_content:
  10. * @modify_author:
  11. * @modify_date: 2020-05-28 14:27:44
  12. -->
  13. <template>
  14. <el-row>
  15. <el-col :span="leftCol" ref="elw">
  16. <el-card :body-style="{'padding':'0'}">
  17. <export-tree-list-jc
  18. :height="dxdcAsideHeight"
  19. :width="treeWidth"
  20. :style="{'max-height':dxdcAsideHeight+'px'}"
  21. @provTreeSelectChange="provTreeSelectChange"
  22. @provTreeNodeExpand="provTreeNodeExpand"
  23. ></export-tree-list-jc>
  24. </el-card>
  25. </el-col>
  26. <el-col :span="rightCol">
  27. <el-card :body-style="{'padding-top':'10px'}">
  28. <div class="block">
  29. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">报告状态</span>
  30. <el-select v-model="bgType" clearable placeholder="请选择">
  31. <el-option label="专家(交换意见稿)" value="0"></el-option>
  32. <el-option label="交换意见阶段" value="4"></el-option>
  33. <!--<el-option label="成果讨论阶段" value="5"></el-option>-->
  34. <el-option label="中心修改阶段" value="6"></el-option>
  35. <el-option label="司局修改阶段" value="7"></el-option>
  36. </el-select>
  37. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">专业类型</span>
  38. <el-select v-model="listType" clearable placeholder="请选择" multiple collapse-tags>
  39. <el-option
  40. v-for="item in listTypeOptions"
  41. :key="item.value"
  42. :label="item.label"
  43. :value="item.value">
  44. </el-option>
  45. </el-select>
  46. <span class="demonstration" style="margin-right: 5px;margin-left: 7px">排序方式</span>
  47. <el-select v-model="orderBy" clearable placeholder="请选择">
  48. <el-option label="严重程度" value="pblmPasi"></el-option>
  49. <el-option label="专业类型" value="listType"></el-option>
  50. </el-select>
  51. <!-- <el-button type="primary" icon="el-icon-download"
  52. style="float: right;margin:0 5px"
  53. @click="exportExecl">导出</el-button> -->
  54. <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>
  55. </div>
  56. </el-card>
  57. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  58. <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="post">
  59. <input type="hidden" name="width" v-model="windowWidth">
  60. <input type="hidden" name="height" v-model="windowHeight">
  61. <input id="id" type="hidden" name="rgstrId">
  62. <input id="type" type="hidden" name="type" v-model="wordType">
  63. <input id="userId" type="hidden" name="persId" v-model="userId">
  64. <input id="listType" type="hidden" name="listType" v-model="listType">
  65. <input id="orderBy" type="hidden" name="orderBy" v-model="orderBy">
  66. <!-- <input type="hidden" name="excelName" v-model="excelName"> -->
  67. </form>
  68. <div v-loading="loading" style="width: 100%;height: 100%;display:flex;flex-direction:row;justify-content:center;align-items:center;">
  69. <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
  70. <p v-if="firstToShow" style="font-weight: bolder;color: #868686;font-size: larger;">请通过左侧树点击指定组或工程,导出报告</p>
  71. <iframe v-show="!firstToShow" ref="frameMain8" id="frameMain8" name="frameMain8" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  72. </div>
  73. </el-card>
  74. </el-col>
  75. </el-row>
  76. </template>
  77. <script>
  78. //这里导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  79. //import 《组件名称》 from '《组件路径》';
  80. //import {函数名称1,函数名称2} from '《组件路径》';
  81. import request from '@util/gw_ajax_request.js';
  82. import exportTreeListJc from './exportTreeList_jc_group'
  83. import {dateFormat} from '@util/gw_date.js'
  84. export default {
  85. components: {
  86. exportTreeListJc:exportTreeListJc,
  87. },
  88. data() {
  89. return {
  90. id:'',
  91. pid: '',
  92. dxdcMainHeight: window.innerHeight-150,
  93. dxdcAsideHeight: window.innerHeight-100,
  94. windowHeight:window.innerHeight - 200,
  95. windowWidth:window.innerWidth - 350,
  96. reportSrc2:'/demo/reportJsp/showReport.jsp?rpx=js_TAC_OUTLINE_WORD',
  97. // reportSrc:'/pageofficePath/pageoffice/tacReport/show',
  98. reportSrc:'/pageofficePath/pageoffice/tacReport/pdc/show',
  99. loading:false,
  100. leftCol:4,
  101. rightCol:20,
  102. excelName:'稽察报告',
  103. treeWidth: 250,
  104. firstToShow:true,
  105. bgType:'0',
  106. ywType:'1', // 业务类型 基础信息
  107. wordType:'',
  108. type:'400',
  109. listType:[],
  110. listTypeOptions: [
  111. {
  112. value: '1',
  113. label: '前期与设计'
  114. }, {
  115. value: '2',
  116. label: '建设管理'
  117. }, {
  118. value: '3',
  119. label: '计划下达与执行'
  120. }, {
  121. value: '4',
  122. label: '资金使用与管理'
  123. }, {
  124. value: '5',
  125. label: '工程质量'
  126. },{
  127. value: '6',
  128. label: '工程安全'
  129. }
  130. ],
  131. orderBy:'pblmPasi',
  132. }
  133. },
  134. mounted() {
  135. this.treeWidth = this.$refs.elw.$el.clientWidth;
  136. },
  137. //生命周期 - 创建完成(可以访问当前this实例)
  138. created() {
  139. // 注意是数组
  140. this.listType = ['1','2','3','4','5','6']
  141. },
  142. computed: {
  143. userId: function () {
  144. return localStorage.getItem("userid")
  145. ? localStorage.getItem("userid")
  146. : "1098101939614724096";
  147. }
  148. },
  149. methods: {
  150. provTreeSelectChange(data){
  151. this.id = data.id;
  152. this.searchExecl();
  153. },
  154. provTreeNodeExpand(data){
  155. this.id = data.id;
  156. this.pid = data.pid;
  157. this.searchExecl();
  158. },
  159. // 获取Excel数据
  160. searchExecl(){
  161. var newSrc = "";
  162. this.setWordType();
  163. let _this = this;
  164. if( _this.id == ''){
  165. return;
  166. }
  167. if(_this.id != '' && _this.pid !='' && _this.pid.length < 12){
  168. // this.openMessage();
  169. return;
  170. }
  171. let rgstrId = '';
  172. if(_this.bgType != '0' && _this.bgType != ''){
  173. // rgstrId = _this.id.split(",").map((x)=>{return x + "_" + _this.bgType;}).join(",");
  174. if(typeof(_this.id) == 'string'){
  175. rgstrId = _this.id + "_" + _this.bgType;
  176. }else{
  177. rgstrId = _this.id.map((x)=>{return x + "_" + _this.bgType;}).join(",");
  178. }
  179. }else{
  180. rgstrId = _this.id;
  181. }
  182. // v-model 不同步,只能手动同步了
  183. document.getElementById("id").value = rgstrId;
  184. this.firstToShow = false;
  185. this.loading = true;
  186. // 使用form表单post提交,彻底解决参数值过长的问题
  187. this.$refs.formMain8.submit();
  188. // 使用_this
  189. this.$refs.frameMain8.onload = function(){
  190. _this.loading = false;
  191. // 控制iframe内图片的大小
  192. var iframe = document.getElementById('frameMain8');
  193. var doc = iframe.contentWindow.document;
  194. var img = doc.getElementById('imgs');
  195. img.style.width = '100%';
  196. };
  197. },
  198. openMessage(){
  199. const h = this.$createElement;
  200. this.$notify({
  201. title: '提示',
  202. message: h('i', { style: 'color: teal'}, '点击组或者工程才会生成报告')
  203. });
  204. },
  205. // 导出Excel数据
  206. exportExecl(){
  207. v = window.frames["frameMain8"];
  208. v.report1_saveAsWord();
  209. },
  210. setWordType(){
  211. // 不足补零 1是基础信息
  212. if(this.type != undefined && this.type.length == 1){
  213. this.wordType = this.ywType + "0"+this.type;
  214. }else if(this.type.length == 2){
  215. this.wordType = this.ywType + this.type;
  216. }else{
  217. this.wordType = this.type;
  218. }
  219. },
  220. },
  221. watch:{
  222. monthValue(n,o){
  223. if(n == null){
  224. this.monthValue = "";
  225. }
  226. }
  227. },
  228. activated() {
  229. this.searchExecl();
  230. }
  231. }
  232. </script>
  233. <style >
  234. /* @import url(); 引入公共css类 */
  235. </style>