(function (vc, vm) { vc.extends({ data: { editIntegralRuleFeeInfo: { irfId: '', ruleId: '', payStartTime: '', payEndTime: '', } }, _initMethod: function () { }, _initEvent: function () { vc.on('editIntegralRuleFee', 'openEditIntegralRuleFeeModal', function (_params) { $that.refreshEditIntegralRuleFeeInfo(); $('#editIntegralRuleFeeModel').modal('show'); vc.copyObject(_params, $that.editIntegralRuleFeeInfo); $that.editIntegralRuleFeeInfo.communityId = vc.getCurrentCommunity().communityId; setTimeout(function(){ $that._initEditIntegralRuleFeeDate(); },1000) }); }, methods: { _initEditIntegralRuleFeeDate:function(){ vc.initDateTime('editPayStartTime',function(_value){ $that.editIntegralRuleFeeInfo.payStartTime = _value; }); vc.initDateTime('editPayEndTime',function(_value){ $that.editIntegralRuleFeeInfo.payEndTime = _value; }) }, editIntegralRuleFeeValidate: function () { return vc.validate.validate({ editIntegralRuleFeeInfo: $that.editIntegralRuleFeeInfo }, { 'editIntegralRuleFeeInfo.ruleId': [ { limit: "required", param: "", errInfo: "规则ID不能为空" }, { limit: "maxLength", param: "30", errInfo: "规则ID不能超过30" }, ], 'editIntegralRuleFeeInfo.payStartTime': [ { limit: "required", param: "", errInfo: "缴费开始时间不能为空" }, { limit: "maxLength", param: "64", errInfo: "缴费开始时间不能超过64" }, ], 'editIntegralRuleFeeInfo.payEndTime': [ { limit: "required", param: "", errInfo: "缴费结束时间不能为空" }, { limit: "maxLength", param: "64", errInfo: "缴费结束时间不能超过64" }, ], 'editIntegralRuleFeeInfo.irfId': [ { limit: "required", param: "", errInfo: "编号不能为空" }] }); }, editIntegralRuleFee: function () { if (!$that.editIntegralRuleFeeValidate()) { vc.toast(vc.validate.errInfo); return; } vc.http.apiPost( '/integral.updateIntegralRuleFee', JSON.stringify($that.editIntegralRuleFeeInfo), { emulateJSON: true }, function (json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); let _json = JSON.parse(json); if (_json.code == 0) { //关闭model $('#editIntegralRuleFeeModel').modal('hide'); vc.emit('integralRuleFeeManage', 'listIntegralRuleFee', {}); return; } vc.toast(_json.msg); }, function (errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, refreshEditIntegralRuleFeeInfo: function () { $that.editIntegralRuleFeeInfo = { irfId: '', ruleId: '', payStartTime: '', payEndTime: '', } }, } }); })(window.vc, window.$that);