소스 검색

活动产品需求变动

chenrui 4 달 전
부모
커밋
96d4057b30

+ 85 - 89
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -38,7 +38,7 @@ import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detai
 import totalProductDetailModal from './totalProductDetailModal.vue'
 import normalProductDetailModal from './normalProductDetailModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { salesDisablePromo, salesEnablePromoPromo, salesBatchInsert, importBorrowTotalProduct } from '@/api/salesDetailNew'
+import { salesDisablePromo, salesEnablePromoPromo, salesBatchInsert } from '@/api/salesDetailNew'
 import { salesPromoSaveSort } from '@/api/salesNew'
 export default {
   mixins: [commonMixin],
@@ -112,19 +112,19 @@ export default {
       // 单元格样式
       cellStyleOption: {
         headerCellClass: ({ column, rowIndex }) => {
-          if (column.key >= 4 && column.key <= 6) {
+          if (column.key >= 4 && column.key <= 8) {
             return 'table-header-cell-blue'
           }
-          if (column.key >= 7 && column.key <= 10) {
+          if (column.key >= 9 && column.key < 10) {
             return 'table-header-cell-red'
           }
-          if (column.key >= 11 && column.key <= 13) {
+          if (column.key >= 10 && column.key <= 13) {
             return 'table-header-cell-green'
           }
-          if (column.key >= 14 && column.key <= 17) {
+          if (column.key >= 14 && column.key <= 16) {
             return 'table-header-cell-org'
           }
-          if (column.key >= 18 && column.key <= 20) {
+          if (column.key >= 17 && column.key <= 19) {
             return 'table-header-cell-zs'
           }
         },
@@ -156,7 +156,7 @@ export default {
       // 格式化数字金额单元格
       const formatTd = (row, column, rowIndex, uniKey, fun) => {
         if (row[column.field]) {
-          return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
+          return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : (column.field == 'geteBalance' || column.field == 'regularBaseVal') ? 'table-word-color' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
         } else {
           return ''
         }
@@ -240,7 +240,7 @@ export default {
           }
         },
         {
-          title: '门槛产品(数量或金额)',
+          title: '门槛产品',
           children: [
             {
               field: 'gateSelected',
@@ -265,23 +265,44 @@ export default {
               width: 50,
               align: 'center',
               renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
+            },
+            {
+              field: 'gateQuota',
+              key: '7',
+              title: '配额',
+              width: 50,
+              align: 'center',
+              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
+            },
+            {
+              field: 'unUseGateQuota',
+              key: '8',
+              title: '未用配额',
+              width: 60,
+              align: 'center',
+              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
             }
           ]
         },
         {
-          title: '正价产品(数量或金额)',
+          title: '特价',
           children: [
             {
-              field: 'regularQuota',
-              key: '7',
-              title: '配额',
+              field: 'specialPriceSelected',
+              key: '9',
+              title: '已选',
               width: 50,
               align: 'center',
-              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
-            },
+              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
+            }
+          ]
+        },
+        {
+          title: '正价产品',
+          children: [
             {
               field: 'regularSelected',
-              key: '8',
+              key: '10',
               title: '已选',
               width: 50,
               align: 'center',
@@ -289,28 +310,36 @@ export default {
             },
             {
               field: 'regularTotal',
-              key: '9',
+              key: '11',
               title: '累计',
               width: 50,
               align: 'center',
               renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit', _this.openTotalProduct)
             },
             {
-              field: 'regularBalance',
-              key: '10',
-              title: '差额',
-              width: 50,
+              field: 'regularBaseVal',
+              key: '12',
+              title: '基础差',
+              width: 60,
+              align: 'center',
+              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit')
+            },
+            {
+              field: 'regularNextVal',
+              key: '13',
+              title: '下阶差',
+              width: 60,
               align: 'center',
               renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'regularUnit')
             }
           ]
         },
         {
-          title: '促销品(数量)',
+          title: '促销品',
           children: [
             {
               field: 'promoLimit',
-              key: '11',
+              key: '14',
               title: '额度',
               width: 50,
               align: 'center',
@@ -318,7 +347,7 @@ export default {
             },
             {
               field: 'promoSelected',
-              key: '12',
+              key: '15',
               title: '已选',
               width: 50,
               align: 'center',
@@ -326,7 +355,7 @@ export default {
             },
             {
               field: 'promoBalance',
-              key: '13',
+              key: '16',
               title: '差额',
               width: 50,
               align: 'center',
@@ -335,11 +364,11 @@ export default {
           ]
         },
         {
-          title: '采购额(金额)',
+          title: '采购额',
           children: [
             {
               field: 'purchaseLimit',
-              key: '14',
+              key: '17',
               title: '额度',
               width: 50,
               align: 'center',
@@ -347,7 +376,7 @@ export default {
             },
             {
               field: 'purchaseSelected',
-              key: '15',
+              key: '18',
               title: '已选',
               width: 50,
               align: 'center',
@@ -355,53 +384,16 @@ export default {
             },
             {
               field: 'purchaseSurplus',
-              key: '16',
+              key: '19',
               title: '结余',
               width: 50,
               align: 'center',
               renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
-            },
-            {
-              field: 'purchaseOverspend',
-              key: '17',
-              title: '超支',
-              width: 50,
-              align: 'center',
-              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'purchaseUnit')
-            }
-          ]
-        },
-        {
-          title: '特价产品(数量或金额)',
-          children: [
-            {
-              field: 'specialPriceQuota',
-              key: '18',
-              title: '配额',
-              width: 50,
-              align: 'center',
-              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'gateUnit')
-            },
-            {
-              field: 'specialPriceSelected',
-              key: '19',
-              title: '已选',
-              width: 50,
-              align: 'center',
-              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
-            },
-            {
-              field: 'specialPriceBalance',
-              key: '20',
-              title: '差额',
-              width: 50,
-              align: 'center',
-              renderBodyCell: ({ row, column, rowIndex }, h) => formatTd(row, column, rowIndex, 'specialPriceUnit')
             }
           ]
         },
-        { field: 'totalCategory', key: '21', title: '款数', width: 50, align: 'center', fixed: 'right' },
-        { field: 'totalQty', key: '22', title: '数量', width: 50, align: 'center', fixed: 'right' }
+        { field: 'totalCategory', key: '20', title: '款数', width: 50, align: 'center', fixed: 'right' },
+        { field: 'totalQty', key: '21', title: '数量', width: 50, align: 'center', fixed: 'right' }
       ]
       if (this.type == 'edit') {
         cols.unshift({
@@ -416,14 +408,14 @@ export default {
       }
       // 销售价权限
       if (this.type == 'view' && this.$hasPermissions('B_salesDetail_salesPrice') || this.type == 'edit' && this.$hasPermissions('B_salesEdit_salesPrice')) {
-        cols.push({ field: 'totalAmount', key: '23', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } })
-        cols.push({ field: 'lossAmount', key: '24', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } })
+        cols.push({ field: 'totalAmount', key: '22', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } })
+        cols.push({ field: 'lossAmount', key: '23', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } })
       }
       // 编辑页面
       if (this.type == 'edit') {
         cols.push({
           field: '',
-          key: '25',
+          key: '24',
           title: '状态',
           width: 50,
           center: 'center',
@@ -445,7 +437,7 @@ export default {
         })
         cols.push({
           field: '',
-          key: '26',
+          key: '25',
           title: '产品',
           width: 130,
           center: 'center',
@@ -532,15 +524,22 @@ export default {
         const gateSelected = isYuan ? item.gateTotalAmount : item.gateQty // 已选
         const gateTotal = isYuan ? item.gateBorrowAmount : item.gateBorrowQty // 累计
         const gateQuota = isYuan ? item.gateQuotaAmount : item.gateQuotaQty // 配额
+        const unUseGateQuota = isYuan ? item.unUseAmount : item.unUseQty // 未用配额(正价产品)=配额 - 已选 - 累计;未用配额(特价产品)= 配额 - 已选
         const geteBalance = item.gateShortfallValue // 差额 = 配额 - 已选 - 累计
+        // 特价产品
+        const isYuan2 = item.gateRuleUnit == 'YUAN'
+        const specialPriceUnit = isYuan2 ? '元' : '个' // 单位
+        const specialPriceQuota = item.promotionRule.promotionRuleType === 'PROMO_PROD' ? item.gateQuotaAmount : 0 // 配额
+        const specialPriceSelected = isYuan2 ? item.discountAmount : item.discountQty || 0 // 已选
+        const specialPriceBalance = !specialPriceQuota ? 0 : isYuan ? item.discountCeAmount : item.discountCeQty// 差额 = 配额 - 已选
         // 正价统计
         const isYuan1 = item.regularRuleUnit == 'YUAN'
         const regularUnit = isYuan1 ? '元' : '个' // 单位
-        const regularQuota = item.promotionRule.promotionRuleType != 'PROMO_PROD' ? item.gateQuotaAmount : 0// 配额
-        const regularRuleValue = item.regularRuleValue // 额度
+        const regularQuota = item.promotionRule.promotionRuleType != 'PROMO_PROD' ? item.gateQuotaAmount : 0// 配额  // 额度item.regularRuleValue
         const regularSelected = isYuan1 ? item.regularTotalAmount : item.regularTotalQty // 已选
         const regularTotal = isYuan1 ? item.regularBorrowAmount : item.regularBorrowQty // 累计
-        const regularBalance = isYuan1 ? item.regularCeAmount : item.regularCeQty // 差额 = 额度 - 已选 - 累计
+        const regularBaseVal = (isYuan1 ? item.baseAmount : item.baseQty) * 1 <= 0 ? 0 : undefined // 基础差
+        const regularNextVal = (isYuan1 ? item.nextAmount : item.nextQty) * 1 <= 0 ? 0 : undefined // 下级差
         // 促销品
         const promoUnit = '个'
         const promoSelected = item.giftQty || 0 // 已选
@@ -551,13 +550,6 @@ export default {
         const purchaseLimit = item.totalPromoGiftsAmount // 额度
         const purchaseSelected = item.totalUsePromoGiftsAmount // 已选
         const purchaseSurplus = item.surplusAmount || 0 // 结余
-        const purchaseOverspend = item.disSurplusAmount || 0 // 超支
-        // 特价产品
-        const isYuan2 = item.gateRuleUnit == 'YUAN'
-        const specialPriceUnit = isYuan2 ? '元' : '个' // 单位
-        const specialPriceQuota = item.promotionRule.promotionRuleType === 'PROMO_PROD' ? item.gateQuotaAmount : 0 // 配额
-        const specialPriceSelected = isYuan2 ? item.discountAmount : item.discountQty || 0 // 已选
-        const specialPriceBalance = !specialPriceQuota ? 0 : isYuan ? item.discountCeAmount : item.discountCeQty// 差额 = 配额 - 已选
 
         // 促销品
         this.tableData.push({
@@ -568,15 +560,22 @@ export default {
           // 门槛
           gateUnit, // 单位
           gateQuota, // 配额
+          unUseGateQuota, // 未用配额
           gateSelected, // 已选
           gateTotal, // 累计
           geteBalance, // 差额 = 配额 - 已选 - 累计
+          // 特价产品
+          specialPriceUnit, // 单位
+          specialPriceQuota, // 配额
+          specialPriceSelected, // 已选
+          specialPriceBalance, // 差额
           // 正价
           regularUnit, // 单位
           regularQuota, // 配额
           regularSelected, // 已选
           regularTotal, // 累计
-          regularBalance, // 差额 = 配额 - 已选 - 累计
+          regularBaseVal, // 基础差
+          regularNextVal, // 下阶差
           // 促销品
           promoUnit, // 单位
           promoLimit, // 额度
@@ -586,13 +585,7 @@ export default {
           purchaseUnit,
           purchaseLimit, // 额度
           purchaseSelected, // 已选
-          purchaseSurplus, // 结余
-          purchaseOverspend, // 超支
-          // 特价产品
-          specialPriceUnit, // 单位
-          specialPriceQuota, // 配额
-          specialPriceSelected, // 已选
-          specialPriceBalance // 差额
+          purchaseSurplus // 结余
         })
       }
       // 获取禁用的活动规则
@@ -837,6 +830,9 @@ export default {
        text-decoration: underline;
      }
   }
+  .table-word-color{
+    color:#ed1c24;
+  }
   .table-arrow-box{
     display: flex;
     span{

+ 2 - 2
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -817,6 +817,7 @@ export default {
         warehouseSn: row.warehouseSn,
         salesBillDetailSnList: snArr,
         salesBillSn: this.salesBillSn,
+        allFlag: false,
         salesPromoDetailSnSet: row.salesPromoDetailList ? [row.salesPromoDetailList[0].salesPromoDetailSn] : undefined
       }
       this.setWarehouseInfo(ajax_data)
@@ -826,8 +827,7 @@ export default {
       const _this = this
       const selectedRows = _this.dataSource.filter(item => _this.selectedRowKeys.includes(item.id))
       const obj = selectedRows ? selectedRows.map(item => item.salesBillDetailSn) : []
-      // 将Set转换回数组
-      const mergedArr = _this.getSalesPromoSnList(selectedRows)
+      const mergedArr = _this.getSalesPromoSnList(obj && obj.length > 0 ? selectedRows : _this.dataSource)
       const ajaxData = {
         warehouseSn: sn,
         salesBillDetailSnList: obj,

+ 2 - 1
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -487,7 +487,8 @@ export default {
       const ajax_data = {
         warehouseSn: row.warehouseSn,
         salesBillDetailSnList: snArr,
-        salesBillSn: this.salesBillSn
+        salesBillSn: this.salesBillSn,
+        allFlag: false
       }
       this.setWarehouseInfo(ajax_data)
     },