Browse Source

修改采购入库制式表格

dev
long 2 years ago
parent
commit
bcd965e86c
  1. 210
      src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue
  2. 2
      src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue
  3. 2
      src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue

210
src/views/accessrecords/statement/ProcessMaterialWarehousingStatement.vue

@ -1,130 +1,120 @@
<template>
<div >
<a-card :bordered="false" style="width: 100%;height: 730px">
<div>
<a-button type="primary" icon="download" @click="downWord">下载</a-button>
<a-button type="primary" style="left: 10px" @click="previewWord">预览并打印</a-button>
<div class="table-operator" style="width: 18%">
<!-- <a-button type="primary">-->
<!-- 预览-->
<!-- </a-button>-->
<div style="width: 100%;height: 100%;">
<pdf v-show="false" ref="pdfWord" :src="pdfSrc" class="pdf" style=""></pdf>
</div>
</div>
</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",
const VALIDATE_NO_PASSED = Symbol()
import pick from 'lodash.pick'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, downFile } from '@/api/manage'
import pdf from 'vue-pdf-signature'
import CMapReaderFactory from 'vue-pdf-signature/src/CMapReaderFactory'
export default {
name: 'ProcessMaterialWarehousingStatement',
mixins: [JeecgListMixin, mixinDevice],
components: { pdf, CMapReaderFactory },
props: {
materWared: {
type: String
},
Wslist:[]
}
},
created() {
this.sendMesFroIframe();
// this.loadData();
},
activated() {
this.sendMesFroIframe();
},
mounted() {
this.showSessionId = window.location.search;
this.srcHtml = '../static/物质入库验收报告.html';
this.sendMesFroIframe();
},
beforeMount() {
/**/
procInstId: {
type: String,
default: '',
required: false
},
pictureId: {
type: String,
default: '',
required: false
},
lcModa: {
type: Object,
required: false
}
},
},
methods:{
//
async sendMesFroIframe() {
let a = await this.loadData();
console.log("执行了>>>>>>>>>>>>>>>>>>",a);
data() {
return {
showSessionId: '',
srcHtml: '',
modalLsVisible: false,
pdfWord: '',
pdfSrc: '',
url: {
list: '/hy/processUdgetPlan/getPlanTable',
queryPlandDownWord: '/word/queryWarehousingDownWord',
queryPlanPrevie: '/word/queryWarehousingPrevie'
},
Wslist: null
}
},
mounted() {
this.showSessionId = window.location.search
},
created() {
downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => {
console.log(data)
const blob = new Blob([data], { type: 'application/pdf' })
this.pdfWord = window.URL.createObjectURL(blob)
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, '*')
}
}
})
// this.loadData();
},
activated() {
},
},
beforeMount() {
loadData() {
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;
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.queryPlanApply}`
}
},
methods: {
//
downWord() {
downFile(this.url.queryPlandDownWord, { id: this.queryParam.id }).then((data) => {
const blob = new Blob([data]) //
var a = document.createElement('a') //<a></a>
a.href = URL.createObjectURL(blob) // ahref
a.download = '采购通知书.docx' //
a.style.display = 'none' // a
document.body.appendChild(a) // a
a.click() // aahref
a.remove()
})
}
if(res.code===510){
this.$message.warning(res.message)
}
this.loading = false;
resolve( this.Wslist );
},
previewWord() {
downFile(this.url.queryPlanPrevie, { id: this.queryParam.id }).then((data) => {
console.log(data)
const blob = new Blob([data], { type: 'application/pdf' })
this.pdfSrc = window.URL.createObjectURL(blob)
console.log(this.pdfSrc)
window.open(this.pdfSrc)//
})
},
loadData() {
this.queryParam.id = this.materWared
},
})
},
}
}
}
</script>
<style scoped>
.iframe {
<style lang="less" scoped>
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background: #fff;
overflow-y: hidden;
}
</style>

2
src/views/accessrecords/statement/ProcessMaterialsPlanStatement.vue

@ -20,7 +20,7 @@
import CMapReaderFactory from 'vue-pdf-signature/src/CMapReaderFactory'
export default {
name: 'ProcessMaterialPlan',
name: 'ProcessMaterialsPlanStatement',
mixins: [JeecgListMixin, mixinDevice],
components: { pdf, CMapReaderFactory },
props: {

2
src/views/accessrecords/statement/ProcessMaterialsPlanStatement2.vue

@ -20,7 +20,7 @@
import CMapReaderFactory from 'vue-pdf-signature/src/CMapReaderFactory'
export default {
name: 'ProcessMaterialPlan',
name: 'ProcessMaterialsPlanStatement2',
mixins: [JeecgListMixin, mixinDevice],
components: { pdf, CMapReaderFactory },
props: {

Loading…
Cancel
Save