Compare commits
22 Commits
master
...
ZhongBuZhanQu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d8fa29ec5 |
|
|
|
|
e196898096 |
|
|
|
|
148417c3c1 |
|
|
|
|
ecfe08ebeb |
|
|
|
|
7caa1403d3 |
|
|
|
|
f2fa0a2bb5 |
|
|
|
|
098b7776e6 |
|
|
|
|
32087e3177 |
|
|
|
|
89ada2c5d9 |
|
|
|
|
e003226392 |
|
|
|
|
3b397de523 |
|
|
|
|
9e16a24d60 |
|
|
|
|
694bbd71dc |
|
|
|
|
3f2bfb154a |
|
|
|
|
216ab8a916 |
|
|
|
|
7d4cd33524 |
|
|
|
|
da8593cae4 |
|
|
|
|
9712c1e30c |
|
|
|
|
0ccef22fbd |
|
|
|
|
a0c1e6c174 |
|
|
|
|
ba687a1dd0 |
|
|
|
|
aafa20f7af |
|
File diff suppressed because one or more lines are too long
|
|
@ -33,6 +33,7 @@ namespace MasaBlazorApp3.DataAccess
|
|||
public ITable<PlanDetails> PlanDetails => this.GetTable<PlanDetails>();
|
||||
public ITable<AccountBookG2> AccountBookG2 => this.GetTable<AccountBookG2>();
|
||||
public ITable<HkcChangeShifts> HkcChangeShifts => this.GetTable<HkcChangeShifts>();
|
||||
public ITable<HkcChangeShiftsDetail> HkcChangeShiftsDetail => this.GetTable<HkcChangeShiftsDetail>();
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MasaBlazorApp3.DataAccess
|
||||
{
|
||||
public class CheckInfo<T>
|
||||
{
|
||||
public string StrInfo { get; set; }
|
||||
public List<T> TEntity { get; set; } = new List<T>();
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
|
||||
public Task<List<ChannelList>> GetAllDrugChannelList();
|
||||
|
||||
public Task<bool> DrawerOperationFinish(List<ChannelStock> Stocks, int type);
|
||||
public Task<bool> DrawerOperationFinish(List<ChannelStock> Stocks, int type,BoxModel boxNum,List<ChannelList> channelLists);
|
||||
|
||||
public Task<bool> UnBind(string id);
|
||||
|
||||
|
|
@ -32,54 +32,73 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
public Task<bool> DrawerCheckFinish(List<ChannelStock> Stocks);
|
||||
//抽屉获取库存数据--药品绑定
|
||||
Task<ChannelStockWithDrawerCount<ChannelStock>> GetChannelStockByBiaoDing(int DrawerNo, int Quantity=0);
|
||||
//手术室药箱获取绑定数据
|
||||
//手术室药盒获取绑定数据
|
||||
Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip);
|
||||
/// <summary>
|
||||
/// 手术室药箱绑定套餐
|
||||
/// 手术室药盒绑定套餐
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> BindBox(ChannelList list, Plan plan);
|
||||
/// <summary>
|
||||
/// 手术室药盒绑定套餐
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> BindBox(ChannelList channelList);
|
||||
/// <summary>
|
||||
/// 手术室药箱解绑套餐
|
||||
/// 手术室药盒解绑套餐
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UnBindBox(ChannelList list);
|
||||
//获取手术室药箱中所有要补药的数据
|
||||
//获取手术室药盒中所有要补药的数据
|
||||
Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip);
|
||||
//手术室药箱补药获取毒麻柜中的药品信息
|
||||
//手术室药盒补药获取毒麻柜中的药品信息
|
||||
Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl);
|
||||
//手术室药箱补药完成
|
||||
//手术室药盒补药完成
|
||||
Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList);
|
||||
//手术室药箱入库
|
||||
//手术室药盒入库
|
||||
Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip);
|
||||
//手术室药箱入库获取待入库明细
|
||||
// 药盒入库弹窗页面获取要入库的药品明细信息
|
||||
Task<List<ChannelStock>> GetBoxAddToBox(ChannelList cl);
|
||||
//手术室药盒入库获取待入库明细
|
||||
Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip);
|
||||
// 手术室药箱待入库明细入库完成
|
||||
// 手术室药盒待入库明细入库完成
|
||||
Task<bool> BoxAddBoxFinish(ChannelList boxChannelList);
|
||||
|
||||
//手术室药箱获取药箱药品及库存信息
|
||||
Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip);
|
||||
//药箱移库时获取选中药箱号的药品信息
|
||||
Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip);
|
||||
//手术室药盒获取药盒药品及库存信息
|
||||
Task<PageData<PlanDetails>> GetBoxDrugInfo(string DrawerNo, int? take, int? skip);
|
||||
//药盒移库时获取选中药盒号的药品信息
|
||||
Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, string drawerNo,int? take, int? skip);
|
||||
|
||||
/// <summary>
|
||||
/// 药箱交换药品获取所有除本药箱外的所有药箱号
|
||||
/// 药盒交换药品获取所有除本药盒外的所有药盒号
|
||||
/// </summary>
|
||||
/// <param name="machineId"></param>
|
||||
/// <returns></returns>
|
||||
Task<int[]> GetDrawerNum(ChannelStock channelStock);
|
||||
Task<string[]> GetDrawerNum(ChannelStock channelStock);
|
||||
|
||||
/// <summary>
|
||||
/// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱号
|
||||
/// 药盒移除药品,获取所有除本药盒外的所有包含该药品的药盒号
|
||||
/// </summary>
|
||||
/// <param name="machineId"></param>
|
||||
/// <returns></returns>
|
||||
Task<int[]> GetDrawerNumForRemove(ChannelStock channelStock);
|
||||
Task<string[]> GetDrawerNumForRemove(ChannelStock channelStock);
|
||||
|
||||
//手术室药箱交换药品完成
|
||||
//手术室药盒交换药品完成
|
||||
Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> Stocks);
|
||||
//手术室药箱移出药品完成
|
||||
Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity);
|
||||
//手术室药盒移出药品完成
|
||||
Task<bool> BoxRemoveFinish(ChannelStock stock, string SelectedDrawerNo, int removeQuantity);
|
||||
|
||||
Task<List<ChannelList>> GetAllBox();
|
||||
//根据药盒查询药品信息
|
||||
Task<List<ChannelStock>> GetChannelStockByBox(int BoxNum);
|
||||
//根据套餐下无库存的药箱
|
||||
Task<List<ChannelStock>> GetChannelStockByPlan(string plan);
|
||||
//手术室药盒获取绑定数据
|
||||
Task<List<ChannelList>> GetAllChannelList();
|
||||
//抽屉取药向药盒加药校验药盒中是否存在该药
|
||||
Task<CheckInfo<ChannelList>> CheckBoxDrugInfo(BoxModel BoxNum,List<ChannelStock> channelStockList);
|
||||
//药箱中的药移入到抽屉
|
||||
Task<bool> RemoveDrugToDrawerFinish(string SelectedDrawerNo, ChannelStock channelStock, int quantity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
public interface IDrugInfoDao
|
||||
{
|
||||
Task<List<DrugInfo>> GetAllDrugAndStock();
|
||||
|
||||
Task<List<DrugInfo>> GetAllDrugAndStockByBox(BoxModel boxModel);
|
||||
|
||||
|
||||
Task<List<DrugInfo>> GetAllDrug();
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
{
|
||||
public interface IOrderInfoDao
|
||||
{
|
||||
public Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
|
||||
|
||||
public Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo,DateTime OrderDate, int? take, int? skip);
|
||||
//导入处方查询数据
|
||||
public Task<PageData<OrderInfo>> GetAllOrderInfoForImport(string name, string OrderrNo, DateTime OrderDate, BoxModel boxModel, int? take, int? skip);
|
||||
|
||||
public Task<PageData<OrderInfo>> GetAllCanReturnOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip);
|
||||
|
||||
|
|
@ -26,11 +27,27 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
public Task<bool> OrderReturnFinish(List<OperationVo<MachineRecord>> datas, string OrderrNo);
|
||||
|
||||
public Task<List<OperationVo<MachineRecord>>> getReturnInfoByOrderNo(string OrderrNo);
|
||||
//获取药箱中的用药信息
|
||||
//获取药盒中的用药信息
|
||||
public Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box,string OrderrNo, DateTime OrderDate, int? take, int? skip);
|
||||
//获取所有药箱号
|
||||
public Task<int[]> GetDrawerNum(string machineId);
|
||||
//获取待处理处方中的麻醉师
|
||||
public Task<PageData<OrderInfo>> GetAllOrderInfo(string Name, string BoxNum, string PatientName,string OrderrNo, DateTime? OrderDate, int? take, int? skip);
|
||||
|
||||
public Task<PageData<ChannelStock>> GetAllOrderInfoDrugByBox(BoxModel boxNum, string roomName, DateTime? OrderDate);
|
||||
//获取麻醉师信息
|
||||
public Task<List<Anaesthetist>> GetAnaesthetistName();
|
||||
//获取麻醉师单对应的手术间号
|
||||
public Task<List<BoxModel>> GetOperationNum(int boxColor);
|
||||
//获取麻醉师单对应的手术间号(查询全部手术间已绑套餐的手术间)
|
||||
public Task<List<BoxModel>> GetAllBindOperationNum();
|
||||
//获取所有药盒号
|
||||
public Task<List<ChannelStock>> GetDrawerNum(string machineId);
|
||||
/// 获取指定药盒号
|
||||
public Task<List<BoxModel>> GetDrawerNumByOperationNum(string machineId, List<int> operationNum);
|
||||
//核对处方
|
||||
public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo);
|
||||
public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, BoxModel boxModel);
|
||||
//查询药品对应的库位 drawerType=1药品库位,其他则是回收库位
|
||||
public Task<List<ChannelStock>> GetStockByDRrug(string drugId, string manuNo, int drawerType);
|
||||
//核对处方通过库位下的药品
|
||||
public Task<bool> CheckOrderInfoByChannelStock(IList<ChannelStock> csList, BoxModel boxModel);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,11 @@ namespace MasaBlazorApp3.DataAccess.Dao
|
|||
Task<PageData<ReportStockDateInfo>> GetStockExportData(string drugName);
|
||||
//专用账册导出数据
|
||||
Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName);
|
||||
//手术室患者麻醉药品使用登记本主表数据
|
||||
Task<List<ReportUsageParentDateInfo>> GetOrderInfoParentData(DateTime? startDate);
|
||||
//手术室患者麻醉药品使用登记本
|
||||
Task<List<ReportUsageDateInfo>> GetOrderInfoData(DateTime? startDate);
|
||||
//请领登记表导出
|
||||
Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -28,9 +28,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
var query = _connection.DrugInfo.AsQueryable();
|
||||
|
||||
|
||||
return await query
|
||||
.LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && cs.MachineId == _setting.machineId))
|
||||
List<DrugInfo> drugList = await query
|
||||
.LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && (cs.MachineId == _setting.machineId)))
|
||||
.InnerJoin(
|
||||
_connection.ChannelStock.Where(cl => cl.MachineId == _setting.machineId && cl.DrawerType == 1).GroupBy(cl => cl.DrugId),
|
||||
(di, cl) => di.DrugId == cl.Key,
|
||||
|
|
@ -39,6 +38,48 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
//.Where(cs => cs.Quantity > 0)
|
||||
.OrderBy((di) => di.DrugId)
|
||||
.ToListAsync();
|
||||
if(drugList!=null&&drugList.Count>0)
|
||||
{
|
||||
for (int i = 0; i < drugList.Count; i++)
|
||||
{
|
||||
List<ChannelStock> channelStocks = _connection.ChannelStock.Where(cs => cs.MachineId.Equals(_setting.boxMachineId) && cs.DrugId == drugList[i].DrugId).OrderBy(cs=> new{ cs.DrawerNo, cs.ColNo}).ToList();
|
||||
var nomalBoxStockList= channelStocks.Where(cs => cs.DrawerNo <= 30).GroupBy(cs =>new { cs.ManuNo, cs.EffDate }).Select(g => new { manuNo=g.Key.ManuNo,effdate=g.Key.EffDate,Quantity=g.Sum(k=>k.Quantity)}).ToList();
|
||||
foreach (var item in nomalBoxStockList)
|
||||
{
|
||||
ChannelStock nomalBox = new ChannelStock() { DrugId = drugList[i].DrugId,ManuNo=item.manuNo,Quantity=item.Quantity,EffDate=item.effdate,MachineId= "DM5" };
|
||||
drugList[i].Stocks.Add(nomalBox);
|
||||
}
|
||||
drugList[i].Stocks.AddRange(channelStocks.Where(cs=>cs.DrawerNo>30));
|
||||
}
|
||||
}
|
||||
return drugList;
|
||||
//return await query
|
||||
// .LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && (cs.MachineId == _setting.machineId)))
|
||||
// .InnerJoin(
|
||||
// _connection.ChannelStock.Where(cl => cl.MachineId == _setting.machineId && cl.DrawerType == 1).GroupBy(cl => cl.DrugId),
|
||||
// (di, cl) => di.DrugId == cl.Key,
|
||||
// (di, cl) => di
|
||||
// )
|
||||
// //.Where(cs => cs.Quantity > 0)
|
||||
// .OrderBy((di) => di.DrugId)
|
||||
// .ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<DrugInfo>> GetAllDrugAndStockByBox(BoxModel boxModel)
|
||||
{
|
||||
var query = _connection.DrugInfo.AsQueryable();
|
||||
|
||||
|
||||
return await query
|
||||
.LoadWith(di => di.Stocks.Where(cs => cs.Quantity > 0 && cs.MachineId == _setting.boxMachineId&&cs.DrawerNo==boxModel.BoxName&&cs.ColNo==boxModel.BoxNo))
|
||||
.InnerJoin(
|
||||
_connection.ChannelStock.Where(cl => cl.MachineId == _setting.boxMachineId && cl.DrawerNo==boxModel.BoxName&&cl.ColNo==boxModel.BoxNo).GroupBy(cl => cl.DrugId),
|
||||
(di, cl) => di.DrugId == cl.Key,
|
||||
(di, cl) => di
|
||||
)
|
||||
//.Where(cs => cs.Quantity > 0)
|
||||
.OrderBy((di) => di.DrugId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<PageData<DrugInfo>> GetAllDrug(string drugId, string drugName, int? take, int? skip)
|
||||
|
|
@ -119,6 +160,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
.Where(di => di.DrugId == drugInfo.DrugId)
|
||||
.Set(di => di.DrugName, drugInfo.DrugName)
|
||||
.Set(di => di.DrugSpec, drugInfo.DrugSpec)
|
||||
.Set(di=>di.PackH,drugInfo.PackH)
|
||||
.Set(di => di.Manufactory, drugInfo.Manufactory);
|
||||
return statement.Update() > 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,89 +33,90 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
}
|
||||
public async Task<PageData<InOutInvoice>> GetAllInvoiceByType(string invoiceNo, DateTime invoiceDate, int? take, int? skip, int type = 1)
|
||||
{
|
||||
var query2 = from cl in _connection.ChannelList.Where(c => c.MachineId == _setting.machineId)
|
||||
group cl by cl.DrugId into temp
|
||||
select new { temp.Key };
|
||||
var query3 = from ioi in _connection.InOutInvoice
|
||||
from od in query2.InnerJoin(od => od.Key == ioi.DrugId)
|
||||
group ioi by ioi.InvoiceNo into temp
|
||||
select new InOutInvoice{
|
||||
InvoiceNo= temp.First().InvoiceNo,
|
||||
InPharmacyId = temp.First().InPharmacyId,
|
||||
OutPharmacyId = temp.First().OutPharmacyId,
|
||||
InvoiceDate = temp.First().InvoiceDate,
|
||||
CreateTime = temp.First().CreateTime,
|
||||
Type = temp.First().Type,
|
||||
CancelFlag = temp.First().CancelFlag,
|
||||
Status = temp.First().Status,
|
||||
};
|
||||
//var query2 = from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.machineId)
|
||||
// group cl by cl.DrugId into temp
|
||||
// select new { temp.Key };
|
||||
//var query3 = from ioi in _connection.InOutInvoice
|
||||
// from od in query2.InnerJoin(od => od.Key == ioi.DrugId)
|
||||
// group ioi by ioi.InvoiceNo into temp
|
||||
// select new InOutInvoice{
|
||||
// InvoiceNo= temp.First().InvoiceNo,
|
||||
// InPharmacyId = temp.First().InPharmacyId,
|
||||
// OutPharmacyId = temp.First().OutPharmacyId,
|
||||
// InvoiceDate = temp.First().InvoiceDate,
|
||||
// CreateTime = temp.First().CreateTime,
|
||||
// Type = temp.First().Type,
|
||||
// CancelFlag = temp.First().CancelFlag,
|
||||
// Status = temp.First().Status,
|
||||
// };
|
||||
|
||||
|
||||
|
||||
//var query = _connection.FromSql<InOutInvoice>($@"
|
||||
// SELECT ioi.invoice_no,ioi.in_pharmacy_id, ioi.out_pharmacy_id, ioi.invoice_date, ioi.create_time, ioi.type, ioi.cancel_flag, ioi.status FROM in_out_invoice ioi
|
||||
// INNER JOIN (SELECT drug_id FROM channel_list WHERE machine_id = ""{_setting.machineId}"" GROUP BY drug_id) c ON c.drug_id = ioi.drug_id
|
||||
// GROUP BY ioi.invoice_no");
|
||||
var query = _connection.FromSql<InOutInvoice>($@"
|
||||
SELECT ioi.invoice_no,ioi.in_pharmacy_id, ioi.out_pharmacy_id, ioi.invoice_date, ioi.create_time, ioi.type, ioi.cancel_flag, ioi.status FROM in_out_invoice ioi
|
||||
INNER JOIN (SELECT drug_id FROM channel_stock WHERE machine_id = {_setting.machineId} GROUP BY drug_id) c ON c.drug_id = ioi.drug_id
|
||||
GROUP BY ioi.invoice_no");
|
||||
|
||||
if (!String.IsNullOrEmpty(invoiceNo))
|
||||
{
|
||||
//query = query.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
query = query.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
//query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
}
|
||||
if(invoiceDate != DateTime.MinValue)
|
||||
if (invoiceDate != DateTime.MinValue)
|
||||
{
|
||||
//query = query.Where(ioi => ioi.CreateTime.Date.Equals(invoiceDate.Date));
|
||||
query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
query = query.Where(ioi => Convert.ToDateTime(ioi.InvoiceDate).Date.Equals(invoiceDate.Date));
|
||||
//query3 = query3.Where(ioi => ioi.InvoiceNo.Contains(invoiceNo));
|
||||
}
|
||||
|
||||
if(!String.IsNullOrEmpty(_setting.storage))
|
||||
if (!String.IsNullOrEmpty(_setting.inPharmacyId))
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
//query = query.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
|
||||
query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
|
||||
query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.inPharmacyId));
|
||||
//query = query.Where(ioi => ioi.OutPharmacyId.Equals(_setting.inPharmacyId));
|
||||
//query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
|
||||
}
|
||||
// 调拨出库
|
||||
else if (type == 2)
|
||||
{
|
||||
//query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.storage));
|
||||
query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
|
||||
query = query.Where(ioi => ioi.InPharmacyId.Equals(_setting.inPharmacyId));
|
||||
//query3 = query3.Where(ioi => ioi.OutPharmacyId.Equals(_setting.storage));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 调拨入库
|
||||
if (type == 1)
|
||||
{
|
||||
//query = query.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
|
||||
query3 = query3.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
|
||||
query = query.Where(ioi => (ioi.Type == 2 && ioi.Status == 0));
|
||||
//query3 = query3.Where(ioi => (ioi.Type == 0 && ioi.Status == 2) || (ioi.Type == 1 && ioi.Status == 0));
|
||||
}
|
||||
// 调拨出库
|
||||
else if (type == 2)
|
||||
{
|
||||
//query = query.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
|
||||
query3 = query3.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
|
||||
query = query.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
|
||||
//query3 = query3.Where(ioi => new int[] { 0, 2 }.Contains(ioi.Type) && ioi.Status == 0);
|
||||
}
|
||||
//query = query.Where(ioi => ioi.CancelFlag == 0);
|
||||
//query = query.Select(ioi => new InOutInvoice()
|
||||
//{
|
||||
// InPharmacyId = ioi.InPharmacyId,
|
||||
// OutPharmacyId = ioi.OutPharmacyId,
|
||||
// InvoiceDate = ioi.InvoiceDate,
|
||||
// InvoiceNo = ioi.InvoiceNo,
|
||||
// CreateTime = ioi.CreateTime,
|
||||
// Type = ioi.Type,
|
||||
// Status = ioi.Status,
|
||||
// CancelFlag = ioi.CancelFlag,
|
||||
//});
|
||||
query = query.Where(ioi => ioi.CancelFlag == 0);
|
||||
query = query.Select(ioi => new InOutInvoice()
|
||||
{
|
||||
InPharmacyId = ioi.InPharmacyId,
|
||||
OutPharmacyId = ioi.OutPharmacyId,
|
||||
InvoiceDate = ioi.InvoiceDate,
|
||||
InvoiceNo = ioi.InvoiceNo,
|
||||
CreateTime = ioi.CreateTime,
|
||||
Type = ioi.Type,
|
||||
Status = ioi.Status,
|
||||
CancelFlag = ioi.CancelFlag,
|
||||
});
|
||||
|
||||
query3 = query3.Where(ioi => ioi.CancelFlag == 0);
|
||||
List <InOutInvoice> list = await query3
|
||||
//query3 = query3.Where(ioi => ioi.CancelFlag == 0);
|
||||
List<InOutInvoice> list = await query
|
||||
.OrderByDescending(ioi => ioi.CreateTime)
|
||||
.Skip((int)skip)
|
||||
.Take((int)take)
|
||||
.ToListAsync();
|
||||
|
||||
int pagedData = await query3.CountAsync();
|
||||
int pagedData = await query.CountAsync();
|
||||
return new PageData<InOutInvoice>()
|
||||
{
|
||||
|
||||
|
|
@ -140,23 +141,25 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
|
||||
query = query.Where(cs => cs.MachineId.Equals(_setting.machineId)).Where(cs => cs.DrawerType == 1).Where(cs => cs.DrugId.Equals(DrugId));
|
||||
|
||||
|
||||
|
||||
if (quantity > 0)
|
||||
{
|
||||
query = query.Where(cs => cs.Quantity > 0);
|
||||
if (!String.IsNullOrEmpty(manuNo))
|
||||
if (!String.IsNullOrEmpty(manuNo) && manuNo != "X")
|
||||
{
|
||||
query = query.Where(cs => cs.ManuNo.Equals(manuNo));
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!String.IsNullOrEmpty(manuNo))
|
||||
if (!String.IsNullOrEmpty(manuNo) && manuNo != "X")
|
||||
{
|
||||
query = query.Where(cs => cs.ManuNo.Equals(manuNo) || String.IsNullOrEmpty(cs.ManuNo) || cs.Quantity == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return await query.OrderBy((cs) => cs.EffDate)
|
||||
|
||||
return await query.LoadWith(cl => cl.drugManuNo)
|
||||
.OrderBy((cs) => cs.EffDate)
|
||||
.ThenBy((cs) => cs.DrawerNo)
|
||||
.ThenBy((cs) => cs.ColNo)
|
||||
.ToListAsync();
|
||||
|
|
@ -172,12 +175,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
(ioi, key) => ioi)
|
||||
.Where(ioi => ioi.InvoiceNo.Equals(invoiceNo))
|
||||
.OrderBy(ioi => ioi.DrugId);
|
||||
return await query.ToListAsync();
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<DrugInfo> getDrugInfoById(string DrugId)
|
||||
{
|
||||
return await _connection.DrugInfo.Where(di => di.DrugId == DrugId).FirstOrDefaultAsync();
|
||||
return await _connection.DrugInfo.Where(di => di.DrugId == DrugId).LoadWith(di => di.Manus).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -198,7 +201,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
|
||||
// 当前药品的库存总量
|
||||
var total = stockList.Sum(cs => cs.Quantity);
|
||||
|
||||
|
||||
if (flag)
|
||||
{
|
||||
// 盘点库存是否足够
|
||||
|
|
@ -251,6 +254,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
List<ChannelStock> stockList = await this.GetChannelStockByDrugId(detail.DrugId, detail.DrugManuNo);
|
||||
|
||||
DrugInfo Drug = await this.getDrugInfoById(detail.DrugId);
|
||||
if(Drug!=null&&stockList!=null&&stockList.Count>0)
|
||||
{
|
||||
stockList.ForEach(sl => sl.Drug = Drug);
|
||||
}
|
||||
|
||||
// 当前药品的库存总量
|
||||
var total = stockList.Aggregate(0, (current, next) => current + next.Quantity);
|
||||
|
|
@ -359,7 +366,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
)
|
||||
.Where(cs => cs.DrugId.Equals(ChannelStock.DrugId))
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
// 保存账册
|
||||
int acid = _connection.InsertWithInt32Identity(new AccountBook()
|
||||
{
|
||||
|
|
@ -382,7 +389,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
//根据抽屉类型判断是否需要写标签
|
||||
if (ChannelStock.BoardType.ToString().Contains("5"))
|
||||
{
|
||||
await _portUtil.WriteQuantityMethod(ChannelStock.Quantity- ChannelStock.TakeQuantity, ChannelStock.DrawerNo, ChannelStock.ColNo);
|
||||
await _portUtil.WriteQuantityMethod(ChannelStock.Quantity - ChannelStock.TakeQuantity, ChannelStock.DrawerNo, ChannelStock.ColNo);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -450,15 +457,15 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
.Set(cs => cs.Quantity, ChannelStock.Quantity + ChannelStock.AddQuantity);
|
||||
if (String.IsNullOrEmpty(ChannelStock.ManuNo) || (ChannelStock.Quantity == 0 && !ChannelStock.ManuNo.Equals(invoiceVo.Invoice.DrugManuNo)))
|
||||
{
|
||||
DrugManuNo drugManuNo = await GetDrugManuNo(ChannelStock.DrugId, invoiceVo.Invoice.DrugManuNo);
|
||||
DrugManuNo drugManuNo = await GetDrugManuNo(ChannelStock.DrugId, ChannelStock.drugManuNo.ManuNo);
|
||||
|
||||
ChannelStock.Dmnguid = drugManuNo.Id;
|
||||
ChannelStock.ManuNo = drugManuNo.ManuNo;
|
||||
ChannelStock.EffDate = drugManuNo.EffDate.ToString();
|
||||
ChannelStock.EffDate = drugManuNo.EffDate?.ToString("yyyy-MM-dd");
|
||||
|
||||
q = q.Set(cs => cs.Dmnguid, drugManuNo.Id)
|
||||
.Set(cs => cs.ManuNo, drugManuNo.ManuNo)
|
||||
.Set(cs => cs.EffDate, drugManuNo.EffDate.ToString());
|
||||
q = q.Set(cs => cs.Dmnguid, ChannelStock.Dmnguid)
|
||||
.Set(cs => cs.ManuNo, ChannelStock.ManuNo)
|
||||
.Set(cs => cs.EffDate, ChannelStock.EffDate);
|
||||
}
|
||||
int r = q.Update();
|
||||
if (!DateTime.TryParse(ChannelStock.EffDate, out DateTime dEffDate))
|
||||
|
|
@ -509,7 +516,30 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = invoiceVo.Invoice.InvoiceNo,
|
||||
});
|
||||
|
||||
|
||||
//更新回收箱库存,入库后回收箱的空瓶库存减少
|
||||
//List<ChannelStock> returnChannelStockList = _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 2 && cs.DrugId == ChannelStock.DrugId && cs.Quantity > 0).OrderBy(cs => cs.Quantity).ToList();
|
||||
//if (returnChannelStockList != null && returnChannelStockList.Count > 0 && returnChannelStockList.Sum(rcs => rcs.Quantity) <= ChannelStock.AddQuantity)
|
||||
//{
|
||||
// //空瓶数小于等于入库数量,直接清空所有回收箱中药品空瓶数
|
||||
// returnChannelStockList.ForEach(rcs => rcs.Quantity = 0);
|
||||
// _connection.Update(returnChannelStockList);
|
||||
|
||||
//}
|
||||
//else if(returnChannelStockList != null && returnChannelStockList.Count > 0)
|
||||
//{
|
||||
// for (int rt = 0; rt < ChannelStock.AddQuantity; rt++)
|
||||
// {
|
||||
// int AddQuan = ChannelStock.AddQuantity;
|
||||
// int StockQuan = returnChannelStockList[rt].Quantity;
|
||||
// returnChannelStockList[rt].Quantity = (StockQuan - AddQuan) <= 0 ? 0 : (StockQuan - AddQuan);
|
||||
// ChannelStock.AddQuantity = AddQuan - StockQuan;
|
||||
|
||||
// }
|
||||
|
||||
// _connection.Update(returnChannelStockList);
|
||||
//}
|
||||
|
||||
// 获取更新完库存之后的药品库存
|
||||
List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
|
||||
.Where(cs => cs.MachineId.Equals(_setting.machineId))
|
||||
|
|
@ -547,7 +577,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(!flag)
|
||||
if (!flag)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using MasaBlazorApp3.Pojo.Vo;
|
|||
using MasaBlazorApp3.Port;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Mysqlx.Crud;
|
||||
using System.Collections.Generic;
|
||||
using static LinqToDB.Common.Configuration;
|
||||
|
||||
namespace MasaBlazorApp3.DataAccess.Impl
|
||||
|
|
@ -20,15 +21,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
private readonly ILog logger = LogManager.GetLogger(typeof(MachineRecordDao));
|
||||
private readonly PortUtil _portUtil;
|
||||
|
||||
private GlobalStateService _globalStateService;
|
||||
//public UserDao(MyContext context)
|
||||
//{
|
||||
// Context = context;
|
||||
//}
|
||||
public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil)
|
||||
public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil, GlobalStateService globalStateService)
|
||||
{
|
||||
_connection = connection;
|
||||
_setting = setting.Value;
|
||||
_portUtil = portUtil;
|
||||
_globalStateService = globalStateService;
|
||||
}
|
||||
|
||||
public async Task<List<ChannelStock>> GetChannelStockByDrugId(string DrugId, String ManuNo)
|
||||
|
|
@ -67,14 +70,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
|
||||
public async Task<PageData<MachineRecord>> GetCanReturnRecords(DateTime start, DateTime end, int operatorId, string drugId, int? take, int? skip)
|
||||
{
|
||||
var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
|
||||
var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId)&&it.InvoiceId.StartsWith("DRAWER_"));
|
||||
if (start != null && start != DateTime.MinValue)
|
||||
{
|
||||
query = query.Where(mr => mr.OperationTime > start);
|
||||
}
|
||||
if (end != null && end != DateTime.MinValue)
|
||||
{
|
||||
query = query.Where(mr => mr.OperationTime < end);
|
||||
query = query.Where(mr => mr.OperationTime < end.AddDays(1));
|
||||
}
|
||||
if (operatorId != 0)
|
||||
{
|
||||
|
|
@ -99,14 +102,15 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
|
||||
public async Task<PageData<MachineRecord>> GetMachineRecordAsync(DateTime start, DateTime end, int operatorId, string drugId, int type, int? take, int? skip)
|
||||
{
|
||||
var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
|
||||
var query = from mr in _connection.MachineRecord select mr ;
|
||||
|
||||
if (start != null && start != DateTime.MinValue)
|
||||
{
|
||||
query = query.Where(mr => mr.OperationTime > start);
|
||||
}
|
||||
if (end != null && end != DateTime.MinValue)
|
||||
{
|
||||
query = query.Where(mr => mr.OperationTime < end);
|
||||
query = query.Where(mr => mr.OperationTime < end.AddDays(1));
|
||||
}
|
||||
if (operatorId != 0)
|
||||
{
|
||||
|
|
@ -120,14 +124,48 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
query = query.Where(mr => mr.DrugId == drugId);
|
||||
}
|
||||
query = query.OrderByDescending(mr => mr.OperationTime);
|
||||
query =from mr in query
|
||||
from dr in _connection.DrugInfo.Where(d => d.DrugId == mr.DrugId)
|
||||
from us in _connection.User.Where(u => u.Id == mr.Operator)
|
||||
select MachineRecord.Build(mr, dr, us);
|
||||
|
||||
int pagedData = await query.CountAsync();
|
||||
List<MachineRecord> MachineRecords = await query.LoadWith(mr => mr.Drug)
|
||||
.LoadWith(mr => mr.OperatorUser)
|
||||
.OrderByDescending(mr => mr.OperationTime)
|
||||
List<MachineRecord> MachineRecords = await query
|
||||
//.OrderByDescending(mr => mr.OperationTime)
|
||||
.Skip((int)skip)
|
||||
.Take((int)take)
|
||||
.ToListAsync();
|
||||
|
||||
//var query = _connection.MachineRecord.AsQueryable().Where(it => it.MachineId.Equals(_setting.machineId));
|
||||
//if (start != null && start != DateTime.MinValue)
|
||||
//{
|
||||
// query = query.Where(mr => mr.OperationTime > start);
|
||||
//}
|
||||
//if (end != null && end != DateTime.MinValue)
|
||||
//{
|
||||
// query = query.Where(mr => mr.OperationTime < end.AddDays(1));
|
||||
//}
|
||||
//if (operatorId != 0)
|
||||
//{
|
||||
// query = query.Where(mr => mr.Operator == operatorId);
|
||||
//}
|
||||
//if (type != 0)
|
||||
//{
|
||||
// query = query.Where(mr => mr.Type == type);
|
||||
//}
|
||||
//if (!String.IsNullOrEmpty(drugId))
|
||||
//{
|
||||
// query = query.Where(mr => mr.DrugId == drugId);
|
||||
//}
|
||||
//int pagedData = await query.CountAsync();
|
||||
//List<MachineRecord> MachineRecords = await query.LoadWith(mr => mr.Drug)
|
||||
// .LoadWith(mr => mr.OperatorUser)
|
||||
// .OrderByDescending(mr => mr.OperationTime)
|
||||
// .Skip((int)skip)
|
||||
// .Take((int)take)
|
||||
// .ToListAsync();
|
||||
|
||||
return new PageData<MachineRecord>() { Desserts = MachineRecords, TotalDesserts = pagedData };
|
||||
|
||||
}
|
||||
|
|
@ -230,6 +268,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
_portUtil.SetNumCount(record.DrawerNo, record.ColNo, record.ReturnQuantity);
|
||||
Thread.Sleep(80);
|
||||
}
|
||||
// 获取更新完库存之后的药品库存
|
||||
List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
|
||||
.InnerJoin(
|
||||
_connection.ChannelList.Where(cl => cl.MachineId.Equals(_setting.machineId)).Where(cl => cl.DrawerType == 1),
|
||||
(cs, cl) => cs.ListId == cl.Id,
|
||||
(cs, cl) => cs
|
||||
)
|
||||
.Where(cs => cs.DrugId.Equals(record.DrugId))
|
||||
.ToListAsync();
|
||||
//账册添加入库记录
|
||||
int accountID = _connection.InsertWithInt32Identity(new AccountBook()
|
||||
{
|
||||
MachineId = _setting.machineId,
|
||||
DrugId = record.DrugId,
|
||||
ManuNo = record.ManuNo,
|
||||
EffDate = !String.IsNullOrEmpty(record.EffDate) ? DateTime.ParseExact(record.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 31,
|
||||
AddQuantity = record.ReturnQuantity,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
ManuStock = list.Where(it => it.ManuNo == record.ManuNo).Sum(it => it.Quantity),
|
||||
TotalStock = list.Sum(it => it.Quantity),
|
||||
InvoiceId = data.data.First().InvoiceId,
|
||||
});
|
||||
|
||||
}
|
||||
// 更新 取药记录 设置还药数量、状态
|
||||
|
|
@ -237,8 +300,28 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
record.ReturnQuantity1 = record.ReturnQuantity1 + record.CurrentReturnQuantity;
|
||||
record.Id = record.Id;
|
||||
record.Status = (record.Quantity - (record.ReturnQuantity1 + record.ReturnQuantity2 + sumQuantity)) == 0 ? 2 : 1;
|
||||
record.Status = (record.Quantity - (record.ReturnQuantity1 + record.ReturnQuantity2 + sumQuantity)) <= 0 ? 2 : 1;
|
||||
_connection.Update(record);
|
||||
|
||||
//更新药盒库存(原库存减已还药数)
|
||||
if(record.BoxDrawer>0)
|
||||
{
|
||||
//查询药盒库位中对应的药品信息
|
||||
ChannelStock csBox = _connection.ChannelStock.Where(cs => cs.MachineId.Equals(_setting.boxMachineId) && cs.DrugId == record.DrugId && cs.ManuNo == record.ManuNo && cs.DrawerNo == record.BoxDrawer && cs.ColNo == record.BoxColNo).FirstOrDefault();
|
||||
if(csBox!=null)
|
||||
{
|
||||
csBox.Quantity = csBox.Quantity - sumQuantity;
|
||||
int iUpdateBox= _connection.Update(csBox);
|
||||
if(iUpdateBox<=0)
|
||||
{
|
||||
logger.Info("更新药品库存失败");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Info($"未查询到药品{record.DrugId}批次{record.ManuNo}在库位{record.BoxDrawer}-{record.BoxColNo}中信息");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -338,7 +421,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
Operator = _MachineRecord.Operator,
|
||||
OperationTime = DateTime.Now,
|
||||
Quantity = _MachineRecord.CurrentReturnQuantity,
|
||||
Type = 31,
|
||||
Type = 32,
|
||||
InvoiceId = _MachineRecord.InvoiceId,
|
||||
GetId = _MachineRecord.GetId
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +1,13 @@
|
|||
using LinqToDB;
|
||||
using Google.Protobuf;
|
||||
using LinqToDB;
|
||||
using log4net;
|
||||
using MasaBlazorApp3.DataAccess.Dao;
|
||||
using MasaBlazorApp3.Pojo;
|
||||
using MasaBlazorApp3.Pojo.Config;
|
||||
using MasaBlazorApp3.Pojo.Vo;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Radzen;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
|
@ -25,11 +28,13 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
private readonly SettingConfig _setting;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(DrugInfoDao));
|
||||
private GlobalStateService _globalStateService;
|
||||
public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService)
|
||||
private NotificationService _message;
|
||||
public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService,NotificationService message)
|
||||
{
|
||||
_connection = connection;
|
||||
_setting = setting.Value;
|
||||
_globalStateService = globalStateService;
|
||||
_message = message;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取所有套餐数据
|
||||
|
|
@ -39,7 +44,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
var query = _connection.Plan.AsQueryable();
|
||||
|
||||
List<Plan> list = await query.Where(p => p.UseState == 1)
|
||||
List<Plan> list = await query.Where(p => p.UseState == 1 && p.MachineId==_setting.boxMachineId)
|
||||
.LoadWith(p => p._PlanDetails.Where(pd => pd.UseState == 1))
|
||||
//.ThenLoad(p=>p._DrugInfo)
|
||||
.OrderBy(r => r.Id)
|
||||
|
|
@ -79,7 +84,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
/// <returns></returns>
|
||||
public async Task<Plan> GetPlanById(int Id)
|
||||
{
|
||||
var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1);
|
||||
var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1 && p.MachineId == _setting.boxMachineId);
|
||||
List<Plan> list = await query
|
||||
.LoadWith(p => p._PlanDetails)
|
||||
//.ThenLoad(p=>p._DrugInfo)
|
||||
|
|
@ -114,7 +119,27 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
plan.OperatorUser = _globalStateService.Operator.Id;
|
||||
plan.ReviewerUser = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id;
|
||||
plan.UseState = 1;
|
||||
return _connection.InsertWithInt32Identity(plan) > 0;
|
||||
plan.MachineId = _setting.boxMachineId;
|
||||
if(_connection.InsertWithInt32Identity(plan) > 0)
|
||||
{
|
||||
//保存操作记录
|
||||
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
|
||||
{
|
||||
MachineId = _setting.boxMachineId,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 50,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = $"新增套餐{plan.Name}",
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -134,7 +159,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
try
|
||||
{
|
||||
var iResult = _connection.Plan
|
||||
.Where(p => p.Id == plan.Id)
|
||||
.Where(p => p.Id == plan.Id && p.MachineId == _setting.boxMachineId)
|
||||
.Set(p => p.Name, plan.Name)
|
||||
.Set(p => p.Description, plan.Description);
|
||||
return iResult.Update() > 0;
|
||||
|
|
@ -151,7 +176,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
try
|
||||
{
|
||||
//查询是否有绑定,没有绑定可以删除,有绑定则不允许删除
|
||||
List<string> channelListsId =await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planId.ToString() && cl.MachineId == _setting.boxMachineId).Select(cl => cl.Id).ToListAsync();
|
||||
List<string> channelListsId = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planId.ToString() && cl.MachineId == _setting.boxMachineId).Select(cl => cl.Id).ToListAsync();
|
||||
if (channelListsId != null && channelListsId.Count > 0)
|
||||
{
|
||||
bool searchResult = _connection.ChannelStock.AsQueryable().Where(cs => channelListsId.Contains(cs.ListId)).Any(cs => cs.Quantity > 0);
|
||||
|
|
@ -187,6 +212,20 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
try
|
||||
{
|
||||
_connection.BeginTransaction();
|
||||
|
||||
|
||||
//如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
|
||||
List<string> listIds = await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
|
||||
int iDelResult = 1;
|
||||
int iDelChannelListResult = 1;
|
||||
if (listIds != null && listIds.Count > 0)
|
||||
{
|
||||
//删除channelStock表中的绑定药品
|
||||
iDelResult = _connection.ChannelStock.Where(cs => listIds.Contains(cs.ListId)).Delete();
|
||||
_connection.ChannelList.Where(cl => listIds.Contains(cl.Id)).Set(cl => cl.DrugId, "").Update();
|
||||
|
||||
|
||||
}
|
||||
bool flag = false;
|
||||
logger.Error($"删除套餐{planId}");
|
||||
//查询该套餐下是否有药品,如果有则一并删除
|
||||
|
|
@ -194,25 +233,25 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
int pdResult = 1;
|
||||
if (iHasPd > 0)
|
||||
{
|
||||
pdResult =await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
|
||||
pdResult = await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
|
||||
}
|
||||
int pResult = await _connection.Plan.Where(p => p.Id == planId).Set(pd => pd.UseState, 0).UpdateAsync();
|
||||
|
||||
//如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
|
||||
List<string> listIds =await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
|
||||
int iDelResult = 1;
|
||||
int iDelChannelListResult = 1;
|
||||
if (listIds != null && listIds.Count > 0)
|
||||
{
|
||||
//删除channelStock表中的绑定药品
|
||||
iDelResult = _connection.ChannelStock.Where(cs => listIds.Contains(cs.ListId)).Delete();
|
||||
_connection.ChannelList.Where(cl => listIds.Contains(cl.Id)).Set(cl=>cl.DrugId,"").Update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (pdResult > 0 && pResult > 0 && iDelResult > 0 && iDelChannelListResult > 0)
|
||||
{
|
||||
//保存操作记录
|
||||
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
|
||||
{
|
||||
MachineId = _setting.boxMachineId,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 51,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = $"删除套餐{planId}",
|
||||
});
|
||||
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
|
@ -246,8 +285,18 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
if (!string.IsNullOrEmpty(details.DrugId))
|
||||
{
|
||||
int id =await _connection.InsertWithInt32IdentityAsync(details);
|
||||
int id = await _connection.InsertWithInt32IdentityAsync(details);
|
||||
details.Id = id;
|
||||
//保存操作记录
|
||||
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
|
||||
{
|
||||
MachineId = _setting.boxMachineId,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 52,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = $"套餐{details.PlanId}添加药品{details.DrugId},基数{details.BaseQuantity}",
|
||||
});
|
||||
return id > 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -274,6 +323,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
.Where(p => p.Id == details.Id)
|
||||
.Set(p => p.DrugId, details._DrugInfo.DrugId)
|
||||
.Set(p => p.BaseQuantity, details.BaseQuantity);
|
||||
|
||||
//保存操作记录
|
||||
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
|
||||
{
|
||||
MachineId = _setting.boxMachineId,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 53,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = $"修改套餐{details.PlanId},药品{details.DrugId}-{details._DrugInfo.DrugId},基数{details.BaseQuantity}",
|
||||
});
|
||||
return await iResult.UpdateAsync() > 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -289,7 +349,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
try
|
||||
{
|
||||
bool bFlag = true;
|
||||
List<string> idList =await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planDetail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
|
||||
List<string> idList = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planDetail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
|
||||
if (idList != null && idList.Count > 0)
|
||||
{
|
||||
bFlag = !(_connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == planDetail.DrugId).Any(cs => cs.Quantity > 0));
|
||||
|
|
@ -319,26 +379,37 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
List<string> idList = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == detail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
|
||||
if (idList != null && idList.Count > 0)
|
||||
{
|
||||
iDelResult= await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
|
||||
iDelResult = await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
|
||||
}
|
||||
if (iDelResult > 0)
|
||||
{
|
||||
bool bUpdateResult= _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
|
||||
if(bUpdateResult)
|
||||
//if (iDelResult > 0)
|
||||
//{
|
||||
bool bUpdateResult = _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
|
||||
if (bUpdateResult)
|
||||
{
|
||||
//保存操作记录
|
||||
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
|
||||
{
|
||||
_connection.CommitTransaction();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_connection.RollbackTransaction();
|
||||
return false;
|
||||
}
|
||||
MachineId = _setting.boxMachineId,
|
||||
OperationTime = DateTime.Now,
|
||||
Type = 54,
|
||||
Operator = _globalStateService.Operator.Id,
|
||||
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
|
||||
InvoiceId = $"删除套餐{detail.PlanId},中的药品{detail._DrugInfo.DrugName}ID:{detail.DrugId}",
|
||||
});
|
||||
_connection.CommitTransaction();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_connection.RollbackTransaction();
|
||||
return false;
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// logger.Error($"套餐中的药品{detail._DrugInfo.DrugName}无绑定");
|
||||
// return false;
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
WHERE cl.`machine_id` = '{_setting.machineId}' AND cl.`drawer_type` = 1 ";
|
||||
if (!string.IsNullOrEmpty(drugName))
|
||||
{
|
||||
SQL += " and di.drug_name = '{drugName}'";
|
||||
SQL += $" and (di.drug_name like '%{drugName}%'|| di.py_code like '%{drugName}%'||di.drug_id like '%{drugName}%')";
|
||||
}
|
||||
SQL += " ORDER BY cl.`drug_id`";
|
||||
// 加载模板文件
|
||||
|
|
@ -49,12 +49,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
{
|
||||
foreach (var report in reportList)
|
||||
{
|
||||
reportStockList.Add(report);
|
||||
reportStockList.Add(report);
|
||||
}
|
||||
|
||||
pagedData = await reportList.CountAsync();
|
||||
}
|
||||
return new PageData<ReportStockDateInfo>()
|
||||
return new PageData<ReportStockDateInfo>()
|
||||
{
|
||||
|
||||
TotalDesserts = pagedData,
|
||||
|
|
@ -67,32 +67,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//中部战区总医院麻醉药品、第一类精神药品进出专用账册
|
||||
public async Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName)
|
||||
{
|
||||
List<ReportAccountDateInfo> accountList = new List<ReportAccountDateInfo>();
|
||||
int pagedData = 0;
|
||||
DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
|
||||
DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
|
||||
string SQL = $@"SELECT mr.`stock_quantity` AS `stockQuantity`, IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0))
|
||||
AS `inQuantity`, IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
|
||||
mr.`operation_time` AS `operationTime`, mr.`invoice_id` AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
|
||||
di.`drug_spec` AS `drugSpec`, di.`big_unit` AS `BigUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`,
|
||||
mr.`manu_no` AS `manuNo`, mr.`eff_date` AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName` FROM
|
||||
dm_machine_record mr LEFT JOIN drug_info di ON mr.`drug_id` = di.`drug_id` LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`
|
||||
LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id` WHERE mr.`machine_id` = '{_setting.machineId}' AND mr.`operation_time` > '{p_startDate}'
|
||||
AND mr.`operation_time` < '{p_endDate}'";
|
||||
string SQL = $@"SELECT ab.`create_time` AS `OperationTime`,ab.manu_no AS ManuNo,ab.eff_date as EffDate, ab.add_quantity AS `inQuantity`,
|
||||
ab.out_quantity AS `outQuantity`,ab.manu_quantity as ManuQuantity,ab.total_quantity as StockQuantity,
|
||||
u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName`, ab.`drug_id` AS `drugId`,di.`drug_name` AS `drugName`,di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `BigUnit`, di.`dosage` AS `dosage`,
|
||||
di.`manufactory` AS `manufactory`, ab.`invoice_id` AS `invoiceId`, ab.department as department,'' as Remarks FROM
|
||||
account_book ab LEFT JOIN drug_info di ON ab.`drug_id` = di.`drug_id` LEFT JOIN user_list u1 ON ab.`operator` = u1.`id`
|
||||
LEFT JOIN user_list u2 ON ab.`reviewer` = u2.`id` WHERE ab.`machine_id` = '{_setting.machineId}' AND ab.type in(1,2,31) DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') > '{p_startDate}'
|
||||
AND DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') < '{p_endDate}'";
|
||||
if (!string.IsNullOrEmpty(drugName))
|
||||
{
|
||||
SQL += " AND di.drug_name= '{drugName}'";
|
||||
SQL += $" AND (di.drug_name like '%{drugName}%' or di.drug_id like '%{drugName}%' or di.py_code like '%{drugName}%')";
|
||||
}
|
||||
SQL += " ORDER BY mr.`drug_id`, mr.`operation_time`, mr.`id`";
|
||||
SQL += " ORDER BY ab.`create_time`, ab.`drug_id`";
|
||||
var reportList = _connection.FromSql<ReportAccountDateInfo>(SQL);
|
||||
if (reportList != null)
|
||||
{
|
||||
foreach (var report in reportList)
|
||||
{
|
||||
accountList.Add(report);
|
||||
accountList.Add(report);
|
||||
}
|
||||
|
||||
pagedData = await reportList.CountAsync();
|
||||
|
|
@ -104,5 +103,76 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
Desserts = accountList
|
||||
};
|
||||
}
|
||||
//手术室患者麻醉药品使用登记本(主表数据)
|
||||
public async Task<List<ReportUsageParentDateInfo>> GetOrderInfoParentData(DateTime? searchDate)
|
||||
{
|
||||
//List<ReportUsageParentDateInfo> accountList = new List<ReportUsageParentDateInfo>();
|
||||
int pagedData = 0;
|
||||
|
||||
string SQL = $@"SELECT od.drug_id drugId1, di.drug_Name drugName1,od.set_manu_No as manuNo1,sum(od.quantity) quantity1 ,oi.charge_Date as portDate
|
||||
from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id
|
||||
WHERE DATE_FORMAT(oi.charge_Date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1 group by od.drug_id,od.set_manu_No";
|
||||
|
||||
|
||||
|
||||
|
||||
var reportList =await _connection.FromSql<ReportUsageParentDateInfo>(SQL).ToListAsync();
|
||||
//if (reportList != null)
|
||||
//{
|
||||
// foreach (var report in reportList)
|
||||
// {
|
||||
// accountList.Add(report);
|
||||
// }
|
||||
|
||||
// pagedData = await reportList.CountAsync();
|
||||
//}
|
||||
return reportList;
|
||||
}
|
||||
|
||||
//手术室患者麻醉药品使用登记本(子数据)
|
||||
public async Task<List<ReportUsageDateInfo>> GetOrderInfoData(DateTime? searchDate)
|
||||
{
|
||||
string SQL = $@"SELECT oi.charge_Date as portdate, od.drug_id as DrugId,1 as ShouShuJian,oi.anaesthetist_code as doctor1,oi.anaesthetist_name as doctor2,oi.patient_id as patientId,oi.p_name as PName,oi.disease as Diagnose,
|
||||
CONCAT(di.drug_name,' ',di.drug_spec) as DrugName,od.set_manu_No as ManuNo,od.use_dosage as UsageDosage,'' as CanYeLiang,'' as CanYeChuZhi,'' as UseUserName,'' as CheckUserName,od.quantity as quantity
|
||||
from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id
|
||||
WHERE DATE_FORMAT(oi.charge_Date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1 order by oi.anaesthetist_code,oi.anaesthetist_name, od.drug_id";
|
||||
|
||||
|
||||
|
||||
|
||||
var reportList =await _connection.FromSql<ReportUsageDateInfo>(SQL).ToListAsync();
|
||||
return reportList;
|
||||
}
|
||||
|
||||
//麻醉科毒麻药品请领登记表
|
||||
public async Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate)
|
||||
{
|
||||
List<ReportApplyInfo> accountList = new List<ReportApplyInfo>();
|
||||
int pagedData = 0;
|
||||
|
||||
string SQL = $@"SELECT Drawerno as BoxNum,Create_date AS applyinfo,userfirst,usersecond,drugid,doctor,manager
|
||||
from applyinfo ap inner join drug_info di on ap.drugid=di.drug_id
|
||||
WHERE machine_id='{_setting.boxMachineId}' and DATE_FORMAT(ap.Create_date,'%Y-%m-%d')='{searchDate.ToString("yyyy-MM-dd")}' ";
|
||||
|
||||
|
||||
|
||||
|
||||
var reportList = _connection.FromSql<ReportApplyInfo>(SQL);
|
||||
if (reportList != null&& reportList.Count()>0)
|
||||
{
|
||||
foreach (var report in reportList)
|
||||
{
|
||||
accountList.Add(report);
|
||||
}
|
||||
|
||||
pagedData = await reportList.CountAsync();
|
||||
}
|
||||
return new PageData<ReportApplyInfo>()
|
||||
{
|
||||
|
||||
TotalDesserts = pagedData,
|
||||
Desserts = accountList
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
}
|
||||
public async Task<List<SettingManu>> GetMenuItemsAsync()
|
||||
{
|
||||
var query = _connection.SettingManu.AsQueryable();
|
||||
var query = _connection.SettingManu.Where(s=>s.UseStatus==1).AsQueryable();
|
||||
|
||||
|
||||
return await query
|
||||
|
|
|
|||
|
|
@ -144,7 +144,39 @@ namespace MasaBlazorApp3.DataAccess.Impl
|
|||
.Where(cs => cs.Id == changeShift.Id)
|
||||
.Set(cs => cs.State, "1")
|
||||
.Set(cs => cs.ToDate, DateTime.Now)
|
||||
.Set(cs=>cs.ToOperator,changeShift.ToOperator).Update();
|
||||
.Set(cs => cs.ToOperator, changeShift.ToOperator).Update();
|
||||
|
||||
//插入交接班时药品数据信息
|
||||
var channelStockList = _connection.ChannelStock
|
||||
.Where(cs => (cs.MachineId == _setting.machineId || cs.MachineId == _setting.boxMachineId) && cs.DrawerType == 1)
|
||||
.GroupBy(cs => cs.DrugId)
|
||||
.Select(g => new
|
||||
{
|
||||
drugId = g.Key,
|
||||
sumQuantity = g.Sum(cs => cs.Quantity)
|
||||
}).ToList();
|
||||
|
||||
if (channelStockList != null && channelStockList.Count > 0)
|
||||
{
|
||||
//将药品库存信息写入交接明细表
|
||||
for (int i = 0; i < channelStockList.Count; i++)
|
||||
{
|
||||
//查询药品上次交接的明细,用于记录处方数
|
||||
HkcChangeShiftsDetail? historyList = _connection.HkcChangeShiftsDetail
|
||||
.Where(d => d.DrugId == channelStockList[i].drugId && d.ChangeshiftsId == changeShift.Id).FirstOrDefault();
|
||||
|
||||
HkcChangeShiftsDetail detail = new HkcChangeShiftsDetail()
|
||||
{
|
||||
ChangeshiftsId = insertResult,
|
||||
DrugId = channelStockList[i].drugId,
|
||||
RealNumber = channelStockList[i].sumQuantity,
|
||||
OrderNumber = historyList != null ? historyList.OrderNumber + historyList.RealNumber - channelStockList[i].sumQuantity : 0
|
||||
};
|
||||
var insertDetailResult = _connection.InsertWithInt32Identity(detail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (insertResult <= 0 || updateResult <= 0)
|
||||
{
|
||||
_connection.RollbackTransaction();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="log4net.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
@ -78,6 +81,9 @@
|
|||
<None Update="ReportTemp\account_book_temp.grf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="ReportTemp\use_book.grf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="ReportTemp\machine_log_add.grf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
|
@ -93,5 +99,8 @@
|
|||
<None Update="ReportTemp\stock_template.grf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="ReportTemp\Usage_Temp.grf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@
|
|||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药箱号" Property="DrawerNo">
|
||||
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
|
||||
<Template Context="DrawerNo">
|
||||
@DrawerNo.DrawerNo 号药箱
|
||||
@DrawerNo.DrawerNo 号药盒
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
async void OnRowSelect(ChannelList cl)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxAddBoxDetailDialog>(
|
||||
$"{cl.DrawerNo}号药箱药品入库",
|
||||
$"{cl.DrawerNo}号药盒药品入库",
|
||||
new Dictionary<string, object>() { { "boxChannelList", cl } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,39 @@
|
|||
|
||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
|
||||
<RadzenStack>
|
||||
<RadzenDataGrid Data="@boxChannelList.ChannelStocks" AllowAlternatingRows="true"
|
||||
<RadzenDataGrid Data="@channelStockList" AllowAlternatingRows="true" LoadData="@LoadData"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="ChannelStocks.Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="ChannelStocks.Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="AddToQuantity" Title="入药箱数量" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="Quantity" Title="库存" />
|
||||
<RadzenDataGridColumn Title="药品批次">
|
||||
<Template Context="channelStockList">
|
||||
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
|
||||
{
|
||||
DrugManuNo manu = channelStockList.drugManuNoList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.ManuNo</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期">
|
||||
<Template Context="channelStockList">
|
||||
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
|
||||
{
|
||||
DrugManuNo manu = channelStockList.drugManuNoList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="入药盒数量">
|
||||
<Template Context="channelStockList">
|
||||
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
|
||||
{
|
||||
DrugManuNo manu = channelStockList.drugManuNoList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.Quantity</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</RadzenStack>
|
||||
|
|
@ -38,6 +64,8 @@
|
|||
int count;
|
||||
[Parameter] public ChannelList boxChannelList { get; set; }
|
||||
|
||||
List<ChannelStock> channelStockList = new List<ChannelStock>();
|
||||
|
||||
public List<BoxTakeVo> data { get; set; }
|
||||
//称重取药数量
|
||||
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
|
@ -47,6 +75,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
channelStockList = await channelListDao.GetBoxAddToBox(boxChannelList);
|
||||
base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
|
|
@ -256,7 +285,7 @@
|
|||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"手术室药箱取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
|
||||
logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,385 @@
|
|||
@page "/Box/BoxAddDetail-复制"
|
||||
@using MasaBlazorApp3.Pojo.Config;
|
||||
@using MasaBlazorApp3.Pojo.Vo;
|
||||
@using MasaBlazorApp3.Util;
|
||||
@using Microsoft.Extensions.Options;
|
||||
@using Newtonsoft.Json;
|
||||
@using log4net;
|
||||
|
||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
|
||||
<RadzenStack>
|
||||
@if (CanTakeDrug)
|
||||
{
|
||||
<RadzenDataGrid Data="@data" AllowAlternatingRows="false" ExpandMode="DataGridExpandMode.Multiple">
|
||||
<Template Context="manu">
|
||||
<RadzenDataGrid @ref="grid" Data="@manu.ChannelStock.DrawerChanneStockList" CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))" EmptyText="无数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="库位">
|
||||
<Template>
|
||||
@context.DrawerNo - @context.ColNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="manu.ManuNo" Title="批次" />
|
||||
<RadzenDataGridColumn Property="manu.EffDate" Title="效期" />
|
||||
<RadzenDataGridColumn Property="manu.Quantity" Title="库存" />
|
||||
<RadzenDataGridColumn Property="manu.TakeQuantity" Title="取药数量">
|
||||
@* <Template>
|
||||
@manu.Quantity
|
||||
</Template> *@
|
||||
<EditTemplate Context="cs">
|
||||
<RadzenNumeric Style="display: block" Name="takeQuantity" @bind-Value=@cs.TakeQuantity>
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="1" Max="100" Text="请填写正确的取出数量" Component="takeQuantity" />
|
||||
</RadzenNumeric>
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenDataGrid Data="@data" AllowAlternatingRows="false">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="Quantity" Title="取药数量" />
|
||||
<RadzenDataGridColumn Property="StockQuantity" Title="库存" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
@if (status < 2)
|
||||
{
|
||||
<RadzenButton Click="@OpenDrawer" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="取药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="取药" Style="width: 120px" />
|
||||
}
|
||||
@if (status == 2)
|
||||
{
|
||||
<RadzenButton Click="@TakeFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
}
|
||||
@if (status <= 2)
|
||||
{
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
}
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
|
||||
@code {
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
|
||||
int status;
|
||||
|
||||
[Parameter] public ChannelList boxChannelList { get; set; }
|
||||
private bool CanTakeDrug = true;
|
||||
|
||||
public List<BoxTakeVo> data { get; set; }
|
||||
//称重取药数量
|
||||
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
//开抽屉前操作标识
|
||||
List<string> DrawerNoColNoList = new List<string>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
data = await channelListDao.getTakeInfoByBox(boxChannelList);
|
||||
// 如果有【stockQuantity】字段说明有药品库存不足
|
||||
if (data.Any(it => it.ChannelStock == null))
|
||||
{
|
||||
CanTakeDrug = false;
|
||||
}
|
||||
base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
async Task OpenDrawer()
|
||||
{
|
||||
this.status = 1;
|
||||
// 解析需要打开的抽屉列表
|
||||
List<BoxTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
|
||||
// for (int i = 0; i < data.Count; i++)
|
||||
// {
|
||||
// if (data[i].ChannelStock != null && data[i].ChannelStock.DrawerChanneStockList != null && data[i].ChannelStock.DrawerChanneStockList.Count > 0)
|
||||
// {
|
||||
// for (int j = 0; j < data[i].ChannelStock.DrawerChanneStockList.Count; j++)
|
||||
// {
|
||||
// if (data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity <= 0)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// BoxTakeVo boxTakeVo = new BoxTakeVo() { ChannelStock = data[i].ChannelStock.DrawerChanneStockList[j] };
|
||||
// if (!drawerNos.Contains(boxTakeVo))
|
||||
// {
|
||||
// // if (!(drawerNos.Where(dn => dn.ChannelStock.DrawerNo == boxTakeVo.ChannelStock.DrawerNo).Count() > 0))
|
||||
// // {
|
||||
// drawerNos.Add(boxTakeVo);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 根据抽屉类型来决定打开前是否需要查询数量
|
||||
var promiseUtil = new PromiseUtil<int>();
|
||||
|
||||
await promiseUtil.taskAsyncLoop(500, 0, async (options, next, stop) =>
|
||||
{
|
||||
var orderTakeVo = drawerNos[options._data];
|
||||
var drawerNo = orderTakeVo.ChannelStock.DrawerNo;
|
||||
try
|
||||
{
|
||||
if (this.status == 0)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
// 开启抽屉
|
||||
else if (this.status == 1)
|
||||
{
|
||||
if (orderTakeVo.Status == 0)
|
||||
{
|
||||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
|
||||
var drawerChanneStockList = data.Where(ot => ot.ChannelStock.DrawerNo == drawerNo).Select(ot => ot.ChannelStock.DrawerChanneStockList).ToList();
|
||||
await PortUtil.HasLightOnByCol(drawerNo, drawerChanneStockList[0].Where(i => i.TakeQuantity > 0).ToList().Select(i => i.ColNo).ToArray());
|
||||
}
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
if (!DrawerNoColNoList.Contains(data[i].ChannelStock.DrawerNo.ToString() + data[i].ChannelStock.ColNo))
|
||||
{
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("6"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;
|
||||
PortUtil.ColNoLst.Add(data[i].ChannelStock.ColNo);
|
||||
|
||||
data[i].BeforeQuantity[data[i].ChannelStock.ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStock.ColNo);
|
||||
logger.Info($"称重抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
|
||||
await Task.Delay(200);
|
||||
}
|
||||
|
||||
//是药盒抽屉开药盒
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("3"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;
|
||||
await PortUtil.OpenBoxByColNo(data[i].ChannelStock.ColNo);
|
||||
await Task.Delay(200);
|
||||
}
|
||||
DrawerNoColNoList.Add(data[i].ChannelStock.DrawerNo.ToString() + data[i].ChannelStock.ColNo);
|
||||
}
|
||||
}
|
||||
var b = await PortUtil.OpenDrawerStatus(drawerNo);
|
||||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
|
||||
orderTakeVo.Status = 1;
|
||||
next();
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
}
|
||||
// 检测状态
|
||||
else if (orderTakeVo.Status == 1)
|
||||
{
|
||||
// 查询抽屉是否为关闭状态
|
||||
var b = await PortUtil.CheckDrawerStatus2(drawerNo);
|
||||
// 关闭则改变状态并终止循环
|
||||
if (b)
|
||||
{
|
||||
|
||||
data.ForEach(cl =>
|
||||
{
|
||||
if (cl.ChannelStock.DrawerNo == drawerNo)
|
||||
{
|
||||
cl.GetQuantity = cl.Quantity;
|
||||
|
||||
}
|
||||
});
|
||||
orderTakeVo.Status = 2;
|
||||
// if (data.Any(it => it.ChannelStock.BoardType.ToString().Contains("2")))
|
||||
// {
|
||||
// //有单支抽屉则广播灭灯
|
||||
// PortUtil.AllLightOff();
|
||||
// }
|
||||
if (options._data == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"取药完成,请,点击完成按钮进行确认");
|
||||
this.status = 2;
|
||||
string alertMessage = string.Empty;
|
||||
//检查是否称重抽屉,核对实际取出数量是否与应取数量一致,不一致则弹出提示
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("6"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[i].ChannelStock.DrawerNo;// drawerNo;
|
||||
PortUtil.ColNoLst.Add(data[i].ChannelStock.ColNo);
|
||||
|
||||
orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStock.ColNo);
|
||||
logger.Info($"称重抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
|
||||
if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
|
||||
{
|
||||
//称重自动计数数量与实际要取数量不一致弹出提示,确认后保存数据
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
|
||||
}
|
||||
await Task.Delay(200);
|
||||
}
|
||||
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("2") && data[i].ChannelStock.DrawerNo == drawerNo)
|
||||
{
|
||||
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
|
||||
// WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
|
||||
// if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
|
||||
// {
|
||||
// alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
// }
|
||||
for (int j = 0; j < data[i].ChannelStock.DrawerChanneStockList.Count; j++)
|
||||
{
|
||||
WeightFinnalQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1];
|
||||
if (data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity != WeightFinnalQuantity[data[i].ChannelStock.DrawerChanneStockList[j].ColNo - 1])
|
||||
{
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].ChannelStock.DrawerChanneStockList[j].TakeQuantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//有单支抽屉则广播灭灯
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
// if (!string.IsNullOrEmpty(alertMessage))
|
||||
// {
|
||||
// //弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
// //弹出确认提示框
|
||||
// var confirm = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
// $"保存确认",
|
||||
// new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
|
||||
// new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
logger.Info(alertMessage);
|
||||
// if (!confirm)
|
||||
// {
|
||||
// RestData();
|
||||
// logger.Info("取消保存");
|
||||
// // 关闭弹窗
|
||||
// dialogService.Close(false);
|
||||
// }
|
||||
// }
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
options._data += 1;
|
||||
next();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
next(); // continue iteration
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
RestData();
|
||||
logger.Info($"{boxChannelList.DrawerNo}药盒取药发生错误,{e.Message}");
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
|
||||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void RestData()
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
this.status = 0;
|
||||
data.ForEach(it =>
|
||||
{
|
||||
it.Status = 0;
|
||||
it.BeforeQuantity = new int[9];
|
||||
it.AfterQuantity = new int[9];
|
||||
});
|
||||
this.WeightFinnalQuantity = new int[9];
|
||||
DrawerNoColNoList.Clear();
|
||||
}
|
||||
void Cancel()
|
||||
{
|
||||
RestData();
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
async Task TakeFinish()
|
||||
{
|
||||
|
||||
// 保存账册、操作记录
|
||||
var b = await channelListDao.BoxTakeFinish(data, boxChannelList);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 关闭弹窗
|
||||
dialogService.Close(true);
|
||||
|
||||
}
|
||||
//重置状态
|
||||
this.RestData();
|
||||
}
|
||||
|
||||
RadzenDataGrid<ChannelStock> grid;
|
||||
void OnCellClick(DataGridCellMouseEventArgs<ChannelStock> args)
|
||||
{
|
||||
this.grid.EditRow(args.Data);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,17 +8,6 @@
|
|||
|
||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
|
||||
<RadzenStack>
|
||||
@* <RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">处方号:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.OrderNo)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">患者姓名:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.PatientName)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">性别:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Sex)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">年龄:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Age)</b></RadzenText>
|
||||
|
||||
</RadzenStack> *@
|
||||
@if (CanTakeDrug)
|
||||
{
|
||||
<RadzenDataGrid Data="@data" AllowAlternatingRows="false">
|
||||
|
|
@ -71,6 +60,7 @@
|
|||
@inject Radzen.DialogService dialogService;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
|
|
@ -101,6 +91,8 @@
|
|||
async Task OpenDrawer()
|
||||
{
|
||||
this.status = 1;
|
||||
// PortUtil.PowerOn();
|
||||
// await Task.Delay(200);
|
||||
// 解析需要打开的抽屉列表
|
||||
List<BoxTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
|
||||
|
||||
|
|
@ -125,6 +117,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
|
||||
|
|
@ -169,7 +163,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -192,7 +189,11 @@
|
|||
}
|
||||
});
|
||||
orderTakeVo.Status = 2;
|
||||
PortUtil.AllLightOff();
|
||||
// if (data.Any(it => it.ChannelStock.BoardType.ToString().Contains("2")))
|
||||
// {
|
||||
// //有单支抽屉则广播灭灯
|
||||
// PortUtil.AllLightOff();
|
||||
// }
|
||||
if (options._data == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
|
|
@ -220,36 +221,47 @@
|
|||
await Task.Delay(200);
|
||||
}
|
||||
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("2"))
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("2") && data[i].ChannelStock.DrawerNo == drawerNo)
|
||||
{
|
||||
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
|
||||
if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
|
||||
{
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{orderTakeVo.Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(alertMessage))
|
||||
|
||||
// 所有抽屉操作完成,断电单支抽屉
|
||||
for (int i = 0; i < drawerNos.Count; i++)
|
||||
{
|
||||
//弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
//弹出确认提示框
|
||||
var confirm = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
$"保存确认",
|
||||
new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
|
||||
new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
logger.Info(alertMessage);
|
||||
if (!confirm)
|
||||
if (setting.Value.single.Contains(drawerNos[i].ChannelStock.DrawerNo))
|
||||
{
|
||||
RestData();
|
||||
logger.Info("取消保存");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
PortUtil.PowerOff(drawerNos[i].ChannelStock.DrawerNo);
|
||||
await Task.Delay(200);
|
||||
}
|
||||
}
|
||||
// if (!string.IsNullOrEmpty(alertMessage))
|
||||
// {
|
||||
// //弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
// //弹出确认提示框
|
||||
// var confirm = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
// $"保存确认",
|
||||
// new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
|
||||
// new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
logger.Info(alertMessage);
|
||||
// if (!confirm)
|
||||
// {
|
||||
// RestData();
|
||||
// logger.Info("取消保存");
|
||||
// // 关闭弹窗
|
||||
// dialogService.Close(false);
|
||||
// }
|
||||
// }
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -277,7 +289,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
@ -311,7 +323,7 @@
|
|||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"手术室药箱取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
|
||||
logger.Error($"手术室药盒取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +1,90 @@
|
|||
@page "/Box/BoxAdd"
|
||||
@using MasaBlazorApp3.Report
|
||||
@using Radzen.Blazor.Rendering
|
||||
<style>
|
||||
@@keyframes shake {
|
||||
0% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
0% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
|
||||
25% {
|
||||
opacity: 1;
|
||||
color: orange;
|
||||
}
|
||||
25% {
|
||||
opacity: 1;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0;
|
||||
color: yellow;
|
||||
}
|
||||
50% {
|
||||
opacity: 0;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
75% {
|
||||
opacity: 1;
|
||||
color: crimson;
|
||||
}
|
||||
75% {
|
||||
opacity: 1;
|
||||
color: crimson;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.rz-custom-header {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.shaky-text {
|
||||
animation: shake 2s infinite ease-in-out;
|
||||
/* 你可以根据需要调整动画的持续时间和迭代次数 */
|
||||
transition: color 0.5s linear,opacity 0.5s linear;
|
||||
animation: shake 2s infinite ease-in-out;
|
||||
/* 你可以根据需要调整动画的持续时间和迭代次数 */
|
||||
transition: color 0.5s linear,opacity 0.5s linear;
|
||||
}
|
||||
|
||||
.my-popup {
|
||||
display: none;
|
||||
position:absolute;
|
||||
overflow: hidden;
|
||||
/* height: 360px;
|
||||
width: 600px; */
|
||||
border: var(--rz-panel-border);
|
||||
background-color: var(--rz-panel-background-color);
|
||||
box-shadow: var(--rz-panel-shadow);
|
||||
border-radius: var(--rz-border-radius);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
@* <RadzenFieldset Text="报表导出">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton @ref=button Icon="download" Text="请领登记表导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
|
||||
<Popup @ref=popup Lazy=true class="my-popup">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
|
||||
<RadzenFieldset Text="条件选择">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="查询时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</RadzenStack>
|
||||
</Popup>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset> *@
|
||||
<RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts" @bind-Value=@selectedChannelLists
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts" @bind-Value=@selectedChannelLists
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
ExpandMode="DataGridExpandMode.Multiple" LoadData="@LoadData" IsLoading="@isLoading" Count="@count"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Template Context="cs">
|
||||
|
|
@ -58,7 +96,7 @@
|
|||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory">
|
||||
</RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate">
|
||||
</RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="基数" Property="BaseQuantity">
|
||||
|
|
@ -69,9 +107,17 @@
|
|||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药箱号" Property="DrawerNo">
|
||||
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药盒号" Property="DrawerNo">
|
||||
<Template Context="DrawerNo">
|
||||
@DrawerNo.DrawerNo 号药箱
|
||||
|
||||
@(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" :
|
||||
DrawerNo.DrawerNo == 31 ? "胃镜药盒" :
|
||||
DrawerNo.DrawerNo == 32 ? "导管药盒" :
|
||||
DrawerNo.DrawerNo == 33 ? "生殖药盒" :
|
||||
DrawerNo.DrawerNo == 34 ? "妇门药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo == 1 ? '白' : '绿')}")
|
||||
@* @(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo==1?'白':'绿')}") *@
|
||||
|
||||
@* @($"{DrawerNo.DrawerNo}-{DrawerNo.ColNo}") *@
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
|
||||
|
|
@ -82,19 +128,21 @@
|
|||
@code {
|
||||
@inject IChannelListDao channelStockDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject IReportDataDao reportDataDao;
|
||||
RadzenDataGrid<ChannelList> grid;
|
||||
bool isLoading;
|
||||
int count;
|
||||
private IEnumerable<ChannelList>? _forecasts;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
|
||||
RadzenButton button;
|
||||
Popup popup;
|
||||
IList<ChannelList> selectedChannelLists;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
|
|
@ -123,7 +171,7 @@
|
|||
async void OnRowSelect(ChannelList cl)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxAddDetailDialog>(
|
||||
$"{cl.DrawerNo}号药箱取药",
|
||||
cl.DrawerNo==99?"急诊药盒":cl.DrawerNo==111?"恢复室药盒":$"{cl.DrawerNo}-{(cl.ColNo==1?'白':'绿')} 药盒加药",
|
||||
new Dictionary<string, object>() { { "boxChannelList", cl } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
|
|
@ -134,14 +182,14 @@
|
|||
}
|
||||
|
||||
|
||||
async void StockExport()
|
||||
|
||||
//请领登记表导出
|
||||
async Task AccountBookExport()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
async void AccountBookExport()
|
||||
{
|
||||
|
||||
// string drugId = drugName != null ? drugName.Split('/').Last().Trim():"";
|
||||
// GridReportUtil gridReportUtil = new GridReportUtil();
|
||||
PageData<ReportApplyInfo> pageData = await reportDataDao.GetApplyInfoDate(start);
|
||||
GridReportUtil.PrintReport("account_book_temp.grf", pageData);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +1,100 @@
|
|||
@page "/Box/BoxBindings"
|
||||
|
||||
|
||||
<style>
|
||||
.mycol {
|
||||
width: calc(100%/8);
|
||||
margin: 4px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
@* <RadzenFieldset Text="查询">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
<RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">选择套餐</RadzenText>
|
||||
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@EditChannel" Text="绑定/解绑" />
|
||||
</RadzenStack>
|
||||
</RadzenFieldset> *@
|
||||
<form onsubmit="@(() => EditChannel())">
|
||||
<RadzenFieldset Text="选择套餐">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenButton ButtonType="ButtonType.Submit" Size="ButtonSize.Medium" Text="绑定/解绑" />
|
||||
@* <RadzenButton Size="ButtonSize.Medium" Click="@EditChannel" IsBusy="isLoading" Text="解绑" ButtonStyle="ButtonStyle.Warning" /> *@
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
|
||||
ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" Data="@_forecasts" PageSize="56" style="height:61vh; overflow:auto">
|
||||
<Template Context="channel">
|
||||
<RadzenCard class="col-3">
|
||||
<RadzenCard class="mycol" onclick="@(() => CardClick(channel))">
|
||||
<RadzenRow>
|
||||
<RadzenColumn Size="8" Class="rz-text-truncate">
|
||||
<b class="rz-pr-3">@(channel.DrawerNo)</b>
|
||||
<b>号手术间</b>
|
||||
@if (channel.DrawerNo == 99)
|
||||
{
|
||||
<b class="rz-pr-3">@($"急诊药盒")</b>
|
||||
}
|
||||
else if(channel.DrawerNo==111)
|
||||
{
|
||||
<b class="rz-pr-3">@($"恢复室药盒")</b>
|
||||
}
|
||||
else if (channel.DrawerNo == 31)
|
||||
{
|
||||
<b class="rz-pr-3">@($"胃镜药盒")</b>
|
||||
}
|
||||
else if(channel.DrawerNo==32)
|
||||
{
|
||||
<b class="rz-pr-3">@($"导管药盒")</b>
|
||||
}
|
||||
else if (channel.DrawerNo == 33)
|
||||
{
|
||||
<b class="rz-pr-3">@($"生殖药盒")</b>
|
||||
}
|
||||
else if(channel.DrawerNo==34)
|
||||
{
|
||||
<b class="rz-pr-3">@($"妇门药盒")</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
<b class="rz-pr-3">@($"{channel.DrawerNo}-{(channel.ColNo == 1 ? '白':'绿')}")</b>
|
||||
}
|
||||
@* <b>号药盒</b> *@
|
||||
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="4" Class="rz-text-align-end">
|
||||
@if (channel.TotalQuantity == 0)
|
||||
{
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@(() => EditChannel(channel))" Text="绑定/解绑" />
|
||||
}
|
||||
<RadzenColumn Size="4" class="rz-text-align-end">
|
||||
<RadzenCheckBox TValue="bool" Disabled=@channel.BoxDisabled @bind-Value=@channel.IsChecked />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
<RadzenStack Gap="0">
|
||||
<RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">套餐</RadzenText>
|
||||
@if (channel.DrugId == null || channel.TotalQuantity == 0)
|
||||
{
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" @bind-Value="channel.PlanInfo" Data="@plans"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
|
||||
|
||||
<RadzenDropDownDataGridColumn Property="Description" Width="120px" Title="套餐描述" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenCustomValidator Component="planName" Validator="@(()=>(channel.PlanInfo.Id>0))" Popup=true Text="请先选择套餐再点击绑定按钮" />
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.Body1"><b>@(channel.PlanInfo.Name)</b></RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body1"><b>@(channel.PlanInfo.Name)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-4 rz-mb-0">总库存</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1"><b>@(channel.TotalQuantity)</b></RadzenText>
|
||||
</RadzenStack>
|
||||
|
|
@ -60,6 +111,7 @@
|
|||
@inject IDrugInfoDao drugInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject NotificationService _message
|
||||
@inject IPlanDao planDao;
|
||||
RadzenDataList<ChannelList> grid;
|
||||
bool isLoading;
|
||||
int count;
|
||||
|
|
@ -74,22 +126,26 @@
|
|||
|
||||
|
||||
List<Plan> plans;
|
||||
|
||||
int firstFlag = 0;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
var resultPlan = await planDao.GetAllPlanInfo();
|
||||
plans = resultPlan.Desserts.Where(p => p._PlanDetails.Count > 0).ToList();
|
||||
firstFlag = 0;
|
||||
|
||||
//drugInfos = await drugInfoDao.GetAllDrug();
|
||||
}
|
||||
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
|
||||
isLoading = true;
|
||||
|
||||
var result = await channelListDao.GetAllChannelListWithPlan(args.Top, args.Skip);
|
||||
|
||||
// Update the Data property
|
||||
_forecasts = result.Desserts;
|
||||
|
||||
// Update the count
|
||||
count = result.TotalDesserts;
|
||||
|
||||
|
|
@ -103,60 +159,120 @@
|
|||
await grid.Reload();
|
||||
}
|
||||
|
||||
async Task EditChannel(ChannelList list)
|
||||
|
||||
|
||||
|
||||
// 默认选中的项
|
||||
private Plan selectedPlan = new();
|
||||
// 处理选择变更(可选)
|
||||
private void OnPlanSelected(Plan plan)
|
||||
{
|
||||
if (list.PlanInfo.Id > 0)
|
||||
selectedPlan = plan;
|
||||
}
|
||||
//绑定
|
||||
async Task EditChannel()
|
||||
{
|
||||
List<ChannelList> bindList = _forecasts.Where(b => b.IsChecked).ToList();
|
||||
if (bindList == null || bindList.Count <= 0)
|
||||
{
|
||||
// 说明之前有绑定并且未改变,那么就是在进行解绑
|
||||
if (list.DrugId != null && list.DrugId.Equals(list.PlanInfo.Id.ToString()))
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(bindList[0].DrugId))
|
||||
{
|
||||
//之前有绑定,在进行解绑
|
||||
foreach (var item in bindList)
|
||||
{
|
||||
var b = await channelListDao.UnBindBox(list);
|
||||
var b = await channelListDao.UnBindBox(item);
|
||||
if (b)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
|
||||
);
|
||||
await reloadGrid();
|
||||
}
|
||||
|
||||
}
|
||||
// 否则是进行绑定
|
||||
else
|
||||
{
|
||||
var b = await channelListDao.BindBox(list);
|
||||
if (b)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
|
||||
);
|
||||
await reloadGrid();
|
||||
}
|
||||
await grid.Reload();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list.PlanInfo != null)
|
||||
{// 否则是进行解绑
|
||||
if (selectedPlan != null && selectedPlan.Id > 0)
|
||||
{
|
||||
// 说明只设置了药品
|
||||
var b = await channelListDao.BindBox(list);
|
||||
if (b)
|
||||
foreach (var item in bindList)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
|
||||
);
|
||||
await reloadGrid();
|
||||
var b = await channelListDao.BindBox(item, selectedPlan);
|
||||
if (b)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
await grid.Reload();
|
||||
}
|
||||
// 什么都没有选择或者么有改变,只是点击了按钮,此时不操作
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择套餐", Duration = 4000 }
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async Task CardClick(ChannelList list)
|
||||
{
|
||||
if (firstFlag == 0 && !(list.BoxDisabled))
|
||||
{
|
||||
firstFlag = 1;
|
||||
if (!string.IsNullOrEmpty(list.DrugId))
|
||||
{
|
||||
list.IsChecked = !list.IsChecked;
|
||||
//已绑药品需要解绑,未绑定的不可选
|
||||
if (list.IsChecked)
|
||||
{
|
||||
_forecasts.Where(it => it.DrugId != list.DrugId || it.TotalQuantity > 0).ToList().ForEach(it => it.BoxDisabled = true);
|
||||
selectedPlan = await planDao.GetPlanById(Convert.ToInt32(list.DrugId));
|
||||
}
|
||||
else
|
||||
{
|
||||
_forecasts.Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
|
||||
firstFlag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
list.IsChecked = !list.IsChecked;
|
||||
//未绑定药品则已绑定的不可选
|
||||
if (list.IsChecked)
|
||||
{
|
||||
_forecasts.Where(it => !string.IsNullOrEmpty(it.DrugId) || it.TotalQuantity > 0).ToList().ForEach(it => it.BoxDisabled = true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_forecasts.ToList().Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
|
||||
firstFlag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!list.BoxDisabled)
|
||||
{
|
||||
list.IsChecked = !list.IsChecked;
|
||||
}
|
||||
//isChecked==false 1)是否全部是false,是则将所有isChecked==true,不是则不做改变
|
||||
if (!_forecasts.Any(b => b.IsChecked == true))
|
||||
{
|
||||
_forecasts.Where(it => it.TotalQuantity <= 0).ToList().ForEach(it => it.BoxDisabled = false);
|
||||
firstFlag = 0;
|
||||
}
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,212 @@
|
|||
@page "/Box/BoxBindings123"
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<RadzenFieldset class="col-12 mb-4" Text="选择药盒">
|
||||
<div class="col-12 row justify-content-center align-items-center text-center">
|
||||
<div class="row justify-content-around align-items-center" style="overflow:auto">
|
||||
@if (BoxList != null)
|
||||
{
|
||||
foreach (var item in BoxList)
|
||||
{
|
||||
<div class="col-2">
|
||||
<RadzenCheckBox Style="width:40px;height:40px;margin:2px" TValue="bool" Disabled=@item.BoxDisabled @bind-Value=@item.IsChecked Name="@($"CheckBox_{item.DrawerNo}")" Change="@((bool isChecked) => OnCheckBoxChange(isChecked, item.DrawerNo))" />
|
||||
@if(item.DrawerNo<51)
|
||||
{
|
||||
<RadzenLabel Text="@($"{(item.DrawerNo % 2 == 0 ? item.DrawerNo : item.DrawerNo+1)/2}-{(item.DrawerNo % 2 == 0 ? 2 : 1)}")" Component="@($"CheckBox_{item.DrawerNo}")" />
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenLabel Text="@($"{item.DrawerNo -25}")" Component="@($"CheckBox_{item.DrawerNo}")" />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</RadzenFieldset>
|
||||
<RadzenCard class="col-12 mb-2">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@EditChannel" Text="绑定/解绑" />
|
||||
<hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
<RadzenStack Gap="0">
|
||||
<RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">选择套餐</RadzenText>
|
||||
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</RadzenCard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IDrugInfoDao drugInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject NotificationService _message;
|
||||
@inject IPlanDao planDao;
|
||||
int count;
|
||||
private List<ChannelList>? _forecasts;
|
||||
private List<ChannelList>? BoxList;
|
||||
|
||||
List<DrugInfo> drugInfos;
|
||||
List<DrugManuNo> drugManuNos;
|
||||
|
||||
DrugInfo drugInfo;
|
||||
|
||||
DrugManuNo drugManuNo;
|
||||
|
||||
int firstFlag = 0;
|
||||
|
||||
List<Plan> plans;
|
||||
// 默认选中的项
|
||||
private Plan selectedPlan = new();
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadData();
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
//drugInfos = await drugInfoDao.GetAllDrug();
|
||||
}
|
||||
|
||||
async Task LoadData()
|
||||
{
|
||||
BoxList = await channelListDao.GetAllBox();
|
||||
var result = await planDao.GetAllPlanInfo();
|
||||
plans = result.Desserts.Where(p=>p._PlanDetails.Count>0).ToList();
|
||||
_forecasts = await channelListDao.GetAllChannelList();
|
||||
firstFlag = 0;
|
||||
}
|
||||
|
||||
// 处理选择变更(可选)
|
||||
private void OnPlanSelected(Plan plan)
|
||||
{
|
||||
selectedPlan = plan;
|
||||
}
|
||||
|
||||
//绑定
|
||||
async Task EditChannel()
|
||||
{
|
||||
List<ChannelList> bindList = BoxList.Where(b => b.IsChecked).ToList();
|
||||
if (bindList == null || bindList.Count <= 0)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(bindList[0].DrugId))
|
||||
{
|
||||
//之前有绑定,在进行解绑
|
||||
foreach (var item in bindList)
|
||||
{
|
||||
var b = await channelListDao.UnBindBox(item);
|
||||
if (b)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
await LoadData();
|
||||
}
|
||||
else
|
||||
{// 否则是进行绑定
|
||||
if (selectedPlan != null && selectedPlan.Id > 0)
|
||||
{
|
||||
foreach (var item in bindList)
|
||||
{
|
||||
var b = await channelListDao.BindBox(item, selectedPlan);
|
||||
if (b)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
await LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择套餐", Duration = 4000 }
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnCheckBoxChange(bool isChecked, int DrawerNo)
|
||||
{
|
||||
//isChecked==true 1)当前选择的药箱已经绑药套餐且库存<=0,如果有库存则提示不能选择,如果无库存则列出与之绑定相同套餐且库存<=0的药箱号,其他药箱号不可选择
|
||||
// 2)当前选择的药箱未绑定套餐则将所有未绑定套餐的药箱号列出来,其他药箱不可操作
|
||||
if (firstFlag == 0)
|
||||
{
|
||||
if (isChecked)
|
||||
{
|
||||
firstFlag = 1;
|
||||
string drugId = BoxList.Where(b => b.DrawerNo == DrawerNo).Select(b => b.DrugId).FirstOrDefault();
|
||||
//所选药箱已绑定套餐
|
||||
if (!string.IsNullOrEmpty(drugId))
|
||||
{
|
||||
//查询该药箱下的药品库存是否存在不为0的,存在则不让选择
|
||||
List<ChannelStock> stockList = await channelListDao.GetChannelStockByBox(DrawerNo);
|
||||
if (stockList != null && stockList.Count > 0)
|
||||
{
|
||||
//该药箱下存在库存不为0的药品
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒下的药品仍有库存,请清库存后再操作", Duration = 4000 }
|
||||
);
|
||||
BoxList.ForEach(it => it.IsChecked = false);
|
||||
firstFlag = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//无库存则列出与之绑定相同套餐且库存 <= 0的药箱号,其他药箱号不可选择
|
||||
// BoxList.Where(b => string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
|
||||
//1)查询套餐下无库存的药箱号
|
||||
List<ChannelStock>? lists = await channelListDao.GetChannelStockByPlan(drugId);
|
||||
if (lists != null && lists.Count > 0)
|
||||
{
|
||||
int[] boxNum = lists.Select(l => l.DrawerNo).ToArray();
|
||||
//不在该lists下的药箱号不可选择
|
||||
BoxList.Where(b => !boxNum.Contains(b.DrawerNo)).ToList().ForEach(b => b.BoxDisabled = true);
|
||||
}
|
||||
selectedPlan = await planDao.GetPlanById(Convert.ToInt32(drugId));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//未绑定套餐 ,列出所有未绑的药箱号,其他不可操作
|
||||
BoxList.Where(b => !string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isChecked)
|
||||
{
|
||||
//isChecked==false 1)是否全部是false,是则将所有isChecked==true,不是则不做改变
|
||||
if (!BoxList.Any(b => b.IsChecked == true))
|
||||
{
|
||||
BoxList.ForEach(b => b.BoxDisabled = false);
|
||||
firstFlag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
|
||||
<RadzenStack>
|
||||
<RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
|
||||
@* <RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
|
||||
<RadzenText Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">规格:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
|
||||
|
|
@ -18,27 +18,71 @@
|
|||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">效期:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText> *@
|
||||
<div style="text-align: left;width:15vw">
|
||||
<div class="rz-text-h6 rz-mb-0">药品名称</div>
|
||||
@(channelStock.Drug.DrugName)
|
||||
</div>
|
||||
<div style="text-align: left;width:6vw">
|
||||
<div class="rz-text-h6 rz-mb-0">规格</div>
|
||||
@(channelStock.Drug.DrugSpec)
|
||||
</div>
|
||||
<div style="text-align: left;width:8vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">批次</div>
|
||||
@(channelStock.ManuNo)
|
||||
</div>
|
||||
<div style="text-align: left;width:8vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">效期</div>
|
||||
@(channelStock.EffDate)
|
||||
</div>
|
||||
<div style="text-align: left;width:4vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">库存</div>
|
||||
@(channelStock.Quantity)
|
||||
</div>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
<RadzenStack style="align-content:center">
|
||||
|
||||
<RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border);align-content:center" Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入药箱:</RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入</RadzenText>
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 11vw;"
|
||||
ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
@((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 2 ? "绿" : (context as BoxModel).BoxNo == 3 ? "非常规" : "抽屉")
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Name="DropDownChangeEvent">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
|
||||
</RadzenDropDown>
|
||||
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入数量:</RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入数量</RadzenText>
|
||||
|
||||
<RadzenNumeric Min="0" Style="display: block" Max=@channelStock.Quantity Name="Quantity" @bind-Value="removeQuantity" />
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
|
||||
<RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
@if (BoxColor.BoxNo == 4)
|
||||
{
|
||||
@if (status < 3)
|
||||
{
|
||||
<RadzenButton IsBusy="@(status > 0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="加药" Click="@OpenDrawer" Style="width: 120px" />
|
||||
<RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
|
||||
}
|
||||
@if (status == 3)
|
||||
{
|
||||
<RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@AddFinish" Style="width: 120px" />
|
||||
<RadzenButton Visible="@CancleIsEnable" Variant="Variant.Flat" Text="取消" Click="@Cancel" Style="width: 120px" />
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
}
|
||||
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
|
|
@ -46,22 +90,40 @@
|
|||
@code {
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IOptions<SettingConfig> setting;
|
||||
@inject IOptions<SettingConfig> setting
|
||||
@inject IOptions<DrawerConfig> drawerSetting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
|
||||
int removeQuantity;
|
||||
bool CompleteIsEnable = true;
|
||||
bool CancleIsEnable = true;
|
||||
|
||||
int removeQuantity = 0;
|
||||
int status;
|
||||
|
||||
int[] DrawerNos;
|
||||
int SelectedDrawerNo = 0;
|
||||
string[] AllDrawerNos;
|
||||
string[] DrawerNos;
|
||||
string SelectedDrawerNo = "1-1";
|
||||
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
//药盒颜色集合
|
||||
List<BoxModel> BoxColorList = new List<BoxModel>()
|
||||
{
|
||||
new BoxModel{BoxNo=1,BoxName=1 },
|
||||
new BoxModel{BoxNo=2 ,BoxName=1},
|
||||
new BoxModel{BoxNo=3 ,BoxName=1},
|
||||
new BoxModel{BoxNo=4 ,BoxName=1}
|
||||
};
|
||||
BoxModel BoxColor = new BoxModel { BoxNo = 1, BoxName = 1 };
|
||||
BoxModel BoxNum;
|
||||
[Parameter] public ChannelStock channelStock { get; set; }
|
||||
private bool CanTakeDrug = true;
|
||||
|
||||
// public List<BoxTakeVo> data { get; set; }
|
||||
|
||||
|
||||
|
||||
//称重取药数量
|
||||
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
|
@ -71,28 +133,98 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
DrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
|
||||
if (DrawerNos != null && DrawerNos.Count() > 0)
|
||||
AllDrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
|
||||
if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0)
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
// var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, 8, 0);
|
||||
// selectedDrawerData = result.Desserts;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawerNos = new string[] { "无库位" };
|
||||
}
|
||||
base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
void RestData()
|
||||
// void RestData()
|
||||
// {
|
||||
// PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
// this.status = 0;
|
||||
// data.ForEach(it =>
|
||||
// {
|
||||
// it.Status = 0;
|
||||
// it.BeforeQuantity = new int[9];
|
||||
// it.AfterQuantity = new int[9];
|
||||
// });
|
||||
// this.WeightFinnalQuantity = new int[9];
|
||||
// DrawerNoColNoList.Clear();
|
||||
// }
|
||||
|
||||
private async Task OnColorChanged(object value)
|
||||
{
|
||||
// PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
// this.status = 0;
|
||||
// data.ForEach(it =>
|
||||
// {
|
||||
// it.Status = 0;
|
||||
// it.BeforeQuantity = new int[9];
|
||||
// it.AfterQuantity = new int[9];
|
||||
// });
|
||||
// this.WeightFinnalQuantity = new int[9];
|
||||
// DrawerNoColNoList.Clear();
|
||||
BoxColor = (BoxModel)value;
|
||||
if (AllDrawerNos != null && AllDrawerNos.Length > 0 && AllDrawerNos[0] != "无库位")
|
||||
{
|
||||
if ((((BoxModel)value).BoxNo) == 3)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('白')) && !(d.EndsWith('绿')) && !(d.Contains('-'))).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((((BoxModel)value).BoxNo) == 1)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if ((((BoxModel)value).BoxNo) == 2)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('绿')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if ((((BoxModel)value).BoxNo) == 4)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('绿')) && !(d.EndsWith('白')) && d.Contains('-')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void Cancel()
|
||||
{
|
||||
|
|
@ -102,21 +234,22 @@
|
|||
}
|
||||
async Task Save()
|
||||
{
|
||||
if (removeQuantity<=0)
|
||||
if (removeQuantity <= 0)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入移入数量", Duration = 4000 });
|
||||
return;
|
||||
}
|
||||
if (SelectedDrawerNo<=0)
|
||||
if (string.IsNullOrEmpty(SelectedDrawerNo) || SelectedDrawerNo == "无库位")
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药箱", Duration = 4000 });
|
||||
return;
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药盒", Duration = 4000 });
|
||||
return;
|
||||
}
|
||||
var b = await channelListDao.BoxRemoveFinish(channelStock, SelectedDrawerNo,removeQuantity);
|
||||
SelectedDrawerNo = SelectedDrawerNo == "急诊药盒" ? "99-1" : SelectedDrawerNo == "恢复室药盒" ? "111-1" : SelectedDrawerNo;
|
||||
var b = await channelListDao.BoxRemoveFinish(channelStock, SelectedDrawerNo, removeQuantity);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"药箱移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
|
||||
logger.Error($"药盒移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -128,4 +261,141 @@
|
|||
//重置状态
|
||||
this.RestData();
|
||||
}
|
||||
|
||||
int drawerNo = 1;
|
||||
int colNo = 1;
|
||||
int[] BeforeQuantity = new int[9];
|
||||
int[] AfterQuantity = new int[9];
|
||||
async Task OpenDrawer()
|
||||
{
|
||||
this.status = 1;
|
||||
var selectSpl = SelectedDrawerNo.Split('-');
|
||||
|
||||
if (selectSpl != null && selectSpl.Count() > 0)
|
||||
{
|
||||
drawerNo = Convert.ToInt32(selectSpl[0]);
|
||||
colNo = Convert.ToInt32(selectSpl[1]);
|
||||
}
|
||||
PortUtil.DrawerNo = drawerNo;
|
||||
// 根据抽屉类型来决定打开前是否需要查询数量
|
||||
var promiseUtil = new PromiseUtil<object>();
|
||||
await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.status == 0)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
// 开启抽屉
|
||||
else if (this.status == 1)
|
||||
{
|
||||
// 判断是否为单支抽屉
|
||||
if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
}
|
||||
var b = await PortUtil.OpenDrawerStatus(this.drawerNo);
|
||||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
|
||||
this.status = 2;
|
||||
PortUtil.Operate = true;
|
||||
next();
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
RestData();
|
||||
PortUtil.Operate = false;
|
||||
stop();
|
||||
}
|
||||
|
||||
}
|
||||
// 检测状态
|
||||
else if (this.status == 2)
|
||||
{
|
||||
// 查询抽屉是否为关闭状态
|
||||
var b = await PortUtil.CheckDrawerStatus2(drawerNo);
|
||||
// 关闭则改变状态并终止循环
|
||||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"加药完成,请,点击完成按钮");
|
||||
this.status = 3;
|
||||
PortUtil.Operate = false;
|
||||
if (drawerSetting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
|
||||
AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,抽屉未关检测数量【{string.Join(",", AfterQuantity)}】");
|
||||
|
||||
removeQuantity = this.AfterQuantity[colNo - 1] - this.BeforeQuantity[colNo - 1];
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
next(); // continue iteration
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Info($"抽屉加药发生错误,{e.Message}");
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
|
||||
);
|
||||
if (drawerSetting.Value.single != null && drawerSetting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void RestData()
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
this.status = 0;
|
||||
// this.BeforeQuantity = new int[9];
|
||||
// this.AfterQuantity = new int[9];
|
||||
// currentCol = 0;
|
||||
// ColNos.Clear();
|
||||
}
|
||||
async Task AddFinish()
|
||||
{
|
||||
if (removeQuantity <= 0)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "请输入移入数量", Duration = 4000 });
|
||||
return;
|
||||
}
|
||||
// 保存账册、操作记录
|
||||
var b = await channelListDao.RemoveDrugToDrawerFinish(SelectedDrawerNo, channelStock, removeQuantity);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"抽屉加药保存数据库失败,数据{JsonConvert.SerializeObject(channelStock)}");
|
||||
}
|
||||
//重置状态
|
||||
this.RestData();
|
||||
// 关闭弹窗
|
||||
dialogService.Close(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
|
||||
<RadzenStack>
|
||||
<RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border)" Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
|
||||
@*<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">药名:</RadzenText>
|
||||
<RadzenText Class="rz-text-truncate"><b>@(channelStock.Drug.DrugName)</b></RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">规格:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Drug.DrugSpec)</b></RadzenText>
|
||||
|
|
@ -19,38 +19,77 @@
|
|||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">交换药箱:</RadzenText>
|
||||
<RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
|
||||
|
||||
</RadzenDropDown>
|
||||
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">交换药盒:</RadzenText> *@
|
||||
<div style="text-align: left;width:15vw">
|
||||
<div class="rz-text-h6 rz-mb-0">药品名称</div>
|
||||
@(channelStock.Drug.DrugName)
|
||||
</div>
|
||||
<div style="text-align: left;width:6vw">
|
||||
<div class="rz-text-h6 rz-mb-0">规格</div>
|
||||
@(channelStock.Drug.DrugSpec)
|
||||
</div>
|
||||
<div style="text-align: left;width:8vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">批次</div>
|
||||
@(channelStock.ManuNo)
|
||||
</div>
|
||||
<div style="text-align: left;width:8vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">效期</div>
|
||||
@(channelStock.EffDate)
|
||||
</div>
|
||||
<div style="text-align: left;width:4vw;">
|
||||
<div class="rz-text-h6 rz-mb-0">库存</div>
|
||||
@(channelStock.Quantity)
|
||||
</div>
|
||||
<div class="rz-text-h6 rz-mb-0;width:10vw">
|
||||
交换药盒
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 8vw;"
|
||||
ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
@((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 2 ? "绿" : "非常规")
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="width:10vw" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
|
||||
|
||||
</RadzenDropDown>
|
||||
</div>
|
||||
</RadzenStack>
|
||||
<RadzenDataGrid @ref="grid" Data="@selectedDrawerData" AllowAlternatingRows="true" LoadData="@LoadData" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="DrawerNo" Title="药箱号">
|
||||
<RadzenDataGridColumn Property="DrawerNo" Title="药盒号">
|
||||
<Template Context="DrawerNo">
|
||||
@(DrawerNo.DrawerNo == 99 ? "急诊药盒" : DrawerNo.DrawerNo == 111 ? "恢复室药盒" :
|
||||
DrawerNo.DrawerNo == 31 ? "胃镜药盒" :
|
||||
DrawerNo.DrawerNo == 32 ? "导管药盒" :
|
||||
DrawerNo.DrawerNo == 33 ? "生殖药盒" :
|
||||
DrawerNo.DrawerNo == 34 ? "妇门药盒" : $"{DrawerNo.DrawerNo}-{(DrawerNo.ColNo == 1 ? '白' : '绿')}")
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="ChannelStock.ManuNo" Title="批次" />
|
||||
<RadzenDataGridColumn Property="ChannelStock.EffDate" Title="效期" />
|
||||
<RadzenDataGridColumn Property="Quantity" Title="库存" />
|
||||
<RadzenDataGridColumn MinWidth="100px" Title="交换数量" Property="AddQuantity">
|
||||
<RadzenDataGridColumn MinWidth="100px" Title="交换数量" Property="AddQuantity">
|
||||
<EditTemplate Context="cs">
|
||||
<RadzenNumeric Min="0" Style="display: block" Max=@cs.Quantity Name="Quantity" @bind-Value=@cs.AddQuantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的交换数量" Component="Quantity" Popup="true" />
|
||||
<RadzenNumeric Min="0" Style="display: block" Max=@cs.Quantity Name="Quantity" @bind-Value=@cs.AddQuantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的交换数量" Component="Quantity" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
|
||||
<RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="保存" Style="width: 120px" />
|
||||
<RadzenButton Click="@Save" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
|
||||
|
|
@ -58,25 +97,27 @@
|
|||
</RadzenStack>
|
||||
|
||||
@code {
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IOptions<SettingConfig> setting;
|
||||
@inject IOptions<DrawerConfig> drawerSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
|
||||
bool CompleteIsEnable = true;
|
||||
bool CancleIsEnable = true;
|
||||
|
||||
int status;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos;
|
||||
int SelectedDrawerNo=0;
|
||||
|
||||
[Parameter] public ChannelStock channelStock { get; set; }
|
||||
private bool CanTakeDrug = true;
|
||||
|
||||
// public List<BoxTakeVo> data { get; set; }
|
||||
|
||||
public List<ChannelStock> selectedDrawerData{ get; set; }
|
||||
public List<ChannelStock> selectedDrawerData { get; set; }
|
||||
|
||||
//称重取药数量
|
||||
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
|
@ -84,36 +125,141 @@
|
|||
//开抽屉前操作标识
|
||||
List<string> DrawerNoColNoList = new List<string>();
|
||||
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
BoxModel BoxColor = new BoxModel { BoxNo = 1, BoxName = 1 };
|
||||
string[] AllDrawerNos;
|
||||
string[] DrawerNos;
|
||||
string SelectedDrawerNo = "1-1";
|
||||
//药盒颜色集合
|
||||
List<BoxModel> BoxColorList = new List<BoxModel>()
|
||||
{
|
||||
new BoxModel{BoxNo=1,BoxName=1 },
|
||||
new BoxModel{BoxNo=2 ,BoxName=1},
|
||||
new BoxModel{BoxNo=3 ,BoxName=1}
|
||||
};
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
DrawerNos = await channelListDao.GetDrawerNum(channelStock);
|
||||
// AllDrawerNos = await channelListDao.GetDrawerNum(channelStock);
|
||||
// if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
|
||||
// {
|
||||
// if (DrawerNos == null || DrawerNos.Length <= 0)
|
||||
// {
|
||||
// DrawerNos = new string[] { "无库位" };
|
||||
// }
|
||||
// }
|
||||
AllDrawerNos = await channelListDao.GetDrawerNumForRemove(channelStock);
|
||||
if (AllDrawerNos != null && AllDrawerNos.Count() > 0)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0)
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawerNos = new string[] { "无库位" };
|
||||
}
|
||||
base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
if (DrawerNos != null && DrawerNos.Count() > 0)
|
||||
if (DrawerNos != null && !DrawerNos.Contains("无库位") && DrawerNos.Count() > 0)
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
var result = await channelListDao.GetChannelStockByDrug(channelStock, SelectedDrawerNo, args.Top, args.Skip);
|
||||
selectedDrawerData = result.Desserts;
|
||||
count = result.TotalDesserts;
|
||||
if (selectedDrawerData != null && selectedDrawerData.Count > 0)
|
||||
{
|
||||
if (selectedDrawerData[0].DrawerNo <= 30)
|
||||
{
|
||||
if (selectedDrawerData[0].ColNo == 1)
|
||||
{
|
||||
BoxColor = BoxColorList[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
BoxColor = BoxColorList[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BoxColor = BoxColorList[2];
|
||||
}
|
||||
}
|
||||
count = result.TotalDesserts;
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
void RestData()
|
||||
|
||||
private async Task OnColorChanged(object value)
|
||||
{
|
||||
// PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
// this.status = 0;
|
||||
// data.ForEach(it =>
|
||||
// {
|
||||
// it.Status = 0;
|
||||
// it.BeforeQuantity = new int[9];
|
||||
// it.AfterQuantity = new int[9];
|
||||
// });
|
||||
// this.WeightFinnalQuantity = new int[9];
|
||||
// DrawerNoColNoList.Clear();
|
||||
BoxColor = (BoxModel)value;
|
||||
if (AllDrawerNos != null && AllDrawerNos.Length > 0 && AllDrawerNos[0] != "无库位")
|
||||
{
|
||||
if (BoxColor.BoxNo == 3)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('白')) && !(d.EndsWith('绿')) && !(d.Contains('-'))).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
await SelectedDrawerChange(SelectedDrawerNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BoxColor.BoxNo == 1)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('白')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
await SelectedDrawerChange(SelectedDrawerNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if (BoxColor.BoxNo == 2)
|
||||
{
|
||||
DrawerNos = AllDrawerNos.Where(d => d.EndsWith('绿')).ToArray();
|
||||
if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
{
|
||||
SelectedDrawerNo = DrawerNos[0];
|
||||
await SelectedDrawerChange(SelectedDrawerNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedDrawerNo = "无库位";
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
// else if (BoxColor.BoxNo == 4)
|
||||
// {
|
||||
// DrawerNos = AllDrawerNos.Where(d => !(d.EndsWith('绿')) && !(d.EndsWith('白')) && d.Contains('-')).ToArray();
|
||||
// if (DrawerNos != null && DrawerNos.Length > 0 && DrawerNos[0] != "无库位")
|
||||
// {
|
||||
// SelectedDrawerNo = DrawerNos[0];
|
||||
// await SelectedDrawerChange(SelectedDrawerNo);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SelectedDrawerNo = "无库位";
|
||||
// }
|
||||
// await InvokeAsync(StateHasChanged);
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void Cancel()
|
||||
{
|
||||
|
|
@ -123,18 +269,18 @@
|
|||
}
|
||||
async Task Save()
|
||||
{
|
||||
if (selectedDrawerData!=null&&selectedDrawerData.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.ManuNo != null))
|
||||
if (selectedDrawerData != null && selectedDrawerData.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.ManuNo != null))
|
||||
{
|
||||
if (selectedDrawerData.Where(cs => cs.AddQuantity != 0).Sum(cs => cs.Quantity) > channelStock.Quantity)
|
||||
if (selectedDrawerData.Where(cs => cs.AddQuantity != 0).Sum(cs => cs.AddQuantity) > channelStock.Quantity)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Summary = "提示", Detail = $"交换总数量不能大于库存", Duration = 4000 });
|
||||
return;
|
||||
}
|
||||
var b = await channelListDao.BoxReplaceFinish(channelStock,selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList());
|
||||
var b = await channelListDao.BoxReplaceFinish(channelStock, selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList());
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
logger.Error($"药箱药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
|
||||
logger.Error($"药盒药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -155,7 +301,13 @@
|
|||
|
||||
async Task SelectedDrawerChange(object drawerNo)
|
||||
{
|
||||
var result = await channelListDao.GetChannelStockByDrug(channelStock, Convert.ToInt32(drawerNo), 8, 0);
|
||||
if (drawerNo == "无库位")
|
||||
{
|
||||
return;
|
||||
}
|
||||
drawerNo = drawerNo == "急诊药盒" ? "99-1" : drawerNo == "恢复室药盒" ? "111-1" : drawerNo == "胃镜药盒" ? "31-1" : drawerNo == "导管药盒" ? "32-1" : drawerNo == "生殖药盒" ? "33-1" : drawerNo == "妇门药盒" ? "34-1" : drawerNo;
|
||||
|
||||
var result = await channelListDao.GetChannelStockByDrug(channelStock, drawerNo.ToString(), 8, 0);
|
||||
selectedDrawerData = result.Desserts;
|
||||
}
|
||||
int currentCol = 0;
|
||||
|
|
@ -166,4 +318,14 @@
|
|||
currentCol = args.Data.ColNo;
|
||||
grid.EditRow(args.Data);
|
||||
}
|
||||
|
||||
void RestData()
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
this.status = 0;
|
||||
// this.BeforeQuantity = new int[9];
|
||||
// this.AfterQuantity = new int[9];
|
||||
// currentCol = 0;
|
||||
// ColNos.Clear();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,132 +2,114 @@
|
|||
@using MasaBlazorApp3.Pojo.Config
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
|
||||
<div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
|
||||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
<div class="col-2 row justify-content-center align-items-center text-center">
|
||||
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
|
||||
@foreach (var cs in channelStockList)
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9 mb-4">
|
||||
@* <RadzenFieldset Text="">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="替换药品" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="移出药品" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset> *@
|
||||
|
||||
@* <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
|
||||
<HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
|
||||
Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@(selectedOrderInfos != null && selectedOrderInfos.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
|
||||
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
|
||||
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
|
||||
<RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem" />
|
||||
<RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem" />
|
||||
<RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem" />
|
||||
</Columns>
|
||||
</RadzenDataGrid> *@
|
||||
|
||||
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading"
|
||||
Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
|
||||
ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<div class="col-10">
|
||||
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" style="height:600px;overflow:auto"
|
||||
Data="@_forecasts" PageSize="6" AllowPaging="false">
|
||||
<Template Context="pd">
|
||||
<RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%; overflow: hidden;">
|
||||
<RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
|
||||
<RadzenColumn Size="10">
|
||||
<div style="text-align: left;">
|
||||
<div class="rz-text-h6 rz-mb-0">品名/规格/厂家</div>
|
||||
@(pd._DrugInfo.DrugNameSpec)
|
||||
</div>
|
||||
@* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.ToString())</RadzenText> *@
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="3" class="rz-p-4 product-title">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
|
||||
@* <RadzenColumn Size="5">
|
||||
厂家<br />
|
||||
@(pd._DrugInfo.Manufactory)
|
||||
</RadzenColumn> *@
|
||||
@*<RadzenColumn Size="3">
|
||||
规格<br />
|
||||
@(pd._DrugInfo.DrugSpec)
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
|
||||
</RadzenColumn> *@
|
||||
<RadzenColumn Size="1">
|
||||
<div class="rz-text-h6 rz-mb-0">基数</div>
|
||||
@(pd.BaseQuantity)
|
||||
@* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText> *@
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
|
||||
<RadzenColumn Size="1">
|
||||
<div class="rz-text-h6 rz-mb-0">库存</div>
|
||||
@(pd.channelStocks.Sum(cs => cs.Quantity))
|
||||
@* <RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.channelStocks.Sum(cs => cs.Quantity))</RadzenText> *@
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="1" class="rz-p-4 product-title">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
|
||||
</RadzenColumn>
|
||||
@* <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
|
||||
</RadzenRow>
|
||||
@* <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="移出药品" Style="width: 100%" Click="@(()=>removeClick(pd))" />
|
||||
</RadzenColumn> *@
|
||||
@if (pd.channelStocks != null && pd.channelStocks.Count > 0)
|
||||
@if (pd.channelStocks != null && pd.channelStocks.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < pd.channelStocks.Count; i++)
|
||||
{
|
||||
for (int i = 0; i < pd.channelStocks.Count; i++)
|
||||
var manuInfo = pd.channelStocks[i];
|
||||
var manuNo = 1;
|
||||
if (i == 0)
|
||||
{
|
||||
var manuInfo = pd.channelStocks[i];
|
||||
var manuNo = 1;
|
||||
if (i == 0)
|
||||
{
|
||||
manuNo = 0;
|
||||
}
|
||||
<RadzenColumn Size="12" SizeLG="7" class="rz-p-4">
|
||||
manuNo = 0;
|
||||
}
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="12">
|
||||
@if (manuInfo != null && manuInfo.ManuNo != null)
|
||||
{
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
|
||||
<RadzenColumn Size="3">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">批次</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
|
||||
<RadzenColumn Size="3">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">效期</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
|
||||
<RadzenColumn Size="1">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">库存</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(manuInfo))" />
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenText style="margin-top:5px;"></RadzenText>
|
||||
<RadzenButton Text="替换药品" Style="margin:1px" Click="@(() => replaceClick(manuInfo))" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="移出药品" Style="width: 100%" Click="@(() => removeClick(manuInfo))" />
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenText style="margin-top:5px;"></RadzenText>
|
||||
<RadzenButton Text="移出药品" Click="@(() => removeClick(manuInfo))" />
|
||||
</RadzenColumn>
|
||||
|
||||
</RadzenRow>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
|
||||
<RadzenColumn Size="5">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">未绑定批次</RadzenText>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
}
|
||||
</RadzenColumn>
|
||||
}
|
||||
</RadzenRow>
|
||||
}
|
||||
</RadzenRow>
|
||||
}
|
||||
</RadzenCard>
|
||||
</Template>
|
||||
</RadzenDataList>
|
||||
|
|
@ -150,13 +132,14 @@
|
|||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
List<ChannelStock> channelStockList = new();
|
||||
int status = 0;
|
||||
int drawerNo = 1;
|
||||
string drawerNo = "1-1";
|
||||
string OrderNo;
|
||||
DateTime OrderDate;
|
||||
void SelectDrawer(int drawerNo)
|
||||
void SelectDrawer(string strDrawerNoColNo)
|
||||
{
|
||||
this.drawerNo = drawerNo;
|
||||
this.drawerNo = strDrawerNoColNo;
|
||||
grid.Reload();
|
||||
}
|
||||
// void OnCurrentDateChanged(DateTime args)
|
||||
|
|
@ -188,15 +171,17 @@
|
|||
|
||||
isLoading = false;
|
||||
|
||||
DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
}
|
||||
//替换按钮
|
||||
async Task replaceClick(ChannelStock cs)
|
||||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
|
||||
string message = cs.DrawerNo + "-" + (cs.ColNo == 1 ? "白" : "绿") + " 药盒替换药品详情";
|
||||
var b = await dialogService.OpenAsync<BoxReplace>(
|
||||
$"{cs.DrawerNo}号药箱替换药品详情",
|
||||
message,
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
|
|
@ -218,8 +203,9 @@
|
|||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
string message = cs.DrawerNo + "-" + (cs.ColNo == 1 ? "白" : "绿") + " 药盒移动药品详情";
|
||||
var b = await dialogService.OpenAsync<BoxRemoveDialog>(
|
||||
$"{cs.DrawerNo}号药箱替换药品详情",
|
||||
message,
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,234 @@
|
|||
@page "/Box/BoxStockAAA"
|
||||
@using MasaBlazorApp3.Pojo.Config
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
|
||||
<div class="col-2 row justify-content-center align-items-center text-center">
|
||||
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
|
||||
@foreach (var cs in channelStockList)
|
||||
{
|
||||
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<RadzenDataGrid @ref="grid"
|
||||
IsLoading="@isLoading"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
ExpandMode="DataGridExpandMode.Single">
|
||||
<Template Context="di">
|
||||
<RadzenDataGrid Data="@di.Stocks" EmptyText="无数据">
|
||||
<Columns>
|
||||
@* <RadzenDataGridColumn Title="库位" Property="DrawerNo">
|
||||
<Template Context="s">
|
||||
@s.DrawerNo - @s.ColNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn> *@
|
||||
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate">
|
||||
<Template Context="s">
|
||||
@{
|
||||
DateTime dateTime;
|
||||
bool success = DateTime.TryParse(s.EffDate, out dateTime);
|
||||
@s.EffDate
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="数量" Property="Quantity">
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药品名称" Property="DrugName"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="规格" Property="DrugSpec"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="基数" Property="BoxBaseQuantity">
|
||||
<Template Context="s">
|
||||
@s.BoxBaseQuantity
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="总库存" Property="BoxBaseQuantity">
|
||||
<Template Context="s">
|
||||
@s.StockQuantity
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</RadzenStack>
|
||||
@code {
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject NotificationService _message
|
||||
|
||||
@inject IDrugInfoDao drugInfoDao;
|
||||
|
||||
private IEnumerable<DrugInfo>? _forecasts;
|
||||
bool allowRowSelectOnRowClick = true;
|
||||
// IEnumerable<DrugManuNo> drugManuNos;
|
||||
// IList<DrugManuNo> selectedDrugManuNos;
|
||||
|
||||
RadzenDataGrid<DrugInfo> grid;
|
||||
// RadzenDataGrid<DrugManuNo> gridManuNo;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
List<ChannelStock> channelStockList = new();
|
||||
int status = 0;
|
||||
string drawerNo = "1-1";
|
||||
string OrderNo;
|
||||
DateTime OrderDate;
|
||||
async Task SelectDrawer(string strDrawerNoColNo)
|
||||
{
|
||||
this.drawerNo = strDrawerNoColNo;
|
||||
|
||||
BoxModel boxModel = new BoxModel();
|
||||
boxModel.BoxName = 1;
|
||||
boxModel.BoxNo = 1;
|
||||
// grid.Reload();
|
||||
if (drawerNo != null)
|
||||
{
|
||||
string[] strArr = drawerNo.Split('-');
|
||||
boxModel.BoxName = Convert.ToInt32(strArr[0]);
|
||||
boxModel.BoxNo = Convert.ToInt32(strArr[1]);
|
||||
}
|
||||
var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);
|
||||
_forecasts = result;
|
||||
}
|
||||
// void OnCurrentDateChanged(DateTime args)
|
||||
// {
|
||||
// OrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
// }
|
||||
//重置
|
||||
async Task reloadGrid()
|
||||
{
|
||||
OrderNo = "";
|
||||
OrderDate = DateTime.MinValue;
|
||||
await grid.Reload();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
isLoading = true;
|
||||
BoxModel boxModel = new BoxModel();
|
||||
|
||||
boxModel.BoxName = 1;
|
||||
boxModel.BoxNo = 1;
|
||||
isLoading = true;
|
||||
if (drawerNo != null)
|
||||
{
|
||||
string[] strArr = drawerNo.Split('-');
|
||||
boxModel.BoxName = Convert.ToInt32(strArr[0]);
|
||||
boxModel.BoxNo = Convert.ToInt32(strArr[1]);
|
||||
}
|
||||
var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);// await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
|
||||
// Update the Data property
|
||||
_forecasts = result;
|
||||
// Update the count
|
||||
//count = result.TotalDesserts;
|
||||
|
||||
isLoading = false;
|
||||
|
||||
channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
base.OnAfterRender(firstRender);
|
||||
|
||||
if (firstRender)
|
||||
{
|
||||
await grid.ExpandRows(grid.PagedView.Where(di => di.Stocks.Count > 0));
|
||||
}
|
||||
}
|
||||
|
||||
void RowRender(RowRenderEventArgs<DrugInfo> args)
|
||||
{
|
||||
args.Expandable = args.Data.Stocks.Count > 0;
|
||||
}
|
||||
//确认
|
||||
async Task Confirm()
|
||||
{
|
||||
// orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
|
||||
}
|
||||
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
BoxModel boxModel = new BoxModel();
|
||||
|
||||
boxModel.BoxName = 1;
|
||||
boxModel.BoxNo = 1;
|
||||
isLoading = true;
|
||||
if (drawerNo != null)
|
||||
{
|
||||
string[] strArr = drawerNo.Split(',');
|
||||
boxModel.BoxName = Convert.ToInt32(strArr[0]);
|
||||
boxModel.BoxNo = Convert.ToInt32(strArr[1]);
|
||||
}
|
||||
var result = await drugInfoDao.GetAllDrugAndStockByBox(boxModel);// await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
|
||||
// Update the Data property
|
||||
_forecasts = result;
|
||||
// Update the count
|
||||
//count = result.TotalDesserts;
|
||||
|
||||
isLoading = false;
|
||||
|
||||
channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
}
|
||||
//替换按钮
|
||||
async Task replaceClick(ChannelStock cs)
|
||||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxReplace>(
|
||||
$"{cs.DrawerNo}号药盒替换药品详情",
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if (b)
|
||||
{
|
||||
await reloadGrid();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//库存为0无法操作
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
//移除按钮
|
||||
async Task removeClick(ChannelStock cs)
|
||||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxRemoveDialog>(
|
||||
$"{cs.DrawerNo}号药盒替换药品详情",
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if (b)
|
||||
{
|
||||
await reloadGrid();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//库存为0无法操作
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,212 @@
|
|||
@page "/Box/BoxStockAA"
|
||||
@using MasaBlazorApp3.Pojo.Config
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
|
||||
<div class="col-2 row justify-content-center align-items-center text-center">
|
||||
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
|
||||
@foreach (var cs in channelStockList)
|
||||
{
|
||||
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer((cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString())))" Text="@(cs.DrawerNo==99?"急诊室药盒":cs.DrawerNo==111?"恢复室药盒":cs.DrawerNo==31?"胃镜药盒":cs.DrawerNo==32?"导管药盒":cs.DrawerNo==33?"生殖药盒":cs.DrawerNo==34?"妇门药盒":$"{cs.DrawerNo.ToString() + "-" + (cs.ColNo==1?'白':'绿')}")" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != (cs.DrawerNo.ToString() + "-" + cs.ColNo.ToString()) ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" style="height:600px;overflow:auto"
|
||||
Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
|
||||
ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Template Context="pd">
|
||||
<RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="5">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="3">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="1">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="1">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.channelStocks.Sum(cs => cs.Quantity))</RadzenText>
|
||||
</RadzenColumn>
|
||||
|
||||
</RadzenRow>
|
||||
@* <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
|
||||
<RadzenButton Text="移出药品" Style="width: 100%" Click="@(()=>removeClick(pd))" />
|
||||
</RadzenColumn> *@
|
||||
@if (pd.channelStocks != null && pd.channelStocks.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < pd.channelStocks.Count; i++)
|
||||
{
|
||||
var manuInfo = pd.channelStocks[i];
|
||||
var manuNo = 1;
|
||||
if (i == 0)
|
||||
{
|
||||
manuNo = 0;
|
||||
}
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="12">
|
||||
@if (manuInfo != null && manuInfo.ManuNo != null)
|
||||
{
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="3">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">批次</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="3">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">效期</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="1">
|
||||
@if (manuNo == 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">库存</RadzenText>
|
||||
}
|
||||
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenText style="margin-top:5px;"></RadzenText>
|
||||
<RadzenButton Text="替换药品" Style="margin:1px" Click="@(() => replaceClick(manuInfo))" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenText style="margin-top:5px;"></RadzenText>
|
||||
<RadzenButton Text="移出药品" Click="@(() => removeClick(manuInfo))" />
|
||||
</RadzenColumn>
|
||||
|
||||
</RadzenRow>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenRow Gap="0">
|
||||
<RadzenColumn Size="5">
|
||||
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">未绑定批次</RadzenText>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
}
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
}
|
||||
}
|
||||
</RadzenCard>
|
||||
</Template>
|
||||
</RadzenDataList>
|
||||
|
||||
</div>
|
||||
</RadzenStack>
|
||||
@code {
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject NotificationService _message
|
||||
|
||||
private IEnumerable<PlanDetails>? _forecasts;
|
||||
bool allowRowSelectOnRowClick = true;
|
||||
// IEnumerable<DrugManuNo> drugManuNos;
|
||||
// IList<DrugManuNo> selectedDrugManuNos;
|
||||
RadzenDataList<PlanDetails> grid;
|
||||
// RadzenDataGrid<DrugManuNo> gridManuNo;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
List<ChannelStock> channelStockList = new();
|
||||
int status = 0;
|
||||
string drawerNo = "1-1";
|
||||
string OrderNo;
|
||||
DateTime OrderDate;
|
||||
void SelectDrawer(string strDrawerNoColNo)
|
||||
{
|
||||
this.drawerNo = strDrawerNoColNo;
|
||||
grid.Reload();
|
||||
}
|
||||
// void OnCurrentDateChanged(DateTime args)
|
||||
// {
|
||||
// OrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
// }
|
||||
//重置
|
||||
async Task reloadGrid()
|
||||
{
|
||||
OrderNo = "";
|
||||
OrderDate = DateTime.MinValue;
|
||||
await grid.Reload();
|
||||
}
|
||||
//确认
|
||||
async Task Confirm()
|
||||
{
|
||||
// orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
|
||||
}
|
||||
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
var result = await channelListDao.GetBoxDrugInfo(drawerNo, args.Top, args.Skip);
|
||||
// Update the Data property
|
||||
_forecasts = result.Desserts;
|
||||
// Update the count
|
||||
count = result.TotalDesserts;
|
||||
|
||||
isLoading = false;
|
||||
|
||||
channelStockList = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
}
|
||||
//替换按钮
|
||||
async Task replaceClick(ChannelStock cs)
|
||||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxReplace>(
|
||||
$"{cs.DrawerNo}号药盒替换药品详情",
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if (b)
|
||||
{
|
||||
await reloadGrid();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//库存为0无法操作
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0无法替换", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
//移除按钮
|
||||
async Task removeClick(ChannelStock cs)
|
||||
{
|
||||
if (cs.Quantity > 0)
|
||||
{
|
||||
var b = await dialogService.OpenAsync<BoxRemoveDialog>(
|
||||
$"{cs.DrawerNo}号药盒替换药品详情",
|
||||
new Dictionary<string, object>() { { "channelStock", cs } },
|
||||
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if (b)
|
||||
{
|
||||
await reloadGrid();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//库存为0无法操作
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"库存为0,没有要移出的药品", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
<RadzenColumn Size="12" SizeMD="7">
|
||||
<RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
|
||||
<RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
|
||||
登录
|
||||
交接班登录验证
|
||||
</RadzenText>
|
||||
<RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
|
||||
<div class="rz-form-row">
|
||||
|
|
@ -66,10 +66,19 @@
|
|||
<RadzenRequiredValidator Component="Password" Text="请填写密码" />
|
||||
</div>
|
||||
</div>
|
||||
@if (userI > 2)
|
||||
{
|
||||
<div class="rz-form-row">
|
||||
<label class="rz-label" for="remark">备注</label>
|
||||
<div class="rz-form-input-wrapper">
|
||||
<RadzenTextBox id="remark" @bind-Value="@remarks" Style="width:100%" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="rz-form-row">
|
||||
<label class="rz-label"></label>
|
||||
<div class="rz-form-input-wrapper rz-login-buttons">
|
||||
<RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录" />
|
||||
<RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录验证" />
|
||||
<RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
|
||||
|
||||
</div>
|
||||
|
|
@ -105,7 +114,7 @@
|
|||
Pojo.User ToReviewer = new Pojo.User();
|
||||
|
||||
HkcChangeShifts hkcChange = new HkcChangeShifts();
|
||||
|
||||
string remarks = string.Empty;
|
||||
bool isShow;
|
||||
|
||||
private Pojo.User loginModel = new();
|
||||
|
|
@ -207,7 +216,8 @@
|
|||
optDate = DateTime.Now,
|
||||
ToDate = DateTime.Now,
|
||||
State = "0", //状态为1表示交接班完成
|
||||
MachineId = hkcChange.MachineId
|
||||
MachineId = hkcChange.MachineId,
|
||||
Remarks = remarks
|
||||
};
|
||||
hkcChange.ToOperator = ToOperator.Username;
|
||||
bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
|
||||
|
|
@ -247,7 +257,8 @@
|
|||
FromRviewer = ToReviewer?.Username,
|
||||
optDate = DateTime.Now,
|
||||
State = "0", //状态为1表示交接班完成
|
||||
MachineId = hkcChange.MachineId
|
||||
MachineId = hkcChange.MachineId,
|
||||
Remarks = remarks
|
||||
};
|
||||
bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
|
||||
if (bResult)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<RadzenLabel Text="开始时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<RadzenLabel Text="结束时间" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,78 +1,204 @@
|
|||
@page "/Box/Check"
|
||||
@page "/Box/CheckAAA"
|
||||
@using MasaBlazorApp3.Pojo.Config
|
||||
@using MasaBlazorApp3.Report
|
||||
@using Microsoft.Extensions.Options
|
||||
@using Radzen.Blazor.Rendering
|
||||
@using log4net;
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
|
||||
<div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
|
||||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
<style>
|
||||
.my-popup {
|
||||
display: none;
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
/* height: 360px; */
|
||||
width: 900px;
|
||||
border: var(--rz-panel-border);
|
||||
background-color: var(--rz-panel-background-color);
|
||||
box-shadow: var(--rz-panel-shadow);
|
||||
border-radius: var(--rz-border-radius);
|
||||
}
|
||||
|
||||
.rz-grid-table {
|
||||
position: relative;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
@* <div class="col-4 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
|
||||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;overflow:auto">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
<RadzenButton class="col-5" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9 mb-4">
|
||||
<form onsubmit="@(() => grid.Reload())">
|
||||
</div> *@
|
||||
@* <div class="col-2 row justify-content-center align-items-center text-center">
|
||||
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div> *@
|
||||
<div class="col-12">
|
||||
<form onsubmit="@(() => {firstLod=0;grid.Reload();})">
|
||||
<RadzenFieldset Text="查询">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="处方号" Component="OrderNo" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="处方时间" Component="OrderDate" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
@* <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem"> *@
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="麻醉医师" Component="NamesList" Style="width: 20%;" />
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="NamesList" TValue="Anaesthetist" Data="@NamesList" @bind-Value="NameInfo"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="麻醉医师" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
</RadzenColumn>
|
||||
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="核对药箱" Component="BoxList" />
|
||||
@* <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="Anaesthetist" Data="@BoxColorList" @bind-Value="BoxColor" Style="width: 100%;"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="Name">
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Name" Title="药盒颜色" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid> *@
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum" Style="width: 100%;"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
|
||||
@((context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿"))
|
||||
|
||||
@* @((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo) *@
|
||||
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
|
||||
<RadzenLabel Text="处方号" Component="OrderNo" />
|
||||
<RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
|
||||
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6" Style="margin-top:0.5rem">
|
||||
<RadzenLabel Text="处方时间" Component="OrderDate" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" AllowClear @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
|
||||
<RadzenLabel Text="患者姓名" Component="PatientName" />
|
||||
<RadzenTextBox @bind-Value="PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
|
||||
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6" Style="margin-top:2px">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" />
|
||||
<RadzenButton Style="margin-top:2px" Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
|
||||
<Popup @ref=popup Lazy=true class="my-popup">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
|
||||
<RadzenFieldset Text="条件选择">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="处方时间" Component="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</RadzenStack>
|
||||
</Popup>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
@* </RadzenStack> *@
|
||||
</RadzenFieldset>
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" Style="margin:0.5rem" />
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" Style="margin:0.5rem">
|
||||
@* <RadzenLabel Text="核对药箱" Component="BoxList" Style="margin:0.5rem" />
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
@((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo)
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid> *@
|
||||
@* <RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" />
|
||||
<RadzenButton Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
|
||||
<Popup @ref=popup Lazy=true class="my-popup">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
|
||||
<RadzenFieldset Text="条件选择">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="处方时间" Component="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</RadzenStack>
|
||||
</Popup> *@
|
||||
</RadzenStack>
|
||||
</form>
|
||||
<RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
|
||||
<HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
|
||||
Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@(selectedOrderInfos != null && selectedOrderInfos.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
|
||||
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
|
||||
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
|
||||
<RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem">
|
||||
<Template Context="DetailList">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
<div Style="width:936px;height:50vh;overflow:auto">
|
||||
<RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:955px;overflow:auto" Groupable="true"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@orderInfos" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
|
||||
CellClick="@((DataGridCellMouseEventArgs<OrderInfo> args) => OnCellClick(args))"
|
||||
AllowPaging="false">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="2rem">
|
||||
@* <HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
|
||||
Change="@(args => OnCheckSeleced(args))" />
|
||||
</HeaderTemplate> *@
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="anaesthetistName" Title="麻醉医师" Sortable="false" Filterable="false" Width="50px" />
|
||||
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="50px" />
|
||||
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="30px" />
|
||||
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="70px" />
|
||||
<RadzenDataGridColumn Property="ChargeDate" Title="处方时间" Sortable="false" Filterable="false" Width="80px" />
|
||||
<RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="80px" />
|
||||
@* <Template Context="DetailInfo">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
{
|
||||
OrderDetail orderDetail = DetailList.DetailList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Drug.DrugName</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
|
||||
OrderDetail orderDetail = DetailList.DetailList[i]; *@
|
||||
@* <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>*@
|
||||
@* <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
|
||||
<Template Context="DetailList">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
{
|
||||
|
|
@ -80,71 +206,304 @@
|
|||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem">
|
||||
<Template Context="DetailList">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
</RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="批次" Property="DetailInfo.SetManuNo" Filterable="false" Width="100px">
|
||||
@* <Template Context="DetailInfo">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@DetailInfo.DetailInfo.SetManuNo</RadzenText>
|
||||
|
||||
@if (DetailInfo.DetailInfo.SetManuNo != null )
|
||||
{
|
||||
OrderDetail orderDetail = DetailList.DetailList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Quantity</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@DetailInfo.DetailInfo.SetManuNo
|
||||
</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</Template> *@
|
||||
<EditTemplate Context="DetailInfo">
|
||||
<RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="DetailInfo.DetailInfo.drugManuNo" Data="DetailInfo.DetailInfo.Drug.Manus" Style="width:100%; display: block;">
|
||||
<Template>
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
<ValueTemplate>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</RadzenStack>
|
||||
</ValueTemplate>
|
||||
</RadzenDropDown>
|
||||
<RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Filterable="false" Width="50px">
|
||||
<EditTemplate Context="DetailInfo">
|
||||
<RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@DetailInfo.DetailInfo.Quantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="Quantity" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="DetailInfo.TotalQuantity" Title="合计" Filterable="false" Width="50px" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</RadzenStack>
|
||||
@code {
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
|
||||
@inject NotificationService _message;
|
||||
@inject IReportDataDao reportDataDao;
|
||||
@inject IOptions<SettingConfig> setting;
|
||||
bool allowRowSelectOnRowClick = true;
|
||||
IEnumerable<OrderInfo> orderInfos;
|
||||
IList<OrderInfo> selectedOrderInfos;
|
||||
RadzenDataGrid<OrderInfo> grid;
|
||||
//麻醉师集合
|
||||
List<Anaesthetist> NamesList = new List<Anaesthetist>();
|
||||
Anaesthetist NameInfo;
|
||||
Anaesthetist BoxColor;
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
//药盒颜色集合
|
||||
List<Anaesthetist> BoxColorList = new List<Anaesthetist>();
|
||||
BoxModel BoxNum;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
int status = 0;
|
||||
int drawerNo = 1;
|
||||
string OrderNo;
|
||||
DateTime OrderDate;
|
||||
void SelectDrawer(int drawerNo)
|
||||
string PatientName;
|
||||
DateTime? OrderDate = null;
|
||||
DateTime PortOrderDate = DateTime.Now;
|
||||
Popup popup;
|
||||
RadzenButton button;
|
||||
//第一次加载不执行LoadData方法
|
||||
int firstLod = 1;
|
||||
void OnCheckSeleced(object dete)
|
||||
{
|
||||
this.drawerNo = drawerNo;
|
||||
grid.Reload();
|
||||
if (orderInfos != null)
|
||||
{
|
||||
orderInfos.ToList().ForEach(it => it.ItemIsChecked = true);
|
||||
}
|
||||
}
|
||||
void OnCurrentDateChanged(DateTime args)
|
||||
{
|
||||
OrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
}
|
||||
void OnCurrentPortDateChanged(DateTime args)
|
||||
{
|
||||
PortOrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
}
|
||||
// async Task OnColorChange(object value)
|
||||
// {
|
||||
// Anaesthetist v = value as Anaesthetist;
|
||||
// if (v.Id != BoxColor.Id)
|
||||
// {
|
||||
// BoxList = await orderInfoDao.GetOperationNum(BoxColor.Id);// await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
|
||||
|
||||
// BoxNum = BoxList.FirstOrDefault();
|
||||
// }
|
||||
// }
|
||||
//重置
|
||||
async Task reloadGrid()
|
||||
{
|
||||
OrderNo = "";
|
||||
OrderDate = DateTime.MinValue;
|
||||
firstLod = 1;
|
||||
await grid.Reload();
|
||||
}
|
||||
void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
|
||||
{
|
||||
if (args.Data.DetailInfo.SetManuNo != null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
|
||||
}
|
||||
if (args.Data.DetailInfo.drugManuNo == null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
|
||||
}
|
||||
args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
|
||||
grid.EditRow(args.Data);
|
||||
}
|
||||
//确认
|
||||
async Task Confirm()
|
||||
{
|
||||
orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
|
||||
if (selectedOrderInfos == null)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (BoxNum == null)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择药箱", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null && (string.IsNullOrEmpty(it.DetailInfo.SetManuNo))))
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择批次信息", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
selectedOrderInfos.Where(oi => oi.DetailInfo.drugManuNo != null && !string.IsNullOrEmpty(oi.DetailInfo.drugManuNo.ManuNo)).ToList().ForEach(oi => oi.DetailInfo.SetManuNo = oi.DetailInfo.drugManuNo.ManuNo);
|
||||
selectedOrderInfos.Where(oi => !string.IsNullOrEmpty(oi.DetailInfo.SetManuNo)).ToList().ForEach(oi => oi.DetailInfo.drugManuNo = new() { ManuNo = oi.DetailInfo.SetManuNo });
|
||||
//弹出药品合计信息,确认无误后进行核对,取消则不核对
|
||||
//弹出确认提示框
|
||||
// var b = await dialogService.OpenAsync<CheckOrderConfirmDialog>(
|
||||
// $"核对确认",
|
||||
// new Dictionary<string, object>() { { "selectedOrderInfos", selectedOrderInfos } },
|
||||
// new DialogOptions() { Width = "80vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
// if (b)
|
||||
// {
|
||||
bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum);
|
||||
if (bResult)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
|
||||
);
|
||||
//await GetInitialDate();
|
||||
await grid.Reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
// }
|
||||
}
|
||||
PageData<OrderInfo> result;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
BoxColorList = setting.Value.boxColor.Split(',').Select(it => new Anaesthetist { Name = it,Id=it=="白"?1:2 }).ToList();
|
||||
BoxColor = BoxColorList.FirstOrDefault();
|
||||
NamesList = setting.Value.anaesthetist_name.Split(',').Select(it => new Anaesthetist { Name = it }).ToList();
|
||||
NameInfo = NamesList.FirstOrDefault();
|
||||
BoxList = await orderInfoDao.GetOperationNum(0);// await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
|
||||
|
||||
BoxNum = BoxList.FirstOrDefault();
|
||||
|
||||
//await GetInitialDate();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
isLoading = true;
|
||||
if (firstLod == 1)
|
||||
{
|
||||
|
||||
var result = await orderInfoDao.GetAllOrderInfoByBox(drawerNo, OrderNo, OrderDate, args.Top, args.Skip);
|
||||
// Update the Data property
|
||||
return;
|
||||
}
|
||||
// BoxList=BoxList.Where(bl => bl.BoxNo == BoxColor.Id).ToList();
|
||||
// BoxNum = BoxList.FirstOrDefault();
|
||||
string? anaesthetistName = NameInfo.Name == "未选择" ? null : NameInfo.Name;
|
||||
string? roomName = BoxNum == null ? "" : setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
|
||||
result = await orderInfoDao.GetAllOrderInfo(anaesthetistName, roomName, PatientName, OrderNo, OrderDate, args.Top, args.Skip);
|
||||
isLoading = true;
|
||||
orderInfos = result.Desserts;
|
||||
// Update the count
|
||||
count = result.TotalDesserts;
|
||||
// if (result != null)
|
||||
// {
|
||||
// isLoading = true;
|
||||
// orderInfos = result.Desserts;
|
||||
// // Update the count
|
||||
// count = result.TotalDesserts;
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
|
||||
// // Update the Data property
|
||||
// if (Name != null)
|
||||
// {
|
||||
// orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name);
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()},Name{Name.Name}");
|
||||
// count = orderInfos.Count();
|
||||
// }
|
||||
// if (OrderDate != null && OrderDate != DateTime.MinValue)
|
||||
// {
|
||||
// orderInfos = orderInfos.Where(it => it.ChargeDate.Date >= OrderDate.Value.Date);
|
||||
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
|
||||
// // Update the count
|
||||
// count = orderInfos.Count();
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(OrderNo))
|
||||
// {
|
||||
// orderInfos = orderInfos.Where(it => it.OrderNo.Contains(OrderNo));
|
||||
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}-OrderNo{OrderNo}");
|
||||
// // Update the count
|
||||
// count = orderInfos.Count();
|
||||
// }
|
||||
// if (Name != null && OrderDate != null && OrderDate != DateTime.MinValue && !string.IsNullOrEmpty(OrderNo))
|
||||
// {
|
||||
// orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name && it.ChargeDate.Date == OrderDate.Value.Date && it.OrderNo.Contains(OrderNo));
|
||||
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()}");
|
||||
// // Update the count
|
||||
// count = orderInfos.Count();
|
||||
// }
|
||||
// if (BoxNum != null&&BoxNum.BoxName!=99&&BoxNum.BoxName!=111)
|
||||
// {
|
||||
// string roomName = setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
|
||||
|
||||
// orderInfos = orderInfos.Where(it => it.RoomName == roomName);
|
||||
|
||||
// logger.Info($"LoadData:{DateTime.Now},{orderInfos.Count()};roomName{roomName}");
|
||||
// count = orderInfos.Count();
|
||||
// }
|
||||
|
||||
// logger.Info($"LoadData结束:{DateTime.Now},{orderInfos.Count()}");
|
||||
|
||||
// orderInfos = orderInfos.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
|
||||
|
||||
// logger.Info($"LoadData结束:{DateTime.Now},{orderInfos.Count()} -{args.Skip.Value}-{args.Top.Value}");
|
||||
|
||||
// await InvokeAsync(StateHasChanged);
|
||||
// //查找该麻醉师对应的手术室
|
||||
// //List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList();
|
||||
// // List<int> roomNameList = orderInfos.Select(it => Convert.ToInt32(it.RoomName.Substring(6, it.RoomName.Length - 6))).Distinct().ToList();
|
||||
// // BoxList = await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
|
||||
|
||||
// // BoxNum = BoxList.FirstOrDefault();
|
||||
|
||||
isLoading = false;
|
||||
|
||||
DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
|
||||
// }
|
||||
}
|
||||
//麻醉药品使用登记本导出
|
||||
async Task StockExport()
|
||||
{
|
||||
if (PortOrderDate == DateTime.MinValue)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
List<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
parameters.Add("PortOrderDate", pageData);
|
||||
GridReportUtil.PrintReport("Usage_Temp.grf", parameters);
|
||||
}
|
||||
// protected override async Task OnInitializedAsync()
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,363 @@
|
|||
@using MasaBlazorApp3.Pojo.Config
|
||||
@using MasaBlazorApp3.Util
|
||||
@using MasaBlazorApp3.Pojo.Vo;
|
||||
@using Microsoft.Extensions.Options
|
||||
@using log4net;
|
||||
|
||||
<RadzenStack>
|
||||
|
||||
<div Style="width:100%;height:70vh;overflow:auto">
|
||||
|
||||
@* <RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:50vw;overflow:auto" AllowFiltering="false"
|
||||
Data=@csList>
|
||||
<Template Context="contextDate">
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText Style="width:20vw;text-align:left">@contextDate.Drug.DrugName</RadzenText>
|
||||
<RadzenText Style="width:10vw">@contextDate.ManuNo</RadzenText>
|
||||
<RadzenStack Gap="10" Style="text-align:right">
|
||||
<div style="text-align: center;">
|
||||
@if (contextDate.ReturnDrawerChanneStock != null && contextDate.ReturnDrawerChanneStock.ReturnQuantity>0)
|
||||
{
|
||||
<div style="text-align: center;">
|
||||
还药库位【@contextDate.ReturnDrawerChanneStock?.DrawerNo】还药数【contextDate.ReturnDrawerChanneStock?.ReturnQuantity】< br />
|
||||
</div>
|
||||
}
|
||||
@if (contextDate.OrderList.fore > 0)
|
||||
{
|
||||
<div style="text-align: center;">
|
||||
空瓶库位【@contextDate.EmptyStock】空瓶数【@contextDate.EmptyQuantity】< br />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</RadzenStack>
|
||||
<RadzenStack Gap="10" Style="text-align:right">
|
||||
<div style="text-align: center;">
|
||||
基数【@contextDate.BaseQuantity】<br />
|
||||
库存数【@contextDate.Quantity】<br />
|
||||
用药数【@contextDate.UseQuantity】<br />
|
||||
处方数【@contextDate.OrderQuantity】<br />
|
||||
空瓶数【@contextDate.EmptyQuantity】<br />
|
||||
</div>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</Template>
|
||||
</RadzenListBox> *@
|
||||
|
||||
<RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:100%;overflow:auto" AllowFiltering="false" TValue="ChannelStock"
|
||||
Data=@csList>
|
||||
<Template>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText Style="width:20vw;text-align:left">@((context as ChannelStock).Drug.ToString())</RadzenText>
|
||||
<RadzenText Style="width:10vw">@((context as ChannelStock).ManuNo)</RadzenText>
|
||||
<RadzenStack Gap="10" Style="text-align:right">
|
||||
<div style="text-align: center;">
|
||||
@if (((context as ChannelStock).DrawerChanneStockList) != null && ((context as ChannelStock).DrawerChanneStockList.Count) > 0)
|
||||
{
|
||||
for (int i = 0; i < (context as ChannelStock).DrawerChanneStockList.Count; i++)
|
||||
{
|
||||
<div style="text-align: center;">
|
||||
还药品库位【@((context as ChannelStock).DrawerChanneStockList[i].Location)】还药数【@((context as ChannelStock).DrawerChanneStockList[i].ReturnQuantity)】
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if ((context as ChannelStock).EmptyQuantity > 0)
|
||||
{
|
||||
<div style="text-align: center;">
|
||||
还空瓶库位【@((context as ChannelStock).EmptyStock.Location)】空瓶数【@((context as ChannelStock).EmptyStock.ReturnQuantity)】
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</RadzenStack>
|
||||
<RadzenStack Gap="10" Style="text-align:right">
|
||||
<div style="text-align: center;">
|
||||
基数【@((context as ChannelStock).BaseQuantity)】<br />
|
||||
@* 总库存【@((context as ChannelStock).TotalQuantity)】<br /> *@
|
||||
库存数【@((context as ChannelStock).Quantity)】<br />
|
||||
用药数【@((context as ChannelStock).UseQuantity)】<br />
|
||||
处方数【@((context as ChannelStock).OrderQuantity)】<br />
|
||||
空瓶数【@((context as ChannelStock).EmptyQuantity)】<br />
|
||||
</div>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</Template>
|
||||
</RadzenListBox>
|
||||
</div>
|
||||
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
@* <RadzenButton Click="@ConfirmOK" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="归还" Style="width: 120px" />
|
||||
|
||||
<RadzenButton Click="@((args) => dialogService.Close(false))" Variant="Variant.Flat" Text="取消" Style="width: 120px" /> *@
|
||||
@if (status < 2)
|
||||
{
|
||||
<RadzenButton Click="@OpenDrawer" IsBusy="status > 0" BusyText="归还中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="归还" Style="width: 120px" />
|
||||
}
|
||||
@if (status == 2)
|
||||
{
|
||||
<RadzenButton Click="@TakeFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
}
|
||||
@if (status <= 2)
|
||||
{
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
}
|
||||
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
|
||||
@code {
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject PortUtil PortUtil;
|
||||
@inject NotificationService _message;
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
[Parameter] public IList<ChannelStock> csList { get; set; }
|
||||
List<OrderDetail> orderDetailList = new();
|
||||
ChannelStock listBoxSelectedcsList = new();
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
int status;
|
||||
|
||||
List<OrderTakeVo> data = new();
|
||||
//计数取药数量
|
||||
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
// //取药数量小于库存
|
||||
// tempData.Add(new OrderTakeVo()
|
||||
// {
|
||||
// Drug = detail.Drug,
|
||||
// OrderDetail = detail,
|
||||
// ChannelStock = stock,
|
||||
// StockQuantity = total,
|
||||
// Quantity = Quantity,
|
||||
// });
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
for (int i = 0; i < csList.Count; i++)
|
||||
{
|
||||
if (csList[i].EmptyStock != null && csList[i].EmptyStock.ReturnQuantity > 0)
|
||||
{
|
||||
data.Add(new OrderTakeVo()
|
||||
{
|
||||
ChannelStock = csList[i].EmptyStock
|
||||
});
|
||||
}
|
||||
if (csList[i].DrawerChanneStockList != null && csList[i].DrawerChanneStockList.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < csList[i].DrawerChanneStockList.Count; j++)
|
||||
{
|
||||
data.Add(new OrderTakeVo()
|
||||
{
|
||||
ChannelStock = csList[i].DrawerChanneStockList[j]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
base.OnInitializedAsync();
|
||||
}
|
||||
// async Task ConfirmOK()
|
||||
// {
|
||||
// // 关闭弹窗
|
||||
// dialogService.Close(true);
|
||||
// }
|
||||
async Task OpenDrawer()
|
||||
{
|
||||
this.status = 1;
|
||||
// 解析需要打开的抽屉列表
|
||||
List<OrderTakeVo> drawerNos = this.data.GroupBy(it => it.ChannelStock.DrawerNo).Select(it => it.First()).ToList();
|
||||
|
||||
// 根据抽屉类型来决定打开前是否需要查询数量
|
||||
var promiseUtil = new PromiseUtil<int>();
|
||||
|
||||
await promiseUtil.taskAsyncLoop(500, 0, async (options, next, stop) =>
|
||||
{
|
||||
var orderTakeVo = drawerNos[options._data];
|
||||
var drawerNo = orderTakeVo.ChannelStock.DrawerNo;
|
||||
var drawerType = orderTakeVo.ChannelStock.DrawerType;
|
||||
try
|
||||
{
|
||||
if (this.status == 0)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
// 开启抽屉
|
||||
else if (this.status == 1)
|
||||
{
|
||||
if (orderTakeVo.Status == 0)
|
||||
{
|
||||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
|
||||
|
||||
await PortUtil.HasLightOnByCol(drawerNo, data.Where(ot => ot.ChannelStock.DrawerNo == drawerNo).Select(ot => ot.ChannelStock.ColNo).ToArray());
|
||||
}
|
||||
var b = await PortUtil.OpenDrawerStatus(drawerNo);
|
||||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
if (drawerType == 1)
|
||||
{
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,环药");
|
||||
}
|
||||
else
|
||||
{
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,环空瓶");
|
||||
}
|
||||
orderTakeVo.Status = 1;
|
||||
next();
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
}
|
||||
// 检测状态
|
||||
else if (orderTakeVo.Status == 1)
|
||||
{
|
||||
// 查询抽屉是否为关闭状态
|
||||
var b = await PortUtil.CheckDrawerStatus2(drawerNo);
|
||||
// 关闭则改变状态并终止循环
|
||||
if (b)
|
||||
{
|
||||
|
||||
data.ForEach(cl =>
|
||||
{
|
||||
if (cl.ChannelStock.DrawerNo == drawerNo)
|
||||
{
|
||||
cl.GetQuantity = cl.Quantity;
|
||||
|
||||
}
|
||||
});
|
||||
orderTakeVo.Status = 2;
|
||||
if (options._data == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"抽屉关闭,请,点击完成按钮进行确认");
|
||||
this.status = 2;
|
||||
string alertMessage = string.Empty;
|
||||
//检查是否称重抽屉,核对实际取出数量是否与应取数量一致,不一致则弹出提示
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
|
||||
if (data[i].ChannelStock.BoardType.ToString().Contains("2"))
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", orderTakeVo.AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
|
||||
if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
|
||||
{
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{orderTakeVo.Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(alertMessage))
|
||||
{
|
||||
//弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
//弹出确认提示框
|
||||
var confirm = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
$"保存确认",
|
||||
new Dictionary<string, object>() { { "confirmInfo", alertMessage } },
|
||||
new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
logger.Info(alertMessage);
|
||||
if (!confirm)
|
||||
{
|
||||
RestData();
|
||||
logger.Info("取消保存");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
}
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
options._data += 1;
|
||||
next();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
next(); // continue iteration
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
RestData();
|
||||
logger.Info($"处方取药发生错误,{e.Message}");
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
|
||||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void RestData()
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
this.status = 0;
|
||||
data.ForEach(it =>
|
||||
{
|
||||
it.Status = 0;
|
||||
it.BeforeQuantity = new int[9];
|
||||
it.AfterQuantity = new int[9];
|
||||
});
|
||||
this.WeightFinnalQuantity = new int[9];
|
||||
}
|
||||
void Cancel()
|
||||
{
|
||||
RestData();
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
async Task TakeFinish()
|
||||
{
|
||||
|
||||
// 保存账册、操作记录
|
||||
bool bResult = await orderInfoDao.CheckOrderInfoByChannelStock(csList.ToList(), null);
|
||||
if (bResult)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
|
||||
);
|
||||
// 关闭弹窗
|
||||
dialogService.Close(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方核对失败", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
//重置状态
|
||||
this.RestData();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,253 @@
|
|||
@page "/Box/OrderImport"
|
||||
@using MasaBlazorApp3.Pojo.Config
|
||||
@using MasaBlazorApp3.Report
|
||||
@using Microsoft.Extensions.Options
|
||||
@using Radzen.Blazor.Rendering
|
||||
@using log4net;
|
||||
|
||||
<style>
|
||||
.rz-grid-table {
|
||||
position: relative;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<div class="col-12">
|
||||
<form onsubmit="@(() => {grid.Reload();})">
|
||||
<RadzenFieldset Text="查询">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
|
||||
<RadzenLabel Text="处方号" Component="OrderNo" />
|
||||
<RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
|
||||
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6" Style="margin-top:0.5rem">
|
||||
<RadzenLabel Text="处方时间" Component="OrderDate" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
|
||||
<RadzenLabel Text="患者姓名" Component="PatientName" />
|
||||
<RadzenTextBox @bind-Value="PatientName" Style="width: 100%;" Name="PatientName"></RadzenTextBox>
|
||||
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6" Style="margin-top:4vh">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" ButtonStyle="ButtonStyle.Warning" IsBusy="isLoading" Icon="input" Text="导入" />
|
||||
<RadzenButton Click="@((args) => dialogService.Close(false))" Variant="Variant.Flat" ButtonStyle="ButtonStyle.Secondary" Text="取消" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenFieldset>
|
||||
</form>
|
||||
<div Style="width:75vw;height:50vh;overflow:auto">
|
||||
<RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:75vw;overflow:auto" Groupable="true"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@orderInfos" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
SelectionMode="DataGridSelectionMode.Multiple"
|
||||
@bind-Value="@(selectedOrderInfos)"
|
||||
CellClick="@((DataGridCellMouseEventArgs<OrderInfo> args) => OnCellClick(args))"
|
||||
AllowPaging="false">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
|
||||
@* <HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
|
||||
Change="@(args => OnCheckSeleced(args))" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
|
||||
</Template> *@
|
||||
<HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
|
||||
Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false"
|
||||
Value="@(selectedOrderInfos != null &&selectedOrderInfos.Contains(data))"
|
||||
InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="anaesthetistName" Title="麻醉医师" Sortable="false" Filterable="false" Width="8vw" />
|
||||
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="8vw" />
|
||||
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="6vw" />
|
||||
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="13vw" />
|
||||
@* <RadzenDataGridColumn Property="ChargeDate" Title="处方时间" Sortable="false" Filterable="false" Width="10vw" /> *@
|
||||
<RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="20vw" />
|
||||
@* <Template Context="DetailInfo">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
{
|
||||
OrderDetail orderDetail = DetailList.DetailList[i]; *@
|
||||
@* <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>*@
|
||||
@* <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
|
||||
<Template Context="DetailList">
|
||||
@for (int i = 0; i < DetailList.DetailList.Count; i++)
|
||||
{
|
||||
OrderDetail orderDetail = DetailList.DetailList[i];
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="批次" Property="DetailInfo.SetManuNo" Filterable="false" Width="18vw">
|
||||
<Template Context="DetailInfo">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@DetailInfo.DetailInfo.SetManuNo</RadzenText>
|
||||
|
||||
@if (DetailInfo.DetailInfo.SetManuNo != null)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@DetailInfo.DetailInfo.SetManuNo
|
||||
</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
@* <EditTemplate Context="DetailInfo">
|
||||
<RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="DetailInfo.DetailInfo.drugManuNo" Data="DetailInfo.DetailInfo.Drug.Manus" Style="width:100%; display: block;">
|
||||
<Template>
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
<ValueTemplate>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</RadzenStack>
|
||||
</ValueTemplate>
|
||||
</RadzenDropDown>
|
||||
<RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
|
||||
</EditTemplate> *@
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Filterable="false" Width="6vw">
|
||||
@* <EditTemplate Context="DetailInfo">
|
||||
<RadzenNumeric Min="0" Style="display: block" Name="Quantity" @bind-Value=@DetailInfo.DetailInfo.Quantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="Quantity" Popup="true" />
|
||||
</EditTemplate> *@
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</RadzenStack>
|
||||
@code {
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject NotificationService _message;
|
||||
@inject IReportDataDao reportDataDao;
|
||||
@inject IOptions<SettingConfig> setting;
|
||||
|
||||
|
||||
|
||||
[Parameter] public BoxModel boxModel { get; set; }
|
||||
|
||||
bool allowRowSelectOnRowClick = true;
|
||||
IEnumerable<OrderInfo> orderInfos;
|
||||
IList<OrderInfo> selectedOrderInfos = new List<OrderInfo>();
|
||||
RadzenDataGrid<OrderInfo> grid;
|
||||
//麻醉师集合
|
||||
List<Anaesthetist> NamesList = new List<Anaesthetist>();
|
||||
Anaesthetist NameInfo;
|
||||
Anaesthetist BoxColor;
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
//药盒颜色集合
|
||||
List<Anaesthetist> BoxColorList = new List<Anaesthetist>();
|
||||
BoxModel BoxNum;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
int status = 0;
|
||||
string OrderNo;
|
||||
string PatientName;
|
||||
DateTime OrderDate = DateTime.Now;
|
||||
DateTime PortOrderDate = DateTime.Now;
|
||||
Popup popup;
|
||||
RadzenButton button;
|
||||
//第一次加载不执行LoadData方法
|
||||
// int firstLod = 1;
|
||||
void OnCheckSeleced(object dete)
|
||||
{
|
||||
if (orderInfos != null)
|
||||
{
|
||||
orderInfos.ToList().ForEach(it => it.ItemIsChecked = true);
|
||||
}
|
||||
}
|
||||
void OnCurrentDateChanged(DateTime args)
|
||||
{
|
||||
OrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
}
|
||||
void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
|
||||
{
|
||||
if (args.Data.DetailInfo.SetManuNo != null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
|
||||
}
|
||||
if (args.Data.DetailInfo.drugManuNo == null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
|
||||
}
|
||||
args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
|
||||
grid.EditRow(args.Data);
|
||||
}
|
||||
//确认
|
||||
async Task Confirm()
|
||||
{
|
||||
if (selectedOrderInfos == null || selectedOrderInfos.Count<=0)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
// 关闭弹窗selectedOrderInfos
|
||||
dialogService.Close(selectedOrderInfos);
|
||||
|
||||
}
|
||||
PageData<OrderInfo> result;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
// if (firstLod == 1)
|
||||
if (boxModel != null && boxModel.BoxName > 0)
|
||||
{
|
||||
//查询除本药箱外的处方信息
|
||||
result = await orderInfoDao.GetAllOrderInfoForImport(PatientName, OrderNo, OrderDate, boxModel, args.Top, args.Skip);
|
||||
orderInfos = result.Desserts;
|
||||
selectedOrderInfos = orderInfos.ToList();
|
||||
count = result.TotalDesserts;
|
||||
isLoading = true;
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,581 @@
|
|||
@page "/Box/Check"
|
||||
@using MasaBlazorApp3.Pojo.Config
|
||||
@using MasaBlazorApp3.Report
|
||||
@using Microsoft.Extensions.Options
|
||||
@using Radzen.Blazor.Rendering
|
||||
@using log4net;
|
||||
|
||||
<style>
|
||||
.my-popup {
|
||||
display: none;
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
/* height: 360px; */
|
||||
width: 900px;
|
||||
border: var(--rz-panel-border);
|
||||
background-color: var(--rz-panel-background-color);
|
||||
box-shadow: var(--rz-panel-shadow);
|
||||
border-radius: var(--rz-border-radius);
|
||||
}
|
||||
|
||||
.rz-grid-table {
|
||||
position: relative;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@* <RadzenStack Orientation="Orientation.Horizontal"> *@
|
||||
<div class="col-12" style="margin-bottom:5px;">
|
||||
@* <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem"> *@
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenLabel Text="核对药箱" Component="BoxList" />
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 8vw;"
|
||||
ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
@((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 3 ? "非常规" : "绿")
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" Value="BoxNum" Style="width: 10vw;"
|
||||
ValueChanged="@((args) => OnBoxChanged(args))" AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
|
||||
@((context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" :
|
||||
(context as BoxModel).BoxName == 31 ? "胃镜药盒" :
|
||||
(context as BoxModel).BoxName == 32 ? "导管药盒" :
|
||||
(context as BoxModel).BoxName == 33 ? "生殖药盒" :
|
||||
(context as BoxModel).BoxName == 34 ? "妇门药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿"))
|
||||
|
||||
@* @((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo) *@
|
||||
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenLabel Text="处方时间" Component="OrderDate" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 15vw;" Name="OrderDate" />
|
||||
@* <RadzenButton Size="ButtonSize.Medium" Click="Search" IsBusy="isLoading" Icon="search" Text="查询" /> *@
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" ButtonStyle="ButtonStyle.Success" IsBusy="isLoading" Icon="check_circle" Text="确认" />
|
||||
<RadzenButton Size="ButtonSize.Medium" Click="AddOrderMethod" ButtonType="ButtonType.Button" IsBusy="isLoading" ButtonStyle="ButtonStyle.Warning" Icon="input" Text="导入" />
|
||||
<RadzenButton Style="margin-top:2px" Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
|
||||
<Popup @ref=popup Lazy=true class="my-popup">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
|
||||
<RadzenFieldset Text="条件选择">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="处方时间" Component="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</RadzenStack>
|
||||
</Popup>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</div>
|
||||
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<div Style="width:55vw;overflow:auto">
|
||||
@* <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData" Style="width:50vw;overflow:auto"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@csList" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
|
||||
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedcsList
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnDrugCellClick(args))"
|
||||
AllowPaging="false">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="2vw" />
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo" Filterable="false" Width="2vw">
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="DetailInfo.Quantity" Title="合计" Filterable="false" Width="3vw">
|
||||
<Template Context="contextDate">
|
||||
<div style="text-align: center;">
|
||||
库存量【@contextDate.Quantity】<br />
|
||||
用药量【@contextDate.UseQuantity】<br />
|
||||
处方数【@contextDate.OrderQuantity】
|
||||
</div>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid> *@
|
||||
|
||||
<RadzenListBox AllowClear="true" @bind-Value=@listBoxSelectedcsList Style="width:45vw;height:70vh;overflow:auto" AllowFiltering="false" TValue="ChannelStock"
|
||||
LoadData=@LoadData Data=@csList>
|
||||
<Template>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText Style="width:15vw;text-align:left">@((context as ChannelStock).Drug.DrugName)</RadzenText>
|
||||
<RadzenText Style="width:10vw">@((context as ChannelStock).ManuNo)</RadzenText>
|
||||
<RadzenStack Gap="10" Style="text-align:right">
|
||||
<div style="text-align: center;">
|
||||
基数【@((context as ChannelStock).BaseQuantity)】<br />
|
||||
@* 总库存【@((context as ChannelStock).TotalQuantity)】<br /> *@
|
||||
库存数【@((context as ChannelStock).Quantity)】<br />
|
||||
用药数【@((context as ChannelStock).SelectedOrderList.Aggregate(0, (a, b) => a + b.DetailInfo.Quantity))】<br />
|
||||
处方数【@((context as ChannelStock).SelectedOrderList.Count)】
|
||||
</div>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</Template>
|
||||
</RadzenListBox>
|
||||
</div>
|
||||
<div Style="width:75vw;overflow:auto;box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); ">
|
||||
@if ((listBoxSelectedcsList != null && string.IsNullOrEmpty(listBoxSelectedcsList.ListId) && listBoxSelectedcsList.Quantity > listBoxSelectedcsList.UseQuantity) || (listBoxSelectedcsList.Quantity > listBoxSelectedcsList.BaseQuantity))
|
||||
{
|
||||
//ListId为空则是没有在套餐里的药,库存量大于使用量时需要把药还到抽屉里
|
||||
//列出需要还到抽屉里的药品的抽屉库位
|
||||
@* <RadzenRow AlignItems="AlignItems.Center" Style="margin:1vw;">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenLabel Text="库位" Component="DrawerList" />
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="DrawerList" TValue="ChannelStock" @bind-Value="@listBoxSelectedcsList.ReturnDrawerChanneStock" Data="@(listBoxSelectedcsList?.DrawerChanneStockList)"
|
||||
Style="width:20vw;" AllowFilteringByAllStringColumns="true" TextProperty="Location">
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="Location" Title="库位" Sortable="false" />
|
||||
<RadzenDropDownDataGridColumn Property="Quantity" Title="库存" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenLabel Text="还药数" Component="ReturnQuantity" />
|
||||
<RadzenNumeric Min="0" Name="ReturnQuantity" TValue="int" @bind-Value=@listBoxSelectedcsList.ReturnQuantity Style="width:5vw;" />
|
||||
<RadzenNumericRangeValidator Min="0" Max=@listBoxSelectedcsList.Quantity Text="请填写正确的还药数量" Component="ReturnQuantity" Popup="true" />
|
||||
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center" Style="margin:1vw;">
|
||||
<RadzenColumn Size="12">*@
|
||||
@if (listBoxSelectedcsList?.DrawerChanneStockList != null)
|
||||
{
|
||||
<RadzenListBox AllowClear="true" @bind-Value=@returnList AllowFiltering="false" TValue="ChannelStock" Style="width:70vw;overflow:auto"
|
||||
Data=@(listBoxSelectedcsList?.DrawerChanneStockList)>
|
||||
<Template>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText Style="width:20vw;text-align:left">还药库位@((context as ChannelStock).Location)</RadzenText>
|
||||
<RadzenText Style="width:10vw">还药数@((context as ChannelStock).ReturnQuantity)</RadzenText>
|
||||
</RadzenStack>
|
||||
</Template>
|
||||
</RadzenListBox>
|
||||
}
|
||||
@* </RadzenColumn>
|
||||
</RadzenRow> *@
|
||||
}
|
||||
|
||||
<RadzenDataGrid Style="width:55vw;height:70vh;overflow:auto"
|
||||
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
Data="@(listBoxSelectedcsList?.OrderList)" EmptyText="无处方数据"
|
||||
@bind-Value="@(listBoxSelectedcsList.SelectedOrderList)"
|
||||
SelectionMode="DataGridSelectionMode.Multiple"
|
||||
AllowRowSelectOnRowClick="true"
|
||||
AllowPaging="false">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="1rem">
|
||||
@* <HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(listBoxSelectedcsList?.OrderList!=null&&(bool)listBoxSelectedcsList?.OrderList.Any(oi=>oi. ItemIsChecked))"
|
||||
Change="@(args => ChangeHeaderCheckBox(args))" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@data.ItemIsChecked" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" Change="@(args => { data.ItemIsChecked=!data.ItemIsChecked;})" />
|
||||
</Template> *@
|
||||
<HeaderTemplate>
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
|
||||
Value="@(listBoxSelectedcsList?.SelectedOrderList==null || listBoxSelectedcsList?.SelectedOrderList.Any() !=true? false: !(bool)listBoxSelectedcsList?.OrderList.All(i => (bool)(listBoxSelectedcsList?.SelectedOrderList.Contains(i)))?null:listBoxSelectedcsList?.OrderList.Any(i => (bool)listBoxSelectedcsList?.SelectedOrderList.Contains(i)))"
|
||||
Change="@(args =>listBoxSelectedcsList.SelectedOrderList = args == true ? listBoxSelectedcsList?.OrderList.ToList():new List<OrderInfo>())" />
|
||||
</HeaderTemplate>
|
||||
<Template Context="data">
|
||||
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@(listBoxSelectedcsList.SelectedOrderList.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="OrderNo" Title="处方号" Sortable="false" Filterable="false" Width="5vw" />
|
||||
<RadzenDataGridColumn Property="anaesthetistName" Title="医师" Sortable="false" Filterable="false" Width="3vw" />
|
||||
<RadzenDataGridColumn Property="PatientName" Title="患者" Sortable="false" Filterable="false" Width="3vw" />
|
||||
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2vw" />
|
||||
<RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2vw" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</RadzenStack>
|
||||
@* </RadzenStack> *@
|
||||
@code {
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrder));
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject NotificationService _message;
|
||||
@inject IReportDataDao reportDataDao;
|
||||
@inject IOptions<SettingConfig> setting;
|
||||
//bool allowRowSelectOnRowClick = true;
|
||||
IEnumerable<ChannelStock> csList;
|
||||
IList<ChannelStock> selectedcsList;
|
||||
ChannelStock listBoxSelectedcsList = new();
|
||||
ChannelStock returnList = new();
|
||||
IEnumerable<OrderInfo> orderList;
|
||||
IList<OrderInfo> selectedOrderList;
|
||||
RadzenListBox<ChannelStock> listBox;
|
||||
RadzenDataGrid<OrderInfo> gridOrder;
|
||||
|
||||
//麻醉师集合
|
||||
List<Anaesthetist> NamesList = new List<Anaesthetist>();
|
||||
Anaesthetist NameInfo;
|
||||
BoxModel BoxColor;
|
||||
//全部药盒集合
|
||||
List<BoxModel> AllBoxList = new List<BoxModel>();
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
//药盒颜色集合
|
||||
List<BoxModel> BoxColorList = new List<BoxModel>()
|
||||
{
|
||||
new BoxModel{BoxNo=1,BoxName=1 },
|
||||
new BoxModel{BoxNo=2 ,BoxName=1},
|
||||
new BoxModel{BoxNo=3 ,BoxName=1}
|
||||
};
|
||||
BoxModel BoxNum;
|
||||
bool isLoading;
|
||||
int count;
|
||||
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
int status = 0;
|
||||
string OrderNo;
|
||||
string PatientName;
|
||||
DateTime? OrderDate = DateTime.Now;
|
||||
DateTime PortOrderDate = DateTime.Now;
|
||||
Popup popup;
|
||||
RadzenButton button;
|
||||
private async Task OnColorChanged(object value)
|
||||
{
|
||||
if ((((BoxModel)value).BoxNo) == 3)
|
||||
{
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxName > 30).ToList();
|
||||
BoxNum = BoxList.FirstOrDefault();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName <= 30).ToList();
|
||||
BoxNum = BoxList.FirstOrDefault();
|
||||
}
|
||||
await LoadData(null);
|
||||
|
||||
}
|
||||
//药箱选中修改
|
||||
private async Task OnBoxChanged(object value)
|
||||
{
|
||||
// BoxList = BoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName == ((BoxModel)value).BoxName).ToList();
|
||||
BoxNum = (BoxModel)value;
|
||||
|
||||
await LoadData(null);
|
||||
}
|
||||
bool? boolHeader = true;
|
||||
//全选/反选
|
||||
void ChangeHeaderCheckBox(bool? args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
boolHeader = args;
|
||||
listBoxSelectedcsList?.OrderList.ToList().ForEach(it => it.ItemIsChecked = (bool)args);
|
||||
}
|
||||
}
|
||||
void OnCheckSeleced(object dete)
|
||||
{
|
||||
//listBoxSelectedcsList?.OrderList.ToList().Where(it => it.OrderNo == (OrderInfo as (dete).))(oi => oi.ItemIsChecked = true));
|
||||
}
|
||||
//日期修改
|
||||
async Task OnCurrentDateChanged(DateTime args)
|
||||
{
|
||||
OrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
|
||||
await LoadData(null);
|
||||
}
|
||||
void OnCurrentPortDateChanged(DateTime args)
|
||||
{
|
||||
PortOrderDate = new DateTime(args.Year, args.Month, args.Day);
|
||||
}
|
||||
void OnDrugCellClick(DataGridCellMouseEventArgs<ChannelStock> args)
|
||||
{
|
||||
|
||||
}
|
||||
void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
|
||||
{
|
||||
if (args.Data.DetailInfo.SetManuNo != null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
|
||||
}
|
||||
if (args.Data.DetailInfo.drugManuNo == null)
|
||||
{
|
||||
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
|
||||
}
|
||||
args.Data.ItemIsChecked = !args.Data.ItemIsChecked;
|
||||
// gridOrder.EditRow(args.Data);
|
||||
}
|
||||
//查询
|
||||
async Task Search()
|
||||
{
|
||||
await LoadData(null);
|
||||
}
|
||||
//确认
|
||||
async Task Confirm()
|
||||
{
|
||||
csList = csList.ToList();
|
||||
List<ChannelStock> checkChannelStock = new();
|
||||
string errMessage = string.Empty;
|
||||
foreach (var item in csList)
|
||||
{
|
||||
if (item.SelectedOrderList.Aggregate(0, (a, b) => a + b.DetailInfo.Quantity)>item.Quantity)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"用药数不可大于库存数,请仔细核对!", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
int i = 0;
|
||||
if (item.OrderList != null && item.SelectedOrderList.Count > 0)
|
||||
{
|
||||
item.UseQuantity = item.SelectedOrderList.Sum(oi => oi.DetailInfo.Quantity);
|
||||
item.OrderQuantity = item.SelectedOrderList.Count;
|
||||
// checkChannelStock.Add(item);
|
||||
i = 1;
|
||||
}
|
||||
if (item.DrawerChanneStockList != null && item.DrawerChanneStockList.Any(d => d.ReturnQuantity > 0))
|
||||
{
|
||||
//还药数量:使用量==库存?还0 :库存>基数? (库存数-使用数)>基数? 还 库存数-使用数:0;
|
||||
item.ReturnQuantity =
|
||||
(item.UseQuantity == item.Quantity) ? 0 :
|
||||
(item.Quantity <= item.BaseQuantity) ? 0 :
|
||||
((item.Quantity - item.UseQuantity) > item.BaseQuantity) ?
|
||||
(item.Quantity - item.UseQuantity - item.BaseQuantity) : 0;
|
||||
//还药库位
|
||||
if (item.ReturnQuantity > 0)
|
||||
{
|
||||
//药品未在套餐中绑定需要把药还到对应抽屉
|
||||
List<ChannelStock> allDrugStock = await orderInfoDao.GetStockByDRrug(item.DrugId, item.ManuNo, 1);// await _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 1 && cs.DrugId == csList[i].DrugId && cs.ManuNo == csList[i].ManuNo).OrderBy(cs => cs.Quantity).ToListAsync();
|
||||
if (allDrugStock != null && allDrugStock.Count > 0)
|
||||
{
|
||||
item.DrawerChanneStockList = new();
|
||||
int iReturnQuantity = item.Quantity - item.UseQuantity - item.BaseQuantity;
|
||||
for (int j = 0; j < allDrugStock.Count; j++)
|
||||
{
|
||||
if (allDrugStock[j].BoardType.ToString().Contains("2") && allDrugStock[j].Quantity >= 25)
|
||||
continue;
|
||||
if (allDrugStock[j].BoardType.ToString().Contains("2") && allDrugStock[j].Quantity + item.Quantity - item.UseQuantity > 25)
|
||||
{
|
||||
if (iReturnQuantity <= allDrugStock.Sum(it => it.Quantity))
|
||||
{
|
||||
for (int q = 0; iReturnQuantity > 0; q++)
|
||||
{
|
||||
|
||||
allDrugStock[j].ReturnQuantity = 25 - allDrugStock[q].Quantity;
|
||||
item.DrawerChanneStockList.Add(allDrugStock[q]);
|
||||
iReturnQuantity = iReturnQuantity - allDrugStock[q].ReturnQuantity;
|
||||
if (iReturnQuantity <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//库位不足,有药品无库位可放
|
||||
allDrugStock[j].ReturnQuantity = iReturnQuantity;
|
||||
item.DrawerChanneStockList.Add(allDrugStock[j]);
|
||||
logger.Info($"还药品【{item.Drug.DrugName}】库位不足,有药品无库位可放");
|
||||
errMessage += $"库位不足,药品【{item.Drug.DrugName}】无库位可放";
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = errMessage, Duration = 4000 }
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allDrugStock[j].ReturnQuantity = iReturnQuantity;
|
||||
item.DrawerChanneStockList.Add(allDrugStock[j]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// checkChannelStock.Add(item);
|
||||
i = 1;
|
||||
}
|
||||
|
||||
//还空瓶数
|
||||
item.EmptyQuantity = item.SelectedOrderList.Sum(oi => oi.DetailInfo.Quantity);
|
||||
if (item.EmptyQuantity > 0)
|
||||
{
|
||||
//还空瓶库位
|
||||
//查询还空瓶库位
|
||||
//checkChannelStock[i].EmptyStock;
|
||||
|
||||
List<ChannelStock> allDrugStock = await orderInfoDao.GetStockByDRrug(item.DrugId, item.ManuNo, 2);// await _connection.ChannelStock.Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 1 && cs.DrugId == csList[i].DrugId && cs.ManuNo == csList[i].ManuNo).OrderBy(cs => cs.Quantity).ToListAsync();
|
||||
if (allDrugStock.Count > 0)
|
||||
{
|
||||
item.EmptyStock = allDrugStock.FirstOrDefault();
|
||||
item.EmptyStock.ReturnQuantity = item.EmptyQuantity;
|
||||
i = 1;
|
||||
}
|
||||
// checkChannelStock.Add(item);
|
||||
}
|
||||
if (i == 1)
|
||||
{
|
||||
checkChannelStock.Add(item);
|
||||
}
|
||||
}
|
||||
if (errMessage.Length > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (checkChannelStock == null || checkChannelStock.Count <= 0)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"无可操作的数据", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
// //弹出确认提示框
|
||||
var b = await dialogService.OpenAsync<CheckOrderConfirmDialog>(
|
||||
$"核对确认",
|
||||
new Dictionary<string, object>() { { "csList", checkChannelStock } },
|
||||
new DialogOptions() { Width = "90vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
// if (b)
|
||||
// {
|
||||
// bool bResult = await orderInfoDao.CheckOrderInfoByChannelStock(csList.ToList(), BoxNum);
|
||||
// if (bResult)
|
||||
// {
|
||||
// _message.Notify(
|
||||
// new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
|
||||
// );
|
||||
// await LoadData(null);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _message.Notify(
|
||||
// new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
if (b)
|
||||
{
|
||||
LoadData(null);
|
||||
}
|
||||
|
||||
}
|
||||
//导处方
|
||||
async Task AddOrderMethod()
|
||||
{
|
||||
var b = await dialogService.OpenAsync<CheckOrderImportDialog>(
|
||||
$"导入处方信息",
|
||||
new Dictionary<string, object>() { { "boxModel", BoxNum } },
|
||||
new DialogOptions() { Width = "80vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
if (b != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
List<OrderInfo> importOrderInfo = b;
|
||||
if (importOrderInfo.Count > 0)
|
||||
{
|
||||
string errorMessage = string.Empty;
|
||||
for (int i = 0; i < importOrderInfo.Count; i++)
|
||||
{
|
||||
if (!(bool)listBoxSelectedcsList?.OrderList.Contains(importOrderInfo[i]))
|
||||
{
|
||||
if (csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault() == null)
|
||||
{
|
||||
errorMessage += $"处方{importOrderInfo[i].OrderNo}导入失败,药品{importOrderInfo[i].DetailInfo.Drug.DrugName}不存在或批次{importOrderInfo[i].DetailInfo.SetManuNo}不存在";
|
||||
}
|
||||
else
|
||||
{
|
||||
csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault()?.SelectedOrderList.Add(importOrderInfo[i]);
|
||||
//csList.Where(c => c.DrugId == importOrderInfo[i].DetailInfo.DrugId && c.ManuNo == importOrderInfo[i].DetailInfo.SetManuNo).FirstOrDefault()?.OrderList.Add(importOrderInfo[i]);
|
||||
}
|
||||
}
|
||||
csList = csList;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorMessage))
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = errorMessage, Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
StateHasChanged(); // 刷新UI
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
PageData<ChannelStock> result;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
BoxColor = BoxColorList.FirstOrDefault();
|
||||
AllBoxList = await orderInfoDao.GetOperationNum(0);
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxNo == BoxColor.BoxNo && bl.BoxName <= 30).ToList();
|
||||
BoxNum = AllBoxList.FirstOrDefault();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
string? roomName = BoxNum == null ? "" : setting.Value.roomName + BoxNum.BoxName.ToString().PadLeft(2, '0');
|
||||
result = await orderInfoDao.GetAllOrderInfoDrugByBox(BoxNum, roomName, OrderDate);
|
||||
isLoading = true;
|
||||
csList = result.Desserts;
|
||||
if (csList != null && csList.Count() > 0)
|
||||
{
|
||||
listBoxSelectedcsList = csList.ElementAt(0);
|
||||
}
|
||||
count = result.TotalDesserts;
|
||||
isLoading = false;
|
||||
StateHasChanged(); // 刷新UI
|
||||
}
|
||||
//麻醉药品使用登记本导出
|
||||
async Task StockExport()
|
||||
{
|
||||
if (PortOrderDate == DateTime.MinValue)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
|
||||
);
|
||||
return;
|
||||
}
|
||||
// PageData<ReportUsageDateInfo> pageParentData = await reportDataDao.GetOrderInfoParentData(PortOrderDate);
|
||||
// PageData<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
|
||||
|
||||
List<ReportUsageParentDateInfo> pageParentData = await reportDataDao.GetOrderInfoParentData(PortOrderDate);
|
||||
List<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(PortOrderDate);
|
||||
Dictionary<string, object> parameters = new Dictionary<string, object>();
|
||||
parameters.Add("parent", pageParentData);
|
||||
parameters.Add("child", pageData);
|
||||
GridReportUtil.PrintReport("use_book.grf", parameters);
|
||||
}
|
||||
// protected override async Task OnInitializedAsync()
|
||||
// {
|
||||
// await base.OnInitializedAsync();
|
||||
|
||||
// // orderInfos = dbContext.Employees;
|
||||
|
||||
// var result = await orderInfoDao.GetAllOrderInfo(OrderNo, OrderDate, args.Top, args.Skip);
|
||||
// // Update the Data property
|
||||
// orderInfos = result.Desserts;
|
||||
// // Update the count
|
||||
// count = result.TotalDesserts;
|
||||
|
||||
// isLoading = false;
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
@page "/Box/CheckDDD"
|
||||
@using Radzen.Blazor
|
||||
@using System.ComponentModel
|
||||
|
||||
<style>
|
||||
|
||||
.total-footer {
|
||||
font-weight: 600;
|
||||
color: var(--rz-secondary);
|
||||
padding: 8px 12px;
|
||||
background-color: var(--rz-base-100);
|
||||
border-top: 2px solid var(--rz-border-default);
|
||||
}
|
||||
</style>
|
||||
@* <RadzenDataGrid @ref="grid" Data="@summaryData" TItem="dynamic"
|
||||
AllowPaging="true" PageSize="5">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="商品品类" Property="Category" Width="200px" />
|
||||
<RadzenDataGridColumn Title="销售总量" TextAlign="TextAlign.Right">
|
||||
<Template Context="group">
|
||||
<span class="font-bold">@group.TotalQuantity.ToString("N0")</span>
|
||||
</Template>
|
||||
<FooterTemplate>
|
||||
<div class="total-footer">
|
||||
全品类合计: @orders.Sum(o => o.Quantity).ToString("N0")
|
||||
</div>
|
||||
</FooterTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid> *@
|
||||
|
||||
@code {
|
||||
RadzenDataGrid<dynamic> grid;
|
||||
List<Order> orders = new();
|
||||
IEnumerable<dynamic> summaryData;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// 模拟数据
|
||||
orders = new List<Order> {
|
||||
new Order { Category = "电子产品", Quantity = 15 },
|
||||
new Order { Category = "电子产品", Quantity = 8 },
|
||||
new Order { Category = "家居用品", Quantity = 23 }
|
||||
};
|
||||
|
||||
CalculateSummary();
|
||||
}
|
||||
|
||||
void CalculateSummary()
|
||||
{
|
||||
summaryData = orders
|
||||
.GroupBy(o => o.Category)
|
||||
.Select(g => new
|
||||
{
|
||||
Category = g.Key,
|
||||
TotalQuantity = g.Sum(x => x.Quantity)
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public class Order : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public string Category { get; set; }
|
||||
private int _quantity;
|
||||
public int Quantity
|
||||
{
|
||||
get => _quantity;
|
||||
set
|
||||
{
|
||||
_quantity = value;
|
||||
PropertyChanged?.Invoke(this,
|
||||
new PropertyChangedEventArgs(nameof(Quantity)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
@using log4net;
|
||||
<style>
|
||||
.rz-custom-header {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
|
|
@ -17,8 +17,14 @@
|
|||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(i))
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="true" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" Style="background-color: #d3d3d3;" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -29,27 +35,27 @@
|
|||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-12" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
|
||||
<RadzenButton class="col-12" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@channels"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<RadzenDataGrid @ref="grid" Style="width:66vw; overflow:auto"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@channels"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End">
|
||||
@if (status < 3)
|
||||
{
|
||||
<RadzenButton IsBusy="@(status>0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="加药" Click="@OpenDrawer" />
|
||||
<RadzenButton IsBusy="@(status > 0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="加药" Click="@OpenDrawer" />
|
||||
}
|
||||
@if (status == 3)
|
||||
{
|
||||
|
|
@ -62,29 +68,30 @@
|
|||
</RadzenRow>
|
||||
</HeaderTemplate>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
|
||||
<RadzenDataGridColumn Width="4vw" Title="库位" Property="ColNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="15vw" Title="药品名称" Property="Drug.DrugName">
|
||||
<Template Context="channel">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<RadzenDataGridColumn Width="15vw" Title="批次" Property="ManuNo">
|
||||
<Template Context="channel">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
|
||||
@* <RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText> *@
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
|
||||
|
||||
@if (channel.drugManuNo != null && channel.drugManuNo.EffDate.ToString().Length > 10)
|
||||
@* @if (channel.drugManuNo != null && channel.drugManuNo.EffDate.ToString().Length > 10)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@channel.drugManuNo.EffDate.ToString().Substring(0, 10)
|
||||
</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@channel.drugManuNo?.EffDate
|
||||
</RadzenText>
|
||||
}
|
||||
{ *@
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@channel.EffDate
|
||||
</RadzenText>
|
||||
@* } *@
|
||||
</Template>
|
||||
<EditTemplate Context="channel">
|
||||
|
||||
|
|
@ -130,12 +137,17 @@
|
|||
}
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity">
|
||||
<RadzenDataGridColumn Title="库存" Width="10vw" Property="Quantity">
|
||||
<Template Context="cs">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn MinWidth="100px" Title="加药数量" Property="AddQuantity">
|
||||
<RadzenDataGridColumn MinWidth="15vw" Title="加药数量" Property="AddQuantity">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
加药<br>数量
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<EditTemplate Context="cs">
|
||||
@if (cs.BoardType.ToString().Contains("2") || cs.BoardType.ToString().Contains("3"))
|
||||
{
|
||||
|
|
@ -158,6 +170,7 @@
|
|||
@inject PortUtil PortUtil;
|
||||
@inject NotificationService _message
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
int status = 0;
|
||||
int drawerNo = 1;
|
||||
RadzenDataGrid<ChannelStock> grid;
|
||||
|
|
@ -191,8 +204,8 @@
|
|||
}
|
||||
async Task OpenDrawer()
|
||||
{
|
||||
PortUtil.DrawerNo = this.drawerNo;
|
||||
this.status = 1;
|
||||
PortUtil.DrawerNo = this.drawerNo;
|
||||
// 根据抽屉类型来决定打开前是否需要查询数量
|
||||
var promiseUtil = new PromiseUtil<object>();
|
||||
await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
|
||||
|
|
@ -209,6 +222,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(this.drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
|
|
@ -242,6 +257,10 @@
|
|||
logger.Info($"抽屉打开失败");
|
||||
RestData();
|
||||
PortUtil.Operate = false;
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
|
|
@ -264,6 +283,11 @@
|
|||
}
|
||||
this.status = 3;
|
||||
PortUtil.Operate = false;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -301,6 +325,7 @@
|
|||
{
|
||||
cl.AddQuantity = this.AfterQuantity[cl.ColNo - 1] - this.BeforeQuantity[cl.ColNo - 1];
|
||||
});
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
// 判断是否为称重抽屉
|
||||
if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
|
||||
|
|
@ -309,7 +334,7 @@
|
|||
for (int i = 0; i < ColNos.Count; i++)
|
||||
{
|
||||
int afterQuantity = await PortUtil.CheckQuantityForSingle(ColNos[i]);
|
||||
AfterQuantity[ColNos[i]-1] = afterQuantity;
|
||||
AfterQuantity[ColNos[i] - 1] = afterQuantity;
|
||||
logger.Info($"AfterQuantity:{ColNos[i]}-{string.Join(",", AfterQuantity)}数量{string.Join(", ", BeforeQuantity)}");
|
||||
}
|
||||
channels.Where(cl => ColNos.Contains(cl.ColNo)).ToList().ForEach(cl =>
|
||||
|
|
@ -331,7 +356,7 @@
|
|||
);
|
||||
if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
|
|
@ -438,7 +463,7 @@
|
|||
if (channels.Any(cl => cl.AddQuantity != 0 && cl.DrugId != null && cl.drugManuNo != null))
|
||||
{
|
||||
// 保存账册、操作记录
|
||||
var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.AddQuantity != 0).ToList(), 1);
|
||||
var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.AddQuantity != 0).ToList(), 1, null, null);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
|
|
@ -480,7 +505,7 @@
|
|||
{
|
||||
// if (args.Data.BoardType.ToString().Contains("3"))
|
||||
// {
|
||||
// //是药盒抽屉则点击行,打开对应行的药箱
|
||||
// //是药盒抽屉则点击行,打开对应行的药盒
|
||||
// if (!ColNos.Contains(args.Data.ColNo))
|
||||
// {
|
||||
// ColNos.Add(args.Data.ColNo);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
|
|
@ -29,14 +29,14 @@
|
|||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-12" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
|
||||
<RadzenButton class="col-12" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<RadzenDataGrid @ref="grid"
|
||||
<RadzenDataGrid @ref="grid" Style="width:66vw; overflow:auto"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
|
|
@ -49,10 +49,52 @@
|
|||
<RadzenRow JustifyContent="JustifyContent.End">
|
||||
@if (status < 3)
|
||||
{
|
||||
<RadzenButton IsBusy="@(status>0)" BusyText="取药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="取药" Click="@OpenDrawer" />
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
|
||||
{
|
||||
|
||||
<RadzenButton IsBusy="@(status > 0)" BusyText="取空瓶中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="取空瓶" Click="@OpenDrawer" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenButton IsBusy="@(status > 0)" BusyText="取药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="取药" Click="@OpenDrawer" />
|
||||
}
|
||||
}
|
||||
@if (status == 3)
|
||||
{
|
||||
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
|
||||
{ }
|
||||
else
|
||||
{
|
||||
<RadzenLabel Text="入库药箱" Component="BoxList" />
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxColorList" TValue="BoxModel" Data="@BoxColorList" Value="BoxColor" Style="width: 7vw;"
|
||||
ValueChanged="@((args) => OnColorChanged(args))" AllowFiltering="false"
|
||||
AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
@((context as BoxModel).BoxNo == 1 ? "白" : (context as BoxModel).BoxNo == 3 ? "非常规" : "绿")
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxNo" Title="药箱颜色" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" Value="BoxNum" Style="width: 15vw;"
|
||||
ValueChanged="@((args) => OnBoxChanged(args))" AllowFilteringByAllStringColumns="true" TextProperty="药箱号">
|
||||
<Template>
|
||||
|
||||
@(
|
||||
(context as BoxModel).BoxName == 99 ? "急诊药盒" : (context as BoxModel).BoxName == 111 ? "恢复室药盒" :
|
||||
(context as BoxModel).BoxName == 31 ? "胃镜药盒" :
|
||||
(context as BoxModel).BoxName == 32 ? "导管药盒" :
|
||||
(context as BoxModel).BoxName == 33 ? "生殖药盒" :
|
||||
(context as BoxModel).BoxName == 34 ? "妇门药盒" : (context as BoxModel).BoxName + "-" + ((context as BoxModel).BoxNo == 1 ? "白" : "绿")
|
||||
)
|
||||
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
}
|
||||
<RadzenButton Visible="@CompleteIsEnable" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="完成" Click="@TakeFinish" />
|
||||
}
|
||||
@if (status > 0 && status <= 3)
|
||||
|
|
@ -62,25 +104,30 @@
|
|||
</RadzenRow>
|
||||
</HeaderTemplate>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
|
||||
<RadzenDataGridColumn Width="4vw" Title="库位" Property="ColNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="15vw" Title="药品名称" Property="Drug.DrugName">
|
||||
<Template Context="channel">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug.DrugName</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@channel.Drug.DrugSpec</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<RadzenDataGridColumn Width="15vw" Title="批次" Property="ManuNo">
|
||||
<Template Context="channel">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@channel.EffDate</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity">
|
||||
<RadzenDataGridColumn Title="库存" Width="10vw" Property="Quantity">
|
||||
<Template Context="channel">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Info" Size="ButtonSize.Medium" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@channel.Quantity.ToString()" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn MinWidth="120px" Title="取药数量" Property="TakeQuantity">
|
||||
<RadzenDataGridColumn MinWidth="15vw" Title="取药数量" Property="TakeQuantity">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
取药<br>数量
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<EditTemplate Context="channel">
|
||||
@if (channel.BoardType.ToString().Contains("2") || channel.BoardType.ToString().Contains("3"))
|
||||
{
|
||||
|
|
@ -103,6 +150,9 @@
|
|||
@inject PortUtil PortUtil;
|
||||
@inject NotificationService _message
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
int status = 0;
|
||||
int drawerNo = 1;
|
||||
RadzenDataGrid<ChannelStock> grid;
|
||||
|
|
@ -119,12 +169,33 @@
|
|||
bool CompleteIsEnable = true;
|
||||
bool CancleIsEnable = true;
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(DrawerTake));
|
||||
BoxModel BoxNum;
|
||||
|
||||
|
||||
BoxModel BoxColor;
|
||||
//全部药盒集合
|
||||
List<BoxModel> AllBoxList = new List<BoxModel>();
|
||||
//药盒集合
|
||||
List<BoxModel> BoxList = new List<BoxModel>();
|
||||
//药盒颜色集合
|
||||
List<BoxModel> BoxColorList = new List<BoxModel>()
|
||||
{
|
||||
new BoxModel{BoxNo=1,BoxName=1 },
|
||||
new BoxModel{BoxNo=2 ,BoxName=1},
|
||||
new BoxModel{BoxNo=3 ,BoxName=1}
|
||||
};
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(DrawerTake));
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
BoxColor = BoxColorList.FirstOrDefault();
|
||||
AllBoxList = await orderInfoDao.GetOperationNum(0);
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxNo == BoxColor.BoxNo && bl.BoxName <= 30).ToList();
|
||||
BoxNum = AllBoxList.FirstOrDefault();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
// var result = await channelListDao.GetChannelStockByDrawerNo(drawerNo, 1);
|
||||
var result = await channelListDao.GetChannelStockByDrawerNoWithDrawers(drawerNo, 1);
|
||||
DrawerNos = result.DrawerArray;
|
||||
|
|
@ -136,10 +207,30 @@
|
|||
|
||||
isLoading = false;
|
||||
}
|
||||
private async Task OnColorChanged(object value)
|
||||
{
|
||||
if ((((BoxModel)value).BoxNo) == 3)
|
||||
{
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxName > 30).ToList();
|
||||
BoxNum = BoxList.FirstOrDefault();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
BoxList = AllBoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName <= 30).ToList();
|
||||
BoxNum = BoxList.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
//药箱选中修改
|
||||
private async Task OnBoxChanged(object value)
|
||||
{
|
||||
// BoxList = BoxList.Where(bl => bl.BoxNo == ((BoxModel)value).BoxNo && bl.BoxName == ((BoxModel)value).BoxName).ToList();
|
||||
BoxNum = (BoxModel)value;
|
||||
}
|
||||
async Task OpenDrawer()
|
||||
{
|
||||
PortUtil.DrawerNo = this.drawerNo;
|
||||
this.status = 1;
|
||||
PortUtil.DrawerNo = this.drawerNo;
|
||||
// 根据抽屉类型来决定打开前是否需要查询数量
|
||||
var promiseUtil = new PromiseUtil<object>();
|
||||
await promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
|
||||
|
|
@ -156,6 +247,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single != null && setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(this.drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
|
|
@ -165,7 +258,15 @@
|
|||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
|
||||
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取空瓶");
|
||||
}
|
||||
else
|
||||
{
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,取药");
|
||||
}
|
||||
PortUtil.Operate = true;
|
||||
this.status = 2;
|
||||
next();
|
||||
|
|
@ -176,6 +277,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -190,7 +295,15 @@
|
|||
if (b)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"取药完成,请核对或录入正确的取出数量");
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
|
||||
{
|
||||
|
||||
PortUtil.SpeakAsync($"取空瓶完成,请核对或录入正确的取出数量");
|
||||
}
|
||||
else
|
||||
{
|
||||
PortUtil.SpeakAsync($"取药完成,请核对或录入正确的取出数量");
|
||||
}
|
||||
// 判断是否为称重抽屉
|
||||
if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
|
||||
{
|
||||
|
|
@ -200,6 +313,10 @@
|
|||
logger.Info($"关闭抽屉,称重抽屉获取稳定数量后日志");
|
||||
this.status = 3;
|
||||
PortUtil.Operate = false;
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -250,7 +367,7 @@
|
|||
for (int i = 0; i < ColNos.Count; i++)
|
||||
{
|
||||
int afterQuantity = await PortUtil.CheckQuantityForSingle(ColNos[i]);
|
||||
AfterQuantity[ColNos[i]-1] = afterQuantity;
|
||||
AfterQuantity[ColNos[i] - 1] = afterQuantity;
|
||||
logger.Info($"AfterQuantity:{ColNos[i]}-{afterQuantity}数量{string.Join(",", AfterQuantity)}");
|
||||
}
|
||||
if (!BeforeQuantity.SequenceEqual(AfterQuantity))
|
||||
|
|
@ -275,7 +392,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(this.drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
|
|
@ -392,9 +509,24 @@
|
|||
{
|
||||
if (channels.Any(cl => cl.TakeQuantity != 0))
|
||||
{
|
||||
|
||||
CheckInfo<ChannelList> checkInfo = null;
|
||||
// if(BoxNum!=null&&BoxNum.BoxNo!=0)
|
||||
// {
|
||||
// //查询本次加药的药盒里是否有绑该药,有则正常入库,无则提示无绑定不可添加
|
||||
// checkInfo = await channelListDao.CheckBoxDrugInfo(BoxNum, channels.Where(cl => cl.TakeQuantity != 0).ToList());
|
||||
// if (!string.IsNullOrEmpty(checkInfo.StrInfo))
|
||||
// {
|
||||
// _message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒中未绑定该批次药品无法添加", Duration = 4000 });
|
||||
// logger.Error($"该药盒中未绑定该批次药品无法添加,数据{JsonConvert.SerializeObject(channels)}");
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(drawerNo))
|
||||
{
|
||||
BoxNum = null;
|
||||
}
|
||||
// 保存账册、操作记录
|
||||
var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.TakeQuantity != 0).ToList(), 2);
|
||||
var b = await channelListDao.DrawerOperationFinish(channels.Where(cl => cl.TakeQuantity != 0).ToList(), 2, BoxNum, null);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
|
|
@ -434,7 +566,7 @@
|
|||
{
|
||||
// if (args.Data.BoardType.ToString().Contains("3"))
|
||||
// {
|
||||
// //是药盒抽屉则点击行,打开对应行的药箱
|
||||
// //是药盒抽屉则点击行,打开对应行的药盒
|
||||
// if (!ColNos.Contains(args.Data.ColNo))
|
||||
// {
|
||||
// ColNos.Add(args.Data.ColNo);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@page "/stock/drug"
|
||||
<style>
|
||||
.rz-custom-header {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -40,19 +40,19 @@
|
|||
</RadzenFieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-6 mb-4">
|
||||
<div class="col-6 mb-4" style="height:55vh;overflow:auto;">
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
@bind-Value="@SelectedDrugs"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((DrugInfo di)=>{OnDrugUpdateRow(di);})" RowCreate="@((DrugInfo di)=>{OnDrugCreateRow(di);})"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
LoadData="@LoadData"
|
||||
@bind-Value="@SelectedDrugs"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single" RowUpdate="@((DrugInfo di)=>{OnDrugUpdateRow(di);})" RowCreate="@((DrugInfo di)=>{OnDrugCreateRow(di);})"
|
||||
AllowPaging="true" PageSize="5" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Title="编码" Property="DrugId">
|
||||
<RadzenDataGridColumn Title="编码" Property="DrugId">
|
||||
<EditTemplate Context="drugInfo">
|
||||
<RadzenTextBox Name="DrugId" @bind-Value="drugInfo.DrugId" Style="width:100%; display: block;" />
|
||||
<RadzenRequiredValidator Text="请填写编码" Component="DrugId" Popup="true" />
|
||||
|
|
@ -61,19 +61,24 @@
|
|||
<RadzenDataGridColumn Width="200px" Title="药品名称" Property="DrugName">
|
||||
<EditTemplate Context="drugInfo">
|
||||
<RadzenTextBox Name="DrugName" @bind-Value="drugInfo.DrugName" Style="width:100%;display:block;" />
|
||||
<RadzenRequiredValidator Text="请填写药品名称" Component="DrugName" Popup="true"/>
|
||||
<RadzenRequiredValidator Text="请填写药品名称" Component="DrugName" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="规格" Property="DrugSpec">
|
||||
<EditTemplate Context="drugInfo">
|
||||
<RadzenTextBox Name="DrugSpec" @bind-Value="drugInfo.DrugSpec" Style="width:100%;display:block;" />
|
||||
<RadzenRequiredValidator Text="请填写规格" Component="DrugSpec" Popup="true"/>
|
||||
<RadzenRequiredValidator Text="请填写规格" Component="DrugSpec" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="200px" Title="厂家" Property="Manufactory">
|
||||
<RadzenDataGridColumn Width="150px" Title="厂家" Property="Manufactory">
|
||||
<EditTemplate Context="drugInfo">
|
||||
<RadzenTextBox Name="Manufactory" @bind-Value="drugInfo.Manufactory" Style="width:100%;display:block;" />
|
||||
<RadzenRequiredValidator Text="请填写厂家" Component="Manufactory" Popup="true"/>
|
||||
<RadzenRequiredValidator Text="请填写厂家" Component="Manufactory" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="导出使用报表" Property="PackH">
|
||||
<EditTemplate Context="drugInfo">
|
||||
<RadzenTextBox Name="PackH" @bind-Value="drugInfo.PackH" Style="width:100%;display:block;" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
|
||||
|
|
@ -102,52 +107,55 @@
|
|||
</RadzenCard> *@
|
||||
@if (SelectedDrugs.Count > 0)
|
||||
{
|
||||
<RadzenDataGrid @ref="ManusGrid" EmptyText="无数据"
|
||||
Data="@(SelectedDrugs.FirstOrDefault()?.Manus)"
|
||||
RowUpdate="@((DrugManuNo dm) => { OnUpdateRow(dm); })" RowCreate="@((DrugManuNo dm) => { OnCreateRow(dm); })"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false">
|
||||
@* <HeaderTemplate>
|
||||
|
||||
<div class="col-6 mb-4" style="height:55vh;width:550px;overflow:auto;">
|
||||
<RadzenDataGrid @ref="ManusGrid" EmptyText="无数据" ColumnWidth="100px" Style="width:445px"
|
||||
Data="@(SelectedDrugs.FirstOrDefault()?.Manus)"
|
||||
RowUpdate="@((DrugManuNo dm) => { OnUpdateRow(dm); })" RowCreate="@((DrugManuNo dm) => { OnCreateRow(dm); })"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false">
|
||||
@* <HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="添加" Variant="Variant.Outlined" />
|
||||
</RadzenRow>
|
||||
</HeaderTemplate> *@
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="序号" Property="index">
|
||||
<Template Context="data">
|
||||
@(SelectedDrugs.FirstOrDefault()?.Manus.IndexOf(data) + 1)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenTextBox Name="ManuNo" @bind-Value="drugManuNo.ManuNo" Style="width:100%; display: block;" />
|
||||
<RadzenRequiredValidator Text="请填写批次" Component="ManuNo" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate">
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="drugManuNo.EffDate" Style="width: 100%;" Name="EffDate" />
|
||||
<RadzenRequiredValidator Text="请填写效期" Component="EffDate" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="序号" Property="index" Width="25px" Visible=false>
|
||||
<Template Context="data">
|
||||
@(SelectedDrugs.FirstOrDefault()?.Manus.IndexOf(data) + 1)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo" Width="150px">
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenTextBox Name="ManuNo" @bind-Value="drugManuNo.ManuNo" Style="width:100%; display: block;" />
|
||||
<RadzenRequiredValidator Text="请填写批次" Component="ManuNo" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate" Width="150px">
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="drugManuNo.EffDate" Style="width: 100%;" Name="EffDate" />
|
||||
<RadzenRequiredValidator Text="请填写效期" Component="EffDate" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
|
||||
<RadzenDataGridColumn Context="drugManuNo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
|
||||
<Template Context="drugManuNo">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(drugManuNo))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeleteRow(drugManuNo))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
</Template>
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenButton Icon="check" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@((args) => SaveRow(drugManuNo))" aria-label="Save">
|
||||
</RadzenButton>
|
||||
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@((args) => CancelEdit(drugManuNo))" aria-label="Cancel">
|
||||
</RadzenButton>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeleteRow(drugManuNo))" aria-label="Delete">
|
||||
</RadzenButton>
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
<RadzenDataGridColumn Context="drugManuNo" Title="操作" Width="160px" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right">
|
||||
<Template Context="drugManuNo">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(drugManuNo))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeleteRow(drugManuNo))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
</Template>
|
||||
<EditTemplate Context="drugManuNo">
|
||||
<RadzenButton Icon="check" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@((args) => SaveRow(drugManuNo))" aria-label="Save">
|
||||
</RadzenButton>
|
||||
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@((args) => CancelEdit(drugManuNo))" aria-label="Cancel">
|
||||
</RadzenButton>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeleteRow(drugManuNo))" aria-label="Delete">
|
||||
</RadzenButton>
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
<div style="margin-top:5px">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增批次" />
|
||||
</div>
|
||||
|
|
@ -245,14 +253,14 @@
|
|||
async Task DeleteDrugRow(DrugInfo drugInfo)
|
||||
{
|
||||
Reset();
|
||||
if(!string.IsNullOrEmpty(drugInfo.DrugId))
|
||||
if (!string.IsNullOrEmpty(drugInfo.DrugId))
|
||||
{
|
||||
//弹出确认提示框
|
||||
var b = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
$"删除确认",
|
||||
new Dictionary<string, object>() { { "confirmInfo", "确认要删除药品:"+drugInfo.DrugName+"吗?" } },
|
||||
new Dictionary<string, object>() { { "confirmInfo", "确认要删除药品:" + drugInfo.DrugName + "吗?" } },
|
||||
new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
if(b)
|
||||
if (b)
|
||||
{
|
||||
// 数据库删除
|
||||
drugInfoDao.DeleteDrugInfo(drugInfo.DrugId);
|
||||
|
|
@ -266,7 +274,7 @@
|
|||
{
|
||||
var drugManuNo = new Pojo.DrugManuNo()
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
// Id = Guid.NewGuid().ToString(),
|
||||
DrugId = SelectedDrugs.FirstOrDefault().DrugId
|
||||
};
|
||||
SelectedDrugs.FirstOrDefault().Manus.Add(drugManuNo);
|
||||
|
|
@ -283,13 +291,15 @@
|
|||
}
|
||||
async Task SaveRow(DrugManuNo drugManuNo)
|
||||
{
|
||||
drugManuNo.Id = string.IsNullOrEmpty(drugManuNo.Id) ? Guid.NewGuid().ToString() : drugManuNo.Id;
|
||||
await ManusGrid.UpdateRow(drugManuNo);
|
||||
}
|
||||
|
||||
void CancelEdit(DrugManuNo drugManuNo)
|
||||
{
|
||||
Reset(drugManuNo);
|
||||
SelectedDrugs.FirstOrDefault().Manus.Remove(drugManuNo);
|
||||
// SelectedDrugs.FirstOrDefault().Manus.Remove(drugManuNo);
|
||||
SelectedDrugs.FirstOrDefault().Manus.RemoveAll(mn=>string.IsNullOrEmpty(mn.Id));
|
||||
ManusGrid.CancelEditRow(drugManuNo);
|
||||
ManusGrid.Reload();
|
||||
}
|
||||
|
|
@ -301,12 +311,12 @@
|
|||
if (SelectedDrugs.FirstOrDefault().Manus.Contains(drugManuNo))
|
||||
{
|
||||
//弹出确认提示框
|
||||
var b = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
$"确认删除",
|
||||
new Dictionary<string, object>() { { "confirmInfo", "确认要删除批次:"+drugManuNo.ManuNo+"吗?" } },
|
||||
new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if(b)
|
||||
var b = await dialogService.OpenAsync<ConfirmDialog>(
|
||||
$"确认删除",
|
||||
new Dictionary<string, object>() { { "confirmInfo", "确认要删除批次:" + drugManuNo.ManuNo + "吗?" } },
|
||||
new DialogOptions() { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false }
|
||||
);
|
||||
if (b)
|
||||
{
|
||||
SelectedDrugs.FirstOrDefault().Manus.Remove(drugManuNo);
|
||||
// 数据库删除
|
||||
|
|
@ -322,6 +332,7 @@
|
|||
}
|
||||
void OnUpdateRow(DrugManuNo dm)
|
||||
{
|
||||
dm.Id = string.IsNullOrEmpty(dm.Id) ? Guid.NewGuid().ToString() : dm.Id;
|
||||
Reset(dm);
|
||||
|
||||
// 数据库更新
|
||||
|
|
|
|||
|
|
@ -36,16 +36,28 @@
|
|||
.rz-gauge .rz-tick-text {
|
||||
fill: #ffffff !important;
|
||||
}
|
||||
|
||||
.warning-message {
|
||||
background: #ffeaa7;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
margin-bottom: 12px;
|
||||
display: block;
|
||||
animation: pulse 1.5s infinite;
|
||||
}
|
||||
</style>
|
||||
<RadzenStack Orientation="Orientation.Vertical" class="rz-background-color-primary-light" AlignItems="AlignItems.Center" Style="width:100vw;height:100vh" Gap="0">
|
||||
|
||||
<RadzenRow Style="width:100vw;height:25vh;" Gap="0" RowGap="0">
|
||||
<RadzenColumn Size="4">
|
||||
|
||||
<RadzenRow Style="height: 100%;width:100%" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenText Style="text-align:right;font-size:18px" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">@currentTime</RadzenText>
|
||||
</RadzenRow>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenRow Style="height: 100%;width:100%" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenColumn Size="6">
|
||||
@if (globalStateService.Operator != null)
|
||||
{
|
||||
//<RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">操作人:@globalStateService.Operator.NickName</RadzenText>
|
||||
|
|
@ -91,6 +103,12 @@
|
|||
</RadzenRow>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
@if (warnTime != 999999999 && warnTime != 0)
|
||||
{
|
||||
<div class="warning-message" id="warningMessage">
|
||||
<strong>警告:</strong> 您长时间未操作屏幕,系统将在 <span id="countdown">@warnTime</span> 秒后自动退出!
|
||||
</div>
|
||||
}
|
||||
<RadzenStack class="rz-background-color-info-lighter" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Style="width: 75vw;height: 57vh" Gap="20">
|
||||
|
||||
<RadzenStack Style="height: 100%;width:41%" Gap="20">
|
||||
|
|
@ -120,7 +138,8 @@
|
|||
}
|
||||
</RadzenStack>
|
||||
<RadzenStack class="home-menu rz-background-color-danger-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(6))" Style="height: 100%;width:50%">
|
||||
<RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">药箱管理</RadzenText>
|
||||
<RadzenText class="rz-color-white" Style="margin-top:10px;margin-bottom:-10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">药盒</RadzenText>
|
||||
<RadzenText class="rz-color-white" Style="margin-top:-10px;margin-bottom:10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">管理</RadzenText>
|
||||
@if (globalStateService.Operator != null)
|
||||
{
|
||||
@if (!globalStateService.Operator.role.permissionIds.Any(id => id - 60 > 0 && id - 60 < 10))
|
||||
|
|
@ -186,12 +205,14 @@
|
|||
private List<Premission> userPremissions { get; set; } = new();
|
||||
@inject GlobalStateService globalStateService;
|
||||
|
||||
Timer timer;
|
||||
@inject PortUtil _portUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(Home));
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
bool currentPage = true;
|
||||
|
||||
//退出时间
|
||||
int warnTime = 999999999;
|
||||
//当前时间
|
||||
string currentTime = DateTime.Now.ToString();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// timer = new Timer(state =>
|
||||
|
|
@ -220,15 +241,47 @@
|
|||
if (!_portUtil.Operate)
|
||||
{
|
||||
// 无人操作鼠标键盘
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
|
||||
{
|
||||
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
|
||||
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
|
||||
globalStateService.Operator.NickName = string.Empty;
|
||||
globalStateService.Operator = null;
|
||||
globalStateService.Reviewer = null;
|
||||
if (globalStateService.Reviewer != null)
|
||||
{
|
||||
globalStateService.Reviewer.NickName = string.Empty;
|
||||
globalStateService.Reviewer = null;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (setting.Value.warningMessage > 0)
|
||||
{
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > (setting.Value.autoOutLog - setting.Value.warningMessage) && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > (setting.Value.autoOutLog - setting.Value.warningMessage))
|
||||
{
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds <= (setting.Value.autoOutLog - setting.Value.warningMessage))
|
||||
{
|
||||
//提示3秒后将自动退出
|
||||
warnTime = Convert.ToInt32(setting.Value.autoOutLog - (DateTime.Now - _portUtil.dateTime).TotalSeconds);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
//提示3秒后将自动退出
|
||||
warnTime = Convert.ToInt32(setting.Value.autoOutLog - (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds);
|
||||
//提示3秒后将自动退出
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
warnTime = 999999999;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
logger.Info($"{setting.Value.autoOutLog}未自动退出{(DateTime.Now - _portUtil.dateTime).TotalSeconds}-{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds}");
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
|
@ -245,12 +298,27 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
var promiseUtilTime = new PromiseUtil<object>();
|
||||
promiseUtilTime.taskAsyncLoop(1000, null, async (data, next, stop) =>
|
||||
{
|
||||
|
||||
if (currentPage)
|
||||
{
|
||||
currentTime = DateTime.Now.ToString();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
next();
|
||||
}
|
||||
else
|
||||
{
|
||||
stop();
|
||||
}
|
||||
});
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
timer?.Dispose();
|
||||
}
|
||||
|
||||
async void init()
|
||||
|
|
|
|||
|
|
@ -41,12 +41,14 @@
|
|||
|
||||
if (firstRender)
|
||||
{
|
||||
#if DEBUG
|
||||
#else
|
||||
await Task.Delay(15);
|
||||
msg = "开始连接指纹模块";
|
||||
InvokeAsync(StateHasChanged);
|
||||
try
|
||||
{
|
||||
bool flag=await FingerprintUtil.ConnectionMain();
|
||||
bool flag = await FingerprintUtil.ConnectionMain();
|
||||
if (flag)
|
||||
{
|
||||
msg = "指纹模块连接成功";
|
||||
|
|
@ -56,12 +58,15 @@
|
|||
msg = "指纹模块连接失败";
|
||||
}
|
||||
InvokeAsync(StateHasChanged);
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "指纹模块连接失败";
|
||||
errMsg += "【指纹模块连接失败】";
|
||||
logger.Info($"指纹模块连接失败【{e.Message}】");
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
#endif
|
||||
await Task.Delay(500);
|
||||
msg = "开始连接抽屉串口";
|
||||
InvokeAsync(StateHasChanged);
|
||||
|
|
@ -71,10 +76,12 @@
|
|||
logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
|
||||
msg = "抽屉串口连接成功";
|
||||
InvokeAsync(StateHasChanged);
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "抽屉串口连接失败";
|
||||
errMsg += "【抽屉串口连接失败】";
|
||||
logger.Info($"抽屉串口连接失败【{e.Message}】");
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(500);
|
||||
|
|
@ -86,10 +93,29 @@
|
|||
logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
|
||||
msg = "CanBus模块连接成功";
|
||||
InvokeAsync(StateHasChanged);
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "CanBus模块连接失败";
|
||||
errMsg += "【CanBus模块连接失败】";
|
||||
logger.Info($"模块连接失败【{e.Message}】");
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(500);
|
||||
msg = "开始连接第二个CanBus模块";
|
||||
InvokeAsync(StateHasChanged);
|
||||
try
|
||||
{
|
||||
PortUtil.canBusSerialTwo.Open();
|
||||
logger.Info($"第二个CanBus模块打开结果【{PortUtil.canBusSerialTwo.IsOpen}】");
|
||||
msg = "CanBus模块连接成功";
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "第二个CanBus模块连接失败";
|
||||
logger.Info($"模块连接失败【{e.Message}】");
|
||||
errMsg += "【第二个CanBus模块连接失败】";
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(500);
|
||||
|
|
@ -101,10 +127,12 @@
|
|||
logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
|
||||
msg = "条码扫描模块连接成功";
|
||||
InvokeAsync(StateHasChanged);
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "条码扫描模块连接失败";
|
||||
errMsg += "【条码扫描模块连接失败】";
|
||||
errMsg += "【条码扫描模块连接失败】";
|
||||
logger.Info($"条码扫描模块打开结果【{e.Message}】");
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
if (portSetting.Value.fridgePortExist)
|
||||
|
|
@ -116,10 +144,11 @@
|
|||
msg = "冰箱串口连接成功";
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "冰箱串口打开失败";
|
||||
errMsg += "【冰箱串口打开失败】";
|
||||
logger.Info($"冰箱串口打开失败【{e.Message}】");
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
|
||||
<form onsubmit="@(() => grid.Reload())">
|
||||
<RadzenFieldset Text="²éѯ">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
|
|
@ -24,10 +24,10 @@
|
|||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="InvoiceDate" Style="width: 100%;" Name="InvoiceDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
<RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="ÖØÖÃ" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
|
@ -37,23 +37,31 @@
|
|||
</div>
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Title="单据号" Property="InvoiceNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="时间" Property="InvoiceDate"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="请领药房" Property="InPharmacyId"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="出库药房" Property="OutPharmacyId"></RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
RowSelect="@((InOutInvoice oi) => { InvoiceSelected(oi); })"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Title="单据号" Property="InvoiceNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="时间" Property="InvoiceDate"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="请领药房" Property="InPharmacyId">
|
||||
<Template Context="InPharmacyId">
|
||||
@(InPharmacyId.InPharmacyId == "0623" ? "麻醉科" : InPharmacyId.InPharmacyId)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="出库药房" Property="OutPharmacyId">
|
||||
<Template Context="OutPharmacyId">
|
||||
@(OutPharmacyId.OutPharmacyId == "070103" ? "药剂科" : OutPharmacyId.OutPharmacyId)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -66,7 +74,7 @@
|
|||
int count;
|
||||
private IEnumerable<InOutInvoice>? _forecasts;
|
||||
string InvoiceNo;
|
||||
DateTime InvoiceDate = DateTime.MinValue;
|
||||
DateTime InvoiceDate = DateTime.Now;
|
||||
|
||||
void OnCurrentDateChanged(DateTime args)
|
||||
{
|
||||
|
|
@ -107,7 +115,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,15 +24,69 @@
|
|||
<RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="库位" Property="DrawerNo">
|
||||
<RadzenDataGridColumn Title="库位" Property="DrawerNo" Width="6vw">
|
||||
<Template Context="s">
|
||||
@s.DrawerNo - @s.ColNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="入库数量" Property="AddQuantity">
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity" Width="6vw"></RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo" Filterable="false" Width="25vw">
|
||||
<Template Context="ManuNo">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@ManuNo.ManuNo</RadzenText>
|
||||
|
||||
@if (ManuNo.Quantity > 0)
|
||||
{
|
||||
<RadzenText TextStyle="TextStyle.Caption">
|
||||
@ManuNo.ManuNo
|
||||
</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
<EditTemplate Context="channel">
|
||||
@if (channel.Quantity == 0 && !String.IsNullOrEmpty(channel.DrugId))
|
||||
{
|
||||
<RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="channel.drugManuNo" Data="@channel.Drug?.Manus" Style="width:100%; display: block;">
|
||||
<Template>
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</Template>
|
||||
<ValueTemplate>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
|
||||
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
|
||||
}
|
||||
</RadzenStack>
|
||||
</ValueTemplate>
|
||||
</RadzenDropDown>
|
||||
<RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@channel.drugManuNo?.EffDate</RadzenText>
|
||||
}
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="入库数" Property="AddQuantity" Width="6vw">
|
||||
<EditTemplate Context="cs">
|
||||
<RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.AddQuantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
|
||||
|
|
@ -43,12 +97,16 @@
|
|||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="Invoice.DrugManuNo" Title="批次" />
|
||||
<RadzenDataGridColumn Property="Invoice.EffDate" Title="效期" />
|
||||
<RadzenDataGridColumn Property="Quantity" Title="请领数量" />
|
||||
<RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" Width="25vw" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" Width="6vw" />
|
||||
<RadzenDataGridColumn Property="Invoice.DrugManuNo" Title="批次" Width="10vw">
|
||||
<Template Context="ManuNo">
|
||||
@(ManuNo.Invoice.DrugManuNo == "X" ? "无" : ManuNo.Invoice.DrugManuNo)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Invoice.EffDate" Title="效期" Width="6vw" />
|
||||
<RadzenDataGridColumn Property="Quantity" Title="请领数量" Width="6vw" />
|
||||
<RadzenDataGridColumn Property="StockQuantity" Title="总库存" Width="6vw" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
|
|
@ -58,7 +116,7 @@
|
|||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
@if (status < 2)
|
||||
{
|
||||
<RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="status > 0" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="加药" Style="width: 120px" />
|
||||
<RadzenButton Click="@StartAdd" Disabled="!CanTakeDrug" IsBusy="@(status > 0)" BusyText="加药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="加药" Style="width: 120px" />
|
||||
}
|
||||
@if (status == 2)
|
||||
{
|
||||
|
|
@ -75,6 +133,7 @@
|
|||
@inject Radzen.DialogService dialogService;
|
||||
@inject IInOutInvoiceDao inOutInvoiceDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
|
||||
|
|
@ -114,6 +173,7 @@
|
|||
async Task CancelOpera()
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.Operate = false;
|
||||
status = 0;
|
||||
dialogService.Close(false);
|
||||
}
|
||||
|
|
@ -149,36 +209,49 @@
|
|||
{
|
||||
if (options._data == 0)
|
||||
{
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
}
|
||||
BeforeQuantity = new int[9];
|
||||
AfterQuantity = new int[9];
|
||||
int flag = 0;//抽屉对应库位无药位置亮灯指令只发一次
|
||||
for (int j = 0; j < data[index].ChannelStocks.Count; j++)
|
||||
{
|
||||
// _flagList.Add(flag);
|
||||
//单支-查数
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("2"))
|
||||
if (data[index].ChannelStocks[j].AddQuantity > 0)
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(data[index].ChannelStocks[j].DrawerNo);
|
||||
data[index].BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", data[index].BeforeQuantity)}】");
|
||||
// _flagList.Add(flag);
|
||||
//单支-查数
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("2"))
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(data[index].ChannelStocks[j].DrawerNo);
|
||||
data[index].BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", data[index].BeforeQuantity)}】");
|
||||
if (flag == 0)
|
||||
{
|
||||
await PortUtil.NoLightOnByCol(drawerNo, data[index].ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo).ToArray());
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
await PortUtil.NoLightOnByCol(drawerNo, data.Select(ot => ot.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo)).Cast<int>().ToArray());
|
||||
}
|
||||
//称重-查数
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("6"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[index].ChannelStocks[j].DrawerNo;// drawerNo;
|
||||
PortUtil.ColNoLst.Add(data[index].ChannelStocks[j].ColNo);
|
||||
}
|
||||
//称重-查数++
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("6"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[index].ChannelStocks[j].DrawerNo;// drawerNo;
|
||||
PortUtil.ColNoLst.Add(data[index].ChannelStocks[j].ColNo);
|
||||
|
||||
data[index].BeforeQuantity[data[index].ChannelStocks[j].ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[index].ChannelStocks[j].ColNo);
|
||||
logger.Info($"称重抽屉【{data[index].ChannelStocks[j].DrawerNo}】,开抽屉前检测数量【{string.Join(",", data[index].BeforeQuantity)}】");
|
||||
await Task.Delay(200);
|
||||
}
|
||||
//药盒-开药盒
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("3"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[index].ChannelStocks[j].DrawerNo;
|
||||
await PortUtil.OpenBoxByColNo(data[index].ChannelStocks[j].ColNo);
|
||||
await Task.Delay(200);
|
||||
data[index].BeforeQuantity[data[index].ChannelStocks[j].ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[index].ChannelStocks[j].ColNo);
|
||||
logger.Info($"称重抽屉【{data[index].ChannelStocks[j].DrawerNo}】,开抽屉前检测数量【{string.Join(",", data[index].BeforeQuantity)}】");
|
||||
await Task.Delay(200);
|
||||
}
|
||||
//药盒-开药盒
|
||||
if (data[index].ChannelStocks[j].BoardType.ToString().Contains("3"))
|
||||
{
|
||||
PortUtil.DrawerNo = data[index].ChannelStocks[j].DrawerNo;
|
||||
await PortUtil.OpenBoxByColNo(data[index].ChannelStocks[j].ColNo);
|
||||
await Task.Delay(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
var b = await PortUtil.OpenDrawerStatus(drawerNo);
|
||||
|
|
@ -187,6 +260,7 @@
|
|||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"{drawerNo}号抽屉已经打开,请,加药");
|
||||
options._data = 1;
|
||||
PortUtil.Operate = true;
|
||||
next();
|
||||
}
|
||||
else
|
||||
|
|
@ -195,7 +269,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -209,10 +286,6 @@
|
|||
if (b)
|
||||
{
|
||||
options._data = 0;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
}
|
||||
if (index == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
|
|
@ -224,68 +297,72 @@
|
|||
{
|
||||
for (int j = 0; j < data[i].ChannelStocks.Count; j++)
|
||||
{
|
||||
string flag = "关" + data[i].ChannelStocks[j].DrawerNo.ToString() + data[i].ChannelStocks[j].ColNo.ToString();
|
||||
|
||||
if (!_flagList.Contains(flag))
|
||||
if (data[i].ChannelStocks[j].AddQuantity > 0)
|
||||
{
|
||||
_flagList.Add(flag);
|
||||
//关闭抽屉后获取称重数量
|
||||
PortUtil.DrawerNo = data[i].ChannelStocks[j].DrawerNo;// drawerNo;
|
||||
// 判断是否为称重抽屉
|
||||
//单支-查数
|
||||
if (data[i].ChannelStocks[j].BoardType.ToString().Contains("6"))
|
||||
{
|
||||
PortUtil.ColNoLst = this.ColNos;
|
||||
string flag = "关" + data[i].ChannelStocks[j].DrawerNo.ToString() + data[i].ChannelStocks[j].ColNo.ToString();
|
||||
|
||||
AfterQuantity[data[i].ChannelStocks[j].ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStocks[j].ColNo);
|
||||
logger.Info($"称重抽屉,关抽屉后检测数量【{string.Join(",", AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStocks[j].ColNo - 1] - AfterQuantity[data[i].ChannelStocks[j].ColNo - 1];
|
||||
if (data[i].ChannelStocks[j].Quantity != WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1])
|
||||
{
|
||||
//称重自动计数数量与实际要取数量不一致弹出提示,确认后保存数据
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1]}】";
|
||||
|
||||
}
|
||||
}
|
||||
//单支-查数
|
||||
if (data[i].ChannelStocks[j].BoardType.ToString().Contains("2"))
|
||||
if (!_flagList.Contains(flag))
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStocks[j].ColNo - 1] - AfterQuantity[data[i].ChannelStocks[j].ColNo - 1];
|
||||
if (data[i].ChannelStocks[j].Quantity != WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1])
|
||||
_flagList.Add(flag);
|
||||
//关闭抽屉后获取称重数量
|
||||
PortUtil.DrawerNo = data[i].ChannelStocks[j].DrawerNo;// drawerNo;
|
||||
// 判断是否为称重抽屉
|
||||
//单支-查数
|
||||
if (data[i].ChannelStocks[j].BoardType.ToString().Contains("6"))
|
||||
{
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].ChannelStocks[j].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1]}】";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(alertMessage))
|
||||
{
|
||||
//弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
//弹出确认提示框
|
||||
var confirm = await dialogService.OpenAsync<ConfirmDialog>
|
||||
(
|
||||
$"保存确认",
|
||||
new Dictionary<string, object>
|
||||
() { { "confirmInfo", alertMessage } },
|
||||
new DialogOptions()
|
||||
{ Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
PortUtil.ColNoLst = this.ColNos;
|
||||
|
||||
if (!confirm)
|
||||
{
|
||||
RestData();
|
||||
logger.Info("取消保存");
|
||||
cancelFlag = true;
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
break;
|
||||
AfterQuantity[data[i].ChannelStocks[j].ColNo - 1] = await PortUtil.CheckQuantityForSingle(data[i].ChannelStocks[j].ColNo);
|
||||
logger.Info($"称重抽屉,关抽屉后检测数量【{string.Join(",", AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStocks[j].ColNo - 1] - AfterQuantity[data[i].ChannelStocks[j].ColNo - 1];
|
||||
if (data[i].ChannelStocks[j].Quantity != WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1])
|
||||
{
|
||||
//称重自动计数数量与实际要取数量不一致弹出提示,确认后保存数据
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1]}】";
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
//单支-查数
|
||||
if (data[i].ChannelStocks[j].BoardType.ToString().Contains("2"))
|
||||
{
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
AfterQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,关抽屉后检测数量【{string.Join(",", AfterQuantity)}】");
|
||||
WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1] = data[i].BeforeQuantity[data[i].ChannelStocks[j].ColNo - 1] - AfterQuantity[data[i].ChannelStocks[j].ColNo - 1];
|
||||
if (data[i].ChannelStocks[j].Quantity != WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1])
|
||||
{
|
||||
alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].ChannelStocks[j].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStocks[j].ColNo - 1]}】";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(alertMessage))
|
||||
{
|
||||
//弹出确认对话框
|
||||
alertMessage += "应取数与实际取出数不一致确认要保存吗?";
|
||||
//弹出确认提示框
|
||||
// var confirm = await dialogService.OpenAsync<ConfirmDialog>
|
||||
// (
|
||||
// $"保存确认",
|
||||
// new Dictionary<string, object>
|
||||
// () { { "confirmInfo", alertMessage } },
|
||||
// new DialogOptions()
|
||||
// { Width = "45vw", Resizable = true, Draggable = true, ShowClose = false });
|
||||
|
||||
// if (!confirm)
|
||||
// {
|
||||
// RestData();
|
||||
// logger.Info("取消保存");
|
||||
// cancelFlag = true;
|
||||
// // 关闭弹窗
|
||||
// dialogService.Close(false);
|
||||
// break;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// logger.Info(alertMessage);
|
||||
// }
|
||||
logger.Info(alertMessage);
|
||||
alertMessage = string.Empty;
|
||||
}
|
||||
alertMessage = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,6 +371,15 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
// 所有抽屉操作完成,断电单支抽屉
|
||||
for (int i = 0; i < drawerNos.Count; i++)
|
||||
{
|
||||
if (setting.Value.single.Contains(drawerNos[i]))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNos[i]);
|
||||
await Task.Delay(200);
|
||||
}
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -335,7 +421,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -343,6 +429,7 @@
|
|||
|
||||
void RestData()
|
||||
{
|
||||
PortUtil.Operate = false;
|
||||
this.status = 0;
|
||||
_flagList.Clear();
|
||||
this.ColNos.Clear();
|
||||
|
|
|
|||
|
|
@ -220,7 +220,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -234,10 +237,6 @@
|
|||
if (b)
|
||||
{
|
||||
options._data = 0;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
}
|
||||
|
||||
if (index == drawerNos.Count - 1)
|
||||
{
|
||||
|
|
@ -315,6 +314,10 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -365,7 +368,11 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@
|
|||
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
|
||||
globalStateService.Reviewer = user;
|
||||
logger.Info($"双人登录模式:操作人【{globalStateService.Operator.NickName}】复核人【{user.NickName}】登录");
|
||||
PortUtil.mouseClickTime = DateTime.Now;
|
||||
dialogService.Close(true);
|
||||
}
|
||||
else
|
||||
|
|
@ -137,6 +138,7 @@
|
|||
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
|
||||
globalStateService.Operator = user;
|
||||
logger.Info($"双人登录模式:操作人【{user.NickName}】复核人【{globalStateService.Reviewer.NickName}】登录");
|
||||
PortUtil.mouseClickTime = DateTime.Now;
|
||||
dialogService.Close(true);
|
||||
}
|
||||
else
|
||||
|
|
@ -161,6 +163,7 @@
|
|||
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
|
||||
globalStateService.Operator = user;
|
||||
logger.Info($"单人登录模式:用户【{user.NickName}】登录");
|
||||
PortUtil.mouseClickTime = DateTime.Now;
|
||||
dialogService.Close(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,17 @@
|
|||
</RadzenRadioButtonList>
|
||||
</RadzenStack> *@
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="4px">
|
||||
抽屉报警
|
||||
<RadzenRadioButtonList Value=@alert TValue="int" Change=@(args => alert = args)>
|
||||
<Items>
|
||||
<RadzenRadioButtonListItem Text="开启" Value="1" />
|
||||
<RadzenRadioButtonListItem Text="关闭" Value="0" />
|
||||
</Items>
|
||||
</RadzenRadioButtonList>
|
||||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</RadzenCard>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -40,12 +51,15 @@
|
|||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.setting> setting;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(LoginDialog));
|
||||
int loginValue = 1;
|
||||
//报警
|
||||
int alert = 0;
|
||||
// int preValue = 1;
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
|
@ -55,6 +69,15 @@
|
|||
//保存
|
||||
async Task SaveMethod()
|
||||
{
|
||||
//开抽屉时报警状态,发送指令
|
||||
if(alert==0)
|
||||
{
|
||||
await PortUtil.AlertClose();
|
||||
}
|
||||
else
|
||||
{
|
||||
await PortUtil.AlertOpen();
|
||||
}
|
||||
// 获取当前工作目录
|
||||
string currentDirectory = Directory.GetCurrentDirectory();
|
||||
// setting.Value.fridgeState = fridgeStateValue;
|
||||
|
|
@ -64,6 +87,7 @@
|
|||
string jsonString = File.ReadAllText(filePath);
|
||||
var jsonNode = JObject.Parse(jsonString);
|
||||
jsonNode["setting"]["loginMode"] = loginValue;
|
||||
jsonNode["setting"]["alert"] = alert;
|
||||
var options = new JsonSerializerOptions { WriteIndented = true };
|
||||
File.WriteAllText(filePath, jsonNode.ToString(Newtonsoft.Json.Formatting.Indented));
|
||||
_message.Notify(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<RadzenLabel Text="开始时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<RadzenLabel Text="结束时间" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
@* <RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
<RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
|
||||
</RadzenRow>
|
||||
</RadzenRow> *@
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject IChannelListDao channelListDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderDetailDialog));
|
||||
|
|
@ -126,6 +127,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
orderTakeVo.BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", orderTakeVo.BeforeQuantity)}】");
|
||||
|
|
@ -170,7 +173,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -193,7 +199,6 @@
|
|||
}
|
||||
});
|
||||
orderTakeVo.Status = 2;
|
||||
PortUtil.AllLightOff();
|
||||
if (options._data == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
|
|
@ -245,11 +250,15 @@
|
|||
if (!confirm)
|
||||
{
|
||||
RestData();
|
||||
logger.Info("取消保存");
|
||||
logger.Info("取消保存");
|
||||
// 关闭弹窗
|
||||
dialogService.Close(false);
|
||||
}
|
||||
}
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -277,7 +286,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Sex)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Overline" Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">年龄:</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(order?.Age)</b></RadzenText>
|
||||
|
||||
|
||||
</RadzenStack>
|
||||
<RadzenDataGrid @ref="grid" Data="@data" ExpandMode="DataGridExpandMode.Multiple"
|
||||
RowRender="@RowRender"
|
||||
|
|
@ -52,20 +52,20 @@
|
|||
<RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
@if(status < 2)
|
||||
@if (status < 2)
|
||||
{
|
||||
<RadzenButton Click="@OpenDrawer" Disabled="!CanReturnDrug" IsBusy="status > 0" BusyText="退药中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Text="退药" Style="width: 120px" />
|
||||
}
|
||||
@if(status == 2)
|
||||
@if (status == 2)
|
||||
{
|
||||
<RadzenButton Click="@TakeFinish" ButtonStyle="ButtonStyle.Success" Variant="Variant.Flat" Text="完成" Style="width: 120px" />
|
||||
}
|
||||
@if(status < 2)
|
||||
@if (status < 2)
|
||||
{
|
||||
<RadzenButton Click="@Cancel" Variant="Variant.Flat" Text="取消" Style="width: 120px" />
|
||||
}
|
||||
|
|
@ -168,8 +168,11 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"处方退药抽屉【{drawerNo}】打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
RestData();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
|
@ -182,15 +185,15 @@
|
|||
if (b)
|
||||
{
|
||||
options._data = 0;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
}
|
||||
if (index == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"退药完成,请,点击完成按钮进行确认");
|
||||
this.status = 2;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -232,7 +235,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
@ -252,7 +255,7 @@
|
|||
}
|
||||
async Task TakeFinish()
|
||||
{
|
||||
|
||||
|
||||
// 保存账册、操作记录
|
||||
var b = await orderInfoDao.OrderReturnFinish(data, order.OrderNo);
|
||||
if (!b)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
@page "/take/order"
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
|
|
@ -65,6 +64,7 @@
|
|||
@code {
|
||||
@inject IOrderInfoDao orderInfoDao;
|
||||
@inject DialogService dialogService;
|
||||
|
||||
RadzenDataGrid<OrderInfo> grid;
|
||||
bool isLoading;
|
||||
int count;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</div>
|
||||
<div class="col-6 mb-4">
|
||||
<div class="col-4 mb-4">
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
@bind-Value="@SelectedPlan"
|
||||
|
|
@ -37,14 +37,14 @@
|
|||
<RadzenRequiredValidator Text="请填写套餐名称" Component="Name" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
|
||||
@* <RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
|
||||
<EditTemplate Context="planInfo">
|
||||
<RadzenTextBox Name="Description" @bind-Value="planInfo.Description" Style="width:100%;display:block;" />
|
||||
<RadzenRequiredValidator Text="请填写套餐描述" Component="Description" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</RadzenDataGridColumn> *@
|
||||
|
||||
<RadzenDataGridColumn Context="planInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
|
||||
<RadzenDataGridColumn Context="planInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="5rem">
|
||||
<Template Context="planInfo">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditPlanRow(planInfo))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
|
|
@ -56,14 +56,14 @@
|
|||
</RadzenButton>
|
||||
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@((args) => CancelPlanEdit(planInfo))" aria-label="Cancel">
|
||||
</RadzenButton>
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeletePlanRow(planInfo))" aria-label="Delete">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeletePlanRow(planInfo))" aria-label="Delete">
|
||||
</RadzenButton>
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
<div class="col-6 mb-4">
|
||||
<div class="col-8 mb-4">
|
||||
<RadzenDataGrid @ref="PlanDetailsGrid" EmptyText="无数据"
|
||||
Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
|
||||
RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
|
||||
|
|
@ -76,12 +76,12 @@
|
|||
</RadzenRow>
|
||||
</HeaderTemplate> *@
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="序号" Property="index" Width="5rem">
|
||||
<RadzenDataGridColumn Title="序号" Property="index" Width="3rem">
|
||||
<Template Context="data">
|
||||
@(SelectedPlan.FirstOrDefault()?._PlanDetails.IndexOf(data) + 1)
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="药品" Property="_DrugInfo.DrugName" Width="25rem">
|
||||
<RadzenDataGridColumn Title="药品" Property="_DrugInfo.DrugName" Width="15rem">
|
||||
<Template Context="data">
|
||||
<RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugName)</b></RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugSpec)</b></RadzenText>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="名称" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugName" Title="名称" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
|
|
@ -101,13 +101,13 @@
|
|||
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="5rem">
|
||||
<RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="7rem">
|
||||
<EditTemplate Context="planDetails">
|
||||
<RadzenNumeric Name="BaseQuantity" @bind-Value="planDetails.BaseQuantity" Style="width:100%; display: block;" />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="BaseQuantity" Popup="true" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
|
||||
<RadzenDataGridColumn Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="9rem">
|
||||
<Template Context="planDetails">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(planDetails))" @onclick:stopPropagation="true">
|
||||
</RadzenButton>
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
<div style="margin-top:5px">
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增药品" />
|
||||
<RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增药品" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -146,8 +146,7 @@
|
|||
IList<Plan>? SelectedPlan { get; set; } = new List<Plan>();
|
||||
List<PlanDetails> SelectedPlanDetails = new List<PlanDetails>();
|
||||
List<DrugInfo> drugInfos;
|
||||
|
||||
|
||||
|
||||
|
||||
async Task LoadData(LoadDataArgs args)
|
||||
{
|
||||
|
|
@ -178,11 +177,14 @@
|
|||
planDao.UpdatePlanInfo(dl);
|
||||
grid.Reload();
|
||||
}
|
||||
void OnCreatePlanRow(Plan dl)
|
||||
async Task OnCreatePlanRow(Plan dl)
|
||||
{
|
||||
// 数据库添加套餐
|
||||
planDao.InsertPlanInfo(dl);
|
||||
SelectedPlan.Remove(dl);
|
||||
bool bFlag = await planDao.InsertPlanInfo(dl);
|
||||
if (!bFlag)
|
||||
{
|
||||
SelectedPlan.Remove(dl);
|
||||
}
|
||||
grid.Reload();
|
||||
}
|
||||
//新增套餐
|
||||
|
|
@ -294,7 +296,18 @@
|
|||
async Task EditRow(PlanDetails planDetail)
|
||||
{
|
||||
// planDetail.DrugId = null;
|
||||
|
||||
//查询要删除的药品是否有绑定且库存大于0
|
||||
if (!(await planDao.CheckPlanDetailBind(planDetail)))
|
||||
{
|
||||
_message.Notify(new NotificationMessage
|
||||
{
|
||||
Severity = NotificationSeverity.Error,
|
||||
Summary = "提示",
|
||||
Detail = "该药品有绑定且库存不为0,请先清库存",
|
||||
Duration = 4000
|
||||
});
|
||||
return;
|
||||
}
|
||||
await PlanDetailsGrid.EditRow(planDetail);
|
||||
}
|
||||
//保存修改药品
|
||||
|
|
@ -406,6 +419,7 @@
|
|||
{
|
||||
if (SelectedPlan.FirstOrDefault() != null)
|
||||
{
|
||||
|
||||
planDetail.PlanId = SelectedPlan.FirstOrDefault().Id;
|
||||
planDetail.DrugId = planDetail.DrugId == null ? planDetail._DrugInfo.DrugId : planDetail.DrugId;
|
||||
planDetail.UseState = 1;
|
||||
|
|
@ -444,6 +458,21 @@
|
|||
//新增药品
|
||||
async Task InsertRow()
|
||||
{
|
||||
//查询要删除的套餐下是否有绑定,且绑定有库存
|
||||
if (SelectedPlan.FirstOrDefault()!=null)
|
||||
{
|
||||
if (!(await planDao.CheckPlanBind((int)SelectedPlan.FirstOrDefault().Id)))
|
||||
{
|
||||
_message.Notify(new NotificationMessage
|
||||
{
|
||||
Severity = NotificationSeverity.Error,
|
||||
Summary = "提示",
|
||||
Detail = "该药品有绑定且库存不为0,请先清库存",
|
||||
Duration = 4000
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
var detail = new Pojo.PlanDetails()
|
||||
{
|
||||
PlanId = SelectedPlan.FirstOrDefault().Id
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
|
||||
<form onsubmit="@(() => grid.Reload())">
|
||||
<RadzenFieldset Text="查询">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<RadzenLabel Text="开始时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
|
|
@ -26,10 +26,10 @@
|
|||
<RadzenLabel Text="结束时间" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
<RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
|
||||
|
|
@ -40,48 +40,95 @@
|
|||
</RadzenFieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-12 mb-4">
|
||||
<div class="col-12 mb-4" style="height:50vh;overflow:auto">
|
||||
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
AllowRowSelectOnRowClick="true"
|
||||
CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="8" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Warning" Disabled="_forecasts == null || !_forecasts.Any(mr => mr.CurrentReturnQuantity > 0)" Variant="Variant.Outlined" Shade="Shade.Light" Text="归还" Click="@OpenReturnDialog" />
|
||||
</RadzenRow>
|
||||
</HeaderTemplate>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="借出数量" Property="Quantity"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
|
||||
<EditTemplate Context="mr">
|
||||
<RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
<RadzenDataGrid @ref="grid" Style="height:48vh;"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
AllowRowSelectOnRowClick="true"
|
||||
CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="8" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Warning" Disabled="_forecasts == null || !_forecasts.Any(mr => mr.CurrentReturnQuantity > 0)" Variant="Variant.Outlined" Shade="Shade.Light" Text="归还" Click="@OpenReturnDialog" />
|
||||
</RadzenRow>
|
||||
</HeaderTemplate>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="200px" Title="药品名称" Property="Drug.DrugName">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.Drug?.DrugName</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption">@mr.Drug?.DrugSpec</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="60px" Title="药盒" Property="OperationTime">
|
||||
<Template Context="mr">
|
||||
|
||||
@if (mr.BoxDrawer > 0)
|
||||
{
|
||||
if (mr.DrawerNo == 99)
|
||||
{
|
||||
<b class="rz-pr-3">@($"急诊药盒")</b>
|
||||
}
|
||||
else if (mr.DrawerNo == 111)
|
||||
{
|
||||
<b class="rz-pr-3">@($"恢复室药盒")</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
<b class="rz-pr-3">@($"{mr.DrawerNo}-{(mr.ColNo == 1 ? '白' : '绿')}")</b>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<b class="rz-pr-3">无</b>
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo" Width="123px">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="借出数量" Property="Quantity">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
借出<br>数量
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
已还<br>药品
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
已还<br>空瓶
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity" Width="90px">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
本次<br>归还
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<EditTemplate Context="mr">
|
||||
<RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,55 +7,61 @@
|
|||
@using log4net;
|
||||
|
||||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" JustifyContent="JustifyContent.SpaceBetween" Style="height: 100%;">
|
||||
|
||||
|
||||
<RadzenStack>
|
||||
|
||||
<RadzenDataGrid @ref="grid" Data="@data" ExpandMode="DataGridExpandMode.Multiple"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据" AllowAlternatingRows="false">
|
||||
|
||||
<Template Context="di">
|
||||
<RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
|
||||
<RadzenDataGrid @ref="grid" Data="@data" ExpandMode="DataGridExpandMode.Multiple"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据" AllowAlternatingRows="false">
|
||||
|
||||
<Template Context="di">
|
||||
<RadzenDataGrid Data="@di.ChannelStocks" EmptyText="无数据" @ref="di.Grid"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args, di.Grid))">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="库位" Property="DrawerNo">
|
||||
<Template Context="s">
|
||||
@s.DrawerNo - @s.ColNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Title="库位" Property="DrawerNo">
|
||||
<Template Context="s">
|
||||
@s.DrawerNo - @s.ColNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="库存" Property="Quantity"></RadzenDataGridColumn>
|
||||
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="效期" Property="EffDate"></RadzenDataGridColumn> *@
|
||||
<RadzenDataGridColumn Title="入库数量" Property="ReturnQuantity">
|
||||
<EditTemplate Context="cs">
|
||||
<RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.ReturnQuantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
|
||||
<RadzenCustomValidator Validator="@(() => di.ChannelStocks.Sum(cs2 => cs2.ReturnQuantity) == di.Quantity)" Component="Quantity" Text="入库总量应等于请领数量" Style="position: absolute;z-index: 9999;" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="ManuNo" Title="批次">
|
||||
<Template Context="ov">
|
||||
@ov.data.First().ManuNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="EffDate" Title="效期">
|
||||
<Template Context="ov">
|
||||
@ov.data.First().EffDate
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Quantity" Title="请领数量" />
|
||||
<RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
<RadzenDataGridColumn Title="入库数量" Property="ReturnQuantity">
|
||||
<EditTemplate Context="cs">
|
||||
<RadzenNumeric Disabled="status > 0" Style="display: block" Min="0" Max="@di.Quantity" Name="Quantity" @bind-Value=@cs.ReturnQuantity />
|
||||
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Max="@di.Quantity" Text="请填写正确的添加数量" Component="Quantity" />
|
||||
<RadzenCustomValidator Validator="@(() => di.ChannelStocks.Sum(cs2 => cs2.ReturnQuantity) == di.Quantity)" Component="Quantity" Text="入库总量应等于还药总数" Style="position: absolute;z-index: 9999;" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</Template>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
|
||||
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
|
||||
<RadzenDataGridColumn Property="ManuNo" Title="批次">
|
||||
<Template Context="ov">
|
||||
@ov.data.First().ManuNo
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="EffDate" Title="效期">
|
||||
<Template Context="ov">
|
||||
@ov.data.First().EffDate
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="Quantity" Title="还药总数">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: center;">
|
||||
还药<br>总数
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Property="StockQuantity" Title="总库存" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
|
||||
|
||||
|
||||
</RadzenStack>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem">
|
||||
@if (status < 2)
|
||||
|
|
@ -77,6 +83,7 @@
|
|||
@inject Radzen.DialogService dialogService;
|
||||
@inject IMachineRecordDao machineRecordDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
|
||||
|
|
@ -84,7 +91,7 @@
|
|||
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(InvoiceAddDialog));
|
||||
|
||||
|
||||
[Parameter] public List<MachineRecord> records { get; set; }
|
||||
private bool CanTakeDrug = true;
|
||||
int status = 0;
|
||||
|
|
@ -93,16 +100,17 @@
|
|||
|
||||
async Task StartAdd()
|
||||
{
|
||||
if(data.Any(it => it.Quantity != it.ChannelStocks.Sum(cs => cs.ReturnQuantity)))
|
||||
if (data.Any(it => it.Quantity != it.ChannelStocks.Sum(cs => cs.ReturnQuantity)))
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请填写正确的入库数量!", Duration = 4000 }
|
||||
);
|
||||
|
||||
} else
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await OpenDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async Task CancelOpera()
|
||||
|
|
@ -155,11 +163,13 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
|
||||
await PortUtil.NoLightOnByCol(drawerNo, data.Select(ot => ot.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo)).Cast<int>().ToArray());
|
||||
var colNo = data.Select(ot => ot.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).Select(cs => cs.ColNo));
|
||||
await PortUtil.NoLightOnByCol(drawerNo, colNo.SelectMany(x => x).ToArray());
|
||||
}
|
||||
var b = await PortUtil.OpenDrawerStatus(drawerNo);
|
||||
if (b)
|
||||
|
|
@ -175,7 +185,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -191,7 +204,7 @@
|
|||
options._data = 0;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
if (index == drawerNos.Count - 1)
|
||||
{
|
||||
|
|
@ -216,11 +229,14 @@
|
|||
|
||||
data.ForEach(cl =>
|
||||
{
|
||||
// cl.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).ToList().ForEach(cs =>
|
||||
// {
|
||||
// logger.Info($"单支抽屉【{drawerNo}】,应加药品数量【{cs.AddQuantity}】,现实加药数量【{AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1]}】");
|
||||
// });
|
||||
cl.ChannelStocks.Where(cs => cs.DrawerNo == drawerNo).ToList().ForEach(cs =>
|
||||
{
|
||||
logger.Info($"单支抽屉【{drawerNo}】,应加药品数量【{cs.AddQuantity}】,现实取数量【{AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1]}】");
|
||||
cl.ReturnQuantity = AfterQuantity[cs.ColNo - 1] - BeforeQuantity[cs.ColNo - 1];
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
next(); // continue iteration
|
||||
|
|
@ -233,13 +249,13 @@
|
|||
catch (Exception e)
|
||||
{
|
||||
RestData();
|
||||
logger.Info($"调拨加药发生错误,{e.Message}");
|
||||
logger.Info($"还药发生错误,{e.Message}");
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"发生错误,{e.Message}", Duration = 4000 }
|
||||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,46 +22,46 @@
|
|||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_returnEmptys"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
AllowRowSelectOnRowClick="true"
|
||||
CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="8" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Width="60px" Sortable="false" Filterable="false">
|
||||
<HeaderTemplate>
|
||||
选择
|
||||
</HeaderTemplate>
|
||||
<Template Context="LoadData">
|
||||
<RadzenCheckBox TriState="false" Value="@LoadData.IsSelected" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select item" }})"
|
||||
TValue="bool" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="数量" Property="Quantity"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
|
||||
<EditTemplate Context="mr">
|
||||
<RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
<div Style="height:50vh;overflow:auto;">
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@_returnEmptys"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
AllowRowSelectOnRowClick="true"
|
||||
CellClick="@((DataGridCellMouseEventArgs<MachineRecord> args) => OnCellClick(args))"
|
||||
AllowPaging="false" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Width="60px" Sortable="false" Filterable="false">
|
||||
<HeaderTemplate>
|
||||
选择
|
||||
</HeaderTemplate>
|
||||
<Template Context="LoadData">
|
||||
<RadzenCheckBox TriState="false" Value="@LoadData.IsSelected" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
|
||||
TValue="bool" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Frozen="true" Title="操作人" Property="OperatorUser.NickName"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Width="170px" Title="操作时间" Property="OperationTime"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="批次" Property="ManuNo">
|
||||
<Template Context="mr">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@mr.ManuNo</RadzenText>
|
||||
<RadzenText TextStyle="TextStyle.Caption"> @mr.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="数量" Property="Quantity"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还药品" Property="ReturnQuantity1"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="已还空瓶" Property="ReturnQuantity2"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="本次归还" Property="CurrentReturnQuantity">
|
||||
<EditTemplate Context="mr">
|
||||
<RadzenNumeric Min="0" Style="display: block" Max="@(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2)" Name="Quantity" @bind-Value=@mr.CurrentReturnQuantity />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem" Style="margin-top:15px;">
|
||||
@if (status < 2)
|
||||
{
|
||||
|
|
@ -82,6 +82,7 @@
|
|||
@inject Radzen.DialogService dialogService;
|
||||
@inject IMachineRecordDao machineRecordDao;
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
|
||||
|
|
@ -107,7 +108,7 @@
|
|||
var result = await machineRecordDao.getReturnEmptyInfoByRecords(records);
|
||||
// Update the Data property
|
||||
_returnEmptys = result.Desserts;
|
||||
emptyQuantity = _returnEmptys.Sum(it=>it.Quantity-it.ReturnQuantity1-it.ReturnQuantity2);
|
||||
emptyQuantity = _returnEmptys.Sum(it => it.Quantity - it.ReturnQuantity1 - it.ReturnQuantity2);
|
||||
// Update the count
|
||||
count = result.TotalDesserts;
|
||||
|
||||
|
|
@ -145,7 +146,7 @@
|
|||
int status = 0;
|
||||
async Task StartAdd()
|
||||
{
|
||||
if (_returnEmptys.Where(it => it.CurrentReturnQuantity>0).Count()<=0)
|
||||
if (_returnEmptys.Where(it => it.CurrentReturnQuantity > 0).Count() <= 0)
|
||||
{
|
||||
_message.Notify(
|
||||
new NotificationMessage { Style = "position: absolute; inset-inline-start: -1000px;", Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择药品!", Duration = 4000 }
|
||||
|
|
@ -195,6 +196,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉【{drawerNo}】,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
|
|
@ -215,7 +218,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -231,7 +237,7 @@
|
|||
options._data = 0;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"加药完成,请,点击完成按钮进行确认");
|
||||
|
|
@ -271,7 +277,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
@ -298,7 +304,7 @@
|
|||
else
|
||||
{
|
||||
// 关闭弹窗
|
||||
dialogService.Close(true);
|
||||
dialogService.Close(true);
|
||||
_message.Notify(new NotificationMessage { Style = "position: absolute; inset-inline-start: -1000px;", Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"还空瓶操作完成!", Duration = 4000 });
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<RadzenLabel Text="¿ªÊ¼Ê±¼ä" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<RadzenLabel Text="½áÊøÊ±¼ä" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
<RadzenLabel Text="处方时间" Component="OrderDate" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" CurrentDateChanged="@OnCurrentDateChanged"
|
||||
ShowTime="true" ShowSeconds="true"
|
||||
@bind-Value="orderInfo.OrderDate" Style="width: 100%;" Name="OrderDate" />
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged"
|
||||
ShowSeconds="true"
|
||||
@bind-Value="orderInfo.ChargeDate" Style="width: 100%;" Name="OrderDate" />
|
||||
<RadzenRequiredValidator Text="请输入处方时间" Component="OrderDate" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
|
@ -289,6 +289,6 @@
|
|||
|
||||
void OnCurrentDateChanged(DateTime args)
|
||||
{
|
||||
orderInfo.OrderDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
|
||||
orderInfo.ChargeDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
</RadzenStack>
|
||||
</RadzenStack>
|
||||
@code {
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject Radzen.DialogService dialogService;
|
||||
@inject NotificationService _message
|
||||
@inject PortUtil PortUtil;
|
||||
@inject ISelfTakeDao selfTakeDao;
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
int status;
|
||||
|
||||
[Parameter] public OrderInfo order { get; set; }
|
||||
[Parameter] public List<OrderDetail> orderDetails { get; set; }
|
||||
[Parameter] public List<OrderDetail> orderDetails { get; set; }
|
||||
|
||||
|
||||
private bool CanTakeDrug = true;
|
||||
|
|
@ -169,7 +169,10 @@
|
|||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"抽屉【{drawerNo}】打开失败,请检测硬件", Duration = 4000 }
|
||||
);
|
||||
logger.Info($"抽屉打开失败");
|
||||
PortUtil.AllLightOff();
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
}
|
||||
|
|
@ -193,7 +196,6 @@
|
|||
});
|
||||
PortUtil.Operate = false;
|
||||
orderTakeVo.Status = 2;
|
||||
PortUtil.AllLightOff();
|
||||
if (options._data == drawerNos.Count - 1)
|
||||
{
|
||||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
|
|
@ -250,6 +252,10 @@
|
|||
dialogService.Close(false);
|
||||
}
|
||||
}
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -291,7 +297,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff();
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
|
@ -312,7 +318,7 @@
|
|||
{
|
||||
|
||||
// 保存账册、操作记录
|
||||
var b = await selfTakeDao.OrderTakeFinish(data,order);
|
||||
var b = await selfTakeDao.OrderTakeFinish(data, order);
|
||||
if (!b)
|
||||
{
|
||||
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
|
||||
|
|
|
|||
|
|
@ -142,10 +142,10 @@
|
|||
@if (channel.DrugId == null || channel.Quantity == 0)
|
||||
{
|
||||
<RadzenDropDownDataGrid Change="@((args) => { channel.drugManuNo = null; })" AllowVirtualization="true" Name="@("Drug_" + channel.Id)" TValue="DrugInfo" @bind-Value="channel.Drug" Data="@drugInfos"
|
||||
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
|
||||
Style="width:260px; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
|
||||
<Columns>
|
||||
<RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" Sortable="false" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="名称" Sortable="false" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugName" Title="名称" Sortable="false" />
|
||||
<RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" Sortable="false" />
|
||||
</Columns>
|
||||
</RadzenDropDownDataGrid>
|
||||
|
|
@ -209,8 +209,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
//drugInfos = await drugInfoDao.GetAllDrug();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<style>
|
||||
.rz-custom-header {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<RadzenStack Orientation="Orientation.Horizontal">
|
||||
|
|
@ -17,27 +17,33 @@
|
|||
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
|
||||
@foreach (int i in DrawerNos)
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo !=i ? Variant.Outlined : Variant.Flat)" />
|
||||
|
||||
if (setting.Value.returnDrawer != null && setting.Value.returnDrawer.Contains(i))
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="true" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" Style="background-color: #d3d3d3;" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@* </RadzenStack> *@
|
||||
</div>
|
||||
</div>
|
||||
<RadzenDataGrid @ref="grid"
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@channels"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
LoadData="@LoadData"
|
||||
IsLoading="@isLoading"
|
||||
Count="@count"
|
||||
EmptyText="无数据"
|
||||
Data="@channels"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
|
||||
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
|
||||
<HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End">
|
||||
@if (status < 3)
|
||||
{
|
||||
<RadzenButton IsBusy="@(status>0)" BusyText="盘点中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="盘点" Click="@OpenDrawer" />
|
||||
<RadzenButton IsBusy="@(status > 0)" BusyText="盘点中。。。" ButtonStyle="ButtonStyle.Warning" Variant="Variant.Flat" Shade="Shade.Light" Text="盘点" Click="@OpenDrawer" />
|
||||
}
|
||||
@if (status == 3)
|
||||
{
|
||||
|
|
@ -117,6 +123,7 @@
|
|||
@inject PortUtil PortUtil;
|
||||
@inject NotificationService _message
|
||||
@inject IOptions<DrawerConfig> setting;
|
||||
@inject IOptions<PortConfig> portSetting;
|
||||
int status = 0;
|
||||
int drawerNo = 1;
|
||||
RadzenDataGrid<ChannelStock> grid;
|
||||
|
|
@ -167,6 +174,8 @@
|
|||
// 判断是否为单支抽屉
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.PowerOn(drawerNo);
|
||||
await Task.Delay(portSetting.Value.delayTime);
|
||||
byte[] quantity = await PortUtil.CheckQuantityByDrawer(this.drawerNo);
|
||||
BeforeQuantity = quantity.Select(it => Convert.ToInt32(it)).ToArray().Skip(3).Take(9).ToArray();
|
||||
logger.Info($"单支抽屉,开抽屉前检测数量【{string.Join(",", BeforeQuantity)}】");
|
||||
|
|
@ -201,6 +210,10 @@
|
|||
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
|
||||
PortUtil.SpeakAsync($"盘点完成,请,核对,或,录入,正确的,盘点数量");
|
||||
this.status = 3;
|
||||
if (setting.Value.single.Contains(drawerNo))
|
||||
{
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -215,6 +228,7 @@
|
|||
{
|
||||
cl.CheckQuantity = this.AfterQuantity[cl.ColNo - 1];// - this.BeforeQuantity[cl.ColNo - 1];
|
||||
});
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
next(); // continue iteration
|
||||
}
|
||||
|
|
@ -229,7 +243,7 @@
|
|||
);
|
||||
if (setting.Value.single.Contains(this.drawerNo))
|
||||
{
|
||||
PortUtil.AllLightOff();
|
||||
PortUtil.PowerOff(drawerNo);
|
||||
}
|
||||
RestData();
|
||||
stop();
|
||||
|
|
|
|||
|
|
@ -1,99 +1,124 @@
|
|||
@page "/stock/list"
|
||||
@using MasaBlazorApp3.Report
|
||||
@using Radzen.Blazor.Rendering
|
||||
<style>
|
||||
@@keyframes shake {
|
||||
0% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
0% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
|
||||
25% {
|
||||
opacity: 1;
|
||||
color: orange;
|
||||
}
|
||||
25% {
|
||||
opacity: 1;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0;
|
||||
color: yellow;
|
||||
}
|
||||
50% {
|
||||
opacity: 0;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
75% {
|
||||
opacity: 1;
|
||||
color: crimson;
|
||||
}
|
||||
75% {
|
||||
opacity: 1;
|
||||
color: crimson;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.rz-custom-header {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.shaky-text {
|
||||
animation: shake 2s infinite ease-in-out;
|
||||
/* 你可以根据需要调整动画的持续时间和迭代次数 */
|
||||
transition: color 0.5s linear,opacity 0.5s linear;
|
||||
animation: shake 2s infinite ease-in-out;
|
||||
/* 你可以根据需要调整动画的持续时间和迭代次数 */
|
||||
transition: color 0.5s linear,opacity 0.5s linear;
|
||||
}
|
||||
|
||||
.my-popup {
|
||||
display: none;
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
/* height: 360px; */
|
||||
width: 900px;
|
||||
border: var(--rz-panel-border);
|
||||
background-color: var(--rz-panel-background-color);
|
||||
box-shadow: var(--rz-panel-shadow);
|
||||
border-radius: var(--rz-border-radius);
|
||||
}
|
||||
</style>
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
<form onsubmit="@(() => grid.Reload())">
|
||||
<RadzenFieldset Text="查询">
|
||||
@* <form onsubmit="@(() => grid.Reload())">
|
||||
<RadzenFieldset Text="报表导出">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="开始时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="结束时间" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenLabel Text="药品名称/拼音码/编码" Component="drug" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
|
||||
Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="12">
|
||||
@* <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" /> *@
|
||||
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
<RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
|
||||
<RadzenButton @ref=button Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="@(args => popup2.ToggleAsync(button.Element))" />
|
||||
<Popup @ref=popup2 Lazy=true class="my-popup">
|
||||
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
|
||||
<RadzenFieldset Text="条件选择">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="开始" Component="Start" />
|
||||
<RadzenLabel Text="时间" Component="Start" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="4">
|
||||
<RadzenLabel Text="结束" Component="End" />
|
||||
<RadzenLabel Text="时间" Component="End" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8">
|
||||
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn Size="5">
|
||||
<RadzenLabel Text="药品名称" Component="drug" />
|
||||
<RadzenLabel Text="拼音码" Component="drug" />
|
||||
<RadzenLabel Text="编码" Component="drug" />
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="6">
|
||||
<RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
|
||||
Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
|
||||
<RadzenRow AlignItems="AlignItems.Center">
|
||||
<RadzenColumn>
|
||||
<RadzenButton Click="reloadGrid" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</RadzenStack>
|
||||
</Popup>
|
||||
</RadzenRow>
|
||||
</RadzenStack>
|
||||
</RadzenFieldset>
|
||||
</form>
|
||||
</form> *@
|
||||
</div>
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
<RadzenDataGrid @ref="grid"
|
||||
IsLoading="@isLoading"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
ExpandMode="DataGridExpandMode.Multiple">
|
||||
IsLoading="@isLoading"
|
||||
RowRender="@RowRender"
|
||||
EmptyText="无数据"
|
||||
Data="@_forecasts"
|
||||
AllowColumnResize="true" AllowAlternatingRows="false"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
ExpandMode="DataGridExpandMode.Single">
|
||||
@* <HeaderTemplate>
|
||||
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
||||
<RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
|
||||
|
|
@ -105,7 +130,39 @@
|
|||
<Columns>
|
||||
<RadzenDataGridColumn Title="库位" Property="DrawerNo">
|
||||
<Template Context="s">
|
||||
@s.DrawerNo - @s.ColNo
|
||||
@if (s.MachineId == "DM5")
|
||||
{
|
||||
switch (s.DrawerNo)
|
||||
{
|
||||
case 99:
|
||||
@("急诊药盒")
|
||||
break;
|
||||
case 111:
|
||||
@("恢复室药盒")
|
||||
break;
|
||||
case 31:
|
||||
@("胃镜药盒")
|
||||
break;
|
||||
case 32:
|
||||
@("导管药盒")
|
||||
break;
|
||||
case 33:
|
||||
@("生殖药盒")
|
||||
break;
|
||||
case 34:
|
||||
@("妇门药盒")
|
||||
break;
|
||||
default:
|
||||
@* @($"{s.DrawerNo}-{(s.ColNo == 1 ? '白' : '绿')}") *@
|
||||
@("常规神外药盒")
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{s.DrawerNo}-{s.ColNo}")
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="数量" Property="Quantity">
|
||||
|
|
@ -116,16 +173,16 @@
|
|||
@{
|
||||
DateTime dateTime;
|
||||
bool success = DateTime.TryParse(s.EffDate, out dateTime);
|
||||
if (success && dateTime <= DateTime.Now.AddMonths(3))
|
||||
{
|
||||
@s.EffDate
|
||||
// if (success && dateTime <= DateTime.Now.AddMonths(3))
|
||||
// {
|
||||
// @s.EffDate
|
||||
|
||||
<p class="shaky-text">近效期药品!</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@s.EffDate
|
||||
}
|
||||
// <p class="shaky-text">近效期药品!</p>
|
||||
// }
|
||||
// else
|
||||
//{
|
||||
@s.EffDate
|
||||
//}
|
||||
}
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
|
|
@ -137,16 +194,16 @@
|
|||
<RadzenDataGridColumn Title="规格" Property="DrugSpec"></RadzenDataGridColumn>
|
||||
<RadzenDataGridColumn Title="总库存" Property="StockQuantity">
|
||||
<Template Context="s">
|
||||
@if (s.StockQuantity < 10)
|
||||
@* @if (s.StockQuantity < 10)
|
||||
{
|
||||
@s.StockQuantity
|
||||
|
||||
<p class="shaky-text">库存预警!</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@s.StockQuantity
|
||||
}
|
||||
{ *@
|
||||
@s.StockQuantity
|
||||
@* } *@
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
|
||||
|
|
@ -166,7 +223,9 @@
|
|||
DateTime? end;
|
||||
|
||||
string drugName;
|
||||
RadzenButton button;
|
||||
|
||||
Popup popup2;
|
||||
IEnumerable<DrugInfo> drugInfo;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
|
@ -199,12 +258,12 @@
|
|||
}
|
||||
|
||||
|
||||
//库存导出
|
||||
async Task StockExport()
|
||||
{
|
||||
PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
|
||||
GridReportUtil.PrintReport("stock_template.grf", pageData);
|
||||
}
|
||||
// //库存导出
|
||||
// async Task StockExport()
|
||||
// {
|
||||
// PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
|
||||
// GridReportUtil.PrintReport("stock_template.grf", pageData);
|
||||
// }
|
||||
//专用账册导出
|
||||
async Task AccountBookExport()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[Column("id")]
|
||||
[Column("id", IsPrimaryKey = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MasaBlazorApp3.Pojo
|
||||
{
|
||||
public class Anaesthetist
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MasaBlazorApp3.Pojo
|
||||
{
|
||||
public class BoxModel
|
||||
{
|
||||
//库位号
|
||||
public int BoxNo { get; set; }
|
||||
//药箱号
|
||||
public int BoxName { get; set; }
|
||||
public string 药箱号 {
|
||||
get => BoxName + "-" + BoxNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
public string DrugId { get; set; }
|
||||
|
||||
[Column("chn_type")]
|
||||
public int DrawerType { get; set; }
|
||||
public int DrawerType { get; set; }
|
||||
|
||||
[Column("col_no1")]
|
||||
public int IsBox { get; set; }
|
||||
|
|
@ -45,12 +45,18 @@ namespace MasaBlazorApp3.Pojo
|
|||
public DrugInfo Drug { get; set; } = new();
|
||||
|
||||
//关联药品中的套餐信息表
|
||||
[Association(ThisKey =nameof(DrugId),OtherKey = nameof(Plan.Id))]
|
||||
public Plan PlanInfo { get; set; }=new();
|
||||
//手术室药箱中的库存总数
|
||||
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(Plan.Id))]
|
||||
public Plan PlanInfo { get; set; } = new();
|
||||
//手术室药盒中的库存总数
|
||||
[Column("stock_quantity")]
|
||||
public int TotalQuantity { get; set; }
|
||||
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(PlanDetails.PlanId))]
|
||||
public List<PlanDetails> _PlanDetails { get; set; } = new();
|
||||
//手术室药盒中的库存总数
|
||||
[Column(IsColumn = false)]
|
||||
public bool IsChecked{get;set;} = false;
|
||||
//手术室药盒中的库存总数
|
||||
[Column(IsColumn = false)]
|
||||
public bool BoxDisabled {get;set;} = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using LinqToDB.Mapping;
|
||||
using Mysqlx.Crud;
|
||||
|
||||
namespace MasaBlazorApp3.Pojo
|
||||
{
|
||||
|
|
@ -26,8 +27,11 @@ namespace MasaBlazorApp3.Pojo
|
|||
|
||||
[Column("quantity")]
|
||||
public int Quantity { get; set; }
|
||||
|
||||
[Column(IsColumn =false)]
|
||||
public int TotalQuantity { get; set; }
|
||||
|
||||
|
||||
//药盒DrawerType为非1时表示不在库
|
||||
[Column("drawer_type")]
|
||||
public int DrawerType { get; set; }
|
||||
|
||||
|
|
@ -53,7 +57,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
public int AddQuantity { get; set; } = 0;
|
||||
|
||||
[Column(IsColumn = false)]
|
||||
public int ReturnQuantity { get; set; }
|
||||
public int ReturnQuantity { get; set; } = 0;
|
||||
|
||||
[Column("dmnguid")]
|
||||
public string Dmnguid { get; set; }
|
||||
|
|
@ -61,6 +65,8 @@ namespace MasaBlazorApp3.Pojo
|
|||
[LinqToDB.Mapping.Association(ThisKey = nameof(Dmnguid), OtherKey = nameof(DrugManuNo.Id))]
|
||||
public DrugManuNo? drugManuNo { get; set; }
|
||||
|
||||
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugManuNo.DrugId))]
|
||||
public List<DrugManuNo> drugManuNoList { get; set; }=new List<DrugManuNo>();
|
||||
|
||||
[Column(IsColumn = false)]
|
||||
public string Location
|
||||
|
|
@ -77,17 +83,43 @@ namespace MasaBlazorApp3.Pojo
|
|||
[Column("Pos_No")]
|
||||
public int BiaoDingStatus { get; set; }
|
||||
|
||||
//手术室药箱中的药品基数
|
||||
//手术室药盒中的药品基数
|
||||
[Column("Check_Quantity")]
|
||||
public int BaseQuantity { get; set; }
|
||||
//手术室药箱中某药品全部批次的需要加药数
|
||||
//手术室药盒中某药品全部批次的需要加药数
|
||||
[Column("col_no2")]
|
||||
public int NeedQuantity { get; set; }
|
||||
//手术室药箱中某药品全部批次的已取药待入库数
|
||||
//手术室药盒中某药品全部批次的已取药待入库数
|
||||
[Column("col_no1")]
|
||||
public int AddToQuantity { get; set; }
|
||||
//手术室药箱中药品补药状态(1需补药2已补药待入库0满库状态)
|
||||
//手术室药盒中药品补药状态(1需补药2已补药待入库0满库状态)
|
||||
[Column("state")]
|
||||
public int BoxState { get; set; }
|
||||
[Column("fill_time")]
|
||||
public DateTime FillTime { get; set; }
|
||||
//药盒中药品对应的处方信息
|
||||
[Column(IsColumn =false)]
|
||||
public List<OrderInfo> OrderList { get; set; }
|
||||
//药盒中药品对应的选中的处方信息
|
||||
[Column(IsColumn =false)]
|
||||
public IList<OrderInfo> SelectedOrderList { get; set; }
|
||||
//还空瓶库位
|
||||
[Column(IsColumn = false)]
|
||||
public ChannelStock EmptyStock { get; set; }
|
||||
//还空瓶数
|
||||
[Column(IsColumn = false)]
|
||||
public int EmptyQuantity { get; set; } = 0;
|
||||
//用药数
|
||||
[Column(IsColumn =false)]
|
||||
public int UseQuantity { get; set; }
|
||||
//处方数
|
||||
[Column(IsColumn =false)]
|
||||
public int OrderQuantity { get; set; }
|
||||
//药盒中未绑套餐的药所在抽屉库位
|
||||
[Column(IsColumn =false)]
|
||||
public List<ChannelStock> DrawerChanneStockList { get; set; }
|
||||
//药盒中未绑套餐的药所在抽屉库位
|
||||
[Column(IsColumn = false)]
|
||||
public ChannelStock ReturnDrawerChanneStock { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ namespace MasaBlazorApp3.Pojo.Config
|
|||
public int[] weigh { get; set; }
|
||||
public int[] box { get; set; }
|
||||
public int[] label { get; set; }
|
||||
|
||||
public int[] returnDrawer { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,11 +17,20 @@ namespace MasaBlazorApp3.Pojo.Config
|
|||
public string canBusPortPath { get; set; }
|
||||
|
||||
public bool canBusExsit { get; set; }
|
||||
//抽屉总数量:8个抽屉与16个抽屉对应发单支指令不同,开抽屉指令也不同
|
||||
public int totalDrawerCount { get; set; }
|
||||
|
||||
public bool canBusTwoExsit { get; set; }
|
||||
public string canBusPortPathTwo { get; set; }
|
||||
public int doorAddr { get; set; }
|
||||
public int storageBoxAddr { get; set; }
|
||||
//存在冰箱串口
|
||||
public bool fridgePortExist { get; set; }
|
||||
//冰箱串口号
|
||||
public string fridgePortPath { get; set; }
|
||||
//储物箱串口
|
||||
public int StorageCan { get; set; }
|
||||
//延时间隔
|
||||
public int delayTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,23 @@ namespace MasaBlazorApp3.Pojo.Config
|
|||
{
|
||||
public string machineId { get; set; }
|
||||
public string storage { get; set; }
|
||||
//调拨入库时的in_Pharmacy_Id字段值与storage不一致不确定是传错了还是就两个值先加上这个配置
|
||||
public string inPharmacyId { get; set; }
|
||||
public int loginMode { get; set; }
|
||||
public bool opFirst { get; set; }
|
||||
//自动退出登录时间,单位秒(0不自动退出)
|
||||
public int autoOutLog { get; set; }
|
||||
//自动退出登录倒计时时间(0不倒计时)
|
||||
public int warningMessage { get; set; }
|
||||
//手术室药盒的设备id
|
||||
public string boxMachineId { get; set; }
|
||||
//手术室名称
|
||||
public string roomName { get; set; }
|
||||
//麻醉医师姓名
|
||||
public string anaesthetist_name { get; set; }
|
||||
public string boxColor { get; set; }
|
||||
//报警
|
||||
public int alert { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ namespace MasaBlazorApp3.Pojo
|
|||
public string PackUnit { get; set; }
|
||||
[Column("py_code")]
|
||||
public string PyCode { get; set; }
|
||||
[Column("pack_h")]
|
||||
public string PackH { get; set; }
|
||||
//用于标识“手术室患者麻醉药品使用登记本”报表中是否导出该药品 1导出0不导
|
||||
//[Column("pack_h")]
|
||||
//public int ReportType { get; set; }
|
||||
[Column(IsColumn =false)]
|
||||
public string DrugNameSpecManufactory
|
||||
{
|
||||
|
|
@ -49,7 +54,13 @@ namespace MasaBlazorApp3.Pojo
|
|||
[Column(IsColumn = false)]
|
||||
public int StockQuantity
|
||||
{
|
||||
get { return Stocks.Aggregate(0, (current, next) => current + next.Quantity); ; }
|
||||
get { return Stocks.Aggregate(0, (current, next) => current + next.Quantity); }
|
||||
}
|
||||
//药盒基数
|
||||
[Column(IsColumn = false)]
|
||||
public int BoxBaseQuantity
|
||||
{
|
||||
get { return Stocks.Aggregate(0, (current, next) => current+next.BaseQuantity);}
|
||||
}
|
||||
|
||||
public override bool Equals(object o)
|
||||
|
|
@ -64,6 +75,15 @@ namespace MasaBlazorApp3.Pojo
|
|||
return $"名称: {DrugName},规格:{DrugSpec}";
|
||||
}
|
||||
|
||||
[Column(IsColumn = false)]
|
||||
public string DrugNameSpec
|
||||
{
|
||||
get => DrugName + " ; " + DrugSpec + ";"+ Manufactory;
|
||||
}
|
||||
|
||||
[Column(IsColumn =false)]
|
||||
public string set_manu_no { get; set; }
|
||||
[Column(IsColumn =false)]
|
||||
public string set_eff_Date { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,5 +36,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
|
||||
return other?.DrugId == DrugId && other?.ManuNo == ManuNo;
|
||||
}
|
||||
[Column(IsColumn =false)]
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,5 +39,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
public string optState { get; set; }
|
||||
[Column("machine_id")]
|
||||
public string MachineId { get; set; }
|
||||
[Column("Remarks")]
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
using LinqToDB.Mapping;
|
||||
|
||||
namespace MasaBlazorApp3.Pojo
|
||||
{
|
||||
[Table("hkc_changeshifts_drug")]
|
||||
public class HkcChangeShiftsDetail
|
||||
{
|
||||
[Column("Id")]
|
||||
public int Id { get; set; }
|
||||
//交接班ID
|
||||
[Column("changeshifts_id")]
|
||||
public int ChangeshiftsId { get; set; }
|
||||
//药品ID
|
||||
[Column("drug_id")]
|
||||
public string DrugId { get; set; }
|
||||
//实物数
|
||||
[Column("RealNumber")]
|
||||
public int RealNumber { get; set; }
|
||||
//处方数
|
||||
[Column("orderNumber")]
|
||||
public int OrderNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -72,7 +72,8 @@ namespace MasaBlazorApp3.Pojo
|
|||
[Column("eff_date")]
|
||||
public DateTime? EffDate { get; set; }
|
||||
/// <summary>
|
||||
/// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药箱移出移入,69药箱药品替换,55药箱套餐绑定解绑)
|
||||
/// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药盒移出移入,69药盒药品替换,)
|
||||
/// 50添加套餐;51删除套餐;52向套餐中添加药品;53修改套餐中的药品;54删除套餐中的药品;55药盒套餐绑定;56药盒套餐解绑,
|
||||
///</summary>
|
||||
[Column("type")]
|
||||
public int Type { get; set; }
|
||||
|
|
@ -145,5 +146,25 @@ namespace MasaBlazorApp3.Pojo
|
|||
{
|
||||
get => DrawerNo + "-" + ColNo;
|
||||
}
|
||||
public static MachineRecord Build(MachineRecord machineRecord,DrugInfo drug,User user)
|
||||
{
|
||||
if(machineRecord!=null)
|
||||
{
|
||||
machineRecord.Drug = drug;
|
||||
machineRecord.OperatorUser = user;
|
||||
|
||||
}
|
||||
return machineRecord;
|
||||
}
|
||||
/// <summary>
|
||||
/// 药盒号
|
||||
///</summary>
|
||||
[Column("Box_Drawer")]
|
||||
public int? BoxDrawer { get; set; }
|
||||
/// <summary>
|
||||
/// 药盒号
|
||||
///</summary>
|
||||
[Column("Box_ColNo")]
|
||||
public int? BoxColNo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ namespace MasaBlazorApp3.Pojo
|
|||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[Column("order_id")]
|
||||
public string OrderId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[Column("order_no")]
|
||||
public string OrderNo { get; set; }
|
||||
/// <summary>
|
||||
|
|
@ -52,6 +57,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
|
||||
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugInfo.DrugId))]
|
||||
public DrugInfo Drug { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
|
|
@ -129,5 +135,16 @@ namespace MasaBlazorApp3.Pojo
|
|||
///</summary>
|
||||
[Column("use_dosage")]
|
||||
public string UseDosage { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// 默认值: NULL
|
||||
///</summary>
|
||||
[Column(IsColumn = false)]
|
||||
public int? TotalQuantity { get; set; } = null;
|
||||
|
||||
[LinqToDB.Mapping.Association(ThisKey = nameof(SetManuNo), OtherKey = nameof(DrugManuNo.ManuNo))]
|
||||
public DrugManuNo? drugManuNo { get; set; }
|
||||
[Column(IsColumn =false)]
|
||||
public string DrugName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -147,21 +147,43 @@ namespace MasaBlazorApp3.Pojo
|
|||
///</summary>
|
||||
[Column("win_no")]
|
||||
public int WinNo { get; set; } = 0;
|
||||
///// <summary>
|
||||
/////
|
||||
///// 默认值: 0
|
||||
/////</summary>
|
||||
//[Column("state")]
|
||||
//public int state { get; set; } = 0;
|
||||
/// <summary>
|
||||
///
|
||||
/// 默认值: 0
|
||||
///</summary>
|
||||
[Column("state")]
|
||||
public int state { get; set; } = 0;
|
||||
|
||||
//[Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
|
||||
//public List<OrderDetail> DetailList { get; set; } = new();
|
||||
|
||||
|
||||
[Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
|
||||
public List<OrderDetail> DetailList { get; set; } = new();
|
||||
public OrderDetail DetailInfo { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
[Column(IsColumn =false)]
|
||||
public bool ItemIsChecked { get; set; }
|
||||
[Column(IsColumn = false)]
|
||||
public bool ItemIsChecked { get; set; } = true;
|
||||
/// <summary>
|
||||
/// 是否全先中
|
||||
/// </summary>
|
||||
[Column(IsColumn = false)]
|
||||
public bool AllItemIsChecked { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 麻醉师
|
||||
///</summary>
|
||||
[Column("anaesthetist_name")]
|
||||
public string anaesthetistName { get; set; }
|
||||
/// <summary>
|
||||
/// 手术室
|
||||
///</summary>
|
||||
[Column("op_room_name")]
|
||||
public string RoomName { get; set; }
|
||||
//药盒中药品对应的选中的处方信息
|
||||
[Column(IsColumn = false)]
|
||||
public IList<OrderInfo> SelectedOrderList { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -33,5 +33,8 @@ namespace MasaBlazorApp3.Pojo
|
|||
//审核人
|
||||
[Column("reviewerUser")]
|
||||
public int ReviewerUser { get; set; }
|
||||
|
||||
[Column("machine_id")]
|
||||
public string MachineId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,30 +34,30 @@ namespace MasaBlazorApp3.Pojo
|
|||
PremissionPath = "take"
|
||||
};
|
||||
|
||||
q.AddChild(new Premission()
|
||||
{
|
||||
Id = 11,
|
||||
PremissionName = "处方取药",
|
||||
PremissionPath = "/take/order"
|
||||
});
|
||||
q.AddChild(new Premission()
|
||||
{
|
||||
Id = 12,
|
||||
PremissionName = "调拨取药",
|
||||
PremissionPath = "/take/invoice"
|
||||
});
|
||||
//q.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 11,
|
||||
// PremissionName = "处方取药",
|
||||
// PremissionPath = "/take/order"
|
||||
//});
|
||||
//q.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 12,
|
||||
// PremissionName = "调拨取药",
|
||||
// PremissionPath = "/take/invoice"
|
||||
//});
|
||||
q.AddChild(new Premission()
|
||||
{
|
||||
Id = 13,
|
||||
PremissionName = "抽屉取药",
|
||||
PremissionPath = "/take/drawer"
|
||||
});
|
||||
q.AddChild(new Premission()
|
||||
{
|
||||
Id = 14,
|
||||
PremissionName = "自选取药",
|
||||
PremissionPath = "/take/self"
|
||||
});
|
||||
//q.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 14,
|
||||
// PremissionName = "自选取药",
|
||||
// PremissionPath = "/take/self"
|
||||
//});
|
||||
q.AddChild(new Premission()
|
||||
{
|
||||
Id = 15,
|
||||
|
|
@ -102,24 +102,24 @@ namespace MasaBlazorApp3.Pojo
|
|||
PremissionPath = "return"
|
||||
};
|
||||
|
||||
h.AddChild(new Premission()
|
||||
{
|
||||
Id = 31,
|
||||
PremissionName = "归还药品(处方)",
|
||||
PremissionPath = "/return/order"
|
||||
});
|
||||
h.AddChild(new Premission()
|
||||
{
|
||||
Id = 32,
|
||||
PremissionName = "归还药品(记录)",
|
||||
PremissionPath = "/return/byRecord"
|
||||
});
|
||||
h.AddChild(new Premission()
|
||||
{
|
||||
Id = 33,
|
||||
PremissionName = "归还空瓶",
|
||||
PremissionPath = "/return/empty"
|
||||
});
|
||||
//h.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 31,
|
||||
// PremissionName = "归还药品(处方)",
|
||||
// PremissionPath = "/return/order"
|
||||
//});
|
||||
//h.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 32,
|
||||
// PremissionName = "归还药品(记录)",
|
||||
// PremissionPath = "/return/byRecord"
|
||||
//});
|
||||
//h.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 33,
|
||||
// PremissionName = "归还空瓶",
|
||||
// PremissionPath = "/return/empty"
|
||||
//});
|
||||
h.AddChild(new Premission()
|
||||
{
|
||||
Id = 34,
|
||||
|
|
@ -171,12 +171,12 @@ namespace MasaBlazorApp3.Pojo
|
|||
PremissionName = "药品信息",
|
||||
PremissionPath = "/stock/drug"
|
||||
});
|
||||
k.AddChild(new Premission()
|
||||
{
|
||||
Id = 46,
|
||||
PremissionName = "药品标定",
|
||||
PremissionPath = "/stock/biaoDing"
|
||||
});
|
||||
//k.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 46,
|
||||
// PremissionName = "药品标定",
|
||||
// PremissionPath = "/stock/biaoDing"
|
||||
//});
|
||||
k.AddChild(new Premission()
|
||||
{
|
||||
Id = 47,
|
||||
|
|
@ -231,31 +231,31 @@ namespace MasaBlazorApp3.Pojo
|
|||
//x.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 55,
|
||||
// PremissionName = "绑定药箱",
|
||||
// PremissionName = "绑定药盒",
|
||||
// PremissionPath = "/Box/BoxBindings"
|
||||
//});
|
||||
//x.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 56,
|
||||
// PremissionName = "药箱核对",
|
||||
// PremissionName = "药盒核对",
|
||||
// PremissionPath = "/Box/Check"
|
||||
//});
|
||||
//x.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 57,
|
||||
// PremissionName = "药箱加药",
|
||||
// PremissionName = "药盒加药",
|
||||
// PremissionPath = "/Box/BoxAdd"
|
||||
//});
|
||||
//x.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 58,
|
||||
// PremissionName = "药箱入库",
|
||||
// PremissionName = "药盒入库",
|
||||
// PremissionPath = "/Box/BoxAddBox"
|
||||
//});
|
||||
//x.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 59,
|
||||
// PremissionName = "药箱库存",
|
||||
// PremissionName = "药盒库存",
|
||||
// PremissionPath = "/Box/BoxStock"
|
||||
//});
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
Premission b = new Premission
|
||||
{
|
||||
Id = 6,
|
||||
PremissionName = "药箱管理",
|
||||
PremissionName = "药盒管理",
|
||||
PremissionPath = "Box"
|
||||
};
|
||||
b.AddChild(new Premission()
|
||||
|
|
@ -275,33 +275,33 @@ namespace MasaBlazorApp3.Pojo
|
|||
b.AddChild(new Premission()
|
||||
{
|
||||
Id = 62,
|
||||
PremissionName = "绑定药箱",
|
||||
PremissionName = "绑定药盒",
|
||||
PremissionPath = "/Box/BoxBindings"
|
||||
});
|
||||
b.AddChild(new Premission()
|
||||
{
|
||||
Id = 63,
|
||||
PremissionName = "药箱核对",
|
||||
PremissionName = "药盒核对",
|
||||
//PremissionName = "盘点交接",
|
||||
PremissionPath = "/Box/Check"
|
||||
});
|
||||
b.AddChild(new Premission()
|
||||
{
|
||||
Id = 66,
|
||||
PremissionName = "药箱加药",
|
||||
PremissionName = "药盒加药",
|
||||
//PremissionPath = "/stock/checkRecord"
|
||||
PremissionPath = "/Box/BoxAdd"
|
||||
});
|
||||
b.AddChild(new Premission()
|
||||
{
|
||||
Id = 65,
|
||||
PremissionName = "药箱入库",
|
||||
PremissionPath = "/Box/BoxAddBox"
|
||||
});
|
||||
//b.AddChild(new Premission()
|
||||
//{
|
||||
// Id = 65,
|
||||
// PremissionName = "药盒入库",
|
||||
// PremissionPath = "/Box/BoxAddBox"
|
||||
//});
|
||||
b.AddChild(new Premission()
|
||||
{
|
||||
Id = 66,
|
||||
PremissionName = "药箱库存",
|
||||
PremissionName = "药盒库存",
|
||||
PremissionPath = "/Box/BoxStock"
|
||||
});
|
||||
list.Add(q);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -25,7 +26,7 @@ namespace MasaBlazorApp3.Pojo
|
|||
// 出库数量
|
||||
public int OutQuantity { get; set; } = 0;
|
||||
//批号结存
|
||||
//public int ManuQuantity { get; set; } = 0;
|
||||
public int ManuQuantity { get; set; } = 0;
|
||||
|
||||
//总结存
|
||||
public int StockQuantity { get; set; } = 0;
|
||||
|
|
@ -48,10 +49,16 @@ namespace MasaBlazorApp3.Pojo
|
|||
public string Manufactory { get; set; } = string.Empty;
|
||||
//凭证号
|
||||
public string InvoiceId { get; set; } = string.Empty;
|
||||
////供应单位
|
||||
//////供应单位
|
||||
//public string SupplierDept { get;set; } = string.Empty;
|
||||
////领用部门
|
||||
//public string ReceiveDept { get; set; } = string.Empty;
|
||||
//////领用部门
|
||||
//public string ReceiveDept { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
///供应单位(领用部门)
|
||||
/// </summary>
|
||||
public string department { get; set; } = string.Empty;
|
||||
//备注
|
||||
public string Remarks { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class ReportStockDateInfo
|
||||
|
|
@ -83,4 +90,71 @@ namespace MasaBlazorApp3.Pojo
|
|||
//数量
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
//手术室患者麻醉药品使用登记本
|
||||
public class ReportUsageParentDateInfo
|
||||
{
|
||||
//药品ID
|
||||
public string drugId1 { get; set; }
|
||||
//药品名称
|
||||
public string drugName1 { get; set; }
|
||||
//批次
|
||||
public string manuNo1 { get; set; }
|
||||
//数量
|
||||
public int quantity1 { get; set; }
|
||||
//日期
|
||||
public DateTime portDate { get; set; }
|
||||
}
|
||||
//手术室患者麻醉药品使用登记本
|
||||
public class ReportUsageDateInfo
|
||||
{
|
||||
//日期
|
||||
public DateTime portdate { get; set; }
|
||||
//手术间
|
||||
public int ShouShuJian { get; set; }
|
||||
//主麻
|
||||
public string doctor1 { get; set; }
|
||||
//副麻
|
||||
public string doctor2 { get; set; }
|
||||
//ID号
|
||||
public string patientId { get; set; }
|
||||
//患者姓名
|
||||
public string PName { get; set; }
|
||||
public string Diagnose { get; set; }
|
||||
//药品ID
|
||||
public string DrugId { get; set; }
|
||||
//药品名称
|
||||
public string DrugName { get; set; }
|
||||
//批次
|
||||
public string ManuNo { get; set; }
|
||||
//使用量
|
||||
public string UsageDosage { get; set; }
|
||||
//残液量
|
||||
public string CanYeLiang { get; set; }
|
||||
//残液处置方式
|
||||
public string CanYeChuZhi { get; set; }
|
||||
//使用人姓名
|
||||
public string UseUserName { get; set; }
|
||||
//核对人姓名
|
||||
public string CheckUserName { get; set; }
|
||||
//数量
|
||||
public int quantity { get; set; }
|
||||
}
|
||||
//请领报表信息
|
||||
public class ReportApplyInfo
|
||||
{
|
||||
//手术间
|
||||
public int BoxNum { get; set; }
|
||||
//请领时间
|
||||
public DateTime ApplyDate { get; set; }
|
||||
//麻醉医生 一线
|
||||
public string UserFirst { get; set; }
|
||||
//麻醉医生 二线
|
||||
public string UserSecond { get; set; }
|
||||
//药品ID
|
||||
public string DrugId { get; set; }
|
||||
//医生签名
|
||||
public string Doctor { get; set; }
|
||||
//管理者签名
|
||||
public string Manager { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MasaBlazorApp3.Pojo
|
||||
{
|
||||
public class ReturnChannelStock
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ namespace MasaBlazorApp3.Pojo
|
|||
public string Icon { get; set; }
|
||||
[Column("Path")]
|
||||
public string Path { get; set; }
|
||||
//使用状态1在用;0不在用
|
||||
[Column("UseStatus")]
|
||||
public int UseStatus { get; set; }
|
||||
[Column(IsColumn = false)]
|
||||
public List<SettingManu> Children { get; set; } = new();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ using MasaBlazorApp3.Pojo.Config;
|
|||
using Microsoft.Extensions.Options;
|
||||
using LinqToDB.Common;
|
||||
using MasaBlazorApp3.Util;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MasaBlazorApp3.Port
|
||||
{
|
||||
|
|
@ -29,6 +30,8 @@ namespace MasaBlazorApp3.Port
|
|||
public SerialPort drawerSerial;
|
||||
// can总线串口
|
||||
public SerialPort canBusSerial;
|
||||
// can总线串口
|
||||
public SerialPort canBusSerialTwo;
|
||||
|
||||
// 条码枪串口
|
||||
public SerialPort scanCodeSerial;
|
||||
|
|
@ -39,6 +42,8 @@ namespace MasaBlazorApp3.Port
|
|||
|
||||
public bool Operate { get; set; }
|
||||
public DateTime dateTime { get; set; } = DateTime.Now;
|
||||
// //鼠标点击时间
|
||||
public DateTime mouseClickTime { get; set; }
|
||||
|
||||
// 当前操作的抽屉号
|
||||
public int DrawerNo { get; set; }
|
||||
|
|
@ -67,14 +72,15 @@ namespace MasaBlazorApp3.Port
|
|||
logger.Error("抽屉串口打开错误" + e.Message);
|
||||
}
|
||||
|
||||
try {
|
||||
string ScanCodePortPath = _portConfig.scanCodePortPath;
|
||||
try
|
||||
{
|
||||
string ScanCodePortPath = _portConfig.scanCodePortPath;
|
||||
logger.Info($"打开条码枪串口【{ScanCodePortPath}】");
|
||||
scanCodeSerial = new SerialPort(ScanCodePortPath, 9600, Parity.None, 8);
|
||||
scanCodeSerial.DataReceived += (object sender, System.IO.Ports.SerialDataReceivedEventArgs e) =>
|
||||
{
|
||||
string code = scanCodeSerial.ReadExisting();
|
||||
|
||||
|
||||
};
|
||||
//scanCodeSerial.Open();
|
||||
//logger.Info($"条码枪串口打开结果【{scanCodeSerial.IsOpen}】");
|
||||
|
|
@ -85,7 +91,7 @@ namespace MasaBlazorApp3.Port
|
|||
}
|
||||
if (_portConfig.canBusExsit)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
string CanBusPortPath = _portConfig.canBusPortPath;
|
||||
logger.Info($"打开can总线串口【{CanBusPortPath}】");
|
||||
|
|
@ -97,7 +103,22 @@ namespace MasaBlazorApp3.Port
|
|||
{
|
||||
logger.Error("can总线串口打开错误" + e.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//打开第二个can总线串口
|
||||
if (_portConfig.canBusTwoExsit)
|
||||
{
|
||||
try
|
||||
{
|
||||
string CanBusPortPath = _portConfig.canBusPortPathTwo;
|
||||
logger.Info($"打开第二个can总线串口【{CanBusPortPath}】");
|
||||
canBusSerialTwo = new SerialPort(CanBusPortPath, 57600, Parity.None, 8);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Error("第二个can总线串口打开错误" + e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
if (_portConfig.fridgePortExist)
|
||||
{
|
||||
|
|
@ -122,12 +143,13 @@ namespace MasaBlazorApp3.Port
|
|||
int _length = 0;
|
||||
DateTime start = DateTime.Now;
|
||||
DateTime end = DateTime.Now;
|
||||
while(_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
||||
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
||||
{
|
||||
_length = serialPort.BytesToRead;
|
||||
end = DateTime.Now;
|
||||
//logger.Error($"_length:{_length};length:{length}");
|
||||
}
|
||||
if(_length != length)
|
||||
if (_length != length)
|
||||
{
|
||||
throw new TimeoutException($"串口【{serialPort.PortName}】交互超时");
|
||||
}
|
||||
|
|
@ -137,10 +159,10 @@ namespace MasaBlazorApp3.Port
|
|||
}
|
||||
private Task<byte[]> GetBufferByPort(SerialPort serialPort, int length)
|
||||
{
|
||||
|
||||
|
||||
return Task.Run(() => GetBufferByPort(serialPort, length, 3000));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
|
||||
public void SpeakAsync(string textinfo)
|
||||
|
|
@ -148,7 +170,7 @@ namespace MasaBlazorApp3.Port
|
|||
speechSynthesizer.SpeakAsync(textinfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region 抽屉串口操作
|
||||
// 打开抽屉
|
||||
|
|
@ -158,9 +180,16 @@ namespace MasaBlazorApp3.Port
|
|||
byte[] buffer = new byte[] { 0xaa, 0x41, (byte)DrawerNo, 0xee };
|
||||
if (_portConfig.drawerProtocol == 485)
|
||||
{
|
||||
if (DrawerNo > 8)
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo - 8), 0xee };
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo / 2), 0xee };
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x11, (byte)(DrawerNo / 2 + DrawerNo % 2), 0xee };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -178,7 +207,17 @@ namespace MasaBlazorApp3.Port
|
|||
{
|
||||
byte[] buffer = await OpenDrawer(DrawerNo);
|
||||
int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
|
||||
int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
//int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
//int index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
|
||||
int index = 1;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
}
|
||||
return r[index] == 0;
|
||||
|
||||
}
|
||||
|
|
@ -191,15 +230,28 @@ namespace MasaBlazorApp3.Port
|
|||
byte[] buffer = new byte[] { 0xaa, 0x42, 0xee };
|
||||
if (_portConfig.drawerProtocol == 485)
|
||||
{
|
||||
if (DrawerNo > 8)
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x22, 0xee };
|
||||
//if (DrawerNo > 8)
|
||||
//{
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x22, 0xee };
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x12, 0xee };
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// buffer = new byte[] { 0xaa, 0x12, 0xee };
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = new byte[] { 0xaa, 0x12, 0xee };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
logger.Info($"查询抽屉状态,串口数据:{Convert.ToHexString(buffer)}");
|
||||
|
|
@ -211,8 +263,18 @@ namespace MasaBlazorApp3.Port
|
|||
public async Task<bool> CheckDrawerStatus2(int DrawerNo)
|
||||
{
|
||||
byte[] buffer = await CheckDrawerStatus(DrawerNo);
|
||||
logger.Info($"查询抽屉状态,返回:{Convert.ToHexString(buffer)}");
|
||||
int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
|
||||
int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
//int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
int index = 1;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
|
||||
}
|
||||
return r[index] != 0;
|
||||
|
||||
}
|
||||
|
|
@ -234,12 +296,22 @@ namespace MasaBlazorApp3.Port
|
|||
// 打开电控门储物箱(有灯使能)
|
||||
public async Task<byte[]> OpenStorage()
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
if (_portConfig.StorageCan == 2)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
return await GetBufferByPort(canBusSerial, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
canBusSerialTwo.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(_portConfig.doorAddr), 0x01, (byte)_portConfig.storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
return await GetBufferByPort(canBusSerialTwo, 8);
|
||||
}
|
||||
|
||||
|
||||
return await GetBufferByPort(canBusSerial, 8);
|
||||
}
|
||||
// 关闭电控门储物箱(有灯失能)
|
||||
public void CloseStorage()
|
||||
|
|
@ -288,14 +360,30 @@ namespace MasaBlazorApp3.Port
|
|||
// 以抽屉为单位获取抽屉内所有库位的药品数量
|
||||
public async Task<byte[]> CheckQuantityByDrawer(int DrawerNo)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
SerialPort serialCanPort = canBusSerial;
|
||||
int channel = DrawerNo;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
channel = DrawerNo / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
serialCanPort = canBusSerialTwo;
|
||||
channel = (DrawerNo + 1) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
|
||||
logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】");
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
serialCanPort.DiscardInBuffer();
|
||||
|
||||
return await GetBufferByPort(canBusSerial, 13);
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + channel), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
|
||||
logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】,调用串口{serialCanPort.PortName}");
|
||||
serialCanPort.Write(buffer, 0, 8);
|
||||
|
||||
return await GetBufferByPort(serialCanPort, 13);
|
||||
}
|
||||
// 获取单个单支板药品数量
|
||||
public async Task<byte[]> CheckQuantityByCol(int DrawerNo, int colNo)
|
||||
|
|
@ -324,19 +412,47 @@ namespace MasaBlazorApp3.Port
|
|||
// 以抽屉为单位灭灯
|
||||
public void LightOffByDrawer(int DrawerNo)
|
||||
{
|
||||
SerialPort serialPort = canBusSerial;
|
||||
int channelDrawerNo = DrawerNo;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
channelDrawerNo = DrawerNo / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = canBusSerialTwo;
|
||||
channelDrawerNo = (DrawerNo + 1) / 2;
|
||||
}
|
||||
}
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x06, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
serialPort.Write(buffer, 0, 8);
|
||||
}
|
||||
// 以单支板为单位有药位置亮灯
|
||||
public async Task HasLightOnByCol(int DrawerNo, int[] ColNos)
|
||||
{
|
||||
|
||||
SerialPort serialPort = canBusSerial;
|
||||
int channelDrawerNo = DrawerNo;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
channelDrawerNo = DrawerNo / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = canBusSerialTwo;
|
||||
channelDrawerNo = (DrawerNo + 1) / 2;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ColNos.Length; i++)
|
||||
{
|
||||
|
||||
var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
|
||||
var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
serialPort.Write(buffer, 0, 8);
|
||||
logger.Info($"{serialPort}串口{DrawerNo}号{channelDrawerNo}抽屉{string.Join(',', ColNos)}库位有药位置亮灯发送指令:{Convert.ToHexString(buffer)}");
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(20));
|
||||
}
|
||||
|
||||
|
|
@ -344,9 +460,23 @@ namespace MasaBlazorApp3.Port
|
|||
// 以单支板为单位无药位置亮灯
|
||||
public async Task NoLightOnByCol(int DrawerNo, int[] ColNos)
|
||||
{
|
||||
SerialPort serialPort = canBusSerial;
|
||||
int channelDrawerNo = DrawerNo;
|
||||
if (_portConfig.totalDrawerCount > 8)
|
||||
{
|
||||
if (DrawerNo % 2 == 0)
|
||||
{
|
||||
channelDrawerNo = DrawerNo / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
serialPort = canBusSerialTwo;
|
||||
channelDrawerNo = (DrawerNo + 1) / 2;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ColNos.Length; i++)
|
||||
{
|
||||
var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
|
||||
var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(20));
|
||||
|
|
@ -357,6 +487,76 @@ namespace MasaBlazorApp3.Port
|
|||
{
|
||||
byte[] buffer = new byte[] { 0xaa, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
}
|
||||
//单支板通电
|
||||
public void PowerOn(int DrawerNo)
|
||||
{
|
||||
DrawerNo = Convert.ToInt32(((DrawerNo > 8 ? DrawerNo - 8 : DrawerNo)*10).ToString(),16);
|
||||
if (_portConfig.StorageCan == 2)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)DrawerNo, 0x05, 0x01, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
canBusSerialTwo.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)DrawerNo, 0x05, 0x01, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
}
|
||||
}
|
||||
//单支板断电
|
||||
public void PowerOff(int DrawerNo)
|
||||
{
|
||||
DrawerNo = Convert.ToInt32(((DrawerNo > 8 ? DrawerNo - 8 : DrawerNo) * 10).ToString(), 16);
|
||||
if (_portConfig.StorageCan == 2)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)DrawerNo, 0x05, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
canBusSerialTwo.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, (byte)DrawerNo, 0x05, 0x00, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
}
|
||||
|
||||
}
|
||||
//单支板通电
|
||||
public void PowerOn()
|
||||
{
|
||||
if (_portConfig.StorageCan == 2)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x01, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
canBusSerialTwo.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x01, 0x00, 0x00, 0xee };
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
}
|
||||
}
|
||||
//单支板断电
|
||||
public void PowerOff()
|
||||
{
|
||||
if (_portConfig.StorageCan == 2)
|
||||
{
|
||||
canBusSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerial.Write(buffer, 0, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
canBusSerialTwo.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xaa, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0xee };
|
||||
canBusSerialTwo.Write(buffer, 0, 8);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -490,7 +690,7 @@ namespace MasaBlazorApp3.Port
|
|||
private string trim(string text)
|
||||
{
|
||||
//此处使用了转义字符如:\',\",\\,分别表示单引号,双引号,反斜杠
|
||||
char[] TrimChar = { ' ', '-', '\'', '\"', '\\','(', ')','(', ')', '①', '②' };
|
||||
char[] TrimChar = { ' ', '-', '\'', '\"', '\\', '(', ')', '(', ')', '①', '②' };
|
||||
return text.Trim(TrimChar);
|
||||
}
|
||||
|
||||
|
|
@ -1396,5 +1596,31 @@ namespace MasaBlazorApp3.Port
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region 抽屉报警
|
||||
//抽屉报警开启
|
||||
public async Task AlertOpen()
|
||||
{
|
||||
drawerSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xAA, 0x13, 0xA, 0xEE };
|
||||
logger.Info($"打开抽屉报警1:{Convert.ToHexString(buffer)}");
|
||||
drawerSerial.Write(buffer, 0, 4);
|
||||
await Task.Delay(20);
|
||||
byte[] buffer2 = new byte[] { 0xAA, 0x23, 0xA, 0xEE };
|
||||
logger.Info($"打开抽屉报警2:{Convert.ToHexString(buffer2)}");
|
||||
drawerSerial.Write(buffer2, 0, 4);
|
||||
}
|
||||
//抽屉报警关闭
|
||||
public async Task AlertClose()
|
||||
{
|
||||
drawerSerial.DiscardInBuffer();
|
||||
byte[] buffer = new byte[] { 0xAA, 0x13, 0x0, 0xEE };
|
||||
logger.Info($"关闭抽屉报警1:{Convert.ToHexString(buffer)}");
|
||||
drawerSerial.Write(buffer, 0, 4);
|
||||
await Task.Delay(20);
|
||||
byte[] buffer2 = new byte[] { 0xAA, 0x23, 0x0, 0xEE };
|
||||
logger.Info($"关闭抽屉报警2:{Convert.ToHexString(buffer2)}");
|
||||
drawerSerial.Write(buffer2, 0, 4);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ internal class Program
|
|||
// 数据库
|
||||
appBuilder.Services.AddLinqToDBContext<AppDataConnection>((provider, options) =>
|
||||
options.UseMySql(config.GetValue<String>("connectionStrings"))
|
||||
.UseDefaultLogging(provider));
|
||||
.UseDefaultLogging(provider), ServiceLifetime.Transient);
|
||||
// dao层数据库操作
|
||||
appBuilder.Services.AddScoped<IUserDao, UserDao>();
|
||||
appBuilder.Services.AddScoped<IRoleDao, RoleDao>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,334 @@
|
|||
{
|
||||
"Version":"6.8.1.1",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Weight":400,
|
||||
"Charset":134
|
||||
},
|
||||
"Printer":{
|
||||
"LeftMargin":0.3175,
|
||||
"TopMargin":0.899583,
|
||||
"RightMargin":0.396875
|
||||
},
|
||||
"DetailGrid":{
|
||||
"CenterView":true,
|
||||
"IsCrossTab":true,
|
||||
"AppendBlankRow":true,
|
||||
"Recordset":{
|
||||
"Field":[
|
||||
{
|
||||
"Name":"手术间",
|
||||
"DBFieldName":"DrawerNo"
|
||||
},
|
||||
{
|
||||
"Name":"请领时间",
|
||||
"DBFieldName":"TTime"
|
||||
},
|
||||
{
|
||||
"Name":"二线",
|
||||
"DBFieldName":"LineTwo"
|
||||
},
|
||||
{
|
||||
"Name":"一线",
|
||||
"DBFieldName":"LineOne"
|
||||
},
|
||||
{
|
||||
"Name":"操作人",
|
||||
"DBFieldName":"Nickname"
|
||||
},
|
||||
{
|
||||
"Name":"时间",
|
||||
"Type":"DateTime",
|
||||
"Format":"yyyy年MM月dd日",
|
||||
"DBFieldName":"operationTime"
|
||||
},
|
||||
{
|
||||
"Name":"药品名称",
|
||||
"DBFieldName":"DrugName"
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"DBFieldName":"quantity"
|
||||
},
|
||||
{
|
||||
"Name":"批次",
|
||||
"DBFieldName":"manuNo"
|
||||
},
|
||||
{
|
||||
"Name":"效期",
|
||||
"Type":"DateTime",
|
||||
"Format":"yyyy/MM/dd",
|
||||
"DBFieldName":"effDate"
|
||||
},
|
||||
{
|
||||
"Name":"库位",
|
||||
"DBFieldName":"drawerNo"
|
||||
},
|
||||
{
|
||||
"Name":"colNo"
|
||||
},
|
||||
{
|
||||
"Name":"type2",
|
||||
"Type":"Integer",
|
||||
"DBFieldName":"type"
|
||||
},
|
||||
{
|
||||
"Name":"医生签名",
|
||||
"DBFieldName":"Doctor"
|
||||
},
|
||||
{
|
||||
"Name":"管理者签名",
|
||||
"DBFieldName":"Manager"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Column":[
|
||||
{
|
||||
"Name":"手术间",
|
||||
"Width":0.978958
|
||||
},
|
||||
{
|
||||
"Name":"请领时间",
|
||||
"Width":2.19604
|
||||
},
|
||||
{
|
||||
"Name":"二线",
|
||||
"Width":2.01083
|
||||
},
|
||||
{
|
||||
"Name":"一线",
|
||||
"Width":1.98438
|
||||
},
|
||||
{
|
||||
"Name":"药品名称",
|
||||
"Width":3.81
|
||||
},
|
||||
{
|
||||
"Name":"医生签名",
|
||||
"Width":2.01083
|
||||
},
|
||||
{
|
||||
"Name":"管理者签名",
|
||||
"Width":1.61396
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"Width":1.19063
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
"Height":1.00542,
|
||||
"ColumnContentCell":[
|
||||
{
|
||||
"Column":"手术间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"操作人"
|
||||
},
|
||||
{
|
||||
"Column":"请领时间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"请领时间"
|
||||
},
|
||||
{
|
||||
"Column":"二线",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"二线"
|
||||
},
|
||||
{
|
||||
"Column":"一线",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"一线"
|
||||
},
|
||||
{
|
||||
"Column":"药品名称",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"数量"
|
||||
},
|
||||
{
|
||||
"Column":"医生签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"医生签名"
|
||||
},
|
||||
{
|
||||
"Column":"管理者签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"管理者签名"
|
||||
},
|
||||
{
|
||||
"Column":"数量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"数量"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ColumnTitle":{
|
||||
"Height":1.79917,
|
||||
"RepeatStyle":"OnPage",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"手术间",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"手\r\n术\r\n间"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"请领时间",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"请领时间"
|
||||
},
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"麻醉医生",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"二线",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"二线"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"一线",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"一线"
|
||||
}
|
||||
],
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"麻醉医生"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"药品名称",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#药品名称#]"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"医生签名",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"医生\r\n签名"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"管理者签名",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"管理者\r\n签名"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"数量",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":120000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"数量"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CrossTab":{
|
||||
"PercentFormat":"0.##%",
|
||||
"HCrossFields":"药品名称",
|
||||
"VCrossFields":"手术间",
|
||||
"ListCols":4,
|
||||
"TotalCols":3
|
||||
}
|
||||
},
|
||||
"Parameter":[
|
||||
{
|
||||
"Name":"startDate",
|
||||
"DataType":"DateTime",
|
||||
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||
"Value":"2023/1/1"
|
||||
},
|
||||
{
|
||||
"Name":"endDate",
|
||||
"DataType":"DateTime",
|
||||
"Format":"yyyy-MM-dd hh:mm:ss",
|
||||
"Value":"2023/4/28 23:59:59"
|
||||
},
|
||||
{
|
||||
"Name":"machine_id",
|
||||
"Value":"DM1"
|
||||
}
|
||||
],
|
||||
"ReportHeader":[
|
||||
{
|
||||
"Name":"ReportHeader1",
|
||||
"Height":1.19063,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox2",
|
||||
"Anchor":"[Left|Top|Right|Bottom]",
|
||||
"Dock":"Fill",
|
||||
"Center":"Both",
|
||||
"Border":{
|
||||
"Styles":"[DrawLeft|DrawTop|DrawRight]"
|
||||
},
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":217500,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#时间#]麻醉科毒麻药品请领登记表"
|
||||
}
|
||||
],
|
||||
"RepeatOnPage":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,275 @@
|
|||
{
|
||||
"Version":"6.8.1.1",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Weight":400,
|
||||
"Charset":134
|
||||
},
|
||||
"Printer":{
|
||||
"Oriention":"Landscape",
|
||||
"LeftMargin":1,
|
||||
"TopMargin":1.42875,
|
||||
"RightMargin":1,
|
||||
"BottomMargin":1.8
|
||||
},
|
||||
"DetailGrid":{
|
||||
"CenterView":true,
|
||||
"IsCrossTab":true,
|
||||
"FixCols":2,
|
||||
"AppendBlankRow":true,
|
||||
"Recordset":{
|
||||
"Field":[
|
||||
{
|
||||
"Name":"日期",
|
||||
"Type":"DateTime",
|
||||
"Format":"yyyy年MM月dd日",
|
||||
"DBFieldName":"Ddate"
|
||||
},
|
||||
{
|
||||
"Name":"药品名称",
|
||||
"DBFieldName":"DrugName"
|
||||
},
|
||||
{
|
||||
"Name":"DrugId"
|
||||
},
|
||||
{
|
||||
"Name":"时间",
|
||||
"DBFieldName":"TDateTime"
|
||||
},
|
||||
{
|
||||
"Name":"实物",
|
||||
"DBFieldName":"Quantity"
|
||||
},
|
||||
{
|
||||
"Name":"处方",
|
||||
"DBFieldName":"OrderQuantity"
|
||||
},
|
||||
{
|
||||
"Name":"备注",
|
||||
"DBFieldName":"Remarks"
|
||||
},
|
||||
{
|
||||
"Name":"交班人",
|
||||
"DBFieldName":"FromUser"
|
||||
},
|
||||
{
|
||||
"Name":"接班人",
|
||||
"DBFieldName":"ToUser"
|
||||
},
|
||||
{
|
||||
"Name":"规格",
|
||||
"DBFieldName":"Spec"
|
||||
},
|
||||
{
|
||||
"Name":"基数",
|
||||
"DBFieldName":"BaseQuantity"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Column":[
|
||||
{
|
||||
"Name":"日期"
|
||||
},
|
||||
{
|
||||
"Name":"时间"
|
||||
},
|
||||
{
|
||||
"Name":"实物"
|
||||
},
|
||||
{
|
||||
"Name":"处方"
|
||||
},
|
||||
{
|
||||
"Name":"备注"
|
||||
},
|
||||
{
|
||||
"Name":"交班人"
|
||||
},
|
||||
{
|
||||
"Name":"接班人"
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
"Height":0.79375,
|
||||
"ColumnContentCell":[
|
||||
{
|
||||
"Column":"日期",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"日期"
|
||||
},
|
||||
{
|
||||
"Column":"时间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"时间"
|
||||
},
|
||||
{
|
||||
"Column":"实物",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"实物"
|
||||
},
|
||||
{
|
||||
"Column":"处方",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"处方"
|
||||
},
|
||||
{
|
||||
"Column":"备注",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"备注"
|
||||
},
|
||||
{
|
||||
"Column":"交班人",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"交班人"
|
||||
},
|
||||
{
|
||||
"Column":"接班人",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"接班人"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ColumnTitle":{
|
||||
"Height":1.5875,
|
||||
"RepeatStyle":"OnPage",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"药品名称",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"药品规格",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"固定基数",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"日期",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"日期"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"时间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"时间"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"固定基数"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"药品规格"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"药品名称"
|
||||
},
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"绑定的药名",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"规格",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"基数",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"实物",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"实物"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"处方",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"处方"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#规格#]"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#规格#]"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#药品名称#]"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"备注",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"备注"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"交班人",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"交班人"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"接班人",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"接班人"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CrossTab":{
|
||||
"PercentFormat":"0.##%",
|
||||
"GroupAutoSum":false,
|
||||
"HCrossFields":"DrugId",
|
||||
"VCrossFields":"日期;时间",
|
||||
"ListCols":2,
|
||||
"TotalCols":3
|
||||
}
|
||||
},
|
||||
"Parameter":[
|
||||
{
|
||||
"Name":"machine_id"
|
||||
},
|
||||
{
|
||||
"Name":"startDate",
|
||||
"DataType":"DateTime"
|
||||
},
|
||||
{
|
||||
"Name":"endDate",
|
||||
"DataType":"DateTime"
|
||||
}
|
||||
],
|
||||
"ReportHeader":[
|
||||
{
|
||||
"Name":"ReportHeader1",
|
||||
"Height":1.00542,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox1",
|
||||
"Dock":"Fill",
|
||||
"Center":"Both",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":217500,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"ShrinkFontToFit":true,
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"中部战区总医院麻醉科特殊管理药品交接班记录"
|
||||
}
|
||||
],
|
||||
"RepeatOnPage":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,374 @@
|
|||
{
|
||||
"Version":"6.8.1.1",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Weight":400,
|
||||
"Charset":134
|
||||
},
|
||||
"Printer":{
|
||||
"Oriention":"Landscape",
|
||||
"LeftMargin":1,
|
||||
"TopMargin":1.42875,
|
||||
"RightMargin":1,
|
||||
"BottomMargin":1.8
|
||||
},
|
||||
"DetailGrid":{
|
||||
"CenterView":true,
|
||||
"IsCrossTab":true,
|
||||
"FixCols":2,
|
||||
"AppendBlankRow":true,
|
||||
"Recordset":{
|
||||
"Field":[
|
||||
{
|
||||
"Name":"日期",
|
||||
"Type":"DateTime",
|
||||
"Format":"yyyy年MM月dd日",
|
||||
"DBFieldName":"portdate"
|
||||
},
|
||||
{
|
||||
"Name":"手术间",
|
||||
"DBFieldName":"ShouShuJian"
|
||||
},
|
||||
{
|
||||
"Name":"主麻",
|
||||
"DBFieldName":"ZhuMa"
|
||||
},
|
||||
{
|
||||
"Name":"副麻",
|
||||
"DBFieldName":"FuMa"
|
||||
},
|
||||
{
|
||||
"Name":"ID号",
|
||||
"DBFieldName":"IDNumber"
|
||||
},
|
||||
{
|
||||
"Name":"姓名",
|
||||
"DBFieldName":"PName"
|
||||
},
|
||||
{
|
||||
"Name":"诊断",
|
||||
"DBFieldName":"Diagnose"
|
||||
},
|
||||
{
|
||||
"Name":"药品名称",
|
||||
"DBFieldName":"DrugName"
|
||||
},
|
||||
{
|
||||
"Name":"批号",
|
||||
"DBFieldName":"ManuNo"
|
||||
},
|
||||
{
|
||||
"Name":"用量",
|
||||
"DBFieldName":"UsageDosage"
|
||||
},
|
||||
{
|
||||
"Name":"残液量",
|
||||
"DBFieldName":"CanYeLiang"
|
||||
},
|
||||
{
|
||||
"Name":"残液处置方式",
|
||||
"DBFieldName":"CanYeChuZhi"
|
||||
},
|
||||
{
|
||||
"Name":"使用人签名",
|
||||
"DBFieldName":"UseUserName"
|
||||
},
|
||||
{
|
||||
"Name":"复核人签名",
|
||||
"DBFieldName":"CheckUserName"
|
||||
},
|
||||
{
|
||||
"Name":"DrugId"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Column":[
|
||||
{
|
||||
"Name":"手术间",
|
||||
"Width":1.56104
|
||||
},
|
||||
{
|
||||
"Name":"主麻",
|
||||
"Width":1.82563
|
||||
},
|
||||
{
|
||||
"Name":"副麻",
|
||||
"Width":1.79917
|
||||
},
|
||||
{
|
||||
"Name":"ID号"
|
||||
},
|
||||
{
|
||||
"Name":"姓名",
|
||||
"Width":1.79917
|
||||
},
|
||||
{
|
||||
"Name":"诊断",
|
||||
"Width":4.39208
|
||||
},
|
||||
{
|
||||
"Name":"批号"
|
||||
},
|
||||
{
|
||||
"Name":"用量",
|
||||
"Width":2.2225
|
||||
},
|
||||
{
|
||||
"Name":"残液量",
|
||||
"Width":2.01083
|
||||
},
|
||||
{
|
||||
"Name":"残液处置方式",
|
||||
"Width":0.978958
|
||||
},
|
||||
{
|
||||
"Name":"使用人签名",
|
||||
"Width":1.61396
|
||||
},
|
||||
{
|
||||
"Name":"复核人签名",
|
||||
"Width":1.5875
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
"Height":0.79375,
|
||||
"ColumnContentCell":[
|
||||
{
|
||||
"Column":"手术间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"手术间"
|
||||
},
|
||||
{
|
||||
"Column":"主麻",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"主麻"
|
||||
},
|
||||
{
|
||||
"Column":"副麻",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"副麻"
|
||||
},
|
||||
{
|
||||
"Column":"ID号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"ID号"
|
||||
},
|
||||
{
|
||||
"Column":"姓名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"姓名"
|
||||
},
|
||||
{
|
||||
"Column":"诊断",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"诊断"
|
||||
},
|
||||
{
|
||||
"Column":"批号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"批号"
|
||||
},
|
||||
{
|
||||
"Column":"用量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"用量"
|
||||
},
|
||||
{
|
||||
"Column":"残液量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"残液量"
|
||||
},
|
||||
{
|
||||
"Column":"残液处置方式",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"残液处置方式"
|
||||
},
|
||||
{
|
||||
"Column":"使用人签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"使用人签名"
|
||||
},
|
||||
{
|
||||
"Column":"复核人签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"复核人签名"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ColumnTitle":{
|
||||
"Height":1.37583,
|
||||
"RepeatStyle":"OnPage",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"手术间",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"手\r\n术\r\n间"
|
||||
},
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"麻醉医师",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"主麻",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"主麻"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"副麻",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"副麻"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"麻醉医师"
|
||||
},
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"患者基本信息",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"ID号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"ID号"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"姓名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"姓名"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"诊断",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"诊断"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"患者基本信息"
|
||||
},
|
||||
{
|
||||
"GroupTitle":true,
|
||||
"Name":"药品名称",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"批号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"批号"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"用量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"用量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"残液量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"残液量"
|
||||
}
|
||||
],
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"[#药品名称#]"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"残液处置方式",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"残液\r\n处置\r\n方式"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"使用人签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"使用人\r\n签名"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"复核人签名",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"复核人\r\n签名"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CrossTab":{
|
||||
"PercentFormat":"0.##%",
|
||||
"GroupAutoSum":false,
|
||||
"HCrossFields":"DrugId",
|
||||
"VCrossFields":"ID号",
|
||||
"ListCols":6,
|
||||
"TotalCols":3,
|
||||
"TotalExcludeColumns":"残液处置方式;使用人签名;复核人签名"
|
||||
}
|
||||
},
|
||||
"Parameter":[
|
||||
{
|
||||
"Name":"machine_id"
|
||||
},
|
||||
{
|
||||
"Name":"startDate",
|
||||
"DataType":"DateTime"
|
||||
},
|
||||
{
|
||||
"Name":"endDate",
|
||||
"DataType":"DateTime"
|
||||
}
|
||||
],
|
||||
"ReportHeader":[
|
||||
{
|
||||
"Name":"ReportHeader1",
|
||||
"Height":3.81,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox12",
|
||||
"Anchor":"[Right|Bottom]",
|
||||
"AlignColumnSide":"Right",
|
||||
"Left":19.4469,
|
||||
"Top":2.98979,
|
||||
"Width":3.46604,
|
||||
"Height":0.582083,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"日期:[#日期#]"
|
||||
},
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox1",
|
||||
"Center":"Both",
|
||||
"Left":2.93688,
|
||||
"Top":1.00542,
|
||||
"Width":21.8017,
|
||||
"Height":1.79917,
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":217500,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"ShrinkFontToFit":true,
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"中国人民解放军中部战区总医院手术患者麻醉药品使用登记本"
|
||||
},
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox13",
|
||||
"Anchor":"[Right|Bottom]",
|
||||
"Left":23.2569,
|
||||
"Top":3.01625,
|
||||
"Width":3.01625,
|
||||
"Height":0.582083,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"手术室:武昌院区"
|
||||
}
|
||||
],
|
||||
"RepeatOnPage":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -31,11 +31,6 @@
|
|||
"Name":"批号",
|
||||
"DBFieldName":"manuNo"
|
||||
},
|
||||
{
|
||||
"Name":"上次批次结存",
|
||||
"Type":"Integer",
|
||||
"DBFieldName":"beforeManuQuan"
|
||||
},
|
||||
{
|
||||
"Name":"入库数量",
|
||||
"Type":"Integer",
|
||||
|
|
@ -90,14 +85,6 @@
|
|||
"Format":"yy/M/d",
|
||||
"DBFieldName":"effDate"
|
||||
},
|
||||
{
|
||||
"Name":"sign1",
|
||||
"Type":"Binary"
|
||||
},
|
||||
{
|
||||
"Name":"sign2",
|
||||
"Type":"Binary"
|
||||
},
|
||||
{
|
||||
"Name":"drugId"
|
||||
},
|
||||
|
|
@ -112,6 +99,10 @@
|
|||
{
|
||||
"Name":"领用部门",
|
||||
"DBFieldName":"receiveDept"
|
||||
},
|
||||
{
|
||||
"Name":"备注",
|
||||
"DBFieldName":"Remarks"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -125,12 +116,7 @@
|
|||
"Width":2.19604
|
||||
},
|
||||
{
|
||||
"Name":"批号",
|
||||
"Width":3.99521
|
||||
},
|
||||
{
|
||||
"Name":"有效期",
|
||||
"Width":2.43417
|
||||
"Name":"供货单位"
|
||||
},
|
||||
{
|
||||
"Name":"入库数量",
|
||||
|
|
@ -141,11 +127,18 @@
|
|||
"Width":1.79917
|
||||
},
|
||||
{
|
||||
"Name":"Column4",
|
||||
"Width":1.98438
|
||||
"Name":"结存数量"
|
||||
},
|
||||
{
|
||||
"Name":"收/发药人",
|
||||
"Name":"批号",
|
||||
"Width":3.99521
|
||||
},
|
||||
{
|
||||
"Name":"有效期",
|
||||
"Width":2.43417
|
||||
},
|
||||
{
|
||||
"Name":"接收(发药人)",
|
||||
"Width":2.80458
|
||||
},
|
||||
{
|
||||
|
|
@ -153,12 +146,7 @@
|
|||
"Width":2.80458
|
||||
},
|
||||
{
|
||||
"Name":"Column2",
|
||||
"Width":2.35479
|
||||
},
|
||||
{
|
||||
"Name":"Column3",
|
||||
"Width":2.38125
|
||||
"Name":"备注"
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
|
|
@ -173,17 +161,13 @@
|
|||
},
|
||||
{
|
||||
"Column":"凭证号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"凭证号"
|
||||
},
|
||||
{
|
||||
"Column":"批号",
|
||||
"Column":"供货单位",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"批号"
|
||||
},
|
||||
{
|
||||
"Column":"有效期",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"有效期"
|
||||
"DataField":"供应单位"
|
||||
},
|
||||
{
|
||||
"Column":"入库数量",
|
||||
|
|
@ -196,12 +180,22 @@
|
|||
"DataField":"出库数量"
|
||||
},
|
||||
{
|
||||
"Column":"Column4",
|
||||
"Column":"结存数量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"总结存"
|
||||
"DataField":"批号结存"
|
||||
},
|
||||
{
|
||||
"Column":"收/发药人",
|
||||
"Column":"批号",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"批号"
|
||||
},
|
||||
{
|
||||
"Column":"有效期",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"有效期"
|
||||
},
|
||||
{
|
||||
"Column":"接收(发药人)",
|
||||
"FreeCell":true,
|
||||
"Control":[
|
||||
{
|
||||
|
|
@ -227,30 +221,9 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"Column":"Column2",
|
||||
"FreeCell":true,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"FieldBox",
|
||||
"Name":"FieldBox14",
|
||||
"Dock":"Fill",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"供应单位"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Column":"Column3",
|
||||
"FreeCell":true,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"FieldBox",
|
||||
"Name":"FieldBox15",
|
||||
"Dock":"Fill",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"领用部门"
|
||||
}
|
||||
]
|
||||
"Column":"备注",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"备注"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -282,6 +255,54 @@
|
|||
"TextAlign":"MiddleCenter",
|
||||
"Text":"凭证号"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"供货单位",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"供货单位\r\n(领用部门)"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"入库数量",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"入库\r\n数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"出库数量",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"出库\r\n数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"结存数量",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"结存数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"批号",
|
||||
|
|
@ -308,7 +329,7 @@
|
|||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"入库数量",
|
||||
"Column":"接收(发药人)",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
|
|
@ -316,43 +337,7 @@
|
|||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"入库\r\n数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"出库数量",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"发出\r\n数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"Column4",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"总结存"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"收/发药人",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"发药人"
|
||||
"Text":"接收人\r\n(发药人)"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
|
|
@ -368,7 +353,7 @@
|
|||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"Column2",
|
||||
"Column":"备注",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
|
|
@ -376,19 +361,7 @@
|
|||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"供应单位"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"Column3",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"领用部门"
|
||||
"Text":"备注"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -400,15 +373,6 @@
|
|||
"PrintGridBorder":false,
|
||||
"RepeatOnPage":true,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"StaticBox",
|
||||
"Name":"StaticBox15",
|
||||
"Left":28.3898,
|
||||
"Top":0.238125,
|
||||
"Width":2.01083,
|
||||
"Height":0.79375,
|
||||
"Text":"生产厂家:"
|
||||
},
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox11",
|
||||
|
|
@ -430,7 +394,7 @@
|
|||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"Text":"品名:"
|
||||
"Text":"药品名称:"
|
||||
},
|
||||
{
|
||||
"Type":"FieldBox",
|
||||
|
|
@ -550,7 +514,7 @@
|
|||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"Text":"生产厂家:"
|
||||
"Text":"生产企业:"
|
||||
},
|
||||
{
|
||||
"Type":"FieldBox",
|
||||
|
|
@ -606,7 +570,7 @@
|
|||
"Charset":134
|
||||
},
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"麻醉、精神药品逐笔专用账册"
|
||||
"Text":"中部战区总医院麻醉药品、第一类精神药品进出专用账册"
|
||||
}
|
||||
],
|
||||
"RepeatOnPage":true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,453 @@
|
|||
{
|
||||
"Version":"6.8.1.1",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Weight":400,
|
||||
"Charset":134
|
||||
},
|
||||
"Printer":{
|
||||
"Oriention":"Landscape"
|
||||
},
|
||||
"DetailGrid":{
|
||||
"Recordset":{
|
||||
"Field":[
|
||||
{
|
||||
"Name":"药品",
|
||||
"DBFieldName":"drugName1"
|
||||
},
|
||||
{
|
||||
"Name":"批次",
|
||||
"DBFieldName":"manuNo1"
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"DBFieldName":"quantity1"
|
||||
},
|
||||
{
|
||||
"Name":"日期",
|
||||
"Type":"DateTime",
|
||||
"Format":"yyyy年MM月dd日",
|
||||
"DBFieldName":"portDate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Column":[
|
||||
{
|
||||
"Name":"药品",
|
||||
"Width":6.16479
|
||||
},
|
||||
{
|
||||
"Name":"批次",
|
||||
"Width":2.40771
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"Width":1.79917
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
"Height":1.00542,
|
||||
"ColumnContentCell":[
|
||||
{
|
||||
"Column":"药品",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"药品"
|
||||
},
|
||||
{
|
||||
"Column":"批次",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"批次"
|
||||
},
|
||||
{
|
||||
"Column":"数量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"DataField":"数量"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ColumnTitle":{
|
||||
"Height":0.608542,
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"药品",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"药品"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"批次",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"批次"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"数量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"数量"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"ReportHeader":[
|
||||
{
|
||||
"Name":"ReportHeader1",
|
||||
"Height":3.41313,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox12",
|
||||
"Anchor":"[Right|Bottom]",
|
||||
"AlignColumnSide":"Right",
|
||||
"Left":17.6212,
|
||||
"Top":2.80458,
|
||||
"Width":3.46604,
|
||||
"Height":0.582083,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"日期:[#日期#]"
|
||||
},
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox1",
|
||||
"Center":"Both",
|
||||
"Left":1.45521,
|
||||
"Top":0.79375,
|
||||
"Width":21.8017,
|
||||
"Height":1.79917,
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":217500,
|
||||
"Bold":true,
|
||||
"Charset":134
|
||||
},
|
||||
"ShrinkFontToFit":true,
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"中国人民解放军中部战区总医院手术患者麻醉药品使用登记本"
|
||||
},
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox13",
|
||||
"Anchor":"[Right|Bottom]",
|
||||
"Left":21.4313,
|
||||
"Top":2.83104,
|
||||
"Width":3.01625,
|
||||
"Height":0.582083,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"手术室:武昌院区"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"ReportFooter":[
|
||||
{
|
||||
"Name":"ReportFooter2",
|
||||
"Height":0.608542
|
||||
},
|
||||
{
|
||||
"Name":"ReportFooter1",
|
||||
"CanGrow":true,
|
||||
"Height":1.5875,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"SubReport",
|
||||
"Name":"SubReport1",
|
||||
"Dock":"Fill",
|
||||
"Report":{
|
||||
"Version":"6.8.1.1",
|
||||
"Font":{
|
||||
"Name":"宋体",
|
||||
"Size":105000,
|
||||
"Weight":400,
|
||||
"Charset":134
|
||||
},
|
||||
"Printer":{
|
||||
"Oriention":"Landscape"
|
||||
},
|
||||
"DetailGrid":{
|
||||
"Recordset":{
|
||||
"Field":[
|
||||
{
|
||||
"Name":"药品",
|
||||
"DBFieldName":"drugName"
|
||||
},
|
||||
{
|
||||
"Name":"批次",
|
||||
"DBFieldName":"manuNo"
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"Type":"Integer",
|
||||
"DBFieldName":"quantity"
|
||||
},
|
||||
{
|
||||
"Name":"主麻",
|
||||
"DBFieldName":"doctor1"
|
||||
},
|
||||
{
|
||||
"Name":"药品id",
|
||||
"DBFieldName":"DrugId"
|
||||
},
|
||||
{
|
||||
"Name":"副麻",
|
||||
"DBFieldName":"doctor2"
|
||||
},
|
||||
{
|
||||
"Name":"患者",
|
||||
"DBFieldName":"PName"
|
||||
},
|
||||
{
|
||||
"Name":"患者id",
|
||||
"DBFieldName":"patientId"
|
||||
},
|
||||
{
|
||||
"Name":"诊断",
|
||||
"DBFieldName":"Diagnose"
|
||||
},
|
||||
{
|
||||
"Name":"残余液",
|
||||
"DBFieldName":"residual"
|
||||
},
|
||||
{
|
||||
"Name":"用量",
|
||||
"DBFieldName":"usage"
|
||||
},
|
||||
{
|
||||
"Name":"残液处置方式",
|
||||
"DBFieldName":"CanYeChuZhi"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Column":[
|
||||
{
|
||||
"Name":"药品",
|
||||
"Width":5.76792
|
||||
},
|
||||
{
|
||||
"Name":"批次",
|
||||
"Width":3.41313
|
||||
},
|
||||
{
|
||||
"Name":"数量",
|
||||
"Width":1.21708
|
||||
},
|
||||
{
|
||||
"Name":"患者"
|
||||
},
|
||||
{
|
||||
"Name":"患者id"
|
||||
},
|
||||
{
|
||||
"Name":"诊断"
|
||||
},
|
||||
{
|
||||
"Name":"残余液",
|
||||
"Width":2.03729
|
||||
},
|
||||
{
|
||||
"Name":"用量",
|
||||
"Width":1.19063
|
||||
},
|
||||
{
|
||||
"Name":"残液处置方式",
|
||||
"Width":1.77271
|
||||
}
|
||||
],
|
||||
"ColumnContent":{
|
||||
"Height":0.6,
|
||||
"ColumnContentCell":[
|
||||
{
|
||||
"Column":"药品",
|
||||
"ShrinkFontToFit":true,
|
||||
"DataField":"药品"
|
||||
},
|
||||
{
|
||||
"Column":"批次",
|
||||
"CanGrow":true,
|
||||
"DataField":"批次"
|
||||
},
|
||||
{
|
||||
"Column":"数量",
|
||||
"FreeCell":true,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox2",
|
||||
"Dock":"Fill",
|
||||
"Text":"[#SumAcc(数量)#]"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Column":"患者",
|
||||
"DataField":"患者"
|
||||
},
|
||||
{
|
||||
"Column":"患者id",
|
||||
"DataField":"患者id"
|
||||
},
|
||||
{
|
||||
"Column":"诊断",
|
||||
"DataField":"诊断"
|
||||
},
|
||||
{
|
||||
"Column":"残余液",
|
||||
"DataField":"残余液"
|
||||
},
|
||||
{
|
||||
"Column":"用量",
|
||||
"DataField":"用量"
|
||||
},
|
||||
{
|
||||
"Column":"残液处置方式",
|
||||
"DataField":"残液处置方式"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ColumnTitle":{
|
||||
"RepeatStyle":"OnGroupHeader",
|
||||
"ColumnTitleCell":[
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"药品",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"药品"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"批次",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"批次"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"数量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"数量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"患者",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"患者"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"患者id",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"患者id"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"诊断",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"诊断"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"残余液",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"残余液"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"用量",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"Text":"用量"
|
||||
},
|
||||
{
|
||||
"GroupTitle":false,
|
||||
"Column":"残液处置方式",
|
||||
"TextAlign":"MiddleCenter",
|
||||
"CanGrow":true,
|
||||
"CanShrink":true,
|
||||
"Text":"残液\r\n处置\r\n方式"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Group":[
|
||||
{
|
||||
"Name":"Group1",
|
||||
"ByFields":"主麻;副麻",
|
||||
"GroupHeader":{
|
||||
"Height":2.98979,
|
||||
"PrintGridBorder":false,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox1",
|
||||
"Top":0.79375,
|
||||
"Width":6.79979,
|
||||
"Height":2.19604,
|
||||
"Text":"麻醉医师\r\n主麻:[#主麻#]\r\n副麻:[#副麻#]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"GroupFooter":{
|
||||
"Visible":false,
|
||||
"Height":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name":"Group2",
|
||||
"ByFields":"药品id",
|
||||
"GroupHeader":{
|
||||
"CanGrow":true,
|
||||
"Height":0.6,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"MemoBox",
|
||||
"Name":"MemoBox3",
|
||||
"AlignColumn":"药品",
|
||||
"Width":5.74146,
|
||||
"Height":0.6,
|
||||
"CanGrow":true,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"[#药品#]"
|
||||
},
|
||||
{
|
||||
"Type":"SummaryBox",
|
||||
"Name":"SummaryBox1",
|
||||
"AlignColumn":"数量",
|
||||
"Left":9.18104,
|
||||
"Width":1.19063,
|
||||
"Height":0.6,
|
||||
"DataField":"数量"
|
||||
}
|
||||
],
|
||||
"OccupyColumn":true,
|
||||
"SameAsColumn":false,
|
||||
"OccupiedColumns":"药品;数量",
|
||||
"VAlign":"Middle"
|
||||
},
|
||||
"GroupFooter":{
|
||||
"Visible":false,
|
||||
"Height":0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name":"ReportFooter3",
|
||||
"Height":0.79375,
|
||||
"Control":[
|
||||
{
|
||||
"Type":"StaticBox",
|
||||
"Name":"StaticBox1",
|
||||
"AlignColumnSide":"Left",
|
||||
"Left":0.396875,
|
||||
"Top":0.211667,
|
||||
"Width":24.2094,
|
||||
"Height":0.396875,
|
||||
"ShrinkFontToFit":true,
|
||||
"Text":"残余毒麻药品处置方法:①未使用完的注射液和镇痛泵中的残余药液,由医师、药师或护士在视频监控下双人将残余液完全倾泻入下水道并用水冲净,双人复核确认并签字,空安瓿按流程回收;②废贴需核对批次和数量,在领用后次日交回药房,并在药房签字确认"
|
||||
}
|
||||
],
|
||||
"PrintAtBottom":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -5,51 +5,93 @@
|
|||
@inherits LayoutComponentBase
|
||||
|
||||
<style>
|
||||
.my-tab-menu{
|
||||
padding: 10px 20px;
|
||||
.my-tab-menu {
|
||||
padding: 10px 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.my-tab-menu:hover{
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); /* 阴影效果 */
|
||||
text-decoration: none !important;
|
||||
background: #255dd6;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.my-tab-menu:hover {
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); /* 阴影效果 */
|
||||
text-decoration: none !important;
|
||||
background: #255dd6;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
a.active {
|
||||
background: #255dd4;
|
||||
border-radius: 20px;
|
||||
background: #255dd4;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.warning-message {
|
||||
background: #ffeaa7;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
/* margin-top: 2px; */
|
||||
display: block;
|
||||
animation: pulse 1.5s infinite;
|
||||
}
|
||||
</style>
|
||||
|
||||
<RadzenLayout>
|
||||
<RadzenHeader Style="height: 75px;">
|
||||
<RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Style="height: 100%;">
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenColumn Size="1">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
<RadzenIcon Icon="chevron_left" Style="font-size:3rem;cursor: pointer;padding: 0 10px;" @onclick="@(() => { backHome(); })" />
|
||||
</RadzenStack>
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="8" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
|
||||
@foreach (Premission p in children)
|
||||
{
|
||||
if (childrenIds.Any(id => id == p.Id))
|
||||
<RadzenColumn Size="10" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start">
|
||||
@if (children.Count > 5)
|
||||
{
|
||||
|
||||
<RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
@foreach (Premission p in children)
|
||||
{
|
||||
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
|
||||
if (childrenIds.Any(id => id == p.Id))
|
||||
{
|
||||
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
|
||||
}
|
||||
}
|
||||
}
|
||||
</RadzenStack>
|
||||
@if (children.Any(c => c.PremissionPath.Contains("Box")))
|
||||
{
|
||||
<RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
|
||||
}
|
||||
</RadzenStack>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
<RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
|
||||
@foreach (Premission p in children)
|
||||
{
|
||||
if (childrenIds.Any(id => id == p.Id))
|
||||
{
|
||||
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
|
||||
}
|
||||
}
|
||||
@if (children.Any(c => c.PremissionPath.Contains("Box")))
|
||||
{
|
||||
<RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
|
||||
}
|
||||
</RadzenStack>
|
||||
}
|
||||
</RadzenColumn>
|
||||
<RadzenColumn Size="2">
|
||||
<RadzenColumn Size="1">
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center">
|
||||
@* <RadzenText TextAlign="TextAlign.Center" class="rz-color-white">退出</RadzenText> *@
|
||||
<RadzenIcon Icon="exit_to_app" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { logout(); })" />
|
||||
</RadzenStack>
|
||||
</RadzenColumn>
|
||||
</RadzenRow>
|
||||
</RadzenHeader>
|
||||
<RadzenBody>
|
||||
@if (warnTime != 999999999)
|
||||
{
|
||||
<div class="warning-message" id="warningMessage">
|
||||
<strong>警告:</strong> 您长时间未操作屏幕,系统将在 <span id="countdown">@warnTime</span> 秒后自动退出!
|
||||
</div>
|
||||
}
|
||||
<div class="container-fluid rz-p-1">
|
||||
<RadzenCard>
|
||||
@Body
|
||||
|
|
@ -62,6 +104,7 @@
|
|||
|
||||
@code
|
||||
{
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject GlobalStateService globalStateService;
|
||||
@inject NavigationManager na;
|
||||
int selectedIndex = 0;
|
||||
|
|
@ -70,8 +113,10 @@
|
|||
List<Premission> children;
|
||||
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
|
||||
@inject PortUtil _portUtil;
|
||||
@inject NotificationService _message
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(MainLayout));
|
||||
bool currentPage = true;
|
||||
int warnTime = 999999999;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
|
@ -80,19 +125,19 @@
|
|||
|
||||
Operator = globalStateService.Operator;
|
||||
Premission parent = new Premission().getAdminPremission().Find(p => p.PremissionPath == s[3]);
|
||||
childrenIds = Operator.role.permissionIds.Where(id => id - (parent .Id* 10) < 10).ToList();
|
||||
childrenIds = Operator.role.permissionIds.Where(id => id - (parent.Id * 10) < 10).ToList();
|
||||
children = parent.Items.ToList();
|
||||
|
||||
if(setting.Value.autoOutLog>0)
|
||||
if (setting.Value.autoOutLog > 0)
|
||||
{
|
||||
// 是否需要自动退出
|
||||
var promiseUtil = new PromiseUtil<object>();
|
||||
promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
|
||||
{
|
||||
if (globalStateService.Operator == null||!currentPage)
|
||||
if (globalStateService.Operator == null || !currentPage)
|
||||
{
|
||||
|
||||
logger.Info($"MainLayout页自动退出循环停止{globalStateService.Operator==null},{!currentPage}");
|
||||
|
||||
logger.Info($"MainLayout页自动退出循环停止{globalStateService.Operator == null},{!currentPage}");
|
||||
stop();
|
||||
}
|
||||
else
|
||||
|
|
@ -100,12 +145,12 @@
|
|||
try
|
||||
{
|
||||
//没有在操作抽屉
|
||||
if(!_portUtil.Operate)
|
||||
if (!_portUtil.Operate)
|
||||
{
|
||||
// 无人操作鼠标键盘
|
||||
if((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
|
||||
{
|
||||
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
|
||||
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
|
||||
globalStateService.Operator = null;
|
||||
globalStateService.Reviewer = null;
|
||||
na.NavigateTo("");
|
||||
|
|
@ -113,6 +158,31 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
if (setting.Value.warningMessage > 0)
|
||||
{
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > (setting.Value.autoOutLog - setting.Value.warningMessage) && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > (setting.Value.autoOutLog - setting.Value.warningMessage))
|
||||
{
|
||||
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds <= (setting.Value.autoOutLog - setting.Value.warningMessage))
|
||||
{
|
||||
//提示3秒后将自动退出
|
||||
warnTime = Convert.ToInt32(setting.Value.autoOutLog - (DateTime.Now - _portUtil.dateTime).TotalSeconds);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
//提示3秒后将自动退出
|
||||
warnTime = Convert.ToInt32(setting.Value.autoOutLog - (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds);
|
||||
//提示3秒后将自动退出
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
warnTime = 999999999;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
|
@ -149,8 +219,41 @@
|
|||
globalStateService.Reviewer = null;
|
||||
na.NavigateTo("");
|
||||
}
|
||||
}
|
||||
async Task OpenStorage()
|
||||
{
|
||||
try
|
||||
{
|
||||
var b = await _portUtil.OpenStorage();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Info($"开储物箱发生错误,{ex.Message}");
|
||||
_message.Notify(
|
||||
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"开储物箱发生错误,{ex.Message}", Duration = 4000 }
|
||||
);
|
||||
}
|
||||
}
|
||||
private DotNetObjectReference<MainLayout>? dotNetObjectReference;
|
||||
|
||||
@code
|
||||
{
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
dotNetObjectReference = DotNetObjectReference.Create(this);
|
||||
await JSRuntime.InvokeVoidAsync("registerMouseClickHandler", dotNetObjectReference);
|
||||
}
|
||||
}
|
||||
|
||||
[JSInvokable]
|
||||
public void HandleMouseClick(int clientX, int clientY)
|
||||
{
|
||||
// 这里处理鼠标点击事件,例如记录日志或更新状态
|
||||
// Console.WriteLine($"Mouse clicked at: ({clientX}, {clientY})");
|
||||
_portUtil.mouseClickTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
dotNetObjectReference?.Dispose();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"connectionStrings": "server=127.0.0.1;port=3306;database=hkcdb;userid=root;password=qq1223;Charset=utf8mb4;",
|
||||
"connectionStrings": "server=127.0.0.1;port=3306;database=zhongbuzhanqu;userid=root;password=qq1223;Charset=utf8mb4;",
|
||||
"finger": {
|
||||
"ip": "192.168.50.59",
|
||||
"port": 4370,
|
||||
|
|
@ -7,29 +7,47 @@
|
|||
},
|
||||
"setting": {
|
||||
"machineId": "DM1",
|
||||
"storage": 1,
|
||||
//药房代码,有则写无则空
|
||||
//. 药房代码: 武昌 07010323 麻醉科小药柜 8个抽屉
|
||||
// 汉口 "07010363" "麻醉科 16个抽屉",
|
||||
"storage": "07010323",
|
||||
"inPharmacyId": "062303",
|
||||
"roomName": "麻醉科手术室",
|
||||
"loginMode": 1,
|
||||
"opFirst": true,
|
||||
//自动退出登录时间,单位秒(0不自动退出)
|
||||
"autoOutLog": 0,
|
||||
"boxMachineId": "DM5"
|
||||
"autoOutLog": 15,
|
||||
//自动退出登录倒计时时间
|
||||
"warningMessage": 5,
|
||||
"boxMachineId": "DM5",
|
||||
"anaesthetist_name": "未选择,杨俊哲,周丹,刘方,罗丁,陈晓龙,杜金菊,季楠,王彩红,凌娜佳,汪宏,谈世刚,罗中兵,郭慧,廖家涛,殷国江,李坤,周翔,秦明哲,王庆利,张燕辉,姜佳佳,宋晓阳,胡晓",
|
||||
"boxColor": "白,绿",
|
||||
//打开抽屉时报警0关闭1开启
|
||||
"alert": 0
|
||||
},
|
||||
"port": {
|
||||
"drawerPortPath": "COM2",
|
||||
"drawerPortPath": "COM5",
|
||||
"drawerProtocol": 485,
|
||||
"scanCodePortPath": "COM1",
|
||||
"canBusPortPath": "COM31",
|
||||
"scanCodePortPath": "COM3",
|
||||
"canBusExsit": true,
|
||||
"canBusPortPath": "COM6",
|
||||
"totalDrawerCount": 16,
|
||||
"canBusTwoExsit": true,
|
||||
"StorageCan": 1,
|
||||
//第二个can总线端口
|
||||
"canBusPortPathTwo": "COM9",
|
||||
"doorAddr": 0,
|
||||
"storageBoxAddr": 0,
|
||||
"fridgePortExist": false,
|
||||
"fridgePortPath": "COM3"
|
||||
"fridgePortPath": "COM3",
|
||||
"delayTime": 200
|
||||
},
|
||||
"drawer": {
|
||||
"single": [ 3 ],
|
||||
"single": [ 1,2,3 ],
|
||||
"weigh": [ 4 ],
|
||||
"box": [ 4 ],
|
||||
"label": [ 4 ]
|
||||
"label": [ 4 ],
|
||||
"returnDrawer": [12,14]
|
||||
},
|
||||
"fridge": {
|
||||
//冰箱温度区间
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@
|
|||
margin: 0 !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function registerMouseClickHandler(dotNetObjectReference) {
|
||||
document.addEventListener('click', function (event) {
|
||||
dotNetObjectReference.invokeMethodAsync('HandleMouseClick', event.clientX, event.clientY);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
@ -24,8 +31,8 @@
|
|||
<div id="app">加载中。。。</div>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href="" class="reload">Reload</a>
|
||||
发生错误,请点击重新加载
|
||||
<a href="" class="reload">重新加载</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
<script src="_framework/blazor.webview.js"></script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : zhongbuzhanqu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/08/2025 17:06:04
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for account_book
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `account_book`;
|
||||
CREATE TABLE `account_book` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`operator` int(11) NULL DEFAULT NULL COMMENT '操作人',
|
||||
`reviewer` int(11) NULL DEFAULT NULL COMMENT '审核人',
|
||||
`date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
|
||||
`drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品id',
|
||||
`eff_date` date NULL DEFAULT NULL COMMENT '效期',
|
||||
`manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
|
||||
`invoice_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号',
|
||||
`manu_quantity` int(11) NULL DEFAULT NULL COMMENT '批次数量',
|
||||
`total_quantity` int(11) NULL DEFAULT NULL COMMENT '药品总数量',
|
||||
`opera_quantity` int(11) NULL DEFAULT NULL COMMENT '操作数量',
|
||||
`type` int(2) NULL DEFAULT NULL COMMENT '操作类型1入库2出库3还药4盘点',
|
||||
`machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
|
||||
`insert_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||
`add_quantity` int(11) NULL DEFAULT NULL COMMENT '数量',
|
||||
`out_quantity` int(11) NULL DEFAULT NULL COMMENT '出库数量',
|
||||
`create_time` datetime NULL DEFAULT NULL,
|
||||
`yesterday_quantity` int(11) NULL DEFAULT NULL,
|
||||
`manu_stock` int(11) NULL DEFAULT NULL COMMENT '抽屉号',
|
||||
`total_stock` int(11) NULL DEFAULT NULL,
|
||||
`department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '取药科室',
|
||||
`create_date` datetime NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : hkcdb
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 26/08/2025 14:39:02
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for account_book_g2
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `account_book_g2`;
|
||||
CREATE TABLE `account_book_g2` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`drug_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`type` int(1) NULL DEFAULT 1 COMMENT '1领入2发出3日结4总结5转结',
|
||||
`department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '科室',
|
||||
`invoice_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备内记录凭证',
|
||||
`order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号或凭证号',
|
||||
`manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
|
||||
`eff_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '效期',
|
||||
`yesterday_quantity` int(11) NULL DEFAULT NULL COMMENT '上日结存',
|
||||
`add_quantity` int(11) NULL DEFAULT NULL COMMENT '收入',
|
||||
`out_quantity` int(11) NULL DEFAULT NULL COMMENT '发出',
|
||||
`manu_stock` int(11) NULL DEFAULT NULL COMMENT '批次结存',
|
||||
`total_stock` int(11) NULL DEFAULT NULL COMMENT '总结村',
|
||||
`user_id1` int(11) NULL DEFAULT NULL COMMENT '发药领药人id',
|
||||
`user_id2` int(11) NULL DEFAULT NULL COMMENT '复核人id',
|
||||
`machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
|
||||
`create_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
|
||||
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '插入更新时间',
|
||||
`shoushuJian` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手术间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 33034 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : zhongbuzhanqu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/08/2025 17:05:17
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hkc_changeshifts
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hkc_changeshifts`;
|
||||
CREATE TABLE `hkc_changeshifts` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`optDate` datetime NULL DEFAULT NULL COMMENT '操作时间',
|
||||
`FromOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班操作人',
|
||||
`FromRviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班审核人',
|
||||
`ToOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班操作人',
|
||||
`ToReviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班审核人',
|
||||
`ToDate` datetime NULL DEFAULT NULL COMMENT '接班时间',
|
||||
`State` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当班状态(0当前值班,1已交班)',
|
||||
`optState` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作状态(0新增,1修改)',
|
||||
`machine_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`Remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `index_optdate`(`optDate`) USING BTREE,
|
||||
INDEX `index_fromOperator`(`FromOperator`) USING BTREE,
|
||||
INDEX `index_fromReviewer`(`FromRviewer`) USING BTREE,
|
||||
INDEX `index_ToDate`(`ToDate`) USING BTREE,
|
||||
INDEX `index_toOperator`(`ToOperator`) USING BTREE,
|
||||
INDEX `index_toreviewer`(`ToReviewer`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of hkc_changeshifts
|
||||
-- ----------------------------
|
||||
INSERT INTO `hkc_changeshifts` VALUES (1, '2025-06-30 14:36:25', 'admin', NULL, '', NULL, '2025-07-01 09:21:57', '1', '0', 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (2, '2025-07-01 09:21:32', 'admin', NULL, NULL, NULL, '2025-07-01 09:30:17', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (3, '2025-07-01 09:29:57', 'test3', NULL, NULL, NULL, '2025-07-01 09:36:06', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (4, '2025-07-01 09:36:06', 'admin', NULL, NULL, NULL, '2025-07-01 09:39:27', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (5, '2025-07-01 09:39:27', 'test3', NULL, 'admin', NULL, '2025-07-01 10:26:19', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (6, '2025-07-01 10:26:19', 'admin', NULL, 'test3', NULL, '2025-08-15 10:12:01', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (7, '2025-08-15 10:12:01', 'test3', NULL, 'admin', NULL, '2025-08-15 10:21:54', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (8, '2025-08-15 10:21:54', 'admin', NULL, 'test3', NULL, '2025-08-16 16:38:35', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (9, '2025-08-16 16:38:35', 'test3', NULL, 'admin', NULL, '2025-08-16 18:37:06', '1', NULL, 'DM1', NULL);
|
||||
INSERT INTO `hkc_changeshifts` VALUES (23, '2025-08-16 18:37:06', 'admin', NULL, NULL, NULL, '2025-08-16 18:37:06', '0', NULL, 'DM1', '备注');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : zhongbuzhanqu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/08/2025 17:05:31
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hkc_changeshifts_drug
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hkc_changeshifts_drug`;
|
||||
CREATE TABLE `hkc_changeshifts_drug` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`changeShifts_id` int(11) NULL DEFAULT NULL COMMENT '交接班表主键',
|
||||
`drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`RealNumber` int(11) NULL DEFAULT NULL COMMENT '实物数',
|
||||
`orderNumber` int(11) NULL DEFAULT NULL COMMENT '处方数',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of hkc_changeshifts_drug
|
||||
-- ----------------------------
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : zhongbuzhanqu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/08/2025 17:04:19
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for plan
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `plan`;
|
||||
CREATE TABLE `plan` (
|
||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '套餐名',
|
||||
`Description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐描述',
|
||||
`AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
|
||||
`useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
|
||||
`operatorUser` int(11) NULL DEFAULT NULL COMMENT '操作人',
|
||||
`reviewerUser` int(11) NULL DEFAULT NULL COMMENT '审核人',
|
||||
`updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`machine_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`Id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : zhongbuzhanqu
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/08/2025 17:04:29
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for plan_details
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `plan_details`;
|
||||
CREATE TABLE `plan_details` (
|
||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`Plan_Id` int(11) NULL DEFAULT NULL COMMENT '外键',
|
||||
`Base_Quantity` int(11) NULL DEFAULT NULL COMMENT '基数',
|
||||
`Drug_Id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品ID',
|
||||
`AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
|
||||
`operatorUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
|
||||
`reviewerUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核人',
|
||||
`updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`Id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 146 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50740 (5.7.40-log)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : hkcdb
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50740 (5.7.40-log)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 26/08/2025 09:01:46
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for settingmanu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `settingmanu`;
|
||||
CREATE TABLE `settingmanu` (
|
||||
`ID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`Manu_Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名',
|
||||
`Manu_Icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单图标',
|
||||
`Path` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单页面地址',
|
||||
`Culture` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '中文zh-CN;英文en',
|
||||
`UseStatus` int(11) NULL DEFAULT NULL COMMENT '可用状态0不用;1在用',
|
||||
PRIMARY KEY (`ID`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of settingmanu
|
||||
-- ----------------------------
|
||||
INSERT INTO `settingmanu` VALUES (1, '登录设置', 'lock', '/manage/setting/login', 'zh-CN', 1);
|
||||
INSERT INTO `settingmanu` VALUES (2, '冰箱设置', 'build', '/manage/setting/Fridge', 'zh-CN', 0);
|
||||
INSERT INTO `settingmanu` VALUES (3, 'Login Setting', 'lock', '/manage/setting/login', 'en', 0);
|
||||
INSERT INTO `settingmanu` VALUES (4, 'Fridge Setting', 'build', '/manage/setting/Fridge', 'en', 0);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
DELETE from channel_list where machine_id='DM5';
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_1','DM5',1,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_1','DM5',1,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_2','DM5',2,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_2','DM5',2,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_3','DM5',3,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_3','DM5',3,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_4','DM5',4,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_4','DM5',4,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_5','DM5',5,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_5','DM5',5,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_6','DM5',6,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_6','DM5',6,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_7','DM5',7,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_7','DM5',7,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_8','DM5',8,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_8','DM5',8,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_9','DM5',9,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_9','DM5',9,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_10','DM5',10,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_10','DM5',10,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_11','DM5',11,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_11','DM5',11,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_12','DM5',12,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_12','DM5',12,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_13','DM5',13,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_13','DM5',13,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_14','DM5',14,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_14','DM5',14,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_15','DM5',15,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_15','DM5',15,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_16','DM5',16,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_16','DM5',16,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_17','DM5',17,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_17','DM5',17,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_18','DM5',18,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_18','DM5',18,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_19','DM5',19,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_19','DM5',19,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_20','DM5',20,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_20','DM5',20,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_21','DM5',21,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_21','DM5',21,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_22','DM5',22,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_22','DM5',22,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_23','DM5',23,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_23','DM5',23,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_24','DM5',24,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_24','DM5',24,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_25','DM5',25,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_25','DM5',25,2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_26','DM5',26,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_27','DM5',27,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_28','DM5',28,1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no,col_no) values('DM5_CHANNEL_29','DM5',29,1);
|
||||
|
||||
|
||||
delete from channel_stock where machine_id='DM5'
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
1)修改Role表里对应的角色permissions字段值
|
||||
UPDATE `role` set permissions='11,12,13,14,23,24,32,33,34,40,41,42,43,44,50,51,52,53,21,35,45,61,62,63,66,46,47,36,37,48,49,15' WHERE machine_id='DM1'
|
||||
2)chan_stock表
|
||||
|
||||
|
||||
|
||||
DELETE from channel_stock where machine_id='DM1'
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_1','DM1',1,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_2','DM1',1,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_3','DM1',1,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_4','DM1',1,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_5','DM1',1,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_6','DM1',1,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_7','DM1',1,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_8','DM1',1,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_9','DM1',1,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_10','DM1',2,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_11','DM1',2,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_12','DM1',2,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_13','DM1',2,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_14','DM1',2,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_15','DM1',2,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_16','DM1',2,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_17','DM1',2,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_18','DM1',2,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_19','DM1',3,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_20','DM1',3,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_21','DM1',3,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_22','DM1',3,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_23','DM1',3,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_24','DM1',3,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_25','DM1',3,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_26','DM1',3,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_27','DM1',3,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_28','DM1',4,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_29','DM1',4,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_30','DM1',4,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_31','DM1',4,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_32','DM1',4,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_33','DM1',4,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_34','DM1',4,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_35','DM1',4,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_36','DM1',4,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_37','DM1',5,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_38','DM1',5,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_39','DM1',5,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_40','DM1',5,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_41','DM1',5,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_42','DM1',5,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_43','DM1',5,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_44','DM1',5,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_45','DM1',5,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_46','DM1',6,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_47','DM1',6,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_48','DM1',6,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_49','DM1',6,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_50','DM1',6,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_51','DM1',6,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_52','DM1',6,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_53','DM1',6,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_54','DM1',6,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_55','DM1',7,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_56','DM1',7,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_57','DM1',7,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_58','DM1',7,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_59','DM1',7,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_60','DM1',7,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_61','DM1',7,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_62','DM1',7,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_63','DM1',7,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_64','DM1',8,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_65','DM1',8,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_66','DM1',8,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_67','DM1',8,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_68','DM1',8,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_69','DM1',8,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_70','DM1',8,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_71','DM1',8,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_72','DM1',8,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_73','DM1',9,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_74','DM1',9,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_75','DM1',9,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_76','DM1',9,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_77','DM1',9,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_78','DM1',9,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_79','DM1',9,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_80','DM1',9,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_81','DM1',9,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_82','DM1',10,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_83','DM1',10,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_84','DM1',10,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_85','DM1',10,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_86','DM1',10,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_87','DM1',10,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_88','DM1',10,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_89','DM1',10,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_90','DM1',10,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_91','DM1',11,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_92','DM1',11,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_93','DM1',11,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_94','DM1',11,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_95','DM1',11,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_96','DM1',11,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_97','DM1',11,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_98','DM1',11,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_99','DM1',11,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_100','DM1',12,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_101','DM1',12,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_102','DM1',12,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_103','DM1',12,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_104','DM1',12,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_105','DM1',12,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_106','DM1',12,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_107','DM1',12,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_108','DM1',12,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_109','DM1',13,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_110','DM1',13,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_111','DM1',13,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_112','DM1',13,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_113','DM1',13,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_114','DM1',13,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_115','DM1',13,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_116','DM1',13,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_117','DM1',13,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_118','DM1',14,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_119','DM1',14,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_120','DM1',14,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_121','DM1',14,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_122','DM1',14,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_123','DM1',14,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_124','DM1',14,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_125','DM1',14,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_126','DM1',14,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_127','DM1',15,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_128','DM1',15,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_129','DM1',15,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_130','DM1',15,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_131','DM1',15,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_132','DM1',15,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_133','DM1',15,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_134','DM1',15,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_135','DM1',15,9);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_136','DM1',16,1);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_137','DM1',16,2);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_138','DM1',16,3);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_139','DM1',16,4);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_140','DM1',16,5);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_141','DM1',16,6);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_142','DM1',16,7);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_143','DM1',16,8);
|
||||
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_144','DM1',16,9);
|
||||
|
||||
UPDATE channel_stock set board_type=2 where machine_id='DM1' and row_no<12;
|
||||
UPDATE channel_stock set drawer_type=2 WHERE machine_id='DM1' and row_no<12 and row_no%2=0;
|
||||
|
||||
|
||||
delete from channel_list where machine_id='DM5';
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_1','DM5',1);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_2','DM5',2);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_3','DM5',3);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_4','DM5',4);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_5','DM5',5);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_6','DM5',6);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_7','DM5',7);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_8','DM5',8);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_9','DM5',9);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_10','DM5',10);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_11','DM5',11);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_12','DM5',12);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_13','DM5',13);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_14','DM5',14);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_15','DM5',15);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_16','DM5',16);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_17','DM5',17);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_18','DM5',18);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_19','DM5',19);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_20','DM5',20);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_21','DM5',21);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_22','DM5',22);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_23','DM5',23);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_24','DM5',24);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_25','DM5',25);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_26','DM5',26);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_27','DM5',27);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_28','DM5',28);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_29','DM5',29);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_30','DM5',30);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_31','DM5',31);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_32','DM5',32);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_33','DM5',33);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_34','DM5',34);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_35','DM5',35);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_36','DM5',36);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_37','DM5',37);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_38','DM5',38);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_39','DM5',39);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_40','DM5',40);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_41','DM5',41);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_42','DM5',42);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_43','DM5',43);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_44','DM5',44);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_45','DM5',45);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_46','DM5',46);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_47','DM5',47);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_48','DM5',48);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_49','DM5',49);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_50','DM5',50);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_51','DM5',51);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_52','DM5',52);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_53','DM5',53);
|
||||
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_54','DM5',54);
|
||||
|
||||
|
||||
3)修改drug_manu_no表中eff_date字段长度为20
|
||||
|
||||
4)account_book表添加字段
|
||||
add_quantity int 11 0 True False False 0 数量 0 False False False False False False
|
||||
out_quantity int 11 0 True False False 0 出库数量 0 False False False False False False
|
||||
create_time datetime 0 0 True False False 0 0 False False False False False False
|
||||
yesterday_quantity int 11 0 True False False 0 0 False False False False False False
|
||||
manu_stock int 11 0 True False False 0 抽屉号 0 False False False False False False
|
||||
total_stock int 11 0 True False False 0 0 False False False False False False
|
||||
department varchar 255 0 True False False 0 取药科室 utf8mb4 utf8mb4_general_ci 0 False False False False False False
|
||||
create_date datetime 0 0 True False False 0 0 False False False False False False
|
||||
|
||||
|
||||
5)dm_machine_record表添加字段
|
||||
stock_quantity float 0 0 True False False 0 操作后的库存 0 False False False False False False
|
||||
check_quantity float 0 0 True False False 0 盘点库存 0 False False False False False False
|
||||
manunoQuantity float 0 0 True False False 0 批号库存 0 False False False False False False
|
||||
|
||||
6)hkc_order_finish表添加字段
|
||||
operator varchar 50 0 True False False 0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue