/// <summary> /// 入库计划信息拆分 /// </summary> protected int SplitStockPlan() { if (!this.IsValid()) { return(-1); } this.splitPlan = new List <Neusoft.HISFC.Models.Pharmacy.StockPlan>(); for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++) { if (this.neuSpread1_Sheet1.Cells[i, 0].Text == "") { continue; } Neusoft.HISFC.Models.Pharmacy.StockPlan alterStockPlan = this.originalStockPlan.Clone(); //对于非原始记录 设置流水号为空 保存时进行插入 避免一直进行更新操作 if (i > 0) { alterStockPlan.ID = ""; } alterStockPlan.Company = this.neuSpread1_Sheet1.Rows[i].Tag as Neusoft.FrameWork.Models.NeuObject; alterStockPlan.StockApproveQty = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[i, 1].Text) * this.originalStockPlan.Item.PackQty; this.splitPlan.Add(alterStockPlan); } return(1); }
/// <summary> /// 打印函数 /// </summary> /// <param name="al">打印数组</param> /// <param name="i">第几页</param> /// <param name="count">总页数</param> /// <param name="operCode">制单人</param> private void PrintStockplan(ArrayList al, int inow, int icount, string operCode) { if (al.Count <= 0) { MessageBox.Show("没有打印的数据!"); return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.StockPlan stockPlan = (Neusoft.HISFC.Models.Pharmacy.StockPlan)al[0]; Neusoft.HISFC.BizLogic.Manager.Constant constantMgr = new Neusoft.HISFC.BizLogic.Manager.Constant(); Neusoft.HISFC.BizLogic.Manager.Department deptMgr = new Neusoft.HISFC.BizLogic.Manager.Department(); Neusoft.HISFC.BizProcess.Integrate.Pharmacy itemMgr = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); string strHos = constantMgr.GetHospitalName(); string dosageID = string.Empty; //剂型 if (stockPlan.State == "2") { this.lbl0.Text = strHos + "药品采购审批单"; } else { this.lbl0.Text = strHos + "药品采购计划单"; //label2.Visible = false; } #region label赋值 if (this.IsReprint) { this.lbl0.Text = this.lbl0.Text + "(补打)"; } //DateTime sysTime = this.itemMgr.GetDateTimeFromSysDateTime(); //this.lb11.Text = "计划科室 " + inPlan.Dept+this.deptMgr.get + " 计划人 " + inPlan.PlanOper.ID; this.lb11.Text = " 计划人: " + stockPlan.Oper.Name; this.lb12.Text = "计划日期:" + this.itemMgr.GetDateTimeFromSysDateTime().ToString("yyyy-MM-dd"); this.label2.Text = "采购日期:" + stockPlan.StockOper.OperTime.ToString("yyyy-MM-dd"); this.lb36.Text = "第" + inow.ToString() + "页/共" + icount.ToString() + "页"; this.label1.Text = "单据号:" + stockPlan.BillNO; this.label3.Text = "科室:" + deptMgr.GetDeptmentById(stockPlan.Dept.ID); #endregion #region farpoint赋值 decimal sumNum5 = 0; decimal sumNum8 = 0; decimal sumNum9 = 0; this.sheetView1.RowCount = 0; #region {1EC17564-2FAD-4a77-97AC-4C57076888B2} FarPoint.Win.Spread.CellType.NumberCellType numberCellType1 = new FarPoint.Win.Spread.CellType.NumberCellType(); numberCellType1.DecimalPlaces = 4; this.sheetView1.Columns[6].CellType = numberCellType1; this.sheetView1.Columns[7].CellType = numberCellType1; this.sheetView1.Columns[8].CellType = numberCellType1; #endregion for (int i = 0; i < al.Count; i++) { this.sheetView1.AddRows(i, 1); Neusoft.HISFC.Models.Pharmacy.StockPlan info = al[i] as Neusoft.HISFC.Models.Pharmacy.StockPlan; this.sheetView1.Cells[i, 0].Text = info.Item.ID; // info.Item.NameCollection.UserCode;//药品自定义码 this.sheetView1.Cells[i, 1].Text = info.Item.Name; //药品名称 this.sheetView1.Cells[i, 2].Text = info.Item.Specs; //规格 if (info.Item.PackQty == 0) { info.Item.PackQty = 1; } decimal count = 0, count2 = 0, count3 = 0; count = info.StockApproveQty / info.Item.PackQty; count2 = (info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice); count3 = (info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice); this.sheetView1.Cells[i, 3].Text = info.Item.PackUnit;//单位 // Neusoft.HISFC.BizProcess.Integrate.Pharmacy itemMgr = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); dosageID = ((Neusoft.HISFC.Models.Pharmacy.Item)itemMgr.GetItem(info.Item.ID)).DosageForm.ID; this.sheetView1.Cells[i, 4].Text = ((Neusoft.FrameWork.Models.NeuObject)constantMgr.GetConstant("DOSAGEFORM", dosageID)).Name; //info.Item.DosageForm.Name; //剂型 this.sheetView1.Cells[i, 5].Text = (info.StockApproveQty / info.Item.PackQty).ToString(); //计划数量 this.sheetView1.Cells[i, 6].Text = info.StockPrice.ToString(); //计划购入价 // info.Item.PackUnit;// this.sheetView1.Cells[i, 7].Text = info.Item.Price.ToString(); //参考零售价 this.sheetView1.Cells[i, 8].Text = ((info.StockApproveQty / info.Item.PackQty) * (info.StockPrice)).ToString(); //计划金额 this.sheetView1.Cells[i, 9].Text = ((info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice)).ToString(); //零售金额 //if (info.Item.Product.Company.Name != "") // this.sheetView1.Cells[i, 7].Text = info.Item.Product.Company.Name; //供货公司; //else // this.sheetView1.Cells[i, 7].Text = "未选择"; if (info.Company.Name != "") { this.sheetView1.Cells[i, 10].Text = info.Company.Name; //供货公司; } else { this.sheetView1.Cells[i, 10].Text = "未选择"; } //if (info.Item.Product.Producer.Name != "") // this.sheetView1.Cells[i, 8].Text = info.Item.Product.Producer.Name; //生产厂家 //else // this.sheetView1.Cells[i, 8].Text = "未选择"; sumNum5 = sumNum5 + count; sumNum8 = sumNum8 + count2; sumNum9 = sumNum9 + count3; } this.sheetView1.RowCount = al.Count + 1; this.sheetView1.Cells[al.Count, 0].Text = "合计"; this.sheetView1.Cells[al.Count, 1].Text = "共" + al.Count + "行"; //行数; this.sheetView1.Cells[al.Count, 5].Text = sumNum5.ToString(); //购入数量合计 this.sheetView1.Cells[al.Count, 8].Text = sumNum8.ToString(); //购入金额合计 this.sheetView1.Cells[al.Count, 9].Text = sumNum9.ToString(); //零售金额合计 //宽度 //this.panel4.Width = this.Width - 3; this.fpSpread1.Width = this.panel1.Width - 10; this.fpSpread1.Height = (int)this.sheetView1.RowHeader.Rows[0].Height + (int)(this.sheetView1.Rows[0].Height * (al.Count + 1)) + 10; #endregion #region 打印函数 Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); Neusoft.HISFC.Components.Common.Classes.Function.GetPageSize("PhaInplan", ref p); p.PrintPage(5, 0, this.panel1); #endregion }