|
@@ -42,12 +42,20 @@
|
|
|
<a-col :md="8" :sm="24" style="text-align:left;">
|
|
|
<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>
|
|
@@ -60,22 +68,6 @@
|
|
|
>批量操作<a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
<span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
|
|
|
- <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-col :md="12" :sm="24" style="text-align:right;">
|
|
|
<a-button
|
|
@@ -213,8 +205,8 @@ import ProductBrand from '@/views/common/productBrand.js'
|
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
import {
|
|
|
salesDetailList,
|
|
|
- salesPromoDetailCount,
|
|
|
salesDetailUpdateQty,
|
|
|
+ salesDetailInsert,
|
|
|
salesDetailDel,
|
|
|
salesDetailBatchDel,
|
|
|
deleteAll,
|
|
@@ -239,9 +231,9 @@ export default {
|
|
|
default: false
|
|
|
},
|
|
|
newLoading: Boolean,
|
|
|
- activeList: {
|
|
|
- type: Array,
|
|
|
- default: () => []
|
|
|
+ promo: {
|
|
|
+ type: Object,
|
|
|
+ default: function () { return null }
|
|
|
},
|
|
|
// 详情数据
|
|
|
detailData: {
|
|
@@ -274,9 +266,9 @@ export default {
|
|
|
this.queryParam.salesBillSn = this.salesBillSn || ''
|
|
|
return salesDetailList(Object.assign(parameter, this.queryParam, {
|
|
|
showStock: true,
|
|
|
- promoRuleSn: '',
|
|
|
- promoSn: '',
|
|
|
- salesPromoSn: ''
|
|
|
+ promoRuleSn: this.promo ? this.promo.promoRuleSn : '',
|
|
|
+ promoSn: this.promo ? this.promo.promoSn : '',
|
|
|
+ salesPromoSn: this.promo ? this.promo.salesPromoSn : ''
|
|
|
})).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
@@ -333,14 +325,14 @@ export default {
|
|
|
columns () {
|
|
|
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: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '12%', align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '25%', 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: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
]
|
|
|
if (this.showStockCol) {
|
|
|
arr.splice(6, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
|
|
@@ -358,6 +350,9 @@ export default {
|
|
|
salesBillSn (newValue, oldValue) {
|
|
|
this.resetSearchForm()
|
|
|
},
|
|
|
+ promo (newValue, oldValue) {
|
|
|
+ this.resetSearchForm()
|
|
|
+ },
|
|
|
spinning (a, b) {
|
|
|
if (a) {
|
|
|
this.$emit('spinning', a)
|
|
@@ -408,6 +403,49 @@ export default {
|
|
|
this.$refs.table.clearSelected()
|
|
|
this.$refs.table.refresh(!!flag)
|
|
|
},
|
|
|
+ // 保存添加的产品到销售列表
|
|
|
+ saveNewProduct (row, promo, promoProductClz) {
|
|
|
+ // 防止多次添加产品
|
|
|
+ if (this.isInster) { return }
|
|
|
+ this.$message.loading('正在添加产品...', 1)
|
|
|
+ this.isInster = true
|
|
|
+ this.spinning = true
|
|
|
+ const params = {
|
|
|
+ salesPromoSn: promo.salesPromoSn,
|
|
|
+ promoRuleSn: promo.promoRuleSn,
|
|
|
+ promoSn: promo.promoSn,
|
|
|
+ promoProductClz: promoProductClz,
|
|
|
+ packQty: row.productPackQty,
|
|
|
+ productSn: row.productSn,
|
|
|
+ showCost: row.lastStockCost,
|
|
|
+ price: row.productPrice,
|
|
|
+ origPrice: row.origPrice,
|
|
|
+ promotionGiftsAmount: 0,
|
|
|
+ usePromotionGiftsAmount: 0,
|
|
|
+ qty: row.salesNums,
|
|
|
+ salesBillSn: this.detailData.salesBillSn,
|
|
|
+ salesBillNo: this.detailData.salesBillNo,
|
|
|
+ purchaseBillSn: this.detailData.purchaseBillSn,
|
|
|
+ purchaseBillNo: this.detailData.purchaseBillNo,
|
|
|
+ priceLevel: row.priceLevel,
|
|
|
+ stockSn: row.stockSn,
|
|
|
+ promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
|
|
|
+ promotionFlag: 0, // 促销标记 正品传0,促销品传1
|
|
|
+ warehouseSn: row.warehouseSn
|
|
|
+ }
|
|
|
+ salesDetailInsert(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success('产品添加成功', 2.5)
|
|
|
+ this.resetSearchForm(true)
|
|
|
+ this.$emit('refash', 'promo')
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ this.isInster = false
|
|
|
+ }).catch(err => {
|
|
|
+ this.isInster = false
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 批量取消出现产品
|
|
|
handleBatchCancelActive () {
|
|
|
const _this = this
|
|
@@ -446,7 +484,7 @@ export default {
|
|
|
salesBillSn: _this.salesBillSn
|
|
|
}
|
|
|
// 更换活动
|
|
|
- _this.$emit('upActive', null, '0', params)
|
|
|
+ _this.$emit('upActive', '0', params)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -463,10 +501,10 @@ export default {
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
+ deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: this.promo ? this.promo.salesPromoSn : '' }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$refs.table.refresh(true)
|
|
|
- _this.$emit('insterOk', 'promo')
|
|
|
+ _this.$emit('refash', 'promo')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.spinning = false
|
|
@@ -493,12 +531,12 @@ export default {
|
|
|
_this.spinning = true
|
|
|
salesDetailBatchDel({
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: '',
|
|
|
+ salesPromoSn: this.promo ? this.promo.salesPromoSn : '',
|
|
|
salesBillDetailSnList: obj
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$refs.table.refresh(false)
|
|
|
- _this.$emit('insterOk', 'promo')
|
|
|
+ _this.$emit('refash', 'promo')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.spinning = false
|
|
@@ -513,7 +551,7 @@ export default {
|
|
|
warehouseSn: row.warehouseSn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- salesPromoSn: ''
|
|
|
+ salesPromoSn: this.promo ? this.promo.salesPromoSn : ''
|
|
|
}
|
|
|
this.setWarehouseInfo(ajax_data)
|
|
|
},
|
|
@@ -528,7 +566,7 @@ export default {
|
|
|
warehouseSn: sn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: '',
|
|
|
+ salesPromoSn: _this.promo ? _this.promo.salesPromoSn : '',
|
|
|
allFlag: _this.warehouseTit ? true : undefined
|
|
|
}
|
|
|
_this.setWarehouseInfo(ajax_data)
|
|
@@ -541,7 +579,7 @@ export default {
|
|
|
console.log(res)
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.$emit('insterOk', 'promo')
|
|
|
+ _this.$emit('refash', 'promo')
|
|
|
}
|
|
|
_this.openWarehouseModal = false
|
|
|
_this.$refs.table.refresh(false)
|
|
@@ -574,7 +612,7 @@ export default {
|
|
|
this.$refs.updateActive.getActiveList({
|
|
|
productSn: record.productSn,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- promoRuleSn: ''
|
|
|
+ promoRuleSn: this.promo ? this.promo.promoRuleSn : ''
|
|
|
}, record)
|
|
|
this.openUpActiveModal = true
|
|
|
},
|
|
@@ -588,10 +626,10 @@ export default {
|
|
|
salesBillDetailSn: record.salesBillDetailSn,
|
|
|
qty: record.qty,
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: ''
|
|
|
+ salesPromoSn: _this.promo ? _this.promo.salesPromoSn : ''
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- _this.$emit('insterOk', 'promo')
|
|
|
+ _this.$emit('refash', 'promo')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.$refs.table.refresh(false)
|
|
@@ -612,10 +650,10 @@ export default {
|
|
|
onOk () {
|
|
|
_this.delLoading = true
|
|
|
_this.spinning = true
|
|
|
- salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
+ salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo ? _this.promo.salesPromoSn : '' }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$refs.table.refresh(false)
|
|
|
- _this.$emit('insterOk', 'promo')
|
|
|
+ _this.$emit('refash', 'promo')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.delLoading = false
|
|
@@ -630,11 +668,11 @@ export default {
|
|
|
const params = {
|
|
|
salesBillDetailSn: editRow.salesBillDetailSn,
|
|
|
salesBillSn: this.salesBillSn,
|
|
|
- oldSalesPromoSn: '',
|
|
|
+ oldSalesPromoSn: this.promo ? this.promo.salesPromoSn : '',
|
|
|
priceLevel: editRow.priceLevel
|
|
|
}
|
|
|
// 更换活动
|
|
|
- this.$emit('upActive', null, data, params)
|
|
|
+ this.$emit('upActive', data, params)
|
|
|
},
|
|
|
// 更换活动成功
|
|
|
upAcitveSuccess () {
|