自动生成定义管理通用代码
This commit is contained in:
@@ -181,6 +181,40 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.MaterialController.PageList(Yi.Framework.DtoModel.ERP.Material.MaterialCreateUpdateInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
分页查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.MaterialController.GetById(System.Int64)">
|
||||
<summary>
|
||||
单查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.MaterialController.Create(Yi.Framework.DtoModel.ERP.Material.MaterialCreateUpdateInput)">
|
||||
<summary>
|
||||
增
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.MaterialController.Update(System.Int64,Yi.Framework.DtoModel.ERP.Material.MaterialCreateUpdateInput)">
|
||||
<summary>
|
||||
更
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.MaterialController.Del(System.Collections.Generic.List{System.Int64})">
|
||||
<summary>
|
||||
删
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.PageList(Yi.Framework.DtoModel.ERP.Supplier.SupplierCreateUpdateInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
分页查
|
||||
@@ -215,6 +249,74 @@
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.UnitController.PageList(Yi.Framework.DtoModel.ERP.Unit.UnitCreateUpdateInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
分页查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.UnitController.GetById(System.Int64)">
|
||||
<summary>
|
||||
单查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.UnitController.Create(Yi.Framework.DtoModel.ERP.Unit.UnitCreateUpdateInput)">
|
||||
<summary>
|
||||
增
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.UnitController.Update(System.Int64,Yi.Framework.DtoModel.ERP.Unit.UnitCreateUpdateInput)">
|
||||
<summary>
|
||||
更
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.UnitController.Del(System.Collections.Generic.List{System.Int64})">
|
||||
<summary>
|
||||
删
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.WarehouseController.PageList(Yi.Framework.DtoModel.ERP.Warehouse.WarehouseCreateUpdateInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
分页查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.WarehouseController.GetById(System.Int64)">
|
||||
<summary>
|
||||
单查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.WarehouseController.Create(Yi.Framework.DtoModel.ERP.Warehouse.WarehouseCreateUpdateInput)">
|
||||
<summary>
|
||||
增
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.WarehouseController.Update(System.Int64,Yi.Framework.DtoModel.ERP.Warehouse.WarehouseCreateUpdateInput)">
|
||||
<summary>
|
||||
更
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.WarehouseController.Del(System.Collections.Generic.List{System.Int64})">
|
||||
<summary>
|
||||
删
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.StudentController.Create(Yi.Framework.DtoModel.RABC.Student.StudentCreateInput)">
|
||||
<summary>
|
||||
增
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Material;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class MaterialController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<MaterialController> _logger;
|
||||
private readonly IMaterialService _materialService;
|
||||
public MaterialController(ILogger<MaterialController> logger, IMaterialService materialService)
|
||||
{
|
||||
_logger = logger;
|
||||
_materialService = materialService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] MaterialCreateUpdateInput input, [FromQuery] PageParModel page)
|
||||
{
|
||||
var result = await _materialService.PageListAsync(input, page);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
var result = await _materialService.GetByIdAsync(id);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> Create(MaterialCreateUpdateInput input)
|
||||
{
|
||||
var result = await _materialService.CreateAsync(input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> Update(long id, MaterialCreateUpdateInput input)
|
||||
{
|
||||
var result = await _materialService.UpdateAsync(id, input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> Del(List<long> ids)
|
||||
{
|
||||
await _materialService.DeleteAsync(ids);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Unit;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class UnitController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<UnitController> _logger;
|
||||
private readonly IUnitService _unitService;
|
||||
public UnitController(ILogger<UnitController> logger, IUnitService unitService)
|
||||
{
|
||||
_logger = logger;
|
||||
_unitService = unitService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] UnitCreateUpdateInput input, [FromQuery] PageParModel page)
|
||||
{
|
||||
var result = await _unitService.PageListAsync(input, page);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
var result = await _unitService.GetByIdAsync(id);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> Create(UnitCreateUpdateInput input)
|
||||
{
|
||||
var result = await _unitService.CreateAsync(input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> Update(long id, UnitCreateUpdateInput input)
|
||||
{
|
||||
var result = await _unitService.UpdateAsync(id, input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> Del(List<long> ids)
|
||||
{
|
||||
await _unitService.DeleteAsync(ids);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Warehouse;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class WarehouseController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<WarehouseController> _logger;
|
||||
private readonly IWarehouseService _warehouseService;
|
||||
public WarehouseController(ILogger<WarehouseController> logger, IWarehouseService warehouseService)
|
||||
{
|
||||
_logger = logger;
|
||||
_warehouseService = warehouseService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> PageList([FromQuery] WarehouseCreateUpdateInput input, [FromQuery] PageParModel page)
|
||||
{
|
||||
var result = await _warehouseService.PageListAsync(input, page);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
var result = await _warehouseService.GetByIdAsync(id);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> Create(WarehouseCreateUpdateInput input)
|
||||
{
|
||||
var result = await _warehouseService.CreateAsync(input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> Update(long id, WarehouseCreateUpdateInput input)
|
||||
{
|
||||
var result = await _warehouseService.UpdateAsync(id, input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> Del(List<long> ids)
|
||||
{
|
||||
await _warehouseService.DeleteAsync(ids);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
14
Yi.Framework.Net6/Yi.Framework.Common/Enum/StateEnum.cs
Normal file
14
Yi.Framework.Net6/Yi.Framework.Common/Enum/StateEnum.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum StateEnum
|
||||
{
|
||||
Normal=0,
|
||||
Disable=1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Material.ConstConfig
|
||||
{
|
||||
public class MaterialConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Material.MapperConfig
|
||||
{
|
||||
public class SuppliERProfile:Profile
|
||||
{
|
||||
public SuppliERProfile()
|
||||
{
|
||||
CreateMap<MaterialCreateUpdateInput, MaterialEntity>();
|
||||
CreateMap<MaterialEntity, MaterialGetListOutput>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Material
|
||||
{
|
||||
public class MaterialCreateUpdateInput : EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string UnitName { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Material
|
||||
{
|
||||
public class MaterialGetListOutput: EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string UnitName { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Unit.ConstConfig
|
||||
{
|
||||
public class UnitConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Unit.MapperConfig
|
||||
{
|
||||
public class SuppliERProfile:Profile
|
||||
{
|
||||
public SuppliERProfile()
|
||||
{
|
||||
CreateMap<UnitCreateUpdateInput, UnitEntity>();
|
||||
CreateMap<UnitEntity, UnitGetListOutput>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Unit
|
||||
{
|
||||
public class UnitCreateUpdateInput : EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Unit
|
||||
{
|
||||
public class UnitGetListOutput: EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Warehouse.ConstConfig
|
||||
{
|
||||
public class WarehouseConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Warehouse.MapperConfig
|
||||
{
|
||||
public class SuppliERProfile:Profile
|
||||
{
|
||||
public SuppliERProfile()
|
||||
{
|
||||
CreateMap<WarehouseCreateUpdateInput, WarehouseEntity>();
|
||||
CreateMap<WarehouseEntity, WarehouseGetListOutput>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Warehouse
|
||||
{
|
||||
public class WarehouseCreateUpdateInput : EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
public StateEnum State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.DtoModel.ERP.Warehouse
|
||||
{
|
||||
public class WarehouseGetListOutput: EntityDto<long>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
public StateEnum State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Material;
|
||||
using Yi.Framework.Interface.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Interface.ERP
|
||||
{
|
||||
public interface IMaterialService : ICrudAppService<MaterialGetListOutput, long, MaterialCreateUpdateInput>
|
||||
{
|
||||
Task<PageModel<List<MaterialGetListOutput>>> PageListAsync(MaterialCreateUpdateInput input, PageParModel page);
|
||||
}
|
||||
}
|
||||
16
Yi.Framework.Net6/Yi.Framework.Interface/ERP/IUnitService.cs
Normal file
16
Yi.Framework.Net6/Yi.Framework.Interface/ERP/IUnitService.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Unit;
|
||||
using Yi.Framework.Interface.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Interface.ERP
|
||||
{
|
||||
public interface IUnitService : ICrudAppService<UnitGetListOutput, long, UnitCreateUpdateInput>
|
||||
{
|
||||
Task<PageModel<List<UnitGetListOutput>>> PageListAsync(UnitCreateUpdateInput input, PageParModel page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Warehouse;
|
||||
using Yi.Framework.Interface.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Interface.ERP
|
||||
{
|
||||
public interface IWarehouseService : ICrudAppService<WarehouseGetListOutput, long, WarehouseCreateUpdateInput>
|
||||
{
|
||||
Task<PageModel<List<WarehouseGetListOutput>>> PageListAsync(WarehouseCreateUpdateInput input, PageParModel page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.ERP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料定义
|
||||
/// </summary>
|
||||
[SugarTable("Material")]
|
||||
public class MaterialEntity : IEntity<long>, IMultiTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户id
|
||||
/// </summary>
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料单位
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using Yi.Framework.Model.Base;
|
||||
namespace Yi.Framework.Model.ERP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购订单字表
|
||||
/// 采购订单子表
|
||||
/// </summary>
|
||||
[SugarTable("PurchaseDetail")]
|
||||
public class PurchaseDetailsEntity : IEntity<long>, IMultiTenant
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.ERP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 单位定义
|
||||
/// </summary>
|
||||
[SugarTable("Unit")]
|
||||
public class UnitEntity : IEntity<long>, IMultiTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户id
|
||||
/// </summary>
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.ERP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 仓库定义
|
||||
/// </summary>
|
||||
[SugarTable("Warehouse")]
|
||||
public class WarehouseEntity : IEntity<long>, IMultiTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户id
|
||||
/// </summary>
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public StateEnum State { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using AutoMapper;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Material;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.Service.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Service.ERP
|
||||
{
|
||||
public class MaterialService : CrudAppService<MaterialEntity, MaterialGetListOutput, long, MaterialCreateUpdateInput>, IMaterialService
|
||||
{
|
||||
public MaterialService(IRepository<MaterialEntity> repository, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
}
|
||||
public async Task<PageModel<List<MaterialGetListOutput>>> PageListAsync(MaterialCreateUpdateInput input, PageParModel page)
|
||||
{
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var data = await Repository._DbQueryable
|
||||
.WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code))
|
||||
.WhereIF(input.Name is not null, u => u.Name.Contains(input.Name))
|
||||
.ToPageListAsync(page.PageNum, page.PageSize, totalNumber);
|
||||
return new PageModel<List<MaterialGetListOutput>> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) };
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Yi.Framework.Net6/Yi.Framework.Service/ERP/UnitService.cs
Normal file
32
Yi.Framework.Net6/Yi.Framework.Service/ERP/UnitService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using AutoMapper;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Unit;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.Service.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Service.ERP
|
||||
{
|
||||
public class UnitService : CrudAppService<UnitEntity, UnitGetListOutput, long, UnitCreateUpdateInput>, IUnitService
|
||||
{
|
||||
public UnitService(IRepository<UnitEntity> repository, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
}
|
||||
public async Task<PageModel<List<UnitGetListOutput>>> PageListAsync(UnitCreateUpdateInput input, PageParModel page)
|
||||
{
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var data = await Repository._DbQueryable
|
||||
.WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code))
|
||||
.WhereIF(input.Name is not null, u => u.Name.Contains(input.Name))
|
||||
.ToPageListAsync(page.PageNum, page.PageSize, totalNumber);
|
||||
return new PageModel<List<UnitGetListOutput>> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using AutoMapper;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Warehouse;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.Service.Base.Crud;
|
||||
|
||||
namespace Yi.Framework.Service.ERP
|
||||
{
|
||||
public class WarehouseService : CrudAppService<WarehouseEntity, WarehouseGetListOutput, long, WarehouseCreateUpdateInput>, IWarehouseService
|
||||
{
|
||||
public WarehouseService(IRepository<WarehouseEntity> repository, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
}
|
||||
public async Task<PageModel<List<WarehouseGetListOutput>>> PageListAsync(WarehouseCreateUpdateInput input, PageParModel page)
|
||||
{
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var data = await Repository._DbQueryable
|
||||
.WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code))
|
||||
.WhereIF(input.Name is not null, u => u.Name.Contains(input.Name))
|
||||
.ToPageListAsync(page.PageNum, page.PageSize, totalNumber);
|
||||
return new PageModel<List<WarehouseGetListOutput>> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ TemplateFactory templateFactory = new();
|
||||
//选择需要生成的模板提供者
|
||||
|
||||
string modelName = "ERP";
|
||||
List<string> entityNames =new (){ "Supplier", "Purchase", "PurchaseDetails" };
|
||||
List<string> entityNames =new (){ "_" };
|
||||
|
||||
foreach (var entityName in entityNames)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public ConstTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\ConstConfig\{TemplateConst.EntityName}Const.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\ConstConfig\{TemplateConst.EntityName}Const.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\ConstTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public ControllerTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.ApiMicroservice\Controllers\{TemplateConst.ModelName}\{TemplateConst.EntityName}Controller.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.ApiMicroservice\Controllers\{TemplateConst.ModelName}\{TemplateConst.EntityName}Controller.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\ControllerTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public CreateUpdateInputTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}CreateUpdateInput.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}CreateUpdateInput.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\CreateUpdateInputTemplate.txt";
|
||||
EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs";
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public GetListOutputTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListOutput.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListOutput.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\GetListOutputTemplate.txt";
|
||||
EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs";
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public IServceTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.Interface\{TemplateConst.ModelName}\I{TemplateConst.EntityName}Service.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.Interface\{TemplateConst.ModelName}\I{TemplateConst.EntityName}Service.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\IServiceTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public ProfileTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\MapperConfig\{TemplateConst.EntityName}Profile.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\MapperConfig\{TemplateConst.EntityName}Profile.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\ProfileTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
||||
{
|
||||
public ServceTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Server\Yi.Framework.Service\{TemplateConst.ModelName}\{TemplateConst.EntityName}Service.cs";
|
||||
BuildPath = $@"..\..\..\..\Yi.Framework.Service\{TemplateConst.ModelName}\{TemplateConst.EntityName}Service.cs";
|
||||
TemplatePath = $@"..\..\..\Template\Server\ServiceTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Site
|
||||
{
|
||||
public ApiTemplateProvider(string modelName, string entityName) : base(modelName, entityName)
|
||||
{
|
||||
BuildPath = $@"..\..\..\Code_Site\src\api\{TemplateConst.ModelName}\{TemplateConst.LowerEntityName}Api.js";
|
||||
BuildPath = $@"..\..\..\Code_Site\src\api\{TemplateConst.LowerModelName}\{TemplateConst.LowerEntityName}Api.js";
|
||||
TemplatePath = $@"..\..\..\Template\Site\ApiTemplate.txt";
|
||||
}
|
||||
}
|
||||
|
||||
45
Yi.Vue3.x.RuoYi/src/api/erp/materialApi.js
Normal file
45
Yi.Vue3.x.RuoYi/src/api/erp/materialApi.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分页查询
|
||||
export function listData(query) {
|
||||
return request({
|
||||
url: '/material/pageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// id查询
|
||||
export function getData(code) {
|
||||
return request({
|
||||
url: '/material/getById/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/material/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateData(id,data) {
|
||||
return request({
|
||||
url: `/material/update/${id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delData(code) {
|
||||
return request({
|
||||
url: '/material/del',
|
||||
method: 'delete',
|
||||
data:"string"==typeof(code)?[code]:code
|
||||
})
|
||||
}
|
||||
45
Yi.Vue3.x.RuoYi/src/api/erp/unitApi.js
Normal file
45
Yi.Vue3.x.RuoYi/src/api/erp/unitApi.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分页查询
|
||||
export function listData(query) {
|
||||
return request({
|
||||
url: '/unit/pageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// id查询
|
||||
export function getData(code) {
|
||||
return request({
|
||||
url: '/unit/getById/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/unit/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateData(id,data) {
|
||||
return request({
|
||||
url: `/unit/update/${id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delData(code) {
|
||||
return request({
|
||||
url: '/unit/del',
|
||||
method: 'delete',
|
||||
data:"string"==typeof(code)?[code]:code
|
||||
})
|
||||
}
|
||||
45
Yi.Vue3.x.RuoYi/src/api/erp/warehouseApi.js
Normal file
45
Yi.Vue3.x.RuoYi/src/api/erp/warehouseApi.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分页查询
|
||||
export function listData(query) {
|
||||
return request({
|
||||
url: '/warehouse/pageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// id查询
|
||||
export function getData(code) {
|
||||
return request({
|
||||
url: '/warehouse/getById/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/warehouse/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateData(id,data) {
|
||||
return request({
|
||||
url: `/warehouse/update/${id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delData(code) {
|
||||
return request({
|
||||
url: '/warehouse/del',
|
||||
method: 'delete',
|
||||
data:"string"==typeof(code)?[code]:code
|
||||
})
|
||||
}
|
||||
377
Yi.Vue3.x.RuoYi/src/views/ERP/material/index.vue
Normal file
377
Yi.Vue3.x.RuoYi/src/views/ERP/material/index.vue
Normal file
@@ -0,0 +1,377 @@
|
||||
<template>
|
||||
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="物料名称" prop="name" >
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="name"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编号" prop="code" >
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入物料编号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="code"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-select
|
||||
v-model="queryParams.isDeleted"
|
||||
placeholder="状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['erp:material:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['erp:material:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['erp:material:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['erp:material:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||
<el-table-column label="物料编号" align="center" prop="code" />
|
||||
|
||||
<el-table-column label="物料名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
|
||||
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:options="sys_normal_disable"
|
||||
:value="scope.row.isDeleted"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:article:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:article:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="物料编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料单位" prop="name">
|
||||
<el-input v-model="form.unitName" placeholder="请输入物料单位" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-radio-group v-model="form.isDeleted">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="JSON.parse(dict.value)"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input
|
||||
v-model="form.remarks"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/erp/materialApi";
|
||||
import { ref } from "@vue/reactivity";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const dataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
code: undefined
|
||||
},
|
||||
rules: {
|
||||
code: [{ required: true, message: "物料编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||
(response) => {
|
||||
dataList.value = response.data.data;
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
isDeleted: false,
|
||||
remark: undefined,
|
||||
};
|
||||
proxy.resetForm("dataRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const queryRef=ref(null);
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
console.log(queryRef.value)
|
||||
queryRef.value.resetFields();
|
||||
// proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加物料";
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value;
|
||||
getData(id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改物料";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["dataRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
updateData(form.value.id,form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addData(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const delIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(delIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -8,7 +8,7 @@
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="供应商名称" prop="title" >
|
||||
<el-form-item label="供应商名称" prop="name" >
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入供应商名称"
|
||||
@@ -18,7 +18,7 @@
|
||||
prop="name"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编号" prop="title" >
|
||||
<el-form-item label="供应商编号" prop="code" >
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入供应商编号"
|
||||
@@ -379,7 +379,7 @@
|
||||
function handleDelete(row) {
|
||||
const delIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除字典编号为"' + delIds + '"的数据项?')
|
||||
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(delIds);
|
||||
})
|
||||
|
||||
369
Yi.Vue3.x.RuoYi/src/views/ERP/unit/index.vue
Normal file
369
Yi.Vue3.x.RuoYi/src/views/ERP/unit/index.vue
Normal file
@@ -0,0 +1,369 @@
|
||||
<template>
|
||||
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="单位名称" prop="name" >
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="name"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位编号" prop="code" >
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入单位编号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="code"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-select
|
||||
v-model="queryParams.isDeleted"
|
||||
placeholder="状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['erp:unit:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['erp:unit:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['erp:unit:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['erp:unit:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||
<el-table-column label="单位编号" align="center" prop="code" />
|
||||
|
||||
<el-table-column label="单位名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:options="sys_normal_disable"
|
||||
:value="scope.row.isDeleted"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:article:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:article:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="单位编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入单位编码" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-radio-group v-model="form.isDeleted">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="JSON.parse(dict.value)"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input
|
||||
v-model="form.remarks"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/erp/unitApi";
|
||||
import { ref } from "@vue/reactivity";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const dataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
code: undefined,
|
||||
},
|
||||
rules: {
|
||||
code: [{ required: true, message: "单位编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "单位名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||
(response) => {
|
||||
dataList.value = response.data.data;
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
title: undefined,
|
||||
isDeleted: false,
|
||||
remark: undefined,
|
||||
};
|
||||
proxy.resetForm("dataRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加单位";
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value;
|
||||
getData(id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改单位";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["dataRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
updateData(form.value.id,form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addData(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const delIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(delIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
368
Yi.Vue3.x.RuoYi/src/views/ERP/warehouse/index.vue
Normal file
368
Yi.Vue3.x.RuoYi/src/views/ERP/warehouse/index.vue
Normal file
@@ -0,0 +1,368 @@
|
||||
<template>
|
||||
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="仓库名称" prop="name" >
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入仓库名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="name"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库编号" prop="code" >
|
||||
<el-input
|
||||
v-model="queryParams.code"
|
||||
placeholder="请输入仓库编号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
prop="code"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-select
|
||||
v-model="queryParams.isDeleted"
|
||||
placeholder="状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['erp:warehouse:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['erp:warehouse:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['erp:warehouse:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['erp:warehouse:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||
<el-table-column label="仓库编号" align="center" prop="code" />
|
||||
|
||||
<el-table-column label="仓库名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||
<template #default="scope">
|
||||
<dict-tag
|
||||
:options="sys_normal_disable"
|
||||
:value="scope.row.isDeleted"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:article:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:article:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="仓库编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入仓库编码" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓库名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入仓库名称" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||
<el-radio-group v-model="form.isDeleted">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="JSON.parse(dict.value)"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input
|
||||
v-model="form.remarks"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/erp/warehouseApi";
|
||||
import { ref } from "@vue/reactivity";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const dataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
code: undefined,
|
||||
},
|
||||
rules: {
|
||||
code: [{ required: true, message: "仓库编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||
(response) => {
|
||||
dataList.value = response.data.data;
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
isDeleted: false,
|
||||
remark: undefined,
|
||||
};
|
||||
proxy.resetForm("dataRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加仓库";
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value;
|
||||
getData(id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改仓库";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["dataRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined) {
|
||||
updateData(form.value.id,form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addData(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const delIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(delIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
Reference in New Issue
Block a user