Commit e5b7c220 by zhangmeng

迭代

parent eea379b9
......@@ -62,6 +62,7 @@ export default {
storeType(val) {
if (!val) {
this.$emit('update:uuid',this.cacheUuid);
this.saveInit(this.isSendCache);
}
},
uuid(val) {
......@@ -76,7 +77,6 @@ export default {
isSendCache(val) {
console.log(val)
if (val) {
this.$emit('update:uuid',this.cacheUuid);
this.$nextTick(_=> {
......@@ -140,7 +140,7 @@ export default {
getStoreConfig() {
return new Promise((resolve,reject) => {
let params = {
key:this.uuid,
key:this.isAdd?this.newUuid:(this.isSendCache?this.cacheUuid:this.uuid),
currentPage:1,
pageSize:20
}
......@@ -193,9 +193,12 @@ export default {
isStoreSave() {
return new Promise((resolve,reject) => {
let params = {
key:this.newUuid,
key:this.isAdd?this.newUuid:(this.isSendCache?this.cacheUuid:this.uuid),
selectType:this.storeType
}
if (params.selectType === 0) {
resolve(true);
}
this.axios.post(baseUrl + '/api-plug/is-empty?requestProject=gic-web',qs.stringify(params)).then(res => {
console.log(res);
if (res.data.errorCode === 0) {
......
......@@ -152,6 +152,9 @@ export default {
if (val) {
this.$emit('update:uuid',this.cacheUuid);
}
},
uuid(val) {
console.log(val);
}
},
computed:{
......
<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}}
</div>
<el-switch v-model="editFlag"></el-switch>新增的
<!--
<div style="margin:40px;" v-if="editFlag">
<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 style="margin:40px;">
<!-- <div style="margin:40px;">
<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> -->
</div>
</template>
<script>
......@@ -30,7 +31,7 @@ import gicStoreCard from '../component/dmStore/store-card.vue'
return {
// 参数
// uuid:'1112ccc0e35911e8aaf8672621cbd111', // 新增传空,编辑必传,
uuid:'', // 新增传空,编辑必传,
uuid:'066c65f0f3a911e8a48f33baa34efec2', // 新增传空,编辑必传,
// 需要的下拉 默认为全部[0,1,2,3,4,5]
// 0 全部 1 门店类型 2门店标签 3 门店区域 4 门店分组 5 部分门店
options:[0,1,2,3,4,5],
......@@ -41,11 +42,16 @@ import gicStoreCard from '../component/dmStore/store-card.vue'
editFlag:false
}
},
watch:{
uuid(val) {
console.log('uuidchange=>'+val)
}
},
mounted() {
setTimeout(_ => {
// setTimeout(_ => {
// this.uuid = '171b3f01f38d11e89acab39639a83083';
this.$refs.storeCard.init();
},1000)
// this.$refs.storeCard.init();
// },1000)
},
methods:{
isSaveFun() {
......@@ -60,6 +66,7 @@ import gicStoreCard from '../component/dmStore/store-card.vue'
})
},
isStoreEmpty() {
console.log(this.uuid)
this.$refs.storeCard.getRightList().then(res => {
this.$tips({type:'warning',message:res.length?'有数据':'没有数据'});
console.log(res)
......
......@@ -275,12 +275,12 @@ export default {
}
let flag = false;
this.tableList.forEach((v,i) => {
if ( v.prizeType === 1 && (!v.prizeIntegral || !v.prizeCount)){
if ( v.prizeType === 1 && (!v.prizeIntegral || v.prizeCount < 0)){
this.$tips({type:'warning',message:`第${i+1}个奖品未填写`});
flag = true;
return;
}
if ( v.prizeType === 2 && (!v.prizeCardId || !v.prizeCount)){
if ( v.prizeType === 2 && (!v.prizeCardId || v.prizeCount < 0)){
this.$tips({type:'warning',message:`第${i+1}个奖品未填写`});
flag = true;
return;
......
......@@ -253,12 +253,12 @@ export default {
}
let flag = false;
this.tableList.forEach((v,i) => {
if ( v.prizeType === 1 && (!v.prizeIntegral || !v.prizeCount)){
if ( v.prizeType === 1 && (!v.prizeIntegral || v.prizeCount < 0 )){
this.$tips({type:'warning',message:`第${i+1}个奖品未填写`});
flag = true;
return;
}
if ( v.prizeType === 2 && (!v.prizeCardId || !v.prizeCount)){
if ( v.prizeType === 2 && (!v.prizeCardId || v.prizeCount < 0)){
this.$tips({type:'warning',message:`第${i+1}个奖品未填写`});
flag = true;
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