Procházet zdrojové kódy

Merge branch 'dev' into dev-mlchen-wms-index

mlchen před 4 dny
rodič
revize
d64ecc7630

+ 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;
+}

+ 8 - 4
src/views/warehouseManagement/inventoryAllocation/components/inventory-search.vue

@@ -200,11 +200,11 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="对账状态:" prop="isReconciliation">
+        <el-form-item label="对账状态:" prop="reconciliationStatus">
           <el-select
             filterable
             placeholder="请选择"
-            v-model="where.isReconciliation"
+            v-model="where.reconciliationStatus"
             clearable
             class="w100"
           >
@@ -275,6 +275,7 @@
         targetWarehouse: '',
         sourceWarehouse: '',
         isReconciliation: '',
+        reconciliationStatus: '',
         time: []
       };
       return {
@@ -302,8 +303,11 @@
           }
         ],
         isReconciliationOp: [
-          { value: 0, label: '未对账' },
-          { value: 1, label: '已对账' }
+          //  0:未入池 1:未对账 2:对账中 3:已对账
+          { value: 0, label: '未入池' },
+          { value: 1, label: '未对账' },
+          { value: 2, label: '对账中' },
+          { value: 3, label: '已对账' }
         ]
       };
     },

+ 17 - 7
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -60,7 +60,7 @@
           </el-dropdown>
 
           <el-button v-if="$hasPermission('wms:inventoryAllocation:statement')" :disabled="selection.length == 0" type="primary"  @click="handleGenerateStatement('add')"
-            >生成对账单</el-button
+            >推送对账池</el-button
           >
         </template>
         <!-- 单号链接 -->
@@ -157,8 +157,10 @@
         groupName: '',
         saveLoading: false,
         isReconciliationOp: [
-          { value: 0, label: '未对账' },
-          { value: 1, label: '已对账' },
+          { value: 0, label: '未入池' },
+          { value: 1, label: '未对账' },
+          { value: 2, label: '对账中' },
+          { value: 3, label: '已对账' }
         ],
         inventoryDimensionOp: [{
           code: '1',
@@ -225,7 +227,7 @@
             }
           },
           {
-            prop: 'isReconciliation',
+            prop: 'reconciliationStatus',
             label: '对账状态',
             align: 'center',
             showOverflowTooltip: true,
@@ -348,24 +350,32 @@
       // 生成对账单
       handleGenerateStatement(type) {
         if (this.selection.length == 0) {
-          this.$message.warning('请选择要生成对账单的记录');
+          this.$message.warning('请选择要推送对账池的记录');
           return;
         }
 
         // 检查选中的记录状态是否为2
         const invalidRecords = this.selection.filter(item => item.status != 2);
         if (invalidRecords.length > 0) {
-          this.$message.warning('请选择已完成的调拨单生成对账单');
+          this.$message.warning('请选择已完成的调拨单推送对账池');
           return;
         }
 
         // 检查选中的列表维度是否包含物品维度
         const dimensionRecords = this.selection.filter(item => item.inventoryDimension == 1);
         if (dimensionRecords.length > 0) {
-          this.$message.warning('请选择批次维度或包装维度调拨单生成对账单');
+          this.$message.warning('请选择批次维度或包装维度调拨单推送对账池');
           return;
         }
 
+        // 只有reconciliationStatus=0的才能点击推送对账池
+        const reconciliationRecords = this.selection.filter(item => item.reconciliationStatus != 0);
+        if (reconciliationRecords.length > 0) {
+          this.$message.warning('只有未入池的才能点击推送对账池');
+          return;
+        }
+
+
         this.generateStatementFlag = true;
         this.$nextTick(() => {
           this.$refs.generateStatementRef.open(type, this.selection);

+ 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 = {