|
@@ -15,18 +15,28 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="4" :sm="24">
|
|
|
- <a-form-item label="是否促销品">
|
|
|
- <v-select
|
|
|
- code="FLAG"
|
|
|
- id="productInfoList-promoFlag"
|
|
|
- v-model="queryParam.promoFlag"
|
|
|
- allowClear
|
|
|
- placeholder="请选择是否"
|
|
|
- ></v-select>
|
|
|
+ <a-form-item label="产品类型">
|
|
|
+ <a-select v-model.trim="queryParam.promoFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
|
|
|
+ <a-select-option value="0">
|
|
|
+ 正常产品
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="REGULAR">
|
|
|
+ 正价产品(活动)
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="DISCOUNT">
|
|
|
+ 特价产品
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="GIFT">
|
|
|
+ 促销产品
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="GATE">
|
|
|
+ 门槛产品
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="4" :sm="24">
|
|
|
- <a-form-item label="类型">
|
|
|
+ <a-form-item label="下推类型">
|
|
|
<a-select v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
|
|
|
<a-select-option value="">
|
|
|
全部产品
|
|
@@ -60,9 +70,9 @@
|
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<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">
|
|
|
<span>参加促销活动的销售单,不能单个取消产品,只能整单取消。</span>
|
|
|
</template>
|
|
@@ -184,12 +194,17 @@ export default {
|
|
|
disableSelectedRowKeys: [],
|
|
|
selectedRowKeys: [],
|
|
|
colspanNums: 16,
|
|
|
+ hasNormalProduct: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
hasPrompActive(){
|
|
|
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 () {
|
|
|
return {
|
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
@@ -408,6 +423,8 @@ export default {
|
|
|
// 正常产品
|
|
|
const proList = await salesDetailAllList(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 ? [{
|
|
|
id: 'promo-normal',
|
|
@@ -575,6 +592,11 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
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 = []
|
|
|
chooseRow && chooseRow.map(item => {
|
|
|
obj.push({
|