647556386
2026-01-12 2654a849bcbbd03df38592b29c22df56d750fb27
优化
已修改8个文件
297 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/check/recheckOrder.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue 212 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/check/recheckOrder.js
@@ -48,26 +48,7 @@
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {  //框架初始化配置前,
      this.columns.push({
        field: '操作',
        title: '操作',
        width: 90,
        fixed: 'right',
        align: 'center',
        formatter: (row) => {
          return (
            '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">指定库存</i>'
          );
        },
        click: (row) => {
          const table = this.$refs.table.$refs.table;
          if (table) {
            table.clearSelection();
            table.toggleRowSelection(row, true);
          }
          this.$refs.gridBody.open(row);
        }
      });
      let EmptyTrayOutboundBtn = this.buttons.find(x => x.value == 'BatchOrder');
      if (EmptyTrayOutboundBtn) {
        EmptyTrayOutboundBtn.onClick = function () {
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue
@@ -1,5 +1,6 @@
<template>
  <div>
    <!-- åº“存指定弹窗 -->
    <vol-box
      v-model="showDetialBox"
      :lazy="true"
@@ -26,13 +27,6 @@
              </span>
            </el-col>
            <el-col :span="8">
             <!--  <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px"
                @click="getData(false)"
                >{{ kcname }}</el-link
              > -->
              <el-link
                type="primary"
                size="small"
@@ -40,13 +34,6 @@
                @click="getData"
                >刷新</el-link
              >
      <!--         <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="revokeAssign"
                >撤销分配</el-link
              > -->
            </el-col>
          </el-row>
        </el-alert>
@@ -61,7 +48,6 @@
          height="500px"
          @selection-change="handleSelectionChange"
        >
          >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            label="序号"
@@ -94,29 +80,78 @@
        </el-table>
      </div>
      <template #footer>
       <el-button type="primary" size="small" @click="outbound"
        <el-button type="primary" size="small" @click="openStationDialog"
          >直接出库</el-button
        >
        <el-button type="danger" size="small" @click="showDetialBox = false"
          >关闭</el-button
        >
      </template>
    </vol-box>
    <!-- ç«™å°é€‰æ‹©å¼¹çª— -->
    <el-dialog
      v-model="showStationDialog"
      title="选择出库站台"
      width="500px"
      :close-on-click-modal="false"
    >
      <div class="station-dialog-content">
        <el-form :model="stationForm" label-width="100px">
          <el-form-item label="选择站台:" required>
            <el-select
              v-model="stationForm.selectedPlatform"
              placeholder="请选择出库站台"
              style="width: 100%"
            >
              <el-option
                v-for="item in stations"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="出库数量:">
            <el-input
              v-model="selectionSum"
              readonly
              style="width: 100%"
            ></el-input>
          </el-form-item>
          <el-form-item label="物料信息:">
            <div style="font-size: 12px; color: #666; line-height: 1.5">
              <div>物料编号:{{ row.materielCode }}</div>
              <div>物料名称:{{ row.materielName }}</div>
            </div>
          </el-form-item>
        </el-form>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="showStationDialog = false">取消</el-button>
          <el-button type="primary" @click="confirmOutbound">确认出库</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
import { fa } from "element-plus/es/locales.mjs";
// å¼•入站台管理工具
import { stationManager } from "@/../src/uitils/stationManager";
export default {
  components: { VolBox },
  data() {
    return {
      row: null,
      kcname: "",
      mainOrderNo: '',
      mainOrderNo: "",
      pkcx: false,
      showDetialBox: false,
      showStationDialog: false, // ç«™å°é€‰æ‹©å¼¹çª—显示控制
      tableData: [],
      tableColumns: [
        {
@@ -168,7 +203,8 @@
          prop: "stockId",
          title: "库存主键",
          type: "string",
        },{
        },
        {
          prop: "orderDetailId",
          title: "单据明细主键",
          type: "string",
@@ -178,13 +214,22 @@
      selectionSum: 0,
      selectionClass: "less-style",
      originalQuantity: 0,
      // ç«™å°ç›¸å…³æ•°æ®
      stations: [
        { label: "站台2", value: "2-1" },
        { label: "站台3", value: "3-1" },
      ],
      stationForm: {
        selectedPlatform: "", // ä¿®æ”¹å­—段名以匹配参数
      },
    };
  },
  methods: {
    open(row, orderNo) {
    this.row = row;
    this.mainOrderNo = orderNo; // å­˜å‚¨ä¸»å•据编号
    this.showDetialBox = true;
      this.row = row;
      this.mainOrderNo = orderNo;
      this.showDetialBox = true;
      this.originalQuantity = this.row.lockQuantity;
      this.selectionSum = this.row.lockQuantity;
      this.getData();
@@ -197,40 +242,80 @@
        this.selectionClass = "more-style";
      }
    },
    lockStock() {
      this.http
        .post(
          "api/OutboundOrderDetail/LockOutboundStock?id=" + this.row.id,
          this.selection,
          "数据处理中"
        )
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    outbound() {
    // æ‰“开站台选择弹窗
    openStationDialog() {
      if (this.selection.length <= 0) {
        return this.$message.error("请勾选");
        return this.$message.error("请先勾选要出库的库存");
      }
      let url = this.pkcx
        ? "api/Task/GenerateOutboundTask?orderDetailId="
        : "api/Task/GenerateOutboundTask?orderDetailId=";
      this.http
        .post(url + this.row.id, this.selection, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
      // ä»Žç¼“存中获取默认站台
      const cachedStation = stationManager.getStation();
      this.stationForm.selectedPlatform = cachedStation || "";
      this.showStationDialog = true;
    },
    // ç¡®è®¤å‡ºåº“
    async confirmOutbound() {
      if (!this.stationForm.selectedPlatform) {
        return this.$message.error("请选择出库站台");
      }
      // å‡†å¤‡è¯·æ±‚参数
      const requestParams = {
        detailIds: [this.row.id], // å‡ºåº“单的明细ID
        outboundTargetLocation: this.stationForm.selectedPlatform, // é€‰æ‹©çš„站台
        outboundQuantity: this.selectionSum, // å·²é€‰æ•°é‡
        operator: this.getCurrentOperator(), // èŽ·å–å½“å‰æ“ä½œäºº
        orderNo: this.mainOrderNo, // å•据编号
        stockDetailIds: this.selection.map(item => item.stockId) // åº“存明细主键数组
      };
      try {
        const x = await this.http.post(
          "api/Outbound/ProcessPickingOutbound",
          requestParams,
          "数据处理中"
        );
        if (!x.status) {
          return this.$message.error(x.message);
        }
        this.$message.success("出库任务创建成功");
        this.showStationDialog = false;
        this.showDetialBox = false;
        this.$emit("parentCall", ($vue) => {
          $vue.getData();
        });
      } catch (error) {
        this.$message.error(error.message || "出库处理失败");
      }
    },
    // èŽ·å–å½“å‰æ“ä½œäºº
    getCurrentOperator() {
      // å¯ä»¥ä»Žæœ¬åœ°å­˜å‚¨ã€Vuex或全局状态中获取当前用户
      try {
        // ç¤ºä¾‹ï¼šä»ŽlocalStorage获取用户信息
        const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}');
        if (userInfo.userName) {
          return userInfo.userName;
        }
        // ç¤ºä¾‹ï¼šä»ŽVuex获取用户信息
        if (this.$store && this.$store.state.user) {
          return this.$store.state.user.userName;
        }
      } catch (error) {
        console.error('获取操作人信息失败:', error);
      }
      // é»˜è®¤æ“ä½œäºº
      return "admin";
    },
    getData(a) {
      if (!a) this.pkcx = !this.pkcx;
      let url = this.pkcx
@@ -247,7 +332,7 @@
          this.tableData = x;
        });
    },
    handleSelectionChange(val) {
      this.selection = val;
      this.selectionSum =
@@ -264,6 +349,7 @@
        this.selectionClass = "more-style";
      }
    },
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
@@ -273,15 +359,18 @@
        this.$refs.singleTable.clearSelection();
      }
    },
    clearSelection() {
      this.$refs.singleTable.clearSelection();
    },
    handleRowClick(row) {
      this.$refs.singleTable.toggleRowSelection(row);
    },
  },
};
</script>
<style scoped>
.less-style {
  color: black;
@@ -293,6 +382,17 @@
.more-style {
  color: red;
}
/* ç«™å°é€‰æ‹©å¼¹çª—样式 */
.station-dialog-content {
  padding: 10px 0;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
</style>
@@ -307,12 +407,10 @@
.box-table .el-table tbody tr:hover > td {
  background-color: #d8e0d4 !important;
  /* color: #ffffff; */
}
.box-table .el-table tbody tr.current-row > td {
  background-color: #f0f9eb !important;
  /* color: #ffffff; */
}
.el-table .success-row {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs
@@ -176,7 +176,7 @@
                OrderType = InOrderTypeEnum.ReCheck.ObjToInt(),
                OrderStatus = 0,
                CreateType = 0,
                BusinessType = "",
                BusinessType = "30",
                IsBatch = 0,
                FactoryArea = reCheckOrder.FactoryArea,
                Remark = "",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs
@@ -706,10 +706,15 @@
                    if (!string.IsNullOrEmpty(newBarcode))
                    {
                        // ç‰©æ–™æ–°æ¡ç å›žä¼ 
                        //_feedbackMesService.BarcodeFeedback(newBarcode);
                        _feedbackMesService.BarcodeFeedback(newBarcode);
                    }
                    //_feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
                    List<Dt_OutboundOrderDetail> details = _outboundOrderDetailRepository.QueryData(x => x.OrderId == outboundOrder.Id);
                    if(details.All(x => x.OverOutQuantity >= x.OrderQuantity - x.MoveQty))
                    {
                        outboundOrder.OrderStatus = OutOrderStatusEnum.出库完成.ObjToInt();
                        _outboundOrderRepository.UpdateData(outboundOrder);
                    }
                    _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
                }
                catch (Exception ex)
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -359,7 +359,7 @@
            }
            var data = BaseDal.Db.Queryable<Dt_OutboundOrder>()
                .WhereIF(!wheres.IsNullOrEmpty(), wheres)
                .Where(x => x.OrderType == 0)
                .Where(x => x.OrderType == 0 || x.OrderType == 116)
                .OrderBy(orderByModels)
                .ToPageList(options.Page, options.Rows, ref totalCount);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs
@@ -1098,6 +1098,11 @@
                            ContractResolver = new CamelCasePropertyNamesContractResolver()
                        };
                        item.ReturnJsonData = JsonConvert.SerializeObject(barcodesList, settings);
                        //重拣出库不需要回传
                        if (outboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt())
                        {
                            item.ReturnJsonData = "";
                        }
                    }
                    lockInfo.SortedQuantity = lockInfo.SortedQuantity + actualOutboundQuantity;
@@ -1124,13 +1129,13 @@
                    response.Success = true;
                    response.Message = "出库完成";
                    response.UpdatedDetails = updateDetails;
                    // æ£€æŸ¥å‡ºåº“单是否完成
                    if (CheckOutboundOrderCompleted(request.OrderNo))
                    {
                        UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.出库完成.ObjToInt());
                        if (outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt())
                        if (outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt()&& outboundOrder.OrderType!= InOrderTypeEnum.ReCheck.ObjToInt())
                        {
                            _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
                        }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -716,21 +716,9 @@
                {
                    return WebResponseContent.Instance.Error($"货位状态不正确");
                }
                List<Dt_AllocateMaterialInfo> allocateMaterialInfos = _allocateMaterialInfo.QueryData(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo);
                if(allocateMaterialInfos == null)
                {
                    return content.Error("未找到入智仓的物料信息");
                }
                string Operator = allocateMaterialInfos.FirstOrDefault().Creater;
                _unitOfWorkManage.BeginTran();
                var alldelete = _allocateMaterialInfo.DeleteAndMoveIntoHty(allocateMaterialInfos ,OperateTypeEnum.自动删除);
                if (!alldelete)
                {
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                var beforelocationStatus = locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                _locationInfoService.Repository.UpdateData(locationInfo);
@@ -749,7 +737,19 @@
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x=>x.Details).First();
                foreach (var item in stockInfo.Details.Where(x => x.OrderNo == outboundOrder.OrderNo).ToList())
                {
                    var inbounddetail = _allocateMaterialInfo.QueryFirst(x => x.OrderNo == item.OrderNo && x.Barcode == item.Barcode);
                    if (inbounddetail != null)
                    {
                        var alldelete = _allocateMaterialInfo.DeleteAndMoveIntoHty(inbounddetail, OperateTypeEnum.自动删除);
                        if (!alldelete)
                        {
                            await Db.Deleteable(task).ExecuteCommandAsync();
                        }
                    }
                }
                string Operator = outboundOrder.Modifier;
                ///回调MES
                HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>();
                string reqCode = Guid.NewGuid().ToString();
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -1090,6 +1090,14 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                var allFactoryAreas = stockViews.SelectMany(sv => sv.Details)
                                                .Select(x => x.FactoryArea)
                                                .GroupBy(x => x)
                                                .ToList();
                if (allFactoryAreas.Count >= 2)
                {
                    return content.Error($"请选择同一厂区区域的库存进行盘点,当前涉及{allFactoryAreas.Count}个不同的厂区");
                }
                List<int> ids = stockViews.Select(x => x.StockId).ToList();
                //获取库存
                List<Dt_StockInfo> stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => ids.Contains(x.Id)).Includes(x => x.Details).ToList();
@@ -1122,9 +1130,9 @@
                        return content.Error($"未找到{item.PalletCode}库存明细数据");
                    }
                    Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode);
                    if (locationInfo == null && (locationInfo.EnableStatus == EnableStatusEnum.Disable.ObjToInt() || locationInfo.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && item.StockStatus != StockStatusEmun.入库完成.ObjToInt())
                    if (locationInfo == null || (locationInfo.EnableStatus == EnableStatusEnum.Disable.ObjToInt() || locationInfo.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) || locationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt() || item.StockStatus != StockStatusEmun.入库完成.ObjToInt())
                    {
                        content.Error($"{item.PalletCode}货位或库存状态不满足出库条件");
                        return content.Error($"{item.PalletCode}货位或库存状态不满足出库条件");
                    }   
                }
                List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutInventory,outStation);