Administrator 3 years ago
parent
commit
6caba99cc4
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDtoBase.cs
  2. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs
  3. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
  4. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformRequestDto.cs
  5. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs
  6. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs
  7. 60
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs
  8. 5
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
  9. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs
  10. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  11. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  12. 161
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnSumInterface.cs
  13. 9
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  14. 76
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs
  15. 34
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  16. 104
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs
  17. 4
      vue/src/views/pg-fis/basedate/m100Online/budaMB.vue
  18. 677
      vue/src/views/pg-fis/basedate/m100Online/budaZHB.vue
  19. 30
      vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue
  20. 513
      vue/src/views/pg-fis/basedate/partSwitch/index.vue

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDtoBase.cs

@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
[ExporterHeader(DisplayName = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[ExporterHeader(DisplayName = "外部看板编号")]
[ExporterHeader(DisplayName = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[ImporterHeader(Name = "外部看板编号")]
[ImporterHeader(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformRequestDto.cs

@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs

@ -17,8 +17,8 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// <summary>
///外部看板编号
/// </summary>
//[ExporterHeader(DisplayName = "外部看板编号")]
//public string ExternalKanbanNumber { get; set; }
[ExporterHeader(DisplayName = "外部单号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号
/// </summary>

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs

@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// <summary>
///外部看板编号
/// </summary>
[ImporterHeader(Name = "外部看板编号")]
[ImporterHeader(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

60
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs

@ -134,6 +134,66 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
[Display(Name = "版本号")]
public string Version { set; get; }
[Display(Name = "客户")]
public string Client { set; get; }
[Display(Name = "出库类型")]
public string Type { set; get; }
//[Display(Name = "结算编码")]
//public string SettleCode { set; get; }
//[Display(Name = "销售渠道")]
//public string SaleCode { set; get; }
//[Display(Name = "客户代码")]
//public string ClientCode { set; get; }
[Display(Name = "结算单")]
public string BillNum { set; get; }
[Display(Name = "交货编码")]
public string SwitchCode { set; get; }
[Display(Name = "物料号")]
public string MaterialCode { set; get; }
//[Display(Name = "寄售类别")]
//public string SaleType { set; get; }
[Display(Name = "结算数量")]
public decimal Qty { set; get; }
[Display(Name = "实际出库数量")]
public decimal OutputQty { set; get; }
[Display(Name = "差异数量")]
public decimal DiffQty { set; get; }
//[Display(Name = "开票单价")]
//public decimal Price { set; get; }
//[Display(Name = "结算金额")]
//public decimal Amt { set; get; }
//[Display(Name = "已出库金额")]
//public decimal OutPutAmt { set; get; }
//[Display(Name = "WMS待出库金额")]
//public decimal DiffAmt { set; get; }
[Display(Name = "物料组编码")]
public string MaterialGroupCode { set; get; }
[Display(Name = "物料组(车型)")]
public string MaterialGroup { set; get; }
[Display(Name = "物料组描述")]
public string MaterialDesc { set; get; }
[Display(Name = "备注")]
public string Remark1 { set; get; }
[Display(Name = "状态")]
public int State { set; get; }
}
/// <summary>
/// 有条码业务
/// </summary>
public class WmsDetailWithCodeReportDto
{
public WmsDetailWithCodeReportDto()
{
}
[Display(Name = "版本号")]
public string Version { set; get; }

5
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs

@ -149,7 +149,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// <returns>实体DTO</returns>
[HttpGet]
[Route("{id}")]
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
virtual public async Task<CodeSettingDto> GetAsync(Guid id)
{
var result = await _repository.GetAsync(id);
@ -187,7 +186,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
virtual public async Task<PagedResultDto<CodeSettingDto>> GetListAsync(CodeSettingRequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
@ -209,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// <returns>实体总数</returns>
[HttpGet]
[Route("count")]
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
@ -221,7 +218,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// <returns>实体DTO列表</returns>
[HttpGet]
[Route("all")]
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
virtual public async Task<ListResultDto<CodeSettingDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
@ -313,7 +309,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
[HttpPost]
[Route("Export")]
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
virtual public async Task<string> ExportAsync(CodeSettingRequestDto input)
{
string _fileName = string.Format("通用代码设置_{0}.xlsx",DateTime.Now.ToString("yyyyMMdd"));

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs

@ -479,7 +479,7 @@ into temp1
{
var _billNum = "BHQH" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQHSharePartOutPutDetial>(files, _excelImportService);
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQHSharePartOutPutDetial>(files, _excelImportService);
List<WmsHQHSharePartOutPutDetial> _lst = new List<WmsHQHSharePartOutPutDetial>();
var _lsCopy = new List<WmsHQHSharePartOutPutDetial>();

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs

@ -57,7 +57,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("api/settleaccount/wmskanbanoutput")]
//[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
public class WMSKanbanAppService :
SettleAccountApplicationBase<WmsKanbanOutPutDetial>
{

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs

@ -412,7 +412,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{
var _billNum = "BCar" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQCarOutPutDetial>(files, _excelImportService);
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQCarOutPutDetial>(files, _excelImportService);
List<WmsHQCarOutPutDetial> _lst = new List<WmsHQCarOutPutDetial>();
var _lsCopy = new List<WmsHQCarOutPutDetial>();

161
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnSumInterface.cs

@ -0,0 +1,161 @@
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
[Route("api/settleaccount/WMSOutputDetailWithCodeReport")]
public class WMSOutputDetailWithCodeReportAppService :
SettleAccountApplicationBase<WmsDetailWithCodeReport>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsDetailWithCodeReport, Guid> _wmsRepository;
private readonly WmsOutputSumDapperRepository _dapper;
private readonly IExcelImportAppService _excelImportService;
private readonly ErpSumOutputDapperRepository _erpDapper;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
public WMSOutputDetailWithCodeReportAppService(
WmsOutputSumDapperRepository dapper,
ISettleAccountBranchEfCoreRepository<WmsDetailWithCodeReport, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
IExcelImportAppService excelImportService,
IDistributedCache<WmsDetailWithCodeReport> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ErpSumOutputDapperRepository erpDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_erpDapper = erpDapper;
_wmsRepository = wmsRepository;
_dapper = dapper;
_excelImportService = excelImportService;
}
[HttpGet]
[Route("Make")]
[UnitOfWork(false)]
public async Task<string> ReportMake(string version, DateTime accountDate)
{
//有条码的业务(可根据条码/K号/底盘号,查询是否结算过,结算期间)
var _ls = _dapper.GetWmsSearchWithCodeReportList(version, "0");
var _count = _wmsRepository.Count(p => p.Version == version && p.State > 0);
if (_count > 0)
{
throw new BusinessException("8899", "不能重新生成此版本!");
}
else
{
var query = _wmsRepository.Where(p => p.Version == version);
await query.BatchDeleteAsync();
}
List<WmsDetailWithCodeReport> _lst = new List<WmsDetailWithCodeReport>();
if (_ls != null && _ls.Count() > 0)
{
foreach (var itm in _ls)
{
_lst.Add(new WmsDetailWithCodeReport(
Guid.NewGuid(),
itm.,
itm.,
version,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
0));
}
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// Wms汇总合计明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsDetailReport")]
virtual public async Task<PagedResultDto<WmsDetailWithCodeReport>> GetListAsync(WmsRequestDetailReportDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsDetailWithCodeReport>(totalCount, entities);
}
private async Task<long> GetCountAsync(WmsRequestDetailReportDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
[HttpPost]
[Route("ModifyTaskState")]
public virtual async Task<bool> SyncInterface()
{
//_wmsRepository.Where(p => p.BillNum ==)
return true;
}
[HttpPost]
[Route("Export")]
virtual public async Task<string> ExportAsync(WmsRequestDetailReportDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<WmsDetailWithCodeReport>, List<WmsDetailWithCodeReportDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("差异清单(有条码)报表_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
}
}

9
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -266,6 +266,7 @@ namespace Win.Sfs.SettleAccount
CreateMapWmsOneTimeSale();
CreateMapWMSOutputSum();
CreateMapWMSDiffOutputSum();
CreateMapWMSWithCodeOutputSum();
#endregion
}
@ -282,6 +283,14 @@ namespace Win.Sfs.SettleAccount
{
CreateMap<WmsDetailDiffReport, WmsDetailDiffReportDto>().ReverseMap();
}
/// <summary>
/// 有条码业务
/// </summary>
private void CreateMapWMSWithCodeOutputSum()
{
CreateMap<WmsDetailWithCodeReport, WmsDetailWithCodeReportDto>().ReverseMap();
}
private void CreateMapWMSJit()

76
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs

@ -172,4 +172,80 @@ namespace Win.Sfs.SettleAccount.Entities
public int State { set; get; }
}
/// <summary>
/// 有条码
/// </summary>
public class WmsDetailWithCodeReport : FullAuditedAggregateRootBase<Guid>
{
public WmsDetailWithCodeReport()
{
}
public WmsDetailWithCodeReport(Guid id, string client, string type, string version, string billNum, string switchCode, string materialCode, decimal qty, decimal outputQty, decimal diffQty, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state) : base(id)
{
Version = version;
Type = type;
Client = client;
BillNum = billNum;
SwitchCode = switchCode;
MaterialCode = materialCode;
Qty = qty;
OutputQty = outputQty;
DiffQty = diffQty;
MaterialGroupCode = materialGroupCode;
MaterialGroup = materialGroup;
MaterialDesc = materialDesc;
Remark1 = remark1;
State = state;
}
[Display(Name = "版本号")]
public string Version { set; get; }
[Display(Name = "客户")]
public string Client { set; get; }
[Display(Name = "出库类型")]
public string Type { set; get; }
//[Display(Name = "结算编码")]
//public string SettleCode { set; get; }
//[Display(Name = "销售渠道")]
//public string SaleCode { set; get; }
//[Display(Name = "客户代码")]
//public string ClientCode { set; get; }
[Display(Name = "结算单")]
public string BillNum { set; get; }
[Display(Name = "交货编码")]
public string SwitchCode { set; get; }
[Display(Name = "物料号")]
public string MaterialCode { set; get; }
//[Display(Name = "寄售类别")]
//public string SaleType { set; get; }
[Display(Name = "结算数量")]
public decimal Qty { set; get; }
[Display(Name = "实际出库数量")]
public decimal OutputQty { set; get; }
[Display(Name = "差异数量")]
public decimal DiffQty { set; get; }
//[Display(Name = "开票单价")]
//public decimal Price { set; get; }
//[Display(Name = "结算金额")]
//public decimal Amt { set; get; }
//[Display(Name = "已出库金额")]
//public decimal OutPutAmt { set; get; }
//[Display(Name = "WMS待出库金额")]
//public decimal DiffAmt { set; get; }
[Display(Name = "物料组编码")]
public string MaterialGroupCode { set; get; }
[Display(Name = "物料组(车型)")]
public string MaterialGroup { set; get; }
[Display(Name = "物料组描述")]
public string MaterialDesc { set; get; }
[Display(Name = "备注")]
public string Remark1 { set; get; }
[Display(Name = "状态")]
public int State { set; get; }
}
}

34
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -379,6 +379,9 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsDetailReport(options);
builder.ConfigureWmsDetailDiffReport(options);
//有条码
builder.ConfigureWmsDetailWithCodeReport(options);
#endregion
@ -606,6 +609,37 @@ namespace Win.Sfs.SettleAccount
});
}
/// <summary>
/// 有条码
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
private static void ConfigureWmsDetailWithCodeReport(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsDetailWithCodeReport>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsDetailWithCodeReport", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(50);//必填项
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(100);
b.Property(x => x.Client).IsRequired().HasMaxLength(50);
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(150);
b.Property(x => x.MaterialGroup).HasMaxLength(50);
b.Property(x => x.MaterialGroupCode).HasMaxLength(50);
//创建组合索引
});
}
private static void ConfigureHQMKanban(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{

104
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs

@ -905,6 +905,110 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary>
/// 有条码的业务(可根据条码/K号/底盘号,查询是否结算过,结算期间)
/// </summary>
/// <param name="version"></param>
/// <param name="state"></param>
/// <returns></returns>
public virtual List<WmsOutputSumReport2> GetWmsSearchWithCodeReportList(string version, string state)
{
var _sql = "SELECT\n" +
" ROW_NUMBER ( ) OVER ( ORDER BY Type DESC ) 行号 ,\n" +
" temp1.Client 客户,\n" +
" temp1.Type 出库类型,\n" +
" temp1.BillNum 结算单,\n" +
" temp1.MaterialCode 物料号,\n" +
" temp1.CNumber 通用代码号,\n" +
" Isnull( temp1.Qty, 0 ) 结算数量,\n" +
" Isnull( temp1.OutputQty, 0 ) 实际出库数量,\n" +
" Isnull( temp1.Qty, 0 ) - Isnull( temp1.OutputQty, 0 ) 差异数量,\n" +
" temp1.Price 开票单价,\n" +
" Round( Isnull( temp1.Qty, 0 ) * temp1.Price, 2 ) 结算金额,\n" +
" Round( ( Isnull( temp1.Qty, 0 ) - Isnull( temp1.OutputQty, 0 ) ) * temp1.Price, 2 ) WMS待出库金额,\n" +
" temp2.EstimateType 物料组编码,\n" +
" temp2.EstimateTypeDesc 物料组车型,\n" +
" temp2.MaterialDesc 物料描述,\n" +
" temp1.remark 备注 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" '大众准时化出库' AS Type,\n" +
" '大众' Client,\n" +
" BillNum,\n" +
" MaterialCode,\n" +
" Qty,\n" +
" 0 OutputQty,\n" +
" 0 IsBack,\n" +
" Price,\n" +
" ChassisNumber CNumber,\n" +
" Remark \n" +
" FROM\n" +
" Set_WmsJitOutPutDetial \n" +
" WHERE\n" +
" VERSION = '{0}' \n" +
" AND State = 2 UNION ALL\n" +
" SELECT\n" +
" '大众看板出库' AS Type,\n" +
" '大众' Client,\n" +
" BillNum,\n" +
" MaterialCode,\n" +
" Qty Qty,\n" +
" 0 OutputQty,\n" +
" 0 IsBack,\n" +
" Price,\n" +
" Kanban CNumber,\n" +
" Remark \n" +
" FROM\n" +
" Set_WmsKanbanOutPutDetial \n" +
" WHERE\n" +
" VERSION = '{0}' \n" +
" AND State = 2 UNION ALL\n" +
" SELECT\n" +
" '大众备件条码出库' AS Type,\n" +
" '大众' Client,\n" +
" BillNum,\n" +
" MaterialCode,\n" +
" Qty Qty,\n" +
" 0 OutPutQty,\n" +
" 1 IsBack,\n" +
" Price,\n" +
" OrderBillNum CNumber,\n" +
" Remark \n" +
" FROM\n" +
" Set_WmsSharePart90OutPutDetial \n" +
" WHERE\n" +
" VERSION = '{0}' \n" +
" AND State = 2 UNION ALL\n" +
" SELECT\n" +
" '红旗看板出库' AS Type,\n" +
" '红旗' Client,\n" +
" BillNum,\n" +
" MaterialCode,\n" +
" Qty Qty,\n" +
" 0 OutPutQty,\n" +
" 0 IsBack,\n" +
" Price,\n" +
" Kanban CNumber,\n" +
" Remark \n" +
" FROM\n" +
" Set_WmsHQHKanbanOutPutDetial \n" +
" WHERE\n" +
" VERSION = '{0}' \n" +
" AND State = 2 \n" +
" ) temp1\n" +
" LEFT JOIN ( SELECT MAX ( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp1.MaterialCode = temp2.MaterialCode";
_sql = string.Format(_sql, version, state);
var _query = DbConnection.Query<WmsOutputSumReport2>(_sql, null, null, true, 1200, null);
return _query.ToList();
}
}

4
vue/src/views/pg-fis/basedate/m100Online/budaMB.vue

@ -453,7 +453,7 @@ export default {
* @param {Object} data
*/
getList(data) {
debugger
this.listLoading = true;
let inputParam = {};
if (data != undefined) {
@ -495,7 +495,7 @@ export default {
},
//-
handleReplenishPrint() {
debugger
this.isEdit = true;
if (this.multipleSelection == null || this.multipleSelection.length == 0) {
this.$message({

677
vue/src/views/pg-fis/basedate/m100Online/budaZHB.vue

@ -0,0 +1,677 @@
<!--补打柱护板-->
<template>
<div class="cr-body-content">
<div ref="box">
<flexbox class="content-header">
<el-form
:model="listQuery"
ref="queryForm"
v-show="showSearch"
:inline="true"
>
<el-form-item label="大众顺序号">
<el-col :span="11">
<el-form-item prop="beginHostSN">
<el-input
v-model="listQuery.beginHostSN"
placeholder=""
clearable
size="small"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
<el-col class="line" :span="2" style="width: 12px; text-align: center">-</el-col>
<el-col :span="11">
<el-form-item prop="endHostSN">
<el-input
v-model="listQuery.endHostSN"
placeholder=""
clearable
size="small"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="底盘号码">
<el-col :span="11">
<el-form-item prop="beginVin">
<el-input
v-model="listQuery.beginVin"
placeholder=""
clearable
size="small"
style="width: 140px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
<el-col class="line" :span="2" style="width: 12px; text-align: center">-</el-col>
<el-col :span="11">
<el-form-item prop="endVin">
<el-input
v-model="listQuery.endVin"
placeholder=""
clearable
size="small"
style="width: 140px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="上线日期">
<el-date-picker
v-model="listQuery.onlineTimeValue"
size="small"
style="width: 380px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:default-time="['00:00:00', '23:59:59']"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleFilter"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery('queryForm')"
>重置</el-button
>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-s-shop"
@click="handleReplenishPrint()"
>补打(支持多选)</el-button
>
</el-form-item>
</el-form>
</flexbox>
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeightZHB"
:cell-style="cellStyle"
:header-cell-style="headerRowStyle"
size="small"
stripe
border
highlight-current-row
style="width: 100%; margin-top: -25px"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
:row-key="getRowKeys"
:expand-row-keys="expands"
@expand-change="exChange"
>
<el-table-column type="selection" width="44px" sortable="false"></el-table-column>
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
style="margin-bottom: -5px; float: right"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
</div>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination";
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../components/CRMTableHead";
import importExcel from "@/components/ImportExcel-vw";
import Lockr from "lockr";
import { mapGetters } from "vuex";
import moment from "moment";
import Detail from "./detail.vue";
import { downloadFile } from "@/utils/crmindex.js";
import qs from "qs";
export default {
name: "M100Online-budaZHB",
components: { Pagination, CRMTableHead, importExcel, Detail },
directives: { permission },
filters: {
IsCustomerSignFilter(status) {
//
const statusMap = {
true: "是",
false: "否",
};
return statusMap[status];
},
},
props: {
customerInfosZHB: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
crmType: "M100Online-ZHB",
getRowKeys: (row) => {
return row.id; //id
},
expands: [], //id
PrintTimeValue: [],
activeNames: ["1"],
multipleSelection: [],
valueSelect: "",
customerInfos: [],
dialogOptions: [],
versionValue: "",
searchContent: "", //
showExcelImport: false,
form: {},
drawer: false,
list: null,
totalCount: 0,
listLoading: true,
customerInfo: {
printType: "",
productLine: "",
},
//
filterObj: {
type: Object,
default: () => {
return {};
},
},
listQuery: {
SkipCount: 0,
MaxResultCount: 15,
beginVin: undefined,
endVin: undefined,
beginHostSN: undefined,
endHostSN: undefined,
OnlineTimeBegin: undefined,
OnlineTimeEnd: undefined,
},
listPLQuery: {
BillType: 2,
//UserId: this.userinfo.UserId,
},
hostSNQuery: {
productLine: undefined,
},
hostCheckQuery: {
printType: undefined, //0:;1:;2:;
productLine: undefined,
beginHostSN: undefined,
endHostSN: undefined,
beginVin: undefined,
endVin: undefined,
},
hostPrintQuery: {
printType: undefined, //0:;1:;2:;
productLine: undefined,
beginHostSN: undefined,
endHostSN: undefined,
beginVin: undefined,
endVin: undefined,
},
fileQuery: {
dataname: undefined,
},
form: {
details: [],
},
page: 1,
//
showSearch: true,
drawer: false,
dialogFormVisible: false,
formTitle: "",
isEdit: false,
formLoading: false,
tableHeight: document.documentElement.clientHeight - 335,
tableHeightZHB: document.documentElement.clientHeight - 300,
detailTableHeight: 250,
details: [], //
PLList: [], //线
isShowHostSN: false,
isShowVin: false,
isShowState: true,
};
},
mounted() {
this.$nextTick(() => {
var offsetHei = document.documentElement.clientHeight;
//console.log(offsetHei);
let boxH = this.$refs.box.offsetHeight;
this.tableHeight = offsetHei - boxH - 57 - 79; //57footer79
//this.tableHeight = offsetHei -260
});
},
created() {
this.getList();
},
watch: {
customerInfosZHB: {
handler(newVal) {
debugger
console.log("柱护板-接收的父组件的值:" + JSON.stringify(newVal));
if (newVal == "" || newVal == "undefined") {
//TODO
} else {
newVal.forEach((element) => {
this.customerInfo.printType = 2; //2
this.customerInfo.productLine = element.ProductLine;
});
if (this.customerInfo.productLine != "") {
this.getList();
}
}
},
immediate: true,
},
},
computed: {
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({ label: "大众顺序号", prop: "hostSN", width: 80 });
tempsTabs.push({
label: "底盘号",
prop: "vin",
width: 160,
});
tempsTabs.push({
label: "KNR",
prop: "knr",
width: 100,
});
tempsTabs.push({
label: "M100上线时间",
prop: "onlineTime",
width: 150,
});
tempsTabs.push({
label: "M100接收时间",
prop: "receiveTime",
width: 150,
});
tempsTabs.push({
label: "车型代码",
prop: "vehicleModelCode",
width: 100,
});
tempsTabs.push({
label: "版本",
prop: "version",
width: 100,
});
tempsTabs.push({
label: "产线",
prop: "productLine",
width: 80,
});
tempsTabs.push({
label: "柱护板状态",
prop: "printBillNum",
width: 110,
});
tempsTabs.push({
label: "备注",
prop: "remark",
width: 80,
});
tempsTabs.push({
label: "R100上线时间",
prop: "r100OnlineTime",
width: 150,
});
tempsTabs.push({
label: "R100接收时间",
prop: "r100ReceiveTime",
width: 150,
});
return tempsTabs;
},
...mapGetters(["userInfo"]), //
},
methods: {
//base64dataurlbase64
dataURLtoBlob(dataurl) {
var bstr = atob(dataurl.substring(dataurl.indexOf(",") + 1));
var n = bstr.length;
var u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: "application/pdf" });
},
doPrint(val) {
var ordonnance = document.getElementById(val).contentWindow;
setTimeout(() => {
// window.print()
ordonnance.print();
this.pdfLoading = false;
}, 100);
},
printpdf(dataResult) {
//dataResultbase64
let blob = this.dataURLtoBlob(dataResult);
var date = new Date().getTime();
var ifr = document.createElement("iframe");
ifr.style.frameborder = "no";
ifr.style.display = "none";
ifr.style.pageBreakBefore = "always";
ifr.setAttribute("id", "printPdf" + date);
ifr.setAttribute("name", "printPdf" + date);
ifr.src = window.URL.createObjectURL(blob);
document.body.appendChild(ifr);
this.doPrint("printPdf" + date);
window.URL.revokeObjectURL(ifr.src); // URL
this.dialogFormVisible = false;
},
/**
* DataGrid只展开当前行
* @param {Object} row
* @param {Object} rowList
*/
exChange(row, rowList) {
//this.listLoading = true;
var that = this;
if (rowList.length) {
that.expands = [];
if (row) {
that.expands.push(row.id); // id
}
} else {
that.expands = [];
}
},
/**
* 取列表数据
* @param {Object} data
*/
getList(data) {
//debugger
this.listLoading = true;
let inputParam = {};
if (data != undefined) {
inputParam.SkipCount = (this.page - 1) * data.limit;
} else {
inputParam.SkipCount = (this.page - 1) * 15;
}
inputParam.vinBegin = this.listQuery.beginVin;
inputParam.vinEnd = this.listQuery.endVin;
inputParam.hostSNBegin = this.listQuery.beginHostSN;
inputParam.hostSNEnd = this.listQuery.endHostSN;
if (this.listQuery.onlineTimeValue !== undefined) {
inputParam.onlineTimeBegin = this.listQuery.onlineTimeValue[0];
inputParam.onlineTimeEnd = this.listQuery.onlineTimeValue[1];
}
if (this.customerInfo.productLine != "") {
inputParam.productLine = this.customerInfo.productLine;
}
console.log('取柱护板补打列表replenish-print-zhb-list方法输入参数:' + JSON.stringify(this.listQuery));
this.$axios
.gets(
"/api/newjit/bill-m100/replenish-print-zhb-list",
inputParam
)
.then((response) => {
this.list = response.items;
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
//-
handleReplenishPrint() {
debugger
this.isEdit = true;
if (this.multipleSelection == null || this.multipleSelection.length == 0) {
this.$message({
message: "请选择要补打的单据!",
type: "warning",
});
return;
} else {
//
let beginVin1 = this.multipleSelection[0].vin;
let endVin1 = this.multipleSelection[this.multipleSelection.length -1].vin;
var params = {
printType: 2,
productLine: this.customerInfo.productLine,
beginVin: beginVin1,
endVin: endVin1,
m100IdList: []
};
this.multipleSelection.forEach(itm => {
params.m100IdList.push(itm.id);
});
console.log("柱护板补打输入参数:" + JSON.stringify(params));
this.$axios
.posts("/api/newjit/bill-m100/print-zhuhuban-packing-list", params)
.then((response) => {
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
this.fileQuery.dataname = JSON.stringify(response.item);
console.log(
"柱护板-调用Handlers/Handler1.ashx?report=zhuhuban传的值:" +
JSON.stringify(this.fileQuery.dataname)
);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=zhuhuban",
qs.stringify(this.fileQuery)
)
.then((response) => {
this.printpdf(response); //
this.getList(); //
});
}
})
.catch(() => {});
}
},
/** 重置按钮操作 */
resetQuery(refName) {
this.$refs[refName].resetFields();
this.listQuery.OnlineTimeValue = [];
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.listQuery.SkipCount = 1;
//this.getList();
},
/** DataGrid格式化显示字段 */
fieldFormatter(row, column) {
if (column.property === "billStatus") {
return { 1: "未匹配", 2: "未打印", 3: "已打印" }[row[column.property]];
}
if (column.property === "printBillNum") {
if (row[column.property] != null && row[column.property].length > 0)
{
return "柱护板已打印"
}
else
{
return "柱护板未打印"
}
}
if (column.property == "printDate" || column.property == "receiveTime") {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
}
return row[column.property] || "--";
},
/**
* 搜索按钮单击事件
*/
handleFilter() {
this.page = 1;
this.getList();
},
/**
* DataGrid列排序事件未使用
* @param {Object} data
*/
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
/**
* DataGrid多选触发事件
* @param {Object} val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* DataGrid通过回调控制style
*/
cellStyle({ row, column, rowIndex, columnIndex }) {
if (column.property === "qty") {
return { textAlign: "right" };
} else {
return { textAlign: "left" };
}
},
/** DataGrid通过回调控制表头style */
headerRowStyle({ row, column, rowIndex, columnIndex }) {
if (column.property === "qty") {
return { textAlign: "right", background: "#FAFAFA" };
} else {
return { textAlign: "left", background: "#FAFAFA" };
}
},
/**
* DataGrid行单击事件
* @param {Object} row
* @param {Object} column
* @param {Object} event
*/
handleRowClick(row, column, event) {
//this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
closeDialog() {},
},
};
</script>
<style lang="scss" scoped>
@import "../../../pg-fis/styles/crmtable.scss";
.divider1 {
margin: 0;
}
.divider2 {
margin: 10px;
margin-bottom: 20px;
width: 95%;
}
.label1 {
margin-left: 5px;
margin-right: 5px;
}
</style>

30
vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue

@ -112,6 +112,19 @@
>
<strong>重新打印柱护板</strong></el-button
>
<el-button
v-show="this.listQuery.productType === 2"
@click="drawerbudaZHBPrint = true"
size="mini"
type="warning"
plain
>
<strong>柱护板补打</strong></el-button
>
<el-button
v-show="this.listQuery.productType === 2"
@click="drawerZHBDelete = true"
@ -187,6 +200,20 @@
>
<RepetitionZHB v-bind:customerInfosZHB="customerInfosZHB"></RepetitionZHB>
</el-drawer>
<!--柱护板补打-->
<el-drawer
title="柱护板补打"
:visible.sync="drawerbudaZHBPrint"
direction="rtl"
size="65%"
>
<budaZHB v-bind:customerInfosZHB="customerInfosZHB"></budaZHB>
</el-drawer>
<!--柱护板重打和作废-->
<el-drawer
title="柱护板作废"
@ -426,6 +453,7 @@ import { downloadFile } from "@/utils/crmindex.js";
import qs from "qs";
import RepetitionMB from "./RepetitionMB.vue";
import budaMB from "./budaMB.vue";
import budaZHB from "./budaZHB.vue";
import RepetitionZHB from "./RepetitionZHB.vue";
import ScrapMB from "./ScrapMB.vue";
import ScrapZHB from "./ScrapZHB.vue";
@ -445,6 +473,7 @@ export default {
ScrapMB,
ScrapZHB,
budaMB,
budaZHB
},
directives: { permission },
filters: {
@ -480,6 +509,7 @@ export default {
isDisable: false,
drawerMBPrint: false,
drawerbudaMBPrint: false,
drawerbudaZHBPrint: false, //
drawerMBDelete: false,
drawerZHBPrint: false,
drawerZHBDelete: false,

513
vue/src/views/pg-fis/basedate/partSwitch/index.vue

@ -0,0 +1,513 @@
<!--零件切换模块信息管理页-->
<template>
<div class="cr-body-content">
<div ref="box">
<flexbox class="content-header">
<el-form :model="listQuery" ref="queryForm" v-show="showSearch" :inline="true">
<el-form-item label="源零件编码" prop="sourcePartCode" class="forimitem">
<el-input v-model="listQuery.sourcePartCode" placeholder="请输入源零件编码" clearable size="small" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="源零件名称" prop="sourcePartName" class="forimitem">
<el-input v-model="listQuery.sourcePartName" placeholder="请输入源零件名称" clearable size="small" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="目标零件编码" prop="targetPartCode" class="forimitem">
<el-input v-model="listQuery.targetPartCode" placeholder="请输入目标零件编码" clearable size="small" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="目标零件名称" prop="targetPartName" class="forimitem">
<el-input v-model="listQuery.targetPartName" placeholder="请输入目标零件名称" clearable size="small" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item class="formitem">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleFilter">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery('queryForm')">重置</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" style="margin-left: 15px" @click="handleDownload()">导出(Excel)
</el-button>
</el-form-item>
<el-form-item style="margin-bottom: 0px; ">
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="handleCreate">新增
</el-button>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-edit" @click="handleUpdate">修改
</el-button>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-delete" @click="handleDelete">删除
</el-button>
</el-form-item>
</el-form>
</flexbox>
</div>
<div class="l-table">
<!--表格渲染-->
<el-table ref="multipleTable" v-loading="listLoading" element-loading-text="拼命加载中..." element-loading-spinner="el-icon-loading"
class="cr-table" :data="tableData" :height="tableHeight" :cell-style="cellStyle" :header-cell-style="headerRowStyle"
size="small" stripe border highlight-current-row style="width: 100%" @sort-change="sortChange" @selection-change="handleSelectionChange"
@row-click="handleRowClick">
<el-table-column type="selection" width="44px"></el-table-column>
<el-table-column v-for="(item, index) in getDefaultField" :key="index" :prop="item.prop" :label="item.label"
:min-width="item.width" :formatter="fieldFormatter" sortable="custom" show-overflow-tooltip :gutter="0">
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<!--表单渲染-->
<el-dialog :visible.sync="dialogFormVisible" :close-on-click-modal="false" :title="formTitle" width="700px" @close="closeDialog">
<el-form ref="form" :inline="true" :model="childFormModel" :rules="rules" size="small" label-width="120px">
<el-row>
<el-col :span="4">
<el-form-item label="源零件编码:" required />
</el-col>
<el-col :span="20">
<el-form-item prop="sourcePartCode">
<el-input style="width: 400px" v-model="childFormModel.sourcePartCode" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-form-item label="目标零件编码:" required />
</el-col>
<el-col :span="20">
<el-form-item prop="targetPartCode">
<el-input style="width: 400px" v-model="childFormModel.targetPartCode" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<!--表格渲染-->
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialogFormVisible = false">取消</el-button>
<el-button v-loading="formLoading" type="primary" @click="save()">确认</el-button>
</div>
</el-dialog>
</div>
<div class="table-footer">
<!-- 分页控件 -->
<pagination v-show="totalCount > 0" :total="totalCount" :page.sync="pageIndex" :limit.sync="listQuery.maxResultCount"
@pagination="getList" />
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination";
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../components/CRMTableHead";
import importExcel from "@/components/ImportTxt";
import Lockr from "lockr";
import moment from "moment";
//import Detail from "./detail.vue";
import {
downloadFile
} from "@/utils/crmindex.js";
export default {
name: "PartSwitch",
components: {
Pagination,
CRMTableHead,
importExcel,
//Detail
},
directives: {
permission
},
// filters: {
// IsCustomerSignFilter(status) {
// //
// const statusMap = {
// true: "",
// false: "",
// };
// return statusMap[status];
// },
// },
data() {
return {
rules: {
sourcePartCode: [{
required: true,
message: "必须输入!",
trigger: "blur"
}],
targetPartCode: [{
required: true,
message: "必须输入!",
trigger: "blur"
}],
},
tableData: null,
totalCount: 0,
listLoading: true,
listQuery: {
sourcePartCode: undefined,
sourcePartName: undefined,
targetPartCode: undefined,
targetPartName: undefined,
maxResultCount: 15,
skipCount: 0
},
childFormModel: {
},
//
pageIndex: 1,
//
showSearch: true,
multipleSelection: [],
dialogFormVisible: false,
formTitle: "",
isEdit: false,
formLoading: false,
tableHeight: document.documentElement.clientHeight - 280,
};
},
mounted() {
this.$nextTick(() => {
var offsetHei = document.documentElement.clientHeight;
//console.log(offsetHei);
let boxH = this.$refs.box.offsetHeight;
this.tableHeight = offsetHei - boxH - 57 - 79; //57footer79
});
},
created() {
debugger
this.getList();
},
computed: {
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({
label: "源零件编码",
prop: "sourcePartCode",
width: 150,
});
tempsTabs.push({
label: "源零件名称",
prop: "sourcePartName",
width: 200,
});
tempsTabs.push({
label: "目标零件编码",
prop: "targetPartCode",
width: 150,
});
tempsTabs.push({
label: "目标零件名称",
prop: "targetPartName",
width: 200,
});
tempsTabs.push({
label: "创建时间",
prop: "creationTime",
width: 180,
});
console.log("字段列表:" + JSON.stringify(tempsTabs));
return tempsTabs;
},
},
methods: {
/**
* 子窗口保存按钮事件
*/
save() {
let _this = this;
this.$refs.form.validate((valid) => {
if (valid) {
console.log("保存参数:" + JSON.stringify(_this.childFormModel));
_this.formLoading = true;
if (_this.isEdit) {
//
_this.$axios
.puts("/api/newjit/part-switch/" + _this.childFormModel.id, _this.childFormModel)
.then((response) => {
_this.formLoading = false;
_this.$notify({
title: "成功",
message: "更新成功",
type: "success",
duration: 2000,
});
_this.dialogFormVisible = false;
_this.getList();
})
.catch(() => {
_this.formLoading = false;
});
} else {
//insert
console.log(JSON.stringify(_this.childFormModel));
_this.$axios
.posts("/api/newjit/part-switch", _this.childFormModel)
.then((response) => {
_this.formLoading = false;
_this.$notify({
title: "成功",
message: "新增成功",
type: "success",
duration: 2000,
});
_this.dialogFormVisible = false;
_this.getList();
})
.catch(() => {
_this.formLoading = false;
});
}
}
});
},
/** 新增 */
handleCreate() {
if (this.$refs["form"] !== undefined) {
this.$nextTick(() => {
this.$refs["form"].resetFields();
});
}
this.formTitle = "新增";
this.isEdit = false;
this.childFormModel = {};
this.dialogFormVisible = true;
},
/** 修改 */
handleUpdate(row) {
this.formTitle = "修改";
this.isEdit = true;
if (this.multipleSelection.length != 1) {
this.$message({
message: "编辑必须选择单行",
type: "warning",
});
return;
} else {
this.fetchData(this.multipleSelection[0].id);
this.dialogFormVisible = true;
}
},
/** 删除 */
handleDelete(row) {
if (this.multipleSelection.length != 1) {
this.$message({
message: "编辑必须选择单行",
type: "warning",
});
return;
}
this.$confirm(
"是否删除记录" + this.multipleSelection[0].sourcePartCode + "?",
"提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
this.$axios
.deletes(
"/api/newjit/part-switch/" + this.multipleSelection[0].id
)
.then((response) => {
this.$notify({
title: "成功",
message: "删除成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
fetchData(id) {
//
this.$axios
.gets("/api/newjit/part-switch/" + id)
.then((response) => {
this.childFormModel = response.item;
});
},
/** 导出功能 */
handleDownload() {
this.listLoading = true;
console.log(JSON.stringify(this.listQuery));
this.$axios
.posts("/api/newjit/part-switch/export", this.listQuery)
.then((res) => {
let filename = res.item;
this.$axios
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename)
.then((response) => {
if (filename.indexOf("_") != -1) {
let downName =
filename.slice(0, filename.lastIndexOf("_")) +
filename.slice(filename.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, filename);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
});
});
this.listLoading = false;
},
/** 重置按钮操作 */
resetQuery(refName) {
this.$refs[refName].resetFields();
this.handleQuery();
this.listQuery.TargetPartName = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.listQuery.skipCount = 0;
this.getList();
},
/** 格式化字段 */
fieldFormatter(row, column) {
return row[column.property];
},
getList() {
let _this = this;
this.listLoading = true;
console.log("getList方法参数:" + JSON.stringify(this.listQuery));
this.listQuery.skipCount = (this.pageIndex - 1) * this.listQuery.maxResultCount;
this.$axios
.gets("/api/newjit/part-switch/list", this.listQuery)
.then((response) => {
_this.tableData = response.items;
console.log("getList方法结果:" + JSON.stringify(_this.tableData));
_this.totalCount = response.totalCount;
setTimeout(() => {
//
_this.listLoading = false;
}, 500);
})
.catch(() => {
_this.listLoading = false;
});
},
handleFilter() {
this.pageIndex = 1;
this.getList();
},
sortChange(data) {
const {
prop,
order
} = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
/** 通过回调控制style */
cellStyle({
row,
column,
rowIndex,
columnIndex
}) {
if (column.property === "qty") {
return {
textAlign: "right"
};
} else {
return {
textAlign: "left"
};
}
},
/** 通过回调控制表头style */
headerRowStyle({
row,
column,
rowIndex,
columnIndex
}) {
if (column.property === "qty") {
return {
textAlign: "right",
background: "#FAFAFA"
};
} else {
return {
textAlign: "left",
background: "#FAFAFA"
};
}
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
closeDialog() {
//this.multipleSelection = [];//
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../pg-fis/styles/crmtable.scss";
.divider1 {
margin: 0;
//width: 100%;
}
.formitem {
margin-bottom: 0;
}
</style>
Loading…
Cancel
Save