lilei 1 month ago
parent
commit
93ee162ff2

+ 30 - 23
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -61,6 +61,10 @@ export default {
     salesBillSn: {
       type: String,
       default: ''
+    },
+    showCols: {
+      type: Array,
+      default: () => []
     }
   },
   watch: {
@@ -115,16 +119,16 @@ export default {
           if (column.key >= 4 && column.key <= 8) {
             return 'table-header-cell-blue'
           }
-          if (column.key >= 9 && column.key < 10) {
+          if (column.key >= 9 && column.key < 12) {
             return 'table-header-cell-red'
           }
-          if (column.key >= 10 && column.key <= 13) {
+          if (column.key >= 12 && column.key <= 15) {
             return 'table-header-cell-green'
           }
-          if (column.key >= 14 && column.key <= 16) {
+          if (column.key >= 16 && column.key <= 18) {
             return 'table-header-cell-org'
           }
-          if (column.key >= 17 && column.key <= 19) {
+          if (column.key >= 19 && column.key <= 21) {
             return 'table-header-cell-zs'
           }
         },
@@ -302,7 +306,7 @@ export default {
             },
             {
               field: 'discountRuleValue',
-              key: '91',
+              key: '10',
               title: '基础',
               width: 60,
               align: 'center',
@@ -310,7 +314,7 @@ export default {
             },
             {
               field: 'discountRuleNextValue',
-              key: '92',
+              key: '11',
               title: '下阶差',
               width: 60,
               align: 'center',
@@ -323,7 +327,7 @@ export default {
           children: [
             {
               field: 'regularSelected',
-              key: '10',
+              key: '12',
               title: '已选',
               width: 50,
               align: 'center',
@@ -331,7 +335,7 @@ export default {
             },
             {
               field: 'regularTotal',
-              key: '11',
+              key: '13',
               title: '累计',
               width: 50,
               align: 'center',
@@ -339,7 +343,7 @@ export default {
             },
             {
               field: 'regularBaseVal',
-              key: '12',
+              key: '14',
               title: '基础',
               width: 60,
               align: 'center',
@@ -347,7 +351,7 @@ export default {
             },
             {
               field: 'regularNextVal',
-              key: '13',
+              key: '15',
               title: '下阶差',
               width: 60,
               align: 'center',
@@ -360,7 +364,7 @@ export default {
           children: [
             {
               field: 'promoLimit',
-              key: '14',
+              key: '16',
               title: '额度',
               width: 50,
               align: 'center',
@@ -368,7 +372,7 @@ export default {
             },
             {
               field: 'promoSelected',
-              key: '15',
+              key: '17',
               title: '已选',
               width: 50,
               align: 'center',
@@ -376,7 +380,7 @@ export default {
             },
             {
               field: 'promoBalance',
-              key: '16',
+              key: '18',
               title: '差额',
               width: 50,
               align: 'center',
@@ -389,7 +393,7 @@ export default {
           children: [
             {
               field: 'purchaseLimit',
-              key: '17',
+              key: '19',
               title: '额度',
               width: 50,
               align: 'center',
@@ -397,7 +401,7 @@ export default {
             },
             {
               field: 'purchaseSelected',
-              key: '18',
+              key: '20',
               title: '已选',
               width: 50,
               align: 'center',
@@ -405,7 +409,7 @@ export default {
             },
             {
               field: 'purchaseSurplus',
-              key: '19',
+              key: '21',
               title: '结余',
               width: 50,
               align: 'center',
@@ -413,8 +417,8 @@ export default {
             }
           ]
         },
-        { field: 'totalCategory', key: '20', title: '款数', width: 50, align: 'center', fixed: 'right' },
-        { field: 'totalQty', key: '21', title: '数量', width: 50, align: 'center', fixed: 'right' }
+        { field: 'totalCategory', key: '22', title: '款数', width: 50, align: 'center', fixed: 'right' },
+        { field: 'totalQty', key: '23', title: '数量', width: 50, align: 'center', fixed: 'right' }
       ]
       if (this.type == 'edit') {
         cols.unshift({
@@ -429,14 +433,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: '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]) } })
+        cols.push({ field: 'totalAmount', key: '24', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } })
+        cols.push({ field: 'lossAmount', key: '25', 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: '24',
+          key: '26',
           title: '状态',
           width: 50,
           center: 'center',
@@ -470,7 +474,7 @@ export default {
         })
         cols.push({
           field: '',
-          key: '25',
+          key: '27',
           title: '操作',
           width: 130,
           center: 'center',
@@ -536,7 +540,10 @@ export default {
           }
         })
       }
-      return cols
+      return cols.filter((item, index) => {
+        const i = this.type === 'edit' ? index - 1 : index
+        return this.showCols.includes(i.toString()) || (this.type === 'edit' && index == 0) || index > (this.type === 'edit' ? 8 : 7)
+      })
     }
   },
   methods: {

+ 45 - 6
src/views/salesManagement/salesQueryNew/detail.vue

@@ -209,16 +209,35 @@
       <a-card
         size="small"
         :bordered="false"
-        title="活动产品"
         class="salesEdit-cont"
         v-if="!hideActiveTable"
       >
+        <div slot="title">
+          <div style="display: flex;justify-content: space-between;align-items: center;">
+            <strong>活动产品</strong>
+            <div>
+              <a-popover placement="bottom">
+                <template slot="content">
+                  <a-checkbox-group v-model="colsValue">
+                    <a-row style="width:100px;padding:0;">
+                      <a-col :span="24" style="margin:3px 0;" v-for="(item) in colsOptions" :key="item.value">
+                        <a-checkbox :value="item.value">{{ item.label }}</a-checkbox>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button size="small" type="link" class="button-info"><a-icon type="eye"/> 显示列</a-button>
+              </a-popover>
+            </div>
+          </div>
+        </div>
         <activeStatisticsList
           ref="activeTjList"
           type="view"
           :activeList="activeList"
           :warehouseSn="warehouseSn"
           :salesBillSn="$route.params.sn || bizSn"
+          :showCols="colsValue"
         ></activeStatisticsList>
         <detailProductList
           ref="productActiveList"
@@ -275,10 +294,10 @@
         type="primary"
         class="button-info"
         id="salesDetail-UPaudit-btn"
-        v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'SUPERIOR_AUDIT_REJECT' || detailData.billStatus == 'TRANSFER_AUDIT_REJECT')&&$hasPermissions('B_salesAudit')&&$route.params.pageType!='salesNewDetailTransfer'"
+        v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||isSupAudit||detailData.billStatus == 'SUPERIOR_AUDIT_REJECT' || detailData.billStatus == 'TRANSFER_AUDIT_REJECT')&&$hasPermissions('B_salesAudit')"
         @click="handleAudit()"
       >
-        {{ detailData.billStatus=='WAIT_UP_AUDIT_PASS'?'上级':'' }}审核
+        {{ isSupAudit?'上级':'' }}审核
       </a-button>
       <!-- 转单审核 -->
       <a-button
@@ -287,7 +306,7 @@
         type="primary"
         class="button-info"
         id="salesDetail-audit-btn"
-        v-if="$hasPermissions('B_higherLevelAudit')&&detailData&&detailData.billStatus == 'SUPERIOR_WAIT_AUDIT'"
+        v-if="$hasPermissions('B_higherLevelAudit')&&detailData&&detailData.billStatus == 'SUPERIOR_WAIT_AUDIT'&&detailData.transferFlag=='1'"
         @click="handleTransferAudit"
       >
         审核
@@ -419,7 +438,9 @@ export default {
       openTransferOrder: false, // 打开转单弹窗
       selectedDealer: '', // 发货经销商名称
       selectedDealerSn: undefined, // 发货经销商sn
-      chooseDealerList: []// 发货经销商数据
+      chooseDealerList: [], // 发货经销商数据
+      colsOptions: [],
+      colsValue: []
     }
   },
   computed: {
@@ -466,6 +487,10 @@ export default {
         return window.innerHeight - 320 + (this.hideFooter ? 45 : 0)
       }
       return 'auto'
+    },
+    // 是否上级审核
+    isSupAudit () {
+      return this.detailData && this.detailData.billStatus == 'SUPERIOR_WAIT_AUDIT' && (this.detailData.transferFlag == 0 || this.detailData.transferFlag == undefined)
     }
   },
   methods: {
@@ -478,6 +503,19 @@ export default {
     openDealerModal () {
       this.openDealerStock = true
     },
+    getColsOptions () {
+      this.colsOptions = [
+        { label: '序号', value: '0' },
+        { label: '活动类型', value: '1' },
+        { label: '规则简称', value: '2' },
+        { label: '门槛产品', value: '3' },
+        { label: '特价', value: '4' },
+        { label: '正价产品', value: '5' },
+        { label: '促销品', value: '6' },
+        { label: '采购额', value: '7' }
+      ]
+      this.colsValue = this.colsOptions.map(item => item.value)
+    },
     // 确定选择经销商库存转单
     openDealerStockOk (val, data) {
       this.selectedDealer = val.dealerName
@@ -591,6 +629,7 @@ export default {
         if (!this.hideActiveTable) {
           this.$refs.activeTjList.hasInit = false
         }
+        this.getColsOptions()
       })
       this.spinning = false
       setTimeout(() => {
@@ -836,7 +875,7 @@ export default {
         return
       }
       // 不通过 或 是 如果是待上级审核,调用
-      if (type == 'AUDIT_REJECT' || this.detailData.billStatus == 'WAIT_UP_AUDIT_PASS') {
+      if (type == 'AUDIT_REJECT' || this.isSupAudit) {
         this.auditOrder(type)
       } else {
         this.spinning = true

+ 33 - 2
src/views/salesManagement/salesQueryNew/edit.vue

@@ -61,6 +61,18 @@
           <div style="display: flex;justify-content: space-between;align-items: center;">
             <strong>活动产品</strong>
             <div>
+              <a-popover placement="bottom">
+                <template slot="content">
+                  <a-checkbox-group v-model="colsValue">
+                    <a-row style="width:100px;padding:0;">
+                      <a-col :span="24" style="margin:3px 0;" v-for="(item) in colsOptions" :key="item.value">
+                        <a-checkbox :value="item.value">{{ item.label }}</a-checkbox>
+                      </a-col>
+                    </a-row>
+                  </a-checkbox-group>
+                </template>
+                <a-button size="small" type="link" class="button-info"><a-icon type="eye"/> 显示列</a-button>
+              </a-popover>
               <a-button size="small" @click="showActiveList=!showActiveList" type="link" class="button-info"><a-icon :type="showActiveList?'up':'down'"/> {{ showActiveList?'收起':'展开' }}活动</a-button>
               <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
             </div>
@@ -72,6 +84,7 @@
           @openCpModal="openProductModal"
           @refash="refashTableData"
           @selected="active => salesPromoSnSet = active"
+          :showCols="colsValue"
           :activeList="activeList"
           :warehouseSn="warehouseSn"
           :salesBillSn="salesBillSn"
@@ -235,7 +248,9 @@ export default {
       showDiscountSortModal: false, // 特价活动排序弹框
       discountActiveList: [], // 可叠加的特价活动列表
       openVaildPriceModal: false, // 销售价低于成本价提示弹窗
-      tempData: null// 销售价低于成本价 弹窗列表数据
+      tempData: null, // 销售价低于成本价 弹窗列表数据
+      colsOptions: [],
+      colsValue: []
     }
   },
   computed: {
@@ -261,6 +276,19 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
+    getColsOptions () {
+      this.colsOptions = [
+        { label: '序号', value: '0' },
+        { label: '活动类型', value: '1' },
+        { label: '规则简称', value: '2' },
+        { label: '门槛产品', value: '3' },
+        { label: '特价', value: '4' },
+        { label: '正价产品', value: '5' },
+        { label: '促销品', value: '6' },
+        { label: '采购额', value: '7' }
+      ]
+      this.colsValue = this.colsOptions.map(item => item.value)
+    },
     // 查看参与规则明细
     showRuleDetail (sn) {
       this.$refs.activeTjList.showDesc({ promoRuleSn: sn })
@@ -477,7 +505,10 @@ export default {
     async getActiveList (flag) {
       this.spinning = true
       // 触发活动统计查询变量
-      if (this.$refs.activeTjList) this.$refs.activeTjList.hasInit = false
+      if (this.$refs.activeTjList) {
+        this.$refs.activeTjList.hasInit = false
+      }
+      this.getColsOptions()
       // 已参与活动列表
       const list = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
       this.activeList = list.filter(item => item.promotion && item.promotionRule)