mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
加入 代收费用
This commit is contained in:
parent
e5abf6db7c
commit
2945cd032e
@ -58,7 +58,7 @@
|
||||
<option value="001">每年1月1日</option>
|
||||
<option value="002">每月1日</option>
|
||||
<option value="003">每日</option>
|
||||
<option value="004">实时</option>
|
||||
<!-- <option value="004">实时</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
85
public/components/property/addProxyFee/addProxyFee.html
Normal file
85
public/components/property/addProxyFee/addProxyFee.html
Normal file
@ -0,0 +1,85 @@
|
||||
<div id="addProxyFeeModel" 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="addProxyFeeInfo.feeTypeCd"
|
||||
@change="_changeFeeTypeCd(addProxyFeeInfo.feeTypeCd)">
|
||||
<option selected disabled value="">必填,请选择费用类型</option>
|
||||
<option value="888800010015">水费</option>
|
||||
<option value="888800010016">电费</option>
|
||||
<option value="888800010014">其他</option>
|
||||
</select>
|
||||
</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="addProxyFeeInfo.configId" @change="_changeFeeConfig()">
|
||||
<option selected disabled value="">必填,请选择收费项目</option>
|
||||
<option v-for="(item,index) in addProxyFeeInfo.feeConfigs" :key="index"
|
||||
v-bind:value="item.configId">{{item.feeName}}
|
||||
</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="addProxyFeeInfo.ownerName" type="text" disabled="disabled" placeholder="必填,请填写房屋"
|
||||
class="form-control ">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="addProxyFeeInfo.feeTypeCd != '888800010014'">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">金额</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addProxyFeeInfo.amount" type="text" placeholder="必填,请填写金额" class="form-control "
|
||||
@blur="_changeAmount()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">用量</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addProxyFeeInfo.consumption" @blur="_changeConsumption()" type="text"
|
||||
placeholder="必填,请填写用量" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">个数</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addProxyFeeInfo.consumption" @blur="_changeConsumption()" 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="addProxyFeeInfo.amount" disabled="disabled" type="text" placeholder="必填,请填写金额" class="form-control "
|
||||
@blur="_changeAmount()">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveProxyInfo()"><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>
|
||||
216
public/components/property/addProxyFee/addProxyFee.js
Normal file
216
public/components/property/addProxyFee/addProxyFee.js
Normal file
@ -0,0 +1,216 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
callBackFunction: vc.propTypes.string //父组件监听方法
|
||||
},
|
||||
data: {
|
||||
addProxyFeeInfo: {
|
||||
remark: '',
|
||||
roomId: '',
|
||||
objId: '',
|
||||
objName: '',
|
||||
feeTypeCd: '',
|
||||
feeConfigs: [],
|
||||
amount: '',
|
||||
consumption: '',
|
||||
configId: '',
|
||||
ownerName: '',
|
||||
objType: '3333'
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addProxyFee', 'openAddProxyFeeModal', function (_param) {
|
||||
if (_param.hasOwnProperty("objType")) {
|
||||
$that.addProxyFeeInfo.objType = _param.objType;
|
||||
}
|
||||
$that.addProxyFeeInfo.roomId = _param.roomId;
|
||||
$that.addProxyFeeInfo.objId = _param.roomId;
|
||||
$that.addProxyFeeInfo.objName = _param.roomName;
|
||||
$that.addProxyFeeInfo.ownerName = _param.roomName + '(' + _param.ownerName + ')';
|
||||
$('#addProxyFeeModel').modal('show');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
addProxyFeeValidate() {
|
||||
return vc.validate.validate({
|
||||
addProxyFeeInfo: vc.component.addProxyFeeInfo
|
||||
}, {
|
||||
'addProxyFeeInfo.amount': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "金额不能为空"
|
||||
},
|
||||
{
|
||||
limit: "money",
|
||||
param: "",
|
||||
errInfo: "金额格式错误,如3.00"
|
||||
},
|
||||
],
|
||||
'addProxyFeeInfo.consumption': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "用量不能为空"
|
||||
},
|
||||
{
|
||||
limit: "money",
|
||||
param: "",
|
||||
errInfo: "用量格式错误,如3.00"
|
||||
},
|
||||
],
|
||||
'addProxyFeeInfo.objId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "房屋必填"
|
||||
}
|
||||
],
|
||||
'addProxyFeeInfo.configId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用必填"
|
||||
}
|
||||
]
|
||||
});
|
||||
},
|
||||
saveProxyInfo: function () {
|
||||
if (!vc.component.addProxyFeeValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
|
||||
return;
|
||||
}
|
||||
vc.component.addProxyFeeInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
//不提交数据将数据 回调给侦听处理
|
||||
if (vc.notNull($props.callBackListener)) {
|
||||
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addProxyFeeInfo);
|
||||
$('#addProxyFeeModel').modal('hide');
|
||||
return;
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'meterWater.saveProxyFee',
|
||||
JSON.stringify(vc.component.addProxyFeeInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addProxyFeeModel').modal('hide');
|
||||
vc.component.clearAddProxyFeeInfo();
|
||||
vc.emit('listRoomFee', 'notify', {});
|
||||
vc.emit('listParkingSpaceFee', 'notify', {});
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
_changeFeeConfig: function () {
|
||||
$that.addProxyFeeInfo.amount = '';
|
||||
$that.addProxyFeeInfo.consumption = '';
|
||||
},
|
||||
_changeFeeTypeCd: function (_feeTypeCd) {
|
||||
$that.addProxyFeeInfo.amount = '';
|
||||
$that.addProxyFeeInfo.consumption = '';
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 20,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
feeTypeCd: _feeTypeCd,
|
||||
isDefault: 'F',
|
||||
valid: '1'
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.get('roomCreateFeeAdd', 'list', param,
|
||||
function (json, res) {
|
||||
var _feeConfigManageInfo = JSON.parse(json);
|
||||
vc.component.addProxyFeeInfo.feeConfigs = _feeConfigManageInfo.feeConfigs;
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
});
|
||||
},
|
||||
clearAddProxyFeeInfo: function () {
|
||||
vc.component.addProxyFeeInfo = {
|
||||
amount: '',
|
||||
consumption: '',
|
||||
remark: '',
|
||||
roomId: '',
|
||||
objId: '',
|
||||
objName: '',
|
||||
feeTypeCd: '',
|
||||
feeConfigs: [],
|
||||
configId: '',
|
||||
ownerName: '',
|
||||
objType: '3333'
|
||||
};
|
||||
},
|
||||
_getConfig: function () {
|
||||
|
||||
let _feeConfigs = $that.addProxyFeeInfo.feeConfigs;
|
||||
let _config = null;
|
||||
_feeConfigs.forEach(item => {
|
||||
if ($that.addProxyFeeInfo.configId == item.configId && item.computingFormula == '6006') {
|
||||
_config = item;
|
||||
}
|
||||
});
|
||||
|
||||
return _config;
|
||||
},
|
||||
_changeAmount: function () {
|
||||
let _config = $that._getConfig();
|
||||
let _amount = $that.addProxyFeeInfo.amount;
|
||||
if (_config == null) {
|
||||
vc.toast('未选择收费项目或者收费项目公式错误(用量*单价+附加费)');
|
||||
$that.addProxyFeeInfo.amount = '';
|
||||
$that.addProxyFeeInfo.consumption = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (_amount < _config.additionalAmount) {
|
||||
vc.toast('输入金额太小');
|
||||
$that.addProxyFeeInfo.amount = '';
|
||||
$that.addProxyFeeInfo.consumption = '';
|
||||
return;
|
||||
}
|
||||
|
||||
let _consumption = (_amount - _config.additionalAmount) / _config.squarePrice;
|
||||
|
||||
$that.addProxyFeeInfo.consumption = _consumption.toFixed(2);
|
||||
|
||||
},
|
||||
_changeConsumption: function () {
|
||||
let _config = $that._getConfig();
|
||||
let _consumption = $that.addProxyFeeInfo.consumption;
|
||||
if (_config == null) {
|
||||
vc.toast('未选择收费项目或者收费项目公式错误(用量*单价+附加费)');
|
||||
$that.addProxyFeeInfo.amount = '';
|
||||
$that.addProxyFeeInfo.consumption = '';
|
||||
return;
|
||||
}
|
||||
|
||||
let _amount = _config.squarePrice * _consumption + parseFloat(_config.additionalAmount);
|
||||
console.log('_consumption', _consumption, _amount);
|
||||
$that.addProxyFeeInfo.amount = _amount.toFixed(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
@ -58,7 +58,7 @@
|
||||
<option value="001">每年1月1日</option>
|
||||
<option value="002">每月1日</option>
|
||||
<option value="003">每日</option>
|
||||
<option value="004">实时</option>
|
||||
<!-- <option value="004">实时</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
<div class="ibox-title">
|
||||
<h5>{{listRoomCreateFeeInfo.roomName}}费用</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
<button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
|
||||
v-on:click="_openProxyFeeModal()">
|
||||
代收费用
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
|
||||
v-on:click="_openAddMeterWaterModal()">
|
||||
水电抄表
|
||||
@ -54,12 +58,17 @@
|
||||
<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.feeTypeCd == '888800010015' || fee.feeTypeCd == '888800010016' ">
|
||||
<td class="text-center" v-if="fee.computingFormula == '5005'">
|
||||
<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'">
|
||||
<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'">
|
||||
<div>算法:{{_getAttrValue(fee.feeAttrs,'390005')}}</div>
|
||||
<div>用量:{{_getAttrValue(fee.feeAttrs,'390003')}}</div>
|
||||
@ -113,4 +122,6 @@
|
||||
|
||||
<vc:create path="property/addMeterWater" callBackListener="" callBackFunction=""></vc:create>
|
||||
|
||||
<vc:create path="property/addProxyFee" callBackListener="" callBackFunction=""></vc:create>
|
||||
|
||||
</div>
|
||||
@ -143,6 +143,13 @@
|
||||
return "-";
|
||||
}
|
||||
return _fee.endTime;
|
||||
},
|
||||
_openProxyFeeModal:function(){ //创建代收费用
|
||||
vc.emit('addProxyFee', 'openAddProxyFeeModal', {
|
||||
roomId:$that.listRoomCreateFeeInfo.roomId,
|
||||
roomName:$that.listRoomCreateFeeInfo.roomName,
|
||||
ownerName:$that.listRoomCreateFeeInfo.ownerName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user