mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化代码
This commit is contained in:
parent
3b40b69216
commit
b920648b96
@ -21,13 +21,18 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 padding-lr-xs" v-if="simplifyRoomFeeInfo.roomId">
|
||||
<select class="custom-select custom-select-sm" v-model="simplifyRoomFeeInfo.state" @change="_changeSimplifyRoomConfigId()">
|
||||
<option selected value="">请选择状态</option>
|
||||
<select class="custom-select custom-select-sm" v-model="simplifyRoomFeeInfo.state"
|
||||
@change="_changeSimplifyRoomConfigId()">
|
||||
<option selected value="">请选择状态</option>
|
||||
<option value="2008001">收费中</option>
|
||||
<option value="2009001">收费结束</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-6 text-right" v-if="simplifyRoomFeeInfo.roomId">
|
||||
<button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
|
||||
v-on:click="_openTempImportRoomFeeModal()">
|
||||
临时收费
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
|
||||
v-on:click="_openProxyFeeModal()">
|
||||
代收费用
|
||||
@ -71,18 +76,21 @@
|
||||
<td class="text-center">{{fee.startTime}}</td>
|
||||
<td class="text-center">{{_getEndTime(fee)}}</td>
|
||||
<td class="text-center">{{_getDeadlineTime(fee)}}</td>
|
||||
<td class="text-center" v-if="fee.computingFormula == '5005'" :title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<td class="text-center" v-if="fee.computingFormula == '5005'"
|
||||
:title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<div>上期度数:{{fee.preDegrees}}</div>
|
||||
<div>本期度数:{{fee.curDegrees}} </div>
|
||||
<div>单价:{{fee.squarePrice}} </div>
|
||||
<div>附加费:{{fee.additionalAmount}}</div>
|
||||
</td>
|
||||
<td class="text-center" v-else-if="fee.computingFormula == '6006'" :title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<td class="text-center" v-else-if="fee.computingFormula == '6006'"
|
||||
:title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<div>用量:{{_getAttrValue(fee.feeAttrs,'390006')}}</div>
|
||||
<div>单价:{{fee.squarePrice}} </div>
|
||||
<div>附加费:{{fee.additionalAmount}}</div>
|
||||
</td>
|
||||
<td class="text-center" width="150" v-else-if="fee.feeTypeCd == '888800010017'" :title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<td class="text-center" width="150" v-else-if="fee.feeTypeCd == '888800010017'"
|
||||
:title="_simplifyRoomGetFeeOwnerInfo(fee.feeAttrs)">
|
||||
<div>算法:{{_getAttrValue(fee.feeAttrs,'390005')}}</div>
|
||||
<div>用量:{{_getAttrValue(fee.feeAttrs,'390003')}}</div>
|
||||
</td>
|
||||
@ -121,5 +129,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<vc:create path="property/tempImportRoomFee"></vc:create>
|
||||
|
||||
|
||||
</div>
|
||||
@ -155,6 +155,13 @@
|
||||
feeId: _fee.feeId
|
||||
});
|
||||
},
|
||||
_openTempImportRoomFeeModal:function(){
|
||||
vc.emit('tempImportRoomFee', 'openImportRoomFeeModal',{
|
||||
roomId: $that.simplifyRoomFeeInfo.roomId,
|
||||
roomName: $that.simplifyRoomFeeInfo.roomName,
|
||||
ownerName: $that.simplifyRoomFeeInfo.name
|
||||
})
|
||||
},
|
||||
clearSimplifyRoomFeeInfo: function () {
|
||||
let _feeConfigs = $that.roomCreateFeeAddInfo.feeTypeCds;
|
||||
$that.simplifyRoomFeeInfo = {
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
<div id="tempImportRoomFeeModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">临时收费</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">费用类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="tempImportRoomFeeInfo.feeTypeCd"
|
||||
@change="_changeFeeTypeCd(tempImportRoomFeeInfo.feeTypeCd)">
|
||||
<option selected disabled value="">必填,请选择费用类型</option>
|
||||
|
||||
<option v-for="(item,index) in tempImportRoomFeeInfo.feeTypeCds" :key="index"
|
||||
v-bind:value="item.statusCd" >
|
||||
{{item.name}}
|
||||
</option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">费用对象</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="tempImportRoomFeeInfo.objName" type="text" disabled="disabled"
|
||||
placeholder="必填,请填写费用对象" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">费用名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="tempImportRoomFeeInfo.feeName" type="text"
|
||||
placeholder="必填,请填写费用对象" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">收费金额</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="tempImportRoomFeeInfo.amount" type="text"
|
||||
placeholder="必填,请填写费用对象" class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">开始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="tempImportRoomFeeInfo.startTime" type="text"
|
||||
placeholder="必填,请填写开始时间" class="form-control tempImportFeeStartTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">结束时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="tempImportRoomFeeInfo.endTime" type="text"
|
||||
placeholder="必填,请填写结束时间" class="form-control tempImportFeeEndTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="_saveTempImportFeeInfo()"><i
|
||||
class="fa fa-check"></i> 提交
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,162 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
data: {
|
||||
tempImportRoomFeeInfo: {
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
feeTypeCd: '',
|
||||
feeTypeCds: [],
|
||||
feeName: '',
|
||||
objName: '',
|
||||
objId: '',
|
||||
amount: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
vc.getDict('pay_fee_config', "fee_type_cd", function (_data) {
|
||||
vc.component.tempImportRoomFeeInfo.feeTypeCds = _data;
|
||||
});
|
||||
vc.initDate('tempImportFeeStartTime', function (_startTime) {
|
||||
$that.tempImportRoomFeeInfo.startTime = _startTime;
|
||||
});
|
||||
vc.initDate('tempImportFeeEndTime', function (_endTime) {
|
||||
$that.tempImportRoomFeeInfo.endTime = _endTime;
|
||||
let start = Date.parse(new Date($that.tempImportRoomFeeInfo.startTime))
|
||||
let end = Date.parse(new Date($that.tempImportRoomFeeInfo.endTime))
|
||||
if (start - end >= 0) {
|
||||
vc.toast("结束时间必须大于开始时间")
|
||||
$that.tempImportRoomFeeInfo.endTime = '';
|
||||
}
|
||||
});
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('tempImportRoomFee', 'openImportRoomFeeModal',
|
||||
function (_room) {
|
||||
$that.clearTempImportRoomFeeInfo();
|
||||
$that.tempImportRoomFeeInfo.objId = _room.roomId;
|
||||
$that.tempImportRoomFeeInfo.objName = _room.roomName;
|
||||
$('#tempImportRoomFeeModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
tempImportRoomFeeValidate() {
|
||||
return vc.validate.validate({
|
||||
tempImportRoomFeeInfo: vc.component.tempImportRoomFeeInfo
|
||||
},
|
||||
{
|
||||
'tempImportRoomFeeInfo.communityId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "数据异常还没有入驻小区"
|
||||
}
|
||||
],
|
||||
'tempImportRoomFeeInfo.feeTypeCd': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用类型不能为空"
|
||||
}
|
||||
],
|
||||
'tempImportRoomFeeInfo.feeName': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用名称不能为空"
|
||||
}
|
||||
],
|
||||
'tempImportRoomFeeInfo.objId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用对象不能为空"
|
||||
}
|
||||
],
|
||||
'tempImportRoomFeeInfo.startTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "开始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "date",
|
||||
param: "",
|
||||
errInfo: "开始时间格式错误"
|
||||
},
|
||||
],
|
||||
'tempImportRoomFeeInfo.endTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "结束时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "date",
|
||||
param: "",
|
||||
errInfo: "结束时间格式错误"
|
||||
},
|
||||
],
|
||||
|
||||
'tempImportRoomFeeInfo.amount': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "金额不能为空"
|
||||
},
|
||||
{
|
||||
limit: "money",
|
||||
param: "",
|
||||
errInfo: "金额格式错误"
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
clearTempImportRoomFeeInfo: function () {
|
||||
var _feeTypeCds = vc.component.tempImportRoomFeeInfo.feeTypeCds;
|
||||
vc.component.tempImportRoomFeeInfo = {
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
feeTypeCd: '',
|
||||
feeTypeCds: _feeTypeCds,
|
||||
feeName: '',
|
||||
objName: '',
|
||||
objId: '',
|
||||
amount: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
};
|
||||
},
|
||||
_saveTempImportFeeInfo: function () {
|
||||
if (!vc.component.tempImportRoomFeeValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.component.tempImportRoomFeeInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
|
||||
vc.http.post(
|
||||
'importRoomFee','importTempData',
|
||||
JSON.stringify(vc.component.tempImportRoomFeeInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#tempImportRoomFeeModel').modal('hide');
|
||||
vc.emit('listRoomFee', 'notify', {});
|
||||
vc.emit('simplifyRoomFee', 'notify', {});
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.message(errInfo);
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user