| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template>
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;">
- <p class="pStyle">督查对象类别:</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 class="pStyle">机构:</p>
- <el-select v-model="currentDcTermId" placeholder="请选择机构" style="margin-left:10px;margin-right:15px">
- <el-option
- v-for="item in DCTermOption"
- :key="item.id"
- :label="item.nm"
- :value="item.id">
- </el-option>
- </el-select>
- <p class="pStyle">督查状态:</p>
- <el-select v-model="dcType" clearable placeholder="督查状态" style="margin-left:10px;margin-right:15px">
- <el-option label="未督查" value="0"></el-option>
- <el-option label="督查中" value="1"></el-option>
- <el-option label="已督查" value="2"></el-option>
- </el-select>
- <p class="pStyle">省份:</p>
- <el-input v-model="province" clearable style="width: 130px;margin-left:10px;margin-right:15px"></el-input>
- <p class="pStyle">选择月份:</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;" @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%','overflow':'hidden'}" 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 {getPersPlanType} from "@api/duChaPlan.js";
- export default {
- props: [],
- components: {
- },
- data() {
- return {
- currentDCType:'', // ptype
- DCTypeOption:[],
- currentDcTermId:'', // pid
- DCTermOption:[],
- loading:true,
- reportSrc:'/JsReport/reportFiles/reportjsp/showReport.jsp?raq=dcjh_Sheet1.raq',
- excelName:'督查计划表',
- sttm:'',
- ettm:'',
- dxdcMainHeight: window.innerHeight - 70,
- windowHeight:window.innerHeight - 62,
- windowWidth:window.innerWidth - 10,
- monthValue:'',
- province:'',
- dcType: '1', // 督查状态
- }
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- }
- },
- watch:{
- currentDCType:function(){
- // this.searchExecl()
- },
- 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.getUserPlanType();
- },
- methods:{
- getUserPlanType:function(){
- 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.getOrgOption();
- });
- },
- 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;
- 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
- + "&dcType=" + this.dcType
- 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;
- }
- .pStyle{
- font-size: 14px;
- color: #606266;
- }
- </style>
|