소스 검색

修改bug

chenrui 6 달 전
부모
커밋
9212034a15
1개의 변경된 파일25개의 추가작업 그리고 4개의 파일을 삭제
  1. 25 4
      src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

+ 25 - 4
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -73,7 +73,11 @@ export default {
     const _this = this
     const _this = this
     // 格式化数字金额单元格
     // 格式化数字金额单元格
     const formatTd = (row, column, rowIndex, uniKey, fun) => {
     const formatTd = (row, column, rowIndex, uniKey, fun) => {
-      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>)
+      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 {
     return {
       hasInit: false,
       hasInit: false,
@@ -94,10 +98,19 @@ export default {
         // 行选择改变事件
         // 行选择改变事件
         selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
         selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
           console.log(row, isSelected, selectedRowKeys)
           console.log(row, isSelected, selectedRowKeys)
-          this.checkboxOption.selectedRowKeys = isSelected ? [selectedRowKeys[selectedRowKeys.length - 1]] : []
+          // 当前勾选产品
+          const endSelProduct = selectedRowKeys[selectedRowKeys.length - 1]
+          console.log('33333:', endSelProduct)
+          if (!(endSelProduct.stackFlag == '1')) {
+            this.checkboxOption.selectedRowKeys = isSelected ? [endSelProduct] : []
+          } else {
+            this.checkboxOption.selectedRowKeys = selectedRowKeys
+          }
           // 查询此活动下的产品列表
           // 查询此活动下的产品列表
           this.$emit('selected', isSelected ? row : null)
           this.$emit('selected', isSelected ? row : null)
-        }
+        },
+        // 禁用的选择(禁止勾选或者禁止取消勾选)
+        disableSelectedRowKeys: this.distabledProductList()
       },
       },
       // 单元格样式
       // 单元格样式
       cellStyleOption: {
       cellStyleOption: {
@@ -210,7 +223,7 @@ export default {
           title: '正价产品(金额)',
           title: '正价产品(金额)',
           children: [
           children: [
             {
             {
-              field: 'regularSelected',
+              field: 'regularQuota',
               key: 'f',
               key: 'f',
               title: '配额',
               title: '配额',
               width: 50,
               width: 50,
@@ -425,6 +438,13 @@ export default {
       openGuideModal: false //  导入产品引导
       openGuideModal: false //  导入产品引导
     }
     }
   },
   },
+  // 禁用未启用产品
+  computed: {
+    distabledProductList () {
+      const disabledArr = this.tableData.map(item => item.id)
+      return disabledArr
+    }
+  },
   methods: {
   methods: {
     async getDataList () {
     async getDataList () {
       this.hasInit = true
       this.hasInit = true
@@ -440,6 +460,7 @@ export default {
         // 正价统计
         // 正价统计
         const isYuan1 = item.regularRuleUnit == 'YUAN'
         const isYuan1 = item.regularRuleUnit == 'YUAN'
         const regularUnit = isYuan1 ? '元' : '个' // 单位
         const regularUnit = isYuan1 ? '元' : '个' // 单位
+        const regularQuota = item.gateQuotaAmount // 配额
         const regularSelected = isYuan1 ? item.regularTotalAmount : item.regularTotalQty // 已选
         const regularSelected = isYuan1 ? item.regularTotalAmount : item.regularTotalQty // 已选
         const regularTotal = isYuan1 ? item.regularBorrowAmount : item.regularBorrowQty // 累计
         const regularTotal = isYuan1 ? item.regularBorrowAmount : item.regularBorrowQty // 累计
         const regularBalance = 0 // 差额 = 额度 - 已选 - 累计
         const regularBalance = 0 // 差额 = 额度 - 已选 - 累计