|
@@ -15,7 +15,7 @@
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="参与客户:">
|
|
|
<span v-if="detailsData.buyerLimitEnable=='0'">全部客户</span>
|
|
|
- <p v-else style="margin: 0;">部分客户,共{{ detailsData.promoBuyerList.length }}个 <a-button id="promotionRules-rule-normalGoodsList" type="primary" size="small" class="button-success" @click="handleLook">查看</a-button></p>
|
|
|
+ <p v-else style="margin: 0;">部分客户,共{{ detailsData.promoBuyerList.length }}个 <a-button id="promotionRules-rule-normalGoodsList" type="primary" size="small" class="button-success" @click="handleLook(detailsData.promoBuyerList)">查看</a-button></p>
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="活动经费上限:">
|
|
|
<span v-if="detailsData.activeAmountEnable=='0'">不限</span>
|
|
@@ -28,7 +28,70 @@
|
|
|
<a-descriptions-item label="备注:">{{ detailsData.remark || '--' }}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
<a-divider />
|
|
|
+ <!-- 列表 -->
|
|
|
+ <p style="font-weight: bold;">促销规则:</p>
|
|
|
+ <a-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data-source="promoRuleList"
|
|
|
+ :pagination="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ v-if="record.promoRuleType!='PROMO_PROD'"
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-info"
|
|
|
+ @click="handleLookP(record.normalGoodsList, 'normal')"
|
|
|
+ id="promotionRulesDetail-edit-btn">查看正价品</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleLookP(record.promoGoodsList, 'promo')"
|
|
|
+ id="promotionRulesDetail-del-btn">查看{{ record.promoRuleType=='PROMO_PROD' ? '特价品' : record.promoRuleType=='ADD_PRICE_PURCH' ? '换购品' : '促销品' }}</a-button>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
</a-card>
|
|
|
+ <!-- 查看客户/正价品/促销品 -->
|
|
|
+ <a-modal
|
|
|
+ centered
|
|
|
+ class="promotionRulesDetail-look-modal"
|
|
|
+ :footer="null"
|
|
|
+ :maskClosable="false"
|
|
|
+ title="查看"
|
|
|
+ v-model="openModal"
|
|
|
+ @cancle="openModal = false"
|
|
|
+ width="80%">
|
|
|
+ <a-table
|
|
|
+ ref="lookTable"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="nowColumns"
|
|
|
+ :data-source="lookLoadData"
|
|
|
+ :pagination="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 序号 -->
|
|
|
+ <template slot="no" slot-scope="text, record, index">{{ index+1 }}</template>
|
|
|
+ <!-- 起订量限制 -->
|
|
|
+ <template slot="orderGoodsUnit" slot-scope="text, record">
|
|
|
+ {{ record.orderGoodsUnit=='PROD_UNIT' ? '按设置数量':record.orderGoodsUnit=='FULL_BOX' ? '按整箱':'--' }}
|
|
|
+ <span v-if="record.orderGoodsUnit=='PROD_UNIT'"> -- {{ record.orderGoodsQty }}</span>
|
|
|
+ </template>
|
|
|
+ <!-- 自定义表头 -->
|
|
|
+ <template slot="goodsPriceTit" slot-scope="text, record">
|
|
|
+ {{ record.orderGoodsUnit == 'PROMO_PROD' ? '特惠单价(¥)' : '换购单价(¥)' }}
|
|
|
+ </template>
|
|
|
+ <template slot="goodsPrice" slot-scope="text, record">
|
|
|
+ <span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </a-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -37,7 +100,44 @@ import { promoActiveDetailD } from '@/api/promoActive'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
- detailsData: null
|
|
|
+ detailsData: null,
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
+ { title: '促销类型', dataIndex: 'promoRuleTypeDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '促销规则', dataIndex: 'promoRule', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
|
|
|
+ ],
|
|
|
+ loadData: [],
|
|
|
+ openModal: false,
|
|
|
+ custColumns: [
|
|
|
+ { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center' },
|
|
|
+ { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ],
|
|
|
+ pColumns: [ // 正品
|
|
|
+ { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center', fixed: 'left' },
|
|
|
+ { title: '类型', dataIndex: 'goodsTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '类型名称', dataIndex: 'goodsName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '起订量限制', scopedSlots: { customRender: 'orderGoodsUnit' }, align: 'center' }
|
|
|
+ ],
|
|
|
+ promoColumns: [ // 促销品
|
|
|
+ { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center', fixed: 'left' },
|
|
|
+ { title: '类型', dataIndex: 'goodsTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '类型名称', dataIndex: 'goodsName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ],
|
|
|
+ promoSpecialColumns: [ // 特价产品/加价促销品
|
|
|
+ { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { slots: { title: 'goodsPriceTit' }, scopedSlots: { customRender: 'goodsPrice' }, width: 200, align: 'center' }
|
|
|
+ ],
|
|
|
+ lookLoadData: [],
|
|
|
+ promoRuleList: [],
|
|
|
+ nowColumns: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -47,16 +147,75 @@ export default {
|
|
|
promoActiveDetailD({ sn: this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.detailsData = res.data
|
|
|
+ if (_this.detailsData.promoRuleList) {
|
|
|
+ _this.detailsData.promoRuleList.map((item, index) => {
|
|
|
+ item.no = index + 1
|
|
|
+ if (item.promoRuleType == 'BUY_PROD_GIVE_PROD') { // 买产品送产品
|
|
|
+ item.promoRule = '购买满' + item.orderGoodsQty + '个正价产品,送' + item.promoQty + '个促销品'
|
|
|
+ } else if (item.promoRuleType == 'BUY_PROD_GIVE_MONEY') { // 买产品送采购额
|
|
|
+ if (item.orderRuleType == 'prod_qty') {
|
|
|
+ item.promoRule = '购买满' + item.orderAmount + '元正价产品,送' + item.promoAmount + '元采购额可用于购买促销品'
|
|
|
+ } else if (item.orderRuleType == 'order_amount') {
|
|
|
+ item.promoRule = '购买满' + item.orderAmount + '元正价产品可以返正价产品采购额的' + item.promoAmountPer * 100 + '%用于购买促销品'
|
|
|
+ }
|
|
|
+ } else if (item.promoRuleType == 'ADD_PRICE_PURCH') { // 加价换购
|
|
|
+ item.promoRule = '购买满' + item.orderGoodsQty + '个正价产品,可以以换购价购买任意1个换购产品'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.detailsData.promoRuleList = []
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 查看客户
|
|
|
- handleLook () {},
|
|
|
+ handleLook (record) {
|
|
|
+ this.nowColumns = this.custColumns
|
|
|
+ this.lookLoadData = record || []
|
|
|
+ this.openModal = true
|
|
|
+ },
|
|
|
+ // 查看正价品/促销品
|
|
|
+ handleLookP (record, goodsType) {
|
|
|
+ let columns = this.pColumns
|
|
|
+ if ((record.promoRuleType == 'BUY_PROD_GIVE_PROD') || (record.promoRuleType == 'BUY_PROD_GIVE_MONEY')) { // 买产品送产品/买产品送采购额
|
|
|
+ if (goodsType == 'normal') { // 正品
|
|
|
+ columns = this.columns
|
|
|
+ } else if (goodsType == 'promo') { // 促销
|
|
|
+ columns = this.promoColumns
|
|
|
+ }
|
|
|
+ } else if (record.promoRuleType == 'PROMO_PROD') { // 特价产品
|
|
|
+ if (goodsType == 'promo') { // 促销
|
|
|
+ columns = this.promoSpecialColumns
|
|
|
+ }
|
|
|
+ } else if (record.promoRuleType == 'ADD_PRICE_PURCH') { // 加价换购
|
|
|
+ if (goodsType == 'normal') { // 正品
|
|
|
+ columns = this.columns
|
|
|
+ } else if (goodsType == 'promo') { // 促销
|
|
|
+ columns = this.promoSpecialColumns
|
|
|
+ }
|
|
|
+ }
|
|
|
+ record.map(item => {
|
|
|
+ item.name = item.goodsName
|
|
|
+ })
|
|
|
+ this.nowColumns = columns
|
|
|
+ this.lookLoadData = record || []
|
|
|
+ this.openModal = true
|
|
|
+ },
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/promotionRulesManagement/promotionRules/list' })
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ detailsData: {
|
|
|
+ handler (newValue, oldValue) {
|
|
|
+ if (newValue.promoRuleList) {
|
|
|
+ this.promoRuleList = newValue.promoRuleList
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
vm.getDetail()
|