|
@@ -40,41 +40,49 @@
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-row :gutter="15" type="flex" justify="space-between" align="middle">
|
|
|
<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
|
|
|
- :id="'salesEdit-searchBox-'+id"
|
|
|
- type="link"
|
|
|
- class="button-info"
|
|
|
- @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
|
|
|
- <!-- // 操作按钮 -->
|
|
|
<a-dropdown>
|
|
|
<a-menu slot="overlay" @click="handleMenuClick" :id="'salesEdit-menu-'+id">
|
|
|
- <a-menu-item key="3" :id="'salesEdit-menu-3-'+id">
|
|
|
- 全部仓库设置
|
|
|
- </a-menu-item>
|
|
|
<a-menu-item key="0" :id="'salesEdit-menu-0-'+id">
|
|
|
- 部分仓库设置
|
|
|
+ 批量仓库设置
|
|
|
</a-menu-item>
|
|
|
- <a-menu-divider />
|
|
|
<a-menu-item key="1" :id="'salesEdit-menu-1-'+id">
|
|
|
- 删除已选项
|
|
|
- </a-menu-item>
|
|
|
- <a-menu-item key="2" :id="'salesEdit-menu-2-'+id">
|
|
|
- 全部删除
|
|
|
+ 批量删除
|
|
|
</a-menu-item>
|
|
|
- <a-menu-divider />
|
|
|
<a-menu-item key="4" :id="'salesEdit-menu-4-'+id">
|
|
|
批量取消促销
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
<a-button
|
|
|
:id="'salesEdit-plaction-'+id"
|
|
|
- type="link"
|
|
|
+ type="default"
|
|
|
class="button-info"
|
|
|
- > 批量操作 <a-icon type="down" /> </a-button>
|
|
|
+ size="small"
|
|
|
+ >批量操作<a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
+ <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-searchBox-'+id"
|
|
|
+ type="link"
|
|
|
+ class="button-info"
|
|
|
+ @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-setAllWarehouse-'+id"
|
|
|
+ type="link"
|
|
|
+ class="button-info"
|
|
|
+ @click="handleMenuClick({key:3})"
|
|
|
+ >
|
|
|
+ <a-icon type="setting" /> 全部仓库设置
|
|
|
+ </a-button>
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-setAllDel-'+id"
|
|
|
+ type="link"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleMenuClick({key:2})"
|
|
|
+ >
|
|
|
+ <a-icon type="delete" /> 全部删除
|
|
|
+ </a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
@@ -166,16 +174,6 @@
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<div>
|
|
|
- <a-button
|
|
|
- :id="'salesEdit-del-'+id+'-'+record.id"
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- :loading="delLoading"
|
|
|
- class="button-error"
|
|
|
- v-if="!(record.promotionFlag == 'GIFT'&&record.salesPromoDetailParentSn)"
|
|
|
- @click="handleDel(record)"
|
|
|
- >删除</a-button>
|
|
|
-
|
|
|
<a-button
|
|
|
:id="'salesEdit-upactive-'+id+'-'+record.id"
|
|
|
size="small"
|
|
@@ -185,28 +183,17 @@
|
|
|
v-if="record.promotionFlag != 'GIFT'"
|
|
|
@click="handleUpdateActive(record)"
|
|
|
>换促销</a-button>
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-del-'+id+'-'+record.id"
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ :loading="delLoading"
|
|
|
+ class="button-error"
|
|
|
+ v-if="!(record.promotionFlag == 'GIFT'&&record.salesPromoDetailParentSn)"
|
|
|
+ @click="handleDel(record)"
|
|
|
+ >删除</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template slot="footer" slot-scope="currentPageData">
|
|
|
- <!-- 总计 -->
|
|
|
- <a-alert type="info" banner :showIcon="false">
|
|
|
- <div slot="message" class="alert-bar">
|
|
|
- <div class="countData" v-html="boldAmounts(countData&&countData.remarks||'')"></div>
|
|
|
- <div style="display: flex;">
|
|
|
- <div>
|
|
|
- 款数:<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 : 0 }}</strong>
|
|
|
- </div>
|
|
|
- <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>
|
|
|
- </div>
|
|
|
- </a-alert>
|
|
|
- </template>
|
|
|
</s-table>
|
|
|
|
|
|
<!-- 仓库设置 -->
|
|
@@ -227,7 +214,6 @@ import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
import {
|
|
|
salesDetailList,
|
|
|
salesPromoDetailCount,
|
|
|
- salesDetailInsert,
|
|
|
salesDetailUpdateQty,
|
|
|
salesDetailDel,
|
|
|
salesDetailBatchDel,
|
|
@@ -262,15 +248,10 @@ export default {
|
|
|
type: Object,
|
|
|
default: function () { return null }
|
|
|
},
|
|
|
- // 活动规则数据
|
|
|
- promo: {
|
|
|
- type: Object,
|
|
|
- default: function () { return null }
|
|
|
- },
|
|
|
// 表格id
|
|
|
id: {
|
|
|
type: String,
|
|
|
- default: ''
|
|
|
+ default: '0'
|
|
|
},
|
|
|
// 仓库sn
|
|
|
warehouseSn: {
|
|
@@ -286,16 +267,16 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
+ dataSource: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.queryParam.salesBillSn = this.salesBillSn || ''
|
|
|
- this.getCount()
|
|
|
return salesDetailList(Object.assign(parameter, this.queryParam, {
|
|
|
showStock: true,
|
|
|
- promoRuleSn: this.promo.promoRuleSn,
|
|
|
- promoSn: this.promo.promoSn,
|
|
|
- salesPromoSn: this.promo.salesPromoSn
|
|
|
+ promoRuleSn: '',
|
|
|
+ promoSn: '',
|
|
|
+ salesPromoSn: ''
|
|
|
})).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
@@ -353,7 +334,7 @@ export default {
|
|
|
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: this.promo.promotionRule.promotionRuleType == 'PROMO_PROD' ? '14%' : '20%', align: 'left' },
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', 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' },
|
|
@@ -370,10 +351,8 @@ export default {
|
|
|
arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
let idx = 0
|
|
|
// 如果是特价活动,显示折扣
|
|
|
- if (this.promo.promotionRule.promotionRuleType == 'PROMO_PROD') {
|
|
|
- idx = idx + 1
|
|
|
- arr.splice(5, 0, { title: '折扣', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' } })
|
|
|
- }
|
|
|
+ idx = idx + 1
|
|
|
+ arr.splice(5, 0, { title: '折扣', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' } })
|
|
|
arr.splice((this.showStockCol ? 9 : 8) + idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
|
}
|
|
|
return arr
|
|
@@ -419,19 +398,6 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
- // 统计
|
|
|
- getCount () {
|
|
|
- salesPromoDetailCount(Object.assign(this.queryParam, {
|
|
|
- salesBillSn: this.salesBillSn,
|
|
|
- promoRuleSn: this.promo.promoRuleSn,
|
|
|
- promoSn: this.promo.promoSn,
|
|
|
- salesPromoSn: this.promo.salesPromoSn
|
|
|
- })).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.countData = res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 重置查询
|
|
|
resetSearchForm (flag) {
|
|
|
this.queryParam.productCode = ''
|
|
@@ -481,11 +447,10 @@ export default {
|
|
|
_this.spinning = true
|
|
|
const params = {
|
|
|
salesBillDetailSnList: obj,
|
|
|
- salesBillSn: _this.salesBillSn,
|
|
|
- oldSalesPromoSn: _this.promo.salesPromoSn
|
|
|
+ salesBillSn: _this.salesBillSn
|
|
|
}
|
|
|
// 更换活动
|
|
|
- _this.$emit('upActive', _this.promo, '0', params)
|
|
|
+ _this.$emit('upActive', null, '0', params)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -502,7 +467,7 @@ export default {
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
|
|
|
+ deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$refs.table.refresh(true)
|
|
|
_this.$emit('insterOk', 'promo')
|
|
@@ -532,7 +497,7 @@ export default {
|
|
|
_this.spinning = true
|
|
|
salesDetailBatchDel({
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: _this.promo.salesPromoSn,
|
|
|
+ salesPromoSn: '',
|
|
|
salesBillDetailSnList: obj
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
@@ -552,7 +517,7 @@ export default {
|
|
|
warehouseSn: row.warehouseSn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- salesPromoSn: this.promo.salesPromoSn
|
|
|
+ salesPromoSn: ''
|
|
|
}
|
|
|
this.setWarehouseInfo(ajax_data)
|
|
|
},
|
|
@@ -567,7 +532,7 @@ export default {
|
|
|
warehouseSn: sn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: _this.promo.salesPromoSn,
|
|
|
+ salesPromoSn: '',
|
|
|
allFlag: _this.warehouseTit ? true : undefined
|
|
|
}
|
|
|
_this.setWarehouseInfo(ajax_data)
|
|
@@ -613,7 +578,7 @@ export default {
|
|
|
this.$refs.updateActive.getActiveList({
|
|
|
productSn: record.productSn,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- promoRuleSn: this.promo.promoRuleSn
|
|
|
+ promoRuleSn: ''
|
|
|
}, record)
|
|
|
this.openUpActiveModal = true
|
|
|
},
|
|
@@ -627,7 +592,7 @@ export default {
|
|
|
salesBillDetailSn: record.salesBillDetailSn,
|
|
|
qty: record.qty,
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: _this.promo.salesPromoSn
|
|
|
+ salesPromoSn: ''
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$emit('insterOk', 'promo')
|
|
@@ -651,7 +616,7 @@ export default {
|
|
|
onOk () {
|
|
|
_this.delLoading = true
|
|
|
_this.spinning = true
|
|
|
- salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
|
|
|
+ salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$refs.table.refresh(false)
|
|
|
_this.$emit('insterOk', 'promo')
|
|
@@ -669,11 +634,11 @@ export default {
|
|
|
const params = {
|
|
|
salesBillDetailSn: editRow.salesBillDetailSn,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- oldSalesPromoSn: this.promo.salesPromoSn,
|
|
|
+ oldSalesPromoSn: '',
|
|
|
priceLevel: editRow.priceLevel
|
|
|
}
|
|
|
// 更换活动
|
|
|
- this.$emit('upActive', this.promo, data, params)
|
|
|
+ this.$emit('upActive', null, data, params)
|
|
|
},
|
|
|
// 更换活动成功
|
|
|
upAcitveSuccess () {
|