优化单据明细页面
This commit is contained in:
@@ -1101,9 +1101,12 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initPlatform() {
|
initPlatform() {
|
||||||
getPlatformConfigByKey( {"platformKey": "bill_print_flag"}).then((res)=> {
|
getPlatformConfigByKey({"platformKey": "bill_print_flag"}).then((res)=> {
|
||||||
if (res && res.code == 200) {
|
if (res && res.code === 200) {
|
||||||
this.billPrintFlag = res.data.platformValue==='1'?true:false
|
if(this.billType === '采购订单'||this.billType === '采购入库'||this.billType === '采购退货出库'||
|
||||||
|
this.billType === '销售订单'||this.billType === '销售出库'||this.billType === '销售退货入库') {
|
||||||
|
this.billPrintFlag = res.data.platformValue==='1'?true:false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -1154,8 +1157,14 @@
|
|||||||
},
|
},
|
||||||
//三联打印预览
|
//三联打印预览
|
||||||
handlePrint() {
|
handlePrint() {
|
||||||
this.$refs.modalDetail.show(this.model, this.billType);
|
getPlatformConfigByKey({"platformKey": "bill_print_url"}).then((res)=> {
|
||||||
this.$refs.modalDetail.title=this.billType + "-三联打印预览";
|
if (res && res.code === 200) {
|
||||||
|
let billPrintUrl = res.data.platformValue + '?no=' + this.model.number
|
||||||
|
let billPrintHeight = this.dataSource.length*46 + 300
|
||||||
|
this.$refs.modalDetail.show(this.model, billPrintUrl, billPrintHeight);
|
||||||
|
this.$refs.modalDetail.title = this.billType + "-三联打印预览";
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,57 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
<div></div>
|
<a-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭"
|
||||||
|
wrapClassName="ant-modal-cust-warp"
|
||||||
|
style="top:5%;height: 100%;overflow-y: hidden">
|
||||||
|
<template slot="footer">
|
||||||
|
<a-button key="back" @click="handleCancel">取消</a-button>
|
||||||
|
</template>
|
||||||
|
<a-form :form="form">
|
||||||
|
<template>
|
||||||
|
<iframe :src="billPrintUrl" width="100%" :height="height" frameborder="0" scrolling="no"></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>
|
||||||
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import pick from 'lodash.pick'
|
||||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
|
||||||
import {mixinDevice} from '@/utils/mixin.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "BillPrintIframe",
|
name: 'BillPrintIframe',
|
||||||
inject:['closeCurrent'],
|
|
||||||
mixins: [mixinDevice],
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
url: "",
|
title: "三联打印预览",
|
||||||
id:"",
|
width: '1550px',
|
||||||
height: ""
|
visible: false,
|
||||||
|
billPrintUrl: '',
|
||||||
|
height: "",
|
||||||
|
model: {},
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
loading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.goUrl()
|
|
||||||
},
|
|
||||||
updated () {
|
|
||||||
this.goUrl()
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
$route(to, from) {
|
|
||||||
this.goUrl();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show(record, type) {
|
show(record, billPrintUrl, billPrintHeight) {
|
||||||
|
this.height = billPrintHeight
|
||||||
|
this.billPrintUrl = billPrintUrl
|
||||||
|
this.visible = true;
|
||||||
|
this.model = Object.assign({}, record);
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model,'id'))
|
||||||
|
});
|
||||||
},
|
},
|
||||||
goUrl () {
|
handleCancel() {
|
||||||
let url = this.$route.meta.url
|
this.close()
|
||||||
this.id = this.$route.path
|
},
|
||||||
if (this.isMobile()) {
|
close() {
|
||||||
this.height = 800
|
this.$emit('close');
|
||||||
} else {
|
this.visible = false;
|
||||||
this.height = document.documentElement.clientHeight-130
|
|
||||||
}
|
|
||||||
console.log("------url------"+url)
|
|
||||||
console.log("------token------"+Vue.ls.get(ACCESS_TOKEN))
|
|
||||||
if (url !== null && url !== undefined) {
|
|
||||||
//外部url加入token
|
|
||||||
let token = Vue.ls.get(ACCESS_TOKEN);
|
|
||||||
this.url = url + '?token=' + token;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user