优化代码

This commit is contained in:
java110 2021-10-13 00:57:43 +08:00
parent da2136c48e
commit 619d4ce091
4 changed files with 50 additions and 6 deletions

View File

@ -62,7 +62,7 @@
<label class="col-sm-3 col-form-label padding-lr-sm text-right">开始时间</label>
<div class="col-sm-9">
<input v-model="editTempCarFeeConfigInfo.startTime" type="text" placeholder="必填,请填写开始时间"
class="form-control addTempCarFeeConfigStartTime">
class="form-control editTempCarFeeConfigStartTime">
</div>
</div>
</div>
@ -71,7 +71,7 @@
<label class="col-sm-3 col-form-label padding-lr-sm text-right">结束时间</label>
<div class="col-sm-9">
<input v-model="editTempCarFeeConfigInfo.endTime" type="text" placeholder="必填,请填写结束时间"
class="form-control addTempCarFeeConfigEndTime">
class="form-control editTempCarFeeConfigEndTime">
</div>
</div>
</div>

View File

@ -16,7 +16,18 @@
}
},
_initMethod: function () {
vc.initDate('editTempCarFeeConfigStartTime', function (_startTime) {
$that.editTempCarFeeConfigInfo.startTime = _startTime;
});
vc.initDate('editTempCarFeeConfigEndTime', function (_endTime) {
$that.editTempCarFeeConfigInfo.endTime = _endTime;
let start = Date.parse(new Date($that.editTempCarFeeConfigInfo.startTime))
let end = Date.parse(new Date($that.editTempCarFeeConfigInfo.endTime))
if (start - end >= 0) {
vc.toast("结束时间必须大于开始时间")
$that.editTempCarFeeConfigInfo.endTime = '';
}
});
},
_initEvent: function () {
vc.on('editTempCarFeeConfig', 'openEditTempCarFeeConfigModal', function (_params) {

View File

@ -59,7 +59,12 @@
<td class="text-center" style="border: 0px;">单号</td>
<td colspan="1" class="text-center" style="border: 0px;">{{printPayFeeInfo.receiptNum}}</td>
<td class="text-center" style="border: 0px;"></td>
</tr>
<tr style="border: 0px;" v-if="printPayFeeInfo.carName">
<td class="text-center" style="border: 0px;"></td>
<td class="text-center" style="border: 0px;">车辆</td>
<td colspan="1" class="text-center" style="border: 0px;">{{printPayFeeInfo.carName}}</td>
<td class="text-center" style="border: 0px;"></td>
</tr>
<tr style="border: 0px;">
<td class="text-center" style="border: 0px;"></td>

View File

@ -16,7 +16,8 @@
payObjName: '',
feeReceipt: [],
apply: 'N',
userName:vc.getData('/nav/getUserInfo').name
userName: vc.getData('/nav/getUserInfo').name,
carName: ''
},
printFlag: '0'
},
@ -75,6 +76,12 @@
$that._loadReceiptDetail();
if (_feeReceipt[0].objType == '6666') {
$that.printPayFeeInfo.carName = _feeReceipt[0].objName;
//查询车位对应房屋
$that._listOwnerCar(_feeReceipt[0].objId);
}
}, function (errInfo, error) {
console.log('请求失败处理');
}
@ -153,7 +160,28 @@
_closePage: function () {
window.opener = null;
window.close();
}
},
_listOwnerCar: function (_carId) {
let param = {
params: {
page: 1,
row: 1,
communityId: vc.getCurrentCommunity().communityId,
carId: _carId
}
}
//发送get请求
vc.http.apiGet('owner.queryOwnerCars',
param,
function (json, res) {
let _json = JSON.parse(json);
let ownerCar = _json.data[0];
$that.printPayFeeInfo.feeReceipt[0].objName = ownerCar.roomName;
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
}
});