Commit ec4dbd01 by chenyu

Merge branch 'feature/10月迭代' of http://git.gicdev.com/integralMall/integral-mall

parents 33ccd922 8d484b2c
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"vue": "2.6.6", "vue": "2.6.6",
"vue-axios": "^2.1.1", "vue-axios": "^2.1.1",
"vue-clipboard2": "^0.2.1", "vue-clipboard2": "^0.2.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
......
<template> <template>
<el-dialog title="新建分类" :visible.sync="addCateModal.dialogVisible" width="450px" @close="cancelSubmit('editInfoModal')"> <el-dialog title="新建分类" :visible.sync="addCateModal.dialogVisible" width="450px" @close="cancelSubmit('editInfoModal')">
<el-form :model="editInfoModal" ref="editInfoModal" :rules="modalRules"> <el-form :model="editInfoModal" ref="editInfoModal" :rules="modalRules">
<el-form-item label="分类名称" label-width="80px" prop="cateName"> <el-form-item label="分类名称" label-width="80px" prop="cateName" class="position-item">
<el-input type="text" v-model="editInfoModal.cateName" style="width:330px" @input="value => proNameLimit(value)"> </el-input> <el-input type="text" v-model="editInfoModal.cateName" style="width:330px" @input="value => proNameLimit(value)"> </el-input>
<span class="slot-num">{{ goodsInfo.cateNameLen }}/10</span>
</el-form-item> </el-form-item>
<span class="slot-num">{{ goodsInfo.cateNameLen }}/10</span>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('editInfoModal')">取 消</el-button> <el-button @click="cancelSubmit('editInfoModal')">取 消</el-button>
...@@ -57,6 +57,7 @@ export default { ...@@ -57,6 +57,7 @@ export default {
request.post('/api-integral-mall/create-gift-category', qs.stringify(params)).then(res => { request.post('/api-integral-mall/create-gift-category', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
this.$message.success('新增成功'); this.$message.success('新增成功');
this.goodsInfo.cateNameLen = 0;
this.addCateModal.dialogVisible = false; this.addCateModal.dialogVisible = false;
this.$emit('getCategoryOptions'); this.$emit('getCategoryOptions');
} else { } else {
...@@ -77,9 +78,14 @@ export default { ...@@ -77,9 +78,14 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.position-item {
position: relative;
}
.slot-num { .slot-num {
float: right; position: absolute;
margin-top: -20px; bottom: 0;
right: 8px;
font-size: 13px; font-size: 13px;
color: #c0c4cc;
} }
</style> </style>
...@@ -200,6 +200,9 @@ export default { ...@@ -200,6 +200,9 @@ export default {
} }
} }
} }
if (this.intergralModal.type === 'cash') {
this.addStock();
}
//积分 //积分
}, },
confirmStockModal() { confirmStockModal() {
...@@ -208,6 +211,7 @@ export default { ...@@ -208,6 +211,7 @@ export default {
let intergral = []; //积分 let intergral = []; //积分
let stock = []; //库存 let stock = []; //库存
if (this.intergralModal.tableSkuData.length) { if (this.intergralModal.tableSkuData.length) {
console.log(this.intergralModal.tableSkuData);
for (let j in this.intergralModal.tableSkuData) { for (let j in this.intergralModal.tableSkuData) {
let index = this.intergralModal.tableSkuData[0].length - 1; let index = this.intergralModal.tableSkuData[0].length - 1;
let index1 = this.intergralModal.tableSkuData[0].length - 2; let index1 = this.intergralModal.tableSkuData[0].length - 2;
...@@ -315,6 +319,34 @@ export default { ...@@ -315,6 +319,34 @@ export default {
}, },
cancelStockModal() { cancelStockModal() {
this.intergralModal.dialogVisible = false; this.intergralModal.dialogVisible = false;
},
addStock() {
let minIntergral = { integralCost: '', cashCost: '' };
console.log(this.intergralModal.tableSkuData);
for (let i in this.intergralModal.tableSkuData) {
for (let j in this.intergralModal.tableSkuData[i]) {
// 积分
if (this.intergralModal.tableSkuData[i].length - j == 2) {
// console.log(minIntergral);
if (minIntergral.integralCost === '' || Number(this.intergralModal.tableSkuData[i][j].valueName) < Number(minIntergral.integralCost)) {
// console.log('1-1');
minIntergral = Object.assign({}, minIntergral, {
integralCost: this.intergralModal.tableSkuData[i][j].valueName,
cashCost: this.intergralModal.tableSkuData[i][Number(j) + 1].valueName || '0'
});
}
if (Number(this.intergralModal.tableSkuData[i][j].valueName) == Number(minIntergral.integralCost)) {
// console.log('1-2');
minIntergral = Object.assign({}, minIntergral, {
integralCost: this.intergralModal.tableSkuData[i][j].valueName,
cashCost: this.intergralModal.tableSkuData[i][Number(j) + 1].valueName >= 0 ? (minIntergral.cashCost > this.intergralModal.tableSkuData[i][Number(j) + 1].valueName ? this.intergralModal.tableSkuData[i][Number(j) + 1].valueName : minIntergral.cashCost) : '0'
});
}
}
this.giftProSkuIntegral = minIntergral.integralCost;
this.giftProSkuCash = minIntergral.cashCost;
}
}
} }
} }
}; };
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<div class="section-content"> <div class="section-content">
<h3>选择卡券</h3> <h3>选择卡券</h3>
<el-form-item label="选择卡券" required v-show="mallProId === '-1'"> <el-form-item label="选择卡券" required v-show="mallProId === '-1'">
<el-button plain @click="showCard" :disabled="cardList.length >= 10">添加卡券</el-button> <el-button plain @click="showCard" :disabled="cardList.length >= addCardMax">添加卡券</el-button>
<span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;">支持选择兑换券</span> <span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;">支持选择兑换券,最多支持添加{{ addCardMax }}张卡券</span>
</el-form-item> </el-form-item>
<div class="alert-content" v-if="couponStatus"> <div class="alert-content" v-if="couponStatus">
<el-alert title="原卡券已被删除,请及时下线卡券,否则用户将无法兑换" type="warning"> </el-alert> <el-alert title="原卡券已被删除,请及时下线卡券,否则用户将无法兑换" type="warning"> </el-alert>
...@@ -344,6 +344,7 @@ export default { ...@@ -344,6 +344,7 @@ export default {
} }
}; };
return { return {
addCardMax: 15, // 添加卡券的上限数量
ladder: [], ladder: [],
isDifferentialPricing: '', isDifferentialPricing: '',
ladderPriceList: [], ladderPriceList: [],
...@@ -934,6 +935,7 @@ export default { ...@@ -934,6 +935,7 @@ export default {
}, },
// 显示卡券弹窗 // 显示卡券弹窗
showCard() { showCard() {
if (this.cardList.length >= this.addCardMax) return;
this.showCardDialog = true; this.showCardDialog = true;
}, },
// 子组件触发方法 // 子组件触发方法
......
...@@ -76,17 +76,19 @@ ...@@ -76,17 +76,19 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item1, index1) in skuList" :key="index1"> <tr v-for="(item1, index1) in skuList" :key="index1">
<td v-for="(item2, index2) in item1" :key="index2" style="width:120px" v-if="item1.length - index2 > 1"> <template v-for="(item2, index2) in item1">
<!-- {{ item1[7] }} --> <td :key="index2" style="width:120px" v-if="item1.length - index2 > 1">
<span v-if="item1.length - index2 < 7"> <!-- {{ item1[7] }} -->
<el-input size="small" v-model.trim="item2.valueName" @blur="skuInput(item1, item2, index1, index2)" @input="setSkuValueName"></el-input> <span v-if="item1.length - index2 < 7">
</span> <el-input size="small" v-model.trim="item2.valueName" @blur="skuInput(item1, item2, index1, index2)" @input="setSkuValueName"></el-input>
</span>
<!-- <span v-else-if="item1.length === index2 + 1" style="color:red">{{ item2.valueName ? item2.valueName : '' }}</span> --> <!-- <span v-else-if="item1.length === index2 + 1" style="color:red">{{ item2.valueName ? item2.valueName : '' }}</span> -->
<span v-else>{{ item2.valueName ? item2.valueName : '' }}</span> <span v-else>{{ item2.valueName ? item2.valueName : '' }}</span>
</td> </td>
<!-- 最后一列存的skuId --> <!-- 最后一列存的skuId -->
<td v-else style="color:red;display:none">{{ item2.valueName }}</td> <td v-else :key="index2" style="color:red;display:none">{{ item2.valueName }}</td>
</template>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -142,7 +144,11 @@ export default { ...@@ -142,7 +144,11 @@ export default {
searchStandard: '', searchStandard: '',
searchStandardValue: '', searchStandardValue: '',
// isStdImg: false // isStdImg: false
warnStatus: false warnStatus: false,
minIntergral: {
integralCost: '',
cashCost: ''
}
}; };
}, },
created() { created() {
...@@ -547,10 +553,41 @@ export default { ...@@ -547,10 +553,41 @@ export default {
}, },
//sku库存相加得spu库存 //sku库存相加得spu库存
addStock() { addStock() {
console.log(1);
let temSum = 0; let temSum = 0;
let minIntergral = { integralCost: '', cashCost: '' };
for (let i in this.skuList) { for (let i in this.skuList) {
for (let j in this.skuList[i]) { for (let j in this.skuList[i]) {
if (this.skuList[i].length - j == 6) {
// 现金
if (minIntergral.integralCost === '') {
minIntergral = Object.assign({}, minIntergral, {
integralCost: this.skuList[i][j].valueName,
cashCost: this.skuList[i][Number(j) + 1].valueName
});
}
if (Number(this.skuList[i][j].valueName) < Number(minIntergral.integralCost)) {
minIntergral = Object.assign({}, minIntergral, {
integralCost: this.skuList[i][j].valueName,
cashCost: this.skuList[i][Number(j) + 1].valueName
});
this.$emit('changeMinIntegral', minIntergral);
}
if (Number(this.skuList[i][j].valueName) == Number(minIntergral.integralCost)) {
minIntergral = Object.assign({}, minIntergral, {
integralCost: this.skuList[i][j].valueName,
cashCost: this.skuList[i][Number(j) + 1].valueName <= Number(minIntergral.cashCost) ? this.skuList[i][Number(j) + 1].valueName : minIntergral.cashCost
});
this.$emit('changeMinIntegral', minIntergral);
}
}
if (this.skuList[i].length - j == 5) {
// 积分
if (Number(this.skuList[i][Number(j) - 1].valueName) <= Number(minIntergral.integralCost) && Number(this.skuList[i][j].valueName) <= Number(minIntergral.cashCost)) {
minIntergral = Object.assign({}, minIntergral, { integralCost: this.skuList[i][Number(j) - 1].valueName, cashCost: this.skuList[i][j].valueName || '0' });
this.$emit('changeMinIntegral', minIntergral);
}
}
if (this.skuList[i].length - j == 4) { if (this.skuList[i].length - j == 4) {
if (this.skuList[i][j].valueName !== '') temSum += Number(this.skuList[i][j].valueName); if (this.skuList[i][j].valueName !== '') temSum += Number(this.skuList[i][j].valueName);
} }
......
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