2c0976a3 by 蔡俊立

模板打印

1 parent 8658247a
//==本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序==
import { MessageBox } from 'element-ui';
var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState;
//==判断是否需要CLodop(那些不支持插件的浏览器):==
......@@ -88,11 +88,29 @@ export function getLodop (oOBJECT, oEMBED) {
return;
}
if (!LODOP) {
document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : "") + strCLodopInstall_3 + document.body.innerHTML;
MessageBox.confirm('打印控件未安装,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open('http://192.168.2.38:9000/bdcdj/20221212/b8702920-987d-4685-aff4-ade7a3a2b868/CLodop_Setup_for_Win32NT.zip')
}).catch(() => {
});
//document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : "") + strCLodopInstall_3 + document.body.innerHTML;
return;
} else {
if (CLODOP.CVERSION < "4.0.9.9") {
document.body.innerHTML = strCLodopUpdate + document.body.innerHTML;
MessageBox.confirm('打印控件需要升级,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open('http://192.168.2.38:9000/bdcdj/20221212/cc00035b-4240-439a-b6a3-302cab44cb1e/install_lodop32.zip')
}).catch(() => {
});
//document.body.innerHTML = strCLodopUpdate + document.body.innerHTML;
}
if (oEMBED && oEMBED.parentNode)
oEMBED.parentNode.removeChild(oEMBED);
......@@ -122,17 +140,35 @@ export function getLodop (oOBJECT, oEMBED) {
LODOP = CreatedOKLodopObject;
//==Lodop插件未安装时提示下载地址:==
if ((!LODOP) || (!LODOP.VERSION)) {
if (ua.indexOf('Chrome') >= 0)
document.body.innerHTML = strHtmChrome + document.body.innerHTML;
if (ua.indexOf('Firefox') >= 0)
document.body.innerHTML = strHtmFireFox + document.body.innerHTML;
document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML;
MessageBox.confirm('打印控件未安装,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open('http://192.168.2.38:9000/bdcdj/20221212/b8702920-987d-4685-aff4-ade7a3a2b868/CLodop_Setup_for_Win32NT.zip')
}).catch(() => {
});
// if (ua.indexOf('Chrome') >= 0)
// document.body.innerHTML = strHtmChrome + document.body.innerHTML;
// if (ua.indexOf('Firefox') >= 0)
// document.body.innerHTML = strHtmFireFox + document.body.innerHTML;
// document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML;
return LODOP;
}
}
if (LODOP.VERSION < "6.2.2.6") {
if (!needCLodop())
document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML;
MessageBox.confirm('打印控件需要升级,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.open('http://192.168.2.38:9000/bdcdj/20221212/cc00035b-4240-439a-b6a3-302cab44cb1e/install_lodop32.zip')
}).catch(() => {
});
//document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML;
}
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):==
LODOP.SET_LICENSES("", "13528A153BAEE3A0254B9507DCDE2839", "EDE92F75B6A3D917F65910", "");
......
......@@ -30,14 +30,14 @@ class data extends filter {
prop: "tmpname",
label: "模板名称",
},
{
prop: "tmpfont",
label: "模板字体",
},
{
prop: "tmpfontsize",
label: "模板字体大小",
},
// {
// prop: "tmpfont",
// label: "模板字体",
// },
// {
// prop: "tmpfontsize",
// label: "模板字体大小",
// },
{
prop: "updatetime",
label: "最近操作时间",
......
import { getWorkFlowImage } from "@/api/workflow/jsydsyqFlow.js";
import { popupDialog } from "@/utils/popup.js";
import { getPrintTemplateByCode } from "@/api/system";
import { getPrintApplicationInfo } from "@/api/fqsq";
import { getLodop } from "@/utils/LodopFuncs"
import {
leftMenu,
......@@ -137,14 +138,20 @@ export default {
//根据编号获取对应信息
getPrintTemplateByCode({tmpno: 'dysqs'}).then(res => {
if(res.code == 200){
//打开模板设计
let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
LODOP.ADD_PRINT_DATA("ProgramData",res.result.tmpcontent); //装载模板
//todo 调取后端接口获取数据 循环set
LODOP.SET_PRINT_STYLEA("qlrmc","CONTENT","计划大河风流看");
LODOP.PREVIEW();
getPrintApplicationInfo(this.currentSelectProps).then(infoRes => {
if(infoRes.code == 200){
//打开模板设计
let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
LODOP.ADD_PRINT_DATA("ProgramData",res.result.tmpcontent); //装载模板
//todo 调取后端接口获取数据 循环set
for(let key in infoRes.result){
LODOP.SET_PRINT_STYLEA(key,"CONTENT",infoRes.result[key]);
}
LODOP.PREVIEW();
}else{
this.$message.error(infoRes.message)
}
})
}else{
this.$message.error(res.message)
}
......