lilei 6 bulan lalu
induk
melakukan
63eb74f183

+ 91 - 58
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -19,7 +19,7 @@
         :table-data="tableData" />
     </a-spin>
     <!-- 活动规则详情 -->
-    <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+    <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="promoRuleSn" @close="closeDetailModal"></detailModal>
     <!-- 导入产品 -->
     <importGuideModal
       ref="importGuideModal"
@@ -117,19 +117,20 @@ export default {
       // 单元格样式
       cellStyleOption: {
         headerCellClass: ({ column, rowIndex }) => {
-          if (column.field == 'col2' || column.field == 'col3' || column.field == 'col4') {
+          console.log(column)
+          if (column.key >= 4 && column.key <= 6) {
             return 'table-header-cell-blue'
           }
-          if (column.field == 'col6' || column.field == 'col7' || column.field == 'col8' || column.field == 'col9') {
+          if (column.key >= 7 && column.key <= 10) {
             return 'table-header-cell-red'
           }
-          if (column.field == 'col11' || column.field == 'col12' || column.field == 'col13') {
+          if (column.key >= 11 && column.key <= 13) {
             return 'table-header-cell-green'
           }
-          if (column.field == 'col14' || column.field == 'col15' || column.field == 'col16' || column.field == 'col17') {
+          if (column.key >= 14 && column.key <= 17) {
             return 'table-header-cell-org'
           }
-          if (column.field == 'col18' || column.field == 'col19' || column.field == 'col20') {
+          if (column.key >= 18 && column.key <= 20) {
             return 'table-header-cell-zs'
           }
         },
@@ -140,7 +141,7 @@ export default {
       columns: [
         {
           field: '',
-          key: 'acheckbox',
+          key: '0',
           type: 'checkbox',
           title: '',
           width: 23,
@@ -149,7 +150,7 @@ export default {
         },
         {
           field: '',
-          key: 'a',
+          key: '1',
           title: '序号',
           width: 25,
           align: 'center',
@@ -160,7 +161,7 @@ export default {
         },
         {
           field: 'promotionRuleType',
-          key: 'ruletype',
+          key: '2',
           width: 100,
           title: '活动类型',
           align: 'center',
@@ -188,7 +189,7 @@ export default {
           }
         },
         { field: 'promotionRuleDesc',
-          key: 'ruledesc',
+          key: '3',
           width: 100,
           title: '规则简称',
           align: 'center',
@@ -210,7 +211,7 @@ export default {
           children: [
             {
               field: 'gateSelected',
-              key: 'b',
+              key: '4',
               title: '已选',
               width: 50,
               align: 'center',
@@ -218,7 +219,7 @@ export default {
             },
             {
               field: 'gateTotal',
-              key: 'c',
+              key: '5',
               title: '累计',
               width: 50,
               align: 'center',
@@ -226,7 +227,7 @@ export default {
             },
             {
               field: 'geteBalance',
-              key: 'e',
+              key: '6',
               title: '差额',
               width: 50,
               align: 'center',
@@ -239,7 +240,7 @@ export default {
           children: [
             {
               field: 'regularQuota',
-              key: 'f',
+              key: '7',
               title: '配额',
               width: 50,
               align: 'center',
@@ -247,7 +248,7 @@ export default {
             },
             {
               field: 'regularSelected',
-              key: 'g',
+              key: '8',
               title: '已选',
               width: 50,
               align: 'center',
@@ -255,7 +256,7 @@ export default {
             },
             {
               field: 'regularTotal',
-              key: 'k',
+              key: '9',
               title: '累计',
               width: 50,
               align: 'center',
@@ -263,7 +264,7 @@ export default {
             },
             {
               field: 'regularBalance',
-              key: 'l',
+              key: '10',
               title: '差额',
               width: 50,
               align: 'center',
@@ -276,7 +277,7 @@ export default {
           children: [
             {
               field: 'promoLimit',
-              key: 'z',
+              key: '11',
               title: '额度',
               width: 50,
               align: 'center',
@@ -284,7 +285,7 @@ export default {
             },
             {
               field: 'promoSelected',
-              key: 'x',
+              key: '12',
               title: '已选',
               width: 50,
               align: 'center',
@@ -292,7 +293,7 @@ export default {
             },
             {
               field: 'promoBalance',
-              key: 'v',
+              key: '13',
               title: '差额',
               width: 50,
               align: 'center',
@@ -305,7 +306,7 @@ export default {
           children: [
             {
               field: 'purchaseLimit',
-              key: 'm',
+              key: '14',
               title: '额度',
               width: 50,
               align: 'center',
@@ -313,7 +314,7 @@ export default {
             },
             {
               field: 'purchaseSelected',
-              key: 'n',
+              key: '15',
               title: '已选',
               width: 50,
               align: 'center',
@@ -321,7 +322,7 @@ export default {
             },
             {
               field: 'purchaseSurplus',
-              key: 'kq',
+              key: '16',
               title: '结余',
               width: 50,
               align: 'center',
@@ -329,7 +330,7 @@ export default {
             },
             {
               field: 'purchaseOverspend',
-              key: 'jw',
+              key: '17',
               title: '超支',
               width: 50,
               align: 'center',
@@ -342,7 +343,7 @@ export default {
           children: [
             {
               field: 'specialPriceQuota',
-              key: 'mpe',
+              key: '18',
               title: '配额',
               width: 50,
               align: 'center',
@@ -350,7 +351,7 @@ export default {
             },
             {
               field: 'specialPriceSelected',
-              key: 'nyx',
+              key: '19',
               title: '已选',
               width: 50,
               align: 'center',
@@ -358,7 +359,7 @@ export default {
             },
             {
               field: 'specialPriceBalance',
-              key: 'jce',
+              key: '20',
               title: '差额',
               width: 50,
               align: 'center',
@@ -366,15 +367,37 @@ export default {
             }
           ]
         },
-        { 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: 'totalCategory', key: '21', title: '款数', width: 50, align: 'center', fixed: 'right' },
+        { field: 'totalQty', key: '22', title: '数量', width: 50, align: 'center', fixed: 'right' },
+        { field: 'totalAmount', key: '23', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
+        { field: 'lossAmount', key: '24', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
         {
           field: '',
-          key: 'action',
+          key: '25',
+          title: '状态',
+          width: 50,
+          center: 'center',
+          fixed: 'right',
+          renderBodyCell: ({ row, column, rowIndex }, h) => {
+            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>
+              </div>
+            )
+          }
+        },
+        {
+          field: '',
+          key: '26',
           title: '操作',
-          width: 180,
+          width: 130,
           center: 'center',
           fixed: 'right',
           renderBodyCell: ({ row, column, rowIndex }, h) => {
@@ -400,14 +423,6 @@ export default {
             }
             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 => {
@@ -422,7 +437,7 @@ export default {
                     class="button-primary"
                     size="small"
                   >
-                    导入<a-icon style="margin-left:0" type="down" />
+                    导入
                   </a-button>
                 </a-dropdown> : ''}
                 {row.enabledFlag == 1 ? <a-button
@@ -448,7 +463,7 @@ export default {
       ],
       tableData: [],
       openDetailModal: false, // 规则详情弹框
-      detailSn: null, // 销售单sn
+      promoRuleSn: null, // 销售单sn
       disabledActiveOption: null,
       openGuideModal: false, //  导入产品引导
       buyGiftsInfo: null // 买赠产品弹窗详情信息
@@ -620,19 +635,38 @@ export default {
     },
     enableRow (item) {
       const _this = this
-      // 禁用的直接启用
+      // 启用
       if (item.enabledFlag == 0) {
-        this.enabledActive(item)
+        this.$confirm({
+          title: item.promotion.description + '-' + item.promotionRule.description + ',确定启用规则?',
+          centered: true,
+          class: 'confirm-center',
+          content: <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.enabledActive(item)
+            } else {
+              _this.$message.info('请选择启用方式!')
+            }
+          },
+          onCancel () {
+            _this.disabledActiveOption = null
+          }
+        })
         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,
@@ -642,10 +676,10 @@ export default {
           <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>
@@ -655,7 +689,6 @@ export default {
             _this.disabledActive(item)
           } else {
             _this.$message.info('请选择禁用方式!')
-            return true
           }
         },
         onCancel () {
@@ -720,13 +753,13 @@ export default {
     // 查看活动详情
     showDesc (row) {
       if (row.promoRuleSn) {
-        this.detailSn = row.promoRuleSn
+        this.promoRuleSn = row.promoRuleSn
         this.openDetailModal = true
       }
     },
     // 关闭详情弹窗
     closeDetailModal () {
-      this.detailSn = null
+      this.promoRuleSn = null
       this.openDetailModal = false
     }
   }

+ 32 - 13
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -76,17 +76,16 @@
               <a-menu-item key="3" :id="'salesEdit-menu-3-'+id">
                 全部仓库设置
               </a-menu-item>
+              <a-menu-item key="2" :id="'salesEdit-menu-2-'+id">
+                全部删除
+              </a-menu-item>
+              <a-menu-divider />
               <a-menu-item key="0" :id="'salesEdit-menu-0-'+id">
                 部分仓库设置
               </a-menu-item>
-              <a-menu-divider />
               <a-menu-item key="1" :id="'salesEdit-menu-1-'+id">
                 删除已选项
               </a-menu-item>
-              <a-menu-item key="2" :id="'salesEdit-menu-2-'+id">
-                全部删除
-              </a-menu-item>
-              <a-menu-divider />
               <a-menu-item key="4" :id="'salesEdit-menu-4-'+id">
                 批量取消促销
               </a-menu-item>
@@ -135,12 +134,7 @@
       <!-- 产品名称 -->
       <template slot="productName" slot-scope="text, record">
         <div class="ellipsisCon">
-          <a-tooltip placement="rightBottom">
-            <template slot="title">
-              <span>{{ text }}</span>
-            </template>
-            <span class="ellipsisText">{{ text }}</span>
-          </a-tooltip>
+          <span class="ellipsisText" :title="text">{{ text }}</span>
           <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
         </div>
       </template>
@@ -159,7 +153,18 @@
       </template>
       <!-- 规则数量 -->
       <template slot="rulesNums" slot-scope="text, record">
-        <a-button type="link" :id="'salesEdit-gzqty-'+id+'-'+record.id" size="small" class="button-info">{{ record.promoRuleNum }}</a-button>
+        <a-popover placement="right">
+          <template slot="content">
+            <div
+              title="点击查看详情"
+              style="padding:5px 0;cursor: pointer;"
+              v-for="item in record.promoRuleSnList"
+              @click="showRuleDetail(item)"
+              :id="'salesEdit-gzitem-'+id+'-'+record.id"
+              :key="item">{{ activeRuleFilter(item) }}</div>
+          </template>
+          <a-button type="link" :id="'salesEdit-gzqty-'+id+'-'+record.id" size="small" class="button-info">{{ record.promoRuleNum }}<span style="zoom:0.6;color: #666;">个∨</span></a-button>
+        </a-popover>
       </template>
       <!-- 销售数量 -->
       <template slot="salesNums" slot-scope="text, record">
@@ -278,7 +283,11 @@ export default {
       type: String,
       default: '0'
     },
-    // 活动sn
+    activeList: {
+      type: Array,
+      default: () => []
+    },
+    // 已勾选的活动sn
     salesPromoSnSet: {
       type: Array,
       default: () => []
@@ -386,6 +395,15 @@ export default {
     }
   },
   methods: {
+    // 参与规则名称
+    activeRuleFilter (val) {
+      const row = this.activeList.length && this.activeList.find(item => item.promoRuleSn == val)
+      return row ? row.promotion.description + '-' + row.promotionRule.description : ''
+    },
+    // 查看参与规则详情
+    showRuleDetail (promoRuleSn) {
+      this.$emit('showRuleDetail', promoRuleSn)
+    },
     // 仓库下拉列表筛选
     filterOption (input, option) {
       return (
@@ -655,6 +673,7 @@ export default {
         if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
           _this.$message.warning('请先选择要设置的产品!')
         } else {
+          _this.warehouseTit = '部分仓库设置'
           _this.openWarehouseModal = true
         }
       } else if (e.key == 1) { // 删除已选项

+ 4 - 4
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -49,16 +49,16 @@
         <a-col :md="8" :sm="24" style="text-align:left;">
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
-              <a-menu-item key="3" id="salesEdit-pl-3">
-                全部仓库设置
-              </a-menu-item>
               <a-menu-item key="0" id="salesEdit-pl-0">
                 部分仓库设置
               </a-menu-item>
-              <a-menu-divider />
               <a-menu-item key="1" id="salesEdit-pl-1">
                 删除已选项
               </a-menu-item>
+              <a-menu-divider />
+              <a-menu-item key="3" id="salesEdit-pl-3">
+                全部仓库设置
+              </a-menu-item>
               <a-menu-item key="2" id="salesEdit-pl-2">
                 全部删除
               </a-menu-item>

+ 7 - 1
src/views/salesManagement/salesQueryNew/edit.vue

@@ -68,9 +68,11 @@
         <div style="padding:0 10px 10px;">
           <productList
             ref="productActiveList"
+            :activeList="activeList"
             :detailData="detailData"
             :salesBillSn="salesBillSn"
             :salesPromoSnSet="salesPromoSnSet"
+            @showRuleDetail="showRuleDetail"
             @refash="refashTableData"
             @upActive="upActive">
           </productList>
@@ -247,6 +249,10 @@ export default {
         }
       })
     },
+    // 查看参与规则明细
+    showRuleDetail (sn) {
+      this.$refs.activeTjList.showDesc({ promoRuleSn: sn })
+    },
     // 优惠明细查看
     getPromYhDetail () {
       salesPromoQueryCount({ salesBillSn: this.$route.params.sn }).then(res => {
@@ -307,7 +313,7 @@ export default {
         this.getOrderDetail(true)
       }
     },
-    // 特价规则排序
+    // 特价规则排序列表
     getSalesPromoDiscountSort () {
       this.spinning = true
       salesPromoDiscountSort({ salesBillSn: this.$route.params.sn }).then(res => {