|
@@ -19,7 +19,7 @@
|
|
|
:table-data="tableData" />
|
|
|
</a-spin>
|
|
|
<!-- 活动规则详情 -->
|
|
|
- <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
|
|
|
+ <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="promoRuleSn" @close="closeDetailModal"></detailModal>
|
|
|
<!-- 导入产品 -->
|
|
|
<importGuideModal
|
|
|
ref="importGuideModal"
|
|
@@ -117,19 +117,20 @@ export default {
|
|
|
// 单元格样式
|
|
|
cellStyleOption: {
|
|
|
headerCellClass: ({ column, rowIndex }) => {
|
|
|
- if (column.field == 'col2' || column.field == 'col3' || column.field == 'col4') {
|
|
|
+ console.log(column)
|
|
|
+ if (column.key >= 4 && column.key <= 6) {
|
|
|
return 'table-header-cell-blue'
|
|
|
}
|
|
|
- if (column.field == 'col6' || column.field == 'col7' || column.field == 'col8' || column.field == 'col9') {
|
|
|
+ if (column.key >= 7 && column.key <= 10) {
|
|
|
return 'table-header-cell-red'
|
|
|
}
|
|
|
- if (column.field == 'col11' || column.field == 'col12' || column.field == 'col13') {
|
|
|
+ if (column.key >= 11 && column.key <= 13) {
|
|
|
return 'table-header-cell-green'
|
|
|
}
|
|
|
- if (column.field == 'col14' || column.field == 'col15' || column.field == 'col16' || column.field == 'col17') {
|
|
|
+ if (column.key >= 14 && column.key <= 17) {
|
|
|
return 'table-header-cell-org'
|
|
|
}
|
|
|
- if (column.field == 'col18' || column.field == 'col19' || column.field == 'col20') {
|
|
|
+ if (column.key >= 18 && column.key <= 20) {
|
|
|
return 'table-header-cell-zs'
|
|
|
}
|
|
|
},
|
|
@@ -140,7 +141,7 @@ export default {
|
|
|
columns: [
|
|
|
{
|
|
|
field: '',
|
|
|
- key: 'acheckbox',
|
|
|
+ key: '0',
|
|
|
type: 'checkbox',
|
|
|
title: '',
|
|
|
width: 23,
|
|
@@ -149,7 +150,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: '',
|
|
|
- key: 'a',
|
|
|
+ key: '1',
|
|
|
title: '序号',
|
|
|
width: 25,
|
|
|
align: 'center',
|
|
@@ -160,7 +161,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'promotionRuleType',
|
|
|
- key: 'ruletype',
|
|
|
+ key: '2',
|
|
|
width: 100,
|
|
|
title: '活动类型',
|
|
|
align: 'center',
|
|
@@ -188,7 +189,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{ field: 'promotionRuleDesc',
|
|
|
- key: 'ruledesc',
|
|
|
+ key: '3',
|
|
|
width: 100,
|
|
|
title: '规则简称',
|
|
|
align: 'center',
|
|
@@ -210,7 +211,7 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
field: 'gateSelected',
|
|
|
- key: 'b',
|
|
|
+ key: '4',
|
|
|
title: '已选',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -218,7 +219,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'gateTotal',
|
|
|
- key: 'c',
|
|
|
+ key: '5',
|
|
|
title: '累计',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -226,7 +227,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'geteBalance',
|
|
|
- key: 'e',
|
|
|
+ key: '6',
|
|
|
title: '差额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -239,7 +240,7 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
field: 'regularQuota',
|
|
|
- key: 'f',
|
|
|
+ key: '7',
|
|
|
title: '配额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -247,7 +248,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'regularSelected',
|
|
|
- key: 'g',
|
|
|
+ key: '8',
|
|
|
title: '已选',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -255,7 +256,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'regularTotal',
|
|
|
- key: 'k',
|
|
|
+ key: '9',
|
|
|
title: '累计',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -263,7 +264,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'regularBalance',
|
|
|
- key: 'l',
|
|
|
+ key: '10',
|
|
|
title: '差额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -276,7 +277,7 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
field: 'promoLimit',
|
|
|
- key: 'z',
|
|
|
+ key: '11',
|
|
|
title: '额度',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -284,7 +285,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'promoSelected',
|
|
|
- key: 'x',
|
|
|
+ key: '12',
|
|
|
title: '已选',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -292,7 +293,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'promoBalance',
|
|
|
- key: 'v',
|
|
|
+ key: '13',
|
|
|
title: '差额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -305,7 +306,7 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
field: 'purchaseLimit',
|
|
|
- key: 'm',
|
|
|
+ key: '14',
|
|
|
title: '额度',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -313,7 +314,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'purchaseSelected',
|
|
|
- key: 'n',
|
|
|
+ key: '15',
|
|
|
title: '已选',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -321,7 +322,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'purchaseSurplus',
|
|
|
- key: 'kq',
|
|
|
+ key: '16',
|
|
|
title: '结余',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -329,7 +330,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'purchaseOverspend',
|
|
|
- key: 'jw',
|
|
|
+ key: '17',
|
|
|
title: '超支',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -342,7 +343,7 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
field: 'specialPriceQuota',
|
|
|
- key: 'mpe',
|
|
|
+ key: '18',
|
|
|
title: '配额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -350,7 +351,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'specialPriceSelected',
|
|
|
- key: 'nyx',
|
|
|
+ key: '19',
|
|
|
title: '已选',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -358,7 +359,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
field: 'specialPriceBalance',
|
|
|
- key: 'jce',
|
|
|
+ key: '20',
|
|
|
title: '差额',
|
|
|
width: 50,
|
|
|
align: 'center',
|
|
@@ -366,15 +367,37 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- { field: 'totalCategory', key: 'ks', title: '款数', width: 50, align: 'center', fixed: 'right' },
|
|
|
- { field: 'totalQty', key: 'dsl', title: '数量', width: 50, align: 'center', fixed: 'right' },
|
|
|
- { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
|
|
|
- { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
|
|
|
+ { field: 'totalCategory', key: '21', title: '款数', width: 50, align: 'center', fixed: 'right' },
|
|
|
+ { field: 'totalQty', key: '22', title: '数量', width: 50, align: 'center', fixed: 'right' },
|
|
|
+ { field: 'totalAmount', key: '23', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
|
|
|
+ { field: 'lossAmount', key: '24', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
|
|
|
{
|
|
|
field: '',
|
|
|
- key: 'action',
|
|
|
+ key: '25',
|
|
|
+ title: '状态',
|
|
|
+ width: 50,
|
|
|
+ center: 'center',
|
|
|
+ fixed: 'right',
|
|
|
+ renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <a-button
|
|
|
+ type="link"
|
|
|
+ size="small"
|
|
|
+ class={row.enabledFlag == 0 ? 'button-success' : 'button-error'}
|
|
|
+ on-click={() => this.enableRow(row)}
|
|
|
+ >
|
|
|
+ {row.enabledFlag == 0 ? '启用' : '禁用'}
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: '',
|
|
|
+ key: '26',
|
|
|
title: '操作',
|
|
|
- width: 180,
|
|
|
+ width: 130,
|
|
|
center: 'center',
|
|
|
fixed: 'right',
|
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
@@ -400,14 +423,6 @@ export default {
|
|
|
}
|
|
|
return (
|
|
|
<div>
|
|
|
- <a-button
|
|
|
- type="link"
|
|
|
- size="small"
|
|
|
- class={row.enabledFlag == 0 ? 'button-success' : 'button-error'}
|
|
|
- on-click={() => this.enableRow(row)}
|
|
|
- >
|
|
|
- {row.enabledFlag == 0 ? '启用' : '禁用'}
|
|
|
- </a-button>
|
|
|
{row.enabledFlag == 1 ? <a-dropdown>
|
|
|
<a-menu slot="overlay" on-click={(e) => this.handleImportClick(e, row)} id={'salesEdit-menu-import-' + row.id}>
|
|
|
{importButton.map(item => {
|
|
@@ -422,7 +437,7 @@ export default {
|
|
|
class="button-primary"
|
|
|
size="small"
|
|
|
>
|
|
|
- 导入<a-icon style="margin-left:0" type="down" />
|
|
|
+ 导入∨
|
|
|
</a-button>
|
|
|
</a-dropdown> : ''}
|
|
|
{row.enabledFlag == 1 ? <a-button
|
|
@@ -448,7 +463,7 @@ export default {
|
|
|
],
|
|
|
tableData: [],
|
|
|
openDetailModal: false, // 规则详情弹框
|
|
|
- detailSn: null, // 销售单sn
|
|
|
+ promoRuleSn: null, // 销售单sn
|
|
|
disabledActiveOption: null,
|
|
|
openGuideModal: false, // 导入产品引导
|
|
|
buyGiftsInfo: null // 买赠产品弹窗详情信息
|
|
@@ -620,19 +635,38 @@ export default {
|
|
|
},
|
|
|
enableRow (item) {
|
|
|
const _this = this
|
|
|
- // 禁用的直接启用
|
|
|
+ // 启用
|
|
|
if (item.enabledFlag == 0) {
|
|
|
- this.enabledActive(item)
|
|
|
+ this.$confirm({
|
|
|
+ title: item.promotion.description + '-' + item.promotionRule.description + ',确定启用规则?',
|
|
|
+ centered: true,
|
|
|
+ class: 'confirm-center',
|
|
|
+ content: <div>
|
|
|
+ <div style="padding:0 0 10px 0;text-align:center;">
|
|
|
+ <aRadioGroup onChange={_this.changeDaOpt}>
|
|
|
+ <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="DELETE">
|
|
|
+ 正常产品、参与叠加规则的促销产品自动适配规则
|
|
|
+ </aRadio>
|
|
|
+ <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="REMOVE">
|
|
|
+ 产品不自动适配规则
|
|
|
+ </aRadio>
|
|
|
+ </aRadioGroup>
|
|
|
+ </div>
|
|
|
+ </div>,
|
|
|
+ onOk () {
|
|
|
+ if (_this.disabledActiveOption) {
|
|
|
+ _this.enabledActive(item)
|
|
|
+ } else {
|
|
|
+ _this.$message.info('请选择启用方式!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onCancel () {
|
|
|
+ _this.disabledActiveOption = null
|
|
|
+ }
|
|
|
+ })
|
|
|
return
|
|
|
}
|
|
|
- // 如果没有活动产品,直接禁用无需弹框提示
|
|
|
- // const table = _this.$refs['productList-' + item.promoRuleSn][0]
|
|
|
- // if (!table.countData || table.countData && !table.countData.totalQty) {
|
|
|
- // _this.disabledActiveOption = 'DELETE'
|
|
|
- // _this.disabledActive(item)
|
|
|
- // return
|
|
|
- // }
|
|
|
- // 弹框提示禁用方式
|
|
|
+ // 禁用
|
|
|
this.$confirm({
|
|
|
title: item.promotion.description + '-' + item.promotionRule.description + ',确定禁用规则?',
|
|
|
centered: true,
|
|
@@ -642,10 +676,10 @@ export default {
|
|
|
<div style="padding:0 0 10px 0;text-align:center;">
|
|
|
<aRadioGroup onChange={_this.changeDaOpt}>
|
|
|
<aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="DELETE">
|
|
|
- 删除规则中相关产品
|
|
|
+ 删除产品
|
|
|
</aRadio>
|
|
|
<aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="REMOVE">
|
|
|
- 移出规则中相关产品
|
|
|
+ 移出产品
|
|
|
</aRadio>
|
|
|
</aRadioGroup>
|
|
|
</div>
|
|
@@ -655,7 +689,6 @@ export default {
|
|
|
_this.disabledActive(item)
|
|
|
} else {
|
|
|
_this.$message.info('请选择禁用方式!')
|
|
|
- return true
|
|
|
}
|
|
|
},
|
|
|
onCancel () {
|
|
@@ -720,13 +753,13 @@ export default {
|
|
|
// 查看活动详情
|
|
|
showDesc (row) {
|
|
|
if (row.promoRuleSn) {
|
|
|
- this.detailSn = row.promoRuleSn
|
|
|
+ this.promoRuleSn = row.promoRuleSn
|
|
|
this.openDetailModal = true
|
|
|
}
|
|
|
},
|
|
|
// 关闭详情弹窗
|
|
|
closeDetailModal () {
|
|
|
- this.detailSn = null
|
|
|
+ this.promoRuleSn = null
|
|
|
this.openDetailModal = false
|
|
|
}
|
|
|
}
|