123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734 |
- <template>
- <div style="padding:10px;">
- <a-spin :spinning="spinning" tip="Loading...">
- <ve-table
- style="width:100%"
- :max-height="300"
- :scroll-width="0"
- border-y
- border-x
- border-around
- row-key-field-name="salesPromoSn"
- :checkbox-option="checkboxOption"
- :column-width-resize-option="columnWidthResizeOption"
- :cell-style-option="cellStyleOption"
- :row-style-option="{clickHighlight: true}"
- :cellSelectionOption="{enable: false}"
- :virtual-scroll-option="{enable: false}"
- :columns="columns"
- :table-data="tableData" />
- </a-spin>
- <!-- 活动规则详情 -->
- <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
- <!-- 导入产品 -->
- <importGuideModal
- ref="importGuideModal"
- :openModal="openGuideModal"
- @close="closeGuideModel"
- @ok="hanldeImportOk" />
- <!-- 查看累计产品 -->
- <totalProductDetailModal ref="totalProductModal" :show="openTotalProductModal" @close="openTotalProductModal=false"></totalProductDetailModal>
- <!-- 查看买赠产品详情 -->
- <normalProductDetailModal ref="normalProductModal" :buyGiftsInfo="buyGiftsInfo" :openModal="openNormalProductModal" @close="openNormalProductModal=false"></normalProductDetailModal>
- </div>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
- import totalProductDetailModal from './totalProductDetailModal.vue'
- import normalProductDetailModal from './normalProductDetailModal.vue'
- import ImportGuideModal from './importGuideModal.vue'
- import { salesDisablePromo, salesEnablePromoPromo, salesBatchInsert, importBorrowTotalProduct } from '@/api/salesDetailNew'
- export default {
- mixins: [commonMixin],
- components: { detailModal, ImportGuideModal, totalProductDetailModal, normalProductDetailModal },
- props: {
- activeList: {
- type: Array,
- default: () => []
- },
- // 仓库sn
- warehouseSn: {
- type: String,
- default: ''
- },
- // 销售单sn
- salesBillSn: {
- type: String,
- default: ''
- }
- },
- watch: {
- activeList: {
- handler (val) {
- if (!this.hasInit) {
- this.getDataList()
- }
- },
- immediate: true
- }
- },
- data () {
- const _this = this
- // 格式化数字金额单元格
- const formatTd = (row, column, rowIndex, uniKey, fun) => {
- if (row[column.field]) {
- return (<div><span onClick={() => fun ? fun(row) : false}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
- } else {
- return ''
- }
- }
- return {
- hasInit: false,
- spinning: false,
- // 表格列宽拖到
- columnWidthResizeOption: {
- // default false
- enable: true,
- // column resize min width
- minWidth: 50
- },
- openTotalProductModal: false, // 查看累计产品
- openNormalProductModal: false, // 查看买赠产品详情
- // 表格复选框
- checkboxOption: {
- hideSelectAll: true,
- selectedRowKeys: [],
- // 禁用的选择(禁止勾选或者禁止取消勾选)
- disableSelectedRowKeys: [],
- // 行选择改变事件
- selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
- // 当前勾选产品
- const endSelProduct = selectedRowKeys[selectedRowKeys.length - 1]
- // 叠加多选
- if (endSelProduct && row.promotion && row.promotion.stackFlag == '1') {
- const rows = this.activeList.filter(item => selectedRowKeys.includes(item.salesPromoSn) && item.promotion && item.promotion.stackFlag == '1')
- this.checkboxOption.selectedRowKeys = rows.map(item => item.salesPromoSn)
- } else {
- // 非叠加单选
- this.checkboxOption.selectedRowKeys = isSelected ? [endSelProduct] : []
- }
- // 查询此活动下的已选产品列表
- this.$emit('selected', isSelected ? this.checkboxOption.selectedRowKeys : null)
- }
- },
- // 单元格样式
- cellStyleOption: {
- headerCellClass: ({ column, rowIndex }) => {
- if (column.field == 'col2' || column.field == 'col3' || column.field == 'col4') {
- return 'table-header-cell-blue'
- }
- if (column.field == 'col6' || column.field == 'col7' || column.field == 'col8' || column.field == 'col9') {
- return 'table-header-cell-red'
- }
- if (column.field == 'col11' || column.field == 'col12' || column.field == 'col13') {
- return 'table-header-cell-green'
- }
- if (column.field == 'col14' || column.field == 'col15' || column.field == 'col16' || column.field == 'col17') {
- return 'table-header-cell-org'
- }
- if (column.field == 'col18' || column.field == 'col19' || column.field == 'col20') {
- return 'table-header-cell-zs'
- }
- },
- bodyCellClass: ({ row, column, rowIndex }) => {
- }
- },
- // 表格列表
- columns: [
- {
- field: '',
- key: 'acheckbox',
- type: 'checkbox',
- title: '',
- width: 23,
- align: 'center',
- fixed: 'left'
- },
- {
- field: '',
- key: 'a',
- title: '序号',
- width: 25,
- align: 'center',
- fixed: 'left',
- renderBodyCell: ({ row, column, rowIndex }, h) => {
- return ++rowIndex
- }
- },
- {
- field: 'promotionRuleType',
- key: 'ruletype',
- width: 100,
- title: '活动类型',
- align: 'center',
- fixed: 'left',
- renderBodyCell: ({ row, column, rowIndex }, h) => {
- const equalWord = <div style="display:flex;">
- <span style="width:12px;color:#ed1c24;text-align:center;margin-left:5px;cursor:pointer;" onClick={() => _this.moveTjRow(row, rowIndex, 'up')} title="上移">{rowIndex != 0 ? '⇡' : ''}</span>
- <span style="width:12px;color:#108ee9;text-align:center;cursor:pointer;" onClick={() => _this.moveTjRow(row, rowIndex, 'down')} title="下移">{rowIndex != _this.activeList.length - 1 ? '⇣' : ''}</span>
- </div>
- // 买产品送产品 同款产品 是累计产品才弹详情窗
- if (row.promotionRule.promotionRuleType === 'BUY_PROD_GIVE_PROD' && row.promotion.borrowFlag == '1' && row.promotionRule.regularSameFlag == '1') {
- return (<div style="width:100%;display:flex;justify-content: space-between;">
- <div class="table-link-text" onClick={() => _this.showBuyGifts(row)} style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
- {equalWord}
- </div>)
- } else {
- return (<div style="width:100%;display:flex;justify-content: space-between;">
- <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
- {equalWord}
- </div>)
- }
- }
- },
- { field: 'promotionRuleDesc',
- key: 'ruledesc',
- width: 100,
- title: '规则简称',
- align: 'center',
- fixed: 'left',
- renderBodyCell: ({ row, column, rowIndex }, h) => {
- return (<div style="width:100%;display:flex;justify-content: space-between;" title={row[column.field]} onClick={() => _this.showDesc(row)}>
- <div class="table-link-text" title={row[column.field]}>
- <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{row[column.field]}</span>
- </div>
- <div style="width:80px;">
- {row.promotion.stackFlag == 1 ? <a-badge count="叠" numberStyle={{ backgroundColor: '#00aa00', marginLeft: '3px', zoom: '80%' }}/> : ''}
- {row.promotion.borrowFlag == 1 ? <a-badge count="累" numberStyle={{ backgroundColor: '#F5222D', marginLeft: '3px', zoom: '80%' }} /> : ''}
- </div>
- </div>)
- }
- },
- {
- title: '门槛产品(数量或金额)',
- children: [
- {
- field: 'gateSelected',
- key: 'b',
- title: '已选',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
- },
- {
- field: 'gateTotal',
- key: 'c',
- title: '累计',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
- },
- {
- field: 'geteBalance',
- key: 'e',
- title: '差额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
- }
- ]
- },
- {
- title: '正价产品(数量或金额)',
- children: [
- {
- field: 'regularQuota',
- key: 'f',
- title: '配额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit')
- },
- {
- field: 'regularSelected',
- key: 'g',
- title: '已选',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit')
- },
- {
- field: 'regularTotal',
- key: 'k',
- title: '累计',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit', _this.openTotalProduct)
- },
- {
- field: 'regularBalance',
- key: 'l',
- title: '差额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit')
- }
- ]
- },
- {
- title: '促销品(数量)',
- children: [
- {
- field: 'promoLimit',
- key: 'z',
- title: '额度',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'promoUnit')
- },
- {
- field: 'promoSelected',
- key: 'x',
- title: '已选',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'promoUnit')
- },
- {
- field: 'promoBalance',
- key: 'v',
- title: '差额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'promoUnit')
- }
- ]
- },
- {
- title: '采购额(金额)',
- children: [
- {
- field: 'purchaseLimit',
- key: 'm',
- title: '额度',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
- },
- {
- field: 'purchaseSelected',
- key: 'n',
- title: '已选',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
- },
- {
- field: 'purchaseSurplus',
- key: 'kq',
- title: '结余',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
- },
- {
- field: 'purchaseOverspend',
- key: 'jw',
- title: '超支',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
- }
- ]
- },
- {
- title: '特价产品(数量或金额)',
- children: [
- {
- field: 'specialPriceQuota',
- key: 'mpe',
- title: '配额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
- },
- {
- field: 'specialPriceSelected',
- key: 'nyx',
- title: '已选',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
- },
- {
- field: 'specialPriceBalance',
- key: 'jce',
- title: '差额',
- width: 50,
- align: 'center',
- renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
- }
- ]
- },
- { field: 'totalCategory', key: 'ks', title: '款数', width: 50, align: 'center', fixed: 'right' },
- { field: 'totalQty', key: 'dsl', title: '数量', width: 50, align: 'center', fixed: 'right' },
- { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
- { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
- {
- field: '',
- key: 'action',
- title: '操作',
- width: 180,
- center: 'center',
- fixed: 'right',
- renderBodyCell: ({ row, column, rowIndex }, h) => {
- // 导入产品按钮
- const importButton = []
- if (row && row.promotionRule && row.promotionRule.gateFlag === '1') {
- importButton.push({ key: 'GATE', name: '导入门槛产品' })
- }
- if (row && row.promotionRule && row.promotionRule.promotionRuleType != 'PROMO_PROD') {
- importButton.push({ key: 'REGULAR', name: '导入正价产品' })
- }
- if (row && row.promotionRule && (row.promotionRule.regularPromotionSameFlag === '0' || row.promotionRule.scopeFlag === '0' || (row.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_MONEY' && row.promotionRule.scopeFlag === '1'))) {
- importButton.push({ key: 'GIFT', name: '导入促销产品' })
- }
- if (row && row.promotionRule && row.promotionRule.promotionRuleType == 'PROMO_PROD') {
- importButton.push({ key: 'DISCOUNT', name: '导入特价产品' })
- }
- if (row && row.promotion && row.promotion.borrowFlag == 1 && row.promotionRule.gateFlag === '1') {
- importButton.push({ key: 'BORROW_GATE', name: '累计门槛产品' })
- }
- if (row && row.promotion && row.promotion.borrowFlag == 1 && row.promotionRule.promotionRuleType != 'PROMO_PROD') {
- importButton.push({ key: 'BORROW_REGULAR', name: '累计正价产品' })
- }
- return (
- <div>
- <a-button
- type="link"
- size="small"
- class={row.enabledFlag == 0 ? 'button-success' : 'button-error'}
- on-click={() => this.enableRow(row)}
- >
- {row.enabledFlag == 0 ? '启用' : '禁用'}
- </a-button>
- {row.enabledFlag == 1 ? <a-dropdown>
- <a-menu slot="overlay" on-click={(e) => this.handleImportClick(e, row)} id={'salesEdit-menu-import-' + row.id}>
- {importButton.map(item => {
- return (
- <a-menu-item id={'salesEdit-menu-import-' + item.key + '-' + row.id} key={item.key}>{item.name}</a-menu-item>
- )
- })}
- </a-menu>
- <a-button
- id={'salesEdit-menu-import-plaction-' + row.id}
- type="link"
- class="button-primary"
- size="small"
- >
- 导入<a-icon style="margin-left:0" type="down" />
- </a-button>
- </a-dropdown> : ''}
- {row.enabledFlag == 1 ? <a-button
- type="link"
- size="small"
- class="button-primary"
- on-click={() => this.addProduct(row, 1)}
- >
- 添加
- </a-button> : ''}
- {row.enabledFlag == 1 && row.promotion.borrowFlag == 1 ? <a-button
- type="link"
- size="small"
- class="button-primary"
- on-click={() => this.addProduct(row, 2)}
- >
- 累计
- </a-button> : ''}
- </div>
- )
- }
- }
- ],
- tableData: [],
- openDetailModal: false, // 规则详情弹框
- detailSn: null, // 销售单sn
- disabledActiveOption: null,
- openGuideModal: false, // 导入产品引导
- uyGiftsInfo: null // 买赠产品弹窗详情信息
- }
- },
- methods: {
- getDataList () {
- this.hasInit = true
- for (let i = 0; i < this.activeList.length; i++) {
- const item = this.activeList[i]
- // 门槛统计
- const isYuan = item.gateRuleUnit == 'YUAN'
- const gateUnit = isYuan ? '元' : '个' // 单位
- const gateSelected = isYuan ? item.gateTotalAmount : item.gateQty // 已选
- const gateTotal = isYuan ? item.gateBorrowAmount : item.gateBorrowQty // 累计
- const gateQuota = isYuan ? item.gateQuotaAmount : item.gateQuotaQty // 配额
- const geteBalance = item.gateShortfallValue // 差额 = 配额 - 已选 - 累计
- // 正价统计
- const isYuan1 = item.regularRuleUnit == 'YUAN'
- const regularUnit = isYuan1 ? '元' : '个' // 单位
- const regularQuota = item.gateQuotaAmount // 配额
- const regularRuleValue = item.regularRuleValue // 额度
- const regularSelected = isYuan1 ? item.regularTotalAmount : item.regularTotalQty // 已选
- const regularTotal = isYuan1 ? item.regularBorrowAmount : item.regularBorrowQty // 累计
- const regularBalance = regularRuleValue - regularSelected - regularTotal // 差额 = 额度 - 已选 - 累计
- // 促销品
- const promoUnit = '个'
- const promoLimit = 0 // 额度
- const promoSelected = 0 // 已选
- const promoBalance = promoLimit - promoSelected // 差额 = 额度 - 已选
- // 采购额
- const purchaseUnit = '元'
- const purchaseLimit = item.totalPromoGiftsAmount // 额度
- const purchaseSelected = item.totalUsePromoGiftsAmount // 已选
- const purchaseSurplus = (purchaseLimit - purchaseSelected) || 0 // 结余
- const purchaseOverspend = (purchaseSelected - purchaseLimit) || 0 // 超支
- // 特价产品
- const isYuan2 = item.gateRuleUnit == 'YUAN'
- const specialPriceUnit = isYuan2 ? '元' : '个' // 单位
- const specialPriceQuota = (isYuan2 ? item.specialPriceQuotaAmount : item.specialPriceQuotaQty) || 0 // 配额
- const specialPriceSelected = isYuan2 ? item.discountAmount : item.discountQty || 0 // 已选
- const specialPriceBalance = !specialPriceQuota ? 0 : (specialPriceQuota - specialPriceSelected)// 差额 = 配额 - 已选 - 累计
- // 促销品
- this.tableData.push({
- ...item,
- promotionRuleType: item.promotionRule.promotionRuleTypeDictValue,
- promotionRuleDesc: item.promotionRule.description,
- // 门槛
- gateUnit, // 单位
- gateQuota, // 配额
- gateSelected, // 已选
- gateTotal, // 累计
- geteBalance, // 差额 = 配额 - 已选 - 累计
- // 正价
- regularUnit, // 单位
- regularQuota, // 配额
- regularSelected, // 已选
- regularTotal, // 累计
- regularBalance, // 差额 = 配额 - 已选 - 累计
- // 促销品
- promoUnit, // 单位
- promoLimit, // 额度
- promoSelected, // 已选
- promoBalance, // 差额 = 额度 - 已选
- // 采购额
- purchaseUnit,
- purchaseLimit, // 额度
- purchaseSelected, // 已选
- purchaseSurplus, // 结余
- purchaseOverspend, // 超支
- // 特价产品
- specialPriceUnit, // 单位
- specialPriceQuota, // 配额
- specialPriceSelected, // 已选
- specialPriceBalance // 差额
- })
- }
- this.disabledActiveIds()
- },
- // 禁用的活动规则
- disabledActiveIds () {
- this.checkboxOption.disableSelectedRowKeys = this.tableData.filter(item => item.enabledFlag == 0).map(item => item.id)
- },
- // 上下移动特价活动
- moveTjRow (row, index, type) {
- },
- // 刷新当前规则
- refashRow (item, enable) {
- console.log(enable, 'enable')
- // 刷新产品列表
- this.$emit('refash', '')
- const active = this.tableData.find(k => k.id == item.id)
- active.enabledFlag = enable
- this.disabledActiveIds()
- },
- // 查看累计产品 详情
- openTotalProduct (row) {
- this.openTotalProductModal = true
- this.$refs.totalProductModal.pageInit({ salesBillSn: row.salesBillSn, salesPromoSn: row.salesPromoSn })
- },
- // 显示买赠产品弹窗
- showBuyGifts (rowVal) {
- rowVal.promotionRule.salesPromoSn = rowVal.salesPromoSn
- this.buyGiftsInfo = rowVal.promotionRule
- this.openNormalProductModal = true
- const _this = this
- this.$nextTick(() => {
- _this.$refs.normalProductModal.resetSearchForm()
- })
- },
- // 启用规则
- enabledActive (item) {
- const _this = this
- this.spinning = true
- salesEnablePromoPromo({
- salesBillSn: _this.salesBillSn,
- salesPromoSn: item.salesPromoSn
- }).then(res => {
- if (res.status == 200) {
- // 刷新
- _this.refashRow(item, 1)
- _this.$message.success('启用成功')
- }
- _this.spinning = false
- })
- },
- // 禁用规则
- disabledActive (item) {
- const _this = this
- _this.spinning = true
- salesDisablePromo({
- salesBillSn: _this.salesBillSn,
- salesPromoSn: item.salesPromoSn,
- promoRuleSn: item.promoRuleSn,
- salesDisableType: _this.disabledActiveOption
- }).then(res => {
- if (res.status == 200) {
- // 刷新
- _this.refashRow(item, 0)
- _this.disabledActiveOption = null
- _this.$message.success('禁用成功')
- }
- _this.spinning = false
- })
- },
- enableRow (item) {
- const _this = this
- // 禁用的直接启用
- if (item.enabledFlag == 0) {
- this.enabledActive(item)
- return
- }
- // 如果没有活动产品,直接禁用无需弹框提示
- // const table = _this.$refs['productList-' + item.promoRuleSn][0]
- // if (!table.countData || table.countData && !table.countData.totalQty) {
- // _this.disabledActiveOption = 'DELETE'
- // _this.disabledActive(item)
- // return
- // }
- // 弹框提示禁用方式
- this.$confirm({
- title: item.promotion.description + '-' + item.promotionRule.description + ',确定禁用规则?',
- centered: true,
- class: 'confirm-center',
- content: <div>
- <div style="padding:10px 0;text-align:center;">禁用规则后,将无法享受该活动规则优惠</div>
- <div style="padding:0 0 10px 0;text-align:center;">
- <aRadioGroup onChange={_this.changeDaOpt}>
- <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="DELETE">
- 删除规则中相关产品
- </aRadio>
- <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="REMOVE">
- 移出规则中相关产品
- </aRadio>
- </aRadioGroup>
- </div>
- </div>,
- onOk () {
- if (_this.disabledActiveOption) {
- _this.disabledActive(item)
- } else {
- _this.$message.info('请选择禁用方式!')
- return true
- }
- },
- onCancel () {
- _this.disabledActiveOption = null
- }
- })
- },
- // 选择禁用活动选项
- changeDaOpt (e) {
- this.disabledActiveOption = e.target.value
- },
- // 导入产品
- handleImportClick (e, row) {
- this.$refs.importGuideModal.pageInit({ promoProductClz: e.key, salesBillSn: this.salesBillSn, salesPromoSn: row.salesPromoSn }, row)
- this.openGuideModal = true
- },
- // 关闭导入弹框
- closeGuideModel () {
- this.openGuideModal = false
- },
- // 批量导入产品
- hanldeImportOk (salesBillDetailList, row, promoProductClz) {
- const params = {
- salesBillSn: this.salesBillSn,
- salesBillDetailList: salesBillDetailList
- }
- // 活动导入
- if (row.salesPromoSn) {
- params.salesPromoSn = row.salesPromoSn
- params.promoRuleSn = row.promoRuleSn
- params.promoProductClz = promoProductClz
- }
- salesBatchInsert(params).then(res => {
- if (res.status == 200) {
- this.$message.success('产品导入成功', 2.5)
- this.$emit('refash', 'promo')
- }
- })
- },
- hanldeImportTotalOk (list, row, type) {
- const params = {
- salesBillSn: this.salesBillSn,
- salesBillDetailList: list
- }
- // 活动导入
- if (row.salesPromoSn) {
- params.salesPromoSn = row.salesPromoSn
- // params.promoRuleSn = row.promoRuleSn
- params.promoProductClz = promoProductClz
- }
- importBorrowTotalProduct(params).then(res => {
- if (res.status == 200) {
- this.$message.success('产品导入成功', 2.5)
- this.$emit('refash', 'promo')
- }
- })
- },
- // 添加产品
- addProduct (row, type) {
- this.$emit('openCpModal', type, row)
- },
- // 查看活动详情
- showDesc (row) {
- if (row.promoRuleSn) {
- this.detailSn = row.promoRuleSn
- this.openDetailModal = true
- }
- },
- // 关闭详情弹窗
- closeDetailModal () {
- this.detailSn = null
- this.openDetailModal = false
- }
- }
- }
- </script>
- <style lang="less">
- .table-header-cell-blue {
- background: #c9fbff !important;
- }
- .table-header-cell-red {
- background: #ffdccb !important;
- }
- .table-header-cell-green {
- background: #deffec !important;
- }
- .table-header-cell-zs {
- background: #fff2ff !important;
- }
- .table-header-cell-org {
- background: #fff3c2 !important;
- }
- .table-link-text{
- width:100%;
- color: #409EFF;
- display:flex;
- &:hover{
- text-decoration: underline;
- }
- }
- </style>
|