Commit a938a72d by 萱草

update: 优化阶梯价

parent 7d279b9f
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.a7dc14d0dbb3c10aee617172c4935aff.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.45.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.41.js></script><script src=//web-1251519181.file.myqcloud.com/components/activity-select.1.0.2.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.71.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.19.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.30.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.28.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.175ccdf2bfbfc0694b7c.js></script><script type=text/javascript src=./static/js/app.8288b614b235813d8e4b.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.fa47dde4962156979dfa9ff6eca82edc.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.45.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.41.js></script><script src=//web-1251519181.file.myqcloud.com/components/activity-select.1.0.2.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.71.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.19.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.30.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.28.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.175ccdf2bfbfc0694b7c.js></script><script type=text/javascript src=./static/js/app.47695205df10320426ed.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -109,13 +109,13 @@
</div>
</template>
</el-table-column>
<el-table-column label="原价" v-if="isEdit">
<el-table-column label="原价" v-if="!isEdit">
<template slot-scope="{ row }">{{ row.integralCost }}积分+{{ row.cashCost }}</template>
</el-table-column>
<el-table-column label="当前库存" v-if="isEdit">
<el-table-column label="当前库存" v-if="!isEdit">
<template slot-scope="{ row }">{{ row.virtualStock }}</template>
</el-table-column>
<el-table-column label="活动价格" v-if="!isEdit">
<el-table-column label="活动价格">
<template slot-scope="{ row }">
<!-- <div v-if="!(row.giftType && row.children && row.children.length)"><el-input v-model.trim="row.activityIntegral" placeholder="输入积分" size="small" class="w-110" @blur="limitIntergral(row.activityIntegral)"></el-input></div>
<div v-if="!(row.giftType && row.children && row.children.length)" class="mt10"><el-input v-model.trim="row.activityPrice" placeholder="输入现金" size="small" class="w-110"></el-input></div> -->
......@@ -124,7 +124,7 @@
<span v-if="isEdit">{{ row.activityIntegral }}积分+{{ row.activityPrice }}</span>
</template>
</el-table-column>
<el-table-column label="活动库存" :render-header="isEdit ? renderHeader : renderHeader2" v-if="!isEdit">
<el-table-column label="活动库存" :render-header="isEdit ? renderHeader : renderHeader2">
<template slot-scope="{ row }">
<div v-if="!(row.giftType && row.children && row.children.length) && !isEdit"><el-input v-model.trim="row.activityStock" placeholder="输入库存" size="small" class="w-110"></el-input></div>
<div v-if="!(row.giftType && row.children && row.children.length) && !isEdit" class="mt10"><el-input v-model.trim="row.activityExchangeLimit" placeholder="输入限兑数量" size="small" class="w-110"></el-input></div>
......@@ -148,7 +148,7 @@
<div>
<el-select v-model="stockType" style="width:100px;">
<el-option label="增加" :value="1"></el-option>
<el-option label="减少" :value="0"></el-option>
<!-- <el-option label="减少" :value="0"></el-option> -->
</el-select>
<el-input-number v-model="stock" width="140" style="margin-left:-4px;" controls-position="right" :min="0" :max="999999"></el-input-number>
</div>
......@@ -162,7 +162,7 @@
<div>
<el-select v-model="stockType" style="width:100px;">
<el-option label="增加" :value="1"></el-option>
<el-option label="减少" :value="0"></el-option>
<!-- <el-option label="减少" :value="0"></el-option> -->
</el-select>
<el-input-number v-model="stock" width="140" style="margin-left:-4px;" controls-position="right" :min="0" :max="999999"></el-input-number>
<!-- <el-input-number v-model.trim="stock" width="140" clearable controls-position="right" :min="0" :max="999999">
......@@ -180,8 +180,8 @@
</el-popover>
<el-button type="text" v-if="!row.giftType && !overStatus" @click="deleteSelectList(row)">删除</el-button>
<el-button type="text" v-if="row.giftType && !row.isShow && !overStatus" class="mr12" @click="deleteSelectList(row)">删除</el-button>
<el-button type="text" v-if="row.giftType && row.children && row.children.length && isExpand" @click="changeExpand(row)">收起</el-button>
<el-button type="text" v-if="row.giftType && row.children && row.children.length && !isExpand" @click="changeExpand(row)">展开</el-button>
<el-button type="text" v-if="row.giftType && row.children && row.children.length && row.isExpand" @click="changeExpand(row)">收起</el-button>
<el-button type="text" v-if="row.giftType && row.children && row.children.length && !row.isExpand" @click="changeExpand(row)">展开</el-button>
</div>
</template>
</el-table-column>
......@@ -223,6 +223,8 @@ export default {
},
data() {
return {
stockType: 1,
stock: '',
isEdit: false,
loading: false,
getTimeAll: getInputVal.formatDate,
......@@ -416,6 +418,7 @@ export default {
item.activityIntegral = ''; // 活动积分
item.activityPrice = ''; // 活动价格
item.activityStock = ''; // 活动库存
item.isExpand = true;
let giftProStandardJson = item.giftProStandardJson ? JSON.parse(item.giftProStandardJson) : [];
if (giftProStandardJson.length) {
item.children = JSON.parse(item.skuJson);
......@@ -447,7 +450,7 @@ export default {
return row.integralMallProId;
},
changeExpand(row) {
this.isExpand = !this.isExpand;
row.isExpand = !row.isExpand;
this.$refs.multipleTable.toggleRowExpansion(row);
},
// 删除选择的数据
......@@ -570,7 +573,7 @@ export default {
let image = new Image();
image.onload = function() {
let width = this.width;
let height = this.height;
// let height = this.height;
if (width < 700 || width > 1500) {
that.$message.error('请上传正确的图片尺寸');
reject();
......@@ -693,18 +696,33 @@ export default {
let params2 = {
data: data
};
request.post('/api-integral-mall/create-activity', qs.stringify(params2)).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('保存成功');
this.$router.push({
name: 'flashSale'
});
this.loading = false;
} else {
this.$message.error(res.data.message);
this.loading = false;
}
});
if (!isEdit) {
request.post('/api-integral-mall/create-activity', qs.stringify(params2)).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('新建成功');
this.$router.push({
name: 'flashSale'
});
this.loading = false;
} else {
this.$message.error(res.data.message);
this.loading = false;
}
});
} else {
request.post('/api-integral-mall//update-activity', qs.stringify(params2)).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('保存成功');
this.$router.push({
name: 'flashSale'
});
this.loading = false;
} else {
this.$message.error(res.data.message);
this.loading = false;
}
});
}
}
});
}
......
......@@ -51,7 +51,11 @@
</span>
</template>
</el-table-column>
<el-table-column label="商品数量" prop="num"></el-table-column>
<el-table-column label="商品数量">
<template slot-scope="{ row }">
{{ row.activityProList ? row.activityProList.length : '--' }}
</template>
</el-table-column>
<el-table-column label="适用会员" :render-header="renderHeader">
<template slot-scope="{ row }">
{{ row.memberSearchType === 1 ? '全部会员' : row.memberSearchType === 2 ? '会员分组' : '部分会员' }}
......
......@@ -518,8 +518,14 @@ export default {
} else {
this.isDifferentialPricing = 0;
}
this.setLadder();
this.submitLadderList = copy(this.list3);
},
setLadder() {
if (!this.cardCouponList.length) {
this.$message.error('请先添加卡券');
return;
}
this.ladderMemberGrade = [];
let lists = this.memberGradeList.filter(item => {
return this.couponForm.memberGrade.join(',').indexOf(item.gradeId) != -1;
......@@ -540,6 +546,17 @@ export default {
this.list2[i].skuList = this.ladderSkuList;
}
this.list3 = copy(this.list2);
// 多次设置阶梯价,回显之前保存的值
if (this.submitLadderList.length) {
this.submitLadderList.forEach(item => {
this.list3.forEach(itt => {
if (item.gradeId === itt.gradeId) {
itt.skuList[0].giftProSkuCash = item.skuList[0].giftProSkuCash;
itt.skuList[0].giftProSkuIntegral = item.skuList[0].giftProSkuIntegral;
}
});
});
}
},
saveLadderDetail() {
this.submitLadderList = copy(this.list3);
......
......@@ -690,8 +690,8 @@ export default {
} else {
this.isDifferentialPricing = 0;
}
// this.setLadder();
// this.submitLadderList = copy(this.list3);
this.setLadder();
this.submitLadderList = copy(this.list3);
},
setLadder() {
let submitSkuJsonTwo = []; // 未选sku时使用
......@@ -746,41 +746,41 @@ export default {
}
this.list3 = copy(this.list2);
// 多次设置阶梯价,回显之前保存的值
// console.log(this.submitLadderList);
// if (this.submitLadderList.length) {
// this.submitLadderList.forEach(item => {
// this.list3.forEach(itt => {
// if (item.gradeId === itt.gradeId) {
// item.skuList.forEach(item2 => {
// let id = [];
// if (item2.giftPropValues.length) {
// item2.giftPropValues.forEach(item3 => {
// id.push(item3.valueId);
// });
// itt.skuList.forEach(itt2 => {
// let id2 = [];
// if (itt2.giftPropValues.length) {
// itt2.giftPropValues.forEach(itt3 => {
// id2.push(itt3.valueId);
// });
// if (id.length && id2.length && id.join('_') === id2.join('_')) {
// itt2.giftProSkuCash = item2.giftProSkuCash;
// itt2.giftProSkuIntegral = item2.giftProSkuIntegral;
// }
// }
// });
// }else{
// itt.skuList.forEach(itt3 =>{
// if(!itt2.giftPropValues.length){
// }
// });
// }
// });
// }
// });
// });
// }
if (this.submitLadderList.length) {
this.submitLadderList.forEach(item => {
this.list3.forEach(itt => {
if (item.gradeId === itt.gradeId) {
item.skuList.forEach(item2 => {
let id = [];
if (item2.giftPropValues.length) {
item2.giftPropValues.forEach(item3 => {
id.push(item3.valueId);
});
itt.skuList.forEach(itt2 => {
let id2 = [];
if (itt2.giftPropValues.length) {
itt2.giftPropValues.forEach(itt3 => {
id2.push(itt3.valueId);
});
if (id.length && id2.length && id.join('_') === id2.join('_')) {
itt2.giftProSkuCash = item2.giftProSkuCash;
itt2.giftProSkuIntegral = item2.giftProSkuIntegral;
}
}
});
} else {
itt.skuList.forEach(itt3 => {
if (!itt3.giftPropValues.length) {
itt.skuList[0].giftProSkuCash = item.skuList[0].giftProSkuCash;
itt.skuList[0].giftProSkuIntegral = item.skuList[0].giftProSkuIntegral;
}
});
}
});
}
});
});
}
},
saveLadderDetail() {
this.submitLadderList = copy(this.list3);
......@@ -1753,7 +1753,8 @@ export default {
});
}
}
console.log(this.submitSkuJson);
this.setLadder();
this.submitLadderList = copy(this.list3);
// let arr = [];
// for (let item of this.submitSkuJson) {
// arr.push(item.giftPropValues);
......
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