|
@@ -416,11 +416,12 @@ export default {
|
|
|
},
|
|
|
// 参与经销商 change
|
|
|
changeDealerScope (val) {
|
|
|
+ console.log('1111111111', val)
|
|
|
const _this = this
|
|
|
- if (_this.pageType === 'edit') {
|
|
|
- const hasProduct = this.$refs.chooseProductList.getChooseProductNum()
|
|
|
+ if (_this.$refs.chooseProductList) {
|
|
|
+ const hasProduct = _this.$refs.chooseProductList.getChooseProductNum()
|
|
|
if (hasProduct > 0) {
|
|
|
- this.$confirm({
|
|
|
+ _this.$confirm({
|
|
|
title: '提示',
|
|
|
content: <div>变更【参与经销商】后将会【<span style="color:red">清空</span>】已选产品列表,确定变更吗?</div>,
|
|
|
centered: true,
|
|
@@ -439,7 +440,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
_this.form.allDealerFlag = val
|
|
|
- if (val == '1') {
|
|
|
+ if (val == '1' || !val) {
|
|
|
_this.chooseDealerList = []
|
|
|
}
|
|
|
},
|
|
@@ -456,11 +457,11 @@ export default {
|
|
|
// 部分经销商 选择经销商成功
|
|
|
addDealerOk (list) {
|
|
|
const _this = this
|
|
|
- if (_this.pageType === 'edit') {
|
|
|
- const hasProduct = this.$refs.chooseProductList.getChooseProductNum()
|
|
|
+ if (_this.$refs.chooseProductList) {
|
|
|
+ const hasProduct = _this.$refs.chooseProductList.getChooseProductNum()
|
|
|
const hasEq = list.filter(item => !this.chooseDealerList.map(k => k.dealerSn).includes(item.dealerSn))
|
|
|
if (hasEq.length > 0 && hasProduct > 0) {
|
|
|
- this.$confirm({
|
|
|
+ _this.$confirm({
|
|
|
title: '提示',
|
|
|
content: <div>变更【参与经销商】后将会【<span style="color:red">清空</span>】已选产品列表,确定变更吗?</div>,
|
|
|
centered: true,
|
|
@@ -576,7 +577,6 @@ export default {
|
|
|
const endTime = res.data.promoEndDate.split(' ')[0]
|
|
|
res.data.time = [startTime, endTime]
|
|
|
}
|
|
|
- console.log('111111111:', res.data.imageUrl, _this.$refs)
|
|
|
if (res.data.imageUrl) {
|
|
|
_this.$refs.imageSet.setFileList(res.data.imageUrl)
|
|
|
}
|