Commit 8fc0bc78 by 前端

Merge branch 'v3.20.1' into 'master'

V3.20.1

See merge request !29
2 parents 9e75ad04 22e69ddc
...@@ -38,8 +38,8 @@ export default { ...@@ -38,8 +38,8 @@ export default {
}, },
blurFn(e){ blurFn(e){
let value = e.target.value let value = e.target.value
if(this.minVal && +this.minVal>=value) value = this.minVal if(this.minVal && +this.minVal>=value) value = this.minVal+''
if(value && value.charAt(value.length-1)=='.') value = value.substr(0 ,value.length-1) if(value && value?.charAt(value.length-1)=='.') value = value.substr(0 ,value.length-1)
this.$emit('input', value) this.$emit('input', value)
} }
} }
......
...@@ -32,9 +32,16 @@ ...@@ -32,9 +32,16 @@
v-model="scope.scope.originalPrice"></format-input> v-model="scope.scope.originalPrice"></format-input>
</div> </div>
<div slot="giveIntegralSlot" slot-scope="scope"> <div slot="giveIntegralSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" <format-input :disabled="disabled" :intDigit="6" :precise="0" placeholder="请输入"
v-model="scope.scope.giveIntegral"></format-input> v-model="scope.scope.giveIntegral"></format-input>
</div> </div>
<div slot="integralFlagSlot" slot-scope="scope">
<el-switch :disabled="disabled" v-model="scope.scope.exchangeIntegralFlag" @change="changeIntegralFlagFn($event, scope.scope)" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div slot="exchangeIntegralSlot" slot-scope="scope">
<format-input :disabled="disabled || scope.scope.exchangeIntegralFlag!=1" :intDigit="6" :precise="0" placeholder="请输入"
v-model="scope.scope.exchangeIntegral"></format-input>
</div>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button v-if="!disabled" type="text" @click="handleDel(scope.scope)">删除</el-button> <el-button v-if="!disabled" type="text" @click="handleDel(scope.scope)">删除</el-button>
</div> </div>
...@@ -134,13 +141,23 @@ const defalutMerchantColumns = [ ...@@ -134,13 +141,23 @@ const defalutMerchantColumns = [
}, },
{ {
label: '门店价格(元)', label: '门店价格(元)',
width: 220, width: 180,
addHtml: 'activityPriceSlot' addHtml: 'activityPriceSlot'
}, },
{ {
label: '赠送积分', label: '赠送积分',
width: 220, width: 180,
addHtml: 'giveIntegralSlot' addHtml: 'giveIntegralSlot'
},
{
label: '是否支持积分兑换',
width: 150,
addHtml: 'integralFlagSlot'
},
{
label: '兑换积分',
width: 180,
addHtml: 'exchangeIntegralSlot'
} }
] ]
...@@ -321,6 +338,7 @@ export default { ...@@ -321,6 +338,7 @@ export default {
return !(+activityPrice) || !(+originalPrice) return !(+activityPrice) || !(+originalPrice)
}) })
const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral!==0) const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral!==0)
const _exchangeintegralTarget = this.saleMerchantList.find(item => this.formObj.goodsSource==1 && item.exchangeIntegralFlag && (!item.exchangeIntegral || item.exchangeIntegral==0))
const hasTarget = this.saleMerchantList.find(item => { const hasTarget = this.saleMerchantList.find(item => {
let originalPrice = item.originalPrice || 0 let originalPrice = item.originalPrice || 0
let activityPrice = item.activityPrice || 0 let activityPrice = item.activityPrice || 0
...@@ -335,6 +353,8 @@ export default { ...@@ -335,6 +353,8 @@ export default {
callback(new Error('原价不能小于最低售价和活动价')) callback(new Error('原价不能小于最低售价和活动价'))
} else if (_integralTarget) { } else if (_integralTarget) {
callback(new Error('请输入赠送积分')) callback(new Error('请输入赠送积分'))
} else if (_exchangeintegralTarget) {
callback(new Error('请输入大于0的兑换积分'))
} else { } else {
callback() callback()
} }
...@@ -468,6 +488,11 @@ export default { ...@@ -468,6 +488,11 @@ export default {
} }
}, },
methods: { methods: {
changeIntegralFlagFn(e, item) {
if(e!=1){
item.exchangeIntegral = ''
}
},
changeMethod(e, isClear){ changeMethod(e, isClear){
const _target = this.expressInfoFormData.find(item => item.name == 'expressFee') const _target = this.expressInfoFormData.find(item => item.name == 'expressFee')
if(_target){ if(_target){
...@@ -622,7 +647,11 @@ export default { ...@@ -622,7 +647,11 @@ export default {
}, },
confirmDialog(e) { confirmDialog(e) {
this.saleMerchantList = e || [] this.saleMerchantList = e || []
this.saleMerchantList.map(item => this.$set(item, 'giveIntegral', '')) this.saleMerchantList.map(item => {
this.$set(item, 'giveIntegral', '')
this.$set(item, 'exchangeIntegralFlag', 0)
this.$set(item, 'exchangeIntegral', '')
})
this.validateField('saleStoreSlot') this.validateField('saleStoreSlot')
this.closeDialog() this.closeDialog()
}, },
...@@ -646,10 +675,15 @@ export default { ...@@ -646,10 +675,15 @@ export default {
delete obj.coverList delete obj.coverList
delete obj.styleBImgList delete obj.styleBImgList
let saleMerchantList = this.saleMerchantList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let {merchantId, merchantName, activityPrice, giveIntegral, originalPrice} = item let {merchantId, merchantName, activityPrice, giveIntegral, originalPrice,exchangeIntegralFlag, exchangeIntegral} = item
activityPrice = activityPrice ? Number(Number(activityPrice * 10 * 10).toFixed(0)) : 0 activityPrice = activityPrice ? Number(Number(activityPrice * 10 * 10).toFixed(0)) : 0
originalPrice = originalPrice ? Number(Number(originalPrice * 10 * 10).toFixed(0)) : 0 originalPrice = originalPrice ? Number(Number(originalPrice * 10 * 10).toFixed(0)) : 0
return {merchantId, merchantName, activityPrice, giveIntegral, originalPrice} let saleMerchantItem = {merchantId, merchantName, activityPrice, giveIntegral, originalPrice}
if(this.formObj.goodsSource==1) {
saleMerchantItem.exchangeIntegralFlag = exchangeIntegralFlag
saleMerchantItem.exchangeIntegral = exchangeIntegralFlag ? exchangeIntegral : ''
}
return saleMerchantItem
}) })
const params = { const params = {
saleMerchantList: saleMerchantList, saleMerchantList: saleMerchantList,
...@@ -742,7 +776,7 @@ export default { ...@@ -742,7 +776,7 @@ export default {
.selected-table { .selected-table {
margin-top: 10px; margin-top: 10px;
width: 970px; width: 1200px;
.el-button--text { .el-button--text {
padding: 0; padding: 0;
......
...@@ -92,6 +92,24 @@ ...@@ -92,6 +92,24 @@
<span v-else>{{ filterData(scope.scope, 'score').join('、') }}</span> <span v-else>{{ filterData(scope.scope, 'score').join('、') }}</span>
</template> </template>
</div> </div>
<div slot="exchangeIntegralSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope, 'exchange').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="400"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope,'exchange')" :key="index">
{{ item }}
</div>
<span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length || scope.scope.goodsSource==2">--</span>
<span v-else>{{ filterData(scope.scope, 'exchange').join('、') }}</span>
</template>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="4"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="4"></GLTableButton>
</div> </div>
...@@ -313,6 +331,11 @@ export default { ...@@ -313,6 +331,11 @@ export default {
addHtml: 'giveIntegralSlot' addHtml: 'giveIntegralSlot'
}, },
{ {
label: '积分兑换',
width: 200,
addHtml: 'exchangeIntegralSlot'
},
{
label: '商品分类', label: '商品分类',
width: 180, width: 180,
prop: 'associationClassifyFirstName' prop: 'associationClassifyFirstName'
...@@ -445,7 +468,11 @@ export default { ...@@ -445,7 +468,11 @@ export default {
return list?.map(item => { return list?.map(item => {
return `${item.merchantName || '--'}:${item.giveIntegral || '0'}` return `${item.merchantName || '--'}:${item.giveIntegral || '0'}`
}) || [] }) || []
} else if(type=='price') { } else if(type=='exchange'){
return list?.map(item => {
return `${item.merchantName || '--'}:${item.exchangeIntegral || '否'}`
}) || []
}else if(type=='price') {
return list?.map(item => { return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0
return `${activityPrice || '0'}` return `${activityPrice || '0'}`
......
...@@ -303,6 +303,15 @@ export default { ...@@ -303,6 +303,15 @@ export default {
filter: '6' filter: '6'
}, },
{ {
label: '积分兑换',
width: 150,
formatter: cellValue => {
let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return (item.exchangeIntegralFlag != 1 || cellValue.goodsSource==2 )? '否' : item.exchangeIntegral
},
filter: '6'
},
{
label: '分类', label: '分类',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!