Ver código fonte

Merge branch 'develop_yh30' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh30

chenrui 1 ano atrás
pai
commit
04aaa6ba53

+ 1 - 1
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -168,7 +168,7 @@ export default {
     // 选择经销商
     dealerChange (val) {
       this.queryParam.dealer.dealerSn = val.key
-      this.queryParam.dealer.dealerName = (val.label.replace('\n', '')).trim()
+      this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
     },
     pageInit () {
       const _this = this

+ 8 - 2
src/views/reportData/salesReturnDetailReport/list.vue

@@ -159,9 +159,9 @@
               <a-col :md="4" :sm="24">良品数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">返库数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? toThousands(totalData.totalNormalPrice) : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? toThousands(totalData.totalNormalCost) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_costPrice')">正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? toThousands(totalData.totalNormalCost) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">正常退货入库差额:{{ (totalData && (totalData.totalNormalBalance || totalData.totalNormalBalance==0)) ? toThousands(totalData.totalNormalBalance) : '--' }}</a-col>
             </a-row>
           </template>
@@ -313,12 +313,18 @@ export default {
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {
         arr.push({ title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions('M_salesReturnDetailReportList_costPrice')) {
         arr.push({ title: '再入库单价', dataIndex: 'cost', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       arr.push({ title: '正常退货数量', dataIndex: 'normalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) { //  价权限
         arr.push({ title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions('M_salesReturnDetailReportList_costPrice')) {
         arr.push({ title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) { //  价权限
         arr.push({ title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr

+ 6 - 1
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -232,7 +232,12 @@ export default {
         retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
       })
       console.log(retArr, '------------')
-      this.handlePrint(retArr, rows)
+      if(retArr.length){
+        this.handlePrint(retArr, rows)
+      }else{
+        this.$message.info("此收款单明细为空或没有相关数据权限")
+        this.spinning = false
+      }
     },
     // 收款打印
     handlePrint (row, list) {

+ 48 - 41
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -105,6 +105,7 @@
           showEmpty: false,
           showTableHead: true,
           colspanNums: 13,
+          hasOutStockOfActive: false,
           simpleImage: Empty.PRESENTED_IMAGE_SIMPLE
         }
       },
@@ -283,62 +284,65 @@
                 salesBillSn: this.salesBillSn,
                 showStock: this.showStock,
                 warehouseSn: this.warehouseSn,
-                promoFlag: this.promoFlag
+                promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
             }
             const active = this.activeList.filter(item => item.enabledFlag == 1)
 
             // 正常产品
-            const proList = await salesDetailAllList(params).then(res => res.data)
-            const norTotal = await salesDetaiCount(params).then(res => res.data)
+            const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+            const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+            const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
             // 没有活动时,表格不显示统计数据
             let listData = active.length ? (proList.length ? [{
                 id: 'promo-normal',
                 total: norTotal
               },...proList] : []) : proList
             
-            // 循环获取活动产品
-            for(let i=0;i<active.length;i++){
-              const promo = active[i]
-              const activeParams = {
-                promoRuleSn: promo.promoRuleSn,
-                promoSn: promo.promoSn,
-                salesPromoSn: promo.salesPromoSn,
-                ...params
-              }
-              
-              // 获取活动产品统计
-              const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-              if(acTotal){
-                // 采购额结余
-                acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
-                // 采购额超出
-                acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
-              }
-              // 有数据时才调用接口,避免做无用的调用
-              if(acTotal&&acTotal.totalQty){
-                // 获取活动产品列表
-                const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-                const retList = aclist.length ? [{
-                  id: 'promo-'+i,
-                  promo: promo,
-                  total: acTotal
-                },...aclist] : []
-                // 将活动产品数据拼接
-                listData = aclist&&aclist.length ? listData.concat(retList) : listData
+            if(params.promotionFlag != 0){  
+              // 循环获取活动产品
+              for(let i=0;i<active.length;i++){
+                const promo = active[i]
+                const activeParams = {
+                  promoRuleSn: promo.promoRuleSn,
+                  promoSn: promo.promoSn,
+                  salesPromoSn: promo.salesPromoSn,
+                  ...params
+                }
+                
+                // 获取活动产品统计
+                const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+                if(acTotal){
+                  // 采购额结余
+                  acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+                  // 采购额超出
+                  acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+                }
+                // 有数据时才调用接口,避免做无用的调用
+                if(acTotal&&acTotal.totalQty){
+                  // 获取活动产品列表
+                  const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+                  
+                  const retList = aclist.length ? [{
+                    id: 'promo-'+i,
+                    promo: promo,
+                    total: acTotal
+                  },...aclist] : []
+                  // 将活动产品数据拼接
+                  listData = aclist&&aclist.length ? listData.concat(retList) : listData
+                }
               }
-            }
-            console.log(listData)
-            // 如果活动没有任何产品,不显示统计一行
-            if(active.length){
-              const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-              if(hasAcp && hasAcp.length==0){
-                listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+              console.log(listData)
+              // 如果活动没有任何产品,不显示统计一行
+              if(active.length){
+                const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+                if(hasAcp && hasAcp.length==0){
+                  listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+                }
               }
             }
-
             console.log(listData)
             this.dataSource = listData
-
+            
             // 格式化数据
             let f = 0
             this.outStockStr = ''
@@ -357,6 +361,9 @@
               item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
               if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
                   str += item.productCode + '、'
+                  if(item.promotionFlag != 0){
+                    this.hasOutStockOfActive = true
+                  }
               }
             })
             if (str.length > 0) {

+ 3 - 3
src/views/salesManagement/salesQueryNew/detail.vue

@@ -102,7 +102,7 @@
                   </a-col>
                   <a-col flex="300px" v-if="hasPrompActive">
                     <a-form-item label="产品类型">
-                      <a-select v-model.trim="promoFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+                      <a-select v-model.trim="promoFlag" allowClear :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
                         <a-select-option value="0">
                           正常产品
                         </a-select-option>
@@ -346,10 +346,10 @@ export default {
     // 打开审核/一键审核弹框
     handleAudit (isBatch) {
       if (isBatch) { // 一键审核
-        if (this.detailData && this.detailData.promoFlag == 1 && this.$refs.productList.outStockStr != '') {
+        if (this.$refs.productList.hasOutStockOfActive) {
           this.$info({
             title: '提示',
-            content: '参加促销活动的销售单,有缺货产品,不可一键审核!',
+            content: '参加促销活动的产品存在缺货,不可一键审核!',
             centered: true
           })
           return

+ 48 - 55
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -16,7 +16,7 @@
           </a-col>
           <a-col :md="4" :sm="24" v-if="hasPrompActive">
             <a-form-item label="产品类型">
-              <a-select v-model.trim="queryParam.promoFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+              <a-select allowClear v-model.trim="queryParam.promotionFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
                 <a-select-option value="0">
                   正常产品
                 </a-select-option>
@@ -37,7 +37,7 @@
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-item label="下推类型">
-              <a-select v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
+              <a-select allowClear v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
                 <a-select-option value="">
                   全部产品
                 </a-select-option>
@@ -60,7 +60,7 @@
           </a-col>
           <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="searchTable" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm(null)" id="productInfoList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -159,7 +159,7 @@ export default {
         pushProductType: '', // 类型
         productCode: '', //  产品编码
         productName: '', //  产品名称
-        promoFlag: undefined, //  是否促销品
+        promotionFlag: undefined, //  是否促销品
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -412,17 +412,11 @@ export default {
         this.queryParam.salesBillSn = this.salesBillSn
         this.queryParam.showStock = true
         const params = this.queryParam
-        if(params.promoFlag){
-          params.isGifg = params.promoFlag == 1 ? 'Y' : 'N'
-        }else{
-          params.isGifg = undefined
-        }
- 
         const active = this.activeList
-
         // 正常产品
-        const proList = await salesDetailAllList(params).then(res => res.data)
-        const norTotal = await salesDetaiCount(params).then(res => res.data)
+        const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+        const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+        const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
         // 是否有正常产品
         this.hasNormalProduct = proList.length > 0
         //没有活动时不显示统计
@@ -430,49 +424,50 @@ export default {
             id: 'promo-normal',
             total: norTotal
           },...proList] : []) : proList
-         
-        // 循环获取活动产品
-        for(let i=0;i<active.length;i++){
-          const promo = active[i]
-          const activeParams = {
-            promoRuleSn: promo.promoRuleSn,
-            promoSn: promo.promoSn,
-            salesPromoSn: promo.salesPromoSn,
-            ...params
-          }
-          
-          
-          // 获取活动产品统计
-          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-          if(acTotal){
-            // 采购额结余
-            acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
-            // 采购额超出
-            acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
-          }
-           
-          // 有数据时才调用接口,避免做无用的调用
-          if(acTotal&&acTotal.totalQty){
-            // 获取活动产品列表
-            const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-            const retList = aclist.length ? [{
-              id: 'promo-'+i,
-              promo: promo,
-              total: acTotal
-            },...aclist] : []
-            // 将活动产品数据拼接
-            listData = aclist&&aclist.length ? listData.concat(retList) : listData
+        
+        if(params.promotionFlag != 0){
+          // 循环获取活动产品
+          for(let i=0;i<active.length;i++){
+            const promo = active[i]
+            const activeParams = {
+              promoRuleSn: promo.promoRuleSn,
+              promoSn: promo.promoSn,
+              salesPromoSn: promo.salesPromoSn,
+              ...params
+            }
+            
+            
+            // 获取活动产品统计
+            const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+            if(acTotal){
+              // 采购额结余
+              acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+              // 采购额超出
+              acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+            }
+             
+            // 有数据时才调用接口,避免做无用的调用
+            if(acTotal&&acTotal.totalQty){
+              // 获取活动产品列表
+              const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+              const retList = aclist.length ? [{
+                id: 'promo-'+i,
+                promo: promo,
+                total: acTotal
+              },...aclist] : []
+              // 将活动产品数据拼接
+              listData = aclist&&aclist.length ? listData.concat(retList) : listData
+            }
           }
-        }
-  
-        // 如果活动没有任何产品
-        if(active.length){
-          const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-          if(hasAcp && hasAcp.length==0){
-            listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+    
+          // 如果活动没有任何产品
+          if(active.length){
+            const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+            if(hasAcp && hasAcp.length==0){
+              listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+            }
           }
         }
-        
         console.log(listData)
         this.dataSource = listData
 
@@ -512,8 +507,6 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
-      this.queryParam.promoFlag = undefined
-      this.queryParam.isGifg = undefined
       this.productType = []
       this.dataSource = []
       this.clearSelectTable()