1
heshaofeng
2025-11-08 0b87b08ef12e2293cf073f75f7ee73b9423686fa
1
已添加3个文件
已修改7个文件
671 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/router/viewGird.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue 478 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockInfoDetailWithPalletDto.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: '',
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
      modelBody: '',
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
        //返回false,则不会执行查询
        return true;
      },
      searchAfter(result) {
        //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
        return true;
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
        return true;
      },
      rowClick({ row, column, event }) {
        //查询界面点击行事件
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      }
    }
  };
  export default extension;
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue
@@ -49,7 +49,7 @@
                 class="custom-input"
            >
              <template slot="prepend">
                <span>料箱。码</span>
                <span>料箱码</span>
              </template>
              <template slot="append">
                <el-button 
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/router/viewGird.js
@@ -185,6 +185,11 @@
    path: '/materielToMes',
    name: 'Dt_MaterielToMes',
    component: () => import('@/views/inbound/Dt_MaterielToMes.vue')
  },
  {
    path: '/allocateOrder',
    name: 'Dt_AllocateOrder',
    component: () => import('@/views/inbound/Dt_AllocateOrder.vue')
  }
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,478 @@
<template>
  <view-grid
    ref="gridRef"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
<script>
import extend from "@/extension/inbound/Dt_AllocateOrder.js";
import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import { ref, defineComponent } from "vue";
export default defineComponent({
  components: {
    viewGrid: ViewGrid,
    PalletDialog
  },
  setup() {
    // è¡¨æ ¼åŸºç¡€é…ç½®ï¼šå¯¹é½è°ƒæ‹¨å•实体
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "调拨单",
      name: "allocateOrder",
      url: "/allocateOrder/", // åŽç«¯æŽ¥å£è·¯å¾„需与调拨单接口匹配
      sortName: "id",
    });
    // ç¼–辑表单字段:对应Dt_AllocateOrder可编辑属性
    const editFormFields = ref({
      orderNo: "",
      upperOrderNo: "",
      supplierId: "",
      orderType: "",
      businessType: "",
      fromWarehouse: "",
      toWarehouse: "",
      isBatch: false,
      factoryArea: "",
      remark: "",
    });
    // ç¼–辑表单配置:按实体字段类型设置组件
    const editFormOptions = ref([
      [
        {
          title: "单据编号",
          field: "orderNo",
          type: "string",
          required: true,
        },
        {
          title: "上级单据编号",
          field: "upperOrderNo",
          type: "string",
        },
        {
          title: "供应商ID",
          field: "supplierId",
          type: "string",
          required: true,
        },
        {
          title: "订单类型",
          field: "orderType",
          type: "select",
          dataKey: "allocateOrderType", // è°ƒæ‹¨å•专属枚举key
          data: [],
          required: true,
        },
      ],
      [
        {
          title: "业务类型",
          field: "businessType",
          type: "string",
          required: true,
        },
        {
          title: "来源仓库",
          field: "fromWarehouse",
          type: "select",
          dataKey: "warehouses", // ä»“库枚举key(复用或单独配置)
          data: [],
          required: true,
        },
        {
          title: "目标仓库",
          field: "toWarehouse",
          type: "select",
          dataKey: "warehouses",
          data: [],
          required: true,
        },
        {
          title: "是否批次",
          field: "isBatch",
          type: "checkbox",
        },
      ],
      [
        {
          title: "厂区",
          field: "factoryArea",
          type: "string",
          required: true,
        },
        {
          title: "备注",
          field: "remark",
          type: "textarea",
        },
      ],
    ]);
    // æœç´¢è¡¨å•字段:对应Dt_AllocateOrder查询属性
    const searchFormFields = ref({
      orderNo: "",
      upperOrderNo: "",
      supplierId: "",
      orderType: "",
      orderStatus: "",
      createType: "",
      businessType: "",
      fromWarehouse: "",
      toWarehouse: "",
      factoryArea: "",
      creater: "",
      createDate: "",
    });
    // æœç´¢è¡¨å•配置:按查询需求设置字段类型
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "orderNo", type: "like" },
        { title: "上级单据编号", field: "upperOrderNo", type: "like" },
        { title: "供应商ID", field: "supplierId", type: "like" },
        {
          title: "订单类型",
          field: "orderType",
          type: "select",
          dataKey: "allocateOrderType",
          data: [],
        },
      ],
      [
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "allocateOrderStatus",
          data: [],
        },
        {
          title: "创建类型",
          field: "createType",
          type: "select",
          dataKey: "createType",
          data: [],
        },
        { title: "业务类型", field: "businessType", type: "like" },
      ],
      [
        { title: "来源仓库", field: "fromWarehouse", type: "like" },
        { title: "目标仓库", field: "toWarehouse", type: "like" },
        { title: "厂区", field: "factoryArea", type: "like" },
      ],
      [
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
    // ä¸»è¡¨æ ¼åˆ—配置:完全对齐Dt_AllocateOrder字段
    const columns = ref([
      {
        field: "id",
        title: "Id",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        align: "left",
      },
      {
        field: "orderNo",
        title: "单据编号",
        type: "string",
        width: 120,
        align: "left",
        link: true,
      },
      {
        field: "upperOrderNo",
        title: "上级单据编号",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "supplierId",
        title: "供应商ID",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "orderType",
        title: "订单类型",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "allocateOrderType", data: [] },
      },
      {
        field: "orderStatus",
        title: "单据状态",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "allocateOrderStatus", data: [] },
      },
      {
        field: "createType",
        title: "创建方式",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "createType", data: [] },
      },
      {
        field: "businessType",
        title: "业务类型",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "fromWarehouse",
        title: "来源仓库",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "toWarehouse",
        title: "目标仓库",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "isBatch",
        title: "是否批次",
        type: "bool",
        width: 100,
        align: "left",
      },
      {
        field: "factoryArea",
        title: "厂区",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "调拨单明细",
      table: "AllocateOrderDetail",
      columns: [
        {
          field: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          align: "left",
        },
        {
          field: "orderId",
          title: "调拨单主键",
          type: "int",
          width: 90,
          align: "left",
          hidden: true,
        },
        {
          field: "materielCode",
          title: "物料编码",
          type: "select",
          width: 150,
          align: "left",
          required: true,
          dataKey: "materielCodes", // ç‰©æ–™ç¼–码枚举key
          data: [],
        },
        {
          field: "materielName", // å®žä½“中无该字段,需后端关联返回或调整为bind映射
          title: "物料名称",
          type: "string",
          width: 100,
          align: "left",
          bind: { key: "MaterielNames", data: [] },
        },
        {
          field: "batchNo",
          title: "批次号",
          type: "string",
          width: 90,
          align: "left",
          required: true,
        },
        {
          field: "orderQuantity",
          title: "订单数量",
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "receiptQuantity",
          title: "收货数量",
          type: "decimal",
          width: 90,
          align: "left",
        },
        {
          field: "overInQuantity",
          title: "超额入库数量",
          type: "decimal",
          width: 120,
          align: "left",
        },
        {
          field: "orderDetailStatus",
          title: "明细状态",
          type: "int",
          width: 120,
          align: "left",
          bind: { key: "allocateDetailStatus", data: [] },
        },
        {
          field: "unit",
          title: "单位",
          type: "string",
          width: 80,
          align: "left",
          required: true,
        },
        {
          field: "lineNo",
          title: "行号",
          type: "string",
          width: 80,
          align: "left",
          required: true,
        },
        {
          field: "warehouseCode",
          title: "仓库编码",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "barcode",
          title: "条形码",
          type: "string",
          width: 150,
          align: "left",
        },
        {
          field: "barcodeQty",
          title: "条形码数量",
          type: "decimal",
          width: 120,
          align: "left",
        },
        {
          field: "barcodeUnit",
          title: "条形码单位",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "creater",
          title: "创建人",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "remark",
          title: "备注",
          type: "string",
          width: 100,
          align: "left",
        },
      ],
      sortName: "id",
      key: "id",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
      palletVisible,
      currentPalletDocNo,
      handleOpenPalletDialog,
      handlePalletBackSuccess,
      gridRef
    };
  },
});
</script>
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -87,6 +87,13 @@
        align: "left",
      },
      {
        field: "palletCode",
        title: "托盘编号",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "materielCode",
        title: "物料编号",
        type: "string",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockInfoDetailWithPalletDto.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_DTO.Stock
{
    public class StockInfoDetailWithPalletDto : BaseEntity
    {
        public int Id { get; set; }
        public int StockId { get; set; }
        public string MaterielCode { get; set; }
        public string MaterielName { get; set; }
        public string OrderNo { get; set; }
        public string BatchNo { get; set; }
        public string ProductionDate { get; set; }
        public string EffectiveDate { get; set; }
        public string SerialNumber { get; set; }
        public decimal StockQuantity { get; set; }
        public decimal OutboundQuantity { get; set; }
        public int Status { get; set; }
        public string Unit { get; set; }
        public string InboundOrderRowNo { get; set; }
        public string SupplyCode { get; set; }
        public string WarehouseCode { get; set; }
        public string Barcode { get; set; }
        public string BusinessType { get; set; }
        public string Remark { get; set; }
        public string Creater { get; set; }
        public DateTime CreateDate { get; set; }
        public string Modifier { get; set; }
        public DateTime? ModifyDate { get; set; }
        // ä¸»è¡¨æ‰˜ç›˜ç¼–号(前端需显示的字段)
        public string PalletCode { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs
@@ -1,5 +1,7 @@
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Stock;
using WIDESEA_Model.Models;
namespace WIDESEA_IStockService
@@ -10,5 +12,7 @@
        bool ExistBarcodes(string barcode);
        bool ExistBarcodes(List<string> barcodes);
        PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -1,5 +1,9 @@
using WIDESEA_Core.BaseRepository;
using SqlSugar;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.HttpContextUser;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -7,10 +11,12 @@
{
    public partial class StockInfoDetailService : ServiceBase<Dt_StockInfoDetail, IRepository<Dt_StockInfoDetail>>, IStockInfoDetailService
    {
        public StockInfoDetailService(IRepository<Dt_StockInfoDetail> BaseDal) : base(BaseDal)
        public StockInfoDetailService(IRepository<Dt_StockInfoDetail> BaseDal, IRepository<Dt_StockInfo> stockinfoRepository) : base(BaseDal)
        {
            _stockinfoRepository = stockinfoRepository;
        }
        public IRepository<Dt_StockInfo> _stockinfoRepository;
        public IRepository<Dt_StockInfoDetail> Repository => BaseDal;
        public bool ExistBarcodes(string barcode)
@@ -20,7 +26,52 @@
        public bool ExistBarcodes(List<string> barcodes)
        {
            return BaseDal.QueryFirst(x =>!string.IsNullOrEmpty( x.Barcode) &&  barcodes.Contains(x.Barcode)) != null;
            return BaseDal.QueryFirst(x => !string.IsNullOrEmpty(x.Barcode) && barcodes.Contains(x.Barcode)) != null;
        }
        public PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options)
        {
            PageGridData<Dt_StockInfoDetail> lists =  base.GetPageData (options);
            List<int> stockIds = lists.Rows.Select(detail => detail.StockId).Distinct().ToList();
            var stocks= _stockinfoRepository.QueryData(x => stockIds.Contains(x.Id)).ToList();
            List<StockInfoDetailWithPalletDto> dtoList = lists.Rows
                .Select(detail => new StockInfoDetailWithPalletDto
                {
                    Id = detail.Id,
                    StockId = detail.StockId,
                    MaterielCode = detail.MaterielCode,
                    MaterielName = detail.MaterielName,
                    OrderNo = detail.OrderNo,
                    BatchNo = detail.BatchNo,
                    ProductionDate = detail.ProductionDate,
                    EffectiveDate = detail.EffectiveDate,
                    SerialNumber = detail.SerialNumber,
                    StockQuantity = detail.StockQuantity,
                    OutboundQuantity = detail.OutboundQuantity,
                    Status = detail.Status,
                    Unit = detail.Unit,
                    InboundOrderRowNo = detail.InboundOrderRowNo,
                    SupplyCode = detail.SupplyCode,
                    WarehouseCode = detail.WarehouseCode,
                    Barcode = detail.Barcode,
                    BusinessType = detail.BusinessType,
                    Remark = detail.Remark,
                    Creater = detail.Creater,
                    CreateDate = detail.CreateDate,
                    Modifier = detail.Modifier,
                    ModifyDate = detail.ModifyDate,
                    PalletCode= stocks
                        .FirstOrDefault(stock => stock.Id == detail.StockId)?
                        .PalletCode ?? "无托盘编号"
                })
                .ToList();
            return new PageGridData<StockInfoDetailWithPalletDto> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary  };
        }
    }
}
 }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -90,7 +90,10 @@
        [HttpPost, Route("ReceiveInboundOrder"), AllowAnonymous, MethodParamsValidate]
        public WebResponseContent ReceiveInboundOrder([FromBody] InboundRequestModel model)
        {
            if(model.inBounds == null || !model.inBounds.Any())
            {
                return WebResponseContent.Instance.Error("入库单不能为空");
            }
            List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>();
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
@@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -16,5 +18,15 @@
        public StockInfoDetailController(IStockInfoDetailService service) : base(service)
        {
        }
        [HttpPost, Route("GetPageData")]
        public override ActionResult GetPageData([FromBody] PageDataOptions options)
        {
            var result = Service.GetPageData2(options);
            return Json(result);
        }
    }
}