heshaofeng
2 天以前 0474bea600b73ee35b9ce0aac5b65ff720492d37
提交
已修改3个文件
202 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue
@@ -11,7 +11,7 @@
                <el-form-item label="托盘条码:">
                    <el-input v-model="form.palletCode" placeholder="请扫描/输入托盘条码" @keyup.enter="submit" @keyup.13="submit"
                        clearable maxlength="50" @paste="handlePaste" @input="handleInput" />
                        clearable maxlength="50" @paste="handlePaste" @input="handleInput" ref="boxCodeInput" />
                </el-form-item>
            </el-form>
        </template>
@@ -47,6 +47,9 @@
        open() {
            this.show = true
            this.getData();
            this.$nextTick(() => {
                this.focusInput()
            })
        },
        async getData() {
@@ -61,6 +64,7 @@
        async submit() {
            if (!this.form.palletCode) {
                this.$message.warning('请输入托盘条码')
                this.focusInput()
                return
            }
@@ -81,14 +85,20 @@
                )
                if (status) {
                    this.$message.success("组盘成功")
                    this.show = false
                    this.$emit('refresh')
                    this.$message.success("组盘成功");
                    // æ¸…空输入框数据
                    this.form.palletCode = '';
                    // èšç„¦å¹¶é€‰ä¸­è¾“入框
                    this.focusAndSelectInput();
                } else {
                    this.$message.error(message || '操作失败')
                    this.$message.error(message || '操作失败');
                    // å¤±è´¥æ—¶ä¸æ¸…理数据,但聚焦并选中输入框,方便修改
                    this.focusAndSelectInput();
                }
            } catch (error) {
                this.$message.error('请求异常')
                this.$message.error('请求异常');
                // å¼‚常时也不清理数据
                this.focusAndSelectInput();
            }
        },
@@ -101,6 +111,52 @@
        handlePaste(e) {
            // ç²˜è´´æ—¶è‡ªåŠ¨æäº¤
            setTimeout(this.submit, 100)
        },
        // èšç„¦å¹¶é€‰ä¸­è¾“入框
        focusAndSelectInput() {
            this.$nextTick(() => {
                setTimeout(() => {
                    const inputRef = this.$refs.boxCodeInput;
                    if (inputRef) {
                        // Element Plus/Element UI çš„处理方式
                        const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
                        if (inputEl) {
                            inputEl.focus();
                            inputEl.select();
                        }
                    }
                }, 100);
            });
        },
        // åªèšç„¦è¾“入框(不清空数据)
        focusInput() {
            this.$nextTick(() => {
                const inputRef = this.$refs.boxCodeInput;
                if (inputRef) {
                    const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
                    inputEl?.focus();
                }
            });
        },
        // æ¸…空表单数据
        clearForm() {
            this.form.palletCode = '';
            // ä¸æ¸…空 locationType,保持区域选择
        }
    },
    watch: {
        show(val) {
            if (val) {
                this.$nextTick(() => {
                    this.focusInput()
                })
            } else {
                // å…³é—­å¼¹çª—时清空表单
                this.clearForm();
            }
        }
    }
}
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue
@@ -103,6 +103,32 @@
        <el-alert :title="error" type="error" show-icon closable @close="error = ''" />
      </div>
      <!-- æœªç»„盘列表 -->
      <div class="unpallet-section compact">
        <el-card shadow="hover" class="compact-card unpallet-card">
          <div slot="header" class="compact-header">
            <span><i class="el-icon-tickets"></i> æœªç»„盘条码</span>
            <span class="list-actions">
              <el-tag type="primary" size="small">未组盘 {{ totalStockCount }}</el-tag>
            </span>
          </div>
          <div  class="table-container">
            <el-table :data="unpalletMaterials" stripe style="width: 100%" height="100%" size="small" v-loading="unpalletBarcodesLoading">
              <el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
              <el-table-column prop="barcode" label="条码" min-width="140" show-overflow-tooltip></el-table-column>
              <el-table-column prop="materielCode" label="物料编码" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="batchNo" label="批次" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="orderQuantity" label="数量" min-width="130" align="right"></el-table-column>
              <el-table-column prop="unit" label="单位" width="80" align="center"></el-table-column>
              <el-table-column prop="supplyCode" label="供应商" min-width="130" show-overflow-tooltip></el-table-column>
            </el-table>
          </div>
        </el-card>
      </div>
      <!-- ç‰©æ–™åˆ—表 - å›ºå®šé«˜åº¦å¸¦æ»šåŠ¨æ¡ -->
      <div class="material-list compact">
        <el-card shadow="hover" class="compact-card">
@@ -110,7 +136,6 @@
            <span><i class="el-icon-tickets"></i> ç»„盘数据</span>
            <span class="list-actions">
              <el-tag type="primary" size="small">共 {{ materials.length }} æ¡</el-tag>
              <el-tag type="primary" size="small">未组盘 {{ totalStockCount }}</el-tag>
              <el-tag type="primary" size="small">未入库数量 {{ totalStockSum }}{{ uniqueUnit }}</el-tag>
              <el-tag v-if="trayBarcode" type="success" size="small">托盘: {{ trayBarcode }}</el-tag>
              <el-tag v-if="form.warehouseType" type="info" size="small">仓库: {{ currentWarehouseName }}</el-tag>
@@ -177,6 +202,10 @@
      error: '',
      debugMode: false,
      currentFocus: 'warehouse',
      unpalletBarcodes:[],
      unpalletBarcodesLoading: false,
      unpalletMaterials: [], // æœªç»„盘详细数据列表
      // æ‰«ç æžªç›¸å…³å˜é‡
      scanCode: '',
@@ -257,6 +286,7 @@
            this.initwarehouseTypes(); // åˆå§‹åŒ–仓库
            this.initLocationTypes(); // åˆå§‹åŒ–仓库区域
            this.fetchStockStatistics(); // åŠ è½½ç»Ÿè®¡æ•°æ®
            this.fetchUnpalletMaterialDetails();
          }, 300);
        });
      }
@@ -276,6 +306,7 @@
        this.backData = [];
        this.$refs.palletForm?.reset();
        this.fetchStockStatistics(); // å•据号变了,刷新统计
        this.fetchUnpalletMaterialDetails();
      }
    }
  },
@@ -316,6 +347,43 @@
        callback(new Error('请选择仓库区域'));
      } else {
        callback();
      }
    },
    // æ ¹æ®æ¡ç åˆ—表获取详细数据
    async fetchUnpalletMaterialDetails() {
      try {
        // å°è¯•调用接口获取详细数据
        // æ³¨æ„ï¼šå¦‚果这个接口不存在,可以注释掉或根据实际API调整
        const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo='+this.docNo, {
        });
        console.log('未组盘数据:', response.data);
        if (response.status && Array.isArray(response.data)) {
          this.unpalletMaterials = response.data;
          this.unpalletBarcodes = response.data.map(item => item.barcode || '');
          this.totalStockCount = response.data.length;
        } else {
          // å¦‚果接口返回格式不同,尝试其他方式
          // å¦‚果接口不存在,这里会进入catch,设置为空数组
          this.unpalletMaterials = [];
        }
      } catch (err) {
        console.warn('获取未组盘详细数据接口可能不存在,使用条码列表显示:', err);
        // å¦‚果接口不存在,将条码列表转换为简单的显示格式
        // æˆ–者保持为空,让用户知道需要选择仓库和区域来查看详细数据
        this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({
          barcode: barcode,
          materielCode: '-',
          batchNo: '-',
          stockQuantity: '-',
          unit: '-',
          supplyCode: '-',
          warehouseType: '-'
        }));
      }
    },
    /**
@@ -399,6 +467,7 @@
                console.log('仓库区域验证通过:', value);
                // åŒºåŸŸé€‰æ‹©åŽï¼Œè‡ªåŠ¨èšç„¦åˆ°æ‰˜ç›˜è¾“å…¥æ¡†
                this.focusLocationSelect();
                // åˆ·æ–°æœªç»„盘数据(根据选择的仓库和区域过滤)
              }
            });
          }, 100);
@@ -555,6 +624,8 @@
      this.trayBarcode = '';
      this.barcode = '';
      this.materials = [];
      this.unpalletBarcodes = [];
      this.unpalletMaterials = [];
      this.loading = false;
      this.error = '';
      this.scanCode = '';
@@ -813,6 +884,13 @@
              scanTime: this.formatTime(new Date())
            });
          });
          const removeIndex = this.unpalletMaterials.findIndex(item => item.barcode === currentBarcode);
          if (removeIndex > -1) {
            this.unpalletMaterials.splice(removeIndex, 1); // åˆ é™¤æœªç»„盘对应数据
            this.unpalletBarcodes = this.unpalletMaterials.map(item => item.barcode || ''); // æ›´æ–°æ¡ç æ•°ç»„
            this.totalStockCount = Math.max(0, this.totalStockCount - 1);
          }
          
          this.$message({
            message: `成功添加条码: ${currentBarcode}`,
@@ -1297,5 +1375,37 @@
    border: 1px solid #DCDFE6;
    border-radius: 4px;
  }
  .unpallet-section.compact {
  margin-bottom: 8px;
  flex-shrink: 0;
}
.unpallet-card {
  flex-shrink: 0;
}
.unpallet-barcode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  max-height: 180px;
  overflow-y: auto;
}
.unpallet-barcode-list>>>.el-tag {
  cursor: pointer;
  max-width: calc(33.333% - 4px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .unpallet-barcode-list>>>.el-tag {
    max-width: calc(50% - 4px);
  }
}
}
</style>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -645,15 +645,19 @@
                {
                    resultDTO.UniqueUnit = "";
                }
                var validDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(s => s.OrderNo == orderNo).ToList();
                resultDTO.StockSumQuantity = orderDetail.Details.Sum(d => d.OrderQuantity);
                resultDTO.StockCount = orderDetail.Details.Count;
                if (validDetails.Any())
                {
                    resultDTO.StockSumQuantity -= validDetails.Sum(d => d.StockQuantity);
                    // æ˜Žç»†è®°å½•数:符合条件的有效记录条数
                    resultDTO.StockCount -= validDetails.Count;
                }
                var inbound =_inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == orderNo);
                var inboundDetails = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inbound.First().Id).ToList();
                resultDTO.StockSumQuantity = inboundDetails.Where(x=>x.ReceiptQuantity==0).Sum(x=>x.OrderQuantity);
                resultDTO.StockCount = inboundDetails.Where(x => x.ReceiptQuantity == 0).Count();
                //var validDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(s => s.OrderNo == orderNo).ToList();
                //resultDTO.StockSumQuantity = orderDetail.Details.Sum(d => d.OrderQuantity);
                //resultDTO.StockCount = orderDetail.Details.Count;
                //if (validDetails.Any())
                //{
                //    resultDTO.StockSumQuantity -= validDetails.Sum(d => d.StockQuantity);
                //    // æ˜Žç»†è®°å½•数:符合条件的有效记录条数
                //    resultDTO.StockCount -= validDetails.Count;
                //}
                return content.OK("", resultDTO);
            }
            catch (Exception ex)