优化代码

This commit is contained in:
java110 2021-01-14 09:12:06 +08:00
parent b920648b96
commit e1c7cb5f15
3 changed files with 43 additions and 9 deletions

View File

@ -99,7 +99,8 @@
squarePrice: _oweFeeItem.squarePrice, squarePrice: _oweFeeItem.squarePrice,
additionalAmount: _oweFeeItem.additionalAmount, additionalAmount: _oweFeeItem.additionalAmount,
feeName: _oweFeeItem.feeName, feeName: _oweFeeItem.feeName,
amount: _oweFeeItem.feePrice amount: _oweFeeItem.feePrice,
roomName:$that.owePayFeeOrderInfo.roomName
}); });
} }
}) })
@ -177,7 +178,7 @@
vc.goBack(); vc.goBack();
}, },
_printOwnOrder: function () { _printOwnOrder: function () {
vc.saveData('java110_printFee', $that.owePayFeeOrderInfo.oweFees); vc.saveData('java110_printFee', {fees:$that.owePayFeeOrderInfo.oweFees,roomName:$that.owePayFeeOrderInfo.roomName});
//打印催交单 //打印催交单
window.open('/print.html#/pages/property/printOweFee?roomId=' + $that.owePayFeeOrderInfo.payObjId) window.open('/print.html#/pages/property/printOweFee?roomId=' + $that.owePayFeeOrderInfo.payObjId)
} }

View File

@ -22,7 +22,7 @@
<th scope="col" class="text-center">项目名称</th> <th scope="col" class="text-center">项目名称</th>
<th scope="col" class="text-center">费用期间</th> <th scope="col" class="text-center">费用期间</th>
<th scope="col" class="text-center">单位</th> <th scope="col" class="text-center">单位</th>
<th scope="col" class="text-center">面积/用量</th> <th scope="col" class="text-center">面积</th>
<th scope="col" class="text-center">单价</th> <th scope="col" class="text-center">单价</th>
<th scope="col" class="text-center">金额</th> <th scope="col" class="text-center">金额</th>
</tr> </tr>
@ -33,7 +33,7 @@
<td class="text-center">{{vc.dateFormat(item.endTime)}}至{{vc.dateFormat(item.deadlineTime)}} <td class="text-center">{{vc.dateFormat(item.endTime)}}至{{vc.dateFormat(item.deadlineTime)}}
</td> </td>
<td class="text-center"></td> <td class="text-center"></td>
<td class="text-center"></td> <td class="text-center">{{printPayFeeInfo.builtUpArea}}</td>
<td class="text-center">{{item.squarePrice}}/{{item.additionalAmount}}</td> <td class="text-center">{{item.squarePrice}}/{{item.additionalAmount}}</td>
<td class="text-center">{{item.feePrice}}</td> <td class="text-center">{{item.feePrice}}</td>
</tr> </tr>

View File

@ -9,8 +9,10 @@
fees: [], fees: [],
feeTime: '', feeTime: '',
wechatName: '', wechatName: '',
content:'', content: '',
qrImg:'' qrImg: '',
roomId: '',
builtUpArea: ''
}, },
printFlag: '0' printFlag: '0'
}, },
@ -18,19 +20,23 @@
//vc.component._initPrintPurchaseApplyDateInfo(); //vc.component._initPrintPurchaseApplyDateInfo();
let _fees = vc.getData('java110_printFee'); let _fees = vc.getData('java110_printFee');
$that.printPayFeeInfo.fees = _fees $that.printPayFeeInfo.fees = _fees.fees
$that.printPayFeeInfo.roomId = vc.getParam('roomId')
$that._printOweRoom();
$that.printPayFeeInfo.feeTime = vc.dateTimeFormat(new Date().getTime()); $that.printPayFeeInfo.feeTime = vc.dateTimeFormat(new Date().getTime());
$that.printPayFeeInfo.communityName = vc.getCurrentCommunity().name; $that.printPayFeeInfo.communityName = vc.getCurrentCommunity().name;
let _totalAmount = 0.0; let _totalAmount = 0.0;
_fees.forEach(item => { $that.printPayFeeInfo.fees.forEach(item => {
_totalAmount += item.feePrice; _totalAmount += item.feePrice;
}); });
_totalAmount = Math.round(_totalAmount * 100) / 100; _totalAmount = Math.round(_totalAmount * 100) / 100;
$that.printPayFeeInfo.feePrices = _totalAmount; $that.printPayFeeInfo.feePrices = _totalAmount;
$that._loadPrintSpec(); $that._loadPrintSpec();
}, },
_initEvent: function () { _initEvent: function () {
@ -81,6 +87,33 @@
_closePage: function () { _closePage: function () {
window.opener = null; window.opener = null;
window.close(); window.close();
},
_printOweRoom: function () {
let param = {
params: {
page: 1,
row: 1,
roomId: $that.printPayFeeInfo.roomId,
communityId: vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.get('roomCreateFee',
'listRoom',
param,
function (json, res) {
var listRoomData = JSON.parse(json);
vc.copyObject(listRoomData.rooms[0], $that.printPayFeeInfo);
if (listRoomData.rooms[0].roomType == '2020602') {
$that.printPayFeeInfo.roomName = listRoomData.rooms[0].floorNum + '-' + listRoomData.rooms[0].roomNum;
} else {
$that.printPayFeeInfo.roomName = listRoomData.rooms[0].floorNum + '-' + listRoomData.rooms[0].unitNum + '-' + listRoomData.rooms[0].roomNum;
}
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
} }
} }
}); });