Skip to content

Commit e1c7cb5

Browse files
committed
优化代码
1 parent b920648 commit e1c7cb5

3 files changed

Lines changed: 43 additions & 9 deletions

File tree

public/pages/property/owePayFeeOrder/owePayFeeOrder.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
squarePrice: _oweFeeItem.squarePrice,
100100
additionalAmount: _oweFeeItem.additionalAmount,
101101
feeName: _oweFeeItem.feeName,
102-
amount: _oweFeeItem.feePrice
102+
amount: _oweFeeItem.feePrice,
103+
roomName:$that.owePayFeeOrderInfo.roomName
103104
});
104105
}
105106
})
@@ -177,7 +178,7 @@
177178
vc.goBack();
178179
},
179180
_printOwnOrder: function () {
180-
vc.saveData('java110_printFee', $that.owePayFeeOrderInfo.oweFees);
181+
vc.saveData('java110_printFee', {fees:$that.owePayFeeOrderInfo.oweFees,roomName:$that.owePayFeeOrderInfo.roomName});
181182
//打印催交单
182183
window.open('/print.html#/pages/property/printOweFee?roomId=' + $that.owePayFeeOrderInfo.payObjId)
183184
}

public/pages/property/printOweFee/printOweFee.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h3>收费通知单</h3>
2222
<th scope="col" class="text-center">项目名称</th>
2323
<th scope="col" class="text-center">费用期间</th>
2424
<th scope="col" class="text-center">单位</th>
25-
<th scope="col" class="text-center">面积/用量</th>
25+
<th scope="col" class="text-center">面积</th>
2626
<th scope="col" class="text-center">单价</th>
2727
<th scope="col" class="text-center">金额</th>
2828
</tr>
@@ -33,7 +33,7 @@ <h3>收费通知单</h3>
3333
<td class="text-center">{{vc.dateFormat(item.endTime)}}至{{vc.dateFormat(item.deadlineTime)}}
3434
</td>
3535
<td class="text-center"></td>
36-
<td class="text-center"></td>
36+
<td class="text-center">{{printPayFeeInfo.builtUpArea}}</td>
3737
<td class="text-center">{{item.squarePrice}}/{{item.additionalAmount}}</td>
3838
<td class="text-center">{{item.feePrice}}</td>
3939
</tr>

public/pages/property/printOweFee/printOweFee.js

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,34 @@
99
fees: [],
1010
feeTime: '',
1111
wechatName: '',
12-
content:'',
13-
qrImg:''
12+
content: '',
13+
qrImg: '',
14+
roomId: '',
15+
builtUpArea: ''
1416
},
1517
printFlag: '0'
1618
},
1719
_initMethod: function () {
1820
//vc.component._initPrintPurchaseApplyDateInfo();
1921

2022
let _fees = vc.getData('java110_printFee');
21-
$that.printPayFeeInfo.fees = _fees
23+
$that.printPayFeeInfo.fees = _fees.fees
24+
25+
$that.printPayFeeInfo.roomId = vc.getParam('roomId')
26+
$that._printOweRoom();
27+
2228
$that.printPayFeeInfo.feeTime = vc.dateTimeFormat(new Date().getTime());
2329

2430
$that.printPayFeeInfo.communityName = vc.getCurrentCommunity().name;
2531

2632
let _totalAmount = 0.0;
27-
_fees.forEach(item => {
33+
$that.printPayFeeInfo.fees.forEach(item => {
2834
_totalAmount += item.feePrice;
2935
});
3036
_totalAmount = Math.round(_totalAmount * 100) / 100;
3137
$that.printPayFeeInfo.feePrices = _totalAmount;
3238

33-
$that._loadPrintSpec();
39+
$that._loadPrintSpec();
3440
},
3541
_initEvent: function () {
3642

@@ -81,6 +87,33 @@
8187
_closePage: function () {
8288
window.opener = null;
8389
window.close();
90+
},
91+
_printOweRoom: function () {
92+
let param = {
93+
params: {
94+
page: 1,
95+
row: 1,
96+
roomId: $that.printPayFeeInfo.roomId,
97+
communityId: vc.getCurrentCommunity().communityId
98+
}
99+
};
100+
//发送get请求
101+
vc.http.get('roomCreateFee',
102+
'listRoom',
103+
param,
104+
function (json, res) {
105+
var listRoomData = JSON.parse(json);
106+
vc.copyObject(listRoomData.rooms[0], $that.printPayFeeInfo);
107+
if (listRoomData.rooms[0].roomType == '2020602') {
108+
$that.printPayFeeInfo.roomName = listRoomData.rooms[0].floorNum + '-' + listRoomData.rooms[0].roomNum;
109+
} else {
110+
$that.printPayFeeInfo.roomName = listRoomData.rooms[0].floorNum + '-' + listRoomData.rooms[0].unitNum + '-' + listRoomData.rooms[0].roomNum;
111+
}
112+
}, function (errInfo, error) {
113+
console.log('请求失败处理');
114+
}
115+
);
116+
84117
}
85118
}
86119
});

0 commit comments

Comments
 (0)