|
@@ -40,20 +40,20 @@
|
|
:bordered="false"
|
|
:bordered="false"
|
|
class="salesEdit-cont"
|
|
class="salesEdit-cont"
|
|
v-for="item in activeList"
|
|
v-for="item in activeList"
|
|
- :key="item.activeId"
|
|
|
|
|
|
+ :key="item.promoRuleSn"
|
|
>
|
|
>
|
|
<div slot="title" style="display: inline-block;width:100%;">
|
|
<div slot="title" style="display: inline-block;width:100%;">
|
|
- <strong style="margin-right:10px;font-size:14px;">{{item.activeName}}</strong> ({{item.activeDesc}})
|
|
|
|
- <span style="margin-left:20px;color:#00aaff;cursor: pointer;" @click="(event) => {showDesc(event, item.activeId)}">
|
|
|
|
|
|
+ <strong style="margin-right:10px;font-size:14px;">{{item.promotion.title}}</strong> ({{item.promotion.description}})
|
|
|
|
+ <span style="margin-left:20px;color:#00aaff;cursor: pointer;" @click="(event) => {showDesc(event, item)}">
|
|
<a-icon title="查看活动详情" type="eye"/> 活动详情
|
|
<a-icon title="查看活动详情" type="eye"/> 活动详情
|
|
</span>
|
|
</span>
|
|
- <span style="margin:0 20px;color:#ff0800;cursor: pointer;" @click="(event) => {disabledActive(event, item.activeId)}">
|
|
|
|
|
|
+ <span style="margin:0 20px;color:#ff0800;cursor: pointer;" @click="(event) => {disabledActive(event, item.promoRuleSn)}">
|
|
<a-icon title="禁用规则" type="disconnect"/> 禁用规则
|
|
<a-icon title="禁用规则" type="disconnect"/> 禁用规则
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
|
|
<div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
|
|
<div v-show="item.isActive" style="padding: 10px;">
|
|
<div v-show="item.isActive" style="padding: 10px;">
|
|
- <productList :ref="'productList-'+item.activeId" :id="item.activeId" @openCpModal="openProductModal" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productList>
|
|
|
|
|
|
+ <productList :ref="'productList-'+item.promoRuleSn" :id="item.promoRuleSn" @openCpModal="openProductModal" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productList>
|
|
</div>
|
|
</div>
|
|
</a-card>
|
|
</a-card>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -126,7 +126,7 @@ import productList from './comps/productList.vue'
|
|
import productNormalList from './comps/productNormalList.vue'
|
|
import productNormalList from './comps/productNormalList.vue'
|
|
import chooseProduct from './comps/chooseProduct.vue'
|
|
import chooseProduct from './comps/chooseProduct.vue'
|
|
import setPriceModal from './setPriceModal.vue'
|
|
import setPriceModal from './setPriceModal.vue'
|
|
-import { salesDetailBySn, salesWriteSubmit, submitCheck, updateBatch } from '@/api/sales'
|
|
|
|
|
|
+import { salesDetailBySn, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList } from '@/api/salesNew'
|
|
export default {
|
|
export default {
|
|
name: 'SalesNewEdit',
|
|
name: 'SalesNewEdit',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -185,9 +185,22 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.detailData = res.data
|
|
this.detailData = res.data
|
|
}
|
|
}
|
|
- this.getActive()
|
|
|
|
|
|
+ this.getActiveList()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 获取销售单参与的活动列表
|
|
|
|
+ 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
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 添加产品,包括正常和活动的产品
|
|
closeProductModal(){
|
|
closeProductModal(){
|
|
this.cpModalType = 0
|
|
this.cpModalType = 0
|
|
this.cpCurRefId = ''
|
|
this.cpCurRefId = ''
|
|
@@ -267,10 +280,10 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 展开收缩活动详情
|
|
// 展开收缩活动详情
|
|
- showDesc(e,id){
|
|
|
|
|
|
+ showDesc(e,item){
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
- const row = this.$refs['productList-'+id][0]
|
|
|
|
- row&&row.showDesc()
|
|
|
|
|
|
+ const row = this.$refs['productList-'+item.promoRuleSn][0]
|
|
|
|
+ row&&row.showDesc(item.promotionRule)
|
|
},
|
|
},
|
|
// 禁用活动
|
|
// 禁用活动
|
|
disabledActive(e,id){
|
|
disabledActive(e,id){
|
|
@@ -309,35 +322,6 @@ export default {
|
|
console.log(e)
|
|
console.log(e)
|
|
this.disabledActiveOption = e.target.value
|
|
this.disabledActiveOption = e.target.value
|
|
},
|
|
},
|
|
- // 获取活动列表
|
|
|
|
- getActive(){
|
|
|
|
- this.activeList = [
|
|
|
|
- {
|
|
|
|
- activeId: '102312313',
|
|
|
|
- activeName: "520以爱之名保护你",
|
|
|
|
- activeDesc: "满5000赠300"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- activeId: '02342341',
|
|
|
|
- activeName: "夏季清爽502优惠活动",
|
|
|
|
- activeDesc: "满8000减500"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- activeId: '22558888',
|
|
|
|
- activeName: "国庆10天热门活动",
|
|
|
|
- activeDesc: "满5000减300"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- activeId: '856688774',
|
|
|
|
- activeName: "春节滤清器特价活动",
|
|
|
|
- activeDesc: "滤清器8款特价产品优惠"
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- this.activeList.map(item => {
|
|
|
|
- item.isActive = true
|
|
|
|
- this.activeDesKey['search-'+item.activeId] = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
pageInit () {
|
|
pageInit () {
|
|
this.salesBillSn = this.$route.params.sn
|
|
this.salesBillSn = this.$route.params.sn
|
|
this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
|
|
this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
|