|
@@ -60,9 +60,9 @@
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
<a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
<a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
- <a-button type="danger" v-if="hasPrompActive" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
|
|
|
|
- <a-button type="danger" v-else :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
|
|
|
|
- <a-tooltip placement="top" v-if="hasPrompActive" style="margin-left:6px;">
|
|
|
|
|
|
+ <a-button type="primary" v-if="hasNormalProduct" ghost style="margin-left:6px;" :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
|
|
|
|
+ <a-button type="primary" v-if="hasPrompActive&&hasPushedActive" ghost style="margin-left:6px;" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
|
|
|
|
+ <a-tooltip placement="top" v-if="hasPrompActive&&hasPushedActive" style="margin-left:6px;">
|
|
<template slot="title">
|
|
<template slot="title">
|
|
<span>参加促销活动的销售单,不能单个取消产品,只能整单取消。</span>
|
|
<span>参加促销活动的销售单,不能单个取消产品,只能整单取消。</span>
|
|
</template>
|
|
</template>
|
|
@@ -184,12 +184,17 @@ export default {
|
|
disableSelectedRowKeys: [],
|
|
disableSelectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
colspanNums: 16,
|
|
colspanNums: 16,
|
|
|
|
+ hasNormalProduct: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
hasPrompActive(){
|
|
hasPrompActive(){
|
|
return this.detailData&&this.detailData.promoFlag==1&&!this.detailData.totalCancelQty
|
|
return this.detailData&&this.detailData.promoFlag==1&&!this.detailData.totalCancelQty
|
|
},
|
|
},
|
|
|
|
+ hasPushedActive(){
|
|
|
|
+ const a = this.dataSource.filter(item => item.promotionFlag != 0).filter(item => item.pushedQty>0)
|
|
|
|
+ return this.dataSource.length==0 ? false : !(a.length > 0)
|
|
|
|
+ },
|
|
checkboxOption () {
|
|
checkboxOption () {
|
|
return {
|
|
return {
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
@@ -408,6 +413,8 @@ export default {
|
|
// 正常产品
|
|
// 正常产品
|
|
const proList = await salesDetailAllList(params).then(res => res.data)
|
|
const proList = await salesDetailAllList(params).then(res => res.data)
|
|
const norTotal = await salesDetaiCount(params).then(res => res.data)
|
|
const norTotal = await salesDetaiCount(params).then(res => res.data)
|
|
|
|
+ // 是否有正常产品
|
|
|
|
+ this.hasNormalProduct = proList.length > 0
|
|
//没有活动时不显示统计
|
|
//没有活动时不显示统计
|
|
let listData = active.length ? (proList.length ? [{
|
|
let listData = active.length ? (proList.length ? [{
|
|
id: 'promo-normal',
|
|
id: 'promo-normal',
|
|
@@ -575,6 +582,11 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
|
|
const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
|
|
|
|
+ const hasActive = chooseRow && chooseRow.filter(item => item.promotionFlag != 0)
|
|
|
|
+ if(hasActive.length>0){
|
|
|
|
+ _this.$message.warning('参与促销的产品只可进行整单取消!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const obj = []
|
|
const obj = []
|
|
chooseRow && chooseRow.map(item => {
|
|
chooseRow && chooseRow.map(item => {
|
|
obj.push({
|
|
obj.push({
|