优化打印收据问题

This commit is contained in:
java110 2022-05-19 22:54:35 +08:00
parent ea5b5c8284
commit 1c6bb0219f
3 changed files with 67 additions and 28 deletions

View File

@ -133,6 +133,10 @@
<button class="btn-white btn btn-xs" v-on:click="_printFeeReceipt(feeReceipt)"><span><vc:i18n name="补打收据" namespace="feeReceipt"></vc:i18n></span>
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_printFeeSmallReceipt(feeReceipt)"><span><vc:i18n name="补打小票" namespace="feeReceipt"></vc:i18n></span>
</button>
</div>
<!-- <div v-if="feeReceipt.objType == '6666'" class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_printFeeReceipt(feeReceipt)"><span><vc:i18n name="补打收据" namespace="feeReceipt"></vc:i18n></span>(车)</button>
@ -154,4 +158,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
/**
入驻小区
**/
(function (vc) {
(function(vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
@ -28,9 +28,9 @@
}
}
},
_initMethod: function () {
_initMethod: function() {
//切换 至费用页面
vc.on('feeReceipt', 'switch', function (_param) {
vc.on('feeReceipt', 'switch', function(_param) {
if (_param.ownerId == '') {
return;
}
@ -55,16 +55,16 @@
// $that.reportFeeSummaryInfo.conditions.startTime = _startTime;
// });
},
_initEvent: function () {
vc.on('feeReceiptManage', 'listFeeReceipt', function (_param) {
_initEvent: function() {
vc.on('feeReceiptManage', 'listFeeReceipt', function(_param) {
vc.component._listFeeReceipts(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listFeeReceipts(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_initDate: function () {
_initDate: function() {
$(".startTime").datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
@ -88,7 +88,7 @@
todayBtn: true
});
$('.startTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".startTime").val();
vc.component.feeReceiptManageInfo.conditions.qstartTime = value;
let start = Date.parse(new Date(vc.component.feeReceiptManageInfo.conditions.qstartTime))
@ -99,7 +99,7 @@
}
});
$('.endTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".endTime").val();
vc.component.feeReceiptManageInfo.conditions.qendTime = value;
let start = Date.parse(new Date(vc.component.feeReceiptManageInfo.conditions.qstartTime))
@ -110,7 +110,7 @@
}
});
},
_listFeeReceipts: function (_page, _rows) {
_listFeeReceipts: function(_page, _rows) {
vc.component._initDate();
vc.component.feeReceiptManageInfo.conditions.page = _page;
vc.component.feeReceiptManageInfo.conditions.row = _rows;
@ -121,7 +121,7 @@
//发送get请求
vc.http.apiGet('/feeReceipt/queryFeeReceipt',
param,
function (json, res) {
function(json, res) {
var _feeReceiptManageInfo = JSON.parse(json);
vc.component.feeReceiptManageInfo.total = _feeReceiptManageInfo.total;
vc.component.feeReceiptManageInfo.records = _feeReceiptManageInfo.records;
@ -135,17 +135,18 @@
total: vc.component.feeReceiptManageInfo.records,
currentPage: _page
});
}, function (errInfo, error) {
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
//查询
_queryFeeReceiptMethod: function () {
_queryFeeReceiptMethod: function() {
vc.component._listFeeReceipts(DEFAULT_PAGE, DEFAULT_ROWS);
},
//重置
_resetFeeReceiptMethod: function () {
_resetFeeReceiptMethod: function() {
vc.component.feeReceiptManageInfo.conditions.objType = "";
vc.component.feeReceiptManageInfo.conditions.roomId = "";
vc.component.feeReceiptManageInfo.conditions.receiptId = "";
@ -153,10 +154,13 @@
vc.component.feeReceiptManageInfo.conditions.qendTime = "";
vc.component._listFeeReceipts(DEFAULT_PAGE, DEFAULT_ROWS);
},
_printFeeReceipt: function (_receipt) {
_printFeeReceipt: function(_receipt) {
window.open($that.feeReceiptManageInfo.printUrl + "?receiptId=" + _receipt.receiptId);
},
_printFeeReceipts: function (_conditions) {
_printFeeSmallReceipt: function(_receipt) {
window.open('/smallPrint.html#/pages/property/printSmallPayFee?receiptIds=' + _receipt.receiptId);
},
_printFeeReceipts: function(_conditions) {
// console.log(_conditions)
if (_conditions.roomId == null || _conditions.roomId == "") {
vc.toast("请填写收费对象", 1000);
@ -183,14 +187,14 @@
window.open("/print.html#/pages/property/printPayFees?roomName=" + _conditions.roomId +
"&type=" + _conditions.type + "&qstartTime=" + _conditions.qstartTime + "&qendTime=" + _conditions.qendTime);
},
_moreCondition: function () {
_moreCondition: function() {
if (vc.component.feeReceiptManageInfo.moreCondition) {
vc.component.feeReceiptManageInfo.moreCondition = false;
} else {
vc.component.feeReceiptManageInfo.moreCondition = true;
}
},
_listFeePrintPages: function (_page, _rows) {
_listFeePrintPages: function(_page, _rows) {
var param = {
params: {
page: 1,
@ -202,17 +206,18 @@
//发送get请求
vc.http.apiGet('feePrintPage.listFeePrintPage',
param,
function (json, res) {
function(json, res) {
var _feePrintPageManageInfo = JSON.parse(json);
let feePrintPages = _feePrintPageManageInfo.data;
if (feePrintPages && feePrintPages.length > 0) {
$that.feeReceiptManageInfo.printUrl = feePrintPages[0].url;
}
}, function (errInfo, error) {
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
}
});
})(window.vc);
})(window.vc);

View File

@ -328,13 +328,12 @@
fees: _printFees
}
let _data = JSON.parse(json).data;
$that.payFeeOrderInfo.receiptId = _data.receiptId;
// $that.payFeeOrderInfo.receiptId = _data.receiptId;
//vc.saveData('_feeInfo', _feeInfo);
//关闭model
$("#payFeeResult").modal({
backdrop: "static", //点击空白处不关闭对话框
show: true
});
//查询收据
setTimeout(function() {
$that._queryPayFeeReceiptId(_data);
}, 1000);
return;
}
vc.toast(json);
@ -345,6 +344,37 @@
}
);
},
//查询收据
_queryPayFeeReceiptId: function(_data) {
let _param = {
params: {
detailIds: _data.detailId,
communityId: vc.getCurrentCommunity().communityId,
page: 1,
row: 1
}
}
vc.http.apiGet(
'/feeReceipt/queryFeeReceipt',
_param,
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json)
if (_json.code == 0 && _json.data && _json.data.length > 0) {
$that.payFeeOrderInfo.receiptId = _json.data[0].receiptId;
}
$("#payFeeResult").modal({
backdrop: "static", //点击空白处不关闭对话框
show: true
});
},
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
}
);
},
/**
* 下拉 change 事件