Browse Source

style: 优化代码格式,调整条件判断和返回值的可读性

xieyong 1 day ago
parent
commit
e1eedea374
1 changed files with 13 additions and 4 deletions
  1. 13 4
      src/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue

+ 13 - 4
src/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue

@@ -182,7 +182,11 @@
         const cacheWidths = this.getStorage(this.cacheKeyUrl + 'Widths') || {};
         const applyWidth = (col) => {
           if (col.prop && cacheWidths[col.prop]) {
-            return { ...col, width: cacheWidths[col.prop], minWidth: undefined };
+            return {
+              ...col,
+              width: cacheWidths[col.prop],
+              minWidth: undefined
+            };
           }
           return col;
         };
@@ -441,7 +445,8 @@
           data.list = data.list.map((item, index) => {
             const stockCountBase = Math.max(
               Number(
-                item.stockCountBase !== undefined && item.stockCountBase !== null
+                item.stockCountBase !== undefined &&
+                  item.stockCountBase !== null
                   ? item.stockCountBase
                   : item.measureQuantity
               ) || 0,
@@ -545,10 +550,14 @@
         return Number(row.measureQuantity || 0);
       },
       getAvailableStockCount(row) {
-        if (row.availableCountBase !== undefined && row.availableCountBase !== null) {
+        if (
+          row.availableCountBase !== undefined &&
+          row.availableCountBase !== null
+        ) {
           return Number(row.availableCountBase);
         }
-        const available = this.getStockCount(row) - Number(row.lockQuantity || 0);
+        const available =
+          this.getStockCount(row) - Number(row.lockQuantity || 0);
         return Math.max(Number(available.toFixed(4)), 0);
       },
       // 限制订单数量不超过当前可用数量