This commit is contained in:
java110 2022-03-12 17:49:25 +08:00
commit 8a674a25b3

View File

@ -1,4 +1,4 @@
(function (vc, vm) { (function(vc, vm) {
vc.extends({ vc.extends({
data: { data: {
reviewApplyRoomDiscountInfo: { reviewApplyRoomDiscountInfo: {
@ -23,11 +23,11 @@
feeId: '', feeId: '',
} }
}, },
_initMethod: function () { _initMethod: function() {
vc.component._initReviewApplyRoomDiscountDateInfo(); vc.component._initReviewApplyRoomDiscountDateInfo();
}, },
_initEvent: function () { _initEvent: function() {
vc.on('reviewApplyRoomDiscount', 'openReviewApplyRoomDiscountModal', function (_params) { vc.on('reviewApplyRoomDiscount', 'openReviewApplyRoomDiscountModal', function(_params) {
_params = JSON.parse(_params); _params = JSON.parse(_params);
console.log('params here', _params); console.log('params here', _params);
delete _params.state; delete _params.state;
@ -43,7 +43,7 @@
}); });
}, },
methods: { methods: {
_initReviewApplyRoomDiscountDateInfo: function () { _initReviewApplyRoomDiscountDateInfo: function() {
$('.reviewStartTime').datetimepicker({ $('.reviewStartTime').datetimepicker({
language: 'zh-CN', language: 'zh-CN',
fontAwesome: 'fa', fontAwesome: 'fa',
@ -54,7 +54,7 @@
todayBtn: true todayBtn: true
}); });
$('.reviewStartTime').datetimepicker() $('.reviewStartTime').datetimepicker()
.on('changeDate', function (ev) { .on('changeDate', function(ev) {
var value = $(".reviewStartTime").val(); var value = $(".reviewStartTime").val();
vc.component.reviewApplyRoomDiscountInfo.startTime = value; vc.component.reviewApplyRoomDiscountInfo.startTime = value;
}); });
@ -68,7 +68,7 @@
todayBtn: true todayBtn: true
}); });
$('.reviewEndTime').datetimepicker() $('.reviewEndTime').datetimepicker()
.on('changeDate', function (ev) { .on('changeDate', function(ev) {
var value = $(".reviewEndTime").val(); var value = $(".reviewEndTime").val();
var start = Date.parse(new Date(vc.component.reviewApplyRoomDiscountInfo.startTime)) var start = Date.parse(new Date(vc.component.reviewApplyRoomDiscountInfo.startTime))
var end = Date.parse(new Date(value)) var end = Date.parse(new Date(value))
@ -92,12 +92,11 @@
e.currentTarget.blur(); e.currentTarget.blur();
} }
}, },
reviewApplyRoomDiscountValidate: function () { reviewApplyRoomDiscountValidate: function() {
return vc.validate.validate({ return vc.validate.validate({
reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo
}, { }, {
'reviewApplyRoomDiscountInfo.discountId': [ 'reviewApplyRoomDiscountInfo.discountId': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "折扣名称不能为空" errInfo: "折扣名称不能为空"
@ -108,8 +107,7 @@
errInfo: "折扣错误" errInfo: "折扣错误"
}, },
], ],
'reviewApplyRoomDiscountInfo.discountType': [ 'reviewApplyRoomDiscountInfo.discountType': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "折扣类型不能为空" errInfo: "折扣类型不能为空"
@ -120,8 +118,7 @@
errInfo: "折扣错误" errInfo: "折扣错误"
}, },
], ],
'reviewApplyRoomDiscountInfo.returnWay': [ 'reviewApplyRoomDiscountInfo.returnWay': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "返还方式不能为空" errInfo: "返还方式不能为空"
@ -132,8 +129,7 @@
errInfo: "折扣错误" errInfo: "折扣错误"
}, },
], ],
'reviewApplyRoomDiscountInfo.startTime': [ 'reviewApplyRoomDiscountInfo.startTime': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "开始时间不能为空" errInfo: "开始时间不能为空"
@ -144,8 +140,7 @@
errInfo: "开始时间错误" errInfo: "开始时间错误"
}, },
], ],
'reviewApplyRoomDiscountInfo.endTime': [ 'reviewApplyRoomDiscountInfo.endTime': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "结束时间不能为空" errInfo: "结束时间不能为空"
@ -156,8 +151,7 @@
errInfo: "结束时间错误" errInfo: "结束时间错误"
}, },
], ],
'reviewApplyRoomDiscountInfo.reviewRemark': [ 'reviewApplyRoomDiscountInfo.reviewRemark': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "审批说明不能为空" errInfo: "审批说明不能为空"
@ -168,26 +162,23 @@
errInfo: "申请申请说明" errInfo: "申请申请说明"
}, },
], ],
'reviewApplyRoomDiscountInfo.ardId': [ 'reviewApplyRoomDiscountInfo.ardId': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "申请ID不能为空" errInfo: "申请ID不能为空"
}], }],
'reviewApplyRoomDiscountInfo.state': [ 'reviewApplyRoomDiscountInfo.state': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "审批状态不能为空" errInfo: "审批状态不能为空"
}] }]
}); });
}, },
reviewApplyRoomDiscountStateValidate: function () { reviewApplyRoomDiscountStateValidate: function() {
return vc.validate.validate({ return vc.validate.validate({
reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo
}, { }, {
'reviewApplyRoomDiscountInfo.reviewRemark': [ 'reviewApplyRoomDiscountInfo.reviewRemark': [{
{
limit: "required", limit: "required",
param: "", param: "",
errInfo: "审批说明不能为空" errInfo: "审批说明不能为空"
@ -200,7 +191,7 @@
] ]
}); });
}, },
reviewApplyRoomDiscount: function () { reviewApplyRoomDiscount: function() {
console.log(vc.component.reviewApplyRoomDiscountInfo.selectedFees); console.log(vc.component.reviewApplyRoomDiscountInfo.selectedFees);
if (!vc.component.reviewApplyRoomDiscountValidate() && vc.component.reviewApplyRoomDiscountInfo.state != '5') { if (!vc.component.reviewApplyRoomDiscountValidate() && vc.component.reviewApplyRoomDiscountInfo.state != '5') {
vc.toast(vc.validate.errInfo); vc.toast(vc.validate.errInfo);
@ -209,17 +200,16 @@
vc.toast(vc.validate.errInfo); vc.toast(vc.validate.errInfo);
return; return;
} }
if(vc.component.reviewApplyRoomDiscountInfo.returnWay == '1002' && vc.component.reviewApplyRoomDiscountInfo.selectedFees.length <= 0){ if (vc.component.reviewApplyRoomDiscountInfo.returnWay == '1002' && vc.component.reviewApplyRoomDiscountInfo.selectedFees.length <= 0) {
vc.toast('请选择缴费记录'); vc.toast('请选择缴费记录');
return; return;
} }
vc.http.apiPost( vc.http.apiPost(
'/applyRoomDiscount/updateReviewApplyRoomDiscount', '/applyRoomDiscount/updateReviewApplyRoomDiscount',
JSON.stringify(vc.component.reviewApplyRoomDiscountInfo), JSON.stringify(vc.component.reviewApplyRoomDiscountInfo), {
{
emulateJSON: true emulateJSON: true
}, },
function (json, res) { function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json); let _json = JSON.parse(json);
if (_json.code == 0) { if (_json.code == 0) {
@ -230,12 +220,12 @@
} }
vc.toast(_json.msg); vc.toast(_json.msg);
}, },
function (errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
vc.toast(errInfo); vc.toast(errInfo);
}); });
}, },
refreshReviewApplyRoomDiscountInfo: function () { refreshReviewApplyRoomDiscountInfo: function() {
let _discounts = $that.reviewApplyRoomDiscountInfo.discounts; let _discounts = $that.reviewApplyRoomDiscountInfo.discounts;
vc.component.reviewApplyRoomDiscountInfo = { vc.component.reviewApplyRoomDiscountInfo = {
ardId: '', ardId: '',
@ -258,7 +248,7 @@
feeId: '', feeId: '',
} }
}, },
_changeApplyRoomDiscountType: function () { _changeApplyRoomDiscountType: function() {
if ($that.reviewApplyRoomDiscountInfo.discountType == '') { if ($that.reviewApplyRoomDiscountInfo.discountType == '') {
return; return;
} }
@ -274,10 +264,11 @@
//发送get请求 //发送get请求
vc.http.apiGet('/feeDiscount/queryFeeDiscount', vc.http.apiGet('/feeDiscount/queryFeeDiscount',
param, param,
function (json, res) { function(json, res) {
let _feeDiscountManageInfo = JSON.parse(json); let _feeDiscountManageInfo = JSON.parse(json);
$that.reviewApplyRoomDiscountInfo.discounts = _feeDiscountManageInfo.data; $that.reviewApplyRoomDiscountInfo.discounts = _feeDiscountManageInfo.data;
}, function (errInfo, error) { },
function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
} }
); );
@ -332,7 +323,7 @@
// ); // );
// }, // },
// 查询缴费历史v2 // 查询缴费历史v2
_listFees: function () { _listFees: function() {
console.log(vc.component.reviewApplyRoomDiscountInfo); console.log(vc.component.reviewApplyRoomDiscountInfo);
var param = { var param = {
params: { params: {
@ -340,6 +331,7 @@
row: 50, row: 50,
communityId: vc.getCurrentCommunity().communityId, communityId: vc.getCurrentCommunity().communityId,
feeId: vc.component.reviewApplyRoomDiscountInfo.feeId, feeId: vc.component.reviewApplyRoomDiscountInfo.feeId,
state: '1400'
// startTime: vc.component.reviewApplyRoomDiscountInfo.startTime, // startTime: vc.component.reviewApplyRoomDiscountInfo.startTime,
// endTime: vc.component.reviewApplyRoomDiscountInfo.endTime // endTime: vc.component.reviewApplyRoomDiscountInfo.endTime
} }
@ -348,10 +340,11 @@
vc.http.get('propertyFee', vc.http.get('propertyFee',
'listFeeDetail', 'listFeeDetail',
param, param,
function (json, res) { function(json, res) {
var listFeeDetailData = JSON.parse(json); var listFeeDetailData = JSON.parse(json);
vc.component.reviewApplyRoomDiscountInfo.fees = listFeeDetailData.feeDetails; vc.component.reviewApplyRoomDiscountInfo.fees = listFeeDetailData.feeDetails;
}, function (errInfo, error) { },
function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
} }
); );