Procházet zdrojové kódy

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

chenrui před 1 rokem
rodič
revize
744eaaeb19

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.49",
+    "version": "2.2.60",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -310,7 +310,7 @@ export default {
     }
     .flex{
       display:flex;
-      align-item:center;
+      align-items: center;
     }
     .footer-cont{
       margin-top: 5px;

+ 1 - 3
src/views/salesManagement/salesQuery/detail.vue

@@ -121,16 +121,14 @@
           bordered>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
-            <div v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
+            <div>
               <span>{{ text }}</span>
               <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-              <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
               <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
               <!-- 可审核时才可显示“缺”货产品 -->
               <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
               </a-badge>
             </div>
-            <span v-else>{{ text }}</span>
           </template>
           <!-- 当前库存 -->
           <template slot="stockQty" slot-scope="text, record">

+ 6 - 2
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -76,6 +76,10 @@
             placeholder="请输入" />
         </div>
       </template>
+      <!-- 价格 -->
+      <template slot="productPrice" slot-scope="text, record">
+         {{ text }} (<span title="原价">{{ record.origPrice }}</span>)
+      </template>
       <!-- 产品名称 -->
       <template slot="productName" slot-scope="text, record">
         <div class="ellipsisCon">
@@ -159,7 +163,7 @@ export default {
               const productUnit = data.list[i].productUnit || '--'
               const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
               data.list[i].packQtyV = productPackQty + productUnit + '/' + productPackQtyUnit
-              data.list[i].unitQtyV = data.list[i].unitQty + data.list[i].unitTypeDictValue
+              data.list[i].unitQtyV = data.list[i].unitQty + data.list[i].productUnit
             }
             this.disabled = false
           }
@@ -185,7 +189,7 @@ export default {
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'right', scopedSlots: { customRender: 'productPrice' } })
       }
       return arr
     }

+ 19 - 14
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -17,7 +17,7 @@
             :cell-span-option="cellSpanOption"
             :column-width-resize-option="columnWidthResizeOption"
           />
-        <div v-show="showEmpty" class="empty-data">暂无数据</div>
+        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品"/></div>
         <!-- 活动规则详情 -->
         <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
     </a-spin>
@@ -118,10 +118,6 @@
               ftext = '促'
               fcolor = '#52c41a'
             }
-            // if(record.promotionFlag == 'REGULAR'){
-            //   ftext = '正'
-            //   fcolor = '#108ee9'
-            // }
             if(record.promotionFlag == 'DISCOUNT'){
               ftext = '特'
               fcolor = '#faad14'
@@ -130,7 +126,7 @@
                     <div>
                         <span style="padding-right: 15px;">{data}</span>
                         {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
-                        {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
+                        {(Number(record.stockQty||0) < Number(record.unpushedQty||0)) && _this.showStock?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
                     </div>
                 )
           }
@@ -152,9 +148,9 @@
                         款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
                         数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
                         {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>优惠金额:<strong>{record.total.lossAmount||'--'}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额结余:<strong>{_this.toThousands(Number(record.total.totalPromoGiftsAmount) - Number(record.total.totalUsePromoGiftsAmount))}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额超出:<strong>{_this.toThousands(Number(record.total.totalUsePromoGiftsAmount) - Number(record.total.totalPromoGiftsAmount))}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgeccAmount ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                         {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                     </div>
                   </div>
@@ -280,16 +276,18 @@
                 showStock: this.showStock,
                 warehouseSn: this.warehouseSn
             }
+            const active = this.activeList
+
             // 正常产品
             const proList = await salesDetailAllList(params).then(res => res.data)
             const norTotal = await salesDetaiCount(params).then(res => res.data)
-            let listData = [{
+            // 没有活动时,表格不显示统计数据
+            let listData = active.length ? (proList.length ? [{
                 id: 'promo-normal',
                 total: norTotal
-              },...proList]
+              },...proList] : []) : proList
             
             // 循环获取活动产品
-            const active = this.activeList
             for(let i=0;i<active.length;i++){
               const promo = active[i]
               const activeParams = {
@@ -303,11 +301,15 @@
               const aclist = await salesDetailAllList(activeParams).then(res => res.data)
               // 获取活动产品统计
               const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-              const retList = [{
+              // 采购额结余
+              acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount) - Number(acTotal.totalUsePromoGiftsAmount)
+              // 采购额超出
+              acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount) - Number(acTotal.totalPromoGiftsAmount)
+              const retList = aclist.length ? [{
                 id: 'promo-'+i,
                 promo: promo,
                 total: acTotal
-              },...aclist]
+              },...aclist] : []
               listData = aclist&&aclist.length ? listData.concat(retList) : listData
             }
 
@@ -365,4 +367,7 @@
     .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
       padding: 0;
     } 
+    .ve-table .ve-table-container .ve-table-content-wrapper{
+      border-bottom: 1px solid #ddd;
+    }
   </style>

+ 29 - 14
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -15,27 +15,30 @@
               </span>
               <span v-else>购买满{{ descDetail.gateAmount }}元门槛产品,可使用 {{ descDetail.quotaAmount }}元配额,采购规则中的正价商品</span>
             </div>
-            <span v-else>--</span>
+            <span v-else></span>
           </a-descriptions-item>
           <a-descriptions-item label="促销规则">
-            <div v-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_PROD'">
+            {{ descDetail.regularSameFlag==='1'?'同款,':'不同款,' }}
+            <span v-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_PROD'">
               购买满{{ descDetail.regularQty }}个正价产品,送{{ descDetail.promotionQty }}个促销产品
-            </div>
-            <div v-else-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
+              {{ descDetail.accrualFlag ? ',数量叠加':',数量不叠加' }}
+            </span>
+            <span v-else-if="descDetail.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
               购买满{{ descDetail.regularAmount }}元正价产品,送{{ descDetail.giveAmount }}元促销品采购额
-            </div>
-            <div v-else>
+              {{ descDetail.accrualFlag ? ',金额叠加':',金额不叠加' }}
+            </span>
+            <span v-else>
               特价产品
-            </div>
+            </span>
           </a-descriptions-item>
-          <a-descriptions-item label="显示正价产品款数">
+          <a-descriptions-item label="限制正价产品款数" v-if="descDetail.promotionRuleType!='PROMO_PROD'&&descDetail.promotionRuleType!='BUY_PROD_GIVE_MONEY'">
             {{ descDetail.restrictCategory||'--' }}
           </a-descriptions-item>
-          <a-descriptions-item label="订单起订金额">
-            {{ descDetail.minOrderAmount||'--' }}
+          <a-descriptions-item label="订单起订金额(元)">
+            {{ descDetail.minOrderAmount||'' }}
           </a-descriptions-item>
-          <a-descriptions-item label="活动经费上线">
-            {{ descDetail.upperLimitAmount||'--' }}
+          <a-descriptions-item label="活动经费上线(元)">
+            {{ descDetail.upperLimitAmount||'' }}
           </a-descriptions-item>
         </a-descriptions>
     </div>
@@ -161,6 +164,12 @@
           <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
         </div>
       </template>
+      
+      <!-- 促销价 -->
+      <template slot="discountPrice" slot-scope="text, record">
+        <span>{{ record.discountedPrice }}</span>
+        ({{ record.discountRate }}%)
+      </template>
       <!-- 销售数量 -->
       <template slot="salesNums" slot-scope="text, record">
         <a-input-number
@@ -230,7 +239,7 @@
                 </div>
                 <div>
                   <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong></div>
-                  <div v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>{{ countData&&(countData.lossAmount || countData.lossAmount==0) ? toThousands(countData.lossAmount) : '--' }}</strong></div>
+                  <div v-if="$hasPermissions('B_salesEdit_salesPrice')&&countData&&countData.lossAmount">优惠金额:<strong>{{ toThousands(countData.lossAmount) }}</strong></div>
                 </div>
               </div>
             </div>
@@ -333,6 +342,7 @@
               for (var i = 0; i < data.list.length; i++) {
                 data.list[i].no = no + i + 1
                 data.list[i].qtyBackups = data.list[i].qty
+                data.list[i].unitQtyV = data.list[i].unitQty ? (data.list[i].unitQty + data.list[i].productEntity.unit) : '--'
               }
               this.disabled = false
               this.dataSource = data.list
@@ -375,7 +385,7 @@
           { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
           { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
           { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
-          // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '起订量', dataIndex: 'unitQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
           { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
           { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
@@ -385,6 +395,10 @@
         ]
         if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
           arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+          // 如果是特价活动
+          if(this.promo.promotionRule.promotionRuleType=='PROMO_PROD'){
+            arr.splice(4, 0, { title: '促销价', dataIndex: 'discountPrice', width: '8%', align: 'right', scopedSlots: { customRender: 'discountPrice' }})
+          }
           arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         }
         return arr
@@ -452,6 +466,7 @@
         this.queryParam.productTypeSn2 = ''
         this.queryParam.productTypeSn3 = ''
         this.productType = []
+        this.rowSelectionInfo = null
         this.$refs.table.clearSelected()
         this.$refs.table.refresh(!!flag)
       },

+ 7 - 3
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -86,7 +86,7 @@
       :data="loadData"
       :row-selection="{ columnWidth: 40 }"
       @rowSelection="rowSelectionFun"
-      :pageSize="10"
+      :pageSize="showTotal?10:30"
       bordered>
       <!-- 产品编码 -->
       <template slot="productCode" slot-scope="text, record">
@@ -152,9 +152,9 @@
           @click="handleDel(record)"
         >删除</a-button>
       </template>
-      <template slot="footer" slot-scope="currentPageData">
+      <template slot="footer">
         <!-- 总计 -->
-        <a-alert type="info" banner :showIcon="false">
+        <a-alert type="info" v-if="showTotal" banner :showIcon="false">
           <div slot="message">
               <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong>;</span>
               总款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : '--' }}</strong>;
@@ -218,6 +218,10 @@
       salesBillSn: {
         type: String,
         default: ''
+      },
+      showTotal:{
+        type: Boolean,
+        default: true
       }
     },
     data () {

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -24,7 +24,7 @@
                     <li><strong>促销类型:</strong> 买产品送产品</li>
                     <li><strong>促销门槛:</strong> 购买1000元门槛产品,可使用200元配额,采购正价产品</li>
                     <li><strong>促销规则:</strong> 购买满10个正价产品,送10个促销产品</li>
-                    <li><strong>显示正价产品款数:</strong> 40</li>
+                    <li><strong>限制正价产品款数</strong> 40</li>
                     <li><strong>订单起订金额:</strong> 20000</li>
                     <li><strong>活动经费上线:</strong> 5000</li>
                   </ul>

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

@@ -6,9 +6,9 @@
           <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
           <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
-          <span style="margin-left:15px;color:#00aaff;cursor:pointer;"  @click="showDetail=!showDetail">
-            <a-icon title="查看信息" type="eye"/> 查看信息
-          </span>
+          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+            <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
+          </a-button>
         </template>
         <template slot="extra">
           <a-button
@@ -83,7 +83,7 @@
                 <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
                 <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions(authCode + '_salesPrice')" style="color: red;">优惠金额:<strong>{{ detailData&&(detailData.totalLossAmount || detailData.totalLossAmount==0) ? toThousands(detailData.totalLossAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalLossAmount" style="color: red;">优惠金额:<strong>{{ toThousands(detailData.totalLossAmount) }}</strong>;</span>
               </div>
               <div>
                 <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>

+ 34 - 50
src/views/salesManagement/salesQueryNew/edit.vue

@@ -7,9 +7,9 @@
           <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
           <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
-          <span style="margin-left:15px;color:#00aaff;cursor:pointer;"  @click="showDetail=!showDetail">
-            <a-icon title="查看信息" type="eye"/> 查看信息
-          </span>
+          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+            <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
+          </a-button>
         </template>
       </a-page-header>
       <!-- 单据详情 -->
@@ -35,6 +35,7 @@
           ref="productNormalList" 
           @insterOk="insterActiveOk"
           @openCpModal="openProductModal" 
+          :showTotal="activeList.length>0"
           :detailData="detailData" 
           :warehouseSn="warehouseSn" 
           :salesBillSn="salesBillSn"></productNormalList>
@@ -79,16 +80,24 @@
         <div v-if="detailData">
           <div class="totalPrice">总售价:¥<span>{{ toThousands(detailData.totalAmount) }}</span></div>
           <div>
-            产品总款数:<strong>{{ detailData.totalCategory }}</strong>
-            总数量:<strong>{{ detailData.totalQty }}</strong>
-            <span style="margin-right:10px;">优惠金额:<strong>{{ toThousands(detailData.totalLossAmount) }}</strong></span>
+            产品总款数:<strong style="margin-right: 10px;"> {{ detailData.totalCategory }} </strong>
+            总数量:<strong> {{ detailData.totalQty }} </strong>
+            <span style="margin:0 0 0 10px;" v-if="detailData.totalLossAmount">优惠金额:<strong>{{ toThousands(detailData.totalLossAmount) }}</strong></span>
             <a-popover title="优惠明细" @visibleChange="(visible)=>{visible&&getPromYhDetail()}">
-              <a-button shape="round" size="small">优惠明细</a-button>
+              <a-button shape="round" size="small" v-if="detailData.totalLossAmount">优惠明细</a-button>
               <div slot="content">
                 <div v-if="yhDetail">
-                    <div class="yhdetail" style="min-width:300px;margin-bottom: 5px;" v-for="(item,index) in yhDetail.promoMapList" :key="index">
+                    <div 
+                    class="yhdetail" 
+                    style="min-width:300px;margin-bottom: 5px;" 
+                    v-for="(item,index) in yhDetail.promoMapList" 
+                    :key="index">
                       <div class="yhdetail-h" style="font-weight: bold;font-size:14px;">{{ item.title }}</div>
-                      <div style="padding-left:10px;" v-for="(sitem,sindex) in item.promoRuleMapList" :key="sindex">
+                      <div style="padding-left:10px;" 
+                      v-for="(sitem,sindex) in item.promoRuleMapList" 
+                      :key="sindex" 
+                      v-if="sitem.lossAmount"
+                      >
                         <div style="display: flex;justify-content: space-between;">
                           <span>{{sitem.promotionRuleTypeDictValue}}:</span>
                           <strong>¥{{ toThousands(sitem.lossAmount) }}</strong>
@@ -133,6 +142,12 @@
     :totalAmount="updataData.totalAmount" 
     @ok="updatePrice" 
     @cancel="priceUpdateModal=false"></setPriceModal>
+    <!-- 新活动窗口 -->
+    <newPromoModal
+    :show="showNewActiveModal"
+    :salesBillSn="salesBillSn"
+    :newActiveList="newActiveList"
+    ></newPromoModal>
  </div>
 </template>
 
@@ -142,7 +157,8 @@ import productList from './comps/productList.vue'
 import productNormalList from './comps/productNormalList.vue'
 import chooseProduct from './comps/chooseProduct.vue'
 import setPriceModal from './setPriceModal.vue'
-import { salesDisablePromo, salesChangePromo, salesDetailAddPromo } from '@/api/salesDetailNew'
+import newPromoModal from './newPromoModal.vue'
+import { salesDisablePromo, salesChangePromo } from '@/api/salesDetailNew'
 import { salesDetailBySn,salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo,salesPromoValidaSubmit } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
@@ -151,7 +167,8 @@ export default {
     setPriceModal,
     productList,
     chooseProduct,
-    productNormalList
+    productNormalList,
+    newPromoModal
   },
   data () {
     return {
@@ -171,7 +188,8 @@ export default {
       showCpModal: false,
       cpCurRefId: '',
       disabledActiveOption: null,
-      yhDetail: null
+      yhDetail: null,
+      showNewActiveModal: false
     }
   },
   computed: {
@@ -218,10 +236,10 @@ export default {
     // 获取销售单参与的活动列表
     async getActiveList(){
       const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn }).then(res => res.data)
-      this.newActiveList = hasNewActive
       // 有新活动
       if(hasNewActive.length){
-        this.showNewActiveModal(hasNewActive)
+        this.newActiveList = hasNewActive
+        this.showNewActiveModal=true
       }
       this.activeList = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
       this.activeList.map(item => {
@@ -229,42 +247,8 @@ export default {
         this.activeDesKey['search-'+item.promoRuleSn] = false
       })
     },
-    // 新活动确认弹框
-    showNewActiveModal(data){
-      const _this = this
-      let arr = []
-      let promoSnList = []
-      data.map(item => {
-        arr.push(item.title)
-        promoSnList.push(item.promotionSn)
-      })
-      this.$confirm({
-        title: '新活动提醒',
-        centered: true,
-        class:'confirm-center',
-        content: <div>
-          <div style="padding:10px 0;text-align:center;">
-            系统发布新的促销活动:
-          </div>
-          <div style="text-align:center;color:#00aaff;">{arr.join(',')}</div>
-          <div style="padding:10px 0;text-align:center;">
-            是否将现有产品识别到新的活动中吗?
-          </div>
-        </div>,
-        onOk() {
-          salesDetailAddPromo({
-            "salesBillSn": _this.salesBillSn,
-            "promoSnList": promoSnList
-          }).then(res => {
-            if(res.status == 200){
-              _this.pageInit()
-            }else{
-              _this.showNewActiveModal(_this.newActiveList)
-            }
-          })
-        },
-        onCancel() {},
-      });
+    showNewActiveOk(){
+      this.pageInit()
     },
     // 添加产品,包括正常和活动的产品
     closeProductModal(){

+ 0 - 1
src/views/salesManagement/salesQueryNew/list.vue

@@ -142,7 +142,6 @@
               </div>
             </div>
             <div>
-              <a-checkbox v-model="showCancelNum"><span style="display: inline-block;margin-top: 1px;">显示促销单</span></a-checkbox>
               <a-checkbox v-model="showCancelNum"><span style="display: inline-block;margin-top: 1px;">显示取消数量</span></a-checkbox>
             </div>
           </div>

+ 90 - 0
src/views/salesManagement/salesQueryNew/newPromoModal.vue

@@ -0,0 +1,90 @@
+<template>
+    <a-modal
+      v-model="opened"
+      title="新活动提醒"
+      centered
+      :maskClosable="false"
+      :confirmLoading="confirmLoading"
+      width="30%"
+      :footer="null"
+      @cancel="cancel"
+    >
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div style="padding: 0 50px;">
+          <div style="padding:10px 0;text-align:left;">
+            系统发布新的促销活动,是否要参与?
+          </div>
+          <div style="text-align:left;color:#00aaff;">
+            <a-checkbox-group v-model="newPromoSnList">
+              <a-row v-for="item in newActiveList" :key="item.promotionSn">
+                <a-col :span="24"><a-checkbox :value="item.promotionSn">{{ item.title }}</a-checkbox></a-col>
+              </a-row>
+            </a-checkbox-group>
+          </div>
+        </div>
+        <div style="margin-top:36px;text-align:center;">
+          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+        </div>
+      </a-spin>
+    </a-modal>
+  </template>
+  
+  <script>
+  import { commonMixin } from '@/utils/mixin'
+  import { salesDetailAddPromo } from '@/api/salesDetailNew'
+  export default {
+    name: 'newPromoModal',
+    mixins: [commonMixin],
+    props: {
+      show: [Boolean],
+      newActiveList: [Array],
+      salesBillSn: [String]
+    },
+    data () {
+      return {
+        opened: this.show,
+        spinning: false,
+        newPromoSnList: [],
+        confirmLoading: false
+      }
+    },
+    methods: {
+      //  保存
+      handleSubmit () {
+        const _this = this
+        if(_this.newPromoSnList.length){
+            salesDetailAddPromo({
+              "salesBillSn": _this.salesBillSn,
+              "promoSnList": _this.newPromoSnList
+            }).then(res => {
+              if(res.status == 200){
+                _this.$emit('ok')
+              }
+            })
+          }else{
+            _this.$message.info("请选择要参与的新活动")
+            return true
+          }
+      },
+      cancel () {
+        this.opened = false
+        this.$emit('cancel')
+      }
+    },
+    watch: {
+      show (newValue, oldValue) {
+        this.opened = newValue
+        if (!newValue) {
+          this.newPromoSnList = []
+        }else{
+            // 默认全选
+            this.newActiveList.map(item => {
+               this.newPromoSnList.push(item.promotionSn)
+            })
+        }
+      }
+    }
+  }
+  </script>
+  

+ 4 - 1
src/views/salesManagement/waitDispatchNew/detailProductList.vue

@@ -29,7 +29,7 @@
                 :column-width-resize-option="columnWidthResizeOption"
                 :checkbox-option="checkboxOption"
               />
-          <div v-show="showEmpty" class="empty-data">暂无待下推产品</div>
+          <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品"/></div>
       </a-spin>
   
     </div>
@@ -366,4 +366,7 @@
     .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
       padding: 0;
     } 
+    .ve-table .ve-table-container .ve-table-content-wrapper{
+      border-bottom: 1px solid #ddd;
+    }
   </style>

+ 21 - 9
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -88,14 +88,14 @@
               :cellSelectionOption="{enable: false}"
               :virtual-scroll-option="{enable: true}"
               :columns="columns"
-              :table-data="dataSource"
+              :table-data="tableData"
               row-key-field-name="id"
               :cell-style-option="cellStyleOption"
               :cell-span-option="cellSpanOption"
               :column-width-resize-option="columnWidthResizeOption"
               :checkbox-option="checkboxOption"
             />
-        <div v-show="showEmpty" class="empty-data">暂无数据</div>
+        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品"/></div>
         <!-- 活动规则详情 -->
         <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
     </a-spin>
@@ -152,6 +152,7 @@ export default {
       activeList: [], // 活动列表
       spinning: false,
       dataSource: [],
+      tableData: [],
       tableHeight: this.maxHeight,
       cellStyleOption: {
         bodyCellClass: ({ row, column, rowIndex }) => {
@@ -275,9 +276,9 @@ export default {
                   款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
                   数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
                   {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>优惠金额:<strong>{record.total.lossAmount||'--'}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额结余:<strong>{_this.toThousands(Number(record.total.totalPromoGiftsAmount) - Number(record.total.totalUsePromoGiftsAmount))}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额超出:<strong>{_this.toThousands(Number(record.total.totalUsePromoGiftsAmount) - Number(record.total.totalPromoGiftsAmount))}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgeccAmount ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                   {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                 </div>
               </div>
@@ -285,7 +286,7 @@ export default {
           </div>
         )
       }
-
+       
       let arr= [
             { title: "", field: "", key: "acheck", type: "checkbox", align: "center" },
             { title: '序号', field: 'no',key: "a", width: 50, align: 'center', operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
@@ -379,16 +380,18 @@ export default {
         this.queryParam.salesBillSn = this.salesBillSn
         this.queryParam.showStock = true
         const params = this.queryParam
+        const active = this.activeList
+
         // 正常产品
         const proList = await salesDetailAllList(params).then(res => res.data)
         const norTotal = await salesDetaiCount(params).then(res => res.data)
-        let listData = [{
+        //没有活动时不显示统计
+        let listData = active.length ? [{
             id: 'promo-normal',
             total: norTotal
-          },...proList]
+          },...proList] : proList
         
         // 循环获取活动产品
-        const active = this.activeList
         for(let i=0;i<active.length;i++){
           const promo = active[i]
           const activeParams = {
@@ -402,6 +405,10 @@ export default {
           const aclist = await salesDetailAllList(activeParams).then(res => res.data)
           // 获取活动产品统计
           const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          // 采购额结余
+          acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount) - Number(acTotal.totalUsePromoGiftsAmount)
+          // 采购额超出
+          acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount) - Number(acTotal.totalPromoGiftsAmount)
           const retList = [{
             id: 'promo-'+i,
             promo: promo,
@@ -434,6 +441,7 @@ export default {
         })
         this.showEmpty = this.dataSource.length <= 0
         this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+        this.tableData = this.dataSource
         this.spinning = false
         this.disabled = false
     },
@@ -448,6 +456,7 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
+      this.queryParam.promoFlag = undefined
       this.productType = []
       this.dataSource = []
       this.clearSelectTable()
@@ -538,4 +547,7 @@ export default {
   .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
     padding: 0;
   } 
+  .ve-table .ve-table-container .ve-table-content-wrapper{
+      border-bottom: 1px solid #ddd;
+    }
 </style>