mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
39e83da261
commit
3f4ad33b38
@ -1,4 +1,4 @@
|
|||||||
(function (vc) {
|
(function(vc) {
|
||||||
|
|
||||||
vc.extends({
|
vc.extends({
|
||||||
data: {
|
data: {
|
||||||
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
printFlag: '0'
|
printFlag: '0'
|
||||||
},
|
},
|
||||||
_initMethod: function () {
|
_initMethod: function() {
|
||||||
//vc.component._initPrintPurchaseApplyDateInfo();
|
//vc.component._initPrintPurchaseApplyDateInfo();
|
||||||
|
|
||||||
$that.printPayFeeInfo.receiptId = vc.getParam('receiptId');
|
$that.printPayFeeInfo.receiptId = vc.getParam('receiptId');
|
||||||
@ -34,15 +34,15 @@
|
|||||||
|
|
||||||
$that._loadPrintSpec();
|
$that._loadPrintSpec();
|
||||||
},
|
},
|
||||||
_initEvent: function () {
|
_initEvent: function() {
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_initPayFee: function () {
|
_initPayFee: function() {
|
||||||
|
|
||||||
},
|
},
|
||||||
_loadReceipt: function () {
|
_loadReceipt: function() {
|
||||||
|
|
||||||
var param = {
|
var param = {
|
||||||
params: {
|
params: {
|
||||||
@ -57,7 +57,7 @@
|
|||||||
//发送get请求
|
//发送get请求
|
||||||
vc.http.apiGet('/feeReceipt/queryFeeReceipt',
|
vc.http.apiGet('/feeReceipt/queryFeeReceipt',
|
||||||
param,
|
param,
|
||||||
function (json, res) {
|
function(json, res) {
|
||||||
var _feeReceiptManageInfo = JSON.parse(json);
|
var _feeReceiptManageInfo = JSON.parse(json);
|
||||||
let _feeReceipt = _feeReceiptManageInfo.data;
|
let _feeReceipt = _feeReceiptManageInfo.data;
|
||||||
let _amount = 0;
|
let _amount = 0;
|
||||||
@ -74,12 +74,13 @@
|
|||||||
|
|
||||||
$that._loadReceiptDetail();
|
$that._loadReceiptDetail();
|
||||||
|
|
||||||
}, function (errInfo, error) {
|
},
|
||||||
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_loadReceiptDetail: function () {
|
_loadReceiptDetail: function() {
|
||||||
|
|
||||||
var param = {
|
var param = {
|
||||||
params: {
|
params: {
|
||||||
@ -94,7 +95,7 @@
|
|||||||
//发送get请求
|
//发送get请求
|
||||||
vc.http.apiGet('/feeReceipt/queryFeeReceiptDetail',
|
vc.http.apiGet('/feeReceipt/queryFeeReceiptDetail',
|
||||||
param,
|
param,
|
||||||
function (json, res) {
|
function(json, res) {
|
||||||
var _feeReceiptManageInfo = JSON.parse(json);
|
var _feeReceiptManageInfo = JSON.parse(json);
|
||||||
let _feeReceiptDetails = _feeReceiptManageInfo.data;
|
let _feeReceiptDetails = _feeReceiptManageInfo.data;
|
||||||
_feeReceiptDetails.forEach(item => {
|
_feeReceiptDetails.forEach(item => {
|
||||||
@ -108,12 +109,13 @@
|
|||||||
$that.printPayFeeInfo.fees = _feeReceiptDetails;
|
$that.printPayFeeInfo.fees = _feeReceiptDetails;
|
||||||
|
|
||||||
|
|
||||||
}, function (errInfo, error) {
|
},
|
||||||
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_loadPrintSpec: function () {
|
_loadPrintSpec: function() {
|
||||||
var param = {
|
var param = {
|
||||||
params: {
|
params: {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -126,7 +128,7 @@
|
|||||||
//发送get请求
|
//发送get请求
|
||||||
vc.http.apiGet('/feePrintSpec/queryFeePrintSpec',
|
vc.http.apiGet('/feePrintSpec/queryFeePrintSpec',
|
||||||
param,
|
param,
|
||||||
function (json, res) {
|
function(json, res) {
|
||||||
var _json = JSON.parse(json);
|
var _json = JSON.parse(json);
|
||||||
var _data = _json.data;
|
var _data = _json.data;
|
||||||
if (_data.length > 0) {
|
if (_data.length > 0) {
|
||||||
@ -136,34 +138,35 @@
|
|||||||
$that.printPayFeeInfo.communityName = _data[0].printName;
|
$that.printPayFeeInfo.communityName = _data[0].printName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, function (errInfo, error) {
|
},
|
||||||
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
},
|
},
|
||||||
_computeSumArea: function () {
|
_computeSumArea: function() {
|
||||||
let _sum = 0.00;
|
let _sum = 0.00;
|
||||||
$that.printPayFeeInfo.fees.forEach(item => {
|
$that.printPayFeeInfo.fees.forEach(item => {
|
||||||
if (item.area && vc.isNumber(item.area)) {
|
if (item.area && vc.isNumber(item.area)) {
|
||||||
_sum += parseFloat(item.area);
|
_sum += parseFloat(item.area);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return _sum;
|
return _sum.toFixed(2);
|
||||||
},
|
},
|
||||||
|
|
||||||
_printPurchaseApplyDiv: function () {
|
_printPurchaseApplyDiv: function() {
|
||||||
|
|
||||||
$that.printFlag = '1';
|
$that.printFlag = '1';
|
||||||
console.log('console.log($that.printFlag);', $that.printFlag);
|
console.log('console.log($that.printFlag);', $that.printFlag);
|
||||||
document.getElementById("print-btn").style.display = "none";//隐藏
|
document.getElementById("print-btn").style.display = "none"; //隐藏
|
||||||
|
|
||||||
window.print();
|
window.print();
|
||||||
//$that.printFlag = false;
|
//$that.printFlag = false;
|
||||||
window.opener = null;
|
window.opener = null;
|
||||||
window.close();
|
window.close();
|
||||||
},
|
},
|
||||||
_closePage: function () {
|
_closePage: function() {
|
||||||
window.opener = null;
|
window.opener = null;
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user