自定义报表加入打印功能

This commit is contained in:
java110 2022-08-02 09:50:03 +08:00
parent 5dd1cfd250
commit f41c544f45
6 changed files with 111 additions and 41 deletions

View File

@ -1,5 +1,4 @@
<div id="editPropertyCompanyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" <div id="editPropertyCompanyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
aria-hidden="true">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
@ -40,7 +39,7 @@
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="地标" namespace="editPropertyCompany"></vc:i18n></span></label> <label class="col-sm-2 col-form-label"><span><vc:i18n name="地标" namespace="editPropertyCompany"></vc:i18n></span></label>
<div class="col-sm-10"> <div class="col-sm-10">
<input v-model="editPropertyCompanyInfo.nearbyLandmarks" type="text" :placeholder="vc.i18n('必填,请填写地标','editPropertyCompany')" class="form-control"> <input v-model="editPropertyCompanyInfo.nearByLandmarks" type="text" :placeholder="vc.i18n('必填,请填写地标','editPropertyCompany')" class="form-control">
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">

View File

@ -35,6 +35,9 @@
<button type="button" class="btn btn-white btn-sm" v-on:click="_exportReportTableMethod(item)"> <button type="button" class="btn btn-white btn-sm" v-on:click="_exportReportTableMethod(item)">
导出 导出
</button> </button>
<button type="button" class="btn btn-white btn-sm" v-on:click="_printReportTableMethod(item)">
打印
</button>
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">

View File

@ -201,9 +201,11 @@
} }
let urlParam = _result.join('&'); let urlParam = _result.join('&');
vc.jumpToPage('/callComponent/importAndExportFee/exportCustomReportTableData?' + urlParam) vc.jumpToPage('/callComponent/importAndExportFee/exportCustomReportTableData?' + urlParam)
},
_printReportTableMethod: function(_data) {
vc.saveData('printCommonReportTableData', _data);
window.open('/print.html#/pages/property/printCommonReportTable');
} }
} }
}); });

View File

@ -0,0 +1,33 @@
<div>
<div class="top-1 ">
<h1 class="text-center" style="color:#000;font-weight: 400;">{{printCommonReportTableInfo.componentName}}</h1>
</div>
<div class="context-1">
<table class="table vc-table-border" style="color:#000;font-size:20px">
<thead>
<tr>
<th class="text-center" v-for="(itemTh,indexTh) in printCommonReportTableInfo.th">{{itemTh}}</th>
</tr>
</thead>
<tbody class="vc-table-border" style="color:#000;font-size:20px">
<tr v-for="(itemData,indexData) in printCommonReportTableInfo.data" class="vc-table-border">
<td class="text-center" v-for="(tmpItemTh,key) in printCommonReportTableInfo.th">
{{itemData[tmpItemTh]}}</td>
</tr>
</tbody>
</table>
<div class="row padding-left" v-if="printCommonReportTableInfo.footer" style="color:#000;font-size:20px">
<span class="col-md-2" v-for="(tmpItemTh,key) of printCommonReportTableInfo.footer">
<div class="row">{{key}}: {{tmpItemTh}}</div>
</span>
</div>
<div class="text-right" id="print-btn">
<button class="btn btn-primary float-right" type="button" v-on:click="_printPurchaseApplyDiv()">
<i class="fa fa-check"></i>&nbsp;打印
</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" v-on:click="_closePage()"><span><vc:i18n name="取消" namespace="printPayFeeBangTai"></vc:i18n></span>
</button>
</div>
</div>
</div>

View File

@ -0,0 +1,33 @@
/**
入驻小区
**/
(function(vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
printCommonReportTableInfo: {}
},
_initMethod: function() {
$that.printCommonReportTableInfo = vc.getData('printCommonReportTableData')
},
methods: {
_printPurchaseApplyDiv: function() {
$that.printFlag = '1';
console.log('console.log($that.printFlag);', $that.printFlag);
document.getElementById("print-btn").style.display = "none"; //隐藏
window.print();
//$that.printFlag = false;
window.opener = null;
window.close();
},
_closePage: function() {
window.opener = null;
window.close();
},
}
});
})(window.vc);