| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <template>
- <div style="height:100%;width:100%;">
- <el-container style="height:100%;width:100%;">
- <el-aside width="15%" :height="asideHeight" style="padding-right: 10px">
- <!--<div class="date_wrapper" style="padding-top : 10px">年度:
- <el-select v-model="year" placeholder="请选择" @change="changeYear">
- <el-option
- v-for="item in yearList"
- :key="item.id"
- :label="item.year"
- :value="item.year">
- </el-option>
- </el-select>
- </div>-->
- <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
- <el-card class="box-card" style="min-height: 99%">
- <div slot="header" class="clearfix">
- <span>督查组</span>
- </div>
- <el-tree :data="groupTreeData" :props="defaultProps" :expand-on-click-node="false"
- @node-click="groupHandleNodeClick">
- </el-tree>
- </el-card>
- </div>
- </el-aside>
- <el-aside width="25%" :height="asideHeight">
- <div :style="{'height': asideHeight + 'px','overflow': 'auto'}" class="left_tree">
- <el-card class="box-card" style="min-height: 99%">
- <div slot="header" class="clearfix">
- <span>工程信息</span>
- <!-- <el-button style="float: right; padding: 3px 0" type="text" @click="batchImport" v-if="ownPriv('manage')">批量导入</el-button>-->
- <!-- 水利工程基础信息批量导入弹窗 -->
- <!-- <slgc-tian-bao-pl v-if="showGongChengTianBaoPl" @closePlDialog="closePlDialog"></slgc-tian-bao-pl>-->
- </div>
- <el-tree :data="treeData" :props="defaultProps_p" :expand-on-click-node="false" @node-click="provTreeSelectChangeHandler">
- <span class="custom-tree-node" slot-scope="{ node, data }" style="width: 100%;">
- <span style="width: 100%;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;" :title="node.label">{{ node.label }}</span></span>
- </el-tree>
- </el-card>
- </div>
- </el-aside>
- <el-aside width="59%" :height="asideHeight" style="padding-left : 10px;">
- <!-- <el-col :span="rightCol">-->
- <!-- <el-card :body-style="{'padding-top':'0px'}">-->
- <!-- <div class="block">-->
- <!-- <el-button type="primary" icon="el-icon-search" style="float: right;margin:0 5px" @click="searchExecl">查询</el-button>-->
- <!-- </div>-->
- <!-- </el-card>-->
- <el-card :body-style="{'height':asideHeight + 'px','padding':'0'}">
- <form ref="formMain8" id="formMain8" target="frameMain8" :action="reportSrc" method="get">
- <!-- <input id="Id" type="hidden" name="Id">-->
- <input id="rgstrId" type="hidden" name="rgstrId">
- </form>
- <div v-loading="loading" style="width: 100%;height: 100%;display:flex;flex-direction:row;justify-content:center;align-items:center;">
- <i v-if="firstToShow" style="font-size:32px;" class="el-icon-warning-outline"></i>
- <p v-if="firstToShow" style="font-weight: bolder;color: #868686;font-size: larger;">请通过左侧树点击指定工程,导出报告</p>
- <iframe v-show="!firstToShow" ref="frameMain8" id="frameMain8" name="frameMain8" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-card>
- <!-- </el-col>-->
- </el-aside>
- </el-container>
- </div>
- </template>
- <script>
- import request from "@util/gw_ajax_request.js";
- import {getTrees} from "@util/gw_formatTree.js";
- // import {getYearList} from '@api/jcOneMapApi'
- export default {
- components: {},
- props: [],
- data() {
- return {
- // year:'',
- firstToShow: true,
- // yearList: [],
- searchObj: {
- "engScal": '1'
- },
- Id:'',
- asideHeight: window.innerHeight - 106,
- treeData: [],
- groupTreeData: [],
- plnaId: '125', //督查组id
- defaultExpandedKeys: ['350000000000'],
- adCode: '',
- reportSrc: '/pageofficePath/dc/pageoffice/fjpjcsu/show',
- loading: false,
- rightCol:20,
- excelName: '项目法人安全生产标准化评审',
- defaultProps: {
- children: 'children',
- label: 'pnm'
- },
- defaultProps_p: {
- children: 'children',
- label: 'nm'
- },
- pageIndex: 1,
- pageSize: 20,
- total: 0
- };
- },
- computed: {
- persId() {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- },
- mounted() {
- // this.getYearlists();
- this.getGroupData();
- },
- activated() {
- this.getDataList();
- },
- methods: {
- // getYearlists(){
- // getYearList().then(res=>{
- // this.yearList = res.data;
- // let lastItemIndex = this.yearList.length - 1;
- // this.year = this.yearList[lastItemIndex].year
- // })
- // },
- // changeYear(val) {
- // this.newYear = val;
- // this.getGroupData();
- // },
- provTreeSelectChangeHandler: function(data,node) {
- console.log("点击工程后获取数据:"+data.id);
- this.Id= data.id;
- this.searchExecl();
- },
- // 获取Excel数据
- searchExecl(){
- // //debugger
- let _this = this;
- if( _this.Id == ''&&_this.Id==null){
- return;
- }
- document.getElementById("rgstrId").value = _this.Id;
- this.firstToShow = false;
- this.loading = true;
- // 使用form表单post提交,彻底解决参数值过长的问题
- this.$refs.formMain8.submit();
- // 使用_this
- this.$refs.frameMain8.onload = function(){
- _this.loading = false;
- };
- },
- //获取工程列表信息
- getDataList() {
- const params = {
- id:this.plnaId
- }
- request.post(`/bis/insp/fjpjcsu/findPageOfficeList`,params).then(res => {
- if (res.success) {
- if(res.data){
- for (let i in res.data) {
- delete res.data[i].children;
- }
- }
- this.treeData = res.data;
- }
- });
- },
- // 点击督查组
- getGroupData() {
- let params = {
- userId: this.persId,
- orgType: '125'
- };
- request.get(`/dc/organization/base/getAllNode`, {params: params}).then(res => {
- if (res.success) {
- let data = res.data;
- data = getTrees(data);
- this.groupTreeData = data;
- if (data[0] && data[0].id != '004') {
- this.plnaId = this.groupTreeData[0].id
- }
- this.getDataList();
- } else {
- this.$message.warning(res.message)
- }
- })
- },
- groupHandleNodeClick(data) {
- this.plnaId = data.id;
- this.getDataList()
- }
- }
- };
- </script>
- <style lang="scss">
- .el-table .warning-row {
- background: oldlace;
- }
- .el-table .success-row {
- background: #f0f9eb;
- }
- .left_tree .custom-tree-node {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 14px;
- padding-right: 8px;
- }
- </style>
|