mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
有点
This commit is contained in:
parent
290c777be8
commit
df14393e43
@ -0,0 +1,52 @@
|
||||
<div id="addMarketRuleCommunityModel" 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="addMarketRuleCommunity"></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='addMarketRuleCommunity'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMarketRuleCommunityInfo.communityId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择授权小区','addMarketRuleCommunity')}}
|
||||
</option>
|
||||
<option :value="item.communityId" v-for="(item,index) in addMarketRuleCommunityInfo.communitys">{{item.name}}</option> </select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='备注' namespace='addMarketRuleCommunity'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addMarketRuleCommunityInfo.remark"
|
||||
:placeholder="vc.i18n('选填,请填写备注','addMarketRuleCommunity')" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="saveMarketRuleCommunityInfo()"><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>
|
||||
@ -0,0 +1,123 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
callBackFunction: vc.propTypes.string //父组件监听方法
|
||||
},
|
||||
data: {
|
||||
addMarketRuleCommunityInfo: {
|
||||
ruleId: '',
|
||||
communityId: '',
|
||||
remark: '',
|
||||
communitys:[],
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addMarketRuleCommunity', 'openAddMarketRuleCommunityModal', function (_param) {
|
||||
$that.addMarketRuleCommunityInfo.ruleId = _param.ruleId;
|
||||
$('#addMarketRuleCommunityModel').modal('show');
|
||||
$that._listRuleCommunitys();
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
addMarketRuleCommunityValidate() {
|
||||
return vc.validate.validate({
|
||||
addMarketRuleCommunityInfo: vc.component.addMarketRuleCommunityInfo
|
||||
}, {
|
||||
'addMarketRuleCommunityInfo.ruleId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "营销规则ID不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "30",
|
||||
errInfo: "营销规则ID不能超过30"
|
||||
},
|
||||
],
|
||||
'addMarketRuleCommunityInfo.communityId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "小区不能为空"
|
||||
},
|
||||
],
|
||||
'addMarketRuleCommunityInfo.remark': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "512",
|
||||
errInfo: "备注不能超过512"
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
saveMarketRuleCommunityInfo: function () {
|
||||
if (!vc.component.addMarketRuleCommunityValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/marketRule.saveMarketRuleCommunity',
|
||||
JSON.stringify(vc.component.addMarketRuleCommunityInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addMarketRuleCommunityModel').modal('hide');
|
||||
vc.component.clearAddMarketRuleCommunityInfo();
|
||||
vc.emit('marketRuleCommunityInfo', 'listMarketRuleCommunity', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
clearAddMarketRuleCommunityInfo: function () {
|
||||
vc.component.addMarketRuleCommunityInfo = {
|
||||
ruleId: '',
|
||||
communityId: '',
|
||||
remark: '',
|
||||
communitys:[],
|
||||
};
|
||||
},
|
||||
_listRuleCommunitys: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 500
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/community.listCommunitys',
|
||||
param,
|
||||
function (json, res) {
|
||||
let _marketWayTextInfo = JSON.parse(json);
|
||||
$that.addMarketRuleCommunityInfo.communitys = _marketWayTextInfo.communitys;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
@ -0,0 +1,92 @@
|
||||
<div id="addMarketRuleWayModel" class="modal fade" tabindex="-1" 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="addMarketRuleWay"></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='addMarketRuleWay'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMarketRuleWayInfo.wayType">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择营销类型','addMarketRuleWay')}}
|
||||
</option>
|
||||
<option value="1001">{{vc.i18n('文本','addMarketRuleWay')}}</option>
|
||||
<option value="2002">{{vc.i18n('图片','addMarketRuleWay')}}</option>
|
||||
<option value="3003">{{vc.i18n('商品','addMarketRuleWay')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addMarketRuleWayInfo.wayType == '1001'">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='营销文本' namespace='addMarketRuleWay'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMarketRuleWayInfo.wayObjId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择营销文本','addMarketRuleWay')}}
|
||||
</option>
|
||||
<option :value="item.textId" v-for="(item,index) in addMarketRuleWayInfo.marketTexts">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addMarketRuleWayInfo.wayType == '2002'">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='营销图片' namespace='addMarketRuleWay'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMarketRuleWayInfo.wayObjId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择营销图片','addMarketRuleWay')}}
|
||||
</option>
|
||||
<option :value="item.picId" v-for="(item,index) in addMarketRuleWayInfo.marketPics">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addMarketRuleWayInfo.wayType == '3003'">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='营销商品' namespace='addMarketRuleWay'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMarketRuleWayInfo.wayObjId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择营销商品','addMarketRuleWay')}}
|
||||
</option>
|
||||
<option :value="item.goodsId" v-for="(item,index) in addMarketRuleWayInfo.marketGoodss">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='备注' namespace='addMarketRuleWay'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addMarketRuleWayInfo.remark"
|
||||
:placeholder="vc.i18n('选填,请填写备注','addMarketRuleWay')" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="saveMarketRuleWayInfo()"><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>
|
||||
189
public/components/admin/addMarketRuleWay/addMarketRuleWay.js
Normal file
189
public/components/admin/addMarketRuleWay/addMarketRuleWay.js
Normal file
@ -0,0 +1,189 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
callBackFunction: vc.propTypes.string //父组件监听方法
|
||||
},
|
||||
data: {
|
||||
addMarketRuleWayInfo: {
|
||||
wayId: '',
|
||||
ruleId: '',
|
||||
wayType: '',
|
||||
wayObjId: '',
|
||||
remark: '',
|
||||
marketTexts:[],
|
||||
marketPics:[],
|
||||
marketGoodss:[]
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addMarketRuleWay', 'openAddMarketRuleWayModal', function (_param) {
|
||||
$that.addMarketRuleWayInfo.ruleId = _param.ruleId;
|
||||
$('#addMarketRuleWayModel').modal('show');
|
||||
$that._listMarketTexts();
|
||||
$that._listMarketPics();
|
||||
$that._listMarketGoodss();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
addMarketRuleWayValidate() {
|
||||
return vc.validate.validate({
|
||||
addMarketRuleWayInfo: vc.component.addMarketRuleWayInfo
|
||||
}, {
|
||||
'addMarketRuleWayInfo.ruleId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "营销规则ID不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "30",
|
||||
errInfo: "营销规则ID不能超过30"
|
||||
},
|
||||
],
|
||||
'addMarketRuleWayInfo.wayType': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "营销类型不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "12",
|
||||
errInfo: "营销方式类型不能超过12"
|
||||
},
|
||||
],
|
||||
'addMarketRuleWayInfo.wayObjId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "营销方式不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "30",
|
||||
errInfo: "营销方式不能超过30"
|
||||
},
|
||||
],
|
||||
'addMarketRuleWayInfo.remark': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "512",
|
||||
errInfo: "备注不能超过512"
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
saveMarketRuleWayInfo: function () {
|
||||
if (!vc.component.addMarketRuleWayValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/marketRule.saveMarketRuleWay',
|
||||
JSON.stringify(vc.component.addMarketRuleWayInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addMarketRuleWayModel').modal('hide');
|
||||
vc.component.clearAddMarketRuleWayInfo();
|
||||
vc.emit('marketRuleWayInfo', 'listMarketRuleWay', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
clearAddMarketRuleWayInfo: function () {
|
||||
vc.component.addMarketRuleWayInfo = {
|
||||
ruleId: '',
|
||||
wayType: '',
|
||||
wayObjId: '',
|
||||
remark: '',
|
||||
marketTexts:[],
|
||||
marketPics:[],
|
||||
marketGoodss:[]
|
||||
};
|
||||
},
|
||||
_listMarketTexts: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/marketText.listMarketText',
|
||||
param,
|
||||
function (json, res) {
|
||||
let _marketWayTextInfo = JSON.parse(json);
|
||||
$that.addMarketRuleWayInfo.marketTexts = _marketWayTextInfo.data;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_listMarketPics: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/marketPic.listMarketPic',
|
||||
param,
|
||||
function (json, res) {
|
||||
let _marketWayPicInfo = JSON.parse(json);
|
||||
|
||||
$that.addMarketRuleWayInfo.marketPics = _marketWayPicInfo.data;
|
||||
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_listMarketGoodss: function (_page, _rows) {
|
||||
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/marketGoods.listMarketGoods',
|
||||
param,
|
||||
function (json, res) {
|
||||
let _marketWayGoodsInfo = JSON.parse(json);
|
||||
$that.addMarketRuleWayInfo.marketGoodss = _marketWayGoodsInfo.data;
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
@ -0,0 +1,19 @@
|
||||
<div class="modal fade" id="deleteMarketRuleCommunityModel" 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="deleteMarketRuleCommunity"></vc:i18n></span></th></tr>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteMarketRuleCommunityModel()"><span><vc:i18n name="点错了"></vc:i18n></span></button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="deleteMarketRuleCommunity()"><span><vc:i18n name="确认删除!"></vc:i18n></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,51 @@
|
||||
(function(vc,vm){
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
deleteMarketRuleCommunityInfo:{
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('deleteMarketRuleCommunity','openDeleteMarketRuleCommunityModal',function(_params){
|
||||
|
||||
vc.component.deleteMarketRuleCommunityInfo = _params;
|
||||
$('#deleteMarketRuleCommunityModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteMarketRuleCommunity:function(){
|
||||
vc.http.apiPost(
|
||||
'/marketRule.deleteMarketRuleCommunity',
|
||||
JSON.stringify(vc.component.deleteMarketRuleCommunityInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteMarketRuleCommunityModel').modal('hide');
|
||||
vc.emit('marketRuleCommunityInfo', 'listMarketRuleCommunity',{});
|
||||
return ;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
|
||||
});
|
||||
},
|
||||
closeDeleteMarketRuleCommunityModel:function(){
|
||||
$('#deleteMarketRuleCommunityModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
@ -0,0 +1,19 @@
|
||||
<div class="modal fade" id="deleteMarketRuleWayModel" 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="deleteMarketRuleWay"></vc:i18n></span></th></tr>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteMarketRuleWayModel()"><span><vc:i18n name="点错了"></vc:i18n></span></button>
|
||||
<button type="button" class="btn btn-primary" v-on:click="deleteMarketRuleWay()"><span><vc:i18n name="确认删除!"></vc:i18n></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,51 @@
|
||||
(function(vc,vm){
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
deleteMarketRuleWayInfo:{
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('deleteMarketRuleWay','openDeleteMarketRuleWayModal',function(_params){
|
||||
|
||||
vc.component.deleteMarketRuleWayInfo = _params;
|
||||
$('#deleteMarketRuleWayModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteMarketRuleWay:function(){
|
||||
vc.http.apiPost(
|
||||
'/marketRule.deleteMarketRuleWay',
|
||||
JSON.stringify(vc.component.deleteMarketRuleWayInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteMarketRuleWayModel').modal('hide');
|
||||
vc.emit('marketRuleWayInfo', 'listMarketRuleWay',{});
|
||||
return ;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
|
||||
});
|
||||
},
|
||||
closeDeleteMarketRuleWayModel:function(){
|
||||
$('#deleteMarketRuleWayModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
@ -0,0 +1,55 @@
|
||||
<div class=" margin-top">
|
||||
<div class="text-left">
|
||||
<button type="button" class="btn btn-primary btn-sm"
|
||||
v-on:click="_openAddMarketRuleCommunityModal()">
|
||||
<span>
|
||||
<vc:i18n name="关联小区"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<table class="footable table table-stripped toggle-arrow-tiny margin-top" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='小区名称' namespace='marketRuleCommunity'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='小区编号' namespace='marketRuleCommunity'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='备注' namespace='marketRuleCommunity'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='操作'></vc:i18n>
|
||||
</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="marketRuleCommunity in marketRuleCommunityInfo.marketRuleCommunitys">
|
||||
<td class="text-center">{{marketRuleCommunity.communityName}}</td>
|
||||
<td class="text-center">{{marketRuleCommunity.communityId}}</td>
|
||||
<td class="text-center">{{marketRuleCommunity.remark}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteMarketRuleCommunityModel(marketRuleCommunity)"><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/pagination"></vc:create> -->
|
||||
<vc:create path="frame/paginationPlus" namespace="roleCommunityInfo"></vc:create>
|
||||
<vc:create path="admin/addMarketRuleCommunity"
|
||||
callBackListener=""
|
||||
callBackFunction=""
|
||||
></vc:create>
|
||||
<vc:create path="admin/deleteMarketRuleCommunity"></vc:create>
|
||||
</div>
|
||||
@ -0,0 +1,80 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
var ALL_ROWS = 100;
|
||||
vc.extends({
|
||||
data: {
|
||||
marketRuleCommunityInfo: {
|
||||
marketRuleCommunitys:[],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
ruleId: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('marketRuleCommunityInfo', 'openMarketRuleCommunity', function (_param) {
|
||||
vc.copyObject(_param, vc.component.marketRuleCommunityInfo);
|
||||
vc.component._listMarketRuleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('marketRuleCommunityInfo', 'listMarketRuleCommunity', function (_param) {
|
||||
//vc.copyObject(_param, vc.component.marketRuleCommunityInfo.conditions);
|
||||
vc.component._listMarketRuleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('marketRuleCommunityInfo', 'paginationPlus', 'page_event', function (_currentPage) {
|
||||
vc.component._listMarketRuleCommunitys(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listMarketRuleCommunitys: function (_page, _rows) {
|
||||
var param = {
|
||||
params: {
|
||||
page: _page,
|
||||
row: _rows,
|
||||
ruleId: vc.component.marketRuleCommunityInfo.ruleId
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/marketRule.listMarketRuleCommunity',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _marketRuleCommunityInfo = JSON.parse(json);
|
||||
vc.component.marketRuleCommunityInfo.total = _marketRuleCommunityInfo.total;
|
||||
vc.component.marketRuleCommunityInfo.records = _marketRuleCommunityInfo.records;
|
||||
vc.component.marketRuleCommunityInfo.marketRuleCommunitys = _marketRuleCommunityInfo.data;
|
||||
vc.emit('marketRuleCommunityInfo', 'paginationPlus', 'init', {
|
||||
total: vc.component.marketRuleCommunityInfo.records,
|
||||
dataCount: vc.component.marketRuleCommunityInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddMarketRuleCommunityModal: function () {
|
||||
vc.emit('addMarketRuleCommunity','openAddMarketRuleCommunityModal', {
|
||||
ruleId: vc.component.marketRuleCommunityInfo.ruleId,
|
||||
});
|
||||
},
|
||||
_openDeleteMarketRuleCommunityModel: function (_roleCommunity) {
|
||||
vc.emit('deleteMarketRuleCommunity','openDeleteMarketRuleCommunityModal', _roleCommunity);
|
||||
},
|
||||
_queryMarketRuleCommunityMethod: function () {
|
||||
vc.component._listMarketRuleCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_moreCondition: function () {
|
||||
if (vc.component.marketRuleCommunityInfo.moreCondition) {
|
||||
vc.component.marketRuleCommunityInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.marketRuleCommunityInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
56
public/components/admin/marketRuleWay/marketRuleWay.html
Normal file
56
public/components/admin/marketRuleWay/marketRuleWay.html
Normal file
@ -0,0 +1,56 @@
|
||||
<div class=" margin-top">
|
||||
<div class="text-left">
|
||||
<button type="button" class="btn btn-primary btn-sm"
|
||||
v-if=" marketRuleWayInfo.marketRuleWays.length < 1"
|
||||
v-on:click="_openAddMarketRuleWayModal()">
|
||||
<span>
|
||||
<vc:i18n name="关联营销方式"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<table class="footable table table-stripped toggle-arrow-tiny margin-top" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='营销类型' namespace='marketRuleWayManage'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='营销方式' namespace='marketRuleWayManage'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='备注' namespace='marketRuleWayManage'></vc:i18n>
|
||||
</span></th>
|
||||
<th class="text-center"><span>
|
||||
<vc:i18n name='操作'></vc:i18n>
|
||||
</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="marketRuleWay in marketRuleWayInfo.marketRuleWays">
|
||||
<td class="text-center">{{marketRuleWay.wayTypeName}}</td>
|
||||
<td class="text-center">{{marketRuleWay.textName}}{{marketRuleWay.picName}}{{marketRuleWay.goodsName}}</td>
|
||||
<td class="text-center">{{marketRuleWay.remark}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteMarketRuleWayModel(marketRuleWay)"><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/pagination"></vc:create> -->
|
||||
<vc:create path="frame/paginationPlus" namespace="roleCommunityInfo"></vc:create>
|
||||
<vc:create path="admin/addMarketRuleWay"
|
||||
callBackListener=""
|
||||
callBackFunction=""
|
||||
></vc:create>
|
||||
<vc:create path="admin/deleteMarketRuleWay"></vc:create>
|
||||
</div>
|
||||
80
public/components/admin/marketRuleWay/marketRuleWay.js
Normal file
80
public/components/admin/marketRuleWay/marketRuleWay.js
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
var ALL_ROWS = 100;
|
||||
vc.extends({
|
||||
data: {
|
||||
marketRuleWayInfo: {
|
||||
marketRuleWays:[],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
ruleId: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('marketRuleWayInfo', 'openMarketRuleWay', function (_param) {
|
||||
vc.copyObject(_param, vc.component.marketRuleWayInfo);
|
||||
vc.component._listMarketRuleWays(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('marketRuleWayInfo', 'listMarketRuleWay', function (_param) {
|
||||
//vc.copyObject(_param, vc.component.marketRuleWayInfo.conditions);
|
||||
vc.component._listMarketRuleWays(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('marketRuleWayInfo', 'paginationPlus', 'page_event', function (_currentPage) {
|
||||
vc.component._listMarketRuleWays(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listMarketRuleWays: function (_page, _rows) {
|
||||
var param = {
|
||||
params: {
|
||||
page: _page,
|
||||
row: _rows,
|
||||
ruleId: vc.component.marketRuleWayInfo.ruleId
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/marketRule.listMarketRuleWay',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _marketRuleWayInfo = JSON.parse(json);
|
||||
vc.component.marketRuleWayInfo.total = _marketRuleWayInfo.total;
|
||||
vc.component.marketRuleWayInfo.records = _marketRuleWayInfo.records;
|
||||
vc.component.marketRuleWayInfo.marketRuleWays = _marketRuleWayInfo.data;
|
||||
vc.emit('marketRuleWayInfo', 'paginationPlus', 'init', {
|
||||
total: vc.component.marketRuleWayInfo.records,
|
||||
dataCount: vc.component.marketRuleWayInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddMarketRuleWayModal: function () {
|
||||
vc.emit('addMarketRuleWay','openAddMarketRuleWayModal', {
|
||||
ruleId: vc.component.marketRuleWayInfo.ruleId,
|
||||
});
|
||||
},
|
||||
_openDeleteMarketRuleWayModel: function (_roleCommunity) {
|
||||
vc.emit('deleteMarketRuleWay','openDeleteMarketRuleWayModal', _roleCommunity);
|
||||
},
|
||||
_queryMarketRuleWayMethod: function () {
|
||||
vc.component._listMarketRuleWays(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_moreCondition: function () {
|
||||
if (vc.component.marketRuleWayInfo.moreCondition) {
|
||||
vc.component.marketRuleWayInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.marketRuleWayInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -9,18 +9,18 @@
|
||||
<div class="role-context ">{{marketRuleInfo.curMarketRule.description}}</div>
|
||||
<div class="line-x margin-top"></div>
|
||||
<div class="role-menu flex justify-start">
|
||||
<div class="item margin-right" :class="{'active':marketRuleInfo.tabName == 'privilege'}" @click="_changeMarketRuleTab('privilege')">营销方式
|
||||
<div class="item margin-right" :class="{'active':marketRuleInfo.tabName == 'marketRuleWay'}" @click="_changeMarketRuleTab('marketRuleWay')">营销方式
|
||||
</div>
|
||||
<div class="item margin-right" :class="{'active':marketRuleInfo.tabName == 'community'}" @click="_changeMarketRuleTab('community')">小区授权
|
||||
<div class="item margin-right" :class="{'active':marketRuleInfo.tabName == 'marketRuleCommunity'}" @click="_changeMarketRuleTab('marketRuleCommunity')">小区授权
|
||||
</div>
|
||||
<div class="item margin-right" :class="{'active':marketRuleInfo.tabName == 'staff'}" @click="_changeMarketRuleTab('staff')">作用对象
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="marketRuleInfo.tabName == 'privilege' ">
|
||||
<vc:create path="frame/privilegeTree"></vc:create>
|
||||
<div v-if="marketRuleInfo.tabName == 'marketRuleWay' ">
|
||||
<vc:create path="admin/marketRuleWay"></vc:create>
|
||||
</div>
|
||||
<div v-if="marketRuleInfo.tabName == 'community' ">
|
||||
<vc:create path="frame/roleCommunity"></vc:create>
|
||||
<div v-if="marketRuleInfo.tabName == 'marketRuleCommunity' ">
|
||||
<vc:create path="admin/marketRuleCommunity"></vc:create>
|
||||
</div>
|
||||
<div v-if="marketRuleInfo.tabName == 'staff'">
|
||||
<vc:create path="frame/roleStaff"></vc:create>
|
||||
|
||||
@ -5,24 +5,24 @@
|
||||
data: {
|
||||
marketRuleInfo: {
|
||||
curMarketRule: {},
|
||||
tabName: 'privilege'
|
||||
tabName: 'marketRuleWay'
|
||||
},
|
||||
},
|
||||
_initMethod: function() {},
|
||||
_initEvent: function() {
|
||||
vc.on('marketRule', 'switchMarketRule', function(_param) {
|
||||
$that.marketRuleInfo.curMarketRule = _param;
|
||||
$that._changeMarketRuleTab('privilege');
|
||||
$that._changeMarketRuleTab('marketRuleWay');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
_changeMarketRuleTab: function(_tabName) {
|
||||
$that.marketRuleInfo.tabName = _tabName;
|
||||
if (_tabName == 'privilege') {
|
||||
vc.emit('privilegeTree', 'loadPrivilege', $that.marketRuleInfo.curMarketRule.ruleId);
|
||||
if (_tabName == 'marketRuleWay') {
|
||||
vc.emit('marketRuleWayInfo', 'openMarketRuleWay', { ruleId: $that.marketRuleInfo.curMarketRule.ruleId });
|
||||
}
|
||||
if (_tabName == 'community') {
|
||||
vc.emit('roleCommunityInfo', 'openMarketRuleCommunity', { ruleId: $that.marketRuleInfo.curMarketRule.ruleId });
|
||||
if (_tabName == 'marketRuleCommunity') {
|
||||
vc.emit('marketRuleCommunityInfo', 'openMarketRuleCommunity', { ruleId: $that.marketRuleInfo.curMarketRule.ruleId });
|
||||
}
|
||||
if (_tabName == 'staff') {
|
||||
vc.emit('roleStaffInfo', 'openMarketRuleStaff', { ruleId: $that.marketRuleInfo.curMarketRule.ruleId });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user