mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
加入优惠券赠送规则
This commit is contained in:
parent
5a6ab3def4
commit
97e0b045ab
BIN
public/components/.DS_Store
vendored
BIN
public/components/.DS_Store
vendored
Binary file not shown.
72
public/components/scm/addCouponRuleFee/addCouponRuleFee.html
Normal file
72
public/components/scm/addCouponRuleFee/addCouponRuleFee.html
Normal file
@ -0,0 +1,72 @@
|
||||
<div id="addCouponRuleFeeModel" 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 "><span>
|
||||
<vc:i18n name="缴费赠送" namespace="addCouponRuleFee"></vc:i18n>
|
||||
</span></h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='费用' namespace='addCouponRuleFee'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addCouponRuleFeeInfo.feeConfigId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择费用','addCouponRuleFee')}}
|
||||
</option>
|
||||
<option :value="item.configId" v-for="(item,index) in addCouponRuleFeeInfo.feeConfigs">
|
||||
{{item.feeName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费开始时间' namespace='addCouponRuleFee'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addCouponRuleFeeInfo.payStartTime" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写缴费开始时间','addCouponRuleFee')" class="form-control addPayStartTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费结束时间' namespace='addCouponRuleFee'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addCouponRuleFeeInfo.payEndTime" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写缴费结束时间','addCouponRuleFee')" class="form-control addPayEndTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费月' namespace='addCouponRuleFee'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addCouponRuleFeeInfo.payMonth" type="number"
|
||||
:placeholder="vc.i18n('必填,请填写缴费月','addCouponRuleFee')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveCouponRuleFeeInfo()"><i
|
||||
class="fa fa-check"></i>
|
||||
<span>
|
||||
<vc:i18n name="保存"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<span>
|
||||
<vc:i18n name="取消"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
177
public/components/scm/addCouponRuleFee/addCouponRuleFee.js
Normal file
177
public/components/scm/addCouponRuleFee/addCouponRuleFee.js
Normal file
@ -0,0 +1,177 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
callBackFunction: vc.propTypes.string //父组件监听方法
|
||||
},
|
||||
data: {
|
||||
addCouponRuleFeeInfo: {
|
||||
crfId: '',
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
payStartTime: '',
|
||||
payEndTime: '',
|
||||
payMonth: '',
|
||||
feeConfigs:[]
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addCouponRuleFee', 'openAddCouponRuleFeeModal', function (_param) {
|
||||
vc.copyObject(_param,$that.addCouponRuleFeeInfo);
|
||||
$that._listAddCouponConfigFees();
|
||||
$('#addCouponRuleFeeModel').modal('show');
|
||||
setTimeout(function(){
|
||||
$that._initAddCouponRuleFeeDate();
|
||||
},1000)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_initAddCouponRuleFeeDate:function(){
|
||||
vc.initDateTime('addPayStartTime',function(_value){
|
||||
$that.addCouponRuleFeeInfo.payStartTime = _value;
|
||||
});
|
||||
vc.initDateTime('addPayEndTime',function(_value){
|
||||
$that.addCouponRuleFeeInfo.payEndTime = _value;
|
||||
})
|
||||
},
|
||||
addCouponRuleFeeValidate() {
|
||||
return vc.validate.validate({
|
||||
addCouponRuleFeeInfo: vc.component.addCouponRuleFeeInfo
|
||||
}, {
|
||||
'addCouponRuleFeeInfo.ruleId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "规则ID不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "30",
|
||||
errInfo: "规则ID不能超过30"
|
||||
},
|
||||
],
|
||||
'addCouponRuleFeeInfo.feeConfigId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "费用不能超过64"
|
||||
},
|
||||
],
|
||||
'addCouponRuleFeeInfo.payStartTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费开始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费开始时间不能超过64"
|
||||
},
|
||||
],
|
||||
'addCouponRuleFeeInfo.payEndTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费结束时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费结束时间不能超过64"
|
||||
},
|
||||
],
|
||||
'addCouponRuleFeeInfo.payMonth': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费月不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费月不能超过64"
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
saveCouponRuleFeeInfo: function () {
|
||||
if (!vc.component.addCouponRuleFeeValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.component.addCouponRuleFeeInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'/couponRule.saveCouponRuleFee',
|
||||
JSON.stringify(vc.component.addCouponRuleFeeInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addCouponRuleFeeModel').modal('hide');
|
||||
vc.component.clearAddCouponRuleFeeInfo();
|
||||
vc.emit('couponRuleFeeManage', 'listCouponRuleFee', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
clearAddCouponRuleFeeInfo: function () {
|
||||
vc.component.addCouponRuleFeeInfo = {
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
payStartTime: '',
|
||||
payEndTime: '',
|
||||
payMonth: '',
|
||||
feeConfigs:[]
|
||||
|
||||
};
|
||||
},
|
||||
_listAddCouponConfigFees: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page:1,
|
||||
row:100,
|
||||
communityId:vc.getCurrentCommunity().communityId
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feeConfig.listFeeConfigs',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _couponPropertyPoolManageInfo = JSON.parse(json);
|
||||
vc.component.addCouponRuleFeeInfo.feeConfigs = _couponPropertyPoolManageInfo.feeConfigs;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
78
public/components/scm/couponRuleFees/couponRuleFees.html
Normal file
78
public/components/scm/couponRuleFees/couponRuleFees.html
Normal file
@ -0,0 +1,78 @@
|
||||
<div class="margin-top">
|
||||
<div class="row margin-top-lg">
|
||||
<div class="col-lg-2 padding-right-xs padding-right-xl ">
|
||||
<button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
|
||||
v-on:click="_queryCouponRuleCppsMethod()">
|
||||
查询
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddCouponRuleFeeModal()">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<span>
|
||||
<vc:i18n name="添加" namespace="marketTextManage"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='编号' namespace='couponRuleFees'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='费用' namespace='couponRuleFees'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='缴费时间' namespace='couponRuleFees'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='缴费月' namespace='couponRuleFees'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='操作'></vc:i18n>
|
||||
</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="couponRuleFee in couponRuleFeesInfo.couponRuleFees">
|
||||
<td class="text-center">{{couponRuleFee.crfId}}</td>
|
||||
<td class="text-center">{{couponRuleFee.feeConfigName}}</td>
|
||||
<td class="text-center">{{couponRuleFee.payStartTime}}~{{couponRuleFee.payEndTime}}</td>
|
||||
<td class="text-center">{{couponRuleFee.payMonth}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditCouponRuleFeeModel(couponRuleFee)"><span>
|
||||
<vc:i18n name='修改'></vc:i18n>
|
||||
</span></button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openDeleteCouponRuleFeeModel(couponRuleFee)"><span>
|
||||
<vc:i18n name='删除'></vc:i18n>
|
||||
</span></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/paginationPlus" namespace="couponRuleCpps"></vc:create>
|
||||
</div>
|
||||
|
||||
<vc:create path="scm/addCouponRuleFee"
|
||||
callBackListener=""
|
||||
callBackFunction=""
|
||||
></vc:create>
|
||||
<vc:create path="scm/editCouponRuleFee"></vc:create>
|
||||
<vc:create path="scm/deleteCouponRuleFee"></vc:create>
|
||||
</div>
|
||||
87
public/components/scm/couponRuleFees/couponRuleFees.js
Normal file
87
public/components/scm/couponRuleFees/couponRuleFees.js
Normal file
@ -0,0 +1,87 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
vc.extends({
|
||||
data: {
|
||||
couponRuleFeesInfo: {
|
||||
couponRuleFees: [],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
textId: '',
|
||||
conditions: {
|
||||
ruleId: '',
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('couponRuleFees', 'switch', function (_data) {
|
||||
$that.couponRuleFeesInfo.conditions.ruleId = _data.ruleId;
|
||||
$that._listCouponRuleFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('couponRuleFeeManage', 'listCouponRuleFee', function (_param) {
|
||||
vc.component._listCouponRuleFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('couponRuleFees', 'paginationPlus', 'page_event',
|
||||
function (_currentPage) {
|
||||
vc.component._listCouponRuleFees(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listCouponRuleFees: function (_page, _rows) {
|
||||
|
||||
vc.component.couponRuleFeesInfo.conditions.page = _page;
|
||||
vc.component.couponRuleFeesInfo.conditions.row = _rows;
|
||||
var param = {
|
||||
params: vc.component.couponRuleFeesInfo.conditions
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/couponRule.listCouponRuleFee',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _couponRuleFeesInfo = JSON.parse(json);
|
||||
vc.component.couponRuleFeesInfo.total = _couponRuleFeesInfo.total;
|
||||
vc.component.couponRuleFeesInfo.records = _couponRuleFeesInfo.records;
|
||||
vc.component.couponRuleFeesInfo.couponRuleFees = _couponRuleFeesInfo.data;
|
||||
vc.emit('couponRuleFees', 'paginationPlus', 'init', {
|
||||
total: vc.component.couponRuleFeesInfo.records,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddCouponRuleFeeModal: function () {
|
||||
vc.emit('addCouponRuleFee', 'openAddCouponRuleFeeModal', {
|
||||
ruleId:$that.couponRuleFeesInfo.conditions.ruleId,
|
||||
});
|
||||
},
|
||||
_openEditCouponRuleFeeModel:function(_couponRuleFee){
|
||||
vc.emit('editCouponRuleFee','openEditCouponRuleFeeModal',_couponRuleFee);
|
||||
},
|
||||
_openDeleteCouponRuleFeeModel:function(_couponRuleFee){
|
||||
vc.emit('deleteCouponRuleFee','openDeleteCouponRuleFeeModal',_couponRuleFee);
|
||||
},
|
||||
_queryCouponRuleCppsMethod: function () {
|
||||
vc.component._listCouponRuleCppss(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
|
||||
},
|
||||
_moreCondition: function () {
|
||||
if (vc.component.couponRuleFeesInfo.moreCondition) {
|
||||
vc.component.couponRuleFeesInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.couponRuleFeesInfo.moreCondition = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -0,0 +1,19 @@
|
||||
<div class="modal fade" id="deleteCouponRuleFeeModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel"> <span><vc:i18n name="请确认您的操作!"></vc:i18n></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<tr align="center"><th><span><vc:i18n name="确定删除缴费赠送" namespace="deleteCouponRuleFee"></vc:i18n></span></th></tr>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteCouponRuleFeeModel()"><span><vc:i18n name="点错了"></vc:i18n></span></button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="deleteCouponRuleFee()"><span><vc:i18n name="确认删除!"></vc:i18n></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,52 @@
|
||||
(function(vc,vm){
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
deleteCouponRuleFeeInfo:{
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('deleteCouponRuleFee','openDeleteCouponRuleFeeModal',function(_params){
|
||||
|
||||
vc.component.deleteCouponRuleFeeInfo = _params;
|
||||
$('#deleteCouponRuleFeeModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteCouponRuleFee:function(){
|
||||
vc.component.deleteCouponRuleFeeInfo.communityId=vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'/couponRule.deleteCouponRuleFee',
|
||||
JSON.stringify(vc.component.deleteCouponRuleFeeInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteCouponRuleFeeModel').modal('hide');
|
||||
vc.emit('couponRuleFeeManage','listCouponRuleFee',{});
|
||||
return ;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
|
||||
});
|
||||
},
|
||||
closeDeleteCouponRuleFeeModel:function(){
|
||||
$('#deleteCouponRuleFeeModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
@ -0,0 +1,69 @@
|
||||
<div id="editCouponRuleFeeModel" 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 "><span>
|
||||
<vc:i18n name="修改" namespace="editCouponRuleFee"></vc:i18n>
|
||||
</span></h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='费用' namespace='editCouponRuleFee'></vc:i18n>
|
||||
</span> </label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editCouponRuleFeeInfo.feeConfigId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择费用','editCouponRuleFee')}}
|
||||
</option>
|
||||
<option :value="item.configId" v-for="(item,index) in editCouponRuleFeeInfo.feeConfigs">
|
||||
{{item.feeName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费开始时间' namespace='editCouponRuleFee'></vc:i18n>
|
||||
</span> </label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editCouponRuleFeeInfo.payStartTime" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写缴费开始时间','editCouponRuleFee')" class="form-control editPayStartTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费结束时间' namespace='editCouponRuleFee'></vc:i18n>
|
||||
</span> </label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editCouponRuleFeeInfo.payEndTime" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写缴费结束时间','editCouponRuleFee')" class="form-control editPayEndTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='缴费月' namespace='editCouponRuleFee'></vc:i18n>
|
||||
</span> </label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editCouponRuleFeeInfo.payMonth" type="number"
|
||||
:placeholder="vc.i18n('必填,请填写缴费月','editCouponRuleFee')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editCouponRuleFee()"><i
|
||||
class="fa fa-check"></i> <span>
|
||||
<vc:i18n name="保存"></vc:i18n>
|
||||
</span></button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal"><span>
|
||||
<vc:i18n name="取消"></vc:i18n>
|
||||
</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
179
public/components/scm/editCouponRuleFee/editCouponRuleFee.js
Normal file
179
public/components/scm/editCouponRuleFee/editCouponRuleFee.js
Normal file
@ -0,0 +1,179 @@
|
||||
(function (vc, vm) {
|
||||
|
||||
vc.extends({
|
||||
data: {
|
||||
editCouponRuleFeeInfo: {
|
||||
crfId: '',
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
payStartTime: '',
|
||||
payEndTime: '',
|
||||
payMonth: '',
|
||||
feeConfigs:[]
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editCouponRuleFee', 'openEditCouponRuleFeeModal', function (_params) {
|
||||
vc.component.refreshEditCouponRuleFeeInfo();
|
||||
$('#editCouponRuleFeeModel').modal('show');
|
||||
$that._listEditCouponConfigFees();
|
||||
vc.copyObject(_params, vc.component.editCouponRuleFeeInfo);
|
||||
vc.component.editCouponRuleFeeInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
setTimeout(function(){
|
||||
$that._initEditCouponRuleFeeDate();
|
||||
},1000)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_initEditCouponRuleFeeDate:function(){
|
||||
vc.initDateTime('editPayStartTime',function(_value){
|
||||
$that.editCouponRuleFeeInfo.payStartTime = _value;
|
||||
});
|
||||
vc.initDateTime('editPayEndTime',function(_value){
|
||||
$that.editCouponRuleFeeInfo.payEndTime = _value;
|
||||
})
|
||||
},
|
||||
editCouponRuleFeeValidate: function () {
|
||||
return vc.validate.validate({
|
||||
editCouponRuleFeeInfo: vc.component.editCouponRuleFeeInfo
|
||||
}, {
|
||||
'editCouponRuleFeeInfo.ruleId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "规则ID不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "30",
|
||||
errInfo: "规则ID不能超过30"
|
||||
},
|
||||
],
|
||||
'editCouponRuleFeeInfo.feeConfigId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "费用不能超过64"
|
||||
},
|
||||
],
|
||||
'editCouponRuleFeeInfo.payStartTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费开始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费开始时间不能超过64"
|
||||
},
|
||||
],
|
||||
'editCouponRuleFeeInfo.payEndTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费结束时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费结束时间不能超过64"
|
||||
},
|
||||
],
|
||||
'editCouponRuleFeeInfo.payMonth': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "缴费月不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "缴费月不能超过64"
|
||||
},
|
||||
],
|
||||
'editCouponRuleFeeInfo.crfId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "编号不能为空"
|
||||
}]
|
||||
|
||||
});
|
||||
},
|
||||
editCouponRuleFee: function () {
|
||||
if (!vc.component.editCouponRuleFeeValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/couponRule.updateCouponRuleFee',
|
||||
JSON.stringify(vc.component.editCouponRuleFeeInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#editCouponRuleFeeModel').modal('hide');
|
||||
vc.emit('couponRuleFeeManage', 'listCouponRuleFee', {});
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
});
|
||||
},
|
||||
refreshEditCouponRuleFeeInfo: function () {
|
||||
vc.component.editCouponRuleFeeInfo = {
|
||||
crfId: '',
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
payStartTime: '',
|
||||
payEndTime: '',
|
||||
payMonth: '',
|
||||
feeConfigs:[]
|
||||
}
|
||||
},
|
||||
_listEditCouponConfigFees: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page:1,
|
||||
row:100,
|
||||
communityId:vc.getCurrentCommunity().communityId
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/feeConfig.listFeeConfigs',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _couponPropertyPoolManageInfo = JSON.parse(json);
|
||||
vc.component.editCouponRuleFeeInfo.feeConfigs = _couponPropertyPoolManageInfo.feeConfigs;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc, window.vc.component);
|
||||
BIN
public/pages/.DS_Store
vendored
BIN
public/pages/.DS_Store
vendored
Binary file not shown.
@ -11,15 +11,15 @@
|
||||
<div class="role-menu flex justify-start">
|
||||
<div class="item margin-right" :class="{'active':couponRuleInfo.tabName == 'couponRuleCpps'}" @click="_changeCouponRuleTab('couponRuleCpps')">优惠券
|
||||
</div>
|
||||
<div class="item margin-right" :class="{'active':couponRuleInfo.tabName == 'couponRuleFee'}" @click="_changeCouponRuleTab('couponRuleFee')">缴费设置
|
||||
<div class="item margin-right" :class="{'active':couponRuleInfo.tabName == 'couponRuleFee'}" @click="_changeCouponRuleTab('couponRuleFee')">缴费赠送
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="couponRuleInfo.tabName == 'couponRuleCpps' ">
|
||||
<vc:create path="scm/couponRuleCpps"></vc:create>
|
||||
</div>
|
||||
<!-- <div v-if="couponRuleInfo.tabName == 'couponRuleFee' ">
|
||||
<vc:create path="scm/couponRuleCommunity"></vc:create>
|
||||
</div> -->
|
||||
<div v-if="couponRuleInfo.tabName == 'couponRuleFee' ">
|
||||
<vc:create path="scm/couponRuleFees"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
vc.emit('couponRuleCpps', 'switch', { ruleId: $that.couponRuleInfo.curCouponRule.ruleId });
|
||||
}
|
||||
if (_tabName == 'couponRuleFee') {
|
||||
vc.emit('couponRuleCommunityInfo', 'openCouponRuleCommunity', { ruleId: $that.couponRuleInfo.curCouponRule.ruleId });
|
||||
vc.emit('couponRuleFees', 'switch', { ruleId: $that.couponRuleInfo.curCouponRule.ruleId });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user