From 0fde0ce4a298804c1cfb01f69f51b8c6439650d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 14 Jul 2023 15:03:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0DTO,=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E5=8D=95=E6=8D=AE=E5=9F=BA=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 6 +- .../Bases/BA_SERVICE.cs | 2 +- .../Bases/CAN_SA_SERVICE.cs | 4 + .../Entities/BQ/INVOICE_SERVICE.cs | 2 +- .../SettleAccounts/SettleAccountAppService.cs | 4 +- ...ttleAccountApplicationAutoMapperProfile.cs | 155 +++++++++++++++++- .../SettleAccount.Domain/Bases/EntityBase.cs | 37 ++++- .../Bases/OrderNumberGenerator.cs | 0 .../Entities/BQ/BBAC_CAN_SA.cs | 34 ++-- .../Entities/BQ/HBPO_CAN_SA.cs | 34 ++-- .../Entities/BQ/PUB_CAN_SA.cs | 34 ++-- .../Entities/Managers/CAN_SA_MNG.cs | 97 +++++++++++ .../Entities/Managers/NOT_SA_MNG.cs | 42 +++++ 13 files changed, 393 insertions(+), 58 deletions(-) rename code/src/Modules/SettleAccount/src/{SettleAccount.Application => SettleAccount.Domain}/Bases/OrderNumberGenerator.cs (100%) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index e268913c..d4ee4f4b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos - public class INVOICE_GRP_EXPORT_DTO + public class INVOICE_GRP_EXP_DTO { @@ -133,7 +133,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal TaxAmt { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - + [Display(Name = "发票号")] + public string InvbillNum { get; set; } + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index bef825a5..4b420034 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Bases IExporter _excel = new ExcelExporter(); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtoDetails = ObjectMapper.Map, List>(entities); + var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 925adfe5..e7ed0eca 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -115,6 +115,10 @@ namespace Win.Sfs.SettleAccount.Bases return new PagedResultDto(totalCount, dtos); } + + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 0b14e526..c3e12303 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -88,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ IExporter _excel = new ExcelExporter(); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtoDetails = ObjectMapper.Map, List>(entities); + var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs index ef9458f1..0f056a6f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs @@ -63,6 +63,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts private readonly ISettleAccountBranchEfCoreRepository _preBatchRepository; + + private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _versionRepository; private readonly ISettleAccountBranchEfCoreRepository _fisRepository; @@ -575,4 +577,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index d80ca761..7cb17e0f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -145,10 +145,163 @@ namespace Win.Sfs.SettleAccount CreateMapPUB_SE_DETAIL(); CreateMapPUB_SA(); + + CreateMapBBAC_CAN_SA(); + + + CreateMapBBAC_CAN_SA_DETAIL(); + + + CreateMapBBAC_NOT_SA_DETAIL(); + + + CreateMapHBPO_CAN_SA(); + + + CreateMapHBPO_CAN_SA_DETAIL(); + + + CreateMapHBPO_NOT_SA_DETAIL(); + + + CreateMapINVOICE_GRP(); + + + CreateMapINVOICE_MAP_GROUP(); + + + CreateMapINVOICE_NOT_SETTLE(); + + + CreateMapINVOICE_WAIT_DETAIL(); + + + CreateMapPUB_CAN_SA(); + + + CreateMapPUB_CAN_SA_DETAIL(); + + + CreateMapPUB_NOT_SA_DETAIL(); + + + + + + + + + } #region BQ - + + + /// + /// BBAC可结算 + /// + + private void CreateMapBBAC_CAN_SA() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + } + private void CreateMapBBAC_CAN_SA_DETAIL() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + private void CreateMapBBAC_NOT_SA_DETAIL() + + { + + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + private void CreateMapHBPO_CAN_SA() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + } + private void CreateMapHBPO_CAN_SA_DETAIL() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + private void CreateMapHBPO_NOT_SA_DETAIL() + + { + + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + private void CreateMapINVOICE_GRP() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + private void CreateMapINVOICE_MAP_GROUP() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + private void CreateMapINVOICE_NOT_SETTLE() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + } + private void CreateMapINVOICE_WAIT_DETAIL() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + } + private void CreateMapPUB_CAN_SA() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + } + private void CreateMapPUB_CAN_SA_DETAIL() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + private void CreateMapPUB_NOT_SA_DETAIL() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + + CreateMap().ReverseMap(); + } + + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index f4eaf225..8c0eeb03 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -1,10 +1,13 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Security.Policy; using System.Text; using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities.Auditing; +using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.SettleAccountDomain; using static System.Runtime.CompilerServices.RuntimeHelpers; @@ -33,7 +36,36 @@ namespace SettleAccount.Bases public decimal Qty { set; get; } } - public interface ISA_BASE : ISBASE + + + public class SA_CAN_BASE_MAIN : FullAuditedAggregateRoot + { + + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "结算单据")] + public string BillNum { get; set; } = null!; + [Display(Name = "关联结算单号")] + public string SettleBillNum { get; set; } = null!; + + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public SettleBillState State { get; set; } + + /// + /// 明细记录行数 + /// + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + + } + + + + public interface ISA_BASE : ISBASE { /// /// 期间 @@ -238,6 +270,9 @@ namespace SettleAccount.Bases } } + + + public class SA_BASE : FullAuditedAggregateRoot, ISA_BASE { /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs similarity index 100% rename from code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs rename to code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs index 5c893311..0f19e727 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs @@ -6,28 +6,28 @@ using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "BBAC可结算导入")] -public class BBAC_CAN_SA:FullAuditedAggregateRoot +public class BBAC_CAN_SA : SA_CAN_BASE_MAIN { - [Display(Name = "期间")] - public int Version { get; set; } + //[Display(Name = "期间")] + //public int Version { get; set; } - [Display(Name = "结算单据")] - public string BillNum { get; set; } = null!; - [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } = null!; + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public SettleBillState State { get; set; } + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } - /// - /// 明细记录行数 - /// - [Display(Name = "明细记录行数")] - public string InvGroupNum { get; set; } = null!; + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; public BBAC_CAN_SA() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs index 9d8c5647..12c402be 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs @@ -6,27 +6,27 @@ using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "HBPO可结算导入")] -public class HBPO_CAN_SA :FullAuditedAggregateRoot +public class HBPO_CAN_SA : SA_CAN_BASE_MAIN { - [Display(Name = "期间")] - public int Version { get; set; } - [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } = null!; - [Display(Name = "结算单据")] + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + //[Display(Name = "结算单据")] - public string BillNum { get; set; } = null!; + //public string BillNum { get; set; } = null!; - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public SettleBillState State { get; set; } + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } - /// - /// 明细记录行数 - /// - [Display(Name = "明细记录行数")] - public string InvGroupNum { get; set; } = null!; + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "明细记录行数")] + //public string InvGroupNum { get; set; } = null!; public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, string invGroupNum) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs index e2f474cb..f1ada17f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs @@ -6,30 +6,30 @@ using Win.Sfs.SettleAccount; namespace SettleAccount.Domain.BQ; [Display(Name = "PUB可结算导入")] -public class PUB_CAN_SA :FullAuditedAggregateRoot +public class PUB_CAN_SA : SA_CAN_BASE_MAIN { - [Display(Name = "期间")] - public int Version { get; set; } + //[Display(Name = "期间")] + //public int Version { get; set; } - [Display(Name = "关联结算单号")] - public string SettleBillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; - [Display(Name = "结算单据")] - public string BillNum { get; set; } = null!; + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public SettleBillState State { get; set; } - /// - /// 1、JIT 2、买单件 3、备件 3、印度件 - /// + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 1、JIT 2、买单件 3、备件 3、印度件 + ///// [Display(Name = "业务分类")] public string BusinessType { get; set; } = null!; - [Display(Name = "明细记录行数")] - public string InvGroupNum { get; set; } = null!; + //[Display(Name = "明细记录行数")] + //public string InvGroupNum { get; set; } = null!; public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, string businessType, string invGroupNum) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs new file mode 100644 index 00000000..c2dd1f15 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs @@ -0,0 +1,97 @@ +using Hangfire.Annotations; +using SettleAccount.Bases; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Services; +using Volo.Abp.Guids; +using Volo.Abp.ObjectMapping; +using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.SettleAccount.Boms; +using Win.Sfs.SettleAccount.Entities.Materials; +using Win.Sfs.SettleAccount.MaterialRelationships; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Entities.Managers +{ + public class CAN_SA_MNG : DomainService + where TEntity : SA_CAN_BASE_MAIN + where TEntityDetail : SA_CAN_BASE + { + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _detailRepository; + public CAN_SA_MNG + ( + INormalEfCoreRepository repository, + INormalEfCoreRepository detailRepository + ) + { + _repository= repository; + _detailRepository= detailRepository; + } + public virtual async Task SetState(TEntity p_entiy,SettleBillState state) + { + switch (p_entiy.State) + { + case SettleBillState.财务已审核: + if (state == SettleBillState.商务已审核) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + } + break; + case SettleBillState.商务已审核: + if (state == SettleBillState.已开票) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); + } + break; + case SettleBillState.已开票: + if (state == SettleBillState.未结状态) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); + } + break; + case SettleBillState.已扣减: + if (state == SettleBillState.财务已审核) + { + p_entiy.State = state; + } + else + { + throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); + } + break; + } + await _repository.UpdateAsync(p_entiy); + return true; + } + + + } + + + + + + + + + + +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs new file mode 100644 index 00000000..5b37ce06 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs @@ -0,0 +1,42 @@ +using SettleAccount.Bases; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Services; +using Volo.Abp; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Entities.Managers +{ + /// + /// 不能結算管理 + /// + /// + /// + /// + public class NOT_SA_MNG : DomainService + where TEntity : SA_CAN_BASE_MAIN + where TEntityDetail : SA_CAN_BASE + where TNOTDetail:SA_NOT_BASE + { + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _detailRepository; + public NOT_SA_MNG + ( + INormalEfCoreRepository repository, + INormalEfCoreRepository detailRepository + ) + { + _repository = repository; + _detailRepository = detailRepository; + } + public virtual async Task GenerateSettlementOrder(List p_list) + { + return true; + } + + + } +} From c226243c409d8b8790eb832f5d4049a324908077 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 14 Jul 2023 17:30:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E6=9C=9F?= =?UTF-8?q?=E9=97=B4=E8=AE=BE=E7=BD=AE=E5=92=8C=E9=80=9A=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vanilla/components/form/form-input.js | 37 ++- code/WebApp/vanilla/components/form/index.js | 10 +- code/WebApp/vanilla/components/list/index.js | 237 ++++++++++++------ .../vanilla/models/centralized-control.js | 136 ++++++++++ code/WebApp/vanilla/models/code-setting.js | 14 +- code/WebApp/vanilla/request/index.js | 8 +- code/WebApp/vanilla/router/routes.js | 93 +++++++ .../views/base-data/centralized-control.js | 27 ++ .../vanilla/views/base-data/code-setting.js | 13 - code/WebApp/vanilla/views/login.js | 4 +- docs/ui.rp | Bin 521441 -> 537323 bytes 11 files changed, 475 insertions(+), 104 deletions(-) create mode 100644 code/WebApp/vanilla/models/centralized-control.js create mode 100644 code/WebApp/vanilla/views/base-data/centralized-control.js diff --git a/code/WebApp/vanilla/components/form/form-input.js b/code/WebApp/vanilla/components/form/form-input.js index 87d16b3d..f4b0e543 100644 --- a/code/WebApp/vanilla/components/form/form-input.js +++ b/code/WebApp/vanilla/components/form/form-input.js @@ -2,14 +2,16 @@ import html from "html"; import { ref, reactive, watch, onMounted } from "vue"; import { dayjs } from "element-plus"; import request, { post } from "../../request/index.js"; +import { importFunction } from "../../utils/index.js"; export default { template: html` + - `, @@ -87,6 +98,22 @@ export default { const selectProps = ref({}); const selectValues = ref([]); const options = ref([]); + //watch + + watch( + () => model[props.prop], + async (value) => { + if (props.schema.watch) { + console.log(value); + if (props.schema.watch?.constructor === String) { + props.schema.watch = await importFunction(props.schema.watch); + } + if (props.schema.watch?.constructor === Function) { + props.schema.watch(model, value); + } + } + } + ); onMounted(async () => { if (props.schema.options) { options.value = props.schema.options; diff --git a/code/WebApp/vanilla/components/form/index.js b/code/WebApp/vanilla/components/form/index.js index df07298f..9e876e63 100644 --- a/code/WebApp/vanilla/components/form/index.js +++ b/code/WebApp/vanilla/components/form/index.js @@ -5,7 +5,7 @@ export default { components: { AppFormItem: defineAsyncComponent(() => import("./form-item.js")) }, name: "AppForm", template: html`
- + - + - $t('confirm') + + $t('confirm') +
`, - props: ["modelValue", "schema", "action", "hideButton", "isQueryForm", "mode"], + props: ["modelValue", "inline", "schema", "action", "hideButton", "isQueryForm", "mode"], emits: ["update:modelValue", "submit"], setup(props, context) { // init diff --git a/code/WebApp/vanilla/components/list/index.js b/code/WebApp/vanilla/components/list/index.js index 802dee6b..b8b7247f 100644 --- a/code/WebApp/vanilla/components/list/index.js +++ b/code/WebApp/vanilla/components/list/index.js @@ -14,6 +14,7 @@ export default { name: "AppList", components: { AppForm: defineAsyncComponent(() => import("../form/index.js")), + AppFormInput: defineAsyncComponent(() => import("../../components/form/form-input.js")), SvgIcon: defineAsyncComponent(() => import("../../components/icon/index.js")), AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")), VueOfficeExcel, @@ -26,13 +27,18 @@ export default { inline mode="query" label-position="left" - :schema="querySchema" + :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true" - v-if="querySchema" - /> + > + + @@ -231,23 +237,26 @@ export default { - + {{$t('筛选')}} @@ -246,7 +246,7 @@ export default { - + @@ -269,30 +269,30 @@ export default { - - - - - - -