shish 2 mesiacov pred
rodič
commit
8545b857dc

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

@@ -118,6 +118,7 @@
                     <text>更多功能</text>
                   </view>
                 </view>
+
                 <view class="box_6 flex-row" @click="settleAccounts(ghsInfo)" v-if="Number(ghsInfo.debtAmount) > 0">
                   <view class="show_clear_area flex-row justify-between">
                     <text class="waite_clear_order">待结订单 {{ ghsInfo.debtNum }}笔 合计¥{{ ghsInfo.debtAmount ? parseFloat(ghsInfo.debtAmount) : 0 }}</text>
@@ -125,13 +126,22 @@
                   </view>
                 </view>
 
-                <view class="box_6 flex-row" v-if="Number(ghsInfo.balance) < 0"
-                  @click.stop="recharge(ghsInfo)">
+                <view class="box_6 flex-row" v-if="Number(ghsInfo.balance) < 0">
                   <view class="show_clear_area flex-row justify-between">
                     <text class="waite_clear_order">
                       待结 ¥{{ Math.abs(parseFloat(ghsInfo.balance)) }}
                     </text>
-                    <text class="clear-action">结清账单 ></text>
+                    <view class="clear-actions flex-row">
+                      <text
+                        v-if="canSelectOrderClear(ghsInfo)"
+                        class="clear-action"
+                        @click.stop="settleAccounts(ghsInfo)"
+                      >选订单结算 ></text>
+                      <text
+                        class="clear-action"
+                        @click.stop="recharge(ghsInfo)"
+                      >自定义金额 ></text>
+                    </view>
                   </view>
                 </view>
 
@@ -488,6 +498,14 @@ export default {
     settleAccounts(item) {
       this.pageTo({ url: '/pagesPurchase/gathering?id=' + item.id })
     },
+    canSelectOrderClear(ghsInfo) {
+      if (!ghsInfo) {
+        return false
+      }
+      return Number(ghsInfo.debtNum) > 0
+        || Number(ghsInfo.debtAmount) > 0
+        || Number(ghsInfo.remainDebtAmount) > 0
+    },
     getGHSList() {
       return ghsList().then(res => {
         this.supplierList = res.data.list
@@ -1243,6 +1261,21 @@ export default {
   text-overflow: ellipsis;
 }
 
+.clear-actions {
+  flex-shrink: 0;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.clear-actions .clear-action {
+  margin-left: 16upx;
+}
+
+.clear-actions .clear-action:first-child {
+  margin-left: 0;
+}
+
 .clear-action {
   flex-shrink: 0;
   margin-left: 18upx;