shish 6 hours ago
parent
commit
ef59316202

+ 1 - 1
hdApp/src/admin/ghs/pay.vue

@@ -343,7 +343,7 @@
 					this.$msg('供货商信息加载中,请稍后再试')
 					return
 				}
-				this.pageTo({ url: `/pagesPurchase/gathering?id=${this.id}&salt=${this.salt}`, type: 2 })
+				this.pageTo({ url: `/pagesPurchase/gathering?id=${this.id}&salt=${this.salt}&ghsId=${this.id}`, type: 2 })
 			},
 			downloadImg() {
 				if (!this.imgUrl) {

+ 25 - 0
hdApp/src/admin/ghsProduct/detail.vue

@@ -361,9 +361,34 @@ export default {
             pagePath: `admin/ghsProduct/detail?id=${id}&shopId=${shopId}`
           };
           that.jweixinFn(shareParams)
+
+          // 此时 option.ghsId 已由 init 用 shopId 换成当前客户自己的供货商 ID
+          // 从本地恢复该供货商购物车,避免分享逐个打开商品时以空列表覆盖已选
+          that.restoreCartByCurrentGhs()
         }
       })
     },
+    /**
+     * 按当前客户 ghsId 恢复本地购物车到 Vuex(须在 ghsId 就绪后调用)
+     */
+    restoreCartByCurrentGhs() {
+      const ghsId = this.getGhsId()
+      if (ghsId <= 0) {
+        return
+      }
+      // Vuex 里已有数据则不覆盖,防止同页重复拉取把进行中的选择冲掉
+      if (!this.$util.isEmpty(this.selectList)) {
+        return
+      }
+      const currentInfo = uni.getStorageSync('selectList' + this.pageType + '_ghs_' + ghsId)
+      if (this.$util.isEmpty(currentInfo)) {
+        return
+      }
+      const mergedInfo = this._mergeDuplicateSelectRows
+        ? this._mergeDuplicateSelectRows(currentInfo)
+        : currentInfo
+      this.setSelectInfoByType({ type: this.pageType, info: mergedInfo })
+    },
     onShareAppMessage(res) {
       return {
         title: this.title,

+ 2 - 2
hdApp/src/admin/home/components/purchase-ghs-panel.vue

@@ -499,10 +499,10 @@ export default {
         this.$msg('已休店,请选择其它门店')
         return false
       }
-      that.pageTo({ url: '/pagesPurchase/ghsProduct?id=' + item.id })
+      that.pageTo({ url: '/pagesPurchase/ghsProduct?id=' + item.id +'&ghsId=' + item.id})
     },
     settleAccounts(item) {
-      this.pageTo({ url: '/pagesPurchase/gathering?id=' + item.id })
+      this.pageTo({ url: '/pagesPurchase/gathering?id=' + item.id +'&ghsId=' + item.id})
     },
     getGHSList() {
       return ghsList().then(res => {

+ 0 - 4
hdApp/src/mixins/cgProduct.js

@@ -228,10 +228,6 @@ export default {
 			if (opt.ghsId && Number(opt.ghsId) > 0) {
 				return Number(opt.ghsId);
 			}
-			//这条有用,不能删除。ghsProduct.vue里使用到
-			if (opt.id && Number(opt.id) > 0) {
-				return Number(opt.id);
-			}
 			return 0;
 		},
 		/**

+ 1 - 1
hdApp/src/pagesPurchase/pb.vue

@@ -123,7 +123,7 @@ export default {
       })
     },
     settleAccounts (item) {
-      this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id})
+      this.pageTo({ url: '/pagesPurchase/gathering?id='+item.id+'&ghsId='+item.id})
     },
     gotoDetails (val) {
       this.pageTo({ url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id, type:2 })

+ 1 - 1
hdApp/src/pagesPurchase/purDetails.vue

@@ -541,7 +541,7 @@ export default {
 		},
     //跳转到结账页
     goToSettle (item) {
-      this.pageTo({url: '/pagesPurchase/gathering?id='+item.supplierId+'&salt='+item.ghsSalt})
+      this.pageTo({url: '/pagesPurchase/gathering?id='+item.supplierId+'&salt='+item.ghsSalt+'&ghsId='+item.supplierId})
     },
     goClearBill(item) {
       let salt = item.salt ? item.salt : ''