You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.5 KiB

<template>
<div >
<a-card :bordered="false" style="width: 100%;height: 730px">
<div class="table-operator" style="width: 18%">
<!-- <a-button type="primary">-->
<!-- 预览-->
<!-- </a-button>-->
2 years ago
<!-- <spen size="200px">采购申请表</spen>-->
<!-- <a-button type="primary">-->
<!-- 打印-->
<!-- </a-button>-->
</div>
2 years ago
<div style="width: 100%;height: 100%">
<iframe class="iframe"
:src="srcHtml"
frameborder="0"
ref="iframes"
style="width: 100%;height: 100%"
>
</iframe>
</div>
</a-card>
</div>
</template>
<script>
import { getAction } from '@api/manage'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
2 years ago
name: "ProcessMaterialPlan",
mixins:[JeecgListMixin,mixinDevice],
props:{
materWared:{
type: String,
2 years ago
},
/**/
procInstId: {
type: String,
default: '',
2 years ago
required: false
2 years ago
},
pictureId: {
type: String,
default: '',
2 years ago
required: false
2 years ago
},
lcModa: {
type: Object,
required: false
}
},
2 years ago
data(){
return{
showSessionId : '',
srcHtml : '',
url:{
2 years ago
list: "/hy/processUdgetPlan/getPlanTable",
},
2 years ago
Wslist: null,
}
},
mounted() {
this.showSessionId = window.location.search;
2 years ago
this.srcHtml = '../static/采购申请表.html';
2 years ago
// this.sendMesFroIframe();
},
created() {
2 years ago
this.sendMesFroIframe();
// this.loadData();
},
2 years ago
activated() {
this.sendMesFroIframe();
},
beforeMount() {
},
methods:{
//方法:
async sendMesFroIframe() {
2 years ago
await this.loadData();
let a = this.Wslist
console.log("执行了>>>>>>>>>>>>>>>>>>>>>>>",a);
const mapFrame = this.$refs['iframes']
if (mapFrame.attachEvent) { // 兼容浏览器判断
mapFrame.attachEvent('onload', function() {
const iframeWin = mapFrame.contentWindow
iframeWin.postMessage(a, '*')
// data传递的参数 *写成子页面的域名或者是ip
})
} else {
mapFrame.onload = function() {
const iframeWin = mapFrame.contentWindow
iframeWin.postMessage(a, '*')
}
}
},
loadData() {
return new Promise((resolve, reject) => {
if(!this.url.list){
this.$message.error("请设置url.list属性!")
return
}
2 years ago
console.log("KLJKLJKLJKLJKL",this.materWared);
this.queryParam.id = this.materWared;
getAction(this.url.list, this.queryParam).then((res) => {
console.log(res);
if (res.success) {
2 years ago
this.Wslist = res.result;
console.log("this.Wslist>>>>>>>>>>>>>>>>>>>>>>>>>>>>", res.result)
}
if(res.code===510){
this.$message.warning(res.message)
}
this.loading = false;
resolve( this.Wslist );
})
})
},
}
}
</script>
<style scoped>
.iframe {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background: #fff;
overflow-y: hidden;
}
</style>