|
@@ -17,108 +17,104 @@
|
|
|
:rules="rules"
|
|
|
:label-col="formItemLayout.labelCol"
|
|
|
:wrapper-col="formItemLayout.wrapperCol" >
|
|
|
- <a-form-model-item label="标题" prop="title">
|
|
|
- {{ form.title }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="排序" prop="sort">
|
|
|
- {{ form.sort }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="封面图片" prop="imageSet">
|
|
|
- <img
|
|
|
- :src="con"
|
|
|
- alt="图片走丢了"
|
|
|
- width="80"
|
|
|
- height="80"
|
|
|
- v-for="(con,i) in imageSet"
|
|
|
- style="margin-right:10px;object-fit: cover;"
|
|
|
- :key="i"/>
|
|
|
- <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="内容类型" prop="contentType">
|
|
|
- {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':'跳转链接' }}
|
|
|
- </a-form-model-item>
|
|
|
- <div v-if="form.contentType==='IMAGE_CONTENT'">
|
|
|
- <a-form-model-item label="内容" prop="content" >
|
|
|
- <div class="box" v-html="form.content"></div>
|
|
|
- </a-form-model-item>
|
|
|
- </div>
|
|
|
- <div v-if="form.contentType==='VIDEO'">
|
|
|
- <a-form-model-item label="内容" prop="content" >
|
|
|
- <video
|
|
|
- ref="videoPlayer"
|
|
|
- width="230"
|
|
|
- height="150"
|
|
|
- controls
|
|
|
- loop
|
|
|
- controlsList="nodownload">
|
|
|
- <source :src="form.content" type="video/mp4">
|
|
|
- </video>
|
|
|
- </a-form-model-item>
|
|
|
- </div>
|
|
|
- <div v-if="form.contentType==='LINK'">
|
|
|
- <a-form-model-item label="内容" prop="ruleType">
|
|
|
- {{ form.content }}
|
|
|
- </a-form-model-item>
|
|
|
- </div>
|
|
|
- <div v-show="form.contentType==='LINK'&&form.content === '/pagesB/promoDetail'">
|
|
|
- <a-form-model-item label="基本规则" prop="ruleType">
|
|
|
- {{ form.promoRule&&form.promoRule.ruleType?form.promoRule.ruleType==='ticket'?'指定产品返代金券':'--':'--' }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="券名称" prop="ruleName">
|
|
|
- {{ form.promoRule&&form.promoRule.ruleName?form.promoRule.ruleName:'--' }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="券副标题" prop="ruleTitle">
|
|
|
- {{ form.promoRule&&form.promoRule.ruleTitle?form.promoRule.ruleTitle:'--' }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="生成方式" prop="ruleBaseType">
|
|
|
- {{ form.promoRule&&form.promoRule.ruleBaseType?form.promoRule.ruleBaseType==='bill'?'按订单生成券':'按订单产品款数生成券':'--' }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="券有效期" prop="validType" >
|
|
|
- <span>
|
|
|
- {{ form.promoRule&&form.promoRule.validType?form.promoRule.validType==='FIXED'?'固定日期':'领取后,立即生效,':'--' }}
|
|
|
- </span>
|
|
|
- <span class="timeBox" v-if="form.promoRule&&form.promoRule.validType&&form.promoRule.validType==='FIXED'">{{ form.promoRule.validStartDate }}~{{ form.promoRule.validEndDate }}</span>
|
|
|
- <span class="timeBox" v-else>有效期{{ form.promoRule&&form.promoRule.validDays?form.promoRule.validDays:'--' }}天</span>
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="券适用范围" prop="range" >
|
|
|
- 全部产品
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="使用说明" prop="ruleExplain" >
|
|
|
- {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="产品范围" prop="productRangeList" >
|
|
|
- <div v-if="productRangeList&&productRangeList.length>0" style="margin-bottom:10px;">
|
|
|
- <a-tree-select
|
|
|
- v-model="productRangeList"
|
|
|
- :tree-data="productTypeList"
|
|
|
- tree-checkable
|
|
|
- :disabled="true"
|
|
|
- :getPopupContainer="triggerNode => triggerNode.parentNode"
|
|
|
- :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
|
|
|
- placeholder="请选择产品范围" />
|
|
|
- </div>
|
|
|
- <div v-else>--</div>
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="返券产品" prop="publishFlag" >
|
|
|
- <div class="productTable">
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
- size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :defaultLoadData="false"
|
|
|
- :style="{ maxHeight: 300+'px' }"
|
|
|
- :scroll="{ y:230 }"
|
|
|
- bordered>
|
|
|
- </s-table>
|
|
|
- </div>
|
|
|
- </a-form-model-item>
|
|
|
- </div>
|
|
|
+ <a-row>
|
|
|
+ <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-col>
|
|
|
+ <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-col>
|
|
|
+ <a-col :xs="12" :sm="12">
|
|
|
+ <a-form-model-item label="排序" prop="sort" :label-col="{span:8}" :wrapper-col="{span:14}">
|
|
|
+ {{ form.sort||form.sort==0?form.sort:'--' }}
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <!-- <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-col> -->
|
|
|
+ <a-col :xs="24" :sm="24">
|
|
|
+ <a-form-model-item label="封面图片" prop="imageUrl">
|
|
|
+ <img
|
|
|
+ :src="form.imageUrl"
|
|
|
+ alt="图片走丢了"
|
|
|
+ width="80"
|
|
|
+ height="80"
|
|
|
+ style="margin-right:10px;object-fit: cover;"/>
|
|
|
+ <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xs="24" :sm="24">
|
|
|
+ <a-form-model-item label="促销描述" prop="description" >
|
|
|
+ {{ form.description||'--' }}
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <!-- <a-col :xs="24" :sm="24">
|
|
|
+ <a-form-model-item label="加盟商开关权限:" prop="dealerOpenFlag" >
|
|
|
+ {{ form.dealerOpenFlag?form.dealerOpenFlag==='1'?'是':'否':'--' }}
|
|
|
+ </a-form-model-item>
|
|
|
+ </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-form-model-item :label="form.promoType==='BUY_PROD_GIVE_PROD'?'满赠规则': form.promoType==='PROMO_PROD'?'优惠方式':'返券产品'" prop="promoName" >
|
|
|
+ <div class="productTable">
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :style="{ maxHeight: 300+'px' }"
|
|
|
+ :scroll="{ y:230 }"
|
|
|
+ bordered>
|
|
|
+ </s-table>
|
|
|
+ </div>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</a-form-model>
|
|
|
<div class="btn-cont">
|
|
|
- <a-button id="promotion-basicInfo-modal-back" @click="isShow = false">关闭</a-button>
|
|
|
+ <a-button id="promotion-basicInfo-modal-close" @click="isShow = false">关闭</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-spin>
|
|
@@ -127,9 +123,10 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+// 组件
|
|
|
import { STable } from '@/components'
|
|
|
-import { productTypeQuery } from '@/api/productType'
|
|
|
-import { promoActiveDetail, promoRuleProductList } from '@/api/promoActive'
|
|
|
+// 接口
|
|
|
+import { shopPromoDetail, shopPromoProductList } from '@/api/shopPromo'
|
|
|
|
|
|
export default {
|
|
|
name: 'DetailModal',
|
|
@@ -140,7 +137,7 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- itemSn: {
|
|
|
+ itemSn: {// 活动sn
|
|
|
type: String,
|
|
|
default: ''
|
|
|
}
|
|
@@ -149,72 +146,64 @@ export default {
|
|
|
return {
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
spinning: false,
|
|
|
+ // form表单label布局
|
|
|
formItemLayout: {
|
|
|
labelCol: { span: 4 },
|
|
|
wrapperCol: { span: 18 }
|
|
|
},
|
|
|
- productTypeList: [],
|
|
|
- productRangeList: [],
|
|
|
+ productTypeList: [], // 产品范围数据
|
|
|
+ productRangeList: [], // 已选产品范围
|
|
|
form: {
|
|
|
- promoActiveSn: undefined, // 促销活动sn
|
|
|
- title: '', // 标题
|
|
|
- imageSet: '', // 图片
|
|
|
- contentType: 'IMAGE_CONTENT', // 内容类型
|
|
|
- content: '', // 内容
|
|
|
- contentLink: '', // 链接内容
|
|
|
+ promoType: undefined, // 促销类型
|
|
|
+ promoName: '', // '促销名称'
|
|
|
+ time: [], // 促销时间
|
|
|
+ promoStartDate: undefined, // 促销时间-开始
|
|
|
+ promoEndDate: undefined, // 促销时间-结束
|
|
|
sort: undefined, // 排序
|
|
|
- ruleEnableFlag: '1', // 参数配置 1勾选配置 0不能配置
|
|
|
- publishFlag: '0',
|
|
|
- dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
|
- promoRule: {
|
|
|
- ruleType: 'ticket', // 基本规则类型
|
|
|
- productRangeFlag: '', // 产品范围标记 0无 1有产品范围
|
|
|
- productRangeList: [], // 产品范围列表
|
|
|
- ruleName: '', // 券名称
|
|
|
- ruleTitle: '', // 副标题
|
|
|
- ruleBaseType: 'category', // 券生成方式
|
|
|
- ruleExplain: '', // 使用说明
|
|
|
- validType: undefined, // 券有效期类型
|
|
|
- validStartDate: undefined, // 券生效时间
|
|
|
- validEndDate: undefined, // 券失效时间
|
|
|
- validDays: undefined, // 券有效期天数
|
|
|
- range: '1'
|
|
|
- }
|
|
|
+ allDealerFlag: '1', // 全部经销商 1 部分经销商0'
|
|
|
+ imageUrl: undefined, // 促销封面图
|
|
|
+ description: '', // '促销描述'
|
|
|
+ dealerEditFlag: '0', // 加盟商编辑 0否 1是
|
|
|
+ dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
|
|
|
+ rangeList: [], // 选择产品列表
|
|
|
+ discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
|
|
|
+ validName: '', // 券名称
|
|
|
+ validTitle: '', // 券副标题
|
|
|
+ validBaseType: undefined, // 券生成方式
|
|
|
+ validType: undefined, // 券有效期类型
|
|
|
+ validStartDate: undefined, // 券生效时间
|
|
|
+ validEndDate: undefined, // 券失效时间
|
|
|
+ validDays: undefined, // 券有效期天数
|
|
|
+ validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
|
+ validInfo: '' // 使用说明
|
|
|
},
|
|
|
- imageSet: [],
|
|
|
- columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '10%', 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: '12%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
|
|
|
- { title: '返券金额', dataIndex: 'ruleValue', width: '12%', 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: {
|
|
|
- title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
|
|
|
- imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
|
|
|
+ promoName: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
|
|
|
+ time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
|
|
|
sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
|
|
|
- contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
|
|
|
- content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
|
|
|
- contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
|
|
|
- range: [{ required: true, message: '请选择券适用范围', trigger: 'change' }],
|
|
|
- ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
|
|
|
- ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
|
|
|
- ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
|
|
|
+ allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
|
|
|
+ imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
|
|
|
+ description: [{ required: true, message: '请输入促销描述内容', trigger: 'blur' }],
|
|
|
+ dealerOpenFlag: [{ required: true, message: '请选择加盟商开关权限', trigger: 'change' }],
|
|
|
+ rangeList: [{ required: true, message: '请选择促销产品', trigger: 'change' }],
|
|
|
+ validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
|
|
|
+ validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
|
|
|
validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
|
|
|
- ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
|
|
|
+ validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }]
|
|
|
},
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
- params.promoActiveSn = this.itemSn
|
|
|
- return promoRuleProductList(params).then(res => {
|
|
|
+ params.promoSn = this.itemSn
|
|
|
+ // 获取详情 已选参与活动产品数据
|
|
|
+ return shopPromoProductList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
+ // 计算表格序号
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
@@ -227,68 +216,63 @@ 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: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '28%', 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: '8%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
+ arr.splice(5, 0, { title: '赠', dataIndex: 'resultValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
+ } else if (_this.form.promoType === 'PROMO_PROD') {
|
|
|
+ arr.splice(5, 0, { title: '特价价格', dataIndex: 'conditionValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ } else {
|
|
|
+ arr.splice(5, 0, { title: '返券金额', dataIndex: 'resultValue', width: '10%', align: 'center', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ }
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.form = {
|
|
|
- promoActiveSn: undefined, // 促销活动sn
|
|
|
- title: '', // 标题
|
|
|
- imageSet: '', // 图片
|
|
|
- contentType: 'IMAGE_CONTENT', // 内容类型
|
|
|
- content: '', // 内容
|
|
|
- contentLink: '', // 链接内容
|
|
|
+ promoType: undefined, // 促销类型
|
|
|
+ promoName: '', // '促销名称'
|
|
|
+ time: [], // 促销时间
|
|
|
+ promoStartDate: undefined, // 促销时间-开始
|
|
|
+ promoEndDate: undefined, // 促销时间-结束
|
|
|
sort: undefined, // 排序
|
|
|
- ruleEnableFlag: '1', // 参数配置 1勾选配置 0不能配置
|
|
|
- publishFlag: '0',
|
|
|
- dealerEditFlag: '0', // 加盟商编辑 1是 0否
|
|
|
- promoRule: {
|
|
|
- ruleType: 'ticket', // 基本规则类型
|
|
|
- productRangeFlag: '', // 产品范围标记 0无 1有产品范围
|
|
|
- productRangeList: [], // 产品范围列表
|
|
|
- ruleName: '', // 券名称
|
|
|
- ruleTitle: '', // 副标题
|
|
|
- ruleBaseType: 'category', // 券生成方式
|
|
|
- ruleExplain: '', // 使用说明
|
|
|
- validType: undefined, // 券有效期类型
|
|
|
- validStartDate: undefined, // 券生效时间
|
|
|
- validEndDate: undefined, // 券失效时间
|
|
|
- validDays: undefined, // 券有效期天数
|
|
|
- range: '1'
|
|
|
- }
|
|
|
+ allDealerFlag: '1', // 全部经销商 1 部分经销商0'
|
|
|
+ imageUrl: undefined, // 促销封面图
|
|
|
+ description: '', // '促销描述'
|
|
|
+ dealerEditFlag: '0', // 加盟商编辑 0否 1是
|
|
|
+ dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
|
|
|
+ rangeList: [], // 选择产品列表
|
|
|
+ discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
|
|
|
+ validName: '', // 券名称
|
|
|
+ validTitle: '', // 券副标题
|
|
|
+ validBaseType: undefined, // 券生成方式
|
|
|
+ validType: undefined, // 券有效期类型
|
|
|
+ validStartDate: undefined, // 券生效时间
|
|
|
+ validEndDate: undefined, // 券失效时间
|
|
|
+ validDays: undefined, // 券有效期天数
|
|
|
+ validScope: '1', // 券适用范围标记 1-全部 0-指定 死值 1
|
|
|
+ validInfo: '' // 使用说明
|
|
|
}
|
|
|
- this.imageSet = []
|
|
|
- this.productRangeList = []
|
|
|
},
|
|
|
// 获取列表详情
|
|
|
getDetail () {
|
|
|
- promoActiveDetail({ sn: this.itemSn }).then(res => {
|
|
|
+ shopPromoDetail({ sn: this.itemSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- if (res.data.contentType === 'LINK') {
|
|
|
- console.log('加载产品范围')
|
|
|
- this.$nextTick(() => {
|
|
|
- this.getTreeData()
|
|
|
- })
|
|
|
- if (res.data.promoRule && res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
|
|
|
- this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
|
|
|
- } else {
|
|
|
- this.productRangeList = []
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.images) {
|
|
|
- this.form.imageSet = res.data.images
|
|
|
- this.imageSet = res.data.images.split(',')
|
|
|
- }
|
|
|
this.form = res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取产品范围数据
|
|
|
- getTreeData () {
|
|
|
- productTypeQuery({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productTypeList = res.data
|
|
|
- } else {
|
|
|
- this.productTypeList = []
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -305,9 +289,6 @@ export default {
|
|
|
this.resetSearchForm()
|
|
|
} else {
|
|
|
this.getDetail()
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|