优化代码

This commit is contained in:
wuxw 2023-10-08 01:46:22 +08:00
parent 219ceb30ed
commit fcf28201f9
3 changed files with 42 additions and 12 deletions

View File

@ -363,7 +363,7 @@
backdrop: "static", //点击空白处不关闭对话框 backdrop: "static", //点击空白处不关闭对话框
show: true show: true
}); });
},3000); },2000);
$that.batchPayFeeOrderInfo.selectPayFeeIds = []; $that.batchPayFeeOrderInfo.selectPayFeeIds = [];
$that._loadBatchFees(); $that._loadBatchFees();

View File

@ -173,7 +173,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="_back()"><vc:i18n name="返回" namespace="owePayFeeOrder"></vc:i18n> <button type="button" class="btn btn-secondary" @click="_back()"><vc:i18n name="返回" namespace="owePayFeeOrder"></vc:i18n>
</button> </button>
<!-- <button type="button" class="btn btn-primary" @click="_printAndBack()"><vc:i18n name="打印收据" namespace="owePayFeeOrder"></vc:i18n></button> --> <button type="button" class="btn btn-primary" @click="_printAndBack()"><vc:i18n name="打印收据" namespace="owePayFeeOrder"></vc:i18n></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -19,6 +19,8 @@
payType: 'common', payType: 'common',
authCode: '', authCode: '',
orderId: '', orderId: '',
printUrl: '/print.html#/pages/property/printPayFee',
detailIds:'',
} }
}, },
watch: { watch: {
@ -45,9 +47,34 @@
vc.getDict('pay_fee_detail', "prime_rate", function(_data) { vc.getDict('pay_fee_detail', "prime_rate", function(_data) {
$that.owePayFeeOrderInfo.primeRates = _data; $that.owePayFeeOrderInfo.primeRates = _data;
}); });
$that._listFeePrintPages();
}, },
_initEvent: function() {}, _initEvent: function() {},
methods: { methods: {
_listFeePrintPages: function(_page, _rows) {
let param = {
params: {
page: 1,
row: 1,
state: 'T',
communityId: vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/feePrintPage.listFeePrintPage',
param,
function(json, res) {
let _json = JSON.parse(json);
let feePrintPages = _json.data;
if (feePrintPages && feePrintPages.length > 0) {
$that.owePayFeeOrderInfo.printUrl = feePrintPages[0].url;
}
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
_loadOweFees: function() { _loadOweFees: function() {
let param = { let param = {
params: { params: {
@ -292,17 +319,19 @@
_doDealPayResult: function(_json) { _doDealPayResult: function(_json) {
$that._closeDoOwePayFeeModal(); $that._closeDoOwePayFeeModal();
let _data = _json.data; let _data = _json.data;
let receiptIds = ''; let _detailIds = '';
_data.receipts.forEach(item => { _data.details.forEach(item => {
receiptIds += (item.receiptId + ','); _detailIds += (item + ',');
}) })
$that.owePayFeeOrderInfo.receiptIds = receiptIds; $that.owePayFeeOrderInfo.detailIds = _detailIds;
//vc.saveData('_feeInfo', _feeInfo); //vc.saveData('_feeInfo', _feeInfo);
//关闭model setTimeout(function(){
$("#payFeeResult").modal({ $("#payFeeResult").modal({
backdrop: "static", //点击空白处不关闭对话框 backdrop: "static", //点击空白处不关闭对话框
show: true show: true
}); });
},2000);
$that.owePayFeeOrderInfo.selectPayFeeIds = []; $that.owePayFeeOrderInfo.selectPayFeeIds = [];
$that._loadOweFees(); $that._loadOweFees();
vc.toast(_json.msg); vc.toast(_json.msg);
@ -313,7 +342,8 @@
}, },
_printAndBack: function() { _printAndBack: function() {
$('#payFeeResult').modal("hide"); $('#payFeeResult').modal("hide");
window.open("/print.html#/pages/property/printPayFee?receiptIds=" + $that.owePayFeeOrderInfo.receiptIds) // window.open("/print.html#/pages/property/printPayFee?receiptIds=" + $that.owePayFeeOrderInfo.receiptIds);
window.open($that.owePayFeeOrderInfo.printUrl + "?detailIds=" + $that.owePayFeeOrderInfo.detailIds)
}, },
_dealSelectFee: function() { _dealSelectFee: function() {
let totalFee = 0.00; let totalFee = 0.00;