lilei 6 days ago
parent
commit
5b39435055

+ 3 - 4
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -378,8 +378,7 @@ export default {
         salesBillSn: this.salesBillSn,
         salesBillSn: this.salesBillSn,
         showStock: this.showStock,
         showStock: this.showStock,
         warehouseSn: this.warehouseSn,
         warehouseSn: this.warehouseSn,
-        borrowFlag: this.borrowFlag,
-        promoProductClz: this.promoProductClz == '' ? undefined : this.promoProductClz
+        borrowFlag: this.borrowFlag
       }
       }
       // 查询正常产品
       // 查询正常产品
       if (this.type == 'normal') {
       if (this.type == 'normal') {
@@ -389,9 +388,9 @@ export default {
         } else {
         } else {
           // 查询正常产品明细列表
           // 查询正常产品明细列表
           if (this.promoProductClz == 0 || this.promoProductClz == undefined) {
           if (this.promoProductClz == 0 || this.promoProductClz == undefined) {
-            this.dataSource = await salesDetailAllList(params).then(res => res.data || [])
+            this.dataSource = await salesDetailAllList({ ...params, promotionFlag: this.promoProductClz == '' ? undefined : this.promoProductClz }).then(res => res.data || [])
             if (this.activeList.length > 0) {
             if (this.activeList.length > 0) {
-              this.countData = await salesDetaiCount(params).then(res => res.data)
+              this.countData = await salesDetaiCount({ ...params, promoProductClz: this.promoProductClz == '' ? undefined : this.promoProductClz }).then(res => res.data)
             }
             }
           }
           }
         }
         }

+ 7 - 2
src/views/salesManagement/waitDispatchNew/detailProductList.vue

@@ -98,6 +98,10 @@ export default {
         }
         }
       }
       }
     },
     },
+    // 是否有促销活动产品
+    hasPrompActive () {
+      return this.detailData && this.detailData.promoFlag == 1
+    },
     columns () {
     columns () {
       const _this = this
       const _this = this
       // 价格
       // 价格
@@ -171,7 +175,7 @@ export default {
         { title: '操作', field: 'action', width: 100, key: 's', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row, row[column.field], h) } }
         { title: '操作', field: 'action', width: 100, key: 's', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row, row[column.field], h) } }
       ]
       ]
 
 
-      if (this.detailData && this.detailData.promoFlag == 1) {
+      if (this.hasPrompActive) {
         arr.splice(2, 0, {
         arr.splice(2, 0, {
           title: '规则数量',
           title: '规则数量',
           field: 'prompName',
           field: 'prompName',
@@ -292,8 +296,9 @@ export default {
     },
     },
     // 页面初始化
     // 页面初始化
     pageInit (productForm, detailData, activeList) {
     pageInit (productForm, detailData, activeList) {
+      console.log(detailData, 'detailData')
       this.productForm = Object.assign(this.productForm, productForm)
       this.productForm = Object.assign(this.productForm, productForm)
-      this.detailData = detailData
+      // this.detailData = detailData
       this.activeList = activeList
       this.activeList = activeList
       // 查询列表
       // 查询列表
       this.resetSearchForm()
       this.resetSearchForm()

+ 4 - 3
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -93,7 +93,7 @@ export default {
     },
     },
     // 统计查询
     // 统计查询
     getTotalData (flag) {
     getTotalData (flag) {
-      findBySalesBillSn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
+      findBySalesBillSn({ salesBillSn: this.salesBillSn }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           this.totalData = res.data || null
           this.totalData = res.data || null
           if (res.data && Object.keys(res.data).length > 0) {
           if (res.data && Object.keys(res.data).length > 0) {
@@ -213,6 +213,7 @@ export default {
       salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
       salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           this.detailData = res.data
           this.detailData = res.data
+          this.$refs.waitProduct.detailData = res.data
           if (flag) {
           if (flag) {
             // 初始化表格
             // 初始化表格
             this.$refs.partQuery.pageInit(this.salesBillSn, this.detailData)
             this.$refs.partQuery.pageInit(this.salesBillSn, this.detailData)
@@ -257,14 +258,14 @@ export default {
     },
     },
     // 页面初始化
     // 页面初始化
     async pageInit () {
     async pageInit () {
+      this.salesBillSn = this.$route.params.salesBillSn
       // 已参与活动列表
       // 已参与活动列表
       this.spinning = true
       this.spinning = true
-      const list = await salesPromoQueryList({ salesBillSn: this.$route.params.salesBillSn || this.bizSn }).then(res => res.data || [])
+      const list = await salesPromoQueryList({ salesBillSn: this.salesBillSn || this.bizSn }).then(res => res.data || [])
       this.activeList = list.filter(item => item.promotion && item.promotionRule)
       this.activeList = list.filter(item => item.promotion && item.promotionRule)
       this.spinning = false
       this.spinning = false
       // 查询表格数据
       // 查询表格数据
       this.$refs.partQuery.clearSelectTable()
       this.$refs.partQuery.clearSelectTable()
-      this.salesBillSn = this.$route.params.salesBillSn
       this.getOrderDetail(true)
       this.getOrderDetail(true)
       this.getTotalData(true)
       this.getTotalData(true)
     }
     }

+ 10 - 7
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -400,7 +400,14 @@ export default {
         { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
         { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
         { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
         { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
         { title: '产品名称', field: 'productName', key: 'c', width: 220, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         { title: '产品名称', field: 'productName', key: 'c', width: 220, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
-        {
+        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
+      // 单元格合并数量
+      this.colspanNums = this.showConvertPromoGifts ? 7 : 6
+      if (this.hasPrompActive) {
+        this.colspanNums = this.colspanNums + 1
+        arr.splice(4, 0, {
           title: '规则数量',
           title: '规则数量',
           field: 'rulesNums',
           field: 'rulesNums',
           key: '4',
           key: '4',
@@ -427,12 +434,8 @@ export default {
                 </a-popover> : '--'
                 </a-popover> : '--'
             )
             )
           }
           }
-        },
-        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
-        { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
-      ]
-      // 单元格合并数量
-      this.colspanNums = this.showConvertPromoGifts ? 8 : 7
+        })
+      }
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
         this.colspanNums = this.colspanNums + 1
         this.colspanNums = this.colspanNums + 1
         arr.push({ title: '销售价', field: 'price', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row, row[column.field], h) } })
         arr.push({ title: '销售价', field: 'price', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row, row[column.field], h) } })