xunyu.guo
3 years ago
52 changed files with 6949 additions and 671 deletions
Binary file not shown.
@ -1,264 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using AutoMapper; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
|
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Utils; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using EFCore.BulkExtensions; |
|||
using System.IO; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; |
|||
using Win.Sfs.SettleAccount.FISes; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Shouldly; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using System.Data.Common; |
|||
using Volo.Abp.Uow; |
|||
using Volo.Abp; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|||
using Magicodes.ExporterAndImporter.Core.Models; |
|||
|
|||
using TaskJob.Services; |
|||
using TaskJob.EventArgs; |
|||
using Win.Sfs.SettleAccount.Entities.WMS; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Repository; |
|||
using WY.NewJit.Extends.PaiGe.WMS; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|||
{ |
|||
/// <summary>
|
|||
/// 大众准时化结算明细导入-R3已结
|
|||
/// </summary>
|
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/wms")] |
|||
public class WMSAppService : |
|||
ApplicationService |
|||
{ |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> _wmsRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> _wmsVersionRepository; |
|||
private readonly WMSEfCoreRepository<WmsJitOutPutDetial> _wmsefRespository; |
|||
|
|||
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|||
|
|||
private readonly TaskJobService _service; |
|||
/// <summary>
|
|||
/// 构建方法
|
|||
/// </summary>
|
|||
/// <param name="guidGenerator">构建UID</param>
|
|||
|
|||
/// <param name="repository">仓储接口</param>
|
|||
/// <param name="cache">缓存</param>
|
|||
public WMSAppService( |
|||
|
|||
ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> wmsRepository, |
|||
|
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
|
|||
ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> wmsVersionRepository, |
|||
WMSEfCoreRepository<WmsJitOutPutDetial> wmsefRespository, |
|||
WMSEfCoreRepository<TB_BILL> wmstbRespository |
|||
) |
|||
{ |
|||
_job = job; |
|||
_wmstbRespository = wmstbRespository; |
|||
_wmsRepository = wmsRepository; |
|||
_wmsVersionRepository = wmsVersionRepository; |
|||
_wmsefRespository = wmsefRespository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 选择结算明细任务列表,选择相关任务合拼导期间出库表
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsJitOutPut")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<string> WmsJitOutPut(List<Guid> ids, string version) |
|||
{ |
|||
|
|||
var _joblist=_job.Where(p => ids.Contains(p.Id)).ToList(); |
|||
|
|||
|
|||
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); |
|||
|
|||
List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>(); |
|||
foreach (var filename in fileList) |
|||
{ |
|||
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; |
|||
IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter(); |
|||
var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath); |
|||
foreach (var itm in _list) |
|||
{ |
|||
var list = itm.Value.Data.ToList(); |
|||
_lst.AddRange(list.ToArray()); |
|||
} |
|||
} |
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
|
|||
|
|||
var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync(); |
|||
|
|||
|
|||
var _billNum="T" + DateTime.Now.ToString("yyyyMMddhhmmssdddd"); |
|||
|
|||
|
|||
|
|||
|
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() where tm1==null |
|||
select itm1; |
|||
|
|||
|
|||
var _wmslst=query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
|
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0 }); |
|||
int _count= _wmsVersionRepository.Count(p => p.Version == version); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new List<WmsJitOutPut>(); |
|||
_version.Add(new WmsJitOutPut { Version = version, BillNum = _billNum, Creator = CurrentUser.Email }); |
|||
await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version); |
|||
} |
|||
else |
|||
{ |
|||
var _ls= _wmsVersionRepository.Where(p => p.Version == version).ToList(); |
|||
foreach (var itm in _ls) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsVersionRepository.UpdateManyAsync(_ls); |
|||
} |
|||
//_wmsRepository.Where(p=>p)
|
|||
|
|||
return _billNum; |
|||
|
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("WmsJitOutPut-Pass")] |
|||
|
|||
public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null) |
|||
{ |
|||
if (p_list != null) |
|||
{ |
|||
List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>(); |
|||
if (p_list.Count() > 0) |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync(); |
|||
} |
|||
else |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => p.Version == version && p.State != 2).ToListAsync(); |
|||
} |
|||
if (_ls.Count() > 0) |
|||
{ |
|||
var _first = _ls.FirstOrDefault(); |
|||
var _guid = GuidGenerator.Create(); |
|||
foreach (var itm in _ls) |
|||
{ |
|||
itm.TaskId = _guid; |
|||
} |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail",_first.BillNum, 0,0 ,_guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsJitOutPutDetail", |
|||
InterfaceType = "1", |
|||
Version = version, |
|||
SettleAccountState = 0, |
|||
WmsState=0 |
|||
|
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
|
|||
} |
|||
} |
|||
//_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
|
|||
//_wmsDapper.DbConnection.ConnectionTimeout = 1200;
|
|||
//_wmsRepository.Where(p=>p)
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
|
|||
[HttpGet] |
|||
[Route("WmsJitOutPut-Cancel")] |
|||
|
|||
public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version) |
|||
{ |
|||
|
|||
//var _guid = GuidGenerator.Create();
|
|||
//foreach (var itm in _ls)
|
|||
//{
|
|||
// itm.TaskId = _guid;
|
|||
//}
|
|||
var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync(); |
|||
var _first = _ls.FirstOrDefault(); |
|||
if (_ls.Count>0) |
|||
{ |
|||
var _guid = GuidGenerator.Create(); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 }); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsJitOutPutDetail", |
|||
InterfaceType = "1", |
|||
Version = version, |
|||
WmsState = 0, |
|||
SettleAccountState=0 |
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
|
|||
} |
|||
return true; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,439 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using AutoMapper; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
|
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Utils; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using EFCore.BulkExtensions; |
|||
using System.IO; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; |
|||
using Win.Sfs.SettleAccount.FISes; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Shouldly; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using System.Data.Common; |
|||
using Volo.Abp.Uow; |
|||
using Volo.Abp; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|||
using Magicodes.ExporterAndImporter.Core.Models; |
|||
|
|||
using TaskJob.Services; |
|||
using TaskJob.EventArgs; |
|||
using Win.Sfs.SettleAccount.Entities.WMS; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Repository; |
|||
using WY.NewJit.Extends.PaiGe.WMS; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|||
{ |
|||
/// <summary>
|
|||
/// wms出库
|
|||
/// </summary>
|
|||
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/wmsjitoutput")] |
|||
public class WMSJitAppService : |
|||
ApplicationService |
|||
{ |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> _wmsRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> _wmsVersionRepository; |
|||
private readonly WMSEfCoreRepository<WmsJitOutPutDetial> _wmsefRespository; |
|||
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|||
private readonly IExcelImportAppService _excelImportService; |
|||
private readonly TaskJobService _service; |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="wmsRepository"></param>
|
|||
/// <param name="job"></param>
|
|||
/// <param name="wmsVersionRepository"></param>
|
|||
/// <param name="wmsefRespository"></param>
|
|||
/// <param name="wmstbRespository"></param>
|
|||
public WMSJitAppService( |
|||
IExcelImportAppService excelImportService, |
|||
ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> wmsRepository, |
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> wmsVersionRepository, |
|||
WMSEfCoreRepository<WmsJitOutPutDetial> wmsefRespository, |
|||
WMSEfCoreRepository<TB_BILL> wmstbRespository |
|||
) |
|||
{ |
|||
_job = job; |
|||
_wmstbRespository = wmstbRespository; |
|||
_wmsRepository = wmsRepository; |
|||
_wmsVersionRepository = wmsVersionRepository; |
|||
_wmsefRespository = wmsefRespository; |
|||
_excelImportService = excelImportService; |
|||
} |
|||
|
|||
|
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) |
|||
{ |
|||
var _billNum = "T" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.ExtendExcelImport<WmsJitOutPutDetial>(files, _excelImportService); |
|||
List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>(); |
|||
var _lsCopy = new List<WmsJitOutPutDetial>(); |
|||
foreach (var itm in result) |
|||
{ |
|||
WmsJitOutPutDetial _detail = new WmsJitOutPutDetial( |
|||
GuidGenerator.Create(), |
|||
itm.WmsBillNum, |
|||
itm.KennCode, |
|||
itm.ChassisNumber, |
|||
itm.MaterialCode, |
|||
itm.MaterialDesc, |
|||
itm.MaterialGroup, |
|||
string.Empty, |
|||
string.Empty, |
|||
0, |
|||
string.Empty, |
|||
string.Empty, |
|||
version, |
|||
itm.ParentMaterialCode, |
|||
itm.BillNum, |
|||
GuidGenerator.Create() |
|||
, string.Empty |
|||
, itm.Qty |
|||
); |
|||
_lsCopy.Add(_detail); |
|||
} |
|||
_lst.AddRange(_lsCopy.ToArray()); |
|||
|
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsJitOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email); |
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
return _billNum; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
private async Task<long> GetCountAsync(WmsJitOutPutDetialRequestDto input) |
|||
{ |
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|||
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsJitOutPutRequestDto input) |
|||
{ |
|||
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库主表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsJitOutPut>> GetListAsync( WmsJitOutPutRequestDto input) |
|||
{ |
|||
|
|||
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
|
|||
|
|||
return new PagedResultDto<WmsJitOutPut>(totalCount, entities); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库明细
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitDetailList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsJitOutPutDetial>> GetListAsync(WmsJitOutPutDetialRequestDto input) |
|||
{ |
|||
|
|||
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value =input.BillNum }); |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
//var dtoDetails = ObjectMapper.Map<List<WmsJitOutPutDetial>, List<WmsJitOutPutDetialDto>>(entities);
|
|||
|
|||
return new PagedResultDto<WmsJitOutPutDetial>(totalCount, entities); |
|||
} |
|||
/// <summary>
|
|||
/// 任务明细标记已确认
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitOutPutAudit")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<bool> WmsJitAudit(List<Guid> ids) |
|||
{ |
|||
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync(); |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
itm.FileName = "已确认"; |
|||
await _job.UpdateAsync(itm); |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 任务明细标记已确认
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitOutPutCancel")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<bool> WmsJitCancel(List<Guid> ids) |
|||
{ |
|||
var _joblist = await _job.Where(p => ids.Contains(p.Id) && p.FileName=="已确认").ToListAsync(); |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
itm.FileName = "取消确认"; |
|||
await _job.UpdateAsync(itm); |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 选择任务,生成出库单,只包含已确认的单据
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitOutPut")] |
|||
public async Task<string> WmsJitOutPut(WmsJitRequestDto input) |
|||
{ |
|||
var _billNum = "T" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
var _joblist=_job.Where(p => input.Guids.Contains(p.Id) && p.FileName== "已确认").ToList(); |
|||
if (_joblist.Count() > 0) |
|||
{ |
|||
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); |
|||
List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>(); |
|||
foreach (var filename in fileList) |
|||
{ |
|||
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; |
|||
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath); |
|||
var _list = _excelHelper.ExcelToList<WmsJitOutPutDetial>(); |
|||
var _lsCopy = new List<WmsJitOutPutDetial>(); |
|||
foreach (var itm in _list) |
|||
{ |
|||
WmsJitOutPutDetial _detail = new WmsJitOutPutDetial( |
|||
GuidGenerator.Create(), |
|||
itm.WmsBillNum, |
|||
itm.KennCode, |
|||
itm.ChassisNumber, |
|||
itm.MaterialCode, |
|||
itm.MaterialDesc, |
|||
itm.MaterialGroup, |
|||
string.Empty, |
|||
string.Empty, |
|||
0, |
|||
string.Empty, |
|||
string.Empty, |
|||
input.Version, |
|||
itm.ParentMaterialCode, |
|||
itm.BillNum, |
|||
GuidGenerator.Create() |
|||
,string.Empty |
|||
,itm.Qty |
|||
); |
|||
_lsCopy.Add(_detail); |
|||
} |
|||
_lst.AddRange(_lsCopy.ToArray()); |
|||
} |
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version ==input.Version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0 , BatchSize=10000}); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum==_billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsJitOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); |
|||
//var _ls = new List<WmsJitOutPut>();
|
|||
//_ls.Add(_version);
|
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
foreach (var job in _joblist) |
|||
{ |
|||
job.FileName = _billNum; |
|||
await _job.UpdateAsync(job); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
_billNum = string.Empty; |
|||
} |
|||
return _billNum; |
|||
} |
|||
/// <summary>
|
|||
/// 出库界面功能,核准出库功能
|
|||
/// </summary>
|
|||
/// <param name="version"></param>
|
|||
/// <param name="p_list"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitOutPut-Pass")] |
|||
public async Task<bool> WmsJitOutPutPass(WmsJitRequestDto input) |
|||
{ |
|||
if (input.Guids != null) |
|||
{ |
|||
List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>(); |
|||
if (input.Guids.Count() > 0) |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State != 2).ToListAsync(); |
|||
} |
|||
else |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => p.Version ==input.Version && p.BillNum==input.BillNum && p.State != 2).ToListAsync(); |
|||
} |
|||
if (_ls.Count() > 0) |
|||
{ |
|||
foreach (var itm in _ls) |
|||
{ |
|||
itm.State = 1; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkUpdateAsync(_ls); |
|||
//var _first = _ls.FirstOrDefault();
|
|||
//var _guid = GuidGenerator.Create();
|
|||
//foreach (var itm in _ls)
|
|||
//{
|
|||
// itm.TaskId = _guid;
|
|||
//}
|
|||
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
|
|||
//var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail",_first.BillNum, 0,0 ,_guid)
|
|||
//{
|
|||
// TaskId = _guid,
|
|||
// SourceBillNum = _first.BillNum,
|
|||
// TableName = "WmsJitOutPutDetail",
|
|||
// InterfaceType = "1",
|
|||
// Version = version,
|
|||
// SettleAccountState = 0,
|
|||
// WmsState=0
|
|||
|
|||
//};
|
|||
//var _l = new List<TS_UNI_API>();
|
|||
//_l.Add(uniapi);
|
|||
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
|
|||
|
|||
} |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
/// <summary>
|
|||
///出库界面功能, 撤销核准出库
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsJitOutPut-Cancel")] |
|||
public async Task<bool> WmsJitOutPutCancel(WmsJitRequestDto input) |
|||
{ |
|||
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 2).ToListAsync(); |
|||
var _first = _ls.FirstOrDefault(); |
|||
if (_ls.Count > 0) |
|||
{ |
|||
//var _guid = GuidGenerator.Create();
|
|||
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
|
|||
//var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
|
|||
//{
|
|||
// TaskId = _guid,
|
|||
// SourceBillNum = _first.BillNum,
|
|||
// TableName = "WmsJitOutPutDetail",
|
|||
// InterfaceType = "1",
|
|||
// Version = version,
|
|||
// WmsState = 0,
|
|||
// SettleAccountState=0
|
|||
//};
|
|||
//var _l = new List<TS_UNI_API>();
|
|||
//_l.Add(uniapi);
|
|||
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
|
|||
} |
|||
return true; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,381 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using AutoMapper; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
|
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Utils; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using EFCore.BulkExtensions; |
|||
using System.IO; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; |
|||
using Win.Sfs.SettleAccount.FISes; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Shouldly; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using System.Data.Common; |
|||
using Volo.Abp.Uow; |
|||
using Volo.Abp; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|||
using Magicodes.ExporterAndImporter.Core.Models; |
|||
|
|||
using TaskJob.Services; |
|||
using TaskJob.EventArgs; |
|||
using Win.Sfs.SettleAccount.Entities.WMS; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Repository; |
|||
using WY.NewJit.Extends.PaiGe.WMS; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|||
{ |
|||
/// <summary>
|
|||
/// wms出库
|
|||
/// </summary>
|
|||
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/wmskanbanoutput")] |
|||
public class WMSKanbanAppService : |
|||
ApplicationService |
|||
{ |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsKanbanOutPutDetial, Guid> _wmsRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsKanbanOutPut, Guid> _wmsVersionRepository; |
|||
private readonly WMSEfCoreRepository<WmsKanbanOutPutDetial> _wmsefRespository; |
|||
|
|||
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
private readonly TaskJobService _service; |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="wmsRepository"></param>
|
|||
/// <param name="job"></param>
|
|||
/// <param name="wmsVersionRepository"></param>
|
|||
/// <param name="wmsefRespository"></param>
|
|||
/// <param name="wmstbRespository"></param>
|
|||
public WMSKanbanAppService( |
|||
|
|||
|
|||
IExcelImportAppService excelImportService, |
|||
|
|||
ISettleAccountBranchEfCoreRepository<WmsKanbanOutPutDetial, Guid> wmsRepository, |
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
ISettleAccountBranchEfCoreRepository<WmsKanbanOutPut, Guid> wmsVersionRepository, |
|||
WMSEfCoreRepository<WmsKanbanOutPutDetial> wmsefRespository, |
|||
WMSEfCoreRepository<TB_BILL> wmstbRespository |
|||
) |
|||
{ |
|||
_job = job; |
|||
_wmstbRespository = wmstbRespository; |
|||
_wmsRepository = wmsRepository; |
|||
_wmsVersionRepository = wmsVersionRepository; |
|||
_wmsefRespository = wmsefRespository; |
|||
_excelImportService = excelImportService; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input) |
|||
{ |
|||
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsKanbanOutPutRequestDto input) |
|||
{ |
|||
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库主表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsKanbanList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsKanbanOutPut>> GetListAsync( WmsKanbanOutPutRequestDto input) |
|||
{ |
|||
|
|||
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
|
|||
|
|||
return new PagedResultDto<WmsKanbanOutPut>(totalCount, entities); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库明细
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsKanbanDetailList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsKanbanOutPutDetial>> GetListAsync(WmsKanbanOutPutDetialRequestDto input) |
|||
{ |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
return new PagedResultDto<WmsKanbanOutPutDetial>(totalCount, entities); |
|||
} |
|||
/// <summary>
|
|||
/// 任务明细标记已确认
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsKanbanOutPutAudit")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<bool> WmsKanbanAudit(List<Guid> ids) |
|||
{ |
|||
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync(); |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
itm.FileName = "已确认"; |
|||
} |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
await _job.UpdateAsync(itm); |
|||
} |
|||
var _count=await _job.BatchUpdateAsync(_joblist.ToList()); |
|||
if (_count > 0) |
|||
{ |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
/// <summary>
|
|||
/// 选择任务,生成出库单,只包含已确认的单据
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsKanbanOutPut")] |
|||
public async Task<string> WmsKanbanOutPut(WmsJitRequestDto input) |
|||
{ |
|||
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
|
|||
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList(); |
|||
if (_joblist.Count() > 0) |
|||
{ |
|||
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); |
|||
List<WmsKanbanOutPutDetial> _lst = new List<WmsKanbanOutPutDetial>(); |
|||
foreach (var filename in fileList) |
|||
{ |
|||
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; |
|||
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath); |
|||
var _list = _excelHelper.ExcelToList<WmsKanbanOutPutDetial>(); |
|||
foreach (var itm in _list) |
|||
{ |
|||
itm.SetId(GuidGenerator.Create()); |
|||
} |
|||
_lst.AddRange(_list.ToArray()); |
|||
} |
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.Kanban } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); |
|||
|
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
|
|||
} |
|||
|
|||
foreach (var job in _joblist) |
|||
{ |
|||
job.FileName = _billNum; |
|||
await _job.UpdateAsync(job); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
_billNum = string.Empty; |
|||
} |
|||
return _billNum; |
|||
} |
|||
/// <summary>
|
|||
/// 出库界面功能,核准出库功能
|
|||
/// </summary>
|
|||
/// <param name="version"></param>
|
|||
/// <param name="p_list"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsKanbanOutPut-Pass")] |
|||
public async Task<bool> WmsKanbanOutPutPass(WmsJitRequestDto input) |
|||
{ |
|||
if (input.Guids != null) |
|||
{ |
|||
List<WmsKanbanOutPutDetial> _ls = new List<WmsKanbanOutPutDetial>(); |
|||
if (input.Guids.Count() > 0) |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version ==input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync(); |
|||
} |
|||
else |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync(); |
|||
} |
|||
if (_ls.Count() > 0) |
|||
{ |
|||
var _first = _ls.FirstOrDefault(); |
|||
var _guid = GuidGenerator.Create(); |
|||
foreach (var itm in _ls) |
|||
{ |
|||
itm.TaskId = _guid; |
|||
} |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsKanbanOutPutDetail",_first.BillNum, 0,0 ,_guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsKanbanOutPutDetail", |
|||
InterfaceType = "2", |
|||
Version = input.Version, |
|||
SettleAccountState = 0, |
|||
WmsState=0 |
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
/// <summary>
|
|||
///出库界面功能, 撤销核准出库
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsKanbanOutPut-Cancel")] |
|||
public async Task<bool> WmsKanbanOutPutCancel(WmsJitRequestDto input) |
|||
{ |
|||
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).ToListAsync(); |
|||
var _first = _ls.FirstOrDefault(); |
|||
if (_ls.Count()>0) |
|||
{ |
|||
var _guid = GuidGenerator.Create(); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 }); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsKanbanOutPutDetail", _first.BillNum, 0,0, _guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsKanbanOutPutDetail", |
|||
InterfaceType = "2", |
|||
Version = input.Version, |
|||
WmsState = 0, |
|||
SettleAccountState=0 |
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
} |
|||
return true; |
|||
} |
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) |
|||
{ |
|||
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.ExtendExcelImport<WmsKanbanOutPutDetial>(files, _excelImportService); |
|||
List<WmsKanbanOutPutDetial> _lst = new List<WmsKanbanOutPutDetial>(); |
|||
var _lsCopy = new List<WmsKanbanOutPutDetial>(); |
|||
foreach (var itm in result) |
|||
{ |
|||
WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial( |
|||
GuidGenerator.Create(), |
|||
itm.WmsBillNum, |
|||
itm.Kanban, |
|||
|
|||
itm.MaterialCode, |
|||
itm.MaterialDesc, |
|||
itm.MaterialGroup, |
|||
string.Empty, |
|||
string.Empty, |
|||
0, |
|||
string.Empty, |
|||
string.Empty, |
|||
version, |
|||
itm.ParentMaterialCode, |
|||
itm.BillNum, |
|||
GuidGenerator.Create() |
|||
, string.Empty |
|||
, itm.Qty.Value |
|||
); |
|||
_lsCopy.Add(_detail); |
|||
} |
|||
_lst.AddRange(_lsCopy.ToArray()); |
|||
|
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.Kanban } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.Kanban } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email); |
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
return _billNum; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,382 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using AutoMapper; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Caching; |
|||
|
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.ExcelImporter; |
|||
using Win.Sfs.Shared.CacheBase; |
|||
using Win.Utils; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Win.Sfs.BaseData.ImportExcelCommon; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using EFCore.BulkExtensions; |
|||
using System.IO; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; |
|||
using Win.Sfs.SettleAccount.FISes; |
|||
using Win.Sfs.Shared.Enums.SettleAccount; |
|||
using Win.Sfs.Shared.Filter; |
|||
using Shouldly; |
|||
using Magicodes.ExporterAndImporter.Csv; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using System.Data.Common; |
|||
using Volo.Abp.Uow; |
|||
using Volo.Abp; |
|||
using Win.Abp.Snowflakes; |
|||
using Win.Sfs.SettleAccount.CommonManagers; |
|||
using Win.Sfs.SettleAccount.ExportReports; |
|||
using Win.Sfs.SettleAccount.Constant; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|||
using Magicodes.ExporterAndImporter.Core.Models; |
|||
|
|||
using TaskJob.Services; |
|||
using TaskJob.EventArgs; |
|||
using Win.Sfs.SettleAccount.Entities.WMS; |
|||
using Win.Sfs.SettleAccount.Entities.Wms; |
|||
using Win.Sfs.SettleAccount.Repository; |
|||
using WY.NewJit.Extends.PaiGe.WMS; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|||
{ |
|||
/// <summary>
|
|||
/// wms出库
|
|||
/// </summary>
|
|||
|
|||
[AllowAnonymous] |
|||
[Route("api/settleaccount/wmsSharePartoutput")] |
|||
public class WMSSharePartAppService : |
|||
ApplicationService |
|||
{ |
|||
|
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> _wmsRepository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> _wmsVersionRepository; |
|||
private readonly WMSEfCoreRepository<WmsSharePartOutPutDetial> _wmsefRespository; |
|||
|
|||
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|||
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|||
private readonly IExcelImportAppService _excelImportService; |
|||
|
|||
private readonly TaskJobService _service; |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="wmsRepository"></param>
|
|||
/// <param name="job"></param>
|
|||
/// <param name="wmsVersionRepository"></param>
|
|||
/// <param name="wmsefRespository"></param>
|
|||
/// <param name="wmstbRespository"></param>
|
|||
public WMSSharePartAppService( |
|||
|
|||
ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> wmsRepository, |
|||
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job, |
|||
ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> wmsVersionRepository, |
|||
WMSEfCoreRepository<WmsSharePartOutPutDetial> wmsefRespository, |
|||
WMSEfCoreRepository<TB_BILL> wmstbRespository, |
|||
IExcelImportAppService excelImportService |
|||
) |
|||
{ |
|||
_excelImportService = excelImportService; |
|||
_job = job; |
|||
_wmstbRespository = wmstbRespository; |
|||
_wmsRepository = wmsRepository; |
|||
_wmsVersionRepository = wmsVersionRepository; |
|||
_wmsefRespository = wmsefRespository; |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input) |
|||
{ |
|||
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input) |
|||
{ |
|||
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库主表
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsSharePartList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsSharePartOutPut>> GetListAsync( WmsSharePartOutPutRequestDto input) |
|||
{ |
|||
|
|||
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
|
|||
|
|||
return new PagedResultDto<WmsSharePartOutPut>(totalCount, entities); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 准时化出库明细
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[Route("WmsSharePartDetailList")] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
virtual public async Task<PagedResultDto<WmsSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input) |
|||
{ |
|||
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|||
input.SkipCount, true); |
|||
|
|||
var totalCount = await GetCountAsync(input); |
|||
return new PagedResultDto<WmsSharePartOutPutDetial>(totalCount, entities); |
|||
} |
|||
/// <summary>
|
|||
/// 任务明细标记已确认
|
|||
/// </summary>
|
|||
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsSharePartOutPutAudit")] |
|||
[DisableRequestSizeLimit] |
|||
|
|||
public async Task<bool> WmsSharePartAudit(List<Guid> ids) |
|||
{ |
|||
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync(); |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
itm.FileName = "已确认"; |
|||
} |
|||
foreach (var itm in _joblist) |
|||
{ |
|||
await _job.UpdateAsync(itm); |
|||
} |
|||
var _count=await _job.BatchUpdateAsync(_joblist.ToList()); |
|||
if (_count > 0) |
|||
{ |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
/// <summary>
|
|||
/// 选择任务,生成出库单,只包含已确认的单据
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsSharePartOutPut")] |
|||
|
|||
|
|||
public async Task<string> WmsSharePartOutPut(WmsJitRequestDto input) |
|||
{ |
|||
var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
|
|||
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList(); |
|||
if (_joblist.Count() > 0) |
|||
{ |
|||
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); |
|||
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>(); |
|||
foreach (var filename in fileList) |
|||
{ |
|||
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; |
|||
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath); |
|||
var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>(); |
|||
foreach (var itm in _list) |
|||
{ |
|||
itm.SetId(GuidGenerator.Create()); |
|||
} |
|||
_lst.AddRange(_list.ToArray()); |
|||
} |
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.OrderBillNum } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); |
|||
//var _ls = new List<WmsSharePartOutPut>();
|
|||
//_ls.Add(_version);
|
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
|
|||
} |
|||
|
|||
foreach (var job in _joblist) |
|||
{ |
|||
job.FileName = _billNum; |
|||
await _job.UpdateAsync(job); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
_billNum = string.Empty; |
|||
} |
|||
return _billNum; |
|||
} |
|||
/// <summary>
|
|||
/// 出库界面功能,核准出库功能
|
|||
/// </summary>
|
|||
/// <param name="version"></param>
|
|||
/// <param name="p_list"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsSharePartOutPut-Pass")] |
|||
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input) |
|||
{ |
|||
if (input.Guids != null) |
|||
{ |
|||
List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>(); |
|||
if (input.Guids.Count() > 0) |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync(); |
|||
} |
|||
else |
|||
{ |
|||
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync(); |
|||
} |
|||
if (_ls.Count() > 0) |
|||
{ |
|||
var _first = _ls.FirstOrDefault(); |
|||
var _guid = GuidGenerator.Create(); |
|||
foreach (var itm in _ls) |
|||
{ |
|||
itm.TaskId = _guid; |
|||
} |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsSharePartOutPutDetail",_first.BillNum, 0,0 ,_guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsSharePartOutPutDetail", |
|||
InterfaceType = "3", |
|||
Version = input.Version, |
|||
SettleAccountState = 0, |
|||
WmsState=0 |
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
/// <summary>
|
|||
///出库界面功能, 撤销核准出库
|
|||
/// </summary>
|
|||
/// <param name="ids"></param>
|
|||
/// <param name="version"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet] |
|||
[Route("WmsSharePartOutPut-Cancel")] |
|||
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input) |
|||
{ |
|||
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).ToListAsync(); |
|||
var _first = _ls.FirstOrDefault(); |
|||
if (_ls.Count()>0) |
|||
{ |
|||
var _guid = GuidGenerator.Create(); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 }); |
|||
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsSharePartOutPutDetail", _first.BillNum, 0,0, _guid) |
|||
{ |
|||
TaskId = _guid, |
|||
SourceBillNum = _first.BillNum, |
|||
TableName = "WmsSharePartOutPutDetail", |
|||
InterfaceType = "3", |
|||
Version = input.Version, |
|||
WmsState = 0, |
|||
SettleAccountState=0 |
|||
}; |
|||
var _l = new List<TS_UNI_API>(); |
|||
_l.Add(uniapi); |
|||
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l); |
|||
} |
|||
return true; |
|||
} |
|||
[HttpPost] |
|||
[Route("ExcelImport")] |
|||
[DisableRequestSizeLimit] |
|||
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|||
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version) |
|||
{ |
|||
var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss"); |
|||
ExportImporter _exportImporter = new ExportImporter(); |
|||
var result = await _exportImporter.ExtendExcelImport<WmsSharePartOutPutDetial>(files, _excelImportService); |
|||
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>(); |
|||
var _lsCopy = new List<WmsSharePartOutPutDetial>(); |
|||
foreach (var itm in result) |
|||
{ |
|||
WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial( |
|||
GuidGenerator.Create(), |
|||
itm.WmsBillNum, |
|||
itm.OrderBillNum, |
|||
|
|||
itm.MaterialCode, |
|||
itm.MaterialDesc, |
|||
itm.MaterialGroup, |
|||
string.Empty, |
|||
string.Empty, |
|||
0, |
|||
string.Empty, |
|||
string.Empty, |
|||
version, |
|||
itm.ParentMaterialCode, |
|||
itm.BillNum, |
|||
GuidGenerator.Create() |
|||
, string.Empty |
|||
, itm.Qty.Value |
|||
); |
|||
_lsCopy.Add(_detail); |
|||
} |
|||
_lst.AddRange(_lsCopy.ToArray()); |
|||
|
|||
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); |
|||
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync(); |
|||
var query = from itm1 in _ls1 |
|||
join itm2 in outPutDetail on |
|||
new { itm1.MaterialCode, itm1.OrderBillNum } |
|||
equals |
|||
new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 |
|||
from tm1 in temp1.DefaultIfEmpty() |
|||
where tm1 == null |
|||
select itm1; |
|||
var _wmslst = query.ToList(); |
|||
foreach (var itm in _wmslst) |
|||
{ |
|||
itm.BillNum = _billNum; |
|||
} |
|||
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|||
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); |
|||
if (_count == 0) |
|||
{ |
|||
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email); |
|||
await _wmsVersionRepository.InsertAsync(_version, true); |
|||
} |
|||
return _billNum; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,78 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace CK.SCP.Models.ExchangeCenterTables |
|||
{ |
|||
/// <summary>
|
|||
/// 任务订阅表
|
|||
/// </summary>
|
|||
[Description("任务订阅表")] |
|||
public class TEA_TASK_SUB |
|||
{ |
|||
[Description("任务状态")] |
|||
public int TaskState { get; set; } |
|||
|
|||
|
|||
[Description("任务编号")] |
|||
public Guid TaskID { get; set; } |
|||
|
|||
[Description("表格名称")] |
|||
[StringLength(50)] |
|||
public string TableName { get; set; } |
|||
|
|||
[Description("创建者")] |
|||
[StringLength(50)] |
|||
public string Creator { get; set; } |
|||
|
|||
[Description("数据行数")] |
|||
public int DataCount { get; set; } |
|||
|
|||
|
|||
[Description("订阅者")] |
|||
[StringLength(50)] |
|||
public string Subscriber { get; set; } |
|||
|
|||
[Description("失败行数")] |
|||
public int FailedCount { get; set; } |
|||
|
|||
[Description("失败信息")] |
|||
[StringLength(50)] |
|||
public string FailedInfo { get; set; } |
|||
|
|||
[Description("域")] |
|||
[StringLength(50)] |
|||
public string Domain { get; set; } |
|||
|
|||
[Description("地点")] |
|||
[StringLength(50)] |
|||
public string Site { get; set; } |
|||
|
|||
[Key] |
|||
public Guid GUID { get; set; } = Guid.NewGuid(); |
|||
|
|||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
|||
public int UID { get; set; } |
|||
|
|||
[Description("创建人")] |
|||
[StringLength(50)] |
|||
public string CreateUser { get; set; } |
|||
|
|||
[Description("创建时间")] |
|||
public DateTime CreateTime { get; set; } |
|||
|
|||
[Description("备注")] |
|||
public string Remark { get; set; } |
|||
|
|||
[Description("修改人")] |
|||
[StringLength(50)] |
|||
public string UpdateUser { get; set; } |
|||
|
|||
[Description("修改时间")] |
|||
public DateTime? UpdateTime { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,44 @@ |
|||
//大众-FIS结算-路由
|
|||
import Layout from '@/layout' |
|||
|
|||
const btcarDataRouter = { |
|||
path: '/cpat', |
|||
component: Layout, |
|||
redirect: 'pg', |
|||
name: 'btcar', |
|||
//hidden: true,
|
|||
meta: { |
|||
//requiresAuth: true,
|
|||
title: '一轿奔腾', |
|||
index: 0, |
|||
type: 'crm', |
|||
icon: '单据导入', |
|||
keepAlive: false, |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'hq-car-platform', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_bt'), |
|||
name: 'ERPEI',//命名路由
|
|||
meta: { |
|||
title: '一轿奔腾导入', |
|||
roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'hq-car-platform-export', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_m'), |
|||
name: 'ERPEI',//命名路由
|
|||
meta: { |
|||
title: '一轿奔腾结算核对输出', |
|||
//roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
|
|||
] |
|||
} |
|||
|
|||
export default btcarDataRouter |
|||
|
@ -0,0 +1,125 @@ |
|||
|
|||
import Layout from '@/layout' |
|||
|
|||
const hqMenudataRouter = { |
|||
path: '/capt-hq', |
|||
component: Layout, |
|||
redirect: 'ux/vw/dataInput/hq_h', |
|||
name: 'HQData', |
|||
meta: { |
|||
title: '红旗工厂', |
|||
icon: '红旗', |
|||
//roles: ['SettleAccount.HQConsigns', 'SettleAccount.HQSpecConsigns', 'SettleAccount.HQKBs', 'SettleAccount.HQSpecKBs'],
|
|||
keepAlive: false, |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: '/import-h-data', |
|||
name: 'import-h-data',//命名路由-二级
|
|||
component: () => import('@/views/ux/vw/dataInput/hq_h'), |
|||
redirect: 'ux/vw/dataInput/hq_h', |
|||
meta: { |
|||
title: 'H平台', |
|||
// roles: ['SettleAccount.HQKBs', 'SettleAccount.HQSpecKBs'],
|
|||
icon: '看板' |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'hq-H-platform', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_h'), |
|||
name: 'ERPEI',//命名路由
|
|||
meta: { |
|||
title: '红旗H平台导入', |
|||
roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'hq-H-platform-export', |
|||
component: () => import('@/views/ux/vw/dataInput/ScrapClaims'), |
|||
name: 'ScrapClaims', |
|||
meta: { |
|||
title: 'H平台结算差异输出', |
|||
roles: ['SettleAccount.FISs'], |
|||
icon: '文件' |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
path: '/export-m-data', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_m'), |
|||
name: 'export-m-data',//命名路由
|
|||
redirect: '/ux/vw/dataInput/hq_m', |
|||
meta: { |
|||
title: 'M平台', |
|||
//roles: ['SettleAccount.HQConsigns', 'SettleAccount.HQSpecConsigns'],
|
|||
icon: '结算' |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'hq-M-platform', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_m'), |
|||
name: 'ERPEI',//命名路由
|
|||
meta: { |
|||
title: '红旗M平台导入', |
|||
//roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
path: 'hq-M-platform-export', |
|||
component: () => import('@/views/ux/billManage/sparePart'), |
|||
name: 'SparePartReport',//命名路由
|
|||
meta: { |
|||
title: 'H平台结算差异输出', |
|||
//roles: ['abpvnext_master.ProjectPeople'],//控制页面角色(可以设置多个角色)
|
|||
icon: '二配' |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
path: '/export-f-data', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_f'), |
|||
name: 'export-f-data',//命名路由
|
|||
redirect: '/ux/vw/dataInput/hq_f', |
|||
meta: { |
|||
title: 'F平台', |
|||
//roles: ['SettleAccount.HQConsigns', 'SettleAccount.HQSpecConsigns'],
|
|||
icon: '结算' |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'hq-F-platform', |
|||
component: () => import('@/views/ux/vw/dataInput/hq_f'), |
|||
name: 'ERPEI',//命名路由
|
|||
meta: { |
|||
title: '红旗F平台导入', |
|||
//roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
path: 'hq-F-platform-export', |
|||
component: () => import('@/views/ux/billManage/sparePart'), |
|||
name: 'SparePartReport',//命名路由
|
|||
meta: { |
|||
title: 'F平台结算差异输出', |
|||
//roles: ['abpvnext_master.ProjectPeople'],//控制页面角色(可以设置多个角色)
|
|||
icon: '二配' |
|||
} |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
|
|||
export default hqMenudataRouter |
|||
|
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,181 @@ |
|||
|
|||
import Layout from '@/layout' |
|||
|
|||
const vwMenudataRouter = { |
|||
path: '/capt-vw', |
|||
component: Layout, |
|||
redirect: 'ux/basedata/Invoice/index', |
|||
name: 'HQData', |
|||
meta: { |
|||
title: '大众工厂', |
|||
icon: 'vw', |
|||
//roles: ['SettleAccount.HQConsigns', 'SettleAccount.HQSpecConsigns', 'SettleAccount.HQKBs', 'SettleAccount.HQSpecKBs'],
|
|||
keepAlive: false, |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: '/import-data', |
|||
name: 'import-data',//命名路由-二级
|
|||
component: () => import('@/views/ux/billManage/index'), |
|||
redirect: 'ux/basedata/Invoice/index', |
|||
meta: { |
|||
title: '数据导入', |
|||
// roles: ['SettleAccount.HQKBs', 'SettleAccount.HQSpecKBs'],
|
|||
icon: '看板' |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'invoice', |
|||
component: () => import('@/views/ux/basedata/Invoice/index'), |
|||
name: 'Invoices', |
|||
meta: { |
|||
title: '发票汇总', |
|||
roles: ['SettleAccount.Invoices'], |
|||
icon: '对比' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'settle-account-finish', |
|||
component: () => import('@/views/ux/vw/dataInput/r3'), |
|||
name: 'SettleAccount', |
|||
meta: { |
|||
title: 'FIS结算明细', |
|||
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
|
|||
icon: '库存' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'unsettle-account', |
|||
component: () => import('@/views/ux/vw/dataInput/r3'), |
|||
name: 'SettleAccount', |
|||
meta: { |
|||
title: 'FIS未结明细', |
|||
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'kan-ban', |
|||
component: () => import('@/views/ux/vw/dataInput/vwKanBan/index'), |
|||
name: 'VWKanBan',//命名路由
|
|||
meta: { |
|||
title: '大众看板结算导入', |
|||
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
|
|||
icon: '看板' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'spare-part', |
|||
component: () => import('@/views/ux/vw/dataInput/SparePart'), |
|||
name: 'SparePart',//命名路由
|
|||
meta: { |
|||
title: '大众备件结算导入', |
|||
roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)
|
|||
icon: '工厂' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'scrap-claims', |
|||
component: () => import('@/views/ux/vw/dataInput/ScrapClaims'), |
|||
name: 'ScrapClaims', |
|||
meta: { |
|||
title: 'CP7报废和索赔导入', |
|||
roles: ['SettleAccount.FISs'], |
|||
icon: '文件' |
|||
} |
|||
}, |
|||
] |
|||
}, |
|||
{ |
|||
path: '/export-data', |
|||
component: () => import('@/views/ux/billManage/index'), |
|||
name: 'export-data',//命名路由
|
|||
redirect: 'export-data', |
|||
meta: { |
|||
title: '数据输出', |
|||
//roles: ['SettleAccount.HQConsigns', 'SettleAccount.HQSpecConsigns'],
|
|||
icon: '结算' |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: '/invoice-settled/diff', |
|||
component: () => import('@/views/ux/billManage/InvoiceSettledDiff'), |
|||
name: 'InvoiceSettledDiff',//命名路由
|
|||
meta: { |
|||
title: '发票与结算核对汇总', |
|||
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
{ |
|||
path: '/invoice-settled/detaildiff', |
|||
component: () => import('@/views/ux/billManage/InvoiceSettledDetailDiff'), |
|||
name: 'InvoiceSettledDetailDiff',//命名路由
|
|||
meta: { |
|||
title: '准时化结算核对明细', |
|||
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算对比' |
|||
} |
|||
}, |
|||
{ |
|||
path: '/unInvoice-settled/detailDiff', |
|||
component: () => import('@/views/ux/billManage/UnInvoiceSettledDetailDiff'), |
|||
name: 'UnInvoiceSettledDetailDiff',//命名路由
|
|||
meta: { |
|||
title: '准时化量差价差输出', |
|||
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '售后' |
|||
} |
|||
}, |
|||
{ |
|||
path: '/unsettle-diff/export', |
|||
component: () => import('@/views/ux/billManage/UnSettleDiffExport'), |
|||
name: 'UnSettleDiffExport',//命名路由
|
|||
meta: { |
|||
title: '准时化未结核对', |
|||
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '器具' |
|||
} |
|||
}, |
|||
{ |
|||
path: '/unsettled-detail',//大众准时化未结明细表(包含漏结,漏结要有标识)
|
|||
component: () => import('@/views/ux/billManage/IssuedUnsettled/index'), |
|||
name: 'UnsettledDetail',//命名路由
|
|||
meta: { |
|||
title: '准时化未结明细', |
|||
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '报表' |
|||
} |
|||
}, |
|||
{ |
|||
path: '/kbwithcode', |
|||
component: () => import('@/views/ux/billManage/kanBanWithCode'), |
|||
name: 'KanBanWithCode',//命名路由
|
|||
meta: { |
|||
title: '看板结算输出', |
|||
//roles: ['SettleAccount.EstimatedStockDiffReports'],//控制页面角色(可以设置多个角色)
|
|||
icon: '看板' |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
path: '/vwsparepart', |
|||
component: () => import('@/views/ux/billManage/sparePart'), |
|||
name: 'SparePartReport',//命名路由
|
|||
meta: { |
|||
title: '备件结算输出', |
|||
//roles: ['abpvnext_master.ProjectPeople'],//控制页面角色(可以设置多个角色)
|
|||
icon: '供货' |
|||
} |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
|
|||
export default vwMenudataRouter |
|||
|
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,54 @@ |
|||
//大众-FIS结算-路由
|
|||
import Layout from '@/layout' |
|||
|
|||
const vwOutOrderDataRouter = { |
|||
path: '/cpat-order', |
|||
component: Layout, |
|||
redirect: 'pg', |
|||
name: '业务数据', |
|||
//hidden: true,
|
|||
meta: { |
|||
//requiresAuth: true,
|
|||
title: '大众出库单管理', |
|||
index: 0, |
|||
type: 'crm', |
|||
icon: '单据导入', |
|||
keepAlive: false, |
|||
}, |
|||
children: [ |
|||
{ |
|||
path: 'vw-out-order', |
|||
component: () => import('@/views/ux/billManage/vwOutOrder/index'), |
|||
name: 'SettleAccount',//命名路由
|
|||
meta: { |
|||
title: '大众准时化出库单', |
|||
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'kanban-out-order', |
|||
component: () => import('@/views/ux/billManage/kanbanOutOrder/index'), |
|||
name: 'SettleAccount',//命名路由
|
|||
meta: { |
|||
title: '大众看板出库单', |
|||
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
|
|||
icon: '结算' |
|||
} |
|||
}, |
|||
// {
|
|||
// path: 'invoice',
|
|||
// component: () => import('@/views/ux/basedata/Invoice/index'),
|
|||
// name: 'Invoices',//命名路由
|
|||
// meta: {
|
|||
// title: '大众发票汇总导入',
|
|||
// roles: ['SettleAccount.Invoices'],
|
|||
// icon: '对比'
|
|||
// }
|
|||
// },
|
|||
|
|||
] |
|||
} |
|||
|
|||
export default vwOutOrderDataRouter |
|||
|
@ -0,0 +1,7 @@ |
|||
<!-- 父级路由组件 --> |
|||
<template> |
|||
<div> |
|||
<!-- xxx html 内容 --> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
@ -0,0 +1,7 @@ |
|||
<!-- 父级路由组件 --> |
|||
<template> |
|||
<div> |
|||
<!-- xxx html 内容 --> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
@ -0,0 +1,541 @@ |
|||
<!--FIS发运数据对比输出表-明细数据--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="info" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出全部 |
|||
</el-button> --> |
|||
<el-button |
|||
class="filter-item" |
|||
type="success" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
@click="handleCreateBills()" |
|||
>确认出库单(支持批量)</el-button |
|||
> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="info" |
|||
icon="el-icon-download" |
|||
@click="handleCancelBills()" |
|||
>取消出库(支持批量) |
|||
</el-button> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 230px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
: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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import CRMTableHead from "../../components/CRMTableHead"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, CRMTableHead, CRMTableHead }, |
|||
directives: { permission }, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "vwOutOrder", |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
parentId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "", |
|||
action: 0, |
|||
value: "", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
ParentId: "", |
|||
}, |
|||
listOutPutQuery: { |
|||
version: "", |
|||
ids: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
watch: { |
|||
customerInfos: { |
|||
handler(newVal) { |
|||
if (newVal == "" || newVal == "undefined") { |
|||
//TODO |
|||
} else { |
|||
newVal.forEach((element) => { |
|||
this.customerInfo.parentId = element.ParentId; |
|||
}); |
|||
if (this.customerInfo.parentId != "") { |
|||
this.getList(); |
|||
} |
|||
} |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "零件号", |
|||
prop: "materialCode", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "零件描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ label: "物料组", prop: "materialGroup", width: 220 }); |
|||
tempsTabs.push({ label: "数量", prop: "wmsBillNum", width: 100 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
//取消出库单 |
|||
handleCancelBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message({ |
|||
message: "至少选择一行!", |
|||
type: "warning", |
|||
}); |
|||
return; |
|||
} |
|||
//var params = []; |
|||
var params = ""; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
//params.push(id); |
|||
params += id + ","; |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = row.version; |
|||
this.listOutPutQuery.ids = params.substr(0, params.length - 1); |
|||
|
|||
this.$confirm("是否确认取消出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "操作成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
}); |
|||
}, |
|||
//出库单 |
|||
handleCreateBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message({ |
|||
message: "至少选择一行!", |
|||
type: "warning", |
|||
}); |
|||
return; |
|||
} |
|||
//var params = []; |
|||
var params = ""; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
//params.push(id); |
|||
params += id + ","; |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = row.version; |
|||
this.listOutPutQuery.ids = params.substr(0, params.length - 1); |
|||
|
|||
this.$confirm("是否确认出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
}); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
async handleDownload() { |
|||
//await this.getDownBoms(); |
|||
this.listLoading = true; |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/bt-kb-not-consign/export/" + |
|||
this.customerInfo.parentId |
|||
) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
let filter = { |
|||
logic: 0, |
|||
column: "wmsBillNum", |
|||
action: 6, |
|||
value: this.customerInfo.parentId, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
//this.listQuery.ParentId = this.customerInfo.parentId; |
|||
console.log("查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitDetailList", |
|||
this.listQuery |
|||
) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 6, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
|
|||
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 === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right" }; |
|||
} else { |
|||
return { textAlign: "left" }; |
|||
} |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,317 @@ |
|||
<!--轿车看板-发出未结算--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照版本号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column |
|||
label="单据号" |
|||
prop="billNum" |
|||
sortable="custom" |
|||
align="center" |
|||
width="250px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.billNum" placement="bottom-end"> |
|||
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{ |
|||
scope.row.billNum |
|||
}}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- <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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 抽屉控件 --> |
|||
<el-drawer |
|||
title="信息详细页" |
|||
size="75%" |
|||
direction="rtl" |
|||
:visible.sync="drawer" |
|||
:before-close="handleDrawerClose" |
|||
> |
|||
<div> |
|||
<Detail |
|||
v-bind:customerInfos="customerInfos" |
|||
style="margin-top: -35px" |
|||
></Detail> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import Detail from "./detail"; |
|||
import moment from "moment"; |
|||
import { formatTimeToTimestamp } from "@/utils/index"; |
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, Detail }, |
|||
directives: { permission }, |
|||
data() { |
|||
return { |
|||
crmType: "sendUnsettledDiffReport", |
|||
rules: { |
|||
// version: [{ required: true, message: "必须输入!", trigger: "change" }], |
|||
// beginTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
// endTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
}, |
|||
customerInfos: [], |
|||
searchContent: "", // 输入内容 |
|||
drawer: false, |
|||
form: { |
|||
version: "", |
|||
customerCode: "", |
|||
customerName: "", |
|||
beginTime: "", |
|||
endTime: "", |
|||
}, |
|||
versionValue: "", |
|||
versionList: [], |
|||
startTimeVale: "", |
|||
endTimeVale: "", |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 200, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 200; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
//this.getVersionInfo(); |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 120, |
|||
}); |
|||
//tempsTabs.push({ label: "单据号", prop: "billNum", width: 150 }); |
|||
tempsTabs.push({ label: "创建人", prop: "creator", width: 160 }); |
|||
tempsTabs.push({ label: "创建时间", prop: "creationTime", width: 160 }); |
|||
tempsTabs.push({ label: "备注", prop: "remark", width: 120 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
//抽屉 |
|||
handleDrawerOpen(param) { |
|||
this.drawer = true; |
|||
var parentId = param.billNum; //单据号 |
|||
this.customerInfos = [ |
|||
{ |
|||
ParentId: parentId, |
|||
}, |
|||
]; |
|||
}, |
|||
handleDrawerClose(done) { |
|||
done(); |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "creationTime") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
if (column.property == "documentStatus") { |
|||
return { 0: "新建", 1: "进行中", 5: "完成", 9: "取消" }[ |
|||
row[column.property] |
|||
]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.$axios |
|||
.posts("/api/settleaccount/wmsjitoutput/WmsJitList", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "version"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
resetQuery() {}, |
|||
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 }) { |
|||
return { textAlign: "left" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,616 @@ |
|||
<!--FIS发运数据对比输出表-明细数据--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="info" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出全部 |
|||
</el-button> --> |
|||
<JobSelectVerson |
|||
:options="JobVersionList" |
|||
style="width: 150px; margin-left: -10px" |
|||
class="search-container" |
|||
@value-change="JobVersionValue" |
|||
></JobSelectVerson> |
|||
<el-button |
|||
class="filter-item" |
|||
type="success" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
@click="handleCreateBills()" |
|||
>确认出库单(支持批量)</el-button |
|||
> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
@click="handleCancelBills()" |
|||
>取消出库(支持批量) |
|||
</el-button> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 230px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
: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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import CRMTableHead from "../../components/CRMTableHead"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; |
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson }, |
|||
directives: { permission }, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "vwOutOrder", |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
parentId: "", |
|||
version: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
JobVersionList: [ |
|||
{ value: "0", label: "未处理" }, |
|||
{ value: "1", label: "申请出库" }, |
|||
{ value: "2", label: "确认出库" }, |
|||
{ value: "3", label: "不能出库" }, |
|||
{ value: "4", label: "取消出库" }, |
|||
], |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
billNum: "", |
|||
}, |
|||
listOutPutQuery: { |
|||
version: "", |
|||
guids: "", |
|||
billNum: "", |
|||
}, |
|||
page: 1, |
|||
JobversionValue: "", |
|||
JobversionValueVerson: "", |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 230, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
watch: { |
|||
customerInfos: { |
|||
handler(newVal) { |
|||
if (newVal == "" || newVal == "undefined") { |
|||
//TODO |
|||
} else { |
|||
newVal.forEach((element) => { |
|||
this.customerInfo.parentId = element.ParentId; |
|||
this.customerInfo.version = element.Version; |
|||
}); |
|||
if (this.customerInfo.parentId != "") { |
|||
this.getList(); |
|||
} |
|||
} |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 110, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "零件号", |
|||
prop: "materialCode", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "KEEN号", prop: "kennCode", width: 170 }); |
|||
tempsTabs.push({ label: "底盘号", prop: "chassisNumber", width: 190 }); |
|||
tempsTabs.push({ label: "零件描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ label: "物料组", prop: "materialGroup", width: 220 }); |
|||
tempsTabs.push({ label: "交货单号", prop: "wmsBillNum", width: 100 }); |
|||
tempsTabs.push({ label: "数量", prop: "qty", width: 100 }); |
|||
tempsTabs.push({ label: "状态", prop: "state", width: 100 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
//版本下拉列表选择项 |
|||
JobVersionValue(params) { |
|||
//版本下拉选择 |
|||
this.listQuery.Filters = []; |
|||
var column = "state"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: params.value, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
this.getList(); |
|||
}, |
|||
//取消出库单 |
|||
handleCancelBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message({ |
|||
message: "至少选择一行!", |
|||
type: "warning", |
|||
}); |
|||
return; |
|||
} |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); |
|||
|
|||
this.$confirm("是否确认取消出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitOutPut-Cancel", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "操作成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
}); |
|||
}, |
|||
//出库单 |
|||
handleCreateBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.listLoading = true; |
|||
this.listOutPutQuery.guids = []; |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否全部确认出库?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} else { |
|||
this.listLoading = true; |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"部分选择时确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否确认将选中的出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "state") { |
|||
return { |
|||
0: "未处理", |
|||
1: "申请出库", |
|||
2: "确认出库", |
|||
3: "不能出库", |
|||
4: "取消出库", |
|||
}[row[column.property]]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
async handleDownload() { |
|||
//await this.getDownBoms(); |
|||
this.listLoading = true; |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/bt-kb-not-consign/export/" + |
|||
this.customerInfo.parentId |
|||
) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.listQuery.billNum = this.customerInfo.parentId; |
|||
console.log("查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsjitoutput/WmsJitDetailList", |
|||
this.listQuery |
|||
) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 6, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
|
|||
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 === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right" }; |
|||
} else { |
|||
return { textAlign: "left" }; |
|||
} |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,320 @@ |
|||
<!--轿车看板-发出未结算--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照版本号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column |
|||
label="单据号" |
|||
prop="billNum" |
|||
sortable="custom" |
|||
align="center" |
|||
width="250px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.billNum" placement="bottom-end"> |
|||
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{ |
|||
scope.row.billNum |
|||
}}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- <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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 抽屉控件 --> |
|||
<el-drawer |
|||
title="信息详细页" |
|||
size="75%" |
|||
direction="rtl" |
|||
:visible.sync="drawer" |
|||
:before-close="handleDrawerClose" |
|||
> |
|||
<div> |
|||
<Detail |
|||
v-bind:customerInfos="customerInfos" |
|||
style="margin-top: -35px" |
|||
></Detail> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import Detail from "./detail"; |
|||
import moment from "moment"; |
|||
import { formatTimeToTimestamp } from "@/utils/index"; |
|||
|
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, Detail}, |
|||
directives: { permission }, |
|||
data() { |
|||
return { |
|||
crmType: "sendUnsettledDiffReport", |
|||
rules: { |
|||
// version: [{ required: true, message: "必须输入!", trigger: "change" }], |
|||
// beginTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
// endTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
}, |
|||
customerInfos: [], |
|||
searchContent: "", // 输入内容 |
|||
drawer: false, |
|||
form: { |
|||
version: "", |
|||
customerCode: "", |
|||
customerName: "", |
|||
beginTime: "", |
|||
endTime: "", |
|||
}, |
|||
versionValue: "", |
|||
versionList: [], |
|||
startTimeVale: "", |
|||
endTimeVale: "", |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 200, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 200; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
//this.getVersionInfo(); |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 120, |
|||
}); |
|||
//tempsTabs.push({ label: "单据号", prop: "billNum", width: 150 }); |
|||
tempsTabs.push({ label: "创建人", prop: "creator", width: 160 }); |
|||
tempsTabs.push({ label: "创建时间", prop: "creationTime", width: 160 }); |
|||
tempsTabs.push({ label: "备注", prop: "remark", width: 120 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
//抽屉 |
|||
handleDrawerOpen(param) { |
|||
this.drawer = true; |
|||
var parentId = param.billNum; //单据号 |
|||
var version = param.version; //版本 |
|||
this.customerInfos = [ |
|||
{ |
|||
ParentId: parentId, |
|||
Version: version, |
|||
}, |
|||
]; |
|||
}, |
|||
handleDrawerClose(done) { |
|||
done(); |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "creationTime") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
if (column.property == "state") { |
|||
return { 0: "已提交", 1: "已出库", 2: "不能出库" }[ |
|||
row[column.property] |
|||
]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.$axios |
|||
.posts("/api/settleaccount/wmsjitoutput/WmsJitList", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "version"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
resetQuery() {}, |
|||
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 }) { |
|||
return { textAlign: "left" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,594 @@ |
|||
<!--红旗H平台导入功能--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<XhJSSelect |
|||
:options="versionList" |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@value-change="selectValue" |
|||
></XhJSSelect> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出Excel |
|||
</el-button> --> |
|||
<el-dropdown |
|||
size="small" |
|||
class="filter-item" |
|||
style="margin-left: 15px; font-weight: bold" |
|||
@command="handleCommand" |
|||
> |
|||
<span class="el-dropdown-link"> |
|||
导出数据<i class="el-icon-arrow-down el-icon--right"></i> |
|||
</span> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="excel" icon="el-icon-plus" |
|||
>导出Excel</el-dropdown-item |
|||
> |
|||
<el-dropdown-item command="csv" icon="el-icon-circle-plus" |
|||
>导出Csv</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照采购订单号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading.fullscreen.lock="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
: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 |
|||
label="版本" |
|||
prop="version" |
|||
sortable="custom" |
|||
align="center" |
|||
width="100px" |
|||
fixed |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.version" placement="top"> |
|||
<span class="link-type">{{ scope.row.version }}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
import Lockr from "lockr"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue"; |
|||
|
|||
export default { |
|||
name: "HQHPlatform", |
|||
components: { Pagination, CRMTableHead, importExcel, XhJSSelect }, |
|||
directives: { permission }, |
|||
filters: { |
|||
IsCustomerSignFilter(status) { |
|||
//翻译是否签字 |
|||
const statusMap = { |
|||
true: "是", |
|||
false: "否", |
|||
}; |
|||
return statusMap[status]; |
|||
}, |
|||
}, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "hqHPlatform", |
|||
versionValue: "", |
|||
versionList: [], //版本列表 |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
settleAccountId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: true, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listVersionQuery: { |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
site: "TH", |
|||
userId: "00000000-0000-0000-0000-000000000000", |
|||
}, |
|||
listExportQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
fileType: 0, |
|||
userId: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 220, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 220; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getVersionInfo(); |
|||
if (this.versionList == []) { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ label: "行号", prop: "lineNumber", width: 100 }); |
|||
tempsTabs.push({ label: "采购类型", prop: "purchaseType", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购订单号", |
|||
prop: "purchaseOrderNo", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单行项目", |
|||
prop: "purchaseOrderNoItem", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单文本", |
|||
prop: "purchaseOrderNoText", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ label: "收货数量", prop: "receiptQty", width: 120 }); |
|||
tempsTabs.push({ label: "开票数量", prop: "invoicedQty", width: 120 }); |
|||
tempsTabs.push({ label: "不含税金额", prop: "amountNoTax", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购价格不含税", |
|||
prop: "purchasePriceNoTax", |
|||
width: 200, |
|||
}); |
|||
tempsTabs.push({ label: "科目号", prop: "accountNum", width: 150 }); |
|||
tempsTabs.push({ label: "物料代码", prop: "materialCode", width: 180 }); |
|||
tempsTabs.push({ label: "物料描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ |
|||
label: "日期", |
|||
prop: "spareDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
|
|||
tempsTabs.push({ |
|||
label: "交货单号", |
|||
prop: "deliveryOrderNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "交货行号", |
|||
prop: "deliveryLineNum", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "批次号", prop: "batchNo", width: 150 }); |
|||
tempsTabs.push({ label: "税率", prop: "taxRate", width: 100 }); |
|||
tempsTabs.push({ label: "税码", prop: "taxCode", width: 110 }); |
|||
tempsTabs.push({ |
|||
label: "德国发票号", |
|||
prop: "germanInvoiceNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "工厂", prop: "factory", width: 150 }); |
|||
tempsTabs.push({ label: "工厂名称", prop: "factoryName", width: 220 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCommand(command) { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请先选择版本!"); |
|||
return; |
|||
} |
|||
switch (command) { |
|||
case "excel": |
|||
this.listQuery.fileType = 1; //0是csv,1是excel |
|||
break; |
|||
case "csv": |
|||
this.listQuery.fileType = 0; //0是csv,1是excel |
|||
break; |
|||
default: |
|||
//这里是没有找到对应的值处理 |
|||
break; |
|||
} |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("红旗H平台导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
|
|||
selectValue(params) { |
|||
//版本下拉选择 |
|||
this.versionValue = params.value; |
|||
this.getList(); |
|||
}, |
|||
selectOptionsChange(item) { |
|||
this.getList(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
//this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/listVersion", this.listQuery) |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.items.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.id; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
if (JSON.stringify(this.versionList) != "[]") { |
|||
//因版本下拉有默认值,所以详表要自动绑定子表数据 |
|||
this.versionValue = this.versionList[0].label; |
|||
this.getList(); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
// if (column.property === "state") { |
|||
// return { 0: "其他", 2: "已结" }[row[column.property]]; |
|||
// } |
|||
if ( |
|||
column.property == "settleInputDate" || |
|||
column.property == "settleDate" |
|||
) { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
this.getVersionInfo(); |
|||
this.listLoading = false; |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
}, |
|||
|
|||
getList() { |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 10; |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("列表查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
fetchData(id) { |
|||
//循环动态 |
|||
this.$axios |
|||
.gets("/api/settleaccount/HQHPlatform/" + id) |
|||
.then((response) => { |
|||
this.form = response; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "purchaseOrderNo"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
console.log(this.listQuery.Sorting); |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
// if (column.property === "qty") { |
|||
// return { textAlign: "right" }; |
|||
// } else { |
|||
// return { textAlign: "left" }; |
|||
// } |
|||
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); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
.el-table .cell.el-tooltip { |
|||
white-space: pre-wrap; |
|||
} |
|||
</style> |
|||
|
|||
|
@ -0,0 +1,594 @@ |
|||
<!--红旗H平台导入功能--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<XhJSSelect |
|||
:options="versionList" |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@value-change="selectValue" |
|||
></XhJSSelect> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出Excel |
|||
</el-button> --> |
|||
<el-dropdown |
|||
size="small" |
|||
class="filter-item" |
|||
style="margin-left: 15px; font-weight: bold" |
|||
@command="handleCommand" |
|||
> |
|||
<span class="el-dropdown-link"> |
|||
导出数据<i class="el-icon-arrow-down el-icon--right"></i> |
|||
</span> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="excel" icon="el-icon-plus" |
|||
>导出Excel</el-dropdown-item |
|||
> |
|||
<el-dropdown-item command="csv" icon="el-icon-circle-plus" |
|||
>导出Csv</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照采购订单号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading.fullscreen.lock="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
: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 |
|||
label="版本" |
|||
prop="version" |
|||
sortable="custom" |
|||
align="center" |
|||
width="100px" |
|||
fixed |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.version" placement="top"> |
|||
<span class="link-type">{{ scope.row.version }}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
import Lockr from "lockr"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue"; |
|||
|
|||
export default { |
|||
name: "HQHPlatform", |
|||
components: { Pagination, CRMTableHead, importExcel, XhJSSelect }, |
|||
directives: { permission }, |
|||
filters: { |
|||
IsCustomerSignFilter(status) { |
|||
//翻译是否签字 |
|||
const statusMap = { |
|||
true: "是", |
|||
false: "否", |
|||
}; |
|||
return statusMap[status]; |
|||
}, |
|||
}, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "hqHPlatform", |
|||
versionValue: "", |
|||
versionList: [], //版本列表 |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
settleAccountId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: true, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listVersionQuery: { |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
site: "TH", |
|||
userId: "00000000-0000-0000-0000-000000000000", |
|||
}, |
|||
listExportQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
fileType: 0, |
|||
userId: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 220, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 220; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getVersionInfo(); |
|||
if (this.versionList == []) { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ label: "行号", prop: "lineNumber", width: 100 }); |
|||
tempsTabs.push({ label: "采购类型", prop: "purchaseType", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购订单号", |
|||
prop: "purchaseOrderNo", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单行项目", |
|||
prop: "purchaseOrderNoItem", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单文本", |
|||
prop: "purchaseOrderNoText", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ label: "收货数量", prop: "receiptQty", width: 120 }); |
|||
tempsTabs.push({ label: "开票数量", prop: "invoicedQty", width: 120 }); |
|||
tempsTabs.push({ label: "不含税金额", prop: "amountNoTax", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购价格不含税", |
|||
prop: "purchasePriceNoTax", |
|||
width: 200, |
|||
}); |
|||
tempsTabs.push({ label: "科目号", prop: "accountNum", width: 150 }); |
|||
tempsTabs.push({ label: "物料代码", prop: "materialCode", width: 180 }); |
|||
tempsTabs.push({ label: "物料描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ |
|||
label: "日期", |
|||
prop: "spareDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
|
|||
tempsTabs.push({ |
|||
label: "交货单号", |
|||
prop: "deliveryOrderNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "交货行号", |
|||
prop: "deliveryLineNum", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "批次号", prop: "batchNo", width: 150 }); |
|||
tempsTabs.push({ label: "税率", prop: "taxRate", width: 100 }); |
|||
tempsTabs.push({ label: "税码", prop: "taxCode", width: 110 }); |
|||
tempsTabs.push({ |
|||
label: "德国发票号", |
|||
prop: "germanInvoiceNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "工厂", prop: "factory", width: 150 }); |
|||
tempsTabs.push({ label: "工厂名称", prop: "factoryName", width: 220 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCommand(command) { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请先选择版本!"); |
|||
return; |
|||
} |
|||
switch (command) { |
|||
case "excel": |
|||
this.listQuery.fileType = 1; //0是csv,1是excel |
|||
break; |
|||
case "csv": |
|||
this.listQuery.fileType = 0; //0是csv,1是excel |
|||
break; |
|||
default: |
|||
//这里是没有找到对应的值处理 |
|||
break; |
|||
} |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("红旗H平台导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
|
|||
selectValue(params) { |
|||
//版本下拉选择 |
|||
this.versionValue = params.value; |
|||
this.getList(); |
|||
}, |
|||
selectOptionsChange(item) { |
|||
this.getList(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
//this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/listVersion", this.listQuery) |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.items.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.id; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
if (JSON.stringify(this.versionList) != "[]") { |
|||
//因版本下拉有默认值,所以详表要自动绑定子表数据 |
|||
this.versionValue = this.versionList[0].label; |
|||
this.getList(); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
// if (column.property === "state") { |
|||
// return { 0: "其他", 2: "已结" }[row[column.property]]; |
|||
// } |
|||
if ( |
|||
column.property == "settleInputDate" || |
|||
column.property == "settleDate" |
|||
) { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
this.getVersionInfo(); |
|||
this.listLoading = false; |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
}, |
|||
|
|||
getList() { |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 10; |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("列表查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQHPlatform/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
fetchData(id) { |
|||
//循环动态 |
|||
this.$axios |
|||
.gets("/api/settleaccount/HQHPlatform/" + id) |
|||
.then((response) => { |
|||
this.form = response; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "purchaseOrderNo"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
console.log(this.listQuery.Sorting); |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
// if (column.property === "qty") { |
|||
// return { textAlign: "right" }; |
|||
// } else { |
|||
// return { textAlign: "left" }; |
|||
// } |
|||
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); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
.el-table .cell.el-tooltip { |
|||
white-space: pre-wrap; |
|||
} |
|||
</style> |
|||
|
|||
|
@ -0,0 +1,594 @@ |
|||
<!--红旗M平台导入功能--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<XhJSSelect |
|||
:options="versionList" |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@value-change="selectValue" |
|||
></XhJSSelect> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出Excel |
|||
</el-button> --> |
|||
<el-dropdown |
|||
size="small" |
|||
class="filter-item" |
|||
style="margin-left: 15px; font-weight: bold" |
|||
@command="handleCommand" |
|||
> |
|||
<span class="el-dropdown-link"> |
|||
导出数据<i class="el-icon-arrow-down el-icon--right"></i> |
|||
</span> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="excel" icon="el-icon-plus" |
|||
>导出Excel</el-dropdown-item |
|||
> |
|||
<el-dropdown-item command="csv" icon="el-icon-circle-plus" |
|||
>导出Csv</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照采购订单号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading.fullscreen.lock="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
: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 |
|||
label="版本" |
|||
prop="version" |
|||
sortable="custom" |
|||
align="center" |
|||
width="100px" |
|||
fixed |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.version" placement="top"> |
|||
<span class="link-type">{{ scope.row.version }}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</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> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
import Lockr from "lockr"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue"; |
|||
|
|||
export default { |
|||
name: "HQMPlatform", |
|||
components: { Pagination, CRMTableHead, importExcel, XhJSSelect }, |
|||
directives: { permission }, |
|||
filters: { |
|||
IsCustomerSignFilter(status) { |
|||
//翻译是否签字 |
|||
const statusMap = { |
|||
true: "是", |
|||
false: "否", |
|||
}; |
|||
return statusMap[status]; |
|||
}, |
|||
}, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "hqMPlatform", |
|||
versionValue: "", |
|||
versionList: [], //版本列表 |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
settleAccountId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: true, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listVersionQuery: { |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
site: "TH", |
|||
userId: "00000000-0000-0000-0000-000000000000", |
|||
}, |
|||
listExportQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
fileType: 0, |
|||
userId: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 220, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 220; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getVersionInfo(); |
|||
if (this.versionList == []) { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ label: "行号", prop: "lineNumber", width: 100 }); |
|||
tempsTabs.push({ label: "采购类型", prop: "purchaseType", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购订单号", |
|||
prop: "purchaseOrderNo", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单行项目", |
|||
prop: "purchaseOrderNoItem", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单文本", |
|||
prop: "purchaseOrderNoText", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ label: "收货数量", prop: "receiptQty", width: 120 }); |
|||
tempsTabs.push({ label: "开票数量", prop: "invoicedQty", width: 120 }); |
|||
tempsTabs.push({ label: "不含税金额", prop: "amountNoTax", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购价格不含税", |
|||
prop: "purchasePriceNoTax", |
|||
width: 200, |
|||
}); |
|||
tempsTabs.push({ label: "科目号", prop: "accountNum", width: 150 }); |
|||
tempsTabs.push({ label: "物料代码", prop: "materialCode", width: 180 }); |
|||
tempsTabs.push({ label: "物料描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ |
|||
label: "日期", |
|||
prop: "spareDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
|
|||
tempsTabs.push({ |
|||
label: "交货单号", |
|||
prop: "deliveryOrderNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "交货行号", |
|||
prop: "deliveryLineNum", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "批次号", prop: "batchNo", width: 150 }); |
|||
tempsTabs.push({ label: "税率", prop: "taxRate", width: 100 }); |
|||
tempsTabs.push({ label: "税码", prop: "taxCode", width: 110 }); |
|||
tempsTabs.push({ |
|||
label: "德国发票号", |
|||
prop: "germanInvoiceNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "工厂", prop: "factory", width: 150 }); |
|||
tempsTabs.push({ label: "工厂名称", prop: "factoryName", width: 220 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCommand(command) { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请先选择版本!"); |
|||
return; |
|||
} |
|||
switch (command) { |
|||
case "excel": |
|||
this.listQuery.fileType = 1; //0是csv,1是excel |
|||
break; |
|||
case "csv": |
|||
this.listQuery.fileType = 0; //0是csv,1是excel |
|||
break; |
|||
default: |
|||
//这里是没有找到对应的值处理 |
|||
break; |
|||
} |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("红旗H平台导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQMPlatform/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
|
|||
selectValue(params) { |
|||
//版本下拉选择 |
|||
this.versionValue = params.value; |
|||
this.getList(); |
|||
}, |
|||
selectOptionsChange(item) { |
|||
this.getList(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
//this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQMPlatform/listVersion", this.listQuery) |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.items.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.id; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
if (JSON.stringify(this.versionList) != "[]") { |
|||
//因版本下拉有默认值,所以详表要自动绑定子表数据 |
|||
this.versionValue = this.versionList[0].label; |
|||
this.getList(); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
// if (column.property === "state") { |
|||
// return { 0: "其他", 2: "已结" }[row[column.property]]; |
|||
// } |
|||
if ( |
|||
column.property == "settleInputDate" || |
|||
column.property == "settleDate" |
|||
) { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
this.getVersionInfo(); |
|||
this.listLoading = false; |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
}, |
|||
|
|||
getList() { |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 10; |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("列表查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/HQMPlatform/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
fetchData(id) { |
|||
//循环动态 |
|||
this.$axios |
|||
.gets("/api/settleaccount/HQMPlatform/" + id) |
|||
.then((response) => { |
|||
this.form = response; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "purchaseOrderNo"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
console.log(this.listQuery.Sorting); |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
// if (column.property === "qty") { |
|||
// return { textAlign: "right" }; |
|||
// } else { |
|||
// return { textAlign: "left" }; |
|||
// } |
|||
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); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
.el-table .cell.el-tooltip { |
|||
white-space: pre-wrap; |
|||
} |
|||
</style> |
|||
|
|||
|
Loading…
Reference in new issue