浏览代码

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

chenrui 1 年之前
父节点
当前提交
692bf94af2

+ 16 - 1
src/libs/tools.js

@@ -3,7 +3,22 @@ export const getOperationalPrecision = (num1, num2) => {
   const val = ((num1 * 10000) * (num2 * 10000) / 100000000).toFixed(2) || 0
   return val != 0 ? val : 0
 }
-
+// 加粗替换字符串中的金额
+export const boldAmounts = (text) => {
+    let regex = /(\d+\.?\d*)元/g;
+    let regex5 = /(\d+\.?\d*)件/g;
+    let regex1 = /再满(\d+\.?\d*)元,可享受优惠/g;
+    let regex4 = /再满(\d+\.?\d*)件产品可享受优惠/g;
+    let regex2 = /(\d+\.?\d*)(/g
+    let regex3 = /选择(\d+\.?\d*)个/g
+    let rext = text.replace(regex1, '<b>再满$1元,可享受优惠</b>');
+    rext = rext.replace(regex4, '<b>再满$1件产品可享受优惠</b>');
+    rext = rext.replace(regex, '<span>$1</span>元');
+    rext = rext.replace(regex5, '<span>$1</span>件');
+    rext = rext.replace(regex2, '<span>$1</span>(');
+    rext = rext.replace(regex3, '选择<span>$1</span>个');
+    return rext;
+}
 // 金额转大写
 export const dealBigMoney = (n) => {
   if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) { return '数据非法' }

+ 3 - 2
src/utils/mixin.js

@@ -1,6 +1,6 @@
 // import Vue from 'vue'
 import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
-import { toThousands } from '@/libs/tools'
+import { toThousands, boldAmounts } from '@/libs/tools'
 import { mapState } from 'vuex'
 
 // const mixinsComputed = Vue.config.optionMergeStrategies.computed
@@ -80,7 +80,8 @@ const AppDeviceEnquire = {
 const commonMixin = {
   data(){
     return {
-      toThousands
+      toThousands,
+      boldAmounts
     }
   },
   computed:{

+ 2 - 2
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -156,8 +156,8 @@
                         数量:<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&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                         {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                     </div>
                   </div>

+ 18 - 4
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -246,9 +246,7 @@
         <!-- 总计 -->
         <a-alert type="info" banner :showIcon="false">
             <div slot="message" class="alert-bar">
-              <div>
-                {{ countData&&countData.remarks }}
-              </div>
+              <div class="countData" v-html="boldAmounts(countData&&countData.remarks||'')"></div>
               <div style="display: flex;">
                 <div>
                   款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>
@@ -367,7 +365,7 @@
                 if(data.list[i].unitType=='SL'){
                   data.list[i].unitQtyV = data.list[i].unitQty ? (data.list[i].unitQty + data.list[i].productUnit) : '--'
                 }else{
-                  data.list[i].unitQtyV = data.list[i].productPackQty&&data.list[i].unitQty ? ((data.list[i].productPackQty*data.list[i].unitQty) + data.list[i].productUnit) : '--'
+                  data.list[i].unitQtyV = data.list[i].packQty&&data.list[i].unitQty ? ((data.list[i].packQty*data.list[i].unitQty) + data.list[i].productUnit) : '--'
                 }
               }
               this.disabled = false
@@ -768,6 +766,22 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
+    .countData{
+      span{
+        margin: 0 3px;
+        color: rgb(0, 119, 255);
+        font-weight: bold;
+      }
+      span.cor1{
+        color: rgb(248, 132, 0);
+      }
+      b{
+        font-weight: bold;
+        span{
+          color: red;
+        }
+      }
+    }
     > div{
       &:first-child{
         flex-grow: 1;

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

@@ -306,15 +306,15 @@ export default {
     },
     // 打开审核/一键审核弹框
     handleAudit (isBatch) {
-      if(this.detailData&&this.detailData.promoFlag==1&&this.$refs.productList.outStockStr != ''){
-        this.$info({
-          title: '提示',
-          content: '参加促销活动的销售单,有缺货产品,不可一键审核!',
-          centered: true
-        })
-        return
-      }
       if (isBatch) { // 一键审核
+        if(this.detailData&&this.detailData.promoFlag==1&&this.$refs.productList.outStockStr != ''){
+          this.$info({
+            title: '提示',
+            content: '参加促销活动的销售单,有缺货产品,不可一键审核!',
+            centered: true
+          })
+          return
+        }
         this.showDsModal = true
         this.$refs.dsModal.setDetail(this.detailData)
       } else {

+ 1 - 1
src/views/salesManagement/salesQueryNew/edit.vue

@@ -408,7 +408,6 @@ export default {
                 <li style="padding:3px 0;">{item.message}</li>
               ))}
               </ol>
-              <div style="padding:10px 0;text-align:center"><strong>继续提交将无法享受优惠</strong></div>
             </div>,
             onOk() {
               _this.submitOrder(data)
@@ -466,6 +465,7 @@ export default {
       }).then(res => {
         if(res.status == 200){
           _this.$refs['productList-'+item.promoRuleSn][0].disableActive(true)
+          _this.getOrderDetail()
           _this.disabledActiveOption = null
           item.disabled = true
           item.isActive = false

+ 31 - 23
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -27,17 +27,17 @@
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-item label="类型">
-              <a-select v-model.trim="queryParam.ptype" :dropdownMatchSelectWidth="false" >
-                <a-select-option value="0">
+              <a-select v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
+                <a-select-option value="">
                   全部产品
                 </a-select-option>
-                <a-select-option value="1">
+                <a-select-option value="ABLE">
                   剩余待下推数量>0的产品
                 </a-select-option>
-                <a-select-option value="2">
+                <a-select-option value="ALL">
                   可全部下推的产品
                 </a-select-option>
-                <a-select-option value="3">
+                <a-select-option value="NOTALL">
                   不可全部下推的产品
                 </a-select-option>
               </a-select>
@@ -146,7 +146,7 @@ export default {
       salesBillSn: '',
       detailData: null,
       queryParam: {
-        ptype: '0', // 类型
+        pushProductType: '', // 类型
         productCode: '', //  产品编码
         productName: '', //  产品名称
         promoFlag: undefined, //  是否促销品
@@ -297,8 +297,8 @@ export default {
                   数量:<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&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                   {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                 </div>
               </div>
@@ -400,6 +400,10 @@ 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'
+        }
+        
         const active = this.activeList
 
         // 正常产品
@@ -477,7 +481,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.ptype = '0'
+      this.queryParam.pushProductType = ''
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.promotionFlag = undefined
@@ -487,6 +491,7 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
       this.queryParam.promoFlag = undefined
+      this.queryParam.isGifg = undefined
       this.productType = []
       this.dataSource = []
       this.clearSelectTable()
@@ -518,23 +523,26 @@ export default {
         _this.$message.warning('请先选择产品!')
         return
       }
-      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
+      const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.stockQty > 0)
       const obj = []
       chooseRow && chooseRow.map(item => {
-        if (item.stockQty > 0) {
-          obj.push(item.salesBillDetailSn)
-        }
-      })
-       
-      this.$confirm({
-        title: '提示',
-        content: '确认要批量添加到待下推列表吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.$emit('addProduct', obj)
-        }
+        obj.push(item.salesBillDetailSn)
       })
+
+      if(obj.length){
+        this.$confirm({
+          title: '提示',
+          content: '确认要批量添加到待下推列表吗?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.$emit('addProduct', obj)
+          }
+        })
+      }else{
+        _this.$message.warning('库存为0,不可添加!')
+      }
+      
     },
     // 整单取消
     handleAllCancel () {

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.111/ocs-admin',
+        // target: 'http://192.168.2.113:8660/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,