0607
parent
94fbe26728
commit
1902aea72a
|
@ -5,9 +5,9 @@
|
|||
"ValidateIssuerSigningKey": true, // 是否验证密钥,bool 类型,默认true
|
||||
"IssuerSigningKey": "3c1cbc3f546eda35168c3aa3cb91780fbe703f0996c6d123ea96dc85c70bbc0a", // 密钥,string 类型,必须是复杂密钥,长度大于16
|
||||
"ValidateIssuer": true, // 是否验证签发方,bool 类型,默认true
|
||||
"ValidIssuer": "Admin.NET", // 签发方,string 类型
|
||||
"ValidIssuer": "GuanWei", // 签发方,string 类型
|
||||
"ValidateAudience": true, // 是否验证签收方,bool 类型,默认true
|
||||
"ValidAudience": "Admin.NET", // 签收方,string 类型
|
||||
"ValidAudience": "GuanWei", // 签收方,string 类型
|
||||
"ValidateLifetime": true, // 是否验证过期时间,bool 类型,默认true,建议true
|
||||
//"ExpiredTime": 20, // 过期时间,long 类型,单位分钟,默认20分钟,最大支持 13 年
|
||||
"ClockSkew": 5, // 过期时间容错值,long 类型,单位秒,默认5秒
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"SpecificationDocumentSettings": {
|
||||
"DocumentTitle": "Admin.NET 通用权限开发平台",
|
||||
"DocumentTitle": "系统接口",
|
||||
"GroupOpenApiInfos": [
|
||||
{
|
||||
"Group": "Default",
|
||||
"Title": "Admin.NET 通用权限开发平台",
|
||||
"Title": "系统接口",
|
||||
"Description": "让 .NET 开发更简单、更通用、更流行。",
|
||||
"Version": "1.0.0"
|
||||
//"TermsOfService": "https://dotnetchina.gitee.io/furion/",
|
||||
|
|
|
@ -16,6 +16,6 @@
|
|||
"SecretKey": "n0YxRADS7Bnb4th9zplVuDiQIdPFQ5gDtQHzLyXI",
|
||||
"IsEnableHttps": false, // 是否启用HTTPS
|
||||
"IsEnableCache": true, // 是否启用缓存
|
||||
"Bucket": "admin.net"
|
||||
"Bucket": "GuanWei"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
using Admin.NET.Core;
|
||||
namespace Admin.NET.Application.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 员工
|
||||
/// </summary>
|
||||
[SugarTable("employee","员工")]
|
||||
public class Employee : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Name", ColumnDescription = "名字", Length = 32)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Job", ColumnDescription = "职务", Length = 32)]
|
||||
public string? Job { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Sex", ColumnDescription = "性别", Length = 32)]
|
||||
public string? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Tel", ColumnDescription = "联系方式", Length = 32)]
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Email", ColumnDescription = "邮箱", Length = 32)]
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 64)]
|
||||
public string? Address { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Age", ColumnDescription = "年龄")]
|
||||
public int? Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IDNumber", ColumnDescription = "身份证号", Length = 32)]
|
||||
public string? IDNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "DepartmentId", ColumnDescription = "部门ID")]
|
||||
public long? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "DateOnBoard", ColumnDescription = "入职日期")]
|
||||
public DateTime? DateOnBoard { get; set; }
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
using Admin.NET.Core;
|
||||
namespace Admin.NET.Application.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 班组
|
||||
/// </summary>
|
||||
[SugarTable("TeamOfGroup","班组")]
|
||||
public class TeamOfGroup : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Leader", ColumnDescription = "负责人", Length = 32)]
|
||||
public string? Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Tel", ColumnDescription = "电话", Length = 32)]
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 32)]
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
|
@ -155,7 +155,7 @@ public class WarehouseDetails : EntityTenant
|
|||
/// 仓库ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "仓库ID", Length = 32)]
|
||||
public string? WarehouseId { get; set; }
|
||||
public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展字段
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理输出参数
|
||||
/// </summary>
|
||||
public class EmployeeDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
public string? Job { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public string? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
public int? Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public string? IDNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
public long? DepartmentId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public DateTime? DateOnBoard { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public bool IsDelete { get; set; }
|
||||
|
||||
}
|
|
@ -0,0 +1,218 @@
|
|||
using Admin.NET.Core;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理基础输入参数
|
||||
/// </summary>
|
||||
public class EmployeeBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public virtual string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
public virtual string? Job { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public virtual string? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
public virtual string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
public virtual string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public virtual string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public virtual string? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
public virtual int? Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public virtual string? IDNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
public virtual long? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public DateTime? DateOnBoard { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public virtual DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public virtual DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public virtual long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public virtual string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public virtual long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public virtual string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public virtual bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理分页查询输入参数
|
||||
/// </summary>
|
||||
public class EmployeeInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
public string? Job { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public string? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
public int? Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public string? IDNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
public long? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public DateTime? DateOnBoard { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理增加输入参数
|
||||
/// </summary>
|
||||
public class AddEmployeeInput : EmployeeBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "软删除不能为空")]
|
||||
public override bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理删除输入参数
|
||||
/// </summary>
|
||||
public class DeleteEmployeeInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理更新输入参数
|
||||
/// </summary>
|
||||
public class UpdateEmployeeInput : EmployeeBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理主键查询输入参数
|
||||
/// </summary>
|
||||
public class QueryByIdEmployeeInput : DeleteEmployeeInput
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 员工管理输出参数
|
||||
/// </summary>
|
||||
public class EmployeeOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
public string? Job { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public string? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public string? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
public int? Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
public string? IDNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
public long? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
public DateTime? DateOnBoard { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
using Admin.NET.Core.Service;
|
||||
using Admin.NET.Application.Const;
|
||||
using Admin.NET.Application.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
namespace Admin.NET.Application;
|
||||
/// <summary>
|
||||
/// 员工管理服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 100)]
|
||||
public class EmployeeService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<Employee> _rep;
|
||||
public EmployeeService(SqlSugarRepository<Employee> rep)
|
||||
{
|
||||
_rep = rep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询员工管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Page")]
|
||||
public async Task<SqlSugarPagedList<EmployeeOutput>> Page(EmployeeInput input)
|
||||
{
|
||||
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||
u.Name.Contains(input.SearchKey.Trim())
|
||||
|| u.Job.Contains(input.SearchKey.Trim())
|
||||
|| u.Sex.Contains(input.SearchKey.Trim())
|
||||
|| u.Tel.Contains(input.SearchKey.Trim())
|
||||
|| u.Email.Contains(input.SearchKey.Trim())
|
||||
|| u.Address.Contains(input.SearchKey.Trim())
|
||||
|| u.IDNumber.Contains(input.SearchKey.Trim())
|
||||
|| u.Remarks.Contains(input.SearchKey.Trim())
|
||||
)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Job), u => u.Job.Contains(input.Job.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Sex), u => u.Sex.Contains(input.Sex.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Email), u => u.Email.Contains(input.Email.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Address), u => u.Address.Contains(input.Address.Trim()))
|
||||
.WhereIF(input.Age>0, u => u.Age == input.Age)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.IDNumber), u => u.IDNumber.Contains(input.IDNumber.Trim()))
|
||||
.WhereIF(input.DepartmentId>0, u => u.DepartmentId == input.DepartmentId)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
|
||||
.Select<EmployeeOutput>();
|
||||
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加员工管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Add")]
|
||||
public async Task<long> Add(AddEmployeeInput input)
|
||||
{
|
||||
var entity = input.Adapt<Employee>();
|
||||
await _rep.InsertAsync(entity);
|
||||
return entity.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除员工管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Delete")]
|
||||
public async Task Delete(DeleteEmployeeInput input)
|
||||
{
|
||||
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||
await _rep.FakeDeleteAsync(entity); //假删除
|
||||
//await _rep.DeleteAsync(entity); //真删除
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新员工管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Update")]
|
||||
public async Task Update(UpdateEmployeeInput input)
|
||||
{
|
||||
var entity = input.Adapt<Employee>();
|
||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取员工管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "Detail")]
|
||||
public async Task<Employee> Detail([FromQuery] QueryByIdEmployeeInput input)
|
||||
{
|
||||
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取员工管理列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "List")]
|
||||
public async Task<List<EmployeeOutput>> List()
|
||||
{
|
||||
return await _rep.AsQueryable().Select<EmployeeOutput>().Where(a => !a.IsDelete).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -127,7 +127,6 @@ public class InvoiceService : IDynamicApiController, ITransient
|
|||
/// <summary>
|
||||
/// 获取发货通知单列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "List")]
|
||||
|
|
|
@ -9,12 +9,21 @@ namespace Admin.NET.Application;
|
|||
/// </summary>
|
||||
public class AddProductCodeInput
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 入库单ID
|
||||
/// </summary>
|
||||
public long? WarehousingTableId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
//public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库类型
|
||||
/// </summary>
|
||||
//public string? WarehousingType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码数据
|
||||
/// </summary>
|
||||
|
|
|
@ -14,33 +14,29 @@ namespace Admin.NET.Application;
|
|||
public class ProductWarehousingService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<ProductWarehousing> _rep;
|
||||
private readonly WarehouseDetailsService _warehouseDetails;
|
||||
private readonly MaterialsService _materialsService;
|
||||
private readonly SysUnitService _sysUnitService;
|
||||
private readonly MaterialClassifyService _materialClassifyService;
|
||||
private readonly WarehousingStatisticsService _warehousingStatisticsService;
|
||||
private readonly PrintCodeDetailService _codeDetailService;
|
||||
private readonly ProductRetrospectService _productRetrospect;
|
||||
//private readonly WarehouseDetailsService _warehouseDetails;
|
||||
//private readonly WarehousingStatisticsService _warehousingStatisticsService;
|
||||
//private readonly PrintCodeDetailService _codeDetailService;
|
||||
//private readonly ProductRetrospectService _productRetrospect;
|
||||
private readonly UserManager _userManager;
|
||||
public ProductWarehousingService(SqlSugarRepository<ProductWarehousing> rep,
|
||||
UserManager userManager,
|
||||
WarehouseDetailsService warehouseDetails,
|
||||
MaterialsService materialsService,
|
||||
SysUnitService sysUnitService,
|
||||
PrintCodeDetailService codeDetailService,
|
||||
ProductRetrospectService productRetrospect,
|
||||
MaterialClassifyService materialClassifyService,
|
||||
WarehousingStatisticsService warehousingStatisticsService)
|
||||
MaterialClassifyService materialClassifyService)
|
||||
{
|
||||
_rep = rep;
|
||||
_userManager = userManager;
|
||||
_warehouseDetails = warehouseDetails;
|
||||
_materialsService = materialsService;
|
||||
_sysUnitService = sysUnitService;
|
||||
_codeDetailService = codeDetailService;
|
||||
_productRetrospect = productRetrospect;
|
||||
_materialClassifyService = materialClassifyService;
|
||||
_warehousingStatisticsService = warehousingStatisticsService;
|
||||
//_codeDetailService = codeDetailService;
|
||||
//_warehouseDetails = warehouseDetails;
|
||||
//_productRetrospect = productRetrospect;
|
||||
//_warehousingStatisticsService = warehousingStatisticsService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -77,57 +73,57 @@ public class ProductWarehousingService : IDynamicApiController, ITransient
|
|||
)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.GoodCode), u => u.GoodCode.Contains(input.GoodCode.Trim()))
|
||||
.WhereIF(input.MaterialsId>0, u => u.MaterialsId == input.MaterialsId)
|
||||
.WhereIF(input.MaterialsId > 0, u => u.MaterialsId == input.MaterialsId)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.MaterialsNum), u => u.MaterialsNum.Contains(input.MaterialsNum.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Specifications), u => u.Specifications.Contains(input.Specifications.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Classify), u => u.Classify.Contains(input.Classify.Trim()))
|
||||
.WhereIF(input.Count>0, u => u.Count == input.Count)
|
||||
.WhereIF(input.Count > 0, u => u.Count == input.Count)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Unit), u => u.Unit.Contains(input.Unit.Trim()))
|
||||
.WhereIF(input.BaseCount>0, u => u.BaseCount == input.BaseCount)
|
||||
.WhereIF(input.BaseCount > 0, u => u.BaseCount == input.BaseCount)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.BaseUnit), u => u.BaseUnit.Contains(input.BaseUnit.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.PackageScale), u => u.PackageScale.Contains(input.PackageScale.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Batch), u => u.Batch.Contains(input.Batch.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Custom), u => u.Custom.Contains(input.Custom.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Brand), u => u.Brand.Contains(input.Brand.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeType), u => u.CodeType.Contains(input.CodeType.Trim()))
|
||||
.WhereIF(input.CodeCount>0, u => u.CodeCount == input.CodeCount)
|
||||
.WhereIF(input.CodeCount > 0, u => u.CodeCount == input.CodeCount)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.WarehouseLocation), u => u.WarehouseLocation.Contains(input.WarehouseLocation.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
|
||||
.WhereIF(input.SourceId>0, u => u.SourceId == input.SourceId)
|
||||
.WhereIF(input.WarehouseId>0, u => u.WarehouseId == input.WarehouseId)
|
||||
.WhereIF(input.SourceId > 0, u => u.SourceId == input.SourceId)
|
||||
.WhereIF(input.WarehouseId > 0, u => u.WarehouseId == input.WarehouseId)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.ExpandField), u => u.ExpandField.Contains(input.ExpandField.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.WarehousingType), u => u.WarehousingType.Contains(input.WarehousingType.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeNum), u => u.CodeNum.Contains(input.CodeNum.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Supplier), u => u.Supplier.Contains(input.Supplier.Trim()))
|
||||
.WhereIF(input.Status>0, u => u.Status == input.Status)
|
||||
.WhereIF(input.Status > 0, u => u.Status == input.Status)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.OddNumber), u => u.OddNumber.Contains(input.OddNumber.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.ProductionLine), u => u.ProductionLine.Contains(input.ProductionLine.Trim()))
|
||||
.Select<ProductWarehousingOutput>();
|
||||
if(input.ProductDateRange != null && input.ProductDateRange.Count >0)
|
||||
if (input.ProductDateRange != null && input.ProductDateRange.Count > 0)
|
||||
{
|
||||
DateTime? start= input.ProductDateRange[0];
|
||||
DateTime? start = input.ProductDateRange[0];
|
||||
query = query.WhereIF(start.HasValue, u => u.ProductDate > start);
|
||||
if (input.ProductDateRange.Count >1 && input.ProductDateRange[1].HasValue)
|
||||
if (input.ProductDateRange.Count > 1 && input.ProductDateRange[1].HasValue)
|
||||
{
|
||||
var end = input.ProductDateRange[1].Value.AddDays(1);
|
||||
query = query.Where(u => u.ProductDate < end);
|
||||
}
|
||||
}
|
||||
if(input.LoseDateRange != null && input.LoseDateRange.Count >0)
|
||||
if (input.LoseDateRange != null && input.LoseDateRange.Count > 0)
|
||||
{
|
||||
DateTime? start= input.LoseDateRange[0];
|
||||
DateTime? start = input.LoseDateRange[0];
|
||||
query = query.WhereIF(start.HasValue, u => u.LoseDate > start);
|
||||
if (input.LoseDateRange.Count >1 && input.LoseDateRange[1].HasValue)
|
||||
if (input.LoseDateRange.Count > 1 && input.LoseDateRange[1].HasValue)
|
||||
{
|
||||
var end = input.LoseDateRange[1].Value.AddDays(1);
|
||||
query = query.Where(u => u.LoseDate < end);
|
||||
}
|
||||
}
|
||||
if(input.WarehousingDateRange != null && input.WarehousingDateRange.Count >0)
|
||||
if (input.WarehousingDateRange != null && input.WarehousingDateRange.Count > 0)
|
||||
{
|
||||
DateTime? start= input.WarehousingDateRange[0];
|
||||
DateTime? start = input.WarehousingDateRange[0];
|
||||
query = query.WhereIF(start.HasValue, u => u.WarehousingDate > start);
|
||||
if (input.WarehousingDateRange.Count >1 && input.WarehousingDateRange[1].HasValue)
|
||||
if (input.WarehousingDateRange.Count > 1 && input.WarehousingDateRange[1].HasValue)
|
||||
{
|
||||
var end = input.WarehousingDateRange[1].Value.AddDays(1);
|
||||
query = query.Where(u => u.WarehousingDate < end);
|
||||
|
@ -141,218 +137,218 @@ public class ProductWarehousingService : IDynamicApiController, ITransient
|
|||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "ProductWarehousing")]
|
||||
public async Task ProductWarehousing(AddProductCodeInput input)
|
||||
{
|
||||
if (input == null || input.WarehousingTableId == null || input.CodeDatas == null || input.CodeDatas.Count == 0)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var warehousing = await Detail(new QueryByIdProductWarehousingInput() { Id = input.WarehousingTableId.Value });
|
||||
if (warehousing == null)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var materials = await _materialsService.GetById(warehousing.MaterialsId);
|
||||
if (materials == null)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
|
||||
var baseUnit = units.LastOrDefault().Name;
|
||||
var userId = _userManager.UserId;
|
||||
var userName = _userManager.RealName;
|
||||
var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode));
|
||||
Dictionary<AddPrintCodeDetailInput,long> list = new Dictionary<AddPrintCodeDetailInput, long>();
|
||||
foreach (var item in topDatas)
|
||||
{
|
||||
var code = string.IsNullOrEmpty(item.BarCode) ? item.QrCode : item.BarCode;
|
||||
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||
var unit = units.Find(a => a.Name == item.PackageName);
|
||||
//[HttpPost]
|
||||
//[ApiDescriptionSettings(Name = "ProductWarehousing")]
|
||||
//public async Task ProductWarehousing(AddProductCodeInput input)
|
||||
//{
|
||||
// if (input == null || input.WarehousingTableId == null || input.CodeDatas == null || input.CodeDatas.Count == 0)
|
||||
// {
|
||||
// throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
// }
|
||||
// var warehousing = await Detail(new QueryByIdProductWarehousingInput() { Id = input.WarehousingTableId.Value });
|
||||
// if (warehousing == null)
|
||||
// {
|
||||
// throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
// }
|
||||
// var materials = await _materialsService.GetById(warehousing.MaterialsId);
|
||||
// if (materials == null)
|
||||
// {
|
||||
// throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
// }
|
||||
// var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
|
||||
// var baseUnit = units.LastOrDefault().Name;
|
||||
// var userId = _userManager.UserId;
|
||||
// var userName = _userManager.RealName;
|
||||
// var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode));
|
||||
// Dictionary<AddPrintCodeDetailInput,long> list = new Dictionary<AddPrintCodeDetailInput, long>();
|
||||
// foreach (var item in topDatas)
|
||||
// {
|
||||
// var code = string.IsNullOrEmpty(item.BarCode) ? item.QrCode : item.BarCode;
|
||||
// var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||
// var unit = units.Find(a => a.Name == item.PackageName);
|
||||
|
||||
var detail = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = item.PackageName,
|
||||
BaseCount = unit.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName
|
||||
};
|
||||
var detailId = await _codeDetailService.Add(detail);
|
||||
list.Add(detail, detailId);
|
||||
// var detail = new AddPrintCodeDetailInput()
|
||||
// {
|
||||
// ReportTableId = input.WarehousingTableId,
|
||||
// Code = code,
|
||||
// CodeName = codeType,
|
||||
// ChildCount = unit.ChildUnitCount,
|
||||
// Count = 1,
|
||||
// Unit = item.PackageName,
|
||||
// BaseCount = unit.Rate,
|
||||
// BaseUnit = baseUnit,
|
||||
// PrintCodeTime = DateTime.Now,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName
|
||||
// };
|
||||
// var detailId = await _codeDetailService.Add(detail);
|
||||
// list.Add(detail, detailId);
|
||||
|
||||
var childs = input.CodeDatas.FindAll(a => a.FatherCode == code);
|
||||
foreach (var child in childs)
|
||||
{
|
||||
var code2 = string.IsNullOrEmpty(child.BarCode) ? child.QrCode : child.BarCode;
|
||||
var unit2 = units.Find(a => a.Name == child.PackageName);
|
||||
var detail2 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code2,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit2.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child.PackageName,
|
||||
BaseCount = unit2.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code,
|
||||
FatherId = detailId
|
||||
};
|
||||
var detailId2 = await _codeDetailService.Add(detail2);
|
||||
list.Add(detail2, detailId2);
|
||||
// var childs = input.CodeDatas.FindAll(a => a.FatherCode == code);
|
||||
// foreach (var child in childs)
|
||||
// {
|
||||
// var code2 = string.IsNullOrEmpty(child.BarCode) ? child.QrCode : child.BarCode;
|
||||
// var unit2 = units.Find(a => a.Name == child.PackageName);
|
||||
// var detail2 = new AddPrintCodeDetailInput()
|
||||
// {
|
||||
// ReportTableId = input.WarehousingTableId,
|
||||
// Code = code2,
|
||||
// CodeName = codeType,
|
||||
// ChildCount = unit2.ChildUnitCount,
|
||||
// Count = 1,
|
||||
// Unit = child.PackageName,
|
||||
// BaseCount = unit2.Rate,
|
||||
// BaseUnit = baseUnit,
|
||||
// PrintCodeTime = DateTime.Now,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName,
|
||||
// FatherCode = code,
|
||||
// FatherId = detailId
|
||||
// };
|
||||
// var detailId2 = await _codeDetailService.Add(detail2);
|
||||
// list.Add(detail2, detailId2);
|
||||
|
||||
var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2);
|
||||
foreach (var child3 in childs)
|
||||
{
|
||||
var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode;
|
||||
var unit3 = units.Find(a => a.Name == child3.PackageName);
|
||||
var detail3 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code3,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit3.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child3.PackageName,
|
||||
BaseCount = unit3.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code2,
|
||||
FatherId = detailId2
|
||||
};
|
||||
var detailId3 = await _codeDetailService.Add(detail3);
|
||||
list.Add(detail3, detailId3);
|
||||
if (input.CodeDatas.Any(a => a.FatherCode == code3))
|
||||
{
|
||||
var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3);
|
||||
foreach (var child4 in childs)
|
||||
{
|
||||
var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode;
|
||||
var unit4 = units.Find(a => a.Name == child4.PackageName);
|
||||
var detail4 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code4,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit4.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child4.PackageName,
|
||||
BaseCount = unit4.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code3,
|
||||
FatherId = detailId3
|
||||
};
|
||||
var detailId4 = await _codeDetailService.Add(detail4);
|
||||
list.Add(detail4, detailId4);
|
||||
if (input.CodeDatas.Any(a => a.FatherCode == code4))
|
||||
{
|
||||
var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4);
|
||||
foreach (var child5 in childs)
|
||||
{
|
||||
var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode;
|
||||
var unit5 = units.Find(a => a.Name == child5.PackageName);
|
||||
var detail5 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code5,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit5.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child5.PackageName,
|
||||
BaseCount = unit5.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code4,
|
||||
FatherId = detailId4
|
||||
};
|
||||
var detailId5 = await _codeDetailService.Add(detail5);
|
||||
list.Add(detail5, detailId5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2);
|
||||
// foreach (var child3 in childs)
|
||||
// {
|
||||
// var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode;
|
||||
// var unit3 = units.Find(a => a.Name == child3.PackageName);
|
||||
// var detail3 = new AddPrintCodeDetailInput()
|
||||
// {
|
||||
// ReportTableId = input.WarehousingTableId,
|
||||
// Code = code3,
|
||||
// CodeName = codeType,
|
||||
// ChildCount = unit3.ChildUnitCount,
|
||||
// Count = 1,
|
||||
// Unit = child3.PackageName,
|
||||
// BaseCount = unit3.Rate,
|
||||
// BaseUnit = baseUnit,
|
||||
// PrintCodeTime = DateTime.Now,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName,
|
||||
// FatherCode = code2,
|
||||
// FatherId = detailId2
|
||||
// };
|
||||
// var detailId3 = await _codeDetailService.Add(detail3);
|
||||
// list.Add(detail3, detailId3);
|
||||
// if (input.CodeDatas.Any(a => a.FatherCode == code3))
|
||||
// {
|
||||
// var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3);
|
||||
// foreach (var child4 in childs)
|
||||
// {
|
||||
// var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode;
|
||||
// var unit4 = units.Find(a => a.Name == child4.PackageName);
|
||||
// var detail4 = new AddPrintCodeDetailInput()
|
||||
// {
|
||||
// ReportTableId = input.WarehousingTableId,
|
||||
// Code = code4,
|
||||
// CodeName = codeType,
|
||||
// ChildCount = unit4.ChildUnitCount,
|
||||
// Count = 1,
|
||||
// Unit = child4.PackageName,
|
||||
// BaseCount = unit4.Rate,
|
||||
// BaseUnit = baseUnit,
|
||||
// PrintCodeTime = DateTime.Now,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName,
|
||||
// FatherCode = code3,
|
||||
// FatherId = detailId3
|
||||
// };
|
||||
// var detailId4 = await _codeDetailService.Add(detail4);
|
||||
// list.Add(detail4, detailId4);
|
||||
// if (input.CodeDatas.Any(a => a.FatherCode == code4))
|
||||
// {
|
||||
// var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4);
|
||||
// foreach (var child5 in childs)
|
||||
// {
|
||||
// var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode;
|
||||
// var unit5 = units.Find(a => a.Name == child5.PackageName);
|
||||
// var detail5 = new AddPrintCodeDetailInput()
|
||||
// {
|
||||
// ReportTableId = input.WarehousingTableId,
|
||||
// Code = code5,
|
||||
// CodeName = codeType,
|
||||
// ChildCount = unit5.ChildUnitCount,
|
||||
// Count = 1,
|
||||
// Unit = child5.PackageName,
|
||||
// BaseCount = unit5.Rate,
|
||||
// BaseUnit = baseUnit,
|
||||
// PrintCodeTime = DateTime.Now,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName,
|
||||
// FatherCode = code4,
|
||||
// FatherId = detailId4
|
||||
// };
|
||||
// var detailId5 = await _codeDetailService.Add(detail5);
|
||||
// list.Add(detail5, detailId5);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
foreach (var dic in list)
|
||||
{
|
||||
var item = dic.Key;
|
||||
var retrospect1 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = item.BaseCount,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = warehousing.Batch,
|
||||
BusinessType = "扫码入库",
|
||||
CodeType = item.CodeName,
|
||||
Department = warehousing.ProductionLine,
|
||||
Destination = warehousing.Supplier,
|
||||
WarehouseID = warehousing.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
Location = warehousing.WarehouseLocation,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = dic.Value,
|
||||
OddNumber = warehousing.OddNumber,
|
||||
Receipt = "入库单",
|
||||
SourceId = warehousing.Id,
|
||||
Unit = item.Unit,
|
||||
Name = materials.Name,
|
||||
Code = item.Code
|
||||
};
|
||||
await _productRetrospect.Add(retrospect1);
|
||||
}
|
||||
// foreach (var dic in list)
|
||||
// {
|
||||
// var item = dic.Key;
|
||||
// var retrospect1 = new AddProductRetrospectInput()
|
||||
// {
|
||||
// BaseCount = item.BaseCount,
|
||||
// BaseUnit = baseUnit,
|
||||
// Batch = warehousing.Batch,
|
||||
// BusinessType = "扫码入库",
|
||||
// CodeType = item.CodeName,
|
||||
// Department = warehousing.ProductionLine,
|
||||
// Destination = warehousing.Supplier,
|
||||
// WarehouseID = warehousing.WarehouseId,
|
||||
// WarehousingDate = DateTime.Now,
|
||||
// Count = 1,
|
||||
// CreateTime = DateTime.Now,
|
||||
// ScanCodeTime = DateTime.Now,
|
||||
// Location = warehousing.WarehouseLocation,
|
||||
// CreateUserId = userId,
|
||||
// CreateUserName = userName,
|
||||
// MaterialsId = dic.Value,
|
||||
// OddNumber = warehousing.OddNumber,
|
||||
// Receipt = "入库单",
|
||||
// SourceId = warehousing.Id,
|
||||
// Unit = item.Unit,
|
||||
// Name = materials.Name,
|
||||
// Code = item.Code
|
||||
// };
|
||||
// await _productRetrospect.Add(retrospect1);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
var details = await _warehouseDetails.List();
|
||||
if (details != null && details.Any(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit))
|
||||
{
|
||||
var unit = units.Find(a => a.Name == warehousing.Unit);
|
||||
var detail = details.Find(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit);
|
||||
detail.Count += warehousing.Count;
|
||||
if (unit != null)
|
||||
{
|
||||
detail.BaseCount = detail.Count * unit.Rate;
|
||||
}
|
||||
await _warehouseDetails.UpdateByEntity(detail.Adapt<WarehouseDetails>());
|
||||
}
|
||||
else
|
||||
{
|
||||
var newEnt = warehousing.Adapt<AddWarehouseDetailsInput>();
|
||||
newEnt.SourceId = warehousing.Id;
|
||||
var addId = await _warehouseDetails.Add(newEnt);
|
||||
}
|
||||
// var details = await _warehouseDetails.List();
|
||||
// if (details != null && details.Any(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit))
|
||||
// {
|
||||
// var unit = units.Find(a => a.Name == warehousing.Unit);
|
||||
// var detail = details.Find(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit);
|
||||
// detail.Count += warehousing.Count;
|
||||
// if (unit != null)
|
||||
// {
|
||||
// detail.BaseCount = detail.Count * unit.Rate;
|
||||
// }
|
||||
// await _warehouseDetails.UpdateByEntity(detail.Adapt<WarehouseDetails>());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var newEnt = warehousing.Adapt<AddWarehouseDetailsInput>();
|
||||
// newEnt.SourceId = warehousing.Id;
|
||||
// var addId = await _warehouseDetails.Add(newEnt);
|
||||
// }
|
||||
|
||||
var newDetail = warehousing.Adapt<AddWarehousingStatisticsInput>();
|
||||
newDetail.SourceId = warehousing.Id;
|
||||
await _warehousingStatisticsService.Add(newDetail);
|
||||
// var newDetail = warehousing.Adapt<AddWarehousingStatisticsInput>();
|
||||
// newDetail.SourceId = warehousing.Id;
|
||||
// await _warehousingStatisticsService.Add(newDetail);
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
@ -453,11 +449,10 @@ public class ProductWarehousingService : IDynamicApiController, ITransient
|
|||
/// <summary>
|
||||
/// 获取产品入库列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "List")]
|
||||
public async Task<List<ProductWarehousingOutput>> List([FromQuery] ProductWarehousingInput input)
|
||||
public async Task<List<ProductWarehousingOutput>> List()
|
||||
{
|
||||
return await _rep.AsQueryable().Select<ProductWarehousingOutput>().ToListAsync();
|
||||
}
|
||||
|
|
|
@ -10,11 +10,32 @@ namespace Admin.NET.Application;
|
|||
public class ReportDetailTableService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<ReportDetailTable> _rep;
|
||||
//private readonly WarehouseDetailsService _warehouseDetails;
|
||||
private readonly MaterialsService _materialsService;
|
||||
private readonly SysUnitService _sysUnitService;
|
||||
//private readonly MaterialClassifyService _materialClassifyService;
|
||||
//private readonly WarehousingStatisticsService _warehousingStatisticsService;
|
||||
private readonly PrintCodeDetailService _codeDetailService;
|
||||
public ReportDetailTableService(SqlSugarRepository<ReportDetailTable> rep, PrintCodeDetailService codeDetailService)
|
||||
private readonly ProductRetrospectService _productRetrospect;
|
||||
//private readonly ProductWarehousingService _productWarehousing;
|
||||
private readonly UserManager _userManager;
|
||||
public ReportDetailTableService(SqlSugarRepository<ReportDetailTable> rep,
|
||||
UserManager userManager,
|
||||
MaterialsService materialsService,
|
||||
SysUnitService sysUnitService,
|
||||
PrintCodeDetailService codeDetailService,
|
||||
ProductRetrospectService productRetrospect)
|
||||
{
|
||||
_rep = rep;
|
||||
_userManager = userManager;
|
||||
_materialsService = materialsService;
|
||||
_sysUnitService = sysUnitService;
|
||||
_codeDetailService = codeDetailService;
|
||||
_productRetrospect = productRetrospect;
|
||||
//_warehouseDetails = warehouseDetails;
|
||||
//_materialClassifyService = materialClassifyService;
|
||||
//_warehousingStatisticsService = warehousingStatisticsService;
|
||||
//_productWarehousing = productWarehousing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -102,27 +123,243 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
|
|||
[ApiDescriptionSettings(Name = "Add")]
|
||||
public async Task<long> Add(AddReportDetailTableInput input)
|
||||
{
|
||||
var details = await _codeDetailService.List();
|
||||
if (details == null || details.Count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
|
||||
if (printDetails.Count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var entity = input.Adapt<ReportDetailTable>();
|
||||
await _rep.InsertAsync(entity);
|
||||
for (int i = 0; i < printDetails.Count; i++)
|
||||
if (input.UpdateUserId > 0)
|
||||
{
|
||||
var item = printDetails[i];
|
||||
item.ReportTableId = entity.Id;
|
||||
var ent = item.Adapt<PrintCodeDetail>();
|
||||
await _codeDetailService.UpdateByEntity(ent);
|
||||
var details = await _codeDetailService.List();
|
||||
if (details == null || details.Count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
|
||||
if (printDetails.Count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < printDetails.Count; i++)
|
||||
{
|
||||
var item = printDetails[i];
|
||||
item.ReportTableId = entity.Id;
|
||||
var ent = item.Adapt<PrintCodeDetail>();
|
||||
await _codeDetailService.UpdateByEntity(ent);
|
||||
}
|
||||
}
|
||||
return entity.Id;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生产任务单关联
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "ProductionTask")]
|
||||
public async Task ProductionTask(AddProductCodeInput input)
|
||||
{
|
||||
if (input == null || input.WarehousingTableId == null || input.CodeDatas == null || input.CodeDatas.Count == 0)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var warehousing = await Detail(new QueryByIdReportDetailTableInput() { Id = input.WarehousingTableId.Value });
|
||||
if (warehousing == null)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var materials = await _materialsService.GetById(warehousing.MaterialsId);
|
||||
if (materials == null)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
|
||||
var baseUnit = units.LastOrDefault().Name;
|
||||
var userId = _userManager.UserId;
|
||||
var userName = _userManager.RealName;
|
||||
var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode));
|
||||
Dictionary<AddPrintCodeDetailInput, long> list = new Dictionary<AddPrintCodeDetailInput, long>();
|
||||
foreach (var item in topDatas)
|
||||
{
|
||||
var code = string.IsNullOrEmpty(item.BarCode) ? item.QrCode : item.BarCode;
|
||||
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
|
||||
var unit = units.Find(a => a.Name == item.PackageName);
|
||||
|
||||
var detail = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = item.PackageName,
|
||||
BaseCount = unit.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName
|
||||
};
|
||||
var detailId = await _codeDetailService.Add(detail);
|
||||
list.Add(detail, detailId);
|
||||
|
||||
var childs = input.CodeDatas.FindAll(a => a.FatherCode == code);
|
||||
foreach (var child in childs)
|
||||
{
|
||||
var code2 = string.IsNullOrEmpty(child.BarCode) ? child.QrCode : child.BarCode;
|
||||
var unit2 = units.Find(a => a.Name == child.PackageName);
|
||||
var detail2 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code2,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit2.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child.PackageName,
|
||||
BaseCount = unit2.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code,
|
||||
FatherId = detailId
|
||||
};
|
||||
var detailId2 = await _codeDetailService.Add(detail2);
|
||||
list.Add(detail2, detailId2);
|
||||
|
||||
var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2);
|
||||
foreach (var child3 in childs)
|
||||
{
|
||||
var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode;
|
||||
var unit3 = units.Find(a => a.Name == child3.PackageName);
|
||||
var detail3 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code3,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit3.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child3.PackageName,
|
||||
BaseCount = unit3.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code2,
|
||||
FatherId = detailId2
|
||||
};
|
||||
var detailId3 = await _codeDetailService.Add(detail3);
|
||||
list.Add(detail3, detailId3);
|
||||
if (input.CodeDatas.Any(a => a.FatherCode == code3))
|
||||
{
|
||||
var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3);
|
||||
foreach (var child4 in childs)
|
||||
{
|
||||
var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode;
|
||||
var unit4 = units.Find(a => a.Name == child4.PackageName);
|
||||
var detail4 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code4,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit4.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child4.PackageName,
|
||||
BaseCount = unit4.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code3,
|
||||
FatherId = detailId3
|
||||
};
|
||||
var detailId4 = await _codeDetailService.Add(detail4);
|
||||
list.Add(detail4, detailId4);
|
||||
if (input.CodeDatas.Any(a => a.FatherCode == code4))
|
||||
{
|
||||
var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4);
|
||||
foreach (var child5 in childs)
|
||||
{
|
||||
var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode;
|
||||
var unit5 = units.Find(a => a.Name == child5.PackageName);
|
||||
var detail5 = new AddPrintCodeDetailInput()
|
||||
{
|
||||
ReportTableId = input.WarehousingTableId,
|
||||
Code = code5,
|
||||
CodeName = codeType,
|
||||
ChildCount = unit5.ChildUnitCount,
|
||||
Count = 1,
|
||||
Unit = child5.PackageName,
|
||||
BaseCount = unit5.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
PrintCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
FatherCode = code4,
|
||||
FatherId = detailId4
|
||||
};
|
||||
var detailId5 = await _codeDetailService.Add(detail5);
|
||||
list.Add(detail5, detailId5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entity.Id;
|
||||
foreach (var dic in list)
|
||||
{
|
||||
var item = dic.Key;
|
||||
var retrospect1 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = item.BaseCount,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = warehousing.Batch,
|
||||
BusinessType = "生产任务单",
|
||||
CodeType = item.CodeName,
|
||||
Department = warehousing.ProductionLine,
|
||||
//WarehouseID = input.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = dic.Value,
|
||||
OddNumber = warehousing.OddNumber,
|
||||
Receipt = "汇报单",
|
||||
SourceId = warehousing.Id,
|
||||
Unit = item.Unit,
|
||||
Name = materials.Name,
|
||||
Code = item.Code
|
||||
};//Destination = warehousing.Supplier,
|
||||
await _productRetrospect.Add(retrospect1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//var details = await _warehouseDetails.List();
|
||||
//if (details != null && details.Any(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit))
|
||||
//{
|
||||
// var unit = units.Find(a => a.Name == warehousing.Unit);
|
||||
// var detail = details.Find(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit);
|
||||
// detail.Count += warehousing.Count;
|
||||
// if (unit != null)
|
||||
// {
|
||||
// detail.BaseCount = detail.Count * unit.Rate;
|
||||
// }
|
||||
// await _warehouseDetails.UpdateByEntity(detail.Adapt<WarehouseDetails>());
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// var newEnt = warehousing.Adapt<AddWarehouseDetailsInput>();
|
||||
// newEnt.SourceId = warehousing.Id;
|
||||
// var addId = await _warehouseDetails.Add(newEnt);
|
||||
//}
|
||||
|
||||
//var newDetail = warehousing.Adapt<AddWarehousingStatisticsInput>();
|
||||
//newDetail.SourceId = warehousing.Id;
|
||||
//await _warehousingStatisticsService.Add(newDetail);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理输出参数
|
||||
/// </summary>
|
||||
public class TeamOfGroupDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
public string? Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public bool IsDelete { get; set; }
|
||||
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
using Admin.NET.Core;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理基础输入参数
|
||||
/// </summary>
|
||||
public class TeamOfGroupBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public virtual string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
public virtual string? Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public virtual string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public virtual string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public virtual string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public virtual DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public virtual DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public virtual long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public virtual string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public virtual long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public virtual string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public virtual bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理分页查询输入参数
|
||||
/// </summary>
|
||||
public class TeamOfGroupInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键字查询
|
||||
/// </summary>
|
||||
public string? SearchKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
public string? Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理增加输入参数
|
||||
/// </summary>
|
||||
public class AddTeamOfGroupInput : TeamOfGroupBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "软删除不能为空")]
|
||||
public override bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理删除输入参数
|
||||
/// </summary>
|
||||
public class DeleteTeamOfGroupInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理更新输入参数
|
||||
/// </summary>
|
||||
public class UpdateTeamOfGroupInput : TeamOfGroupBaseInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理主键查询输入参数
|
||||
/// </summary>
|
||||
public class QueryByIdTeamOfGroupInput : DeleteTeamOfGroupInput
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 班组管理输出参数
|
||||
/// </summary>
|
||||
public class TeamOfGroupOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
public string? Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public string? Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
public long? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
public string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
public long? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
public string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
public bool IsDelete { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
using Admin.NET.Core.Service;
|
||||
using Admin.NET.Application.Const;
|
||||
using Admin.NET.Application.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
namespace Admin.NET.Application;
|
||||
/// <summary>
|
||||
/// 班组管理服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 100)]
|
||||
public class TeamOfGroupService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<TeamOfGroup> _rep;
|
||||
public TeamOfGroupService(SqlSugarRepository<TeamOfGroup> rep)
|
||||
{
|
||||
_rep = rep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询班组管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Page")]
|
||||
public async Task<SqlSugarPagedList<TeamOfGroupOutput>> Page(TeamOfGroupInput input)
|
||||
{
|
||||
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||
u.Name.Contains(input.SearchKey.Trim())
|
||||
|| u.Leader.Contains(input.SearchKey.Trim())
|
||||
|| u.Tel.Contains(input.SearchKey.Trim())
|
||||
|| u.Address.Contains(input.SearchKey.Trim())
|
||||
|| u.Remarks.Contains(input.SearchKey.Trim())
|
||||
)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Leader), u => u.Leader.Contains(input.Leader.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Address), u => u.Address.Contains(input.Address.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
|
||||
.Select<TeamOfGroupOutput>();
|
||||
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加班组管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Add")]
|
||||
public async Task<long> Add(AddTeamOfGroupInput input)
|
||||
{
|
||||
var entity = input.Adapt<TeamOfGroup>();
|
||||
await _rep.InsertAsync(entity);
|
||||
return entity.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除班组管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Delete")]
|
||||
public async Task Delete(DeleteTeamOfGroupInput input)
|
||||
{
|
||||
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||
await _rep.FakeDeleteAsync(entity); //假删除
|
||||
//await _rep.DeleteAsync(entity); //真删除
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新班组管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Update")]
|
||||
public async Task Update(UpdateTeamOfGroupInput input)
|
||||
{
|
||||
var entity = input.Adapt<TeamOfGroup>();
|
||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取班组管理
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "Detail")]
|
||||
public async Task<TeamOfGroup> Detail([FromQuery] QueryByIdTeamOfGroupInput input)
|
||||
{
|
||||
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取班组管理列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "List")]
|
||||
public async Task<List<TeamOfGroupOutput>> List()
|
||||
{
|
||||
return await _rep.AsQueryable().Select<TeamOfGroupOutput>().Where(a => !a.IsDelete).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ public class WarehouseDetailsDto
|
|||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public string? WarehouseId { get; set; }
|
||||
public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展字段
|
||||
|
|
|
@ -136,7 +136,7 @@ public class WarehouseDetailsBaseInput
|
|||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public virtual string? WarehouseId { get; set; }
|
||||
public virtual long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展字段
|
||||
|
@ -331,7 +331,7 @@ public class WarehouseDetailsInput : BasePageInput
|
|||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public string? WarehouseId { get; set; }
|
||||
public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展字段
|
||||
|
|
|
@ -138,7 +138,7 @@ public class WarehouseDetailsOutput
|
|||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public string? WarehouseId { get; set; }
|
||||
public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展字段
|
||||
|
|
|
@ -40,7 +40,6 @@ public class WarehouseDetailsService : IDynamicApiController, ITransient
|
|||
|| u.CodeType.Contains(input.SearchKey.Trim())
|
||||
|| u.WarehouseLocation.Contains(input.SearchKey.Trim())
|
||||
|| u.Remarks.Contains(input.SearchKey.Trim())
|
||||
|| u.WarehouseId.Contains(input.SearchKey.Trim())
|
||||
|| u.ExpandField.Contains(input.SearchKey.Trim())
|
||||
)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||
|
@ -61,7 +60,6 @@ public class WarehouseDetailsService : IDynamicApiController, ITransient
|
|||
.WhereIF(!string.IsNullOrWhiteSpace(input.WarehouseLocation), u => u.WarehouseLocation.Contains(input.WarehouseLocation.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
|
||||
.WhereIF(input.SourceId>0, u => u.SourceId == input.SourceId)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.WarehouseId), u => u.WarehouseId.Contains(input.WarehouseId.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.ExpandField), u => u.ExpandField.Contains(input.ExpandField.Trim()))
|
||||
.Select<WarehouseDetailsOutput>();
|
||||
if(input.ProductDateRange != null && input.ProductDateRange.Count >0)
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
// 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995
|
||||
//
|
||||
// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
|
||||
|
||||
using Admin.NET.Application.Entity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
public class WarehousingInputData
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
public long? WarehouseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库类型
|
||||
/// </summary>
|
||||
public string? WarehousingType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码类型
|
||||
/// </summary>
|
||||
public string? CodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
public string? Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条码数据
|
||||
/// </summary>
|
||||
public List<string> CodeDatas { get; set; }
|
||||
}
|
|
@ -10,10 +10,36 @@ namespace Admin.NET.Application;
|
|||
public class WarehousingStatisticsService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<WarehousingStatistics> _rep;
|
||||
private readonly WarehouseDetailsService _warehouseDetails;
|
||||
private readonly MaterialsService _materialsService;
|
||||
private readonly SysUnitService _sysUnitService;
|
||||
private readonly MaterialClassifyService _materialClassifyService;
|
||||
private readonly PrintCodeDetailService _codeDetailService;
|
||||
private readonly ProductRetrospectService _productRetrospect;
|
||||
//private readonly ProductWarehousingService _productWarehousing;
|
||||
private readonly ReportDetailTableService _reportDetailTable;
|
||||
private readonly UserManager _userManager;
|
||||
|
||||
public WarehousingStatisticsService(SqlSugarRepository<WarehousingStatistics> rep)
|
||||
public WarehousingStatisticsService(SqlSugarRepository<WarehousingStatistics> rep,
|
||||
UserManager userManager,
|
||||
WarehouseDetailsService warehouseDetails,
|
||||
MaterialsService materialsService,
|
||||
SysUnitService sysUnitService,
|
||||
PrintCodeDetailService codeDetailService,
|
||||
ProductRetrospectService productRetrospect,
|
||||
MaterialClassifyService materialClassifyService,
|
||||
ReportDetailTableService reportDetailTable)
|
||||
{
|
||||
_rep = rep;
|
||||
_userManager = userManager;
|
||||
_warehouseDetails = warehouseDetails;
|
||||
_materialsService = materialsService;
|
||||
_sysUnitService = sysUnitService;
|
||||
_codeDetailService = codeDetailService;
|
||||
_productRetrospect = productRetrospect;
|
||||
_materialClassifyService = materialClassifyService;
|
||||
//_productWarehousing = productWarehousing;
|
||||
_reportDetailTable = reportDetailTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -133,6 +159,227 @@ public class WarehousingStatisticsService : IDynamicApiController, ITransient
|
|||
return entity.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新入库统计
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "Warehousing")]
|
||||
public async Task Warehousing(WarehousingInputData input)
|
||||
{
|
||||
if (input == null || input.WarehouseId == null || input.CodeDatas == null || input.CodeDatas.Count == 0)
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
}
|
||||
var codeDetails = await _codeDetailService.List();
|
||||
var details = await _warehouseDetails.List();
|
||||
var userId = _userManager.UserId;
|
||||
var userName = _userManager.RealName;
|
||||
ReportDetailTable reportTable = null;
|
||||
foreach (var item in input.CodeDatas)
|
||||
{
|
||||
var product = await _codeDetailService.GetByProductCode(item);
|
||||
if (product==null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//product.WarehouseID = input.WarehouseId;
|
||||
reportTable = await _reportDetailTable.Detail(new QueryByIdReportDetailTableInput() { Id = product.ReportTableId.Value });
|
||||
if (reportTable!=null)
|
||||
{
|
||||
var materials = await _materialsService.GetById(reportTable.MaterialsId);
|
||||
if (materials == null)
|
||||
continue;
|
||||
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
|
||||
var baseUnit = units.LastOrDefault().Name;
|
||||
|
||||
var unit = units.Find(a => a.Name == reportTable.Unit);
|
||||
if (details != null && details.Any(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit))
|
||||
{
|
||||
|
||||
var detail = details.Find(a => a.MaterialsId == reportTable.MaterialsId && a.Unit == reportTable.Unit);
|
||||
detail.Count += 1;
|
||||
if (unit != null)
|
||||
{
|
||||
detail.BaseCount = detail.Count * unit.Rate;
|
||||
}
|
||||
await _warehouseDetails.UpdateByEntity(detail.Adapt<WarehouseDetails>());
|
||||
}
|
||||
else
|
||||
{
|
||||
var newEnt = reportTable.Adapt<AddWarehouseDetailsInput>();
|
||||
newEnt.SourceId = reportTable.Id;
|
||||
newEnt.Count = 1;
|
||||
newEnt.BaseCount = unit.Rate;
|
||||
newEnt.WarehouseId = input.WarehouseId;
|
||||
newEnt.GoodCode = item;
|
||||
newEnt.MaterialsNum = reportTable.ProductCodeNum;
|
||||
var addId = await _warehouseDetails.Add(newEnt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var retrospect1 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = unit.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = reportTable.Batch,
|
||||
BusinessType = "入库单",
|
||||
CodeType = input.WarehousingType,
|
||||
Department = reportTable.ProductionLine,
|
||||
//WarehouseID = input.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = reportTable.MaterialsId,
|
||||
OddNumber = reportTable.OddNumber,
|
||||
Receipt = "汇报单",
|
||||
SourceId = reportTable.Id,
|
||||
Unit = unit.Name,
|
||||
Name = materials.Name,
|
||||
Code = item
|
||||
};//Destination = warehousing.Supplier,
|
||||
await _productRetrospect.Add(retrospect1);
|
||||
|
||||
var childs = codeDetails.FindAll(a => a.FatherCode == item);
|
||||
if (childs.Count>0)
|
||||
{
|
||||
var currentUnit = units.FirstOrDefault(a => a.Name == childs.FirstOrDefault().Unit);
|
||||
foreach (var c1 in childs)
|
||||
{
|
||||
var retrospect2 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = currentUnit.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = reportTable.Batch,
|
||||
BusinessType = "入库单",
|
||||
CodeType = input.WarehousingType,
|
||||
Department = reportTable.ProductionLine,
|
||||
//WarehouseID = input.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = reportTable.MaterialsId,
|
||||
OddNumber = reportTable.OddNumber,
|
||||
Receipt = "汇报单",
|
||||
SourceId = reportTable.Id,
|
||||
Unit = currentUnit.Name,
|
||||
Name = materials.Name,
|
||||
Code = c1.Code
|
||||
};//Destination = warehousing.Supplier,
|
||||
await _productRetrospect.Add(retrospect2);
|
||||
|
||||
var childs3 = codeDetails.FindAll(a => a.FatherCode == c1.Code);
|
||||
if (childs3.Count > 0)
|
||||
{
|
||||
var currentUnit3 = units.FirstOrDefault(a => a.Name == childs3.FirstOrDefault().Unit);
|
||||
foreach (var c3 in childs3)
|
||||
{
|
||||
var retrospect3 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = currentUnit3.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = reportTable.Batch,
|
||||
BusinessType = "入库单",
|
||||
CodeType = input.WarehousingType,
|
||||
Department = reportTable.ProductionLine,
|
||||
//WarehouseID = input.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = reportTable.MaterialsId,
|
||||
OddNumber = reportTable.OddNumber,
|
||||
Receipt = "汇报单",
|
||||
SourceId = reportTable.Id,
|
||||
Unit = currentUnit3.Name,
|
||||
Name = materials.Name,
|
||||
Code = c3.Code
|
||||
};//Destination = warehousing.Supplier,
|
||||
await _productRetrospect.Add(retrospect3);
|
||||
|
||||
var childs4 = codeDetails.FindAll(a => a.FatherCode == c3.Code);
|
||||
if (childs4.Count > 0)
|
||||
{
|
||||
var currentUnit4 = units.FirstOrDefault(a => a.Name == childs4.FirstOrDefault().Unit);
|
||||
foreach (var c4 in childs4)
|
||||
{
|
||||
var retrospect4 = new AddProductRetrospectInput()
|
||||
{
|
||||
BaseCount = currentUnit4.Rate,
|
||||
BaseUnit = baseUnit,
|
||||
Batch = reportTable.Batch,
|
||||
BusinessType = "入库单",
|
||||
CodeType = input.WarehousingType,
|
||||
Department = reportTable.ProductionLine,
|
||||
//WarehouseID = input.WarehouseId,
|
||||
WarehousingDate = DateTime.Now,
|
||||
Count = 1,
|
||||
CreateTime = DateTime.Now,
|
||||
ScanCodeTime = DateTime.Now,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
MaterialsId = reportTable.MaterialsId,
|
||||
OddNumber = reportTable.OddNumber,
|
||||
Receipt = "汇报单",
|
||||
SourceId = reportTable.Id,
|
||||
Unit = currentUnit4.Name,
|
||||
Name = materials.Name,
|
||||
Code = c4.Code
|
||||
};//Destination = warehousing.Supplier,
|
||||
await _productRetrospect.Add(retrospect4);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//var warehousing = await Detail(new QueryByIdReportDetailTableInput() { Id = input.WarehousingTableId.Value });
|
||||
//if (warehousing == null)
|
||||
//{
|
||||
// throw Oops.Oh(ErrorCodeEnum.xg1002);
|
||||
//}
|
||||
|
||||
//var details = await _warehouseDetails.List();
|
||||
//if (details != null && details.Any(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit))
|
||||
//{
|
||||
// var unit = units.Find(a => a.Name == warehousing.Unit);
|
||||
// var detail = details.Find(a => a.MaterialsId == warehousing.MaterialsId && a.Unit == warehousing.Unit);
|
||||
// detail.Count += warehousing.Count;
|
||||
// if (unit != null)
|
||||
// {
|
||||
// detail.BaseCount = detail.Count * unit.Rate;
|
||||
// }
|
||||
// await _warehouseDetails.UpdateByEntity(detail.Adapt<WarehouseDetails>());
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// var newEnt = warehousing.Adapt<AddWarehouseDetailsInput>();
|
||||
// newEnt.SourceId = warehousing.Id;
|
||||
// var addId = await _warehouseDetails.Add(newEnt);
|
||||
//}
|
||||
|
||||
var newDetail = reportTable.Adapt<AddWarehousingStatisticsInput>();
|
||||
newDetail.SourceId = reportTable.Id;
|
||||
await Add(newDetail);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除入库统计
|
||||
/// </summary>
|
||||
|
|
|
@ -17,7 +17,7 @@ public class SysOrgSeedData : ISqlSugarEntitySeedData<SysOrg>
|
|||
{
|
||||
return new[]
|
||||
{
|
||||
new SysOrg{ Id=1300000000101, Pid=0, Name="大名科技", Code="1001", Type="101", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="大名科技", TenantId=1300000000001 },
|
||||
new SysOrg{ Id=1300000000101, Pid=0, Name="冠威云", Code="1001", Type="101", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="冠威云", TenantId=1300000000001 },
|
||||
new SysOrg{ Id=1300000000102, Pid=1300000000101, Name="市场部", Code="100101", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=1300000000001 },
|
||||
new SysOrg{ Id=1300000000103, Pid=1300000000101, Name="研发部", Code="100102", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="研发部", TenantId=1300000000001 },
|
||||
new SysOrg{ Id=1300000000104, Pid=1300000000101, Name="财务部", Code="100103", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="财务部", TenantId=1300000000001 },
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -177,7 +177,7 @@ public class Startup : AppStartup
|
|||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
context.Response.Headers.Add("Admin.NET", "Admin.NET");
|
||||
context.Response.Headers.Add("GuanWei", "GuanWei");
|
||||
await next();
|
||||
});
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ enum Api {
|
|||
UpdateCustom = '/api/custom/update',
|
||||
PageCustom = '/api/custom/page',
|
||||
DetailCustom = '/api/custom/detail',
|
||||
ListCustom = '/api/custom/list',
|
||||
}
|
||||
enum ClassifyApi {
|
||||
AddCustom = '/api/custonClassify/add',
|
||||
|
@ -54,6 +55,13 @@ export const detailCustom = (id: any) =>
|
|||
method: 'get',
|
||||
data: { id },
|
||||
});
|
||||
// 列表客户
|
||||
export const listCustom = () =>
|
||||
request({
|
||||
url: Api.ListCustom,
|
||||
method: 'get',
|
||||
data: { },
|
||||
});
|
||||
|
||||
// 增加客户类型
|
||||
export const addCustomClassify = (params?: any) =>
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
import request from '/@/utils/request';
|
||||
enum Api {
|
||||
AddEmployee = '/api/employee/add',
|
||||
DeleteEmployee = '/api/employee/delete',
|
||||
UpdateEmployee = '/api/employee/update',
|
||||
PageEmployee = '/api/employee/page',
|
||||
DetailEmployee = '/api/employee/detail',
|
||||
ListEmployee = '/api/employee/list',
|
||||
}
|
||||
|
||||
// 增加员工管理
|
||||
export const addEmployee = (params?: any) =>
|
||||
request({
|
||||
url: Api.AddEmployee,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 删除员工管理
|
||||
export const deleteEmployee = (params?: any) =>
|
||||
request({
|
||||
url: Api.DeleteEmployee,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 编辑员工管理
|
||||
export const updateEmployee = (params?: any) =>
|
||||
request({
|
||||
url: Api.UpdateEmployee,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 分页查询员工管理
|
||||
export const pageEmployee = (params?: any) =>
|
||||
request({
|
||||
url: Api.PageEmployee,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 列表员工管理
|
||||
export const listEmployee = () =>
|
||||
request({
|
||||
url: Api.ListEmployee,
|
||||
method: 'get',
|
||||
data: { },
|
||||
});
|
||||
|
||||
// 详情员工管理
|
||||
export const detailEmployee = (id: any) =>
|
||||
request({
|
||||
url: Api.DetailEmployee,
|
||||
method: 'get',
|
||||
data: { id },
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
import request from '/@/utils/request';
|
||||
enum Api {
|
||||
AddTeamOfGroup = '/api/teamOfGroup/add',
|
||||
DeleteTeamOfGroup = '/api/teamOfGroup/delete',
|
||||
UpdateTeamOfGroup = '/api/teamOfGroup/update',
|
||||
PageTeamOfGroup = '/api/teamOfGroup/page',
|
||||
DetailTeamOfGroup = '/api/teamOfGroup/detail',
|
||||
ListTeamOfGroup = '/api/teamOfGroup/list',
|
||||
}
|
||||
|
||||
// 增加班组管理
|
||||
export const addTeamOfGroup = (params?: any) =>
|
||||
request({
|
||||
url: Api.AddTeamOfGroup,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 删除班组管理
|
||||
export const deleteTeamOfGroup = (params?: any) =>
|
||||
request({
|
||||
url: Api.DeleteTeamOfGroup,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 编辑班组管理
|
||||
export const updateTeamOfGroup = (params?: any) =>
|
||||
request({
|
||||
url: Api.UpdateTeamOfGroup,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 分页查询班组管理
|
||||
export const pageTeamOfGroup = (params?: any) =>
|
||||
request({
|
||||
url: Api.PageTeamOfGroup,
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
|
||||
// 列表班组管理
|
||||
export const listTeamOfGroup = () =>
|
||||
request({
|
||||
url: Api.ListTeamOfGroup,
|
||||
method: 'get',
|
||||
data: { },
|
||||
});
|
||||
|
||||
// 详情班组管理
|
||||
export const detailTeamOfGroup = (id: any) =>
|
||||
request({
|
||||
url: Api.DetailTeamOfGroup,
|
||||
method: 'get',
|
||||
data: { id },
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<div class="employee-container">
|
||||
<el-dialog v-model="isShowDialog" :width="800" draggable="">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<!--<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>-->
|
||||
<span>{{ props.title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
|
||||
<el-row :gutter="35">
|
||||
<el-form-item v-show="false">
|
||||
<el-input v-model="ruleForm.id" />
|
||||
</el-form-item>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入名字" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="职务" prop="job">
|
||||
<el-input v-model="ruleForm.job" placeholder="请输入职务" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="ruleForm.sex" placeholder="请选择" clearable>
|
||||
<el-option label="男" value="男" />
|
||||
<el-option label="女" value="女" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="联系方式" prop="tel">
|
||||
<el-input v-model="ruleForm.tel" placeholder="请输入联系方式" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="ruleForm.email" placeholder="请输入邮箱" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="ruleForm.address" placeholder="请输入地址" maxlength="64" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="入职日期" prop="dateOnBoard">
|
||||
<el-date-picker v-model="ruleForm.dateOnBoard" type="date" placeholder="入职日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input-number v-model="ruleForm.age" placeholder="请输入年龄" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="身份证号" prop="iDNumber">
|
||||
<el-input v-model="ruleForm.iDNumber" placeholder="请输入身份证号" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="班组" prop="departmentId">
|
||||
<el-select v-model="ruleForm.departmentId" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.id" v-for="item, index in teamOfGroups"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
:deep(.el-select),
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script lang="ts" setup>
|
||||
import { ref,onMounted } from "vue";
|
||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
import { addEmployee, updateEmployee, detailEmployee } from "/@/api/main/employee";
|
||||
import { pageTeamOfGroup, listTeamOfGroup } from '/@/api/main/teamOfGroup';
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
const ruleFormRef = ref();
|
||||
const isShowDialog = ref(false);
|
||||
const ruleForm = ref<any>({});
|
||||
//自行添加其他规则
|
||||
const rules = ref<FormRules>({
|
||||
});
|
||||
const teamOfGroups = ref<any>([]);
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
// ruleForm.value = JSON.parse(JSON.stringify(row));
|
||||
// 改用detail获取最新数据来编辑
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailEmployee(rowData.id)).data.result;
|
||||
else
|
||||
ruleForm.value = rowData;
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
emit("reloadTable");
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
||||
if (isValid) {
|
||||
let values = ruleForm.value;
|
||||
if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) {
|
||||
await addEmployee(values);
|
||||
} else {
|
||||
await updateEmployee(values);
|
||||
}
|
||||
closeDialog();
|
||||
} else {
|
||||
ElMessage({
|
||||
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
teamOfGroups.value = (await listTeamOfGroup()).data.result;
|
||||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,171 +1,249 @@
|
|||
<template>
|
||||
<div class="main">
|
||||
<div class="main-from common-box">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="70px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="可用状态">
|
||||
<el-select v-model="formInline.region" placeholder="请选择" clearable>
|
||||
<el-option label="启用" value="shanghai" />
|
||||
<el-option label="禁用" value="shanghai" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="formInline.user" placeholder="请输入名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="编码">
|
||||
<el-input v-model="formInline.user" placeholder="请输入编码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" @click="onSubmit">重置</el-button>
|
||||
<el-button @click="onSubmit">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit">新增</el-button>
|
||||
<el-button @click="onSubmit" type="warning">删除</el-button>
|
||||
<el-button @click="onSubmit">启用</el-button>
|
||||
<el-button @click="onSubmit">禁用</el-button>
|
||||
<el-dropdown style="margin-left: 10px;">
|
||||
<el-button type="primary">
|
||||
更多操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>导入</el-dropdown-item>
|
||||
<el-dropdown-item>导出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template>
|
||||
<div class="employee-container">
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
|
||||
|
||||
<div class="main-table common-box">
|
||||
<div class="tab-hed">
|
||||
<el-select v-model="formInline.region" placeholder="分类" clearable style="width: 200px;">
|
||||
<el-option label="所有" value="shanghai" />
|
||||
<el-option label="成品" value="shanghai" />
|
||||
<el-option label="成品非追溯" value="shanghai" />
|
||||
</el-select>
|
||||
<div>
|
||||
<el-button type="success" link
|
||||
style="border-right: 1px #515a6e solid; border-radius: 0px; margin-right: 3px; padding: 0 3px;">新增</el-button>
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
更多
|
||||
<el-icon class="el-icon--right">
|
||||
<arrow-down />
|
||||
</el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>查看</el-dropdown-item>
|
||||
<el-dropdown-item>修改</el-dropdown-item>
|
||||
<el-dropdown-item>删除</el-dropdown-item>
|
||||
<el-dropdown-item>刷新</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab">
|
||||
<vxe-table show-overflow height="100%" :data="tableData" :border=true :tree-config="{ transform: true }"
|
||||
:scroll-y="{ gt: 20 }">
|
||||
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
|
||||
<vxe-column field="a" sortable title="编码" width=""></vxe-column>
|
||||
<vxe-column field="b" sortable title="名称" width=""></vxe-column>
|
||||
<vxe-column field="c" sortable title="分类" width=""></vxe-column>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="名字">
|
||||
<el-input v-model="queryParams.name" clearable="" placeholder="请输入名字"/>
|
||||
|
||||
<vxe-column field="f" sortable title="可用状态" width=""></vxe-column>
|
||||
<vxe-column field="f" sortable title="创建时间" width=""></vxe-column>
|
||||
<vxe-column title="操作" width="200" fixed="right" show-overflow>
|
||||
<template #default="{ row }">
|
||||
<vxe-button type="text">查看</vxe-button>
|
||||
<!-- <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> -->
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="职务">
|
||||
<el-input v-model="queryParams.job" clearable="" placeholder="请输入职务"/>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"
|
||||
:total="pageVO1.total" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="性别">
|
||||
<el-input v-model="queryParams.sex" clearable="" placeholder="请输入性别"/>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="联系方式">
|
||||
<el-input v-model="queryParams.tel" clearable="" placeholder="请输入联系方式"/>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="queryParams.email" clearable="" placeholder="请输入邮箱"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="queryParams.address" clearable="" placeholder="请输入地址"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="入职日期">
|
||||
<el-input v-model="queryParams.date" clearable="" placeholder="请输入入职日期"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="年龄">
|
||||
<el-input-number v-model="queryParams.age" clearable="" placeholder="请输入年龄"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="身份证号">
|
||||
<el-input v-model="queryParams.iDNumber" clearable="" placeholder="请输入身份证号"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="部门ID">
|
||||
<el-input v-model="queryParams.departmentId" clearable="" placeholder="请输入部门ID"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remarks" clearable="" placeholder="请输入备注"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
||||
<el-form-item>
|
||||
<el-button-group style="display: flex; align-items: center;">
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'employee:page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddEmployee" v-auth="'employee:add'"> 新增 </el-button>
|
||||
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
tooltip-effect="light"
|
||||
row-key="id"
|
||||
@sort-change="sortChange"
|
||||
border="">
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column prop="name" label="名字" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="job" label="职务" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="sex" label="性别" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="tel" label="联系方式" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="address" label="地址" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="date" label="入职日期" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="age" label="年龄" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="iDNumber" label="身份证号" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="departmentId" label="部门ID" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('employee:update') || auth('employee:delete')">
|
||||
<template #default="scope">
|
||||
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditEmployee(scope.row)" v-auth="'employee:update'"> 编辑 </el-button>
|
||||
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delEmployee(scope.row)" v-auth="'employee:delete'"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:currentPage="tableParams.page"
|
||||
v-model:page-size="tableParams.pageSize"
|
||||
:total="tableParams.total"
|
||||
:page-sizes="[10, 20, 50, 100, 200, 500]"
|
||||
small=""
|
||||
background=""
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
/>
|
||||
<printDialog
|
||||
ref="printDialogRef"
|
||||
:title="printEmployeeTitle"
|
||||
@reloadTable="handleQuery" />
|
||||
<editDialog
|
||||
ref="editDialogRef"
|
||||
:title="editEmployeeTitle"
|
||||
@reloadTable="handleQuery"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
|
||||
const formInline = reactive({
|
||||
user: '',
|
||||
region: '',
|
||||
date: '',
|
||||
})
|
||||
|
||||
const onSubmit = () => {
|
||||
console.log('submit!')
|
||||
}
|
||||
<script lang="ts" setup="" name="employee">
|
||||
import { ref } from "vue";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { auth } from '/@/utils/authFunction';
|
||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { formatDate } from '/@/utils/formatTime';
|
||||
|
||||
|
||||
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
||||
import editDialog from '/@/views/basics-date/employee/component/editDialog.vue'
|
||||
import { pageEmployee, deleteEmployee } from '/@/api/main/employee';
|
||||
|
||||
import { ref } from 'vue'
|
||||
|
||||
const tableData = ref([
|
||||
const showAdvanceQueryUI = ref(false);
|
||||
const printDialogRef = ref();
|
||||
const editDialogRef = ref();
|
||||
const loading = ref(false);
|
||||
const tableData = ref<any>([]);
|
||||
const queryParams = ref<any>({});
|
||||
const tableParams = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
])
|
||||
const printEmployeeTitle = ref("");
|
||||
const editEmployeeTitle = ref("");
|
||||
|
||||
const pageVO1 = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 30,
|
||||
total: 8
|
||||
})
|
||||
// 改变高级查询的控件显示状态
|
||||
const changeAdvanceQueryUI = () => {
|
||||
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
|
||||
}
|
||||
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
loading.value = true;
|
||||
var res = await pageEmployee(Object.assign(queryParams.value, tableParams.value));
|
||||
tableData.value = res.data.result?.items ?? [];
|
||||
tableParams.value.total = res.data.result?.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
// 列排序
|
||||
const sortChange = async (column: any) => {
|
||||
queryParams.value.field = column.prop;
|
||||
queryParams.value.order = column.order;
|
||||
await handleQuery();
|
||||
};
|
||||
|
||||
// 打开新增页面
|
||||
const openAddEmployee = () => {
|
||||
editEmployeeTitle.value = '添加员工管理';
|
||||
editDialogRef.value.openDialog({});
|
||||
};
|
||||
|
||||
// 打开打印页面
|
||||
const openPrintEmployee = async (row: any) => {
|
||||
printEmployeeTitle.value = '打印员工管理';
|
||||
}
|
||||
|
||||
// 打开编辑页面
|
||||
const openEditEmployee = (row: any) => {
|
||||
editEmployeeTitle.value = '编辑员工管理';
|
||||
editDialogRef.value.openDialog(row);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const delEmployee = (row: any) => {
|
||||
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteEmployee(row);
|
||||
handleQuery();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 改变页面容量
|
||||
const handleSizeChange = (val: number) => {
|
||||
tableParams.value.pageSize = val;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 改变页码序号
|
||||
const handleCurrentChange = (val: number) => {
|
||||
tableParams.value.page = val;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
handleQuery();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.main-from {
|
||||
// height: 300px;
|
||||
width: 100%;
|
||||
padding: 20px 10px;
|
||||
|
||||
.el-row {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.main-table {
|
||||
margin-top: 20px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
flex-grow: 1;
|
||||
height: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tab {
|
||||
flex: 1;
|
||||
overflow: scroll;
|
||||
}
|
||||
.tab-hed{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
<style scoped>
|
||||
:deep(.el-ipnut),
|
||||
:deep(.el-select),
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
<template>
|
||||
<div class="teamOfGroup-container">
|
||||
<el-dialog v-model="isShowDialog" :width="800" draggable="">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<!--<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>-->
|
||||
<span>{{ props.title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
|
||||
<el-row :gutter="35">
|
||||
<el-form-item v-show="false">
|
||||
<el-input v-model="ruleForm.id" />
|
||||
</el-form-item>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="负责人" prop="leader">
|
||||
<el-input v-model="ruleForm.leader" placeholder="请输入负责人" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="电话" prop="tel">
|
||||
<el-input v-model="ruleForm.tel" placeholder="请输入电话" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="ruleForm.address" placeholder="请输入地址" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
:deep(.el-select),
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script lang="ts" setup>
|
||||
import { ref,onMounted } from "vue";
|
||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
import { addTeamOfGroup, updateTeamOfGroup, detailTeamOfGroup } from "/@/api/main/teamOfGroup";
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
const ruleFormRef = ref();
|
||||
const isShowDialog = ref(false);
|
||||
const ruleForm = ref<any>({});
|
||||
//自行添加其他规则
|
||||
const rules = ref<FormRules>({
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
// ruleForm.value = JSON.parse(JSON.stringify(row));
|
||||
// 改用detail获取最新数据来编辑
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailTeamOfGroup(rowData.id)).data.result;
|
||||
else
|
||||
ruleForm.value = rowData;
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
emit("reloadTable");
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
||||
if (isValid) {
|
||||
let values = ruleForm.value;
|
||||
if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) {
|
||||
await addTeamOfGroup(values);
|
||||
} else {
|
||||
await updateTeamOfGroup(values);
|
||||
}
|
||||
closeDialog();
|
||||
} else {
|
||||
ElMessage({
|
||||
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<div class="teamOfGroup-container">
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="queryParams.name" clearable="" placeholder="请输入名称"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="负责人">
|
||||
<el-input v-model="queryParams.leader" clearable="" placeholder="请输入负责人"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="电话">
|
||||
<el-input v-model="queryParams.tel" clearable="" placeholder="请输入电话"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="queryParams.address" clearable="" placeholder="请输入地址"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remarks" clearable="" placeholder="请输入备注"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
||||
<el-form-item>
|
||||
<el-button-group style="display: flex; align-items: center;">
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'teamOfGroup:page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddTeamOfGroup" v-auth="'teamOfGroup:add'"> 新增 </el-button>
|
||||
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
tooltip-effect="light"
|
||||
row-key="id"
|
||||
@sort-change="sortChange"
|
||||
border="">
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column prop="name" label="名称" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="leader" label="负责人" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="tel" label="电话" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="address" label="地址" width="300" show-overflow-tooltip="" />
|
||||
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('teamOfGroup:update') || auth('teamOfGroup:delete')">
|
||||
<template #default="scope">
|
||||
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditTeamOfGroup(scope.row)" v-auth="'teamOfGroup:update'"> 编辑 </el-button>
|
||||
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delTeamOfGroup(scope.row)" v-auth="'teamOfGroup:delete'"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:currentPage="tableParams.page"
|
||||
v-model:page-size="tableParams.pageSize"
|
||||
:total="tableParams.total"
|
||||
:page-sizes="[10, 20, 50, 100, 200, 500]"
|
||||
small=""
|
||||
background=""
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
/>
|
||||
<printDialog
|
||||
ref="printDialogRef"
|
||||
:title="printTeamOfGroupTitle"
|
||||
@reloadTable="handleQuery" />
|
||||
<editDialog
|
||||
ref="editDialogRef"
|
||||
:title="editTeamOfGroupTitle"
|
||||
@reloadTable="handleQuery"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup="" name="teamOfGroup">
|
||||
import { ref } from "vue";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { auth } from '/@/utils/authFunction';
|
||||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { formatDate } from '/@/utils/formatTime';
|
||||
|
||||
|
||||
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
||||
import editDialog from '/@/views/basics-date/teamOfGroup/component/editDialog.vue'
|
||||
import { pageTeamOfGroup, deleteTeamOfGroup } from '/@/api/main/teamOfGroup';
|
||||
|
||||
|
||||
const showAdvanceQueryUI = ref(false);
|
||||
const printDialogRef = ref();
|
||||
const editDialogRef = ref();
|
||||
const loading = ref(false);
|
||||
const tableData = ref<any>([]);
|
||||
const queryParams = ref<any>({});
|
||||
const tableParams = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const printTeamOfGroupTitle = ref("");
|
||||
const editTeamOfGroupTitle = ref("");
|
||||
|
||||
// 改变高级查询的控件显示状态
|
||||
const changeAdvanceQueryUI = () => {
|
||||
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
|
||||
}
|
||||
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
loading.value = true;
|
||||
var res = await pageTeamOfGroup(Object.assign(queryParams.value, tableParams.value));
|
||||
tableData.value = res.data.result?.items ?? [];
|
||||
tableParams.value.total = res.data.result?.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
// 列排序
|
||||
const sortChange = async (column: any) => {
|
||||
queryParams.value.field = column.prop;
|
||||
queryParams.value.order = column.order;
|
||||
await handleQuery();
|
||||
};
|
||||
|
||||
// 打开新增页面
|
||||
const openAddTeamOfGroup = () => {
|
||||
editTeamOfGroupTitle.value = '添加班组管理';
|
||||
editDialogRef.value.openDialog({});
|
||||
};
|
||||
|
||||
// 打开打印页面
|
||||
const openPrintTeamOfGroup = async (row: any) => {
|
||||
printTeamOfGroupTitle.value = '打印班组管理';
|
||||
}
|
||||
|
||||
// 打开编辑页面
|
||||
const openEditTeamOfGroup = (row: any) => {
|
||||
editTeamOfGroupTitle.value = '编辑班组管理';
|
||||
editDialogRef.value.openDialog(row);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const delTeamOfGroup = (row: any) => {
|
||||
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteTeamOfGroup(row);
|
||||
handleQuery();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 改变页面容量
|
||||
const handleSizeChange = (val: number) => {
|
||||
tableParams.value.pageSize = val;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 改变页码序号
|
||||
const handleCurrentChange = (val: number) => {
|
||||
tableParams.value.page = val;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
handleQuery();
|
||||
</script>
|
||||
<style scoped>
|
||||
:deep(.el-ipnut),
|
||||
:deep(.el-select),
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,107 +15,86 @@
|
|||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="单号" prop="codeNum">
|
||||
<el-input v-model="ruleForm.codeNum" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="业务日期" prop="startDate">
|
||||
<el-date-picker v-model="ruleForm.startDate" type="date" placeholder="业务日期" />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="业务类型" prop="businessType">
|
||||
<el-input v-model="ruleForm.businessType" placeholder="请输入业务类型" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-select v-model="ruleForm.businessType" placeholder="请选择" clearable>
|
||||
<el-option label="销售出库" value="销售出库" />
|
||||
<el-option label="其他出库" value="其他出库" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="客户" prop="custom">
|
||||
<el-input v-model="ruleForm.custom" placeholder="请输入客户" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-form-item label="客户" prop="custom" :rules="[{ required: true, message: '客户不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.custom" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in customs"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-input v-model="ruleForm.warehouse" placeholder="请输入仓库" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-form-item label="仓库" prop="warehouse" :rules="[{ required: true, message: '仓库不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.warehouse" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in warehouses"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="部门" prop="department">
|
||||
<el-input v-model="ruleForm.department" placeholder="请输入部门" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="车牌号" prop="carNumber">
|
||||
<el-input v-model="ruleForm.carNumber" placeholder="请输入车牌号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="停车位" prop="parkingSpace">
|
||||
<el-input v-model="ruleForm.parkingSpace" placeholder="请输入停车位" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="ruleForm.salesman" placeholder="请输入业务员" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="收货单位" prop="consignee">
|
||||
<el-input v-model="ruleForm.consignee" placeholder="请输入收货单位" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="交货日期" prop="deliveryDate">
|
||||
<el-date-picker v-model="ruleForm.deliveryDate" type="date" placeholder="交货日期" />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="交货地址" prop="deliveryAddress">
|
||||
<el-input v-model="ruleForm.deliveryAddress" placeholder="请输入交货地址" maxlength="128" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="128" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="方案客户拓展" prop="customExpand">
|
||||
<el-input v-model="ruleForm.customExpand" placeholder="请输入方案客户拓展" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="发货拓展" prop="sendOutExpand">
|
||||
<el-input v-model="ruleForm.sendOutExpand" placeholder="请输入发货拓展" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -140,6 +119,9 @@
|
|||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
import { addInvoice, updateInvoice, detailInvoice } from "/@/api/main/invoice";
|
||||
import { listWarehouse } from '/@/api/main/warehouse';
|
||||
import { listSupplier } from '/@/api/main/supplier';
|
||||
import { listCustom } from '/@/api/main/custom';
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
|
@ -153,6 +135,10 @@
|
|||
const ruleFormRef = ref();
|
||||
const isShowDialog = ref(false);
|
||||
const ruleForm = ref<any>({});
|
||||
const warehouses = ref<any>([]);
|
||||
const suppliers = ref<any>([]);
|
||||
const customs = ref<any>([]);
|
||||
|
||||
//自行添加其他规则
|
||||
const rules = ref<FormRules>({
|
||||
businessType: [{required: true, message: '请输入业务类型!', trigger: 'blur',},],
|
||||
|
@ -211,6 +197,9 @@
|
|||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
warehouses.value = (await listWarehouse()).data.result;
|
||||
suppliers.value = (await listSupplier()).data.result;
|
||||
customs.value = (await listCustom()).data.result;
|
||||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
|
|
|
@ -178,7 +178,6 @@
|
|||
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||
import { formatDate } from '/@/utils/formatTime';
|
||||
|
||||
|
||||
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
||||
import editDialog from '/@/views/inventoryManagement/invoice/component/editDialog.vue'
|
||||
import { pageInvoice, deleteInvoice } from '/@/api/main/invoice';
|
||||
|
|
|
@ -15,72 +15,52 @@
|
|||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="单号" prop="codeNum">
|
||||
<el-input v-model="ruleForm.codeNum" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="来源单号" prop="sourceCodeNum">
|
||||
<el-input v-model="ruleForm.sourceCodeNum" placeholder="请输入来源单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="业务日期" prop="startDate">
|
||||
<el-input v-model="ruleForm.startDate" placeholder="请输入业务日期" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input-number v-model="ruleForm.state" placeholder="请输入状态" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="业务类型" prop="businessType">
|
||||
<el-input v-model="ruleForm.businessType" placeholder="请输入业务类型" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="收货单位" prop="consignee">
|
||||
<el-input v-model="ruleForm.consignee" placeholder="请输入收货单位" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="审核人ID" prop="examinerId">
|
||||
<el-input v-model="ruleForm.examinerId" placeholder="请输入审核人ID" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="出库单整型拓展字段" prop="outboundExpandInt">
|
||||
<el-form-item label="整型拓展字段" prop="outboundExpandInt">
|
||||
<el-input-number v-model="ruleForm.outboundExpandInt" placeholder="请输入出库单整型拓展字段" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="出库单字符串拓展字段" prop="outboundExpandString">
|
||||
<el-form-item label="字符串拓展字段" prop="outboundExpandString">
|
||||
<el-input v-model="ruleForm.outboundExpandString" placeholder="请输入出库单字符串拓展字段" maxlength="64" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-input v-model="ruleForm.warehouse" placeholder="请输入仓库" maxlength="255" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddOutbound" v-auth="'outbound:add'"> 新增 </el-button>
|
||||
<!-- <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddOutbound" v-auth="'outbound:add'"> 新增 </el-button> -->
|
||||
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
@ -102,8 +102,8 @@
|
|||
<el-table-column prop="businessType" label="业务类型" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="consignee" label="收货单位" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="examinerId" label="审核人ID" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column prop="outboundExpandInt" label="出库单整型拓展字段" width="135" show-overflow-tooltip="" />
|
||||
<el-table-column prop="outboundExpandString" label="出库单字符串拓展字段" width="150" show-overflow-tooltip="" />
|
||||
<el-table-column prop="outboundExpandInt" label="整型拓展字段" width="135" show-overflow-tooltip="" />
|
||||
<el-table-column prop="outboundExpandString" label="字符串拓展字段" width="150" show-overflow-tooltip="" />
|
||||
<el-table-column prop="warehouse" label="仓库" width="140" show-overflow-tooltip="" />
|
||||
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('outbound:update') || auth('outbound:delete')">
|
||||
<template #default="scope">
|
||||
|
|
|
@ -267,8 +267,8 @@
|
|||
const units = ref<any>([]);
|
||||
const currentMaterial = ref<any>({});
|
||||
const warehouses = ref<any>([]);
|
||||
const productionLines = ref<any>([]);
|
||||
const suppliers = ref<any>([]);
|
||||
const productionLines = ref<any>([]);
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
|
@ -334,8 +334,8 @@
|
|||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
warehouses.value = (await listWarehouse()).data.result;
|
||||
productionLines.value = (await listProductionLine()).data.result;
|
||||
warehouses.value = (await listWarehouse()).data.result;
|
||||
suppliers.value = (await listSupplier()).data.result;
|
||||
});
|
||||
|
||||
|
|
|
@ -13,179 +13,157 @@
|
|||
<el-input v-model="ruleForm.id" />
|
||||
</el-form-item>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="ruleForm.productName" placeholder="请输入产品名称" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-form-item label="产品名称" prop="productName" :rules="[{ required: true, message: '产品名称不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.materials" placeholder="请选择" clearable @change="materialsChange">
|
||||
<el-option :label="item.name" :value="item" v-for="item, index in materials"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="产品编码" prop="productCodeNum">
|
||||
<el-input v-model="ruleForm.productCodeNum" placeholder="请输入产品编码" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="单号" prop="oddNumber">
|
||||
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="ruleForm.state" placeholder="请输入状态" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-select v-model="ruleForm.codeType" placeholder="请选择" clearable>
|
||||
<el-option label="待审核" value= 0 />
|
||||
<el-option label="已审核" value= 1 />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="生产类型" prop="productType">
|
||||
<el-input v-model="ruleForm.productType" placeholder="请输入生产类型" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="生产线" prop="productionLine">
|
||||
<el-input v-model="ruleForm.productionLine" placeholder="请输入生产线" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="生产线编码" prop="codeNum">
|
||||
<el-input v-model="ruleForm.codeNum" placeholder="请输入生产线编码" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="源单号" prop="sourceNumber">
|
||||
<el-input v-model="ruleForm.sourceNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="规格型号" prop="specifications">
|
||||
<el-input v-model="ruleForm.specifications" placeholder="请输入规格型号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="源单号" prop="sourceNumber">
|
||||
<el-input v-model="ruleForm.sourceNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="完工数量" prop="productCount">
|
||||
<el-input-number v-model="ruleForm.productCount" placeholder="请输入完工数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="入库数量" prop="putWarehouse">
|
||||
<el-input-number v-model="ruleForm.putWarehouse" placeholder="请输入入库数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="基本完工数量" prop="baseProductCount">
|
||||
<el-input-number v-model="ruleForm.baseProductCount" placeholder="请输入基本完工数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="基本入库数量" prop="basePutWarehouse">
|
||||
<el-input-number v-model="ruleForm.basePutWarehouse" placeholder="请输入基本入库数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="ruleForm.unit" placeholder="请输入单位" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-form-item label="单位" prop="unit" :rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.unit" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="基本单位" prop="baseUnit">
|
||||
<el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="批次" prop="batch">
|
||||
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="包装规格" prop="package">
|
||||
<el-input v-model="ruleForm.package" placeholder="请输入包装规格" maxlength="32" show-word-limit clearable />
|
||||
|
||||
<el-form-item label="包装单位" prop="package" :rules="[{ required: true, message: '包装单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.package" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="基本单位" prop="baseUnit" :rules="[{ required: true, message: '基本单位不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.baseUnit" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="包装数量" prop="packageCount">
|
||||
<el-input-number v-model="ruleForm.packageCount" placeholder="请输入包装数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="采集失败数量" prop="gatherFalseCount">
|
||||
<el-input-number v-model="ruleForm.gatherFalseCount" placeholder="请输入采集失败数量" clearable />
|
||||
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="生产线" prop="productionLine" >
|
||||
<el-select v-model="ruleForm.productionLine" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="班组" prop="teamGroup">
|
||||
<el-select v-model="ruleForm.teamGroup" placeholder="请选择" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in teamOfGroups"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="操作工人" prop="operator">
|
||||
<el-select v-model="ruleForm.operator" placeholder="请选择操作工人" clearable >
|
||||
<el-option :label="item.name" :value="item.name" v-for="item, index in employees"
|
||||
:key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="生产日期" prop="productDate">
|
||||
<el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="班组" prop="teamGroup">
|
||||
<el-input v-model="ruleForm.teamGroup" placeholder="请输入班组" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="操作工人" prop="operator">
|
||||
<el-input v-model="ruleForm.operator" placeholder="请输入操作工人" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="完工时间" prop="endDate">
|
||||
<el-date-picker v-model="ruleForm.endDate" type="date" placeholder="完工时间" />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="源单号" prop="sourceOddNumber">
|
||||
<el-input v-model="ruleForm.sourceOddNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -210,8 +188,13 @@
|
|||
import { ElMessage } from "element-plus";
|
||||
import type { FormRules } from "element-plus";
|
||||
import { addReportDetailTable, updateReportDetailTable, detailReportDetailTable } from "/@/api/main/reportDetailTable";
|
||||
import { pageMaterials, deleteMaterials, detailMaterials } from '/@/api/main/materials';
|
||||
|
||||
import { pageMaterials, listMaterials, detailMaterials } from '/@/api/main/materials';
|
||||
import { listUnitGroup } from '/@/api/main/unit';
|
||||
import { listProductionLine } from '/@/api/main/productionLine';
|
||||
import { listWarehouse } from '/@/api/main/warehouse';
|
||||
import { listSupplier } from '/@/api/main/supplier';
|
||||
import { listTeamOfGroup } from '/@/api/main/teamOfGroup';
|
||||
import { listEmployee } from '/@/api/main/employee';
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
|
@ -225,13 +208,22 @@
|
|||
const ruleFormRef = ref();
|
||||
const isShowDialog = ref(false);
|
||||
const ruleForm = ref<any>({});
|
||||
const materials = ref<any>({});
|
||||
//const materials = ref<any>({});
|
||||
//自行添加其他规则
|
||||
const rules = ref<FormRules>({
|
||||
productName: [{required: true, message: '请输入产品名称!', trigger: 'blur',},],
|
||||
state: [{required: true, message: '请输入状态!', trigger: 'blur',},],
|
||||
});
|
||||
|
||||
const materials = ref<any>([]);
|
||||
const units = ref<any>([]);
|
||||
const currentMaterial = ref<any>({});
|
||||
const warehouses = ref<any>([]);
|
||||
const suppliers = ref<any>([]);
|
||||
const productionLines = ref<any>([]);
|
||||
const teamOfGroups = ref<any>([]);
|
||||
const employees = ref<any>([]);
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
// ruleForm.value = JSON.parse(JSON.stringify(row));
|
||||
|
@ -243,9 +235,8 @@
|
|||
ruleForm.value = rowData;
|
||||
|
||||
if(rowData.updateUserId){
|
||||
materials.value= (await detailMaterials(rowData.materialsId)).data.result;
|
||||
console.log(materials.value);
|
||||
|
||||
currentMaterial.value= (await detailMaterials(rowData.materialsId)).data.result;
|
||||
//console.log(materials.value);
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
//console.log(ruleForm.value);
|
||||
|
@ -286,10 +277,26 @@
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物料值变更
|
||||
* @param clearBindUserId 是否清空
|
||||
*/
|
||||
const materialsChange = async (value : any) => {
|
||||
currentMaterial.value = value;
|
||||
ruleForm.value.materialsId=value.id;
|
||||
var res = await listUnitGroup(value.unitGroupId ?? 0);
|
||||
units.value = res.data.result ?? [];
|
||||
//console.log(value);
|
||||
};
|
||||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
productionLines.value = (await listProductionLine()).data.result;
|
||||
warehouses.value = (await listWarehouse()).data.result;
|
||||
suppliers.value = (await listSupplier()).data.result;
|
||||
materials.value = (await listMaterials()).data.result;
|
||||
teamOfGroups.value = (await listTeamOfGroup()).data.result;
|
||||
employees.value = (await listEmployee()).data.result;
|
||||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<!-- <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> 新增 </el-button> -->
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> 新增 </el-button>
|
||||
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
@ -292,10 +292,10 @@
|
|||
};
|
||||
|
||||
// 打开新增页面
|
||||
// const openAddReportDetailTable = () => {
|
||||
// editReportDetailTableTitle.value = '添加汇报单详情';
|
||||
// editDialogRef.value.openDialog({});
|
||||
// };
|
||||
const openAddReportDetailTable = () => {
|
||||
editReportDetailTableTitle.value = '添加汇报单详情';
|
||||
editDialogRef.value.openDialog({});
|
||||
};
|
||||
|
||||
|
||||
// 打开编辑页面
|
||||
|
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
|
||||
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
||||
import editDialog from '/@/views/main/productRetrospect/component/editDialog.vue'
|
||||
import editDialog from '/@/views/retrospect/productRetrospect/component/editDialog.vue'
|
||||
import { pageProductRetrospect, deleteProductRetrospect } from '/@/api/main/productRetrospect';
|
||||
|
||||
|
Loading…
Reference in New Issue