|
@@ -540,17 +540,33 @@ export default {
|
|
// 批量取消出现产品
|
|
// 批量取消出现产品
|
|
handleBatchCancelActive () {
|
|
handleBatchCancelActive () {
|
|
const _this = this
|
|
const _this = this
|
|
- if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
|
|
|
+ const len = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length
|
|
|
|
+ if (!_this.rowSelectionInfo || (len < 1)) {
|
|
_this.$message.warning('请先选择产品后再进行批量操作!')
|
|
_this.$message.warning('请先选择产品后再进行批量操作!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
const obj = []
|
|
const obj = []
|
|
|
|
+ const gift = []
|
|
_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
- obj.push(item.salesBillDetailSn)
|
|
|
|
|
|
+ // 赠品
|
|
|
|
+ if (item.promotionFlag == 'GIFT') {
|
|
|
|
+ gift.push(item.productCode)
|
|
|
|
+ } else {
|
|
|
|
+ obj.push(item.salesBillDetailSn)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+ if (gift.length == len) {
|
|
|
|
+ this.$info({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '所选全部为赠品,其不能转为正常产品!',
|
|
|
|
+ centered: true,
|
|
|
|
+ okText: '知道了'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: '已选产品' + obj.length + '项,确认要批量取消促销转为正常产品吗?',
|
|
|
|
|
|
+ content: '已选产品' + len + '项,' + (gift.length ? '其中包含赠品' + gift.join(',') + '(赠品不能转正常产品),确认要继续批量取消促销转为正常产品吗?' : '确认要批量取消促销转为正常产品吗?'),
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
_this.spinning = true
|
|
_this.spinning = true
|