6 changed files with 191 additions and 37 deletions
@ -1,18 +1,131 @@
|
||||
<template> |
||||
<div> |
||||
<a-button type="primary"> |
||||
预览 |
||||
</a-button> |
||||
<a-button>打印</a-button> |
||||
<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 { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { getAction } from '@api/manage' |
||||
|
||||
export default { |
||||
name: "ProcessMaterialsDeliveryStatement" |
||||
name: "ProcessMaterialsDeliveryStatement", |
||||
mixins:[JeecgListMixin,mixinDevice], |
||||
props:{ |
||||
materWared:{ |
||||
type: String, |
||||
} |
||||
}, |
||||
data(){ |
||||
return{ |
||||
showSessionId : '', |
||||
srcHtml : '', |
||||
url:{ |
||||
list: "/hy/processMaterialsDelivery/listStockRemoval", |
||||
}, |
||||
Wslist:[] |
||||
} |
||||
}, |
||||
created() { |
||||
this.sendMesFroIframe(); |
||||
// this.loadData(); |
||||
}, |
||||
activated() { |
||||
this.sendMesFroIframe(); |
||||
this.srcHtml = '../static/内部领物单.html'; |
||||
}, |
||||
mounted() { |
||||
this.showSessionId = window.location.search; |
||||
this.srcHtml = '../static/内部领物单.html'; |
||||
this.sendMesFroIframe(); |
||||
}, |
||||
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() { |
||||
return new Promise((resolve, reject) => { |
||||
if(!this.url.list){ |
||||
this.$message.error("请设置url.list属性!") |
||||
return |
||||
} |
||||
console.log("this.materWared>>>>>>>>>>>>>>>>>>>>>",this.materWared); |
||||
this.queryParam.processMaterialsDeliveryId = this.materWared; |
||||
getAction(this.url.list, this.queryParam).then((res) => { |
||||
console.log(res); |
||||
if (res.success) { |
||||
this.Wslist = res.result.records; |
||||
console.log("res.result>>>>>>>>>>>>>>>>",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> |
Loading…
Reference in new issue