完善打印功能
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<!--打印-->
|
||||
<a-button key="back" @click="handleCancel">取消(ESC)</a-button>
|
||||
<template v-if="isShowPrintBtn">
|
||||
<a-button v-if="billPrintFlag" @click="handlePrintPro">三联打印新版预览</a-button>
|
||||
<a-button v-if="billPrintFlag" @click="handlePrint">三联打印预览</a-button>
|
||||
<!--此处为解决缓存问题-->
|
||||
<a-button v-if="billType === '零售出库'" v-print="'#retailOutPrint'">普通打印</a-button>
|
||||
@@ -1177,6 +1178,7 @@
|
||||
</template>
|
||||
</a-form>
|
||||
<bill-print-iframe ref="modalDetail"></bill-print-iframe>
|
||||
<bill-print-pro-iframe ref="modalProDetail"></bill-print-pro-iframe>
|
||||
<financial-detail ref="financialDetailModal"></financial-detail>
|
||||
</j-modal>
|
||||
</template>
|
||||
@@ -1187,6 +1189,7 @@
|
||||
import { findBillDetailByNumber, findFinancialDetailByNumber, getPlatformConfigByKey, getCurrentSystemConfig} from '@/api/api'
|
||||
import { getMpListShort, getCheckFlag, exportXlsPost } from "@/utils/util"
|
||||
import BillPrintIframe from './BillPrintIframe'
|
||||
import BillPrintProIframe from './BillPrintProIframe'
|
||||
import FinancialDetail from '../../financial/dialog/FinancialDetail'
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
import Vue from 'vue'
|
||||
@@ -1194,6 +1197,7 @@
|
||||
name: 'BillDetail',
|
||||
components: {
|
||||
BillPrintIframe,
|
||||
BillPrintProIframe,
|
||||
FinancialDetail,
|
||||
JUpload
|
||||
},
|
||||
@@ -1940,6 +1944,17 @@
|
||||
return ''
|
||||
}
|
||||
},
|
||||
//三联打印新版预览
|
||||
handlePrintPro() {
|
||||
getPlatformConfigByKey({"platformKey": "bill_print_pro_url"}).then((res)=> {
|
||||
if (res && res.code === 200) {
|
||||
let billPrintUrl = res.data.platformValue + '?no=' + this.model.number
|
||||
let billPrintHeight = document.documentElement.clientHeight - 260
|
||||
this.$refs.modalProDetail.show(this.model, billPrintUrl, billPrintHeight)
|
||||
this.$refs.modalProDetail.title = this.billType + "-三联打印新版预览"
|
||||
}
|
||||
})
|
||||
},
|
||||
//三联打印预览
|
||||
handlePrint() {
|
||||
getPlatformConfigByKey({"platformKey": "bill_print_url"}).then((res)=> {
|
||||
|
||||
80
jshERP-web/src/views/bill/dialog/BillPrintProIframe.vue
Normal file
80
jshERP-web/src/views/bill/dialog/BillPrintProIframe.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:forceRender="true"
|
||||
:style="modalStyle"
|
||||
fullscreen
|
||||
switchFullscreen
|
||||
@cancel="handleCancel"
|
||||
wrapClassName="ant-modal-cust-warp">
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="handleCancel">取消</a-button>
|
||||
</template>
|
||||
<a-form :form="form">
|
||||
<template>
|
||||
<iframe :src="billPrintUrl" :height="height" style="width: 100%; border: none;"></iframe>
|
||||
</template>
|
||||
<template>
|
||||
<a-row>
|
||||
<a-col>
|
||||
<a-form-item>
|
||||
<a-input v-decorator="['id']" hidden/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
</a-form>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {mixinDevice} from '@/utils/mixin'
|
||||
export default {
|
||||
name: 'BillPrintProIframe',
|
||||
mixins: [mixinDevice],
|
||||
data () {
|
||||
return {
|
||||
title: "三联打印预览",
|
||||
width: '1500px',
|
||||
visible: false,
|
||||
modalStyle: '',
|
||||
billPrintUrl: '',
|
||||
height: "",
|
||||
model: {},
|
||||
form: this.$form.createForm(this),
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
show(record, billPrintUrl, billPrintHeight) {
|
||||
this.height = billPrintHeight
|
||||
this.billPrintUrl = billPrintUrl
|
||||
this.visible = true
|
||||
this.modalStyle = 'top:20px;height: 95%;'
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'id'))
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.billPrintUrl = ''
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
this.modalStyle = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user