main
liangzongpeng 2024-05-20 18:06:52 +08:00
parent 16fd751576
commit 4d90594321
77 changed files with 6338 additions and 549 deletions

View File

@ -0,0 +1,76 @@
using Admin.NET.Core;
namespace Admin.NET.Application.Entity;
/// <summary>
/// 分销商
/// </summary>
[SugarTable("Distributor","分销商")]
public class Distributor : EntityTenant
{
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
public string? Name { get; set; }
/// <summary>
/// 编码
/// </summary>
[SugarColumn(ColumnName = "CodeNum", ColumnDescription = "编码", Length = 32)]
public string? CodeNum { get; set; }
/// <summary>
/// 简称
/// </summary>
[SugarColumn(ColumnName = "SorName", ColumnDescription = "简称", Length = 32)]
public string? SorName { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnName = "Status", ColumnDescription = "状态")]
public int? Status { get; set; }
/// <summary>
/// 联系人
/// </summary>
[SugarColumn(ColumnName = "Contacts", ColumnDescription = "联系人", Length = 32)]
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
[SugarColumn(ColumnName = "Tel", ColumnDescription = "电话", Length = 32)]
public string? Tel { get; set; }
/// <summary>
/// 所有者账号
/// </summary>
[SugarColumn(ColumnName = "UserName", ColumnDescription = "所有者账号", Length = 32)]
public string? UserName { get; set; }
/// <summary>
/// 品牌
/// </summary>
[SugarColumn(ColumnName = "Brand", ColumnDescription = "品牌", Length = 32)]
public string? Brand { get; set; }
/// <summary>
/// 上级分销商
/// </summary>
[SugarColumn(ColumnName = "SuperiorDistributor", ColumnDescription = "上级分销商", Length = 32)]
public string? SuperiorDistributor { get; set; }
/// <summary>
/// 地址
/// </summary>
[SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 64)]
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 64)]
public string? Remarks { get; set; }
}

View File

@ -0,0 +1,52 @@
using Admin.NET.Core;
namespace Admin.NET.Application.Entity;
/// <summary>
/// 供应商
/// </summary>
[SugarTable("Supplier","供应商")]
public class Supplier : EntityTenant
{
/// <summary>
/// 供应商名称
/// </summary>
[SugarColumn(ColumnName = "Name", ColumnDescription = "供应商名称", Length = 64)]
public string? Name { get; set; }
/// <summary>
/// 联系人
/// </summary>
[SugarColumn(ColumnName = "Contacts", ColumnDescription = "联系人", Length = 32)]
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
[SugarColumn(ColumnName = "Tel", ColumnDescription = "电话", Length = 32)]
public string? Tel { get; set; }
/// <summary>
/// 企业类型
/// </summary>
[SugarColumn(ColumnName = "CompanyType", ColumnDescription = "企业类型", Length = 32)]
public string? CompanyType { get; set; }
/// <summary>
/// 职务
/// </summary>
[SugarColumn(ColumnName = "Duties", ColumnDescription = "职务", Length = 32)]
public string? Duties { get; set; }
/// <summary>
/// 地址
/// </summary>
[SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 64)]
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
public string? Remarks { get; set; }
}

View File

@ -24,7 +24,7 @@ public class BrandService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<BrandOutput>> Page(BrandInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class CodePakageConfigurationService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<CodePakageConfigurationOutput>> Page(CodePakageConfigurationInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
)

View File

@ -24,7 +24,7 @@ public class CodeRuleByInfomationService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<CodeRuleByInfomationOutput>> Page(CodeRuleByInfomationInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class CodeRuleByReceiptService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<CodeRuleByReceiptOutput>> Page(CodeRuleByReceiptInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeNum.Contains(input.SearchKey.Trim())
|| u.Name.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class CustomService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<CustomOutput>> Page(CustomInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class CustonClassifyService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<CustonClassifyOutput>> Page(CustonClassifyInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
)

View File

@ -0,0 +1,123 @@
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 DistributorService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<Distributor> _rep;
public DistributorService(SqlSugarRepository<Distributor> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询分销商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<DistributorOutput>> Page(DistributorInput input)
{
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())
|| u.SorName.Contains(input.SearchKey.Trim())
|| u.Contacts.Contains(input.SearchKey.Trim())
|| u.Tel.Contains(input.SearchKey.Trim())
|| u.UserName.Contains(input.SearchKey.Trim())
|| u.Brand.Contains(input.SearchKey.Trim())
|| u.SuperiorDistributor.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.CodeNum), u => u.CodeNum.Contains(input.CodeNum.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.SorName), u => u.SorName.Contains(input.SorName.Trim()))
.WhereIF(input.Status>0, u => u.Status == input.Status)
.WhereIF(!string.IsNullOrWhiteSpace(input.Contacts), u => u.Contacts.Contains(input.Contacts.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.UserName), u => u.UserName.Contains(input.UserName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Brand), u => u.Brand.Contains(input.Brand.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.SuperiorDistributor), u => u.SuperiorDistributor.Contains(input.SuperiorDistributor.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<DistributorOutput>();
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(AddDistributorInput input)
{
var entity = input.Adapt<Distributor>();
await _rep.InsertAsync(entity);
return entity.Id;
}
/// <summary>
/// 删除分销商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Delete")]
public async Task Delete(DeleteDistributorInput 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(UpdateDistributorInput input)
{
var entity = input.Adapt<Distributor>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 获取分销商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "Detail")]
public async Task<Distributor> Detail([FromQuery] QueryByIdDistributorInput input)
{
return await _rep.GetFirstAsync(u => u.Id == input.Id);
}
/// <summary>
/// 获取分销商列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "List")]
public async Task<List<DistributorOutput>> List()
{
return await _rep.AsQueryable().Select<DistributorOutput>().ToListAsync();
}
}

View File

@ -0,0 +1,108 @@
namespace Admin.NET.Application;
/// <summary>
/// 分销商输出参数
/// </summary>
public class DistributorDto
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string? CodeNum { get; set; }
/// <summary>
/// 简称
/// </summary>
public string? SorName { get; set; }
/// <summary>
/// 状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 所有者账号
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string? Brand { get; set; }
/// <summary>
/// 上级分销商
/// </summary>
public string? SuperiorDistributor { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { 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; }
}

View File

@ -0,0 +1,214 @@
using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application;
/// <summary>
/// 分销商基础输入参数
/// </summary>
public class DistributorBaseInput
{
/// <summary>
/// 名称
/// </summary>
public virtual string? Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public virtual string? CodeNum { get; set; }
/// <summary>
/// 简称
/// </summary>
public virtual string? SorName { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual int? Status { get; set; }
/// <summary>
/// 联系人
/// </summary>
public virtual string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public virtual string? Tel { get; set; }
/// <summary>
/// 所有者账号
/// </summary>
public virtual string? UserName { get; set; }
/// <summary>
/// 品牌
/// </summary>
public virtual string? Brand { get; set; }
/// <summary>
/// 上级分销商
/// </summary>
public virtual string? SuperiorDistributor { get; set; }
/// <summary>
/// 地址
/// </summary>
public virtual string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long? TenantId { 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 DistributorInput : BasePageInput
{
/// <summary>
/// 关键字查询
/// </summary>
public string? SearchKey { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string? CodeNum { get; set; }
/// <summary>
/// 简称
/// </summary>
public string? SorName { get; set; }
/// <summary>
/// 状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 所有者账号
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string? Brand { get; set; }
/// <summary>
/// 上级分销商
/// </summary>
public string? SuperiorDistributor { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
}
/// <summary>
/// 分销商增加输入参数
/// </summary>
public class AddDistributorInput : DistributorBaseInput
{
/// <summary>
/// 软删除
/// </summary>
[Required(ErrorMessage = "软删除不能为空")]
public override bool IsDelete { get; set; }
}
/// <summary>
/// 分销商删除输入参数
/// </summary>
public class DeleteDistributorInput : BaseIdInput
{
}
/// <summary>
/// 分销商更新输入参数
/// </summary>
public class UpdateDistributorInput : DistributorBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 分销商主键查询输入参数
/// </summary>
public class QueryByIdDistributorInput : DeleteDistributorInput
{
}

View File

@ -0,0 +1,110 @@
namespace Admin.NET.Application;
/// <summary>
/// 分销商输出参数
/// </summary>
public class DistributorOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string? CodeNum { get; set; }
/// <summary>
/// 简称
/// </summary>
public string? SorName { get; set; }
/// <summary>
/// 状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 所有者账号
/// </summary>
public string? UserName { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string? Brand { get; set; }
/// <summary>
/// 上级分销商
/// </summary>
public string? SuperiorDistributor { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { 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; }
}

View File

@ -24,7 +24,7 @@ public class InvoiceService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<InvoiceOutput>> Page(InvoiceInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeNum.Contains(input.SearchKey.Trim())
|| u.BusinessType.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class MaterialClassifyService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<MaterialClassifyOutput>> Page(MaterialClassifyInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
)

View File

@ -24,7 +24,7 @@ public class OutboundService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<OutboundOutput>> Page(OutboundInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeNum.Contains(input.SearchKey.Trim())
|| u.SourceCodeNum.Contains(input.SearchKey.Trim())

View File

@ -26,7 +26,7 @@ public class PackageInfoService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<PackageInfoOutput>> Page(PackageInfoInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeTypeNum.Contains(input.SearchKey.Trim())
|| u.CodeType.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class PrintLabelService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<PrintLabelOutput>> Page(PrintLabelInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Unit.Contains(input.SearchKey.Trim())
|| u.PackageUnit.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class ProductBarCodeService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductBarCodeOutput>> Page(ProductBarCodeInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.BarCode.Contains(input.SearchKey.Trim())
|| u.ParentCode.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class ProductCodeConfigurationService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductCodeConfigurationOutput>> Page(ProductCodeConfigurationInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeType.Contains(input.SearchKey.Trim())
)

View File

@ -24,7 +24,7 @@ public class ProductionService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductionOutput>> Page(ProductionInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class ProductionTasksService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductionTasksOutput>> Page(ProductionTasksInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.OddNumber.Contains(input.SearchKey.Trim())
|| u.ProductType.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class ReportTableService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ReportTableOutput>> Page(ReportTableInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.OddNumber.Contains(input.SearchKey.Trim())
|| u.ProductType.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class SuppleInformationService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<SuppleInformationOutput>> Page(SuppleInformationInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class SuppleTypeService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<SuppleTypeOutput>> Page(SuppleTypeInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
)

View File

@ -0,0 +1,88 @@
namespace Admin.NET.Application;
/// <summary>
/// 供应商输出参数
/// </summary>
public class SupplierDto
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 企业类型
/// </summary>
public string? CompanyType { get; set; }
/// <summary>
/// 职务
/// </summary>
public string? Duties { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { 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; }
}

View File

@ -0,0 +1,174 @@
using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application;
/// <summary>
/// 供应商基础输入参数
/// </summary>
public class SupplierBaseInput
{
/// <summary>
/// 供应商名称
/// </summary>
public virtual string? Name { get; set; }
/// <summary>
/// 联系人
/// </summary>
public virtual string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public virtual string? Tel { get; set; }
/// <summary>
/// 企业类型
/// </summary>
public virtual string? CompanyType { get; set; }
/// <summary>
/// 职务
/// </summary>
public virtual string? Duties { get; set; }
/// <summary>
/// 地址
/// </summary>
public virtual string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long? TenantId { 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 SupplierInput : BasePageInput
{
/// <summary>
/// 关键字查询
/// </summary>
public string? SearchKey { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 企业类型
/// </summary>
public string? CompanyType { get; set; }
/// <summary>
/// 职务
/// </summary>
public string? Duties { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
}
/// <summary>
/// 供应商增加输入参数
/// </summary>
public class AddSupplierInput : SupplierBaseInput
{
/// <summary>
/// 软删除
/// </summary>
[Required(ErrorMessage = "软删除不能为空")]
public override bool IsDelete { get; set; }
}
/// <summary>
/// 供应商删除输入参数
/// </summary>
public class DeleteSupplierInput : BaseIdInput
{
}
/// <summary>
/// 供应商更新输入参数
/// </summary>
public class UpdateSupplierInput : SupplierBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 供应商主键查询输入参数
/// </summary>
public class QueryByIdSupplierInput : DeleteSupplierInput
{
}

View File

@ -0,0 +1,90 @@
namespace Admin.NET.Application;
/// <summary>
/// 供应商输出参数
/// </summary>
public class SupplierOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contacts { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// 企业类型
/// </summary>
public string? CompanyType { get; set; }
/// <summary>
/// 职务
/// </summary>
public string? Duties { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { 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; }
}

View File

@ -0,0 +1,118 @@
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 SupplierService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<Supplier> _rep;
public SupplierService(SqlSugarRepository<Supplier> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询供应商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<SupplierOutput>> Page(SupplierInput input)
{
var query = _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.Contacts.Contains(input.SearchKey.Trim())
|| u.Tel.Contains(input.SearchKey.Trim())
|| u.CompanyType.Contains(input.SearchKey.Trim())
|| u.Duties.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.Contacts), u => u.Contacts.Contains(input.Contacts.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.CompanyType), u => u.CompanyType.Contains(input.CompanyType.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Duties), u => u.Duties.Contains(input.Duties.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<SupplierOutput>();
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(AddSupplierInput input)
{
var entity = input.Adapt<Supplier>();
await _rep.InsertAsync(entity);
return entity.Id;
}
/// <summary>
/// 删除供应商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Delete")]
public async Task Delete(DeleteSupplierInput 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(UpdateSupplierInput input)
{
var entity = input.Adapt<Supplier>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 获取供应商
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "Detail")]
public async Task<Supplier> Detail([FromQuery] QueryByIdSupplierInput input)
{
return await _rep.GetFirstAsync(u => u.Id == input.Id);
}
/// <summary>
/// 获取供应商列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "List")]
public async Task<List<SupplierOutput>> List([FromQuery] SupplierInput input)
{
return await _rep.AsQueryable().Select<SupplierOutput>().ToListAsync();
}
}

View File

@ -25,7 +25,7 @@ public class SysUnitGroupService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<SysUnitGroupOutput>> Page(SysUnitGroupInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CreateOrgName.Contains(input.SearchKey.Trim())
|| u.Name.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class SysUnitService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<SysUnitOutput>> Page(SysUnitInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CreateOrgName.Contains(input.SearchKey.Trim())
|| u.Name.Contains(input.SearchKey.Trim())

View File

@ -25,7 +25,7 @@ public class UrlInfoService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<UrlInfoOutput>> Page(UrlInfoInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.Url.Contains(input.SearchKey.Trim())

View File

@ -25,7 +25,7 @@ public class UrlTypeService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<UrlTypeOutput>> Page(UrlTypeInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.Remarks.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class WarehouseService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<WarehouseOutput>> Page(WarehouseInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.CodeNum.Contains(input.SearchKey.Trim())

View File

@ -24,7 +24,7 @@ public class WarehousingService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<WarehousingOutput>> Page(WarehousingInput input)
{
var query = _rep.AsQueryable()
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.CodeNum.Contains(input.SearchKey.Trim())
|| u.BusinessType.Contains(input.SearchKey.Trim())

View File

@ -13,7 +13,6 @@ public class WebComponent : IWebComponent
{
return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information;
});
// 设置接口超时时间和上传大小
builder.Configuration.Get<WebHostBuilder>().ConfigureKestrel(u =>
{

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddWarehousing = '/api/warehousing/add',
DeleteWarehousing = '/api/warehousing/delete',
UpdateWarehousing = '/api/warehousing/update',
PageWarehousing = '/api/warehousing/page',
DetailWarehousing = '/api/warehousing/detail',
}
// 增加入库单
export const addWarehousing = (params?: any) =>
request({
url: Api.AddWarehousing,
method: 'post',
data: params,
});
// 删除入库单
export const deleteWarehousing = (params?: any) =>
request({
url: Api.DeleteWarehousing,
method: 'post',
data: params,
});
// 编辑入库单
export const updateWarehousing = (params?: any) =>
request({
url: Api.UpdateWarehousing,
method: 'post',
data: params,
});
// 分页查询入库单
export const pageWarehousing = (params?: any) =>
request({
url: Api.PageWarehousing,
method: 'post',
data: params,
});
// 详情入库单
export const detailWarehousing = (id: any) =>
request({
url: Api.DetailWarehousing,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,163 @@
<template>
<div class="warehousing-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="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="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="supplier">
<el-input v-model="ruleForm.supplier" 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="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 { addWarehousing, updateWarehousing, detailWarehousing } from "/@/api/main/warehousing";
//
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 detailWarehousing(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 addWarehousing(values);
} else {
await updateWarehousing(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,221 @@
<template>
<div class="warehousing-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.codeNum" 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-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" />
</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.state" 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.businessType" 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.supplier" 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.examinerId" 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="'warehousing: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="openAddWarehousing" v-auth="'warehousing: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="codeNum" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="businessType" label="业务类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="supplier" label="供货单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="examinerId" 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('warehousing:update') || auth('warehousing:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWarehousing(scope.row)" v-auth="'warehousing:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWarehousing(scope.row)" v-auth="'warehousing: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="printWarehousingTitle"
@reloadTable="handleQuery" />
<editDialog
ref="editDialogRef"
:title="editWarehousingTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="warehousing">
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/system/print/component/hiprint/preview.vue'
import editDialog from '/@/views/main/warehousing/component/editDialog.vue'
import { pageWarehousing, deleteWarehousing } from '/@/api/main/warehousing';
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 printWarehousingTitle = ref("");
const editWarehousingTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageWarehousing(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 openAddWarehousing = () => {
editWarehousingTitle.value = '添加入库单';
editDialogRef.value.openDialog({});
};
//
const openPrintWarehousing = async (row: any) => {
printWarehousingTitle.value = '打印入库单';
}
//
const openEditWarehousing = (row: any) => {
editWarehousingTitle.value = '编辑入库单';
editDialogRef.value.openDialog(row);
};
//
const delWarehousing = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteWarehousing(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>

View File

@ -2,4 +2,4 @@
ENV = development
# 本地环境接口地址http://localhost:5005 http://139.199.191.197:9005
VITE_API_URL = http://139.199.191.197:9005
VITE_API_URL = http://localhost:5005

BIN
Web/src.zip 100644

Binary file not shown.

View File

@ -179,4 +179,5 @@ export interface AddSysUnitInput {
* @memberof AddSysUnitInput
*/
isEnable: boolean;
}

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddBrand = '/api/brand/add',
DeleteBrand = '/api/brand/delete',
UpdateBrand = '/api/brand/update',
PageBrand = '/api/brand/page',
DetailBrand = '/api/brand/detail',
}
// 增加品牌
export const addBrand = (params?: any) =>
request({
url: Api.AddBrand,
method: 'post',
data: params,
});
// 删除品牌
export const deleteBrand = (params?: any) =>
request({
url: Api.DeleteBrand,
method: 'post',
data: params,
});
// 编辑品牌
export const updateBrand = (params?: any) =>
request({
url: Api.UpdateBrand,
method: 'post',
data: params,
});
// 分页查询品牌
export const pageBrand = (params?: any) =>
request({
url: Api.PageBrand,
method: 'post',
data: params,
});
// 详情品牌
export const detailBrand = (id: any) =>
request({
url: Api.DetailBrand,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,102 @@
import request from '/@/utils/request';
enum Api {
AddCustom = '/api/custom/add',
DeleteCustom = '/api/custom/delete',
UpdateCustom = '/api/custom/update',
PageCustom = '/api/custom/page',
DetailCustom = '/api/custom/detail',
}
enum ClassifyApi {
AddCustom = '/api/custonClassify/add',
DeleteCustom = '/api/custonClassify/delete',
UpdateCustom = '/api/custonClassify/update',
PageCustom = '/api/custonClassify/page',
DetailCustom = '/api/custonClassify/detail',
List = '/api/custonClassify/list',
}
// 增加客户
export const addCustom = (params?: any) =>
request({
url: Api.AddCustom,
method: 'post',
data: params,
});
// 删除客户
export const deleteCustom = (params?: any) =>
request({
url: Api.DeleteCustom,
method: 'post',
data: params,
});
// 编辑客户
export const updateCustom = (params?: any) =>
request({
url: Api.UpdateCustom,
method: 'post',
data: params,
});
// 分页查询客户
export const pageCustom = (params?: any) =>
request({
url: Api.PageCustom,
method: 'post',
data: params,
});
// 详情客户
export const detailCustom = (id: any) =>
request({
url: Api.DetailCustom,
method: 'get',
data: { id },
});
// 增加客户类型
export const addCustomClassify = (params?: any) =>
request({
url: ClassifyApi.AddCustom,
method: 'post',
data: params,
});
// 删除客户类型
export const deleteCustomClassify = (params?: any) =>
request({
url: ClassifyApi.DeleteCustom,
method: 'post',
data: params,
});
// 编辑客户类型
export const updateCustomClassify = (params?: any) =>
request({
url: ClassifyApi.UpdateCustom,
method: 'post',
data: params,
});
// 分页查询客户类型
export const pageCustomClassify = (params?: any) =>
request({
url: ClassifyApi.PageCustom,
method: 'post',
data: params,
});
// 详情客户类型
export const detailCustomClassify = (id: any) =>
request({
url: ClassifyApi.DetailCustom,
method: 'get',
data: { id },
});
// 客户类型列表
export const listCustomClassify = (params?: any) =>
request({
url: ClassifyApi.List,
method: 'post',
data: params,
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddDistributor = '/api/distributor/add',
DeleteDistributor = '/api/distributor/delete',
UpdateDistributor = '/api/distributor/update',
PageDistributor = '/api/distributor/page',
DetailDistributor = '/api/distributor/detail',
}
// 增加分销商
export const addDistributor = (params?: any) =>
request({
url: Api.AddDistributor,
method: 'post',
data: params,
});
// 删除分销商
export const deleteDistributor = (params?: any) =>
request({
url: Api.DeleteDistributor,
method: 'post',
data: params,
});
// 编辑分销商
export const updateDistributor = (params?: any) =>
request({
url: Api.UpdateDistributor,
method: 'post',
data: params,
});
// 分页查询分销商
export const pageDistributor = (params?: any) =>
request({
url: Api.PageDistributor,
method: 'post',
data: params,
});
// 详情分销商
export const detailDistributor = (id: any) =>
request({
url: Api.DetailDistributor,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddProduction = '/api/production/add',
DeleteProduction = '/api/production/delete',
UpdateProduction = '/api/production/update',
PageProduction = '/api/production/page',
DetailProduction = '/api/production/detail',
}
// 增加生产组织
export const addProduction = (params?: any) =>
request({
url: Api.AddProduction,
method: 'post',
data: params,
});
// 删除生产组织
export const deleteProduction = (params?: any) =>
request({
url: Api.DeleteProduction,
method: 'post',
data: params,
});
// 编辑生产组织
export const updateProduction = (params?: any) =>
request({
url: Api.UpdateProduction,
method: 'post',
data: params,
});
// 分页查询生产组织
export const pageProduction = (params?: any) =>
request({
url: Api.PageProduction,
method: 'post',
data: params,
});
// 详情生产组织
export const detailProduction = (id: any) =>
request({
url: Api.DetailProduction,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddProductionTasks = '/api/productionTasks/add',
DeleteProductionTasks = '/api/productionTasks/delete',
UpdateProductionTasks = '/api/productionTasks/update',
PageProductionTasks = '/api/productionTasks/page',
DetailProductionTasks = '/api/productionTasks/detail',
}
// 增加生产任务单
export const addProductionTasks = (params?: any) =>
request({
url: Api.AddProductionTasks,
method: 'post',
data: params,
});
// 删除生产任务单
export const deleteProductionTasks = (params?: any) =>
request({
url: Api.DeleteProductionTasks,
method: 'post',
data: params,
});
// 编辑生产任务单
export const updateProductionTasks = (params?: any) =>
request({
url: Api.UpdateProductionTasks,
method: 'post',
data: params,
});
// 分页查询生产任务单
export const pageProductionTasks = (params?: any) =>
request({
url: Api.PageProductionTasks,
method: 'post',
data: params,
});
// 详情生产任务单
export const detailProductionTasks = (id: any) =>
request({
url: Api.DetailProductionTasks,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddReportTable = '/api/reportTable/add',
DeleteReportTable = '/api/reportTable/delete',
UpdateReportTable = '/api/reportTable/update',
PageReportTable = '/api/reportTable/page',
DetailReportTable = '/api/reportTable/detail',
}
// 增加汇报单
export const addReportTable = (params?: any) =>
request({
url: Api.AddReportTable,
method: 'post',
data: params,
});
// 删除汇报单
export const deleteReportTable = (params?: any) =>
request({
url: Api.DeleteReportTable,
method: 'post',
data: params,
});
// 编辑汇报单
export const updateReportTable = (params?: any) =>
request({
url: Api.UpdateReportTable,
method: 'post',
data: params,
});
// 分页查询汇报单
export const pageReportTable = (params?: any) =>
request({
url: Api.PageReportTable,
method: 'post',
data: params,
});
// 详情汇报单
export const detailReportTable = (id: any) =>
request({
url: Api.DetailReportTable,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddSuppleInformation = '/api/suppleInformation/add',
DeleteSuppleInformation = '/api/suppleInformation/delete',
UpdateSuppleInformation = '/api/suppleInformation/update',
PageSuppleInformation = '/api/suppleInformation/page',
DetailSuppleInformation = '/api/suppleInformation/detail',
}
// 增加辅助资料
export const addSuppleInformation = (params?: any) =>
request({
url: Api.AddSuppleInformation,
method: 'post',
data: params,
});
// 删除辅助资料
export const deleteSuppleInformation = (params?: any) =>
request({
url: Api.DeleteSuppleInformation,
method: 'post',
data: params,
});
// 编辑辅助资料
export const updateSuppleInformation = (params?: any) =>
request({
url: Api.UpdateSuppleInformation,
method: 'post',
data: params,
});
// 分页查询辅助资料
export const pageSuppleInformation = (params?: any) =>
request({
url: Api.PageSuppleInformation,
method: 'post',
data: params,
});
// 详情辅助资料
export const detailSuppleInformation = (id: any) =>
request({
url: Api.DetailSuppleInformation,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddSupplier = '/api/supplier/add',
DeleteSupplier = '/api/supplier/delete',
UpdateSupplier = '/api/supplier/update',
PageSupplier = '/api/supplier/page',
DetailSupplier = '/api/supplier/detail',
}
// 增加供应商
export const addSupplier = (params?: any) =>
request({
url: Api.AddSupplier,
method: 'post',
data: params,
});
// 删除供应商
export const deleteSupplier = (params?: any) =>
request({
url: Api.DeleteSupplier,
method: 'post',
data: params,
});
// 编辑供应商
export const updateSupplier = (params?: any) =>
request({
url: Api.UpdateSupplier,
method: 'post',
data: params,
});
// 分页查询供应商
export const pageSupplier = (params?: any) =>
request({
url: Api.PageSupplier,
method: 'post',
data: params,
});
// 详情供应商
export const detailSupplier = (id: any) =>
request({
url: Api.DetailSupplier,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddWarehouse = '/api/warehouse/add',
DeleteWarehouse = '/api/warehouse/delete',
UpdateWarehouse = '/api/warehouse/update',
PageWarehouse = '/api/warehouse/page',
DetailWarehouse = '/api/warehouse/detail',
}
// 增加仓库
export const addWarehouse = (params?: any) =>
request({
url: Api.AddWarehouse,
method: 'post',
data: params,
});
// 删除仓库
export const deleteWarehouse = (params?: any) =>
request({
url: Api.DeleteWarehouse,
method: 'post',
data: params,
});
// 编辑仓库
export const updateWarehouse = (params?: any) =>
request({
url: Api.UpdateWarehouse,
method: 'post',
data: params,
});
// 分页查询仓库
export const pageWarehouse = (params?: any) =>
request({
url: Api.PageWarehouse,
method: 'post',
data: params,
});
// 详情仓库
export const detailWarehouse = (id: any) =>
request({
url: Api.DetailWarehouse,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,50 @@
import request from '/@/utils/request';
enum Api {
AddWarehousing = '/api/warehousing/add',
DeleteWarehousing = '/api/warehousing/delete',
UpdateWarehousing = '/api/warehousing/update',
PageWarehousing = '/api/warehousing/page',
DetailWarehousing = '/api/warehousing/detail',
}
// 增加入库单
export const addWarehousing = (params?: any) =>
request({
url: Api.AddWarehousing,
method: 'post',
data: params,
});
// 删除入库单
export const deleteWarehousing = (params?: any) =>
request({
url: Api.DeleteWarehousing,
method: 'post',
data: params,
});
// 编辑入库单
export const updateWarehousing = (params?: any) =>
request({
url: Api.UpdateWarehousing,
method: 'post',
data: params,
});
// 分页查询入库单
export const pageWarehousing = (params?: any) =>
request({
url: Api.PageWarehousing,
method: 'post',
data: params,
});
// 详情入库单
export const detailWarehousing = (id: any) =>
request({
url: Api.DetailWarehousing,
method: 'get',
data: { id },
});

View File

@ -0,0 +1,152 @@
<template>
<div class="brand-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="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="officialAccount">
<el-input v-model="ruleForm.officialAccount" 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="isEnable">
<el-switch v-model="ruleForm.isEnable" active-text="" inactive-text="" />
</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="64" 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 { addBrand, updateBrand, detailBrand } from "/@/api/main/brand";
//
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>({
name: [{required: true, message: '请输入名称!', trigger: 'blur',},],
});
//
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 detailBrand(rowData.id)).data.result;
else{
ruleForm.value = rowData;
ruleForm.value.isEnable = true;
}
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 addBrand(values);
} else {
await updateBrand(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -1,145 +1,201 @@
<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.isEnable" placeholder="请选择" clearable>
<el-option label="启用" value="0" />
<el-option label="禁用" value="1" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称">
<el-input v-model="formInline.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码">
<el-input v-model="formInline.codeNum" 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-form-item>
</el-form>
</div>
<template>
<div class="brand-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.codeNum" 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.officialAccount" 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-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="'brand: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="openAddBrand" v-auth="'brand: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="200" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="officialAccount" label="公众号" width="140" show-overflow-tooltip="" />
<el-table-column prop="isEnable" label="可用状态" width="120" show-overflow-tooltip="">
<template #default="scope">
<el-tag v-if="scope.row.isEnable"> </el-tag>
<el-tag type="danger" v-else> </el-tag>
</template>
</el-table-column>
<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('brand:update') || auth('brand:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditBrand(scope.row)" v-auth="'brand:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delBrand(scope.row)" v-auth="'brand: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"
/>
<div class="main-table common-box">
<div class="tab">
<vxe-table show-overflow height="100%" :data="brandDate" :border=true :tree-config="{ transform: true }"
:scroll-y="{ gt: 20 }">
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
<vxe-column field="codeNum" sortable title="编码" width=""></vxe-column>
<vxe-column field="name" sortable title="名称" width=""></vxe-column>
<vxe-column field="b" sortable title="公众号" width=""></vxe-column>
<vxe-column field="isEnable" sortable title="可用状态" width=""></vxe-column>
<vxe-column field="remarks" sortable title="备注" width=""></vxe-column>
<vxe-column field="createUserName" sortable title="创建人" width=""></vxe-column>
<vxe-column field="createTime" sortable title="创建时间" width=""></vxe-column>
<vxe-column field="updateTime" 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>
</div>
<div>
<vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"
:total="pageVO1.total" />
</div>
</div>
</div>
<editDialog
ref="editDialogRef"
:title="editBrandTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive,ref } from 'vue'
import { BrandApi, BrandOutput } from '/@/api-services';
import { getAPI } from '/@/utils/axios-utils';
<script lang="ts" setup="" name="brand">
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 editDialog from '/@/views/basics-date/brand/component/editDialog.vue'
import { pageBrand, deleteBrand } from '/@/api/main/brand';
//
let brandDate = ref([] as BrandOutput[])
const getBrand = async() => {
let res = await getAPI(BrandApi).apiBrandPagePost();
brandDate.value = res.data.result?.items!;
pageVO1.total = res.data.result?.total!;
}
onMounted(() => {
getBrand()
})
const formInline = reactive({
name:'',//
isEnable:"",//
codeNum:'',//
})
const onSubmit = () => {
console.log('submit!')
}
const pageVO1 = reactive({
currentPage: 1,
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
})
total: 0,
});
const printBrandTitle = ref("");
const editBrandTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageBrand(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 openAddBrand = () => {
editBrandTitle.value = '添加品牌';
editDialogRef.value.openDialog({});
};
//
const openEditBrand = (row: any) => {
editBrandTitle.value = '编辑品牌';
editDialogRef.value.openDialog(row);
};
//
const delBrand = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteBrand(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>
</style>

View File

@ -0,0 +1,123 @@
<template>
<div class="custom-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-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 { addCustomClassify, updateCustomClassify, detailCustomClassify } from "/@/api/main/custom";
//
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>({
name: [{required: true, message: '请输入名称!', trigger: 'blur',},],
classify: [{required: true, message: '请输入分类!', trigger: 'blur',},],
contacts: [{required: true, message: '请输入联系人!', trigger: 'blur',},],
});
//
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 detailCustomClassify(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 addCustomClassify(values);
} else {
await updateCustomClassify(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,196 @@
<template>
<div class="custom-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="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="分类" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.classify" placeholder="请选择" clearable>
<el-option :label="item.name" :value="item.id" v-for="item, index in fyListData"
: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="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="expandField">
<el-input-number v-model="ruleForm.expandField" 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="contacts">
<el-input v-model="ruleForm.contacts" 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="brand">
<el-input v-model="ruleForm.brand" 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="externalNumber">
<el-input v-model="ruleForm.externalNumber" 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="isEnable">
<el-switch v-model="ruleForm.isEnable" active-text="" inactive-text="" />
</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 { addCustom, updateCustom, detailCustom } from "/@/api/main/custom";
import { getAPI } from '/@/utils/axios-utils';
import { CustonClassifyApi } from '/@/api-services/api';
import { MaterialsOutput} from '/@/api-services/models';
//
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>({
name: [{required: true, message: '请输入名称!', trigger: 'blur',},],
classify: [{required: true, message: '请输入分类!', trigger: 'blur',},],
contacts: [{required: true, message: '请输入联系人!', trigger: 'blur',},],
});
//
let fyListData = ref();
const fyListGet = async () => {
let res = await getAPI(CustonClassifyApi).apiCustonClassifyListGet();
if (res.data.code === 200) {
fyListData.value = res.data.result;
}
}
//
const openDialog = async (row: any) => {
// ruleForm.value = JSON.parse(JSON.stringify(row));
// detail
fyListGet();
let rowData = JSON.parse(JSON.stringify(row));
if (rowData.id)
ruleForm.value = (await detailCustom(rowData.id)).data.result;
else{
ruleForm.value = rowData;
ruleForm.value.isEnable = true;
}
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 addCustom(values);
} else {
await updateCustom(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,233 @@
<template>
<div class="custom-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.codeNum" 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="48" :sm="24" :md="12" :lg="8" :xl="4" class="mb20" v-if="showAdvanceQueryUI">
<el-form-item label="拓展字段整型">
<el-input-number v-model="queryParams.expandField" 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.contacts" 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.brand" 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.externalNumber" 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-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="'custom: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="openAddCustomClassify" v-auth="'custom:add'"> </el-button>
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddCustom" v-auth="'custom: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="240" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="isEnable" label="可用状态" width="120" show-overflow-tooltip="">
<template #default="scope">
<el-tag v-if="scope.row.isEnable"> </el-tag>
<el-tag type="danger" v-else> </el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="classify" label="分类" width="140" show-overflow-tooltip="" /> -->
<el-table-column prop="age" label="年龄" width="60" show-overflow-tooltip="" />
<el-table-column prop="contacts" label="联系人" width="140" show-overflow-tooltip="" />
<el-table-column prop="brand" label="品牌" width="240" show-overflow-tooltip="" />
<el-table-column prop="externalNumber" label="外部编码" width="" show-overflow-tooltip="" />
<el-table-column prop="expandField" label="拓展字段整型" width="" show-overflow-tooltip="" />
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('custom:update') || auth('custom:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditCustom(scope.row)" v-auth="'custom:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delCustom(scope.row)" v-auth="'custom: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"
/>
<editDialog
ref="editDialogRef"
:title="editCustomTitle"
@reloadTable="handleQuery"
/>
<editClassifyDialog
ref="editClassifyDialogRef"
:title="editCustomClassifyTitle"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="custom">
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 editClassifyDialog from '/@/views/basics-date/custom/component/editClassifyDialog.vue'
import editDialog from '/@/views/basics-date/custom/component/editDialog.vue'
import { pageCustom, deleteCustom } from '/@/api/main/custom';
const showAdvanceQueryUI = ref(false);
const editDialogRef = ref();
const editClassifyDialogRef = ref();
const loading = ref(false);
const tableData = ref<any>([]);
const queryParams = ref<any>({});
const tableParams = ref({
page: 1,
pageSize: 10,
total: 0,
});
const editCustomTitle = ref("");
const editCustomClassifyTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageCustom(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 openAddCustom = () => {
editCustomTitle.value = '添加客户';
editDialogRef.value.openDialog({});
};
//
const openAddCustomClassify = () => {
editCustomClassifyTitle.value = '添加客户类型';
editClassifyDialogRef.value.openDialog({});
};
//
const openEditCustom = (row: any) => {
editCustomTitle.value = '编辑客户';
editDialogRef.value.openDialog(row);
};
//
const delCustom = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteCustom(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>

View File

@ -1,205 +0,0 @@
<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.isEnable" placeholder="请选择" clearable>
<el-option label="启用" value="0" />
<el-option label="禁用" value="1" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称">
<el-input v-model="formInline.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码">
<el-input v-model="formInline.codeNum" 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>
<div class="main-table common-box">
<div class="tab-hed">
<el-select v-model="formInline.checked" placeholder="分类" clearable style="width: 200px;">
<el-option label="所有" value="0" />
<el-option :label="item.name" :value="item.id" v-for="item,index in getCustonClassDate" :key="index"/>
</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="customDate" :border=true :tree-config="{ transform: true }"
:scroll-y="{ gt: 20 }">
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
<vxe-column field="codeNum" sortable title="编码" width="120"></vxe-column>
<vxe-column field="name" sortable title="名称" width="120"></vxe-column>
<vxe-column field="classify" sortable title="分类" width="120"></vxe-column>
<vxe-column field="age" sortable title="年龄" width="120"></vxe-column>
<vxe-column field="expandField" sortable title="客户扩展字段整形2" width="180"></vxe-column>
<vxe-column field="contactse" sortable title="联系人" width="120"></vxe-column>
<vxe-column field="brand" sortable title="品牌" width="120"></vxe-column>
<vxe-column field="externalNumberf" sortable title="外部编号" width="150"></vxe-column>
<vxe-column field="isEnable" sortable title="可用状态" width="120"></vxe-column>
<vxe-column field="f" sortable title="手机" width="120"></vxe-column>
<vxe-column field="f" sortable title="微信" width="120"></vxe-column>
<vxe-column field="f" sortable title="所在地区" width="120"></vxe-column>
<vxe-column field="f" sortable title="备注" width="120"></vxe-column>
<vxe-column field="createUserName" sortable title="创建人" width="120"></vxe-column>
<vxe-column field="createTime" sortable title="创建时间" width="120"></vxe-column>
<vxe-column field="updateTime" sortable title="同步时间" width="120"></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>
</div>
<div>
<vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"
:total="pageVO1.total" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive,ref } from 'vue'
import { getAPI } from '/@/utils/axios-utils';
import { CustomApi, CustonClassifyApi } from '/@/api-services/api';
import { CustomOutput, CustonClassifyOutput } from '/@/api-services/models';
//
let getCustonClassDate = ref([] as CustonClassifyOutput[]);
const getCustonClass = async() => {
let res = await getAPI(CustonClassifyApi).apiCustonClassifyListGet();
getCustonClassDate.value = res.data.result!;
}
//
let customDate = ref([] as CustomOutput[]);
const getCustom = async() => {
let res = await getAPI(CustomApi).apiCustomPagePost();
customDate.value = res.data.result?.items!;
pageVO1.total = res.data.result?.total!;
}
onMounted(() => {
getCustonClass()
getCustom()
})
const formInline = reactive({
name:'',//
isEnable:"",//
codeNum:'',//
checked:''
})
const onSubmit = () => {
console.log('submit!')
}
const tableData = ref([
])
const pageVO1 = reactive({
currentPage: 1,
pageSize: 10,
total: 0
})
</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>

View File

@ -0,0 +1,191 @@
<template>
<div class="distributor-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="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="sorName">
<el-input v-model="ruleForm.sorName" 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="status">
<el-input-number v-model="ruleForm.status" 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="contacts">
<el-input v-model="ruleForm.contacts" 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="userName">
<el-input v-model="ruleForm.userName" 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="brand">
<el-input v-model="ruleForm.brand" 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="superiorDistributor">
<el-input v-model="ruleForm.superiorDistributor" 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="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" 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 { addDistributor, updateDistributor, detailDistributor } from "/@/api/main/distributor";
//
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 detailDistributor(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 addDistributor(values);
} else {
await updateDistributor(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,238 @@
<template>
<div class="distributor-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.codeNum" 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.sorName" 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.status" 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.contacts" 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.userName" 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.brand" 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.superiorDistributor" 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="'distributor: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="openAddDistributor" v-auth="'distributor: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="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="sorName" label="简称" width="140" show-overflow-tooltip="" />
<el-table-column prop="status" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="contacts" label="联系人" width="140" show-overflow-tooltip="" />
<el-table-column prop="tel" label="电话" width="140" show-overflow-tooltip="" />
<el-table-column prop="userName" label="所有者账号" width="140" show-overflow-tooltip="" />
<el-table-column prop="brand" label="品牌" width="140" show-overflow-tooltip="" />
<el-table-column prop="superiorDistributor" label="上级分销商" width="140" show-overflow-tooltip="" />
<el-table-column prop="address" label="地址" 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('distributor:update') || auth('distributor:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditDistributor(scope.row)" v-auth="'distributor:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delDistributor(scope.row)" v-auth="'distributor: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"
/>
<editDialog
ref="editDialogRef"
:title="editDistributorTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="distributor">
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 editDialog from '/@/views/basics-date/distributor/component/editDialog.vue'
import { pageDistributor, deleteDistributor } from '/@/api/main/distributor';
const showAdvanceQueryUI = ref(false);
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 editDistributorTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageDistributor(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 openAddDistributor = () => {
editDistributorTitle.value = '添加分销商';
editDialogRef.value.openDialog({});
};
//
const openEditDistributor = (row: any) => {
editDistributorTitle.value = '编辑分销商';
editDialogRef.value.openDialog(row);
};
//
const delDistributor = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteDistributor(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>

View File

@ -1,138 +0,0 @@
<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.isEnable" placeholder="请选择" clearable>
<el-option label="启用" value="0" />
<el-option label="禁用" value="1" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称">
<el-input v-model="formInline.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码">
<el-input v-model="formInline.codeNum" 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"></el-button>
<el-button @click="onSubmit"></el-button>
<el-button @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="main-table common-box">
<div class="tab">
<vxe-table show-overflow height="100%" :data="warehouseDate" :border=true :tree-config="{ transform: true }"
:scroll-y="{ gt: 20 }">
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
<vxe-column field="codeNum" sortable title="编码" width=""></vxe-column>
<vxe-column field="name" sortable title="名称" width=""></vxe-column>
<vxe-column sortable title="可用状态" width="">
<template #default="{ row }">
{{ row.isEnable ? '启用' : '关闭' }}
</template>
</vxe-column>
<vxe-column field="barCode" sortable title="仓库条码" width=""></vxe-column>
<vxe-column field="createTime" sortable title="创建时间" width=""></vxe-column>
<vxe-column field="f" sortable title="仓库扩展字符串扩展字段1" 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>
</div>
<div >
<vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"
:total="pageVO1.total" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive,ref } from 'vue'
import { getAPI } from '/@/utils/axios-utils';
import { WarehouseApi } from '/@/api-services/api';
import { WarehouseOutput } from '/@/api-services/models';
const formInline = reactive({
name:'',//
isEnable:"",//
codeNum:'',//
})
//
let warehouseDate = ref([] as WarehouseOutput[])
const WarehousePage = async () => {
let res = await getAPI(WarehouseApi).apiWarehousePagePost();
warehouseDate.value = res.data.result?.items!;
pageVO1.total = res.data.result?.total!;
}
const onSubmit = () => {
console.log('submit!')
}
const pageVO1 = reactive({
currentPage: 1,
pageSize: 10,
total: 0
})
onMounted(() => {
WarehousePage()
})
</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;
}
}
}
</style>

View File

@ -0,0 +1,149 @@
<template>
<div class="suppleInformation-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="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="type">
<el-input v-model="ruleForm.type" placeholder="请输入类型" maxlength="20" 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="isEnable">
<el-switch v-model="ruleForm.isEnable" active-text="" inactive-text="" />
</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="64" 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 { addSuppleInformation, updateSuppleInformation, detailSuppleInformation } from "/@/api/main/suppleInformation";
//
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 detailSuppleInformation(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 addSuppleInformation(values);
} else {
await updateSuppleInformation(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,200 @@
<template>
<div class="suppleInformation-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.codeNum" 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.type" 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-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="'suppleInformation: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="openAddSuppleInformation" v-auth="'suppleInformation: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="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="type" label="类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="isEnable" label="可用状态" width="120" show-overflow-tooltip="">
<template #default="scope">
<el-tag v-if="scope.row.isEnable"> </el-tag>
<el-tag type="danger" v-else> </el-tag>
</template>
</el-table-column>
<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('suppleInformation:update') || auth('suppleInformation:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditSuppleInformation(scope.row)" v-auth="'suppleInformation:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delSuppleInformation(scope.row)" v-auth="'suppleInformation: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"
/>
<editDialog
ref="editDialogRef"
:title="editSuppleInformationTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="suppleInformation">
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 editDialog from '/@/views/basics-date/suppleInformation/component/editDialog.vue'
import { pageSuppleInformation, deleteSuppleInformation } from '/@/api/main/suppleInformation';
const showAdvanceQueryUI = ref(false);
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 editSuppleInformationTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageSuppleInformation(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 openAddSuppleInformation = () => {
editSuppleInformationTitle.value = '添加辅助资料';
editDialogRef.value.openDialog({});
};
//
const openEditSuppleInformation = (row: any) => {
editSuppleInformationTitle.value = '编辑辅助资料';
editDialogRef.value.openDialog(row);
};
//
const delSuppleInformation = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteSuppleInformation(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>

View File

@ -0,0 +1,163 @@
<template>
<div class="supplier-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="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="contacts">
<el-input v-model="ruleForm.contacts" 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="companyType">
<el-input v-model="ruleForm.companyType" 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="duties">
<el-input v-model="ruleForm.duties" 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="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 { addSupplier, updateSupplier, detailSupplier } from "/@/api/main/supplier";
//
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 detailSupplier(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 addSupplier(values);
} else {
await updateSupplier(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,212 @@
<template>
<div class="supplier-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.contacts" 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.companyType" 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.duties" 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="'supplier: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="openAddSupplier" v-auth="'supplier: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="contacts" label="联系人" width="140" show-overflow-tooltip="" />
<el-table-column prop="tel" label="电话" width="140" show-overflow-tooltip="" />
<el-table-column prop="companyType" label="企业类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="duties" label="职务" width="140" show-overflow-tooltip="" />
<el-table-column prop="address" label="地址" 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('supplier:update') || auth('supplier:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditSupplier(scope.row)" v-auth="'supplier:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delSupplier(scope.row)" v-auth="'supplier: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"
/>
<editDialog
ref="editDialogRef"
:title="editSupplierTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="supplier">
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 editDialog from '/@/views/basics-date/supplier/component/editDialog.vue'
import { pageSupplier, deleteSupplier } from '/@/api/main/supplier';
const showAdvanceQueryUI = ref(false);
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 editSupplierTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageSupplier(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 openAddSupplier = () => {
editSupplierTitle.value = '添加供应商';
editDialogRef.value.openDialog({});
};
//
const openEditSupplier = (row: any) => {
editSupplierTitle.value = '编辑供应商';
editDialogRef.value.openDialog(row);
};
//
const delSupplier = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteSupplier(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>

View File

@ -18,9 +18,9 @@
<el-form-item>
<el-button type="primary" @click="unitPage"></el-button>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="onSubmit"></el-button>
<el-button @click="onSubmit"></el-button>
<el-button type="primary" @click="addUnit"></el-button>
<el-button @click="''"></el-button>
<el-button @click="''"></el-button>
</el-form-item>
</el-form>
</div>
@ -37,38 +37,29 @@
<el-button type="success" link
@click.prevent="addUnitGroup"
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 style="height: 100%;">
<vxe-table show-overflow height="100%" :data="data.unitGroup" :border=true
:tree-config="{ transform: true }" :scroll-y="{ gt: 20 }" @radio-change="radioChangeEvent">
<vxe-column type="radio" title="单选" width="80" fixed="left">
<vxe-column type="radio" title="单选" width="60" fixed="left">
</vxe-column>
<vxe-column field="name" sortable title="名称" width=""></vxe-column>
<vxe-column title="状态" width="80" fixed="right" show-overflow>
<vxe-column title="状态" width="60" fixed="right" show-overflow>
<template #default="{ row }">
{{ row.isEnable ? '启用' : '关闭' }}
<!-- <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> -->
</template>
</vxe-column>
<vxe-column title="操作" width="150" fixed="right" show-overflow>
<template #default="{ row }">
<vxe-button type="text" @click="editUnitGroup(row)" icon="vxe-icon-edit">修改</vxe-button>
<vxe-button type="text" @click="deleteUnitGroup(row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>
<!-- <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> -->
</template>
</vxe-column>
</vxe-table>
</div>
</div>
@ -97,9 +88,8 @@
</vxe-column>
<vxe-column title="操作" width="200" fixed="right" show-overflow>
<template #default="{ row }">
<vxe-button type="text">查看</vxe-button>
<vxe-button type="text">修改</vxe-button>
<vxe-button type="text">删除</vxe-button>
<vxe-button type="text" @click="editUnit(row)" icon="vxe-icon-edit">修改</vxe-button>
<vxe-button type="text" @click="deleteUnit(row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>
<!-- <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> -->
</template>
</vxe-column>
@ -118,17 +108,17 @@
<el-row>
<el-col :span="8">
<el-form-item label="名称">
<el-form-item label="名称" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码">
<el-form-item label="编码" :rules="[{ required: true, message: '编码不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.codeNum" placeholder="请输入编码" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位组">
<el-form-item label="单位组" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
<el-select v-model="unitFrom.groupUnitId" placeholder="请选择" clearable>
<el-option :label="item.name" :value="item.id" v-for="item, index in data.unitGroup"
:key="index" />
@ -137,12 +127,29 @@
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="精度">
<el-input v-model="unitFrom.accuracy" placeholder="请输入" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="换算率">
<el-input v-model="unitFrom.rate" placeholder="请输入" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="代码">
<el-input v-model="unitFrom.code" placeholder="请输入" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="基本单位">
<el-switch v-model="unitFrom.isBaseUnit" inline-prompt active-text="" inactive-text="" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部编码">
<el-input v-model="unitFrom.externalNumber" placeholder="请输入" clearable />
@ -166,16 +173,43 @@
</el-row>
</el-dialog>
<el-dialog v-model="isShowDialog" :title="mGroupTitle" ref="ruleFormRef" :width="800" >
<template #header>
<div style="color: #fff">
<span>单位组</span>
</div>
</template>
<el-form :model="unitGroupModel" label-width="auto" :rules="rules">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name">
<el-input v-model="unitGroupModel.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="isEnable">
<el-switch v-model="unitGroupModel.isEnable" active-text="" inactive-text="" />
</el-form-item>
</el-col>
</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>
<script setup lang="ts">
<script setup lang="ts" name="sysUnit">
import { onMounted, reactive, ref } from 'vue'
import { getAPI } from '/@/utils/axios-utils';
import { SysUnitApi, SysUnitGroupApi } from '/@/api-services/api';
import { AddSysUnitInput, SqlSugarPagedListSysUnitOutput, SysUnitGroupOutput, SysUnitInput } from '/@/api-services/models';
import { AddSysUnitInput, SqlSugarPagedListSysUnitOutput, SysUnitGroupOutput,AddSysUnitGroupInput, SysUnitInput} from '/@/api-services/models';
import type { FormRules } from "element-plus";
import { ElMessageBox, ElMessage } from 'element-plus';
let data = reactive({
unit: [] as SqlSugarPagedListSysUnitOutput[],//
@ -183,6 +217,43 @@ let data = reactive({
});
const ruleFormRef = ref();
const isShowDialog=ref(false);
let unitGroupModel=reactive<any>({isEnable:true,isDelete:false});
//
const rules = ref<FormRules>({
name: [{required: true, message: '请输入名称', trigger: 'blur',},],
});
let mTitle = ref('新增');
let mGroupTitle = ref('新增');
let dialogTableVisible = ref(false);
let unitFrom = reactive<any>({isEnable:true,isDelete:false,name:'',codeNum:''})
const cancel=()=>{
isShowDialog.value=false
}
//submit
const submit = async () => {
if(mGroupTitle.value=='新增'){
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupAddPost(unitGroupModel);
console.log(res)
if (res.data.code===200) {
isShowDialog.value = false;
unitGroup();
}
}else{
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupUpdatePost(unitGroupModel);
if (res.data.code===200) {
isShowDialog.value = false;
unitGroup();
}
}
};
//
const unitGroup = async () => {
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupListGet();
@ -198,32 +269,92 @@ const formInline = reactive({} as SysUnitInput)
//
const unitPage = async (parameter = formInline) => {
let res = await getAPI(SysUnitApi).apiSysUnitPagePost({ page: 1, pageSize: 10, ...parameter,...formInline });
data.unit = res.data.result?.items as any;
pageVO1.total = res.data.result?.total!;
}
let mTitle = ref('新增');
let dialogTableVisible = ref(false);
let unitFrom = reactive({} as AddSysUnitInput)
const addUnit= ()=>{
dialogTableVisible.value=true;
mTitle.value='新增'
}
//
let unitSubmit = async () => {
const unitSubmit = async () => {
if(mTitle.value=='新增'){
let res = await getAPI(SysUnitApi).apiSysUnitAddPost(unitFrom);
if (res.data.code===200) {
dialogTableVisible.value = false;
unitPage();
}
}else{
let res = await getAPI(SysUnitApi).apiSysUnitUpdatePost(unitFrom);
if (res.data.code===200) {
dialogTableVisible.value = false;
unitPage();
}
}
}
const onSubmit = () => {
console.log('submit!')
const editUnit=async(row:any)=>{
unitFrom=row;
mTitle.value='编辑'
dialogTableVisible.value=true;
}
const tableData = ref([
])
const deleteUnit=async(row:any)=>{
ElMessageBox.confirm(`确定删除?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
console.log(row)
let res = await getAPI(SysUnitApi).apiSysUnitDeletePost(row);
if (res.data.code == 200) {
ElMessage({ message: '成功', type: 'success', })
unitPage()
//state.tableData.handleList();
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
}
const addUnitGroup=()=>{
console.log('tableData!')
isShowDialog.value=true
}
const editUnitGroup=async(row:any)=>{
unitGroupModel=row;
mGroupTitle.value='编辑'
isShowDialog.value=true;
}
const deleteUnitGroup=async(row:any)=>{
ElMessageBox.confirm(`确定删除?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
console.log(row)
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupDeletePost(row);
if (res.data.code == 200) {
ElMessage({ message: '成功', type: 'success', })
unitPage()
//state.tableData.handleList();
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
}
const pageVO1 = reactive({

View File

@ -0,0 +1,156 @@
<template>
<div class="warehouse-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="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="isEnable">
<el-switch v-model="ruleForm.isEnable" active-text="" inactive-text="" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="仓库条码" prop="barCode">
<el-input v-model="ruleForm.barCode" 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="expandField">
<el-input v-model="ruleForm.expandField" 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="128" 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 { addWarehouse, updateWarehouse, detailWarehouse } from "/@/api/main/warehouse";
//
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 detailWarehouse(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 addWarehouse(values);
} else {
await updateWarehouse(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,208 @@
<template>
<div class="warehouse-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.codeNum" 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-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.barCode" 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.expandField" 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="'warehouse: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="openAddWarehouse" v-auth="'warehouse: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="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="isEnable" label="可用状态" width="120" show-overflow-tooltip="">
<template #default="scope">
<el-tag v-if="scope.row.isEnable"> </el-tag>
<el-tag type="danger" v-else> </el-tag>
</template>
</el-table-column>
<el-table-column prop="barCode" label="仓库条码" width="140" show-overflow-tooltip="" />
<el-table-column prop="expandField" label="仓库拓展字段" width="90" 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('warehouse:update') || auth('warehouse:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWarehouse(scope.row)" v-auth="'warehouse:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWarehouse(scope.row)" v-auth="'warehouse: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"
/>
<editDialog
ref="editDialogRef"
:title="editWarehouseTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="warehouse">
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 editDialog from '/@/views/basics-date/warehouse/component/editDialog.vue'
import { pageWarehouse, deleteWarehouse } from '/@/api/main/warehouse';
const showAdvanceQueryUI = ref(false);
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 editWarehouseTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageWarehouse(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 openAddWarehouse = () => {
editWarehouseTitle.value = '添加仓库';
editDialogRef.value.openDialog({});
};
//
const openEditWarehouse = (row: any) => {
editWarehouseTitle.value = '编辑仓库';
editDialogRef.value.openDialog(row);
};
//
const delWarehouse = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteWarehouse(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>

View File

@ -103,7 +103,7 @@ const dragRef: any = ref(null);
const state = reactive({
isShowPassword: false,
ruleForm: {
account: 'superadmin',
account: 'test',
password: '123456',
code: '',
codeId: 0,

View File

@ -0,0 +1,163 @@
<template>
<div class="warehousing-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="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="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="supplier">
<el-input v-model="ruleForm.supplier" 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="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 { addWarehousing, updateWarehousing, detailWarehousing } from "/@/api/main/warehousing";
//
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 detailWarehousing(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 addWarehousing(values);
} else {
await updateWarehousing(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,216 @@
<template>
<div class="warehousing-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.codeNum" 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-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" />
</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.state" 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.businessType" 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.supplier" 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.examinerId" 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="'warehousing: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="openAddWarehousing" v-auth="'warehousing: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="codeNum" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="businessType" label="业务类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="supplier" label="供货单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="examinerId" 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('warehousing:update') || auth('warehousing:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWarehousing(scope.row)" v-auth="'warehousing:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWarehousing(scope.row)" v-auth="'warehousing: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="printWarehousingTitle"
@reloadTable="handleQuery" />
<editDialog
ref="editDialogRef"
:title="editWarehousingTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="warehousing">
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 editDialog from '/@/views/main/warehousing/component/editDialog.vue'
import { pageWarehousing, deleteWarehousing } from '/@/api/main/warehousing';
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 printWarehousingTitle = ref("");
const editWarehousingTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageWarehousing(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 openAddWarehousing = () => {
editWarehousingTitle.value = '添加入库单';
editDialogRef.value.openDialog({});
};
//
const openEditWarehousing = (row: any) => {
editWarehousingTitle.value = '编辑入库单';
editDialogRef.value.openDialog(row);
};
//
const delWarehousing = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteWarehousing(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>

View File

@ -0,0 +1,163 @@
<template>
<div class="production-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="index">
<el-input-number v-model="ruleForm.index" 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="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="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="仓库ID" prop="warehouseId">
<el-input v-model="ruleForm.warehouseId" placeholder="请输入仓库ID" maxlength="20" 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="type">
<el-input v-model="ruleForm.type" 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="information">
<el-input v-model="ruleForm.information" 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="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" 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 { addProduction, updateProduction, detailProduction } from "/@/api/main/production";
//
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 detailProduction(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 addProduction(values);
} else {
await updateProduction(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,211 @@
<template>
<div class="production-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-number v-model="queryParams.index" 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.codeNum" 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.warehouseId" 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.type" 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.information" 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="'production: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="openAddProduction" v-auth="'production: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="index" label="序号" width="140" show-overflow-tooltip="" />
<el-table-column prop="name" label="名称" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehouseId" label="仓库ID" width="140" show-overflow-tooltip="" />
<el-table-column prop="type" label="类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="information" label="企业信息" 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('production:update') || auth('production:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditProduction(scope.row)" v-auth="'production:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delProduction(scope.row)" v-auth="'production: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"
/>
<editDialog
ref="editDialogRef"
:title="editProductionTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="production">
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 editDialog from '/@/views/productionCenter/production/component/editDialog.vue'
import { pageProduction, deleteProduction } from '/@/api/main/production';
const showAdvanceQueryUI = ref(false);
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 editProductionTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageProduction(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 openAddProduction = () => {
editProductionTitle.value = '添加生产组织';
editDialogRef.value.openDialog({});
};
//
const openEditProduction = (row: any) => {
editProductionTitle.value = '编辑生产组织';
editDialogRef.value.openDialog(row);
};
//
const delProduction = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteProduction(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>

View File

@ -0,0 +1,198 @@
<template>
<div class="productionTasks-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="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="planStartDate">
<el-date-picker v-model="ruleForm.planStartDate" 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="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="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="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="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="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="batch">
<el-input-number v-model="ruleForm.batch" 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-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-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="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="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" 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 { addProductionTasks, updateProductionTasks, detailProductionTasks } from "/@/api/main/productionTasks";
//
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 detailProductionTasks(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 addProductionTasks(values);
} else {
await updateProductionTasks(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,247 @@
<template>
<div class="productionTasks-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.oddNumber" 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-date-picker placeholder="请选择计划开工日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.planStartDateRange" />
</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.state" 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.productType" 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.codeNum" 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.specifications" 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.batch" 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.productionLine" 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-date-picker placeholder="请选择开工时间" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" />
</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-date-picker placeholder="请选择完工时间" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.endDateRange" />
</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="'productionTasks: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="openAddProductionTasks" v-auth="'productionTasks: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="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="planStartDate" label="计划开工日期" width="90" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="name" label="产品名称" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="产品编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="specifications" label="规格型号" width="140" show-overflow-tooltip="" />
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="开工时间" width="140" show-overflow-tooltip="" />
<el-table-column prop="endDate" label="完工时间" 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('productionTasks:update') || auth('productionTasks:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditProductionTasks(scope.row)" v-auth="'productionTasks:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delProductionTasks(scope.row)" v-auth="'productionTasks: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"
/>
<editDialog
ref="editDialogRef"
:title="editProductionTasksTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="productionTasks">
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 editDialog from '/@/views/productionCenter/productionTasks/component/editDialog.vue'
import { pageProductionTasks, deleteProductionTasks } from '/@/api/main/productionTasks';
const showAdvanceQueryUI = ref(false);
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 editProductionTasksTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageProductionTasks(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 openAddProductionTasks = () => {
editProductionTasksTitle.value = '添加生产任务单';
editDialogRef.value.openDialog({});
};
//
const openEditProductionTasks = (row: any) => {
editProductionTasksTitle.value = '编辑生产任务单';
editDialogRef.value.openDialog(row);
};
//
const delProductionTasks = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteProductionTasks(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>

View File

@ -0,0 +1,170 @@
<template>
<div class="reportTable-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="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="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="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="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-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="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" 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 { addReportTable, updateReportTable, detailReportTable } from "/@/api/main/reportTable";
//
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 detailReportTable(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 addReportTable(values);
} else {
await updateReportTable(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,217 @@
<template>
<div class="reportTable-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.oddNumber" 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-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" />
</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.state" 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.productType" 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.productionLine" 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.codeNum" 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.sourceNumber" 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="'reportTable: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="openAddReportTable" v-auth="'reportTable: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="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceNumber" label="源单号" 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('reportTable:update') || auth('reportTable:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportTable(scope.row)" v-auth="'reportTable:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delReportTable(scope.row)" v-auth="'reportTable: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"
/>
<editDialog
ref="editDialogRef"
:title="editReportTableTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="reportTable">
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 editDialog from '/@/views/productionCenter/reportTable/component/editDialog.vue'
import { pageReportTable, deleteReportTable } from '/@/api/main/reportTable';
const showAdvanceQueryUI = ref(false);
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 editReportTableTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageReportTable(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 openAddReportTable = () => {
editReportTableTitle.value = '添加汇报单';
editDialogRef.value.openDialog({});
};
//
const openEditReportTable = (row: any) => {
editReportTableTitle.value = '编辑汇报单';
editDialogRef.value.openDialog(row);
};
//
const delReportTable = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteReportTable(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>