0520
parent
16fd751576
commit
4d90594321
Admin.NET
Admin.NET.Application
Service
Brand
CodePakageConfiguration
CodeRuleByInfomation
CodeRuleByReceipt
Invoice
Materials
Outbound
PackageInfo
PrintLabel
ProductBarCode
ProductCodeConfiguration
Production
ProductionTasks
ReportTable
SuppleInformation
SuppleType
UrlInfo
UrlType
Warehouse
Warehousing
Admin.NET.Web.Entry
wwwroot/CodeGen
Warehousing/Web/src
api/main
views/main/warehousing
component
Web
src
api-services/models
views
basics-date
brand
component
custom
customer
distributor
component
store
suppleInformation
component
supplier
component
unit
warehouse
component
login/component
main/warehousing
component
productionCenter
production
component
productionTasks
component
reportTable
component
|
@ -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; }
|
||||
|
||||
}
|
|
@ -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; }
|
||||
|
||||
}
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
)
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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; }
|
||||
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
||||
}
|
|
@ -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; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
)
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
)
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
)
|
||||
|
|
|
@ -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; }
|
||||
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
||||
}
|
|
@ -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; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 =>
|
||||
{
|
||||
|
|
Binary file not shown.
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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
|
Binary file not shown.
|
@ -179,4 +179,5 @@ export interface AddSysUnitInput {
|
|||
* @memberof AddSysUnitInput
|
||||
*/
|
||||
isEnable: boolean;
|
||||
|
||||
}
|
||||
|
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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,
|
||||
});
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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 },
|
||||
});
|
||||
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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({
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -103,7 +103,7 @@ const dragRef: any = ref(null);
|
|||
const state = reactive({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
account: 'superadmin',
|
||||
account: 'test',
|
||||
password: '123456',
|
||||
code: '',
|
||||
codeId: 0,
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -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>
|
||||
|
Loading…
Reference in New Issue