| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <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>
- <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>选择时间段</p>
- <el-date-picker v-model="sttm" type="date" value-format="yyyy-MM-dd"
- placeholder="选择日期" style="width: 130px;margin-left:10px"></el-date-picker>
- <span style="padding-left: 10px;padding-right: 10px;">至</span>
- <el-date-picker v-model="ettm" type="date" value-format="yyyy-MM-dd"
- placeholder="选择日期" style="width: 130px"></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'
- 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-200,
- dxdcAsideHeight: window.innerHeight-90,
- windowHeight:window.innerHeight - 200,
- windowWidth:window.innerWidth - 50,
- }
- },
-
- 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"): ''
- },
- },
- 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 = "";
- }
- }
- },
- 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();
- });
- },
- 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:'';
- });
- },
- // 获取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
-
- 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>
- </style>
|