Przeglądaj źródła

自定义跳转URL

于继渤 2 lat temu
rodzic
commit
56b30448e2

+ 1 - 1
api/pages/mac/cusReceiptPayment.js

@@ -22,7 +22,7 @@ module.exports = {
 			edit: { key: 'edit', url: '/package-sales/pages/customer-collection/detail/detail',idKey:'rpId' },
 			cusReturnCollection: { key: 'cusReturnCollection', url: '/package-sales/pages/customer-collection/add/add',idKey:'rpId' ,formMode:'add',formType:'add'},
       selectCustomers: { key: 'add', url: '/package-base-select/pages/select-customers/select-customers' },
-
+      refund:{ key: 'refund', url: '/package-sales/pages/customer-collection/refund/refund' }, 
       selectCollectionConfirm:{key:'selectCollectionConfirm',url:'/package-base-select/pages/select-collection_confirm/select-collection_confirm'}
 		}
 	}

+ 2 - 1
components/dkbase/dk-save-button/dk-save-button.js

@@ -93,7 +93,8 @@ Component({
      */
     submit(e){
       let item = e.currentTarget.dataset.item
-      this.triggerEvent("open", { name: item.code })
+      console.log(e)
+      this.triggerEvent("open", { name: item.code ,customUrl:item.customUrl})
     },
   }
 })

+ 6 - 1
mixins/index.js

@@ -271,9 +271,14 @@ module.exports = {
       // 如果有链接,就跳转
       console.log('url', routeUrl);
       if (routeUrl.url) {
+        let url = routeUrl.url
+        //保存按钮自定义跳转URL
+        if(e.detail.customUrl){
+          url = e.detail.customUrl
+        }
         let _this = this;
         wx.navigateTo({
-          url: routeUrl.url,
+          url: url,
           events: {
             // 保存成功后刷新页面
             refresh: function (data) {

+ 37 - 14
package-sales/pages/customer-collection/customer-collection.js

@@ -15,6 +15,7 @@ Page({
    * 页面的初始数据 
    */
   data: {
+    customerEfundFlag:false,
     // 查询条件
     searchContent: [{
       code: 'createtime',
@@ -77,23 +78,23 @@ Page({
       { name: 'rpNo', title: '收款单号' },
       { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '门店/业务员' },
       { name: 'accDate', title: '收款时间' },
-    
+
     ],
     buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
     // 路由
     routeObjName: 'cusReceiptPayment',
-      // 弹出按钮
-      buttonList: [{
-        name: 'cusReturnCollection',
-        title: mixins.$t("cusReturnCollection")
-      }, {
-        name: 'saleOutBound',
-        title: mixins.$t("cusNotCollection"),
-      }, {
-        name: 'saleReturn',
-        title: mixins.$t("ticketPirnt")
-      }
-      ],
+    // 弹出按钮
+    buttonList: [{
+      name: 'cusReturnCollection',
+      title: mixins.$t("cusReturnCollection")
+    }, {
+      name: 'saleOutBound',
+      title: mixins.$t("cusNotCollection"),
+    }, {
+      name: 'saleReturn',
+      title: mixins.$t("ticketPirnt")
+    }
+    ],
   },
 
 
@@ -121,5 +122,27 @@ Page({
     this.setData({
       tableData: tableData
     })
-  }
+  },
+
+  // open(e){
+  //   console.log(e)
+  // },
+
+  /**
+   * @desc : 初始化
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  loadInit() {
+    //客户退款
+    if (this.data.functionCode == Constants.CUSTOMER_EFUND_FUNCTIONCODE) {
+      wx.setNavigationBarTitle({
+        title: '客户退款'
+      })
+      this.setData({
+        buttonSaveList: [{ code: 'add', title: mixins.$t("add") ,customUrl:this.data.route.refund.url}],
+        customerEfundFlag:true //新建跳转类型标识
+      })
+    }
+  },
 })

+ 2 - 1
project.private.config.json

@@ -1,6 +1,7 @@
 {
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "setting": {
-        "compileHotReLoad": true
+        "compileHotReLoad": true,
+        "preloadBackgroundData": false
     }
 }

+ 2 - 0
utils/Constants.js

@@ -350,6 +350,8 @@ module.exports = {
       infotype: 'default'
     }
   ],
+  //菜单编码  客户退款
+  CUSTOMER_EFUND_FUNCTIONCODE:'2260c936-c469-404c-85ed-aa5046fc8684',
 
   //销售订单相关API
   SALE_ORDER_API: "order-server/wxapi/sale/order/",