Ver Fonte

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

xieyong há 2 dias atrás
pai
commit
092c19e114

+ 6 - 0
src/styles/index.scss

@@ -3,3 +3,9 @@ $--ele-font-path: '~ele-admin/es/style/fonts';
 @import '~ele-admin/es/style/themes/dynamic.scss';
 @import '~ele-admin/es/style/index.scss';
 @import './transition/index.scss';
+
+/* 后端报错信息可能携带换行(多条数据逐行返回),提醒与弹窗保留换行显示 */
+.el-message .el-message__content,
+.el-message-box__message p {
+  white-space: pre-line;
+}

+ 56 - 4
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -69,7 +69,7 @@
             fileName="库存台账"
             :apiUrl="exportApiUrl"
             :params="params"
-            v-if="selectedDime == 2"
+            v-if="selectedDime == 1 || selectedDime == 2"
           ></exportButton>
 
           <el-button
@@ -187,6 +187,26 @@
         <span v-else>{{ row.lockQuantity || 0 }}</span>
       </template>
 
+      <template v-slot:productStockCountBase="{ row }">
+        <el-tooltip
+          v-if="row.productStockCountBase != null"
+          :content="productStockTooltip(row)"
+          placement="top"
+        >
+          <span>
+            {{ row.productStockCountBase }}
+            <el-tag
+              v-if="isProductStockAbnormal(row)"
+              type="danger"
+              size="mini"
+            >
+              总账异常,需对账
+            </el-tag>
+          </span>
+        </el-tooltip>
+        <span v-else>-</span>
+      </template>
+
       <template v-slot:areaName="{ row }">
         <el-link type="primary" @click="openUploadDetail(row, 'list')">
           查看
@@ -514,6 +534,15 @@
               return Math.round(result * 100) / 100;
             }
           },
+          this.selectedDime == 1 || this.selectedDime == 2
+            ? {
+                prop: 'productStockCountBase',
+                label: '物品总账库存',
+                slot: 'productStockCountBase',
+                align: 'center',
+                minWidth: 180
+              }
+            : '',
           {
             prop: 'measureQuantity',
             label: '计量数量',
@@ -776,6 +805,28 @@
       }
     },
     methods: {
+      productStockTooltip(row) {
+        return `物品总账库存:${row.productStockCountBase},总账可用余额:${
+          row.productAvailableCountBase ?? '-'
+        }。总账为物品全部库存,不随当前仓库或批次筛选;出库同时校验总账和批次。`;
+      },
+      // 批次余量不能证明总账正常;这里只提示可以明确判断的数量异常。
+      isProductStockAbnormal(row) {
+        if (row.productStockCountBase == null) return false;
+        const stock = Number(row.productStockCountBase);
+        const available = row.productAvailableCountBase;
+        if (stock < 0 || (available != null && Number(available) < 0)) {
+          return true;
+        }
+        if (Number(row.preWarehousing) === 1) return false;
+        const rowStock = row.stockCountBase ?? row.measureQuantity;
+        return (
+          (rowStock != null && stock < Number(rowStock)) ||
+          (available != null &&
+            row.availableCountBase != null &&
+            Number(available) < Number(row.availableCountBase))
+        );
+      },
       handleUnlock() {
         console.log('this.checkRadioData', this.checkRadioData);
         if (this.checkRadioData?.length != 1) {
@@ -948,13 +999,14 @@
         const treeId = this.$parent.$parent.$parent.current.id;
         if (dimension == 1) {
           // 物品维度
-          const data = storageApi.getProductList({
+          const params = {
             ...where,
             ...order,
             pageNum: page,
             size: limit
-          });
-          return data;
+          };
+          this.params = { ...params, type: 0 };
+          return storageApi.getProductList(params);
         } else if (dimension == 2) {
           // 批次维度
           const params = {