盘点数据的 查询、删除
This commit is contained in:
@ -1,10 +1,5 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
|
||||
namespace WCS.BLL.DbModels
|
||||
{
|
||||
@ -127,9 +122,5 @@ namespace WCS.BLL.DbModels
|
||||
public bool IsSelected { get; set; }
|
||||
}
|
||||
|
||||
public enum StocktakingStatusEnum
|
||||
{
|
||||
未提交 = 0,
|
||||
已提交 = 1,
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatDetailCurrentInfo;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
|
||||
namespace WCS.BLL.Services.IService
|
||||
@ -36,6 +38,12 @@ namespace WCS.BLL.Services.IService
|
||||
|
||||
#region 赛特制冷
|
||||
public Task<ResponseCommon> stockTakingById(StockTakingByIdRequest request);
|
||||
|
||||
public Task<PageQueryResponse<MatDetailStocktakingInfoModel>> getStocktakingInfos(GetStocktakingInfosRequest request);
|
||||
|
||||
public Task<ResponseCommon<object>> updateStocktakingInfo(UpdateStocktakingInfoRequest request);
|
||||
|
||||
public Task<ResponseCommon<object>> deleteStocktakingInfos(DeleteInfosRequest request);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ using WCS.DAL.Db;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatDetailCurrentInfo;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.WebSocketModel;
|
||||
|
||||
@ -1104,6 +1106,160 @@ namespace WCS.BLL.Services.Service
|
||||
Message = $"success",
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<PageQueryResponse<MatDetailStocktakingInfoModel>> getStocktakingInfos(GetStocktakingInfosRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var recordsQueryable = DbHelp.db.Queryable<MatDetailStocktakingInfo>()
|
||||
.LeftJoin<ShelfInfo>((mci, si) => mci.ShlefId == si.Id)
|
||||
.LeftJoin<LocationInfo>((mci, si, li) => (si.TransStatus == TransStatusEnum.静止 && si.CurrentLocationId == li.Id)
|
||||
|| (si.TransStatus == TransStatusEnum.运输中 && si.DestinationLocationId == li.Id))
|
||||
.WhereIF(!string.IsNullOrEmpty(request.MatCode), (mci, si, li) => mci.MatCode.Contains(request.MatCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(request.MatName), (mci, si, li) => mci.MatName.Contains(request.MatName))
|
||||
.WhereIF(!string.IsNullOrEmpty(request.StocktakingUser), (mci, si, li) => mci.StocktakingUser.Contains(request.StocktakingUser))
|
||||
.WhereIF(request.StocktakingStatus != null, (mci, si, li) => mci.StocktakingStatus == request.StocktakingStatus)
|
||||
.Select((mci, si, li) => new MatDetailStocktakingInfoModel()
|
||||
{
|
||||
Id = mci.Id,
|
||||
MatDetailCurrentId = mci.MatDetailCurrentId,
|
||||
|
||||
ShlefId = mci.ShlefId,
|
||||
ShelfCode = mci.ShelfCode,
|
||||
ShelfType = si.ShelfTypeName,
|
||||
ShelfArea = li.LocationArea,
|
||||
|
||||
MatCode = mci.MatCode,
|
||||
MatName = mci.MatName,
|
||||
MatSpec = mci.MatSpec,
|
||||
MatQty = mci.MatQty,
|
||||
StocktakingQty = mci.StocktakingQty,
|
||||
MatSupplier = mci.MatSupplier,
|
||||
MatCustomer = mci.MatCustomer,
|
||||
|
||||
StocktakingUser = mci.StocktakingUser,
|
||||
StocktakingTime = mci.StocktakingTime,
|
||||
StocktakingStatus = mci.StocktakingStatus,
|
||||
});
|
||||
|
||||
//分页
|
||||
var totalCount = await recordsQueryable.CountAsync();
|
||||
var records = await recordsQueryable
|
||||
.OrderByDescending(mci => mci.Id)
|
||||
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
|
||||
.ToListAsync();
|
||||
//生成序号
|
||||
for (int i = 0; i < records.Count; i++)
|
||||
{
|
||||
records[i].RowNumber = (request.PageNumber - 1) * request.PageSize + i + 1;
|
||||
}
|
||||
return new PageQueryResponse<MatDetailStocktakingInfoModel>()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"success",
|
||||
Data = new PageQueryResponseData<MatDetailStocktakingInfoModel>()
|
||||
{
|
||||
TotalCount = totalCount,
|
||||
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
||||
Count = records.Count,
|
||||
Lists = records.ToList()
|
||||
}
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new PageQueryResponse<MatDetailStocktakingInfoModel>()
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新盘点数据的数量
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResponseCommon<object>> updateStocktakingInfo(UpdateStocktakingInfoRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matDetailCurrentInfo = await DbHelp.db.Queryable<MatDetailStocktakingInfo>()
|
||||
.Where(t => t.Id == request.MatDetailStocktakingInfoId)
|
||||
.FirstAsync();
|
||||
if (matDetailCurrentInfo == null)
|
||||
{
|
||||
return new ResponseCommon<Object>
|
||||
{
|
||||
Code = 205,
|
||||
Message = $"更新盘点数据失败:此条数据不存在,请确认!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
matDetailCurrentInfo.StocktakingQty = request.StocktakingQty;
|
||||
matDetailCurrentInfo.StocktakingUser = request.UserName;
|
||||
matDetailCurrentInfo.StocktakingTime = DateTime.Now;
|
||||
var rowNum = await DbHelp.db.Updateable(matDetailCurrentInfo).ExecuteCommandAsync();
|
||||
if (rowNum == 0)
|
||||
{
|
||||
return new ResponseCommon<Object>
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"更新盘点数据失败:请重试!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ResponseCommon<Object>
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"更新盘点数据成功!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var response = new ResponseCommon<Object>
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
Data = null
|
||||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResponseCommon<object>> deleteStocktakingInfos(DeleteInfosRequest request)
|
||||
{
|
||||
//先查询出具体的Id
|
||||
var MatDetailCurrentInfos = await DbHelp.db.Queryable<MatDetailStocktakingInfo>()
|
||||
.Where(t => request.needDeleteIds.Contains(t.Id))
|
||||
.ToListAsync();
|
||||
//执行删除
|
||||
try
|
||||
{
|
||||
var deleteRows = await DbHelp.db.Deleteable(MatDetailCurrentInfos).ExecuteCommandAsync();
|
||||
return new ResponseCommon<Object>
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"已删除{deleteRows}条数据!",
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var response = new ResponseCommon<Object>
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}",
|
||||
Data = null
|
||||
};
|
||||
return response;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
23
WCS.Model/ApiModel/Stocktaking/GetStocktakingInfosRequest.cs
Normal file
23
WCS.Model/ApiModel/Stocktaking/GetStocktakingInfosRequest.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WCS.Model.ApiModel.Stocktaking
|
||||
{
|
||||
public class GetStocktakingInfosRequest : PageQueryRequestBase
|
||||
{
|
||||
public string MatCode { get; set; }
|
||||
|
||||
public string MatName { get; set; }
|
||||
|
||||
public string StocktakingUser { get; set; }
|
||||
|
||||
public StocktakingStatusEnum? StocktakingStatus { get; set; }//盘点状态
|
||||
}
|
||||
|
||||
public enum StocktakingStatusEnum
|
||||
{
|
||||
未提交 = 0,
|
||||
已提交 = 1,
|
||||
}
|
||||
}
|
113
WCS.Model/ApiModel/Stocktaking/MatDetailStocktakingInfoModel.cs
Normal file
113
WCS.Model/ApiModel/Stocktaking/MatDetailStocktakingInfoModel.cs
Normal file
@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
|
||||
namespace WCS.Model.ApiModel.Stocktaking
|
||||
{
|
||||
public class MatDetailStocktakingInfoModel : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键 自增Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架库存明细当前的ID
|
||||
/// </summary>
|
||||
public int MatDetailCurrentId { get; set; }
|
||||
|
||||
#region 货架属性
|
||||
/// <summary>
|
||||
/// 货架ID
|
||||
/// </summary>
|
||||
public int ShlefId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架编码 对应二维码
|
||||
/// </summary>
|
||||
public string ShelfCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架类型
|
||||
/// </summary>
|
||||
public string ShelfType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 货架区域
|
||||
/// </summary>
|
||||
public string ShelfArea { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region 物料属性
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string MatCode { get; set; }
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string MatName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料规格
|
||||
/// </summary>
|
||||
public string? MatSpec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料数量(原始数量)
|
||||
/// </summary>
|
||||
public int MatQty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料数量(盘点数量)
|
||||
/// </summary>
|
||||
public int StocktakingQty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料供应商
|
||||
/// </summary>
|
||||
public string? MatSupplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料客户
|
||||
/// </summary>
|
||||
public string? MatCustomer { get; set; }
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 盘点人
|
||||
/// </summary>
|
||||
public string? StocktakingUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 盘点时间
|
||||
/// </summary>
|
||||
public DateTime? StocktakingTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 盘点状态
|
||||
/// </summary>
|
||||
public StocktakingStatusEnum StocktakingStatus { get; set; } = StocktakingStatusEnum.未提交;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get { return isSelected; }
|
||||
set
|
||||
{
|
||||
isSelected = value;
|
||||
OnPropertyChanged(nameof(IsSelected));
|
||||
}
|
||||
}
|
||||
public bool isSelected;
|
||||
|
||||
public int RowNumber { get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WCS.Model.ApiModel.Stocktaking
|
||||
{
|
||||
public class UpdateStocktakingInfoRequest : RequestBase
|
||||
{
|
||||
public int MatDetailStocktakingInfoId { get; set; }
|
||||
|
||||
public int StocktakingQty { get; set; }
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ using WCS.DAL.DbModels;
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 货架管理、模组管理、库位管理的接口
|
||||
/// 当前库存存量的数据 当前库存数据
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
@ -23,7 +23,7 @@ namespace WCS.WebApi.Controllers
|
||||
_matDetailCurrentInfoService = matDetailCurrentInfoService;
|
||||
}
|
||||
|
||||
#region 位置管理
|
||||
#region 库存数据管理
|
||||
[Route("getMatDetailCurrentInfos")]
|
||||
[HttpPost(Name = "getMatDetailCurrentInfos")]
|
||||
public async Task<ResponseBase> GetMatDetailCurrentInfos(GetMatDetailCurrentInfosRequest request)
|
||||
@ -56,6 +56,15 @@ namespace WCS.WebApi.Controllers
|
||||
[HttpPost("deleteMatDetailCurrentInfo")]
|
||||
public async Task<ResponseCommon<object>> deleteMatDetailCurrentInfo(DeleteInfosRequest request)
|
||||
{
|
||||
//校验
|
||||
if (request.needDeleteIds == null || request.needDeleteIds.Count == 0)
|
||||
{
|
||||
return new ResponseCommon<object>()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:参数校验失败(ID)."
|
||||
};
|
||||
}
|
||||
return await _matDetailCurrentInfoService.deleteMatDetailCurrentInfo(request);
|
||||
}
|
||||
#endregion
|
||||
|
@ -1,14 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.BLL.Services.Service;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.PDAMatBind;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.WebSocketModel;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
@ -67,6 +62,44 @@ namespace WCS.WebApi.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[Route("getStocktakingInfos")]
|
||||
[HttpPost(Name = "getStocktakingInfos")]
|
||||
public async Task<ResponseCommon> getStocktakingInfos(GetStocktakingInfosRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _stockTakingService.getStocktakingInfos(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = ex.Message,
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost("updateStocktakingInfos")]
|
||||
public async Task<ResponseCommon<object>> updateStocktakingInfos(UpdateStocktakingInfoRequest request)
|
||||
{
|
||||
return await _stockTakingService.updateStocktakingInfo(request);
|
||||
}
|
||||
|
||||
[HttpPost("deleteStocktakingInfos")]
|
||||
public async Task<ResponseCommon<object>> deleteStocktakingInfos(DeleteInfosRequest request)
|
||||
{
|
||||
//校验
|
||||
if (request.needDeleteIds == null || request.needDeleteIds.Count == 0)
|
||||
{
|
||||
return new ResponseCommon<object>()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:参数校验失败(ID)."
|
||||
};
|
||||
}
|
||||
return await _stockTakingService.deleteStocktakingInfos(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
354
货架标准上位机/ViewModels/MatDetailStocktakingInfoViewModel.cs
Normal file
354
货架标准上位机/ViewModels/MatDetailStocktakingInfoViewModel.cs
Normal file
@ -0,0 +1,354 @@
|
||||
using HandyControl.Controls;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using SqlSugar;
|
||||
using HandyControl.Data;
|
||||
using System.Windows;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using 智慧物流软件系统.Views.Controls;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using 智慧物流软件系统.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using System.Windows.Controls;
|
||||
using WCS.Model.ApiModel.InterfaceRecord;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using System.Collections.ObjectModel;
|
||||
using HandyControl.Tools.Extension;
|
||||
using 智慧物流软件系统.Tool;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
|
||||
namespace 智慧物流软件系统.ViewModel
|
||||
{
|
||||
public class MatDetailStocktakingInfoViewModel : BindableBase
|
||||
{
|
||||
|
||||
public MatDetailStocktakingInfoViewModel()
|
||||
{
|
||||
//初始化下拉列表框
|
||||
StocktakingStatuses.Add("全部");
|
||||
var statuses = Enum.GetValues(typeof(StocktakingStatusEnum))
|
||||
.Cast<StocktakingStatusEnum>()
|
||||
.ToList();
|
||||
foreach (var status in statuses)
|
||||
{
|
||||
StocktakingStatuses.Add(status.ToString());
|
||||
}
|
||||
|
||||
selectedStocktakingStatus = StocktakingStatuses.First();
|
||||
}
|
||||
|
||||
#region Property
|
||||
private ObservableCollection<MatDetailStocktakingInfoModel> dataGridItemSource;
|
||||
public ObservableCollection<MatDetailStocktakingInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
public MatDetailStocktakingInfoModel selectedataGridItem;
|
||||
public MatDetailStocktakingInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get { return matCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
private string matName;
|
||||
public string MatName
|
||||
{
|
||||
get { return matName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点人
|
||||
/// </summary>
|
||||
private string stocktakingUser;
|
||||
public string StocktakingUser
|
||||
{
|
||||
get { return stocktakingUser; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref stocktakingUser, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盘点状态列表
|
||||
/// </summary>
|
||||
private List<string> stocktakingStatuses = new List<string>();
|
||||
public List<string> StocktakingStatuses
|
||||
{
|
||||
get { return stocktakingStatuses; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref stocktakingStatuses, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedStocktakingStatus;
|
||||
public string SelectedStocktakingStatus
|
||||
{
|
||||
get { return selectedStocktakingStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedStocktakingStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
MatCode = string.Empty;
|
||||
MatName = string.Empty;
|
||||
StocktakingUser = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
var isSelected = Enum.TryParse<StocktakingStatusEnum>(SelectedStocktakingStatus, out StocktakingStatusEnum status);
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetStocktakingInfosRequest()
|
||||
{
|
||||
MatCode = MatCode,
|
||||
MatName = MatName,
|
||||
StocktakingUser = StocktakingUser,
|
||||
StocktakingStatus = isSelected ? status : null,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = PageSize,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatDetailStocktakingInfoModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/getStocktakingInfos", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<MatDetailStocktakingInfoModel>(Result.Data.Lists);
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
dia.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物料修改操作
|
||||
/// </summary>
|
||||
public ICommand BtnEditCommand { get => new DelegateCommand(BtnEdit); }
|
||||
public async void BtnEdit()
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
var matDetailStocktakingInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
|
||||
if (matDetailStocktakingInfo == null)
|
||||
{
|
||||
Growl.Warning("请选择需要修改的数据!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateView = new MatDetailStocktakingInfoUpdateView("修改盘点数据", matDetailStocktakingInfo);
|
||||
updateView.ShowDialog();
|
||||
if (updateView.DialogResult == true)
|
||||
{
|
||||
matDetailStocktakingInfo = updateView.matDetailStocktakingInfo;
|
||||
var body = new UpdateStocktakingInfoRequest()
|
||||
{
|
||||
MatDetailStocktakingInfoId = matDetailStocktakingInfo.Id,
|
||||
StocktakingQty = matDetailStocktakingInfo.StocktakingQty,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/updateStocktakingInfos", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
Growl.Success("修改成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料删除操作
|
||||
/// </summary>
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public async void BtnDelete()
|
||||
{
|
||||
Growl.Ask($"是否删除所有勾选得数据]!", isConfirmed =>
|
||||
{
|
||||
if (isConfirmed)
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
var needDeleteIds = DataGridItemSource?.Where(t => t.IsSelected == true)
|
||||
.Select(t => t.Id)
|
||||
.ToList();
|
||||
|
||||
if (needDeleteIds == null)
|
||||
{
|
||||
Growl.Warning("请选择需要修改的数据!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var body = new DeleteInfosRequest()
|
||||
{
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
needDeleteIds = needDeleteIds,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "PDAStocktaking/deleteStocktakingInfos", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
Growl.Success("删除成功!" + Result?.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set
|
||||
{
|
||||
SetProperty(ref pageSize, value);
|
||||
BtnSearch(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -200,7 +200,7 @@
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:InOutRecordView />
|
||||
<View:MatDetailStocktakingInfoView />
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
<TabItem Padding="10,10,40,10"
|
||||
|
186
货架标准上位机/Views/MatDetailStocktakingInfoUpdateView.xaml
Normal file
186
货架标准上位机/Views/MatDetailStocktakingInfoUpdateView.xaml
Normal file
@ -0,0 +1,186 @@
|
||||
<Window xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="智慧物流软件系统.MatDetailStocktakingInfoUpdateView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
Height="400"
|
||||
Width="320"
|
||||
WindowStyle="None"
|
||||
BorderThickness="0"
|
||||
Background="{x:Null}"
|
||||
AllowsTransparency="True"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Opacity="1"
|
||||
Loaded="Window_Loaded">
|
||||
<Border BorderBrush="Gray"
|
||||
Background="WhiteSmoke"
|
||||
CornerRadius="5"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="18"
|
||||
Name="Title"
|
||||
Margin="8"
|
||||
Text="{Binding Title, FallbackValue=修改盘点数据}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
<Button Margin="-5,-1"
|
||||
Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}"
|
||||
Style="{StaticResource ButtonIcon}"
|
||||
hc:IconElement.Geometry="{StaticResource CloseGeometry}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Click="closeClick" />
|
||||
<StackPanel Margin="5,0"
|
||||
Grid.Row="1">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="物料编码:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="MatCode"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="物料名称:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="MatName"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="物料规格:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="MatSpec"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="货架编号:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="ShelfCode"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="货架区域:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="ShelfArea"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="原始数量:"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="MatQty"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="15"
|
||||
IsReadOnly="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="盘点数量:"
|
||||
FontSize="16"
|
||||
FontWeight="Bold"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
<TextBox Name="StocktakingQty"
|
||||
MinWidth="200"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="16"
|
||||
FontWeight="Bold"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource TextBoxExtend}"></TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="5">
|
||||
<TextBlock Text="提示:确认后将更新【盘点人】为当前用户!"
|
||||
FontSize="15"
|
||||
FontWeight="DemiBold"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"></TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="5"
|
||||
x:Name="spacingPanel"
|
||||
Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Button Margin="5"
|
||||
MinHeight="30"
|
||||
FontSize="15"
|
||||
Content="确认"
|
||||
Name="btnOk"
|
||||
Click="btnOk_Click" />
|
||||
<Button Margin="5"
|
||||
MinHeight="30"
|
||||
FontSize="15"
|
||||
Content="取消"
|
||||
Click="closeClick" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
76
货架标准上位机/Views/MatDetailStocktakingInfoUpdateView.xaml.cs
Normal file
76
货架标准上位机/Views/MatDetailStocktakingInfoUpdateView.xaml.cs
Normal file
@ -0,0 +1,76 @@
|
||||
using HandyControl.Controls;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
|
||||
namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class MatDetailStocktakingInfoUpdateView : System.Windows.Window
|
||||
{
|
||||
public MatDetailStocktakingInfoModel matDetailStocktakingInfo = null;
|
||||
|
||||
|
||||
public MatDetailStocktakingInfoUpdateView(string _titleText, MatDetailStocktakingInfoModel _matDetailStocktakingInfo = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (_matDetailStocktakingInfo != null)
|
||||
{
|
||||
matDetailStocktakingInfo = _matDetailStocktakingInfo;
|
||||
//绑定数据
|
||||
MatCode.Text = matDetailStocktakingInfo.MatCode;
|
||||
MatName.Text = matDetailStocktakingInfo.MatName;
|
||||
MatSpec.Text = matDetailStocktakingInfo.MatSpec;
|
||||
|
||||
ShelfCode.Text = matDetailStocktakingInfo.ShelfCode;
|
||||
ShelfArea.Text = matDetailStocktakingInfo.ShelfArea;
|
||||
|
||||
MatQty.Text = matDetailStocktakingInfo.MatQty.ToString();
|
||||
StocktakingQty.Text = matDetailStocktakingInfo.StocktakingQty.ToString();
|
||||
}
|
||||
|
||||
//绑定标题
|
||||
if (!string.IsNullOrEmpty(_titleText))
|
||||
{
|
||||
Title.Text = _titleText;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void btnOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int.Parse(StocktakingQty.Text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show("盘点数量请输入有效数字!");
|
||||
StocktakingQty.Focus();
|
||||
StocktakingQty.SelectionStart = StocktakingQty.Text.Length;
|
||||
return;
|
||||
}
|
||||
|
||||
matDetailStocktakingInfo.StocktakingQty = int.Parse(StocktakingQty.Text); ;
|
||||
|
||||
this.DialogResult = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
StocktakingQty.Focus();
|
||||
StocktakingQty.SelectionStart = StocktakingQty.Text.Length;
|
||||
}
|
||||
}
|
||||
}
|
407
货架标准上位机/Views/MatDetailStocktakingInfoView.xaml
Normal file
407
货架标准上位机/Views/MatDetailStocktakingInfoView.xaml
Normal file
@ -0,0 +1,407 @@
|
||||
<pi:UserControlBase xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="智慧物流软件系统.MatDetailStocktakingInfoView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737"
|
||||
d:DesignWidth="1192"
|
||||
LoadedVisibleFirst="LoadedVisible">
|
||||
<Border Margin="0"
|
||||
Background="AliceBlue"
|
||||
CornerRadius="3"
|
||||
Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0"
|
||||
Margin="5 5 5 0"
|
||||
Background="AliceBlue"
|
||||
CornerRadius="5"
|
||||
Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="物料编码:"
|
||||
FontSize="18"></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding MatCode}"></TextBox>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="物料名称:"
|
||||
FontSize="18"></TextBlock>
|
||||
<TextBox Grid.Column="3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding MatName}"></TextBox>
|
||||
<TextBlock Grid.Column="4"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="盘点人:"
|
||||
FontSize="18"></TextBlock>
|
||||
<TextBox Grid.Column="5"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
Text="{Binding StocktakingUser}"></TextBox>
|
||||
<TextBlock Grid.Column="6"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Text="盘点状态:"
|
||||
FontSize="18"></TextBlock>
|
||||
<ComboBox Grid.Column="7"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="18"
|
||||
MinWidth="90"
|
||||
ItemsSource="{Binding StocktakingStatuses}"
|
||||
SelectedValue="{Binding SelectedStocktakingStatus}"></ComboBox>
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="9"
|
||||
MinHeight="40"
|
||||
FontSize="18"
|
||||
Content=" 搜索"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}"></Button>
|
||||
<Button Style="{StaticResource ButtonWarning}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="10"
|
||||
MinHeight="40"
|
||||
FontSize="18"
|
||||
Content=" 重置"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnResetCommand}"></Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1"
|
||||
Margin="5"
|
||||
Background="AliceBlue"
|
||||
CornerRadius="5"
|
||||
Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0"
|
||||
Orientation="Horizontal">
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="提 交"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="HotPink"
|
||||
Command="{Binding BtnAddCommand}"></Button>
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="修 改"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="CadetBlue"
|
||||
Command="{Binding BtnEditCommand}"></Button>
|
||||
<Button MinHeight="40"
|
||||
FontSize="18"
|
||||
Margin="5"
|
||||
Content="删 除"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Command="{Binding BtnDeleteCommand}"
|
||||
Style="{StaticResource ButtonDanger}"></Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectionChanged="DataGrid_SelectionChanged"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
Name="dataGrid"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False"
|
||||
FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30"
|
||||
Height="30"
|
||||
IsHitTestVisible="False"
|
||||
IsChecked="{Binding IsSelected}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30"
|
||||
Height="30"
|
||||
Unchecked="allChecked_Unchecked"
|
||||
Checked="allChecked_Checked"
|
||||
Name="allChecked" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="序号"
|
||||
Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料编码"
|
||||
Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料名称"
|
||||
MaxWidth="150"
|
||||
Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料规格"
|
||||
MaxWidth="150"
|
||||
Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="货架编号"
|
||||
Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="货架区域"
|
||||
Binding="{Binding ShelfArea}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="原数量"
|
||||
Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="盘点数量"
|
||||
Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点人"
|
||||
Binding="{Binding StocktakingUser}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点时间"
|
||||
Binding="{Binding StocktakingTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True"
|
||||
Header="盘点状态"
|
||||
Binding="{Binding StocktakingStatus}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3"
|
||||
Background="Transparent"
|
||||
VerticalAlignment="Center">
|
||||
<Grid HorizontalAlignment="Stretch"
|
||||
Margin="0"
|
||||
VerticalAlignment="Top"
|
||||
Width="Auto"
|
||||
MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5">
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
Text="页 "></TextBlock>
|
||||
<ComboBox FontSize="14"
|
||||
VerticalAlignment="Center"
|
||||
SelectedValue="{Binding PageSize}"
|
||||
SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10"
|
||||
IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button BorderBrush="Transparent"
|
||||
Background="Transparent"
|
||||
Grid.Column="0"
|
||||
Name="btnFirst"
|
||||
Content="首页"
|
||||
Foreground="Black"
|
||||
FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}" />
|
||||
<Button BorderBrush="Transparent"
|
||||
Background="Transparent"
|
||||
Grid.Column="1"
|
||||
Name="btnPrev"
|
||||
Content="上一页"
|
||||
FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}" />
|
||||
<TextBox BorderBrush="Transparent"
|
||||
Grid.Column="2"
|
||||
FontSize="14"
|
||||
MinWidth="50"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Cursor="IBeam"
|
||||
IsEnabled="False"
|
||||
Text="{Binding CurrentPage}"
|
||||
TextAlignment="Center" />
|
||||
<Button BorderBrush="Transparent"
|
||||
Background="Transparent"
|
||||
Grid.Column="3"
|
||||
Name="btnNext"
|
||||
Content="下一页"
|
||||
FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}" />
|
||||
<Button BorderBrush="Transparent"
|
||||
Background="Transparent"
|
||||
Grid.Column="4"
|
||||
Name="btnLast"
|
||||
Content="末页"
|
||||
FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--<Border Grid.Row="1" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnExportCommand}"
|
||||
Content=" 导 出" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="DarkOrange">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False"
|
||||
FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="接口地址" Binding="{Binding RequestUrl}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="设备IP" Binding="{Binding DeviceIp}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="请求参数" Binding="{Binding RequestBody}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="QueryString" Binding="{Binding QueryString}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="请求时间" Binding="{Binding RequestTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="返回参数" Binding="{Binding ResponseJson}" MaxWidth="100"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="返回时间" Binding="{Binding ResponseTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="耗时(ms)" Binding="{Binding ExecutionTime}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"
|
||||
|
||||
/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>-->
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
77
货架标准上位机/Views/MatDetailStocktakingInfoView.xaml.cs
Normal file
77
货架标准上位机/Views/MatDetailStocktakingInfoView.xaml.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using 智慧物流软件系统.ViewModel;
|
||||
|
||||
namespace 智慧物流软件系统
|
||||
{
|
||||
public partial class MatDetailStocktakingInfoView : UserControlBase
|
||||
{
|
||||
public MatDetailStocktakingInfoViewModel viewModel { get; set; } = new MatDetailStocktakingInfoViewModel();
|
||||
public MatDetailStocktakingInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
dataGrid.UnselectAllCells();//取消选中 避免手动点击check选项时反选失败 和重新点击该项时反选失败
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user