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.

128 lines
2.9 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>-->
</div>
<div style="width: 100%;height: 80%">
<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 {
name: "ProcessMaterialWarehousingStatement",
mixins:[JeecgListMixin,mixinDevice],
props:{
materWared:{
type: String,
}
},
data(){
return{
showSessionId : '',
srcHtml : '',
url:{
list: "/hy/processMaterialWarehousing/queryByIdWarehousingList",
},
Wslist:[]
}
},
mounted() {
this.showSessionId = window.location.search;
this.srcHtml = '../static/物质入库验收报告.html';
this.sendMesFroIframe();
},
created() {
// this.loadData();
},
beforeMount() {
},
methods:{
//方法:
async sendMesFroIframe() {
let a = await this.loadData();
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() {
console.log("执行; 欧帕科夫")
return new Promise((resolve, reject) => {
if(!this.url.list){
this.$message.error("请设置url.list属性!")
return
}
console.log(this.materWared);
this.queryParam.processMaterialWarehousingId = this.materWared;
getAction(this.url.list, this.queryParam).then((res) => {
console.log(res);
if (res.success) {
this.Wslist = res.result.records;
}
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>