mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
optmize
This commit is contained in:
parent
a515963375
commit
308524037a
@ -1,11 +1,11 @@
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
data: {
|
||||
printSmallPayFeeInfo: {
|
||||
communityName: '',
|
||||
receiptId: '',
|
||||
receiptIds: '',
|
||||
receiptNum:'',
|
||||
receiptNum: '',
|
||||
roomName: '',
|
||||
amount: 0.00,
|
||||
fees: [],
|
||||
@ -14,13 +14,13 @@
|
||||
content: '',
|
||||
qrImg: '',
|
||||
payObjName: '',
|
||||
machineId:'',
|
||||
quantity:'1',
|
||||
machines:[]
|
||||
machineId: '',
|
||||
quantity: '1',
|
||||
machines: []
|
||||
},
|
||||
printFlag: '0'
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
//vc.component._initPrintPurchaseApplyDateInfo();
|
||||
$that.printSmallPayFeeInfo.receiptId = vc.getParam('receiptId');
|
||||
$that.printSmallPayFeeInfo.receiptIds = vc.getParam('receiptIds');
|
||||
@ -29,12 +29,10 @@
|
||||
$that._loadReceipt();
|
||||
$that._loadPrintSpec();
|
||||
},
|
||||
_initEvent: function () {
|
||||
},
|
||||
_initEvent: function() {},
|
||||
methods: {
|
||||
_initPayFee: function () {
|
||||
},
|
||||
_loadReceipt: function () {
|
||||
_initPayFee: function() {},
|
||||
_loadReceipt: function() {
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
@ -47,24 +45,25 @@
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feeReceipt/queryFeeReceipt',
|
||||
param,
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
var _feeReceiptManageInfo = JSON.parse(json);
|
||||
let _feeReceipt = _feeReceiptManageInfo.data;
|
||||
let _amount = 0;
|
||||
_feeReceipt.forEach(item => {
|
||||
_amount += parseFloat(item.amount)
|
||||
});
|
||||
$that.printSmallPayFeeInfo.amount = _amount;
|
||||
$that.printSmallPayFeeInfo.amount = _amount.toFixed(2);
|
||||
$that.printSmallPayFeeInfo.roomName = _feeReceipt[0].objName;
|
||||
$that.printSmallPayFeeInfo.feeTime = _feeReceipt[0].createTime;
|
||||
$that.printSmallPayFeeInfo.payObjName = _feeReceipt[0].payObjName;
|
||||
$that._loadReceiptDetail();
|
||||
}, function (errInfo, error) {
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_loadReceiptDetail: function () {
|
||||
_loadReceiptDetail: function() {
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
@ -77,17 +76,18 @@
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feeReceipt/queryFeeReceiptDetail',
|
||||
param,
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
var _feeReceiptManageInfo = JSON.parse(json);
|
||||
let _feeReceiptDetails = _feeReceiptManageInfo.data;
|
||||
$that.printSmallPayFeeInfo.receiptNum = _feeReceiptDetails[0].payOrderId;
|
||||
$that.printSmallPayFeeInfo.fees = _feeReceiptDetails;
|
||||
}, function (errInfo, error) {
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_loadPrintSpec: function () {
|
||||
_loadPrintSpec: function() {
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
@ -99,19 +99,20 @@
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feePrintSpec/queryFeePrintSpec',
|
||||
param,
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
var _json = JSON.parse(json);
|
||||
var _data = _json.data;
|
||||
if (_data.length > 0) {
|
||||
$that.printSmallPayFeeInfo.content = _data[0].content;
|
||||
$that.printSmallPayFeeInfo.qrImg = _data[0].qrImg;
|
||||
}
|
||||
}, function (errInfo, error) {
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_printPurchaseApplyDiv: function () {
|
||||
_printPurchaseApplyDiv: function() {
|
||||
let bdhtml = window.document.body.innerHTML;
|
||||
let sprnstr = "<startprint></startprint>";
|
||||
let eprnstr = "<endprint></endprint>";
|
||||
@ -125,11 +126,11 @@
|
||||
window.opener = null;
|
||||
window.close();
|
||||
},
|
||||
_closePage: function () {
|
||||
_closePage: function() {
|
||||
window.opener = null;
|
||||
window.close();
|
||||
},
|
||||
_openCloudPrint:function(){
|
||||
_openCloudPrint: function() {
|
||||
$('#cloudPrintModel').modal('show');
|
||||
$that._listMachinePrinter();
|
||||
},
|
||||
@ -149,7 +150,7 @@
|
||||
var _couponPropertyPoolManageInfo = JSON.parse(json);
|
||||
vc.component.printSmallPayFeeInfo.machines = _couponPropertyPoolManageInfo.data;
|
||||
|
||||
if($that.printSmallPayFeeInfo.machines && $that.printSmallPayFeeInfo.machines.length > 0){
|
||||
if ($that.printSmallPayFeeInfo.machines && $that.printSmallPayFeeInfo.machines.length > 0) {
|
||||
$that.printSmallPayFeeInfo.machineId = $that.printSmallPayFeeInfo.machines[0].machineId;
|
||||
}
|
||||
|
||||
@ -159,27 +160,27 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
_cloudPrintPayFeeDetail:function(){
|
||||
_cloudPrintPayFeeDetail: function() {
|
||||
let _detailIds = [];
|
||||
$that.printSmallPayFeeInfo.fees.forEach(_data=>{
|
||||
$that.printSmallPayFeeInfo.fees.forEach(_data => {
|
||||
_detailIds.push(_data.detailId);
|
||||
})
|
||||
if(_detailIds.length < 1){
|
||||
if (_detailIds.length < 1) {
|
||||
vc.toast('未包含费用');
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
let _data = {
|
||||
communityId:vc.getCurrentCommunity().communityId,
|
||||
machineId:$that.printSmallPayFeeInfo.machineId,
|
||||
quantity:$that.printSmallPayFeeInfo.quantity,
|
||||
detailId:_detailIds.join(',')
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
machineId: $that.printSmallPayFeeInfo.machineId,
|
||||
quantity: $that.printSmallPayFeeInfo.quantity,
|
||||
detailId: _detailIds.join(',')
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'/print.printPayFeeDetail',
|
||||
JSON.stringify(_data), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
@ -190,7 +191,7 @@
|
||||
vc.toast(_json.msg);
|
||||
}
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.component.addFloorInfo.errorInfo = errInfo;
|
||||
vc.toast(errInfo)
|
||||
@ -198,4 +199,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user