|
@@ -40,6 +40,7 @@ import totalProductDetailModal from './totalProductDetailModal.vue'
|
|
import normalProductDetailModal from './normalProductDetailModal.vue'
|
|
import normalProductDetailModal from './normalProductDetailModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import { salesDisablePromo, salesEnablePromoPromo, salesBatchInsert, importBorrowTotalProduct } from '@/api/salesDetailNew'
|
|
import { salesDisablePromo, salesEnablePromoPromo, salesBatchInsert, importBorrowTotalProduct } from '@/api/salesDetailNew'
|
|
|
|
+import { salesPromoSaveSort } from '@/api/salesNew'
|
|
export default {
|
|
export default {
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
components: { detailModal, ImportGuideModal, totalProductDetailModal, normalProductDetailModal },
|
|
components: { detailModal, ImportGuideModal, totalProductDetailModal, normalProductDetailModal },
|
|
@@ -165,20 +166,23 @@ export default {
|
|
align: 'center',
|
|
align: 'center',
|
|
fixed: 'left',
|
|
fixed: 'left',
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
- const equalWord = <div style="display:flex;">
|
|
|
|
- <span style="width:12px;color:#ed1c24;text-align:center;margin-left:5px;cursor:pointer;" onClick={() => _this.moveTjRow(row, rowIndex, 'up')} title="上移">{rowIndex != 0 ? '⇡' : ''}</span>
|
|
|
|
- <span style="width:12px;color:#108ee9;text-align:center;cursor:pointer;" onClick={() => _this.moveTjRow(row, rowIndex, 'down')} title="下移">{rowIndex != _this.activeList.length - 1 ? '⇣' : ''}</span>
|
|
|
|
|
|
+ const isTejia = row && row.promotionRule && row.promotionRule.promotionRuleType == 'PROMO_PROD' // 是否特价
|
|
|
|
+ const tejiaLen = _this.activeList.filter(item => item.promotionRule && item.promotionRule.promotionRuleType == 'PROMO_PROD').length // 特价活动数量
|
|
|
|
+ // 特价活动上移下移排序
|
|
|
|
+ const equalWord = <div class="table-arrow-box">
|
|
|
|
+ <span class="up" onClick={() => _this.moveTjRow(row, rowIndex, 1)} title="上移">{rowIndex != 0 ? '⇡' : ''}</span>
|
|
|
|
+ <span class="down" onClick={() => _this.moveTjRow(row, rowIndex, 0)} title="下移">{rowIndex != tejiaLen - 1 ? '⇣' : ''}</span>
|
|
</div>
|
|
</div>
|
|
// 买产品送产品 同款产品 是累计产品才弹详情窗
|
|
// 买产品送产品 同款产品 是累计产品才弹详情窗
|
|
if (row.promotionRule.promotionRuleType === 'BUY_PROD_GIVE_PROD' && row.promotion.borrowFlag == '1' && row.promotionRule.regularSameFlag == '1') {
|
|
if (row.promotionRule.promotionRuleType === 'BUY_PROD_GIVE_PROD' && row.promotion.borrowFlag == '1' && row.promotionRule.regularSameFlag == '1') {
|
|
return (<div style="width:100%;display:flex;justify-content: space-between;">
|
|
return (<div style="width:100%;display:flex;justify-content: space-between;">
|
|
<div class="table-link-text" onClick={() => _this.showBuyGifts(row)} style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
|
|
<div class="table-link-text" onClick={() => _this.showBuyGifts(row)} style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
|
|
- {equalWord}
|
|
|
|
|
|
+ {isTejia ? equalWord : ''}
|
|
</div>)
|
|
</div>)
|
|
} else {
|
|
} else {
|
|
return (<div style="width:100%;display:flex;justify-content: space-between;">
|
|
return (<div style="width:100%;display:flex;justify-content: space-between;">
|
|
<div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
|
|
<div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
|
|
- {equalWord}
|
|
|
|
|
|
+ {isTejia ? equalWord : ''}
|
|
</div>)
|
|
</div>)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -194,9 +198,9 @@ export default {
|
|
<div class="table-link-text" title={row[column.field]}>
|
|
<div class="table-link-text" title={row[column.field]}>
|
|
<span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{row[column.field]}</span>
|
|
<span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{row[column.field]}</span>
|
|
</div>
|
|
</div>
|
|
- <div style="width:80px;">
|
|
|
|
- {row.promotion.stackFlag == 1 ? <a-badge count="叠" numberStyle={{ backgroundColor: '#00aa00', marginLeft: '3px', zoom: '80%' }}/> : ''}
|
|
|
|
- {row.promotion.borrowFlag == 1 ? <a-badge count="累" numberStyle={{ backgroundColor: '#F5222D', marginLeft: '3px', zoom: '80%' }} /> : ''}
|
|
|
|
|
|
+ <div style="position:absolute;right:0;background:#fff;">
|
|
|
|
+ {row.promotion.stackFlag == 1 ? <a-badge count="叠" numberStyle={{ backgroundColor: '#00aa00', marginLeft: '2px', zoom: '0.7' }}/> : ''}
|
|
|
|
+ {row.promotion.borrowFlag == 1 ? <a-badge count="累" numberStyle={{ backgroundColor: '#F5222D', marginLeft: '2px', zoom: '0.7' }} /> : ''}
|
|
</div>
|
|
</div>
|
|
</div>)
|
|
</div>)
|
|
}
|
|
}
|
|
@@ -447,7 +451,7 @@ export default {
|
|
detailSn: null, // 销售单sn
|
|
detailSn: null, // 销售单sn
|
|
disabledActiveOption: null,
|
|
disabledActiveOption: null,
|
|
openGuideModal: false, // 导入产品引导
|
|
openGuideModal: false, // 导入产品引导
|
|
- uyGiftsInfo: null // 买赠产品弹窗详情信息
|
|
|
|
|
|
+ buyGiftsInfo: null // 买赠产品弹窗详情信息
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -530,8 +534,30 @@ export default {
|
|
this.checkboxOption.disableSelectedRowKeys = this.tableData.filter(item => item.enabledFlag == 0).map(item => item.id)
|
|
this.checkboxOption.disableSelectedRowKeys = this.tableData.filter(item => item.enabledFlag == 0).map(item => item.id)
|
|
},
|
|
},
|
|
// 上下移动特价活动
|
|
// 上下移动特价活动
|
|
- moveTjRow (row, index, type) {
|
|
|
|
-
|
|
|
|
|
|
+ moveTjRow (item, rowIndex, type) {
|
|
|
|
+ const temp = this.tableData[type == 1 ? rowIndex - 1 : rowIndex + 1]
|
|
|
|
+ const tempSort = temp.sort
|
|
|
|
+ temp.sort = item.sort
|
|
|
|
+ item.sort = tempSort
|
|
|
|
+ // 保存排序
|
|
|
|
+ const tejia = this.tableData.filter(item => item.promotionRule && item.promotionRule.promotionRuleType == 'PROMO_PROD')
|
|
|
|
+ const data = tejia.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.id,
|
|
|
|
+ sort: item.sort
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.spinning = true
|
|
|
|
+ salesPromoSaveSort(data).then(res => {
|
|
|
|
+ this.spinning = false
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.tableData = this.tableData.sort((a, b) => a.sort - b.sort)
|
|
|
|
+ } else {
|
|
|
|
+ // 恢复排序
|
|
|
|
+ item.sort = temp.sort
|
|
|
|
+ temp.sort = tempSort
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 刷新当前规则
|
|
// 刷新当前规则
|
|
refashRow (item, enable) {
|
|
refashRow (item, enable) {
|
|
@@ -731,4 +757,27 @@ export default {
|
|
text-decoration: underline;
|
|
text-decoration: underline;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .table-arrow-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ span{
|
|
|
|
+ width:16px;
|
|
|
|
+ text-align:center;
|
|
|
|
+ cursor:pointer;
|
|
|
|
+ border-radius: 50px;
|
|
|
|
+ }
|
|
|
|
+ .up{
|
|
|
|
+ color:#ed1c24;
|
|
|
|
+ &:hover{
|
|
|
|
+ color:#fff;
|
|
|
|
+ background:#ed1c24;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .down{
|
|
|
|
+ color:#00aaff;
|
|
|
|
+ &:hover{
|
|
|
|
+ color:#fff;
|
|
|
|
+ background:#00aaff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|