| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <template>
-
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;">
- <p>督查对象类别</p>
- <el-select v-model="currentDCType" placeholder="请选择督查对象类别" style="margin-left:10px;margin-right:15px">
- <el-option
- v-for="item in DCTypeOption"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <p>选择市</p>
- <addvSearch
- style="width: 130px;margin-left:10px;margin-right:15px"
- v-model="province"
- :maxHeight='300'
- :maxWidth='250'
- :rootAddCode="curAdcode_long"
- :level='"1"'
- :nameOrCode="'name'"
- ></addvSearch>
- <p>选择月份</p>
- <el-date-picker
- style="width: 130px;margin-left:10px"
- v-model="monthValue"
- value-format="yyyy-MM"
- type="month"
- placeholder="选择月份">
- </el-date-picker>
- <el-button type="primary" icon="el-icon-search" style="margin-left:20px;" plain @click="searchExecl">查询</el-button>
- <el-button type="primary" icon="el-icon-download" style="margin-left:10px;" plain @click="exportExecl">导出</el-button>
- </el-header>
- <el-main id="dcjhMain">
- <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%'}" v-loading="loading">
- <iframe ref="myIframe" id="frameMainDcjh" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-main>
-
-
- </el-container>
- </template>
- <script>
- import request from '../../../utils/gw_ajax_request.js';
- import {getArenGrpMen, addDczOthersMens,getPlanNodeByPersid,getTermByPersid,getPersPlanType} from "@api/duChaPlan.js";
- import {dateFormat} from '../../../utils/gw_date.js'
- import addvSearch from "../../../widgets/addvSearch.vue"
- import {curAdcode_long} from '@util/global_variable.js'
- export default {
- props: [],
- components: {
- addvSearch
- },
- data() {
- return {
- currentDCType:'', // ptype
- DCTypeOption:[],
- currentDcTermId:'', // pid
- DCTermOption:[],
- loading:true,
- reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=/sheng/dcjh_Sheet2.raq',
- excelName:'督查计划表',
- sttm:'',
- ettm:'',
- dxdcMainHeight: window.innerHeight-130,
- windowHeight:window.innerHeight - 130,
- windowWidth:window.innerWidth - 10,
- monthValue:'',
- province: ''
- }
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- userInAllNode:function(){//当前登录用户所在的所有组信息
- return JSON.parse(localStorage.getItem("allNode"))? JSON.parse(localStorage.getItem("allNode")): []
- },
- guId:function(){
- return localStorage.getItem("guid")? localStorage.getItem("guid"): '000'
- },
- orgName(){
- return localStorage.getItem("orgName")? localStorage.getItem("orgName"): ''
- },
- userType(){
- return localStorage.getItem("userType")? localStorage.getItem("userType"): '1'
- },
-
- currentShowLists:function(){
- return this.currentShowList.filter(item => item.persName.indexOf(this.member_search) > -1)
- },
- isAdmin:function(){
- return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
- },
- curAdcode_long(){
- return curAdcode_long
- },
- // 默认用户所属的默认省份 金水能看到所有的
- defaultProvince(){
- if(localStorage.getItem('currentOrgNm') && localStorage.getItem('currentOrgNm') != '北京金水公司'){
- return localStorage.getItem('currentOrgNm')
- }else{
- return ''
- }
- }
- },
- watch:{
- currentDCType:function(){
- // this.searchExecl()
- // this.test_getDuChaPlanInformation();
- },
- currentDcTermId:function(){
- // this.searchExecl()
- },
- sttm(n,o){
- if(n == null){
- this.sttm = "";
- }
- },
- ettm(n,o){
- if(n == null){
- this.ettm = "";
- }
- },
- monthValue(n,o){
- if(n == null){
- this.monthValue = "";
- }
- }
- },
- mounted(){
- // this.searchExecl()
- },
- methods:{
- getUserPlanType:function(){
- let _self = this;
- getPersPlanType(this.userId).then(res =>{
- this.DCTypeOption = res.data;
- this.DCTypeOption.forEach((option)=>{
- // option['value'] = Number(option['id']) + '';
- option['value'] = option['id'];
- option['label'] = option['name'];
- });
- this.DCTypeOption.unshift({'value':'','label':'全部'});
- this.currentDCType = this.DCTypeOption[0].value;
- // this.test_getDuChaPlanInformation();
- this.getOrgOption();
- });
- },
- test_getDuChaPlanInformation:function(){
- //当下折中方案,需要后续更改,提供所需接口后进行抛弃 @wxcwater
- getPlanNodeByPersid(this.userId,this.currentDCType.replace('00','')).then((res)=>{
- console.log(res);
- this.DCTermOption = res.data;
- this.DCTermOption.unshift({'id':'','nm':'全部'});
- this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
- });
- },
- getOrgOption(){
- request.get('/dc/bis/insp/org/getOrgList').then((res)=>{
- if(res.success){
- this.DCTermOption = res.data;
- this.DCTermOption.forEach((option)=>{
- // option['value'] = Number(option['id']) + '';
- option['id'] = option['orgId'];
- option['nm'] = option['orgNm'];
- });
- this.DCTermOption.unshift({'id':'','nm':'全部'});
- this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
- this.searchExecl();
- }
- });
- },
- // 获取Excel数据
- searchExecl(){
- this.loading = true;
- let _this = this;
- let iframe = document.getElementById("frameMainDcjh");
- let src = this.reportSrc;
- this.province = this.province == '' ? this.defaultProvince : this.province
- iframe.src= src
- + "&width=" + this.windowWidth
- + "&height=" + this.windowHeight
- + "&excelName=" + this.excelName
- + "&sttm=" + this.sttm
- + "&ettm=" + this.ettm
- + "&ptype=" + this.currentDCType
- + "&pid=" + this.currentDcTermId
- + "&persid=" + this.userId
- + "&dt=" + this.monthValue
- + "&adnm=" + this.province
-
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- _this.loading = false;
- });
- } else {
- iframe.onload = function(){
- _this.loading = false;
- };
- }
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainDcjh"];
- v.contentWindow.report1_saveAsExcel();
- },
-
- },
- activated() {
- this.getUserPlanType();
-
- }
- }
- </script>
- <style>
- #dcjhMain {
- overflow: hidden;
- padding:0;
- }
- </style>
|