|
@@ -1,46 +1,56 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="table-page-search-wrapper" v-show="showDescBox">
|
|
|
- <a-descriptions :column="4" v-if="descDetail">
|
|
|
- <a-descriptions-item label="促销类型">
|
|
|
+ <a-row v-if="descDetail" type="flex" justify="start">
|
|
|
+ <a-col span="6" style="padding: 6px;">
|
|
|
+ <span>促销类型:</span>
|
|
|
{{ descDetail.promotionRuleTypeDictValue||'--' }}
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="促销门槛" span="3">
|
|
|
- <div v-if="descDetail.gateFlag === '1'">
|
|
|
- <span v-if="descDetail.gateType==='RATIO_AMOUNT'">
|
|
|
- 购买门槛产品金额{{ descDetail.gateAmount*100 }}%作为配额
|
|
|
- </span>
|
|
|
- <span v-else-if="descDetail.gateType==='MIN_AMOUNT'">
|
|
|
- 购买门槛产品满最低金额{{ descDetail.gateAmount }}不限制配额。
|
|
|
- </span>
|
|
|
- <span v-else>购买满{{ descDetail.gateAmount }}元门槛产品,可使用 {{ descDetail.quotaAmount }}元配额,采购规则中的正价商品</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="18" style="padding: 6px;">
|
|
|
+ <div style="display: flex;">
|
|
|
+ <span>促销门槛:</span>
|
|
|
+ <div v-if="descDetail.gateFlag === '1'">
|
|
|
+ <span v-if="descDetail.gateType==='RATIO_AMOUNT'">
|
|
|
+ 购买门槛产品金额{{ descDetail.gateAmount*100 }}%作为配额
|
|
|
+ </span>
|
|
|
+ <span v-else-if="descDetail.gateType==='MIN_AMOUNT'">
|
|
|
+ 购买门槛产品满最低金额{{ descDetail.gateAmount }}不限制配额。
|
|
|
+ </span>
|
|
|
+ <span v-else>购买满{{ descDetail.gateAmount }}元门槛产品,可使用 {{ descDetail.quotaAmount }}元配额,采购规则中的正价商品</span>
|
|
|
+ </div>
|
|
|
+ <span v-else>无</span>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="24" style="padding: 6px;">
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="display: flex;">
|
|
|
+ <span>促销规则:</span>
|
|
|
+ <span v-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_PROD'">
|
|
|
+ {{ descDetail.regularSameFlag==='1'?'同款产品,':'不同款产品,' }}
|
|
|
+ 购买满{{ descDetail.regularQty }}个正价产品,送{{ descDetail.promotionQty }}个促销产品
|
|
|
+ {{ descDetail.accrualFlag == 1 ? ',数量叠加':',数量不叠加' }}
|
|
|
+ </span>
|
|
|
+ <span v-else-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
|
|
|
+ {{ descDetail.regularSameFlag==='1'?'同款产品,':'不同款产品,' }}
|
|
|
+ 购买满{{ descDetail.regularAmount }}元正价产品,送{{ descDetail.giveAmount }}元促销品采购额
|
|
|
+ {{ descDetail.accrualFlag == 1 ? ',金额叠加':',金额不叠加' }}
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ 特价产品
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;flex-grow: 1;">
|
|
|
+ <div v-if="descDetail.promotionRuleType!='PROMO_PROD'&&descDetail.promotionRuleType!='BUY_PROD_GIVE_MONEY'">
|
|
|
+ <span style="margin-left: 50px;">限制正价产品款数:</span>{{ descDetail.restrictCategory||'无' }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span style="margin-left: 50px;">订单起订金额(元):</span>{{ descDetail.minOrderAmount||'无' }}
|
|
|
+ <span style="margin-left: 50px;">活动经费上线(元):</span>{{ descDetail.upperLimitAmount||'无' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <span v-else>无</span>
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="促销规则">
|
|
|
- {{ descDetail.regularSameFlag==='1'?'同款,':'不同款,' }}
|
|
|
- <span v-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_PROD'">
|
|
|
- 购买满{{ descDetail.regularQty }}个正价产品,送{{ descDetail.promotionQty }}个促销产品
|
|
|
- {{ descDetail.accrualFlag ? ',数量叠加':',数量不叠加' }}
|
|
|
- </span>
|
|
|
- <span v-else-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
|
|
|
- 购买满{{ descDetail.regularAmount }}元正价产品,送{{ descDetail.giveAmount }}元促销品采购额
|
|
|
- {{ descDetail.accrualFlag ? ',金额叠加':',金额不叠加' }}
|
|
|
- </span>
|
|
|
- <span v-else>
|
|
|
- 特价产品
|
|
|
- </span>
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="限制正价产品款数" v-if="descDetail.promotionRuleType!='PROMO_PROD'&&descDetail.promotionRuleType!='BUY_PROD_GIVE_MONEY'">
|
|
|
- {{ descDetail.restrictCategory||'--' }}
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="订单起订金额(元)">
|
|
|
- {{ descDetail.minOrderAmount||'无' }}
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="活动经费上线(元)">
|
|
|
- {{ descDetail.upperLimitAmount||'无' }}
|
|
|
- </a-descriptions-item>
|
|
|
- </a-descriptions>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</div>
|
|
|
<!-- 筛选条件 -->
|
|
|
<div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
|
|
@@ -81,7 +91,15 @@
|
|
|
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-row :gutter="15" type="flex" justify="space-between" align="middle">
|
|
|
- <a-col :md="12" :sm="24" style="text-align:left;">
|
|
|
+ <a-col :md="8" :sm="24" style="text-align:left;">
|
|
|
+ <span v-if="selectTotal" style="margin-right:5px;">已选{{ selectTotal }}项</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
+ <a-button
|
|
|
+ type="link"
|
|
|
+ class="button-info"
|
|
|
+ @click="showSearchBox=!showSearchBox" ><a-icon type="search"/> 筛选</a-button>
|
|
|
+
|
|
|
<a-dropdown>
|
|
|
<a-menu slot="overlay" @click="handleMenuClick">
|
|
|
<a-menu-item key="0" :disabled="disablePromo">
|
|
@@ -95,28 +113,25 @@
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
<a-button
|
|
|
- type="default"
|
|
|
+ type="link"
|
|
|
class="button-info"
|
|
|
> 批量操作 <a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
- <span v-if="selectTotal" style="margin-left:5px;">已选{{ selectTotal }}项</span>
|
|
|
- </a-col>
|
|
|
- <a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
- <a-button
|
|
|
- type="link"
|
|
|
- class="button-info"
|
|
|
- @click="showSearchBox=!showSearchBox" ><a-icon type="search"/> 筛选</a-button>
|
|
|
+
|
|
|
<a-dropdown :disabled="disablePromo">
|
|
|
<a-menu slot="overlay" @click="handleImportClick">
|
|
|
- <a-menu-item key="GATE">
|
|
|
+ <a-menu-item key="GATE" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType!='PROMO_PROD'">
|
|
|
导入门槛产品
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="REGULAR">
|
|
|
+ <a-menu-item key="REGULAR" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType!='PROMO_PROD'">
|
|
|
导入正价产品
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="GIFT">
|
|
|
+ <a-menu-item key="GIFT" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType!='PROMO_PROD'">
|
|
|
导入促销产品
|
|
|
</a-menu-item>
|
|
|
+ <a-menu-item key="DISCOUNT" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType=='PROMO_PROD'">
|
|
|
+ 导入特价产品
|
|
|
+ </a-menu-item>
|
|
|
</a-menu>
|
|
|
<a-button
|
|
|
type="link"
|
|
@@ -148,7 +163,6 @@
|
|
|
<template slot="productCode" slot-scope="text, record">
|
|
|
<span style="padding-right: 15px;">{{ text }}</span>
|
|
|
<a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
|
|
|
- <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
|
|
|
<a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
|
|
|
<a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }"></a-badge>
|
|
|
</template>
|
|
@@ -164,10 +178,14 @@
|
|
|
<a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
+ <!-- 销售价 -->
|
|
|
+ <template slot="price" slot-scope="text, record">
|
|
|
+ {{ toThousands(text) }}
|
|
|
+ <span v-if="record.promotionFlag=='GIFT'" title="原价">({{ toThousands(record.origPrice) }})</span>
|
|
|
+ </template>
|
|
|
<!-- 促销价 -->
|
|
|
<template slot="discountPrice" slot-scope="text, record">
|
|
|
- <span>{{ record.discountedPrice }}</span>
|
|
|
+ <span>{{ toThousands(record.discountedPrice) }}</span>
|
|
|
({{ record.discountRate }}%)
|
|
|
</template>
|
|
|
<!-- 销售数量 -->
|
|
@@ -232,13 +250,13 @@
|
|
|
</div>
|
|
|
<div style="display: flex;">
|
|
|
<div>
|
|
|
- 款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : '--' }}</strong>
|
|
|
+ 款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>
|
|
|
</div>
|
|
|
<div style="padding: 0 10px;">
|
|
|
- 数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>
|
|
|
+ 数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : 0 }}</strong>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong></div>
|
|
|
+ <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '0.00' }}</strong></div>
|
|
|
<div v-if="$hasPermissions('B_salesEdit_salesPrice')&&countData&&countData.lossAmount">优惠金额:<strong>{{ toThousands(countData.lossAmount) }}</strong></div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -384,22 +402,24 @@
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
|
|
|
- { title: '起订量', dataIndex: 'unitQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
|
|
|
- { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
|
|
|
- { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: this.promo.promotionRule.promotionRuleType=='PROMO_PROD' ? '20%' : '26%', align: 'left' },
|
|
|
+ { title: '起订量', dataIndex: 'unitQtyV', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '6%', align: 'center' },
|
|
|
+ { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
|
|
|
+ { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
// { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
|
|
|
]
|
|
|
if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
|
|
|
- arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
|
+ arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'right', scopedSlots: { customRender: 'price' } })
|
|
|
+ let idx = 0
|
|
|
// 如果是特价活动
|
|
|
if(this.promo.promotionRule.promotionRuleType=='PROMO_PROD'){
|
|
|
- arr.splice(4, 0, { title: '促销价', dataIndex: 'discountPrice', width: '8%', align: 'right', scopedSlots: { customRender: 'discountPrice' }})
|
|
|
+ idx = idx + 1
|
|
|
+ arr.splice(5, 0, { title: '促销价', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' }})
|
|
|
}
|
|
|
- arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
|
+ arr.splice(8+idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -424,6 +444,7 @@
|
|
|
showDesc(descDetail){
|
|
|
this.showDescBox = !this.showDescBox
|
|
|
this.descDetail = descDetail
|
|
|
+ this.$emit("showDesc",this.showDescBox)
|
|
|
},
|
|
|
openCpModal(){
|
|
|
this.$emit('openCpModal', 1, this.id)
|
|
@@ -439,9 +460,9 @@
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
// 禁用活动
|
|
|
- disableActive(){
|
|
|
+ disableActive(flag){
|
|
|
this.resetSearchForm()
|
|
|
- this.disablePromo = true
|
|
|
+ this.disablePromo = flag
|
|
|
},
|
|
|
// 统计
|
|
|
getCount(){
|
|
@@ -555,6 +576,7 @@
|
|
|
const _this = this
|
|
|
_this.spinning = true
|
|
|
updateWarehouse(data).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.status == 200) {
|
|
|
_this.openWarehouseModal = false
|
|
|
_this.resetSearchForm(true)
|
|
@@ -625,6 +647,7 @@
|
|
|
salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.resetSearchForm(true)
|
|
|
+ _this.$emit('insterOk','promo')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.delLoading = false
|
|
@@ -686,8 +709,8 @@
|
|
|
}
|
|
|
salesDetailInsert(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.resetSearchForm()
|
|
|
this.$message.success('产品添加成功', 2.5)
|
|
|
+ this.resetSearchForm()
|
|
|
this.$emit('insterOk','promo')
|
|
|
}
|
|
|
this.spinning = false
|
|
@@ -722,8 +745,9 @@
|
|
|
|
|
|
salesBatchInsert(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- this.getOrderDetail(false)
|
|
|
+ this.$message.success('产品导入成功', 2.5)
|
|
|
+ this.resetSearchForm()
|
|
|
+ this.$emit('insterOk','promo')
|
|
|
}
|
|
|
})
|
|
|
},
|