|
@@ -18,52 +18,83 @@
|
|
:label-col="formItemLayout.labelCol"
|
|
:label-col="formItemLayout.labelCol"
|
|
:wrapper-col="formItemLayout.wrapperCol" >
|
|
:wrapper-col="formItemLayout.wrapperCol" >
|
|
<a-row>
|
|
<a-row>
|
|
- <a-col :xs="12" :sm="24">
|
|
|
|
- <a-form-model-item label="促销名称" prop="title">
|
|
|
|
- {{ form.title }}
|
|
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="促销名称" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.promoName }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="12" :sm="24">
|
|
|
|
- <a-form-model-item label="促销时间" prop="sort">
|
|
|
|
- {{ form.sort }}
|
|
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="促销时间" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.promoStartDate }}~{{ form.promoEndDate }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="12" :sm="24">
|
|
|
|
- <a-form-model-item label="排序" prop="sort">
|
|
|
|
- {{ form.sort }}
|
|
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="排序" prop="sort" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.sort ||'--' }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :xs="24" :sm="24">
|
|
|
|
- <a-form-model-item label="参与经销商" prop="sort">
|
|
|
|
- {{ form.sort }}
|
|
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="参与经销商" prop="allDealerFlag" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.allDealerFlag=='1'?'全部经销商':'部分经销商' }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24">
|
|
<a-col :xs="24" :sm="24">
|
|
- <a-form-model-item label="封面图片" prop="imageSet">
|
|
|
|
|
|
+ <a-form-model-item label="封面图片" prop="imageUrl">
|
|
<img
|
|
<img
|
|
- :src="con"
|
|
|
|
|
|
+ :src="form.imageUrl"
|
|
alt="图片走丢了"
|
|
alt="图片走丢了"
|
|
width="80"
|
|
width="80"
|
|
height="80"
|
|
height="80"
|
|
- v-for="(con,i) in imageSet"
|
|
|
|
- style="margin-right:10px;object-fit: cover;"
|
|
|
|
- :key="i"/>
|
|
|
|
|
|
+ style="margin-right:10px;object-fit: cover;"/>
|
|
<div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
|
|
<div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
-
|
|
|
|
<a-col :xs="24" :sm="24">
|
|
<a-col :xs="24" :sm="24">
|
|
- <a-form-model-item label="促销描述" prop="ruleExplain" >
|
|
|
|
- {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
|
|
|
|
|
|
+ <a-form-model-item label="促销描述" prop="description" >
|
|
|
|
+ {{ form.description||'--' }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xs="24" :sm="24">
|
|
<a-col :xs="24" :sm="24">
|
|
- <a-form-model-item label="加盟商编辑" prop="dealerEditFlag" >
|
|
|
|
- {{ form.dealerEditFlag?form.dealerEditFlag==='1'?'是':'否':'--' }}
|
|
|
|
|
|
+ <a-form-model-item label="加盟商开关权限:" prop="dealerOpenFlag" >
|
|
|
|
+ {{ form.dealerOpenFlag?form.dealerOpenFlag==='1'?'是':'否':'--' }}
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
|
|
+ <div v-if="form.promoType==='BUY_PROD_GIVE_VALID'">
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="券名称" prop="validName" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.validName }}
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
|
+ <a-form-model-item label="券副标题" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
|
+ {{ form.validTitle ||'--' }}
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <!-- <a-col :xs="24" :sm="24">
|
|
|
|
+ <a-form-model-item label="生成方式" prop="validBaseType">
|
|
|
|
+ {{ form.validBaseTypeDictValue||'--' }}
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col> -->
|
|
|
|
+ <a-col :xs="24" :sm="24">
|
|
|
|
+ <a-form-model-item label="券有效期" prop="validType">
|
|
|
|
+ <span>{{ form.validType==='FIXED'?'固定日期':'领取后,立即生效' }}</span>
|
|
|
|
+ <span style="margin-left:10px;" v-if="form.validType==='FIXED'">{{ form.validStartDate }}~{{ form.validEndDate }}</span>
|
|
|
|
+ <span style="margin-left:10px;" v-else>有效期{{ form.validDays }}天</span>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="24">
|
|
|
|
+ <a-form-model-item label="券适用范围" prop="validScope">
|
|
|
|
+ {{ form.validScope=='1'?'全部产品':'--' }}
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="24">
|
|
|
|
+ <a-form-model-item label="使用说明">
|
|
|
|
+ {{ form.validInfo||'--' }}
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </div>
|
|
<a-col :xs="24" :sm="24">
|
|
<a-col :xs="24" :sm="24">
|
|
- <a-form-model-item label="返券产品" prop="publishFlag" >
|
|
|
|
|
|
+ <a-form-model-item :label="form.promoType==='BUY_PROD_GIVE_PROD'?'满赠规则': form.promoType==='PROMO_PROD'?'优惠方式':'返券产品'" prop="promoName" >
|
|
<div class="productTable">
|
|
<div class="productTable">
|
|
<s-table
|
|
<s-table
|
|
class="sTable"
|
|
class="sTable"
|
|
@@ -76,6 +107,17 @@
|
|
:style="{ maxHeight: 300+'px' }"
|
|
:style="{ maxHeight: 300+'px' }"
|
|
:scroll="{ y:230 }"
|
|
:scroll="{ y:230 }"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 特价产品 标题 -->
|
|
|
|
+ <template slot="titleType">
|
|
|
|
+ {{ form.promoType==='PROMO_PROD'?form.promoType==='STRAIGHT_DOWN'?'直降金额':'折扣(%)':form.promoType==='BUY_PROD_GIVE_VALID'?'返券金额':'--' }}
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 特价价格-->
|
|
|
|
+ <template slot="specialOffer" slot-scope="text,record">
|
|
|
|
+ <!-- 直降 -->
|
|
|
|
+ <span v-if="form.discountType==='STRAIGHT_DOWN'">{{ (record.shopProductPrice-record.resultValue).toFixed(2) }}</span>
|
|
|
|
+ <!-- 折扣 -->
|
|
|
|
+ <span v-else>{{ (record.shopProductPrice*record.resultValue/100).toFixed(2) }}</span>
|
|
|
|
+ </template>
|
|
</s-table>
|
|
</s-table>
|
|
</div>
|
|
</div>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
@@ -144,20 +186,11 @@ export default {
|
|
validEndDate: undefined, // 券失效时间
|
|
validEndDate: undefined, // 券失效时间
|
|
validDays: undefined, // 券有效期天数
|
|
validDays: undefined, // 券有效期天数
|
|
validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
- validInfo: '', // 使用说明
|
|
|
|
- productNum: undefined
|
|
|
|
|
|
+ validInfo: '' // 使用说明
|
|
},
|
|
},
|
|
- columns: [// 表头
|
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '活动价', dataIndex: 'price', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
|
|
|
|
- { title: '返券金额', dataIndex: 'ruleValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
|
|
|
|
- { title: '参考终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } }
|
|
|
|
- ],
|
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
rules: {
|
|
rules: {
|
|
|
|
+ promoName: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
|
|
time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
|
|
time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
|
|
sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
|
|
sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
|
|
allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
|
|
allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
|
|
@@ -168,15 +201,14 @@ export default {
|
|
validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
|
|
validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
|
|
validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
|
|
validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
|
|
validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
|
|
validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
|
|
- validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }],
|
|
|
|
- productNum: [{ required: true, message: '选择产品不能为空', trigger: ['change', 'blur'] }]
|
|
|
|
|
|
+ validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }]
|
|
},
|
|
},
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
- params.promoActiveSn = this.itemSn
|
|
|
|
|
|
+ params.promoSn = this.itemSn
|
|
// 获取详情 已选参与活动产品数据
|
|
// 获取详情 已选参与活动产品数据
|
|
return chooseProductList(params).then(res => {
|
|
return chooseProductList(params).then(res => {
|
|
let data
|
|
let data
|
|
@@ -195,6 +227,28 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const _this = this
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '商城售价', dataIndex: 'shopProductPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
|
|
|
|
+ ]
|
|
|
|
+ if (_this.form.promoType === 'BUY_PROD_GIVE_PROD') {
|
|
|
|
+ arr.splice(4, 0, { title: '买', dataIndex: 'conditionValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ arr.splice(5, 0, { title: '赠', dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ } else if (_this.form.promoType === 'PROMO_PROD') {
|
|
|
|
+ arr.splice(5, 0, { slots: { title: 'titleType' }, dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ arr.splice(6, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
|
|
|
|
+ } else {
|
|
|
|
+ arr.splice(5, 0, { slots: { title: 'titleType' }, dataIndex: 'resultValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
@@ -220,8 +274,7 @@ export default {
|
|
validEndDate: undefined, // 券失效时间
|
|
validEndDate: undefined, // 券失效时间
|
|
validDays: undefined, // 券有效期天数
|
|
validDays: undefined, // 券有效期天数
|
|
validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
- validInfo: '', // 使用说明
|
|
|
|
- productNum: undefined
|
|
|
|
|
|
+ validInfo: '' // 使用说明
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取列表详情
|
|
// 获取列表详情
|
|
@@ -229,6 +282,9 @@ export default {
|
|
shopPromoDetail({ sn: this.itemSn }).then(res => {
|
|
shopPromoDetail({ sn: this.itemSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.form = res.data
|
|
this.form = res.data
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -245,9 +301,6 @@ export default {
|
|
this.resetSearchForm()
|
|
this.resetSearchForm()
|
|
} else {
|
|
} else {
|
|
this.getDetail()
|
|
this.getDetail()
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|