|
@@ -138,7 +138,7 @@ import productNormalList from './comps/productNormalList.vue'
|
|
|
import chooseProduct from './comps/chooseProduct.vue'
|
|
|
import setPriceModal from './setPriceModal.vue'
|
|
|
import { salesDisablePromo } from '@/api/salesDetailNew'
|
|
|
-import { salesDetailBySn, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList } from '@/api/salesNew'
|
|
|
+import { salesDetailBySn, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo } from '@/api/salesNew'
|
|
|
export default {
|
|
|
name: 'SalesNewEdit',
|
|
|
mixins: [commonMixin],
|
|
@@ -186,7 +186,6 @@ export default {
|
|
|
this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
|
|
|
},
|
|
|
tooglePanel(item){
|
|
|
- console.log(1)
|
|
|
item.isActive=!item.isActive
|
|
|
this.activeList.splice()
|
|
|
},
|
|
@@ -200,16 +199,42 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 获取销售单参与的活动列表
|
|
|
- getActiveList(){
|
|
|
- salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => {
|
|
|
- if(res.status == 200){
|
|
|
- this.activeList = res.data || []
|
|
|
- this.activeList.map(item => {
|
|
|
- item.isActive = true
|
|
|
- this.activeDesKey['search-'+item.promoRuleSn] = false
|
|
|
- })
|
|
|
- }
|
|
|
+ async getActiveList(){
|
|
|
+ const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn }).then(res => res.data)
|
|
|
+ console.log(hasNewActive)
|
|
|
+ // 有新活动
|
|
|
+ if(hasNewActive.length){
|
|
|
+ this.showNewActiveModal(hasNewActive)
|
|
|
+ }
|
|
|
+ this.activeList = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
|
|
|
+ this.activeList.map(item => {
|
|
|
+ item.isActive = true
|
|
|
+ this.activeDesKey['search-'+item.promoRuleSn] = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 新活动确认弹框
|
|
|
+ showNewActiveModal(data){
|
|
|
+ let arr = []
|
|
|
+ data.map(item => {
|
|
|
+ arr.push(item.title)
|
|
|
})
|
|
|
+ this.$confirm({
|
|
|
+ title: '新活动提醒',
|
|
|
+ centered: true,
|
|
|
+ class:'confirm-center',
|
|
|
+ content: <div>
|
|
|
+ <div style="padding:10px 0;text-align:center;">
|
|
|
+ 系统发布新的促销活动:{arr.toString()}
|
|
|
+ </div>
|
|
|
+ <div style="padding:0 0 10px 0;text-align:center;">
|
|
|
+ 需要将现有产品识别到新的活动中吗?
|
|
|
+ </div>
|
|
|
+ </div>,
|
|
|
+ onOk() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onCancel() {},
|
|
|
+ });
|
|
|
},
|
|
|
// 添加产品,包括正常和活动的产品
|
|
|
closeProductModal(){
|