|
@@ -40,11 +40,7 @@
|
|
|
:id="'productTable-resultValue'+record.id "
|
|
|
size="small"/>
|
|
|
</template>
|
|
|
- <!-- 特价产品 标题 -->
|
|
|
- <template slot="titleType">
|
|
|
- {{ activeType==='PROMO_PROD'?discountType==='STRAIGHT_DOWN'?'直降金额':'折扣(%)':activeType==='BUY_PROD_GIVE_VALID'?'返券金额':'--' }}
|
|
|
- </template>
|
|
|
- <!-- 直降 打折 || 买产品送代金券 返券金额 -->
|
|
|
+ <!-- 买产品送代金券 返券金额 -->
|
|
|
<template slot="priceValue" slot-scope="text,record">
|
|
|
<a-input-number
|
|
|
:min="0.01"
|
|
@@ -59,10 +55,20 @@
|
|
|
</template>
|
|
|
<!-- 特价价格-->
|
|
|
<template slot="specialOffer" slot-scope="text,record">
|
|
|
+ <a-input-number
|
|
|
+ :min="0.01"
|
|
|
+ :step="1"
|
|
|
+ :precision="2"
|
|
|
+ :max="99999999"
|
|
|
+ @blur="editProductVal(record,'conditionValue')"
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="record.conditionValue"
|
|
|
+ :id="'productTable-conditionValue'+record.id "
|
|
|
+ size="small"/>
|
|
|
<!-- 直降 -->
|
|
|
- <span v-if="discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span>
|
|
|
+ <!-- <span v-if="discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span> -->
|
|
|
<!-- 折扣 -->
|
|
|
- <span v-else>{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span>
|
|
|
+ <!-- <span v-else>{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span> -->
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text,record">
|
|
@@ -121,8 +127,8 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
- if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
|
|
|
- data.list[i].resultValue = data.list[i].resultValue ? data.list[i].resultValue * 100 : ''
|
|
|
+ if (this.activeType === 'PROMO_PROD') {
|
|
|
+ data.list[i].conditionValue = data.list[i].conditionValue ? data.list[i].conditionValue : data.list[i].shopProductPrice
|
|
|
}
|
|
|
}
|
|
|
this.chooseProductNum = data.count
|
|
@@ -140,7 +146,7 @@ export default {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '商城售价', dataIndex: 'shopProductPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
@@ -149,10 +155,9 @@ export default {
|
|
|
arr.splice(4, 0, { title: '买', scopedSlots: { customRender: 'conditionValue' }, width: '10%', align: 'center' })
|
|
|
arr.splice(5, 0, { title: '赠', scopedSlots: { customRender: 'resultValue' }, width: '10%', align: 'center' })
|
|
|
} else if (_this.activeType === 'PROMO_PROD') {
|
|
|
- arr.splice(5, 0, { slots: { title: 'titleType' }, scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
|
|
|
- arr.splice(6, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
|
|
|
+ arr.splice(5, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
|
|
|
} else {
|
|
|
- arr.splice(5, 0, { slots: { title: 'titleType' }, scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
|
|
|
+ arr.splice(5, 0, { title: '返券金额', scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
|
|
|
}
|
|
|
return arr
|
|
|
},
|
|
@@ -169,6 +174,7 @@ export default {
|
|
|
// 批量已选产品信息
|
|
|
editProductVal (row, typeName) {
|
|
|
let ajaxData = []
|
|
|
+ row.resultValue = this.activeType === 'PROMO_PROD' ? undefined : row.resultValue
|
|
|
if (typeName != 'all') {
|
|
|
ajaxData.push({
|
|
|
id: row.id,
|
|
@@ -202,12 +208,11 @@ export default {
|
|
|
if (this.discountType === 'STRAIGHT_DOWN') {
|
|
|
ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
|
|
|
} else {
|
|
|
- ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue / 100 } })
|
|
|
+ ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: (item.shopProductPrice * (objInfo.resultValue / 100)), resultValue: objInfo.resultValue / 100 } })
|
|
|
}
|
|
|
} else {
|
|
|
ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue } })
|
|
|
}
|
|
|
-
|
|
|
this.editProductVal(ajaxArr, 'all')
|
|
|
},
|
|
|
// 删除
|