Răsfoiți Sursa

支付的订单金额

姜永辉 1 an în urmă
părinte
comite
d909c6b88c

+ 10 - 3
package-basic-data/pages/activity/activity.js

@@ -97,6 +97,7 @@ Page({
         couponUse: {},
         // 策略
         integralTacticItem: {},
+        orderAmount: 0,// 购买的优惠前的订单金额
     },
     /**
      * @desc : 选择活动明细
@@ -188,6 +189,9 @@ Page({
         if (summaryInfo.amountInfo) {
             summaryInfo.amountInfo += ' = ' + amount + '(元)'
             summaryInfo.amount = amount;
+            _this.setData({
+                orderAmount: amount
+            })
         }
         // 积分转成现金                
         let integralRateVal = Number((_this.data.integral / _this.data.integralTacticItem.exchangeRate).toFixed(2))
@@ -273,7 +277,9 @@ Page({
                 userEndDate: userEndDate.toDateStr()
             })
         }
-
+        _this.setData({
+            orderAmount: summaryInfo.amount
+        })
         // 积分转成现金                
         let integralRateVal = Number((_this.data.integral / _this.data.integralTacticItem.exchangeRate).toFixed(2))
         // 折扣--数据库的值不能超过10
@@ -470,7 +476,7 @@ Page({
         params.tradeAmount = summaryInfo.amount
         params.buyBeginDate = summaryInfo.buyBeginDate;
         params.buyEndDate = summaryInfo.endDate
-        params.extendDays = summaryInfo.extendDays; 
+        params.extendDays = summaryInfo.extendDays;
         if (this.data.gradeCode == Constants.gradeCode.STD) {
             params.buyEndDate = summaryInfo.userEndDate
             params.endDate = app.globalData.company.endDate
@@ -532,6 +538,7 @@ Page({
         params.couponUseId = this.data.couponUse.useId && Number(summaryInfo.amount) > 0
             ? this.data.couponUse.useId : null
         params.integral = this.data.integral
+        params.orderAmount = Number(this.data.orderAmount)
         return params;
     },
     /**
@@ -541,7 +548,7 @@ Page({
      */
     saveData(params) {
         return this.excute(this.data.service, this.data.service.reNewCompany, this.data.params).then(res => {
-            if (res.data.code == Constants.SUCESS_CODE  && Number(this.data.summaryInfo.amount) > 0) {
+            if (res.data.code == Constants.SUCESS_CODE && Number(this.data.summaryInfo.amount) > 0) {
                 // 成功后跳转支付
                 this.toPay(res.data.data);
             }

+ 8 - 1
package-basic-data/pages/activity/renew/renew.js

@@ -97,6 +97,7 @@ Page({
         couponUse: {},
         // 策略
         integralTacticItem: {},
+        orderAmount: 0,// 购买的优惠前的订单金额
     },
     /**
      * @desc : 选择活动明细
@@ -188,6 +189,9 @@ Page({
         if (summaryInfo.amountInfo) {
             summaryInfo.amountInfo += ' = ' + amount + '(元)'
             summaryInfo.amount = amount;
+            _this.setData({
+                orderAmount: amount
+            })
         }
         // 积分转成现金                
         let integralRateVal = Number((_this.data.integral / _this.data.integralTacticItem.exchangeRate).toFixed(2))
@@ -273,7 +277,9 @@ Page({
                 userEndDate: userEndDate.toDateStr()
             })
         }
-
+        _this.setData({
+            orderAmount: summaryInfo.amount
+        })
         // 积分转成现金                
         let integralRateVal = Number((_this.data.integral / _this.data.integralTacticItem.exchangeRate).toFixed(2))
         // 折扣--数据库的值不能超过10
@@ -531,6 +537,7 @@ Page({
         params.couponUseId = this.data.couponUse.useId && Number(summaryInfo.amount) > 0
             ? this.data.couponUse.useId : null
         params.integral = this.data.integral
+        params.orderAmount = Number(this.data.orderAmount)
         return params;
     },
     /**

+ 157 - 151
package-basic-data/pages/customer-list/detail/detail.js

@@ -88,32 +88,32 @@ Page({
      * @author : 周兴
      * @date   : 2024/4/25 11:46
      */
-    showTip(e) {
-      let tip = e.currentTarget.dataset.tip
-      if (tip) {
-        util.showToast(tip);
-      }
-    },
-      /**
-   * @desc : 关闭所有的tip
-   * @date : 2024/5/24 15:49
-   * @author : 王英杰
-   */
-    handleTap(){
-      if(this.selectComponent('#dk-tip1')){ 
-        this.selectComponent('#dk-tip1').setShowTipFlag(false)
-      }
-      if(this.selectComponent('#dk-tip2')){ 
-        this.selectComponent('#dk-tip2').setShowTipFlag(false)
-      }
-      if(this.selectComponent('#dk-tip3')){ 
-        this.selectComponent('#dk-tip3').setShowTipFlag(false)
-      }
-      if(this.selectComponent('#dk-tip4')){ 
-        this.selectComponent('#dk-tip4').setShowTipFlag(false)
-      } 
-    },
-    
+  showTip(e) {
+    let tip = e.currentTarget.dataset.tip
+    if (tip) {
+      util.showToast(tip);
+    }
+  },
+  /**
+* @desc : 关闭所有的tip
+* @date : 2024/5/24 15:49
+* @author : 王英杰
+*/
+  handleTap() {
+    if (this.selectComponent('#dk-tip1')) {
+      this.selectComponent('#dk-tip1').setShowTipFlag(false)
+    }
+    if (this.selectComponent('#dk-tip2')) {
+      this.selectComponent('#dk-tip2').setShowTipFlag(false)
+    }
+    if (this.selectComponent('#dk-tip3')) {
+      this.selectComponent('#dk-tip3').setShowTipFlag(false)
+    }
+    if (this.selectComponent('#dk-tip4')) {
+      this.selectComponent('#dk-tip4').setShowTipFlag(false)
+    }
+  },
+
   /**
    * @desc : 收款单保存后重新刷新数据
    * @date : 2024/5/24 15:49
@@ -140,7 +140,7 @@ Page({
         let followList = []
         for (let i = 0; i < list.length; i++) {
           if (list[i].followId) {
-            list[i].createTime =util.formatDataTime(new Date(list[i].createTime)) 
+            list[i].createTime = util.formatDataTime(new Date(list[i].createTime))
             followList.push(list[i])
           }
         }
@@ -219,11 +219,11 @@ Page({
   */
   onChange(e) {
     //体验跳转显示假数据
-    if(this.data.params && this.data.params.testFlag){
+    if (this.data.params && this.data.params.testFlag) {
       return
-    }else{
+    } else {
       let name = e.detail.name
-      let cusId = this.data.id?this.data.id:this.data.item.cusId
+      let cusId = this.data.id ? this.data.id : this.data.item.cusId
       if (name == 'follow') {
         this.getCusFollowList(cusId)
       }
@@ -253,15 +253,15 @@ Page({
   */
   changeTag(e) {
     //体验跳转显示假数据
-    if(this.data.params && this.data.params.testFlag){
+    if (this.data.params && this.data.params.testFlag) {
       return
-    }else{
+    } else {
       let data = this.data.item
       let name = e.detail.name
       this.setData({
         activeCard: e.detail.name
       })
-      if (name == 'order') { 
+      if (name == 'order') {
         this.getOrderList(data.cusId)
       }
       else if (name == 'order-out') {
@@ -378,13 +378,13 @@ Page({
    */
   toJump(e) {
     //体验跳转显示假数据
-   if(this.data.params && this.data.params.testFlag){
-    return
-    }else{
+    if (this.data.params && this.data.params.testFlag) {
+      return
+    } else {
       let key = e.currentTarget.dataset.key
       let url = null
       let gradeCode = this.data.gradeCode
-  
+
       if (key == 'sale') {
         // if (gradeCode == Constants.gradeCode.STD) { //标准
         //   url = this.data.route.toSaleOutOrder.url
@@ -463,9 +463,9 @@ Page({
    */
   toOriginalCollection(e) {
     //体验跳转显示假数据
-   if(this.data.params && this.data.params.testFlag){
-    return
-    }else{
+    if (this.data.params && this.data.params.testFlag) {
+      return
+    } else {
       let item = e.currentTarget.dataset.item
       this.setData({
         selectflag: true
@@ -474,9 +474,9 @@ Page({
       let route = this.data.route
       // 标准版跳转客户收款
       if (this.data.gradeCode == Constants.gradeCode.STD) {
-        if(item.rpType == Constants.rpType.returnReceipt){
+        if (item.rpType == Constants.rpType.returnReceipt) {
           method = 'refundDetail'
-        }else{
+        } else {
           method = 'collectionDetail'
         }
       } else {
@@ -490,47 +490,47 @@ Page({
         events: {
           // 保存成功后刷新页面
           refresh: function (data) {
-          
+
           }
         },
         success: function (res) {
           // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
-          res.eventChannel.emit('params', { id: item.rpId, formMode: Constants.formMode.other,formReturnMode:'customer' })
+          res.eventChannel.emit('params', { id: item.rpId, formMode: Constants.formMode.other, formReturnMode: 'customer' })
         }
       })
     }
   },
 
-/**
-   * @desc : 跳转查看销售订单源单
-   * @date : 2024/2/1 15:49
-   * @author : 于继渤
-   */
-  toOrderDetail(e){
+  /**
+     * @desc : 跳转查看销售订单源单
+     * @date : 2024/2/1 15:49
+     * @author : 于继渤
+     */
+  toOrderDetail(e) {
     //体验跳转显示假数据
-   if(this.data.params && this.data.params.testFlag){
-    return
-    }else{
-    let item = e.currentTarget.dataset.item
-    this.setData({
-      selectflag: true
-    })
-    let route = this.data.route
-    let that = this
-    wx.navigateTo({
-      url: route.orderDetail.url,
-      events: {
-        // 保存成功后刷新页面
-        refresh: function (data) {
-        
+    if (this.data.params && this.data.params.testFlag) {
+      return
+    } else {
+      let item = e.currentTarget.dataset.item
+      this.setData({
+        selectflag: true
+      })
+      let route = this.data.route
+      let that = this
+      wx.navigateTo({
+        url: route.orderDetail.url,
+        events: {
+          // 保存成功后刷新页面
+          refresh: function (data) {
+
+          }
+        },
+        success: function (res) {
+          // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
+          res.eventChannel.emit('params', { id: item.orderId, item: item, formMode: Constants.formMode.other, formReturnMode: 'customer' })
         }
-      },
-      success: function (res) {
-        // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
-        res.eventChannel.emit('params', { id: item.orderId, item:item, formMode: Constants.formMode.other,formReturnMode:'customer' })
-      }
-    })
-  }
+      })
+    }
   },
 
   /**
@@ -538,13 +538,13 @@ Page({
    * @date : 2024/7/11 09:39
    * @author : 刘尧
    */
-  toOutDetail(e){
-      console.log('toOutDetail', e.currentTarget.dataset.item);
-      let item = e.currentTarget.dataset.item
-      this.setData({
-        selectflag: true
-      })
-      
+  toOutDetail(e) {
+    console.log('toOutDetail', e.currentTarget.dataset.item);
+    let item = e.currentTarget.dataset.item
+    this.setData({
+      selectflag: true
+    })
+
     let route = this.data.route
     let that = this
     wx.navigateTo({
@@ -552,7 +552,7 @@ Page({
       events: {
         // 保存成功后刷新页面
         refresh: function (data) {
-        
+
         }
       },
       success: function (res) {
@@ -566,7 +566,7 @@ Page({
   },
 
 
-  toOrderOutReturnDetail(e){
+  toOrderOutReturnDetail(e) {
     let item = e.currentTarget.dataset.item
     this.setData({
       selectflag: true
@@ -578,59 +578,59 @@ Page({
       events: {
         // 保存成功后刷新页面
         refresh: function (data) {
-        
+
         }
       },
       success: function (res) {
         // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
-        res.eventChannel.emit('params', { id: item.outId,formMode: Constants.formMode.detail, formType: Constants.formMode.detail ,formReturnMode:'customer' })
+        res.eventChannel.emit('params', { id: item.outId, formMode: Constants.formMode.detail, formType: Constants.formMode.detail, formReturnMode: 'customer' })
       }
     })
   },
 
- /**
-  * @desc : 跳转
-  * @date : 2024/2/1 15:49
-  * @author : 于继渤
-  */
- toDetailFollow(e) {
-   //体验跳转显示假数据
-   if(this.data.params && this.data.params.testFlag){
-     return
-   }else{
-    let item = e.currentTarget.dataset.item
-    console.log('toDetailFollow', e)
-    let url = null
-    let title = undefined
-    if (item.followStatus == '跟进状态-报备' || item.followStatus == '跟进状态-接待') {
-      url = this.data.route.toFollowStatus1.url
-    } else if (item.followStatus == '跟进状态-跟进' || item.followStatus == '跟进状态-邀约') {
-      title = '跟进详情'
-      url = this.data.route.toFollowStatus2.url
-    } else if (item.followStatus == '跟进状态-约尺') {
-      url = this.data.route.toFollowStatus3.url
-    }
-    let _this = this;
-    wx.navigateTo({
-      url: url,
-      events: {
-        // 保存成功后刷新页面
-        refresh: function (data) {
-          // 刷新一览界面
-          _this.searchData();
-        }
-      },
-      success: function (res) {
-        let data = {}
-        data.id = item.followId
-        data.formMode = Constants.formMode.edit
-        data.formType = Constants.formMode.detail
-        data.title = title
-        res.eventChannel.emit('params', data);
+  /**
+   * @desc : 跳转
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  toDetailFollow(e) {
+    //体验跳转显示假数据
+    if (this.data.params && this.data.params.testFlag) {
+      return
+    } else {
+      let item = e.currentTarget.dataset.item
+      console.log('toDetailFollow', e)
+      let url = null
+      let title = undefined
+      if (item.followStatus == '跟进状态-报备' || item.followStatus == '跟进状态-接待') {
+        url = this.data.route.toFollowStatus1.url
+      } else if (item.followStatus == '跟进状态-跟进' || item.followStatus == '跟进状态-邀约') {
+        title = '跟进详情'
+        url = this.data.route.toFollowStatus2.url
+      } else if (item.followStatus == '跟进状态-约尺') {
+        url = this.data.route.toFollowStatus3.url
       }
-    })
-   }
-},
+      let _this = this;
+      wx.navigateTo({
+        url: url,
+        events: {
+          // 保存成功后刷新页面
+          refresh: function (data) {
+            // 刷新一览界面
+            _this.searchData();
+          }
+        },
+        success: function (res) {
+          let data = {}
+          data.id = item.followId
+          data.formMode = Constants.formMode.edit
+          data.formType = Constants.formMode.detail
+          data.title = title
+          res.eventChannel.emit('params', data);
+        }
+      })
+    }
+  },
 
 
 
@@ -641,17 +641,17 @@ Page({
    */
   loadInit() {
     //体验跳转显示假数据
-    if(this.data.params && this.data.params.testFlag){
+    if (this.data.params && this.data.params.testFlag) {
       this.setData({
-        item:Data.falseCusItemData[0],
+        item: Data.falseCusItemData[0],
         active: 'deal',
         activeCard: 'order',
-        orderList:Data.falseOrderData,
+        orderList: Data.falseOrderData,
         orderOutList: Data.falseSaleOutData,
-        paymentRecordsList:Data.falseReceiptData,
+        paymentRecordsList: Data.falseReceiptData,
         refundRecordsList: Data.falseBackMacData,
       })
-    }else{
+    } else {
       let gradeCode = this.data.gradeCode
       let name = null
       if (gradeCode == Constants.gradeCode.STD) {
@@ -677,24 +677,24 @@ Page({
       }
       this.onChange(e);
     }
-    
+
   },
-  onShow(){
-    
-    if(this.data.refreshByAdd){
+  onShow() {
+
+    if (this.data.refreshByAdd) {
       this.getPayRecords(this.data.id, '收付款类型-收款')
     }
-    
+
   },
 
-      /**
-   * @desc : 功能包购买浮钮
-   * @date : 2024/7/10 8:49
-   * @author : 常皓宁
-   */
-  toBuy(){
+  /**
+* @desc : 功能包购买浮钮
+* @date : 2024/7/10 8:49
+* @author : 常皓宁
+*/
+  toBuy() {
     //home的功能包修改此处就需要做相应修改 包括后面的传值
-    let funPackage = app.globalData.company.funPackage? [...app.globalData.company.funPackage] : []
+    let funPackage = app.globalData.company.funPackage ? [...app.globalData.company.funPackage] : []
     let params = {}
     params.endDate = app.globalData.company.endDate
     params.userEndDate = this.data.params.userEndDate
@@ -717,21 +717,27 @@ Page({
     params.activityItemIds = [this.data.params.activityItemId]
 
     funPackage.push({
-        funUuids: this.data.params.funUuids,
-        activityId: this.data.params.activityId,
+      funUuids: this.data.params.funUuids,
+      activityId: this.data.params.activityId,
     })
     params.funPackage = funPackage
     if (app.globalData.company.vip) {
-        params.vip = true;
+      params.vip = true;
     }
     params.buyLong = this.data.params.extendDays + '天'
+    // 操作员
+    params.staffNameFrom = this.data.params.staffNameFrom
+    // 优惠券使用id 金额大于0
+    params.couponUseId = this.data.params.couponUseId
+    params.integral = this.data.params.integral
+    params.orderAmount = this.data.params.orderAmount
     console.log(params);
     let service = app.globalData['companyService']
-    return this.excute(service, service.saveFunc,params).then(res => {
-        if (res.data.code == Constants.SUCESS_CODE) {
-            // 成功后跳转支付
-            this.toPay(res.data.data);
-        }
+    return this.excute(service, service.saveFunc, params).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE  && Number(this.data.params.factAmt) > 0) {
+        // 成功后跳转支付
+        this.toPay(res.data.data);
+      }
     })
   },
   /**
@@ -739,7 +745,7 @@ Page({
    * @date : 2024/7/11 10:47
    * @author : 刘尧
    */
-  showInitial(e){
+  showInitial(e) {
     this.setData({
       initialValueFlag: !this.data.initialValueFlag
     })

+ 6 - 4
package-basic-data/pages/func-buy/add-confirm/add-confirm.js

@@ -23,6 +23,7 @@ Page({
         userEndDate: null,
         userEndDateFlg: false,
         userEndDateString: '',
+        orderAmount:0,// 购买的优惠前的订单金额
         factAmt: 0,
         routeObjName: 'company',
         integral: 0,
@@ -149,7 +150,7 @@ Page({
                         userEndDate: endDate,
                         userEndDateFlg: true,
                         userEndDateString: _this.data.item.wxPrice + '元/年(' + _this.data.item.activityItemDescribe + ')',
-                        // factAmt: _this.data.item.wxPrice,
+                        orderAmount: _this.data.item.wxPrice,
                         extendDays: 365,
                         nowDate,
                     })
@@ -171,7 +172,7 @@ Page({
                         _this.setData({
                             userEndDateFlg: true,
                             userEndDateString: _this.data.item.wxPrice + '元/年(' + _this.data.item.activityItemDescribe + ')',
-                            // factAmt: _this.data.item.wxPrice,
+                            orderAmount: _this.data.item.wxPrice,
                             extendDays: 365,
                             nowDate,
                         })
@@ -189,13 +190,13 @@ Page({
 
                         } else {
                             _this.setData({
-                                factAmt: Number((factAmt - integralRateVal) * discount.toFixed(2)),
+                                factAmt: Number(((factAmt - integralRateVal) * discount).toFixed(2)),
                             })
                         }
                         _this.setData({
                             userEndDateFlg: false,
                             userEndDateString: price + '元/天(' + _this.data.item.activityItemDescribe + ')* ' + extendDays + '天=' + factAmt + '元',
-                            // factAmt: factAmt,
+                            orderAmount: factAmt,
                             extendDays,
                             nowDate,
                         })
@@ -247,6 +248,7 @@ Page({
         params.couponUseId = this.data.couponUse.useId && Number(this.data.factAmt) > 0
                  ? this.data.couponUse.useId : null
         params.integral = this.data.integral
+        params.orderAmount = Number(this.data.orderAmount)
         return params;
     },
     /**

+ 10 - 6
package-business-analysis/pages/business-overview-experience/business-overview-experience.js

@@ -14,6 +14,7 @@ Page({
         funData: [],
         userEndDate: null,
         userEndDateFlg: false,
+        orderAmount: 0,// 购买的优惠前的订单金额
         factAmt: 0,
         routeObjName: 'company',
         integral: 0,
@@ -22,6 +23,7 @@ Page({
         couponUse: {},
         // 策略
         integralTacticItem: {},
+
     },
 
     /**
@@ -131,7 +133,7 @@ Page({
                         userEndDate: endDate,
                         userEndDateFlg: true,
                         userEndDateString: _this.data.funData.wxPrice + '元/年(' + _this.data.funData.activityItemDescribe + ')',
-                        // factAmt: _this.data.funData.wxPrice,
+                        orderAmount: _this.data.funData.wxPrice,
                         extendDays: 365,
                         nowDate,
                     })
@@ -153,7 +155,7 @@ Page({
                         _this.setData({
                             userEndDateFlg: true,
                             userEndDateString: _this.data.funData.wxPrice + '元/年(' + _this.data.funData.activityItemDescribe + ')',
-                            // factAmt: _this.data.funData.wxPrice,
+                            orderAmount: _this.data.funData.wxPrice,
                             extendDays: 365,
                             nowDate,
                         })
@@ -171,13 +173,13 @@ Page({
 
                         } else {
                             _this.setData({
-                                factAmt: Number((factAmt - integralRateVal) * discount.toFixed(2)),
+                                factAmt: Number(((factAmt - integralRateVal) * discount).toFixed(2)),
                             })
                         }
                         _this.setData({
                             userEndDateFlg: false,
                             userEndDateString: price + '元/天(' + _this.data.funData.activityItemDescribe + ')* ' + extendDays + '天=' + factAmt + '元',
-                            // factAmt: factAmt,
+                            orderAmount: factAmt,
                             extendDays,
                             nowDate,
                         })
@@ -265,6 +267,7 @@ Page({
         params.couponUseId = this.data.couponUse.useId && Number(this.data.factAmt) > 0
             ? this.data.couponUse.useId : null
         params.integral = this.data.integral
+        params.orderAmount = Number(this.data.orderAmount)
         return params;
     },
 
@@ -304,9 +307,10 @@ Page({
             // 操作员
             staffNameFrom: app.globalData.user.staffName,
             // 优惠券使用id 金额大于0
-            couponUseId : this.data.couponUse.useId && Number(this.data.factAmt) > 0
+            couponUseId: this.data.couponUse.useId && Number(this.data.factAmt) > 0
                 ? this.data.couponUse.useId : null,
-            integral : this.data.integral,
+            integral: this.data.integral,
+            orderAmount: this.data.orderAmount,
         }
         //收发存汇总表
         if (type == 'INT') {

+ 3 - 1
package-business-analysis/pages/cus-rec-pay-report/cus-rec-pay-report.js

@@ -148,6 +148,7 @@ Page({
         // 优惠券使用id 金额大于0
         couponUseId: this.data.params.couponUseId,
         integral: this.data.params.integral,
+        orderAmount: this.data.params.orderAmount,
       }
       wx.navigateTo({
         url: route.detail.url,
@@ -228,7 +229,8 @@ Page({
     // 优惠券使用id 金额大于0
     params.couponUseId = this.data.params.couponUseId
     params.integral = this.data.params.integral
-
+    params.orderAmount = this.data.params.orderAmount
+    
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc, params).then(res => {
       if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {

+ 1 - 0
package-business-analysis/pages/profit-report/org-rank/org-rank.js

@@ -158,6 +158,7 @@ Page({
     // 优惠券使用id 金额大于0
     params.couponUseId = this.data.params.couponUseId
     params.integral = this.data.params.integral
+    params.orderAmount = this.data.params.orderAmount
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc, params).then(res => {
       if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {

+ 2 - 0
package-business-analysis/pages/profit-report/profit-report.js

@@ -114,6 +114,7 @@ Page({
         // 优惠券使用id 金额大于0
         couponUseId: this.data.params.couponUseId,
         integral: this.data.params.integral,
+        orderAmount: this.data.params.orderAmount,
       }
     }
     params.searchForm = this.data.searchForm
@@ -290,6 +291,7 @@ Page({
     // 优惠券使用id 金额大于0
     params.couponUseId = this.data.params.couponUseId
     params.integral = this.data.params.integral
+    params.orderAmount = this.data.params.orderAmount
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc, params).then(res => {
       if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {

+ 1 - 0
package-business-analysis/pages/profit-report/sku-rank/sku-rank.js

@@ -158,6 +158,7 @@ Page({
     // 优惠券使用id 金额大于0
     params.couponUseId = this.data.params.couponUseId
     params.integral = this.data.params.integral
+    params.orderAmount = this.data.params.orderAmount
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc, params).then(res => {
       if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {

+ 1 - 0
package-business-analysis/pages/profit-report/staff-rank/staff-rank.js

@@ -164,6 +164,7 @@ Page({
      // 优惠券使用id 金额大于0
      params.couponUseId = this.data.params.couponUseId
      params.integral = this.data.params.integral
+     params.orderAmount = this.data.params.orderAmount
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc,params).then(res => {
         if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {

+ 49 - 42
package-inventory/pages/ivt-sum-report/detail/detail.js

@@ -21,8 +21,8 @@ Page({
     routeObjName: 'report',
     // 待入库 已入库的taglist
     tagList: [
-      { title: mixins.$t('inBoundOrder') ,code:'inBound'},
-      { title: mixins.$t('outBoundOrder') ,code:'outBound'}],
+      { title: mixins.$t('inBoundOrder'), code: 'inBound' },
+      { title: mixins.$t('outBoundOrder'), code: 'outBound' }],
     active: 0,
     companyVip: false
   },
@@ -34,26 +34,26 @@ Page({
   */
   onChangeTabs(e) {
     //体验跳转过来的
-    if(this.data.item.params && this.data.item.params.testFlag){
+    if (this.data.item.params && this.data.item.params.testFlag) {
       let index = e.detail.detail.index
       this.setData({
         active: index,
       })
-      if(index == 1){
+      if (index == 1) {
         this.setData({
-          tableData:Data.falseIvtReportItemDataOUT
+          tableData: Data.falseIvtReportItemDataOUT
         })
-      }else{
+      } else {
         this.setData({
-          tableData:Data.falseIvtReportItemDataIN
+          tableData: Data.falseIvtReportItemDataIN
         })
       }
-    }else{
+    } else {
       let index = e.detail.detail.index
       this.setData({
         active: index,
       })
-  
+
       this.searchData()
     }
   },
@@ -79,19 +79,19 @@ Page({
    */
   getData(params) {
     //体验跳转过来的
-    if(this.data.item.params && this.data.item.params.testFlag){
+    if (this.data.item.params && this.data.item.params.testFlag) {
       let index = this.data.active
-      if(index == 1){
+      if (index == 1) {
         this.setData({
-          tableData:Data.falseIvtReportItemDataOUT
+          tableData: Data.falseIvtReportItemDataOUT
         })
-      }else{
+      } else {
         this.setData({
-          tableData:Data.falseIvtReportItemDataIN
+          tableData: Data.falseIvtReportItemDataIN
         })
       }
       return
-    }else{
+    } else {
       return this.excute(this.data.service, this.data.service.getIvtItemReport, params);
     }
   },
@@ -106,10 +106,10 @@ Page({
     if (tableData && tableData.length > 0) {
       tableData.forEach(element => {
         // 计算包装
-        const qty = this.data.active == 0 ? element.intoQty:element.outQty
+        const qty = this.data.active == 0 ? element.intoQty : element.outQty
         element['skuBox'] = parseInt(qty / item.packBox)
-        element['skuPiece'] = parseFloat(Number(qty % item.packBox)).toFixed(item.decimalPlaces) 
-        if(item.subUnitName){
+        element['skuPiece'] = parseFloat(Number(qty % item.packBox)).toFixed(item.decimalPlaces)
+        if (item.subUnitName) {
           element['skuBoxCurrent'] = element['skuBox'] + item.subUnitName + element['skuPiece'] + item.unitName
         }
         element.imagesUrl = this.data.item.imagesUrl
@@ -125,31 +125,31 @@ Page({
    * @date : 2024/6/5 09:03
    * @author : 刘尧
    */
-  computeBoxNumber(item){
+  computeBoxNumber(item) {
     // 期初
     item['openingBox'] = parseInt(item.openingIvtQty / item.packBox)
     item['openingPiece'] = parseFloat(Number(item.openingIvtQty % item.packBox)).toFixed(item.decimalPlaces)
-    if(item.subUnitName){
+    if (item.subUnitName) {
       item.packageBoxOpening = item['openingBox'] + item.subUnitName + item['openingPiece'] + item.unitName
     }
     // 入库
     item['currentBox'] = parseInt(item.currentIntoQty / item.packBox)
-    item['currentPiece'] = parseFloat(Number(item.currentIntoQty % item.packBox)).toFixed(item.decimalPlaces) 
-    if(item.subUnitName){
+    item['currentPiece'] = parseFloat(Number(item.currentIntoQty % item.packBox)).toFixed(item.decimalPlaces)
+    if (item.subUnitName) {
       item.packageBoxCurrent = item['currentBox'] + item.subUnitName + item['currentPiece'] + item.unitName
     }
     // 出库
     item['currentOutBox'] = parseInt(item.currentOutQty / item.packBox)
-    item['currentOutPiece'] = parseFloat(Number(item.currentOutQty % item.packBox)).toFixed(item.decimalPlaces) 
-    if(item.subUnitName){
+    item['currentOutPiece'] = parseFloat(Number(item.currentOutQty % item.packBox)).toFixed(item.decimalPlaces)
+    if (item.subUnitName) {
       item.packageBoxCurrentOut = item['currentOutBox'] + item.subUnitName + item['currentOutPiece'] + item.unitName
     }
     // 期末
     item['endingIvtBox'] = parseInt(item.endingIvtQty / item.packBox)
-    item['endingIvtPiece'] = parseFloat(Number(item.endingIvtQty % item.packBox)).toFixed(item.decimalPlaces) 
+    item['endingIvtPiece'] = parseFloat(Number(item.endingIvtQty % item.packBox)).toFixed(item.decimalPlaces)
 
     // 包装
-    if(item.subUnitName){
+    if (item.subUnitName) {
       item.packageBoxEndingIvt = item['endingIvtBox'] + item.subUnitName + item['endingIvtPiece'] + item.unitName
     }
     this.setData({
@@ -159,28 +159,28 @@ Page({
   /**
    * 跳转对应单据
    */
-  toItem(param){
+  toItem(param) {
     //体验跳转过来的
-    if(this.data.item.params && this.data.item.params.testFlag){
+    if (this.data.item.params && this.data.item.params.testFlag) {
       return
-    }else{
+    } else {
       const code = this.data.tagList[this.data.active].code
       const data = param.currentTarget.dataset.value
       this.setData({
-        primaryKey: data.intoId? 'intoId': 'outId'
+        primaryKey: data.intoId ? 'intoId' : 'outId'
       })
       const e = {
         type: "toDetail",
         touches: undefined,
         target: {
           dataset: {},
-          id: data.intoId? data.intoId: data.outId
+          id: data.intoId ? data.intoId : data.outId
         },
         mark: {},
         changedTouches: undefined,
         mut: false,
-        currentTarget:{
-          dataset:{}
+        currentTarget: {
+          dataset: {}
         },
         detail: {
           name: code,
@@ -207,10 +207,10 @@ Page({
    * @date : 2024/7/10 8:49
    * @author : 常皓宁
    */
-  toBuy(){
+  toBuy() {
     //home的功能包修改此处就需要做相应修改 包括后面的传值
     let _this = this
-    let funPackage = app.globalData.company.funPackage? [...app.globalData.company.funPackage] : []
+    let funPackage = app.globalData.company.funPackage ? [...app.globalData.company.funPackage] : []
     let params = {}
     params.endDate = app.globalData.company.endDate
     params.gradeCode = app.globalData.company.gradeCode
@@ -233,21 +233,28 @@ Page({
     funPackage.push({
       funUuids: _this.data.item.params.funUuids,
       activityId: _this.data.item.params.activityId,
-  })
+    })
     params.extendDays = 0;
     params.wxMaxNum = app.globalData.company.wxMaxNum
     params.webMaxNum = app.globalData.company.webMaxNum
     params.funPackage = funPackage
     if (app.globalData.company.vip) {
-        params.vip = true;
+      params.vip = true;
     }
+    // 操作员
+    params.staffNameFrom = _this.data.item.params.staffNameFrom
+    // 优惠券使用id 金额大于0
+    params.couponUseId = _this.data.item.params.couponUseId
+    params.integral = _this.data.item.params.integral
+    params.orderAmount = _this.data.item.params.orderAmount
     console.log(params);
     let service = app.globalData['companyService']
-    return this.excute(service, service.saveFunc,params).then(res => {
-        if (res.data.code == Constants.SUCESS_CODE) {
-            // 成功后跳转支付
-            this.toPay(res.data.data);
-        }
+    return this.excute(service, service.saveFunc, params).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE 
+        && Number(_this.data.item.params.factAmt) > 0) {
+        // 成功后跳转支付
+        this.toPay(res.data.data);
+      }
     })
   },
 

+ 3 - 1
package-inventory/pages/ivt-sum-report/ivt-sum-report.js

@@ -218,6 +218,7 @@ Page({
           // 优惠券使用id 金额大于0
           couponUseId: this.data.params.couponUseId,
           integral: this.data.params.integral,
+          orderAmount: this.data.params.orderAmount,
         }
         e.detail.item.params = params
       }
@@ -268,7 +269,8 @@ Page({
     // 优惠券使用id 金额大于0
     params.couponUseId = this.data.params.couponUseId
     params.integral = this.data.params.integral
-    console.log(params);
+    params.orderAmount = this.data.params.orderAmount
+     
     let service = app.globalData['companyService']
     return this.excute(service, service.saveFunc, params).then(res => {
       if (res.data.code == Constants.SUCESS_CODE && Number(this.data.params.factAmt) > 0) {