shish 1 mese fa
parent
commit
9dad778531
1 ha cambiato i file con 16 aggiunte e 3 eliminazioni
  1. 16 3
      ghsApp/src/pagesPurchase/supplier.vue

+ 16 - 3
ghsApp/src/pagesPurchase/supplier.vue

@@ -87,15 +87,15 @@
             </view>
           </view>
 
-          <!-- 待结订单提示区(如果有欠款且非删除状态) -->
+          <!-- 待结订单提示区:合并后直接使用 xhGhs.debtNum 与净 balance(负值=待结金额) -->
           <view 
             class="pending-order-box"
             hover-class="none"
             @click.stop="goToDebtList(item)"
-            v-if="Number(item.debtAmount)>0 && isNormalList">
+            v-if="hasSupplierPending(item) && isNormalList">
             <view class="pending-order-content">
               <image class="pending-icon" referrerpolicy="no-referrer" src="/static/lanhu_020105gongyingshangliebiao/ps2pvfa1l5i34w5vqj2k7b3kejml3i3nmrba1421bf-caa2-491b-8773-af413df7e96d.png" />
-              <text class="pending-text">待结订单 {{item.debtNum}} 笔 ¥{{item.debtAmount?parseFloat(item.debtAmount):0}} 查看明细 &gt;</text>
+              <text class="pending-text">待结订单 {{item.debtNum || 0}} 笔 ¥{{supplierPendingAmount(item)}} 查看明细 &gt;</text>
             </view>
           </view>
 
@@ -245,6 +245,19 @@ export default {
   },
   methods: {
     iconSrc,
+    // 供货商待结金额:净 balance 为负时取绝对值(appVersion>=3 协议)
+    supplierPendingAmount(item) {
+      const bal = parseFloat(item.balance || 0)
+      if (bal < 0) {
+        return Math.abs(bal)
+      }
+      return parseFloat(item.debtAmount || 0)
+    },
+    // 是否有待结:以 debtNum 或待结金额为准
+    hasSupplierPending(item) {
+      const debtNum = Number(item.debtNum || 0)
+      return debtNum > 0 || this.supplierPendingAmount(item) > 0
+    },
     changeLocation(ghs){
       let that = this
       this.$util.confirmModal({content:'确认修改?'},() => {