wxw
2025-10-15 51f7eb771322a65ee552ca9b60280632f72760e6
修改物料管理列表
7个文件已修改
313 ■■■■ 已修改文件
HTML/views/BaseSetting/Materials.html 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/InterFaceModel/HttpModel.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/SysVm/MaterialsVm.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/CustomerServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/MaterialsServer.cs 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ISysServer/IMaterialsServer.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BasisController.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/BaseSetting/Materials.html
@@ -222,6 +222,7 @@
                laypage = layui.laypage,
                layer = layui.layer;
            var $ = layui.$;
            var h1 = GetTableHeight();
            refreshTable("", "", "", "", "", "", "", "");
            var tableIns;
@@ -251,132 +252,22 @@
                    CategoryNo: CategoryNo
                };
                var url = "/Basis/GetMateList?SkuNo=" + SkuNo + "&&SkuName=" + SkuName + "&&AuditStatusNo=" + AuditStatusNo + "&&Type=" + Type + "&&IsControlled=" + IsControlled + "&&IsInspect=" + IsInspect + "&&Environment=" + Environment + "&CategoryNo=" + CategoryNo;
                sendData(IP + url, {}, 'get', function (res) {
                    if (res.code == 0) //成功
                    {
                        var list = res.data;
                        $.extend(infoOptions, {
                            data: list
                        });
                        infoOptions.page = {
                            curr: 1
                        }
                        tableIns = table.render(infoOptions);
                    }
                    else //不成功
                    {
                        layer.msg('获取物料列表信息失败!', {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
                sendData(IP + "/basis/GetRoleRightList", {}, "get", function (res) {
                    $(function () {
                        $(".approvalBtn").hide();
                    });
                    $(function () {
                        $(".approvalBtndel").hide();
                    });
                    $(function () {
                        $(".approvalBtnupt").hide();
                    });
                    if (res.code == 0) //成功
                    {
                        for (var k = 0; k < res.data.length; k++) {
                            if (res.data[k].MenuName == "添加物料") {
                                $(function () {
                                    $(".approvalBtn").show();
                                });
                            }
                            if (res.data[k].MenuName == "删除物料") {
                                $(function () {
                                    $(".approvalBtndel").show();
                                });
                            }
                            if (res.data[k].MenuName == "编辑物料") {
                                $(function () {
                                    $(".approvalBtnupt").show();
                                });
                            }
                        }
                    }
                    else //不成功
                    {
                        layer.msg(
                            "获取信息失败",
                            {
                                icon: 2,
                                time: 2000, //2秒关闭(如果不配置,默认是3秒)
                            },
                            function () {
                                //回调
                            }
                        );
                    }
                });
            }
            sendData(IP + "/basis/GetRoleRightList", {}, "get", function (res) {
                $(function () {
                    $(".approvalBtn").hide();
                });
                $(function () {
                    $(".approvalBtndel").hide();
                });
                $(function () {
                    $(".approvalBtnupt").hide();
                });
                if (res.code == 0) //成功
                {
                    for (var k = 0; k < res.data.length; k++) {
                        if (res.data[k].MenuName == "添加物料") {
                            $(function () {
                                $(".approvalBtn").show();
                            });
                        }
                        if (res.data[k].MenuName == "删除物料") {
                            $(function () {
                                $(".approvalBtndel").show();
                            });
                        }
                        if (res.data[k].MenuName == "编辑物料") {
                            $(function () {
                                $(".approvalBtnupt").show();
                            });
                        }
                    }
                }
                else //不成功
                {
                    layer.msg(
                        "获取信息失败",
                        {
                            icon: 2,
                            time: 2000, //2秒关闭(如果不配置,默认是3秒)
                        },
                        function () {
                            //回调
                        }
                    );
                }
            });
            var infoOptions = {
                elem: "#LAY-app-content-list",
                height: h1,
                id: "LAY-app-content-list",
                page: true,
                limit: pageCnt,
                limits: pageLimits,
                even: true,
                cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                cols:
                    [[
                table.render({
                    elem: '#LAY-app-content-list',
                    url: IP +"/Basis/GetMateList",
                    method: 'POST',
                    height: h1,//'full-'+hei1
                    id: 'LAY-app-content-list',
                    where: param,
                    contentType: 'application/json',
                    headers: { ToKen: $.cookie('token') },
                    page: true,
                    even: true,
                    limit: pageCnt,
                    limits: pageLimits,
                    cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
                    even: true,
                    cols: [[
                        {
                            title: '序号', type: 'numbers', fixed: 'left', width: 65
                        },
@@ -448,8 +339,65 @@
                        {
                            title: '操作', fixed: 'right', align: 'center', toolbar: '#table-content-list', width: 170
                        }
                    ]],
            };
                    ]],parseData: function(res) { // 数据解析回调
    console.log('原始返回数据:', res);
    return {
      "code": res.code, // 解析接口状态
      "msg": res.msg, // 解析提示文本
      "count": res.count, // 解析数据长度
      "data": res.data // 解析数据列表
    };
  },
                });
            }
            sendData(IP + "/basis/GetRoleRightList", {}, "get", function (res) {
                $(function () {
                    $(".approvalBtn").hide();
                });
                $(function () {
                    $(".approvalBtndel").hide();
                });
                $(function () {
                    $(".approvalBtnupt").hide();
                });
                if (res.code == 0) //成功
                {
                    for (var k = 0; k < res.data.length; k++) {
                        if (res.data[k].MenuName == "添加物料") {
                            $(function () {
                                $(".approvalBtn").show();
                            });
                        }
                        if (res.data[k].MenuName == "删除物料") {
                            $(function () {
                                $(".approvalBtndel").show();
                            });
                        }
                        if (res.data[k].MenuName == "编辑物料") {
                            $(function () {
                                $(".approvalBtnupt").show();
                            });
                        }
                    }
                }
                else //不成功
                {
                    layer.msg(
                        "获取信息失败",
                        {
                            icon: 2,
                            time: 2000, //2秒关闭(如果不配置,默认是3秒)
                        },
                        function () {
                            //回调
                        }
                    );
                }
            });
            //监听搜索
            form.on('submit(LAY-app-contlist-search)', function (data) {
Wms/Model/InterFaceModel/HttpModel.cs
@@ -685,7 +685,7 @@
            /// <summary>
            /// 编号
            /// </summary>
            public long customerNo { get; set; }
            public string customerNo { get; set; }
            /// <summary>
            /// 名称
            /// </summary>
@@ -697,7 +697,7 @@
            /// <summary>
            /// 地址
            /// </summary>
            public string streetAddress { get; set; }
            public string Address { get; set; }
            /// <summary>
            /// 联系人
            /// </summary>
Wms/Model/ModelVm/SysVm/MaterialsVm.cs
@@ -22,5 +22,21 @@
        /// 是否受控
        /// </summary>
        public string IsControlled { get; set; }
        /// <summary>
        /// 审核状态
        /// </summary>
        public string AuditStatusNo { get; set; }
        /// <summary>
        /// 是否免检
        /// </summary>
        public string IsInspect { get; set; }
        /// <summary>
        /// 存储环境
        /// </summary>
        public string Environment { get; set; }
        /// <summary>
        /// 类别编码
        /// </summary>
        public string CategoryNo { get; set; }
    }
}
Wms/WMS.BLL/SysServer/CustomerServer.cs
@@ -197,7 +197,7 @@
                    CustomerNo = model.customerNo.ToString(),
                    CustomerName = model.customerName,
                    Type = int.Parse(model.CustomerType),
                    Address = model.streetAddress,
                    Address = model.Address,
                    LinkMan = model.contact,
                    Phone = model.contactMobile,
Wms/WMS.BLL/SysServer/MaterialsServer.cs
@@ -8,10 +8,13 @@
using System.Threading.Tasks;
using AutoMapper;
using Model.InterFaceModel;
using Model.ModelDto.BllSoDto;
using Model.ModelDto.SysDto;
using Model.ModelVm.SysVm;
using SqlSugar;
using Utility;
using WMS.DAL;
using WMS.Entity.BllSoEntity;
using WMS.Entity.Context;
using WMS.Entity.SysEntity;
using WMS.IBLL.ISysServer;
@@ -19,7 +22,7 @@
namespace WMS.BLL.SysServer
{
    public class MaterialsServer : DbHelper<SysMaterialCategory>, IMaterialsServer
    public class MaterialsServer : DbHelper<SysMaterials>, IMaterialsServer
    {
        /// <summary>
        /// 依赖注入
@@ -54,25 +57,55 @@
        /// <param name="environment">存储环境</param>
        /// <param name="categoryNo">类别编码</param>
        /// <returns></returns>
        public Task<List<MaterialsDto>> GetMateList(string skuNo, string skuName, string auditStatusNo, string type, string isControlled, string isInspect, string environment, string categoryNo)
        public async Task<List<MaterialsDto>> GetMateList(GetMaterialsVm model, RefAsync<int> count)
        {
            var DA =  Db.Queryable<SysMaterials>()
                     .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id)
                     .LeftJoin<SysPackag>((a, b,c) => a.PackagNo == c.PackagNo)
                     //.LeftJoin<SysUnit> ((a,b,c,d)=>a.UnitNo == d.UnitNo)
                     .LeftJoin<SysMaterialCategory>((a,b,c,d)=>a.CategoryNo == d.CategoryNo)
                     .Where((a,b,c,d) => a.IsDel == "0" && d.IsDel == "0" )
                     .WhereIF(!string.IsNullOrEmpty(skuNo), a => a.SkuNo.Contains(skuNo))
                     .WhereIF(!string.IsNullOrEmpty(skuName), a => a.SkuName.Contains(skuName))
                     .WhereIF(!string.IsNullOrEmpty(auditStatusNo), a => a.AuditStatusNo == auditStatusNo)
                     .WhereIF(!string.IsNullOrEmpty(type), a => a.Type == type)
                     .WhereIF(!string.IsNullOrEmpty(isControlled), a => a.IsControlled == isControlled)
                     .WhereIF(!string.IsNullOrEmpty(isInspect), a => a.IsInspect == isInspect)
                     .WhereIF(!string.IsNullOrEmpty(environment), a => a.Environment == environment)
                     .WhereIF(!string.IsNullOrEmpty(categoryNo), a => a.CategoryNo == categoryNo)
                     .Select<MaterialsDto>((a, b, c,d) => new MaterialsDto() { CreateUserName = b.RealName,PackagName = c.PackagName }, true)
                     .ToListAsync();
            return DA;
            Expression<Func<SysMaterials, bool>> item = Expressionable.Create<SysMaterials>()
             .AndIF(!string.IsNullOrWhiteSpace(model.SkuNo), it => it.SkuNo.Contains(model.SkuNo.Trim()))
             .AndIF(!string.IsNullOrWhiteSpace(model.SkuName), it => it.SkuNo.Contains(model.SkuName.Trim()))
             .AndIF(!string.IsNullOrWhiteSpace(model.AuditStatusNo), it => it.AuditStatusNo == model.AuditStatusNo)
             .AndIF(!string.IsNullOrWhiteSpace(model.Type), it => it.Type == model.Type)
             .AndIF(!string.IsNullOrWhiteSpace(model.IsControlled), it => it.IsControlled == model.IsControlled)
             .AndIF(!string.IsNullOrWhiteSpace(model.IsInspect), it => it.IsInspect == model.IsInspect)
             .AndIF(!string.IsNullOrWhiteSpace(model.Environment), it => it.Environment == model.Environment)
             .AndIF(!string.IsNullOrWhiteSpace(model.CategoryNo), it => it.CategoryNo == model.CategoryNo)
             .And(it => it.IsDel == "0")
             .ToExpression();//注意 这一句 不能少
            //Db.Aop.OnLogExecuting = (sql, data) =>
            //{
            //    var nl = sql;
            //};
            var data = await GetAllWhereAsync(item)
               .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id && b.IsDel == "0")
               .LeftJoin<SysPackag>((a, b, c) => a.PackagNo == c.PackagNo && c.IsDel == "0")
               .LeftJoin<SysMaterialCategory>((a, b, c, d) => a.CategoryNo == d.CategoryNo && d.IsDel == "0")
               .Select((a, b, c, d) => new MaterialsDto()
               {
                   SkuNo = a.SkuNo,
                   SkuName = a.SkuName,
                   Standard = a.Standard,
                   Type = a.Type,
                   IsControlled = a.IsControlled,
                   IsInspect = a.IsInspect,
                   IsPasteCode = a.IsPasteCode,
                   Origin = a.Origin,
                   UnitNo = a.UnitNo,
                   PackagName = c.PackagName,
                   Environment = a.Environment,
                   CategoryNo = d.CategoryNo,
                   Weight = a.Weight,
                   Warranty = a.Warranty,
                   UnpackWarranty = a.UnpackWarranty,
                   AdventTime = a.AdventTime,
                   LowInventory = a.LowInventory,
                   Demo = a.Demo,
                   CreateUserName = b.UserName,
                   CreateTime = a.CreateTime
               })
               .Distinct()
               .OrderByDescending(a => a.CreateTime)
               .ToPageListAsync(model.Page, model.Limit, count);
            return data;
        }
        /// <summary>
Wms/WMS.IBLL/ISysServer/IMaterialsServer.cs
@@ -4,6 +4,8 @@
using System.Threading.Tasks;
using Model.InterFaceModel;
using Model.ModelDto.SysDto;
using Model.ModelVm.SysVm;
using SqlSugar;
using WMS.Entity.SysEntity;
namespace WMS.IBLL.ISysServer
@@ -24,7 +26,7 @@
        /// <param name="environment">存储环境</param>
        /// <param name="categoryNo">类别编码</param>
        /// <returns></returns>
        Task<List<MaterialsDto>> GetMateList(string skuNo, string skuName, string auditStatusNo, string type, string isControlled, string isInspect, string environment,string categoryNo);
        Task<List<MaterialsDto>> GetMateList(GetMaterialsVm model, RefAsync<int> count);
        /// <summary>
        /// 根据id查询物料信息
Wms/Wms/Controllers/BasisController.cs
@@ -23,6 +23,7 @@
using Utility;
using Model.ModelVm.LogVm;
using System.Diagnostics;
using Model.ModelVm.BllSoVm;
namespace Wms.Controllers
{
@@ -617,10 +618,15 @@
        /// <param name="environment">存储环境</param>
        /// <param name="categoryNo">类别编码</param>
        /// <returns></returns>
        [HttpGet]
        public async Task<List<MaterialsDto>> GetMateList(string skuNo, string skuName, string auditStatusNo, string type, string isControlled, string isInspect, string environment, string categoryNo)
        [HttpPost]
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<IActionResult> GetMateList(GetMaterialsVm model)
        {
            return await _mate.GetMateList(skuNo, skuName, auditStatusNo, type, isControlled, isInspect, environment, categoryNo);
            RefAsync<int> count = new RefAsync<int>();
            var bolls = await _mate.GetMateList(model, count);
            //return new SqlSugarPagedList() { Items = bolls, Total = count };
            return Ok(new { code = 0, count=count.Value, msg = "物料信息", data = bolls });
        }
        /// <summary>