Commit eea379b9 by zhangmeng

迭代3

parent bf18bb9a
......@@ -3,11 +3,11 @@
<el-select v-model="storeType" placeholder="请选择" class="w200 inline-block mr5">
<el-option v-for="(v,i) in leftList" :key="i" :label="v.label" :value="v.value"></el-option>
</el-select>
<option-type v-if="storeType === 1" :uuid="uuid" :newUuid="newUuid"></option-type>
<option-tags v-if="storeType === 2" :uuid="uuid" :newUuid="newUuid"></option-tags>
<option-area v-if="storeType === 3" :uuid="uuid" :newUuid="newUuid"></option-area>
<option-group v-if="storeType === 4" :uuid="uuid" :newUuid="newUuid"></option-group>
<option-part v-if="storeType === 5" :uuid="uuid" :newUuid="newUuid"></option-part>
<option-type v-if="storeType === 1" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-type>
<option-tags v-if="storeType === 2" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-tags>
<option-area v-if="storeType === 3" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-area>
<option-group v-if="storeType === 4" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-group>
<option-part v-if="storeType === 5" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-part>
</section>
</template>
......@@ -32,6 +32,7 @@ const typeList = [{label:'自营',value:'0'},
{label:'代理',value:'2'},
{label:'代销',value:'3'},
{label:'托管',value:'4'}];
export default {
name:'vue-gic-store-new',
props:{
......@@ -60,21 +61,40 @@ export default {
watch:{
storeType(val) {
if (!val) {
this.saveInit();
this.$emit('update:uuid',this.cacheUuid);
}
},
uuid(val) {
// 编辑或者详情
if (val && !this.isAdd) {
if (this.isSendCache) return;
console.log('走到这了');
this.init();
}
},
isSendCache(val) {
console.log(val)
if (val) {
this.$emit('update:uuid',this.cacheUuid);
this.$nextTick(_=> {
console.log(this.uuid)
})
}
}
},
data() {
return {
storeType:0, // 一级选择值
leftList:[],
newUuid:uuidv1().replace(/-/g,'') // 生成uuid
// 创建一个新的uuid
newUuid:uuidv1().replace(/-/g,''),
// 编辑情况下的备份id
cacheUuid:uuidv1().replace(/-/g,''), // 生成uuid
// 编辑的情况下是否发送备份ID
isSendCache:false,
}
},
created() {
......@@ -91,27 +111,29 @@ export default {
// 获取配置项
init() {
this.storeType = 0;
// this.newUuid = this.uuid || this.newUuid;
// if (!this.isAdd) {
// // this.newUuid = this.uuid || this.newUuid;
// }
if (!this.uuid) {
//这是新增
/*如果没有uuid的情况下
1 设置一个新的uuid
2 并传给父级
3 保存
*/
if (this.isAdd) {
this.$emit('update:uuid',this.newUuid);
// 这是保存新的id
this.saveInit();
} else {
// 这是编辑
// 保存一下新的uuid
//
this.saveInit();
this.getStoreConfig();
}
/*如果有uuid的情况下
1 创建一个新的uuid备用 newUUid
2 保存 一下这个新的uuid
3 用父级传来的uuid获取配置项
*/
else {
this.newUuid = this.uuid;
// 这里保存备份id
this.saveInit(true);
if (this.newUuid) {
this.getStoreConfig();
}
}
},
//获取配置
......@@ -153,10 +175,10 @@ export default {
})
},
// 保存
saveInit() {
saveInit(isCacheUuid = false) {
let params = {
selectType:0,
key:this.newUuid,
key:isCacheUuid?this.cacheUuid:this.newUuid,
isAll:0,
value:'',
removeItems:'',
......
......@@ -44,6 +44,18 @@ export default {
uuid: {
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
watch: {
......@@ -95,6 +107,7 @@ export default {
},
created() {
this.getAreaTree();
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 获取树形结构
......@@ -119,7 +132,7 @@ export default {
getCheckedData() {
return new Promise((resolve,reject) => {
let params = {
key:this.uuid,
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:3,
search:'',
currentPage:1,
......@@ -184,16 +197,14 @@ export default {
console.log(item.indeterminate,item.isCheck);
},
saveArea() {
this.params.key = this.uuid;
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
let valueList = [];
this.areaList.map(v => {
// 全选 只传省ID
if(!v.indeterminate && v.isCheck) {
valueList.push(v.provinceId)
}
if(v.indeterminate && v.isCheck && v.children.length) {
// 半选 传市id
v.children.map(w => {
if (w.isCheck) {
......@@ -202,7 +213,6 @@ export default {
})
}
});
this.params.value = valueList.filter(v => v).join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
......@@ -210,6 +220,9 @@ export default {
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
if (res.data.errorCode === 0) {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.popoverShow = false;
} else {
this.$message({type:'error',message:'保存失败'});
......
......@@ -59,6 +59,18 @@ export default {
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
data() {
......@@ -90,7 +102,8 @@ export default {
created() {
this.getLeftList().then(_ => {
this.getRightList();
})
});
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 拉取左侧数据
......@@ -109,12 +122,13 @@ export default {
// 拉取右侧数据
getRightList() {
let params = {
key:this.uuid,
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:4,
search:this.rightValue,
currentPage:1,
pageSize:999
}
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(params)).then(res => {
this.rightList = (res.data.result && res.data.result.result) || [];
this.rightTotal = (res.data.result && res.data.result.totalCount) || 0;
......@@ -127,7 +141,7 @@ export default {
},
// 左侧数据移动到右侧
saveToRight() {
this.params.key = this.uuid;
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
if (this.params.isAll) {
this.params.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.tagId) < 0;
......@@ -140,16 +154,26 @@ export default {
}
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
this.getRightList();
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
})
}).catch(err => {
console.log(err)
})
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key='+this.uuid).then(res => {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key=' + (this.isAdd ? this.uuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
this.getRightList();
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
})
} else {
this.$message({type:'error',message:'清除全部失败'});
}
......@@ -160,14 +184,20 @@ export default {
// 删除右侧单选或者多选数据
deleteRightItems(item) {
let params = {
key:this.uuid,
key:this.isAdd ? this.uuid: this.cacheUuid,
removeItems:item || this.rightCheckList.join(',')
}
this.params.value = this.leftCheckList.join(',');
// console.log(url);
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
this.getRightList();
this.rightCheckList = [];
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
this.rightCheckList = [];
})
}).catch(err => {
console.log(err)
})
......
......@@ -67,6 +67,18 @@ export default {
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
data() {
......@@ -109,6 +121,7 @@ export default {
this.initLeftList();
// 初始化右侧列表
this.initRightList();
console.log(this.uuid,this.cacheUuid);
},
computed:{
computedLeftCount() {
......@@ -175,7 +188,7 @@ export default {
getRightList() {
return new Promise((resolve,reject) => {
this.rightMoreLoading = true;
this.rightParams.key = this.uuid;
this.rightParams.key = this.isCache ? this.cacheUuid : this.uuid;
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(this.rightParams)).then(res => {
this.rightMoreLoading = false;
if (res.data.errorCode === 0) {
......@@ -223,7 +236,7 @@ export default {
},
// 左侧数据移动到右侧
saveToRight() {
this.saveParams.key = this.uuid;
this.saveParams.key = this.isAdd ? this.uuid: this.cacheUuid;
if (this.saveParams.isAll) {
this.saveParams.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.storeId) < 0;
......@@ -237,8 +250,13 @@ export default {
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.saveParams)).then(res => {
this.rightParams.currentPage = 1;
this.getRightList().then(res => {
this.rightList = res;
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
})
}).catch(err => {
console.log(err)
......@@ -246,9 +264,14 @@ export default {
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key='+this.uuid).then(res => {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key=' + (this.isAdd ? this.uuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
this.initRightList();
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.initRightList();
})
} else {
this.$message({type:'error',message:'清除全部失败'});
}
......@@ -259,14 +282,19 @@ export default {
// 删除右侧单选或者多选数据
deleteRightItems(item) {
let params = {
key:this.uuid,
key:this.isAdd ? this.uuid: this.cacheUuid,
removeItems:item || this.rightCheckList.join(',')
}
this.saveParams.value = this.leftCheckList.join(',');
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
this.rightParams.currentPage = 1;
this.initRightList();
this.rightCheckList = [];
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.initRightList();
this.rightCheckList = [];
})
}).catch(err => {
console.log(err)
})
......
......@@ -61,6 +61,18 @@ export default {
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
data() {
......@@ -107,6 +119,7 @@ export default {
created() {
this.getLeftList();
this.rightSearch();
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 右侧搜索
......@@ -129,7 +142,8 @@ export default {
getRightList() {
return new Promise((resolve,reject) => {
this.moreLoading = true;
this.rightParams.key = this.uuid;
console.log(this.isCache)
this.rightParams.key = this.isCache ? this.cacheUuid : this.uuid;
this.rightParams.search = this.rightValue;
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(this.rightParams)).then(res => {
this.moreLoading = false;
......@@ -154,7 +168,7 @@ export default {
},
// 左侧数据移动到右侧
saveToRight() {
this.params.key = this.uuid;
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
if (this.params.isAll) {
this.params.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.tagId) < 0;
......@@ -168,8 +182,13 @@ export default {
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
this.rightParams.currentPage = 1;
this.getRightList().then(res => {
this.rightList = res;
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
})
}).catch(err => {
console.log(err)
......@@ -177,11 +196,16 @@ export default {
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key='+this.uuid).then(res => {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key=' + (this.isAdd ? this.uuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.rightParams.currentPage = 1;
this.getRightList().then(res => {
this.rightList = res;
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
})
} else {
this.$message({type:'error',message:'清除全部失败'});
......@@ -194,16 +218,21 @@ export default {
// 删除右侧单选或者多选数据
deleteRightItems(item) {
let params = {
key:this.uuid,
key:this.isAdd ? this.uuid: this.cacheUuid,
removeItems:item || this.rightCheckList.join(',')
}
this.params.value = this.leftCheckList.join(',');
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.rightParams.currentPage = 1;
this.getRightList().then(res => {
this.rightList = res;
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
this.rightCheckList = [];
})
this.rightCheckList = [];
}).catch(err => {
console.log(err)
})
......
......@@ -27,15 +27,22 @@ export default {
type:String,
default:''
},
newUuid:{
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
created() {
this.getRightList();
console.log(this.uuid,this,newUuid);
console.log(this.uuid,this.cacheUuid);
},
data() {
return {
......@@ -71,7 +78,7 @@ export default {
// 拉取右侧数据
getRightList() {
let params = {
key:this.uuid,
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:1,
search:'',
currentPage:1,
......@@ -87,15 +94,17 @@ export default {
},
// 保存
saveToRight() {
this.params.key = this.uuid;
let valueList = [];
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
this.params.value = this.checkedList.join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
return;
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
// this.popoverShow = false;
// 如果是编辑 并且有操作 把isCache设为true 最终保存是临时id
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
}).catch(err => {
console.log(err)
})
......@@ -103,11 +112,14 @@ export default {
// 删除右侧单选或者多选数据
delItem(v) {
let params = {
key:this.uuid,
key:this.isAdd ? this.uuid: this.cacheUuid,
removeItems:v,
value:''
}
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.getRightList();
}).catch(err => {
console.log(err)
......
......@@ -87,7 +87,11 @@ export default {
uuid:{
type:String,
default:''
}
},
isAdd:{
type:Boolean,
default:true
},
},
data() {
return {
......@@ -132,11 +136,22 @@ export default {
leftTotal:0,
newUuid:uuidv1().replace(/-/g,''), // 生成uuid
dialogUuid:uuidv1().replace(/-/g,''),
cacheUuid:uuidv1().replace(/-/g,''), // 生成uuid
dialogVisible:false,
leftMoreShow:false,
leftMoreLoading:false,
rightMoreShow:false,
rightMoreLoading:false
rightMoreLoading:false,
isCache:false
}
},
watch:{
isCache(val) {
console.log(val)
if (val) {
this.$emit('update:uuid',this.cacheUuid);
}
}
},
computed:{
......@@ -178,7 +193,9 @@ export default {
return unSelecteds.indexOf(v) < 0;
});
}
this.leftList = res;
// console.log( this.leftList )
})
} else {
this.getInitLeftList().then(res => {
......@@ -191,6 +208,7 @@ export default {
});
}
this.leftList = res;
// console.log( this.leftList )
})
}
},
......@@ -263,7 +281,7 @@ export default {
getRightList() {
return new Promise((resolve,reject) => {
this.rightMoreLoading = true;
this.rightParams.key = this.uuid;
this.rightParams.key = this.isCache ? this.cacheUuid : this.newUuid;
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(this.rightParams)).then(res => {
this.rightMoreLoading = false;
if (res.data.errorCode === 0) {
......@@ -311,6 +329,7 @@ export default {
})
}
},
// 右侧加载更多
rightLoadMore() {
this.rightParams.currentPage += 1;
......@@ -325,13 +344,13 @@ export default {
// 左侧数据移动到右侧
saveToRight() {
this.saveParams.key = this.newUuid;
this.saveParams.key = this.isAdd ? this.newUuid: this.cacheUuid;
if (this.saveParams.isAll) {
if (this.storeType !== 0) {
this.saveParams._key = this.dialogUuid;
console.log(this.saveParams.key, this.saveParams._key)
} else {
this.saveParams._key = '';
}
this.saveParams.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.storeId) < 0;
......@@ -340,16 +359,26 @@ export default {
this.saveParams.value = this.leftCheckList.join(',');
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.saveParams)).then(res => {
this.initRightList();
if (!this.isAdd) {
this.isCache = true;
}
this.$nextTick(_ => {
this.initRightList();
})
}).catch(err => {
console.log(err)
})
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key='+this.uuid).then(res => {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key='+ (this.isAdd ? this.newUuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
this.initRightList();
if (!this.isAdd) {
this.isCache = true
}
this.$nextTick(_ => {
this.initRightList();
})
} else {
this.$message({type:'error',message:'清除全部失败'});
}
......@@ -361,13 +390,20 @@ export default {
deleteRightItems(item) {
this.rightMoreLoading = true;
let params = {
key:this.newUuid,
key:(this.isAdd ? this.newUuid: this.cacheUuid),
removeItems:item || this.rightCheckList.join(',')
}
this.saveParams.value = this.leftCheckList.join(',');
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
this.initRightList();
this.rightCheckList = [];
if (!this.isAdd) {
this.isCache = true
}
this.$nextTick(_ => {
this.initRightList();
this.rightCheckList = [];
})
this.rightMoreLoading = false;
}).catch(err => {
this.rightMoreLoading = false;
......
<template>
<div>
<div style="margin:40px;">
<!-- <div style="margin:40px;">
<vue-gic-store-new class="inline-block" ref="storeNew" :options="options" :uuid.sync="uuid" :isAdd="isAdd"></vue-gic-store-new>
<el-button @click="isSaveFun" type="primary">检查是否保存</el-button> {{isSave}}
<el-button @click="getStoreConfig" type="primary">获取保存的数据</el-button> {{storeConfig}}
......@@ -10,9 +10,9 @@
<vue-gic-store-new class="inline-block" ref="storeNew" :options="options"></vue-gic-store-new>
<el-button @click="isSaveFun" type="primary">检查是否保存</el-button> {{isSave}}
<el-button @click="getStoreConfig" type="primary">获取保存的数据</el-button> {{storeConfig}}
</div>
</div> -->
<div style="margin:40px;">
<vue-gic-store-card ref="storeCard" :uuid.sync="uuid"></vue-gic-store-card>
<vue-gic-store-card ref="storeCard" :uuid.sync="uuid"></vue-gic-store-card>
<el-button style="margin:10px;" @click="isStoreEmpty" type="primary">检查是否为空</el-button> {{isEmpty}}
</div>
</div>
......@@ -29,7 +29,8 @@ import gicStoreCard from '../component/dmStore/store-card.vue'
data() {
return {
// 参数
uuid:'1112ccc0e35911e8aaf8672621cbd111', // 新增传空,编辑必传,
// uuid:'1112ccc0e35911e8aaf8672621cbd111', // 新增传空,编辑必传,
uuid:'', // 新增传空,编辑必传,
// 需要的下拉 默认为全部[0,1,2,3,4,5]
// 0 全部 1 门店类型 2门店标签 3 门店区域 4 门店分组 5 部分门店
options:[0,1,2,3,4,5],
......@@ -41,7 +42,10 @@ import gicStoreCard from '../component/dmStore/store-card.vue'
}
},
mounted() {
this.$refs.storeCard.init();
setTimeout(_ => {
// this.uuid = '171b3f01f38d11e89acab39639a83083';
this.$refs.storeCard.init();
},1000)
},
methods:{
isSaveFun() {
......
......@@ -28,13 +28,13 @@ export default Vue.component('render-temp', {
}else if (this.item.auditingStatus === -1) {
return (<div class="fr"><span class="danger-color">{this.item.autingFaildMsg || '审核失败'}</span>{statusFaildhtml}</div>)
}else if (this.item.auditingStatus === -2)
return (<div class="fr"><span class="danger-color">{this.item.autingFaildMsg || '更新失败'}</span>{_html}</div>)
return (<div class="fr"><span class="danger-color">{this.item.autingFaildMsg || '更新失败'}</span>{_html}</div>)
else if (this.item.useCustomCode == 1 && this.item.customCodeSync == 1)
return (<div class="fr"><span class="danger-color">正在上传卡券Code</span></div>)
return (<div class="fr"><span class="danger-color">正在上传卡券Code</span></div>)
else if (this.item.stock === 0)
return (<div class="fr">{statusNostockhtml}</div>)
return (<div class="fr">{statusNostockhtml}</div>)
else if (this.item.cardLimit && this.item.cardLimit == 1)
return (<div class="fr">{_html}</div>)
return (<div class="fr">{_html}</div>)
else return (<div class="fr">{noputonStatushtml}</div>)
}
});
......@@ -176,9 +176,8 @@ export default {
},
watch:{
'form.gameFreeCount'(val){
if (this.form.gameLimitDay != -1 && this.form.gameFreeCount>this.form.gameLimitCount) {
if (this.form.gameLimitCount != -1 && (this.form.gameFreeCount>this.form.gameLimitCount)) {
this.$tips({type:'warning',message:'免费次数不能大于限制次数'});
this.form.gameFreeCount = this.form.gameLimitCount;
}
}
},
......@@ -270,7 +269,7 @@ export default {
},
//提交保存
saveLottery (formName) {
if (this.form.gameFreeCount>this.form.gameLimitCount) {
if (this.form.gameLimitCount != -1 && (this.form.gameFreeCount>this.form.gameLimitCount)) {
this.$tips({type:'warning',message:'免费次数不能大于限制次数'});
return;
}
......
......@@ -165,9 +165,8 @@ export default {
},
watch:{
'form.gameFreeCount'(val){
if (this.form.gameLimitDay != -1 && this.form.gameFreeCount>this.form.gameLimitCount) {
if (this.form.gameLimitCount != -1 && (this.form.gameFreeCount>this.form.gameLimitCount)) {
this.$tips({type:'warning',message:'免费次数不能大于限制次数'});
this.form.gameFreeCount = this.form.gameLimitCount;
}
}
},
......@@ -248,7 +247,7 @@ export default {
},
//提交保存
saveLottery (formName) {
if (this.form.gameFreeCount>this.form.gameLimitCount) {
if (this.form.gameLimitCount != -1 && (this.form.gameFreeCount>this.form.gameLimitCount)) {
this.$tips({type:'warning',message:'免费次数不能大于限制次数'});
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment