| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;using Pur.Entity;
- using Infragistics.Win.UltraWinGrid;
- using System.Collections;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Pur.configure;
- using Pur.Entity.configureEntity;
- using com.hnshituo.pur.vo;
- using Pur.Pop_upWindow;
- using Pur.Entity.Purplan;
- using System;
- using Infragistics.Win;
- namespace Pur.pur_plan
- {
- public partial class frmTaskPriceAuditManager : FrmPmsBase
- {
- public frmTaskPriceAuditManager()
- {
- InitializeComponent();
- ultraGrid1.DisplayLayout.Bands[0].Override.AllowUpdate = DefaultableBoolean.False;
- }
- //菜单按钮事件
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- getTaskPriceAudit();
- break;
- case "Update":
- Upd_TaskRecord();
- break;
- case "Submittal":
- Sub_TaskRecord();
- break;
- case "Confirm":
- Con_TaskRecord();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void getTaskPriceAudit()
- {
- PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
- if (txt_id.Text != "")
- {
- TaskPriceAuditEntity.Id = txt_id.Text;
- }
- if (Cop_taskId.Text != "")
- {
- TaskPriceAuditEntity.TaskId = Cop_taskId.Text;
- }
- if (Cop_taskName.Text != "")
- {
- TaskPriceAuditEntity.TaskName = Cop_taskName.Text;
- }
- if (txt_STATUS.Value != null && txt_STATUS.Value.ToString() !="")
- {
- TaskPriceAuditEntity.Status = txt_STATUS.Value.ToString();
- }
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "getTaskPriceAudit", new object[] { TaskPriceAuditEntity });
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
- /// <summary>
- /// 修改
- /// </summary>
- private void Upd_TaskRecord()
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- if (uge == null)
- {
- MessageUtil.ShowTips("请选择一行数据");
- return;
- }
- if (uge.Cells["STATUS"].Value.ToString().Trim() != "待提报")
- {
- MessageUtil.ShowTips("不是待提报状态,不能修改");
- return;
- }
- PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
- TaskPriceAuditEntity.Id = uge.Cells["ID"].Value.ToString();
- TaskPriceAuditEntity.ReqOrgName = txt_REQ_ORG_NAME.Text;//填报单位名称
- TaskPriceAuditEntity.Remark = txt_REMARK.Text;//备注
- TaskPriceAuditEntity.TaskAmt = txt_TASK_AMT.Text.Trim() == "" ? 0 : double.Parse(txt_TASK_AMT.Text);//金额
- TaskPriceAuditEntity.TaskQty = txt_TASK_QTY.Text.Trim() == "" ? 0 : double.Parse(txt_TASK_QTY.Text);//数量
- TaskPriceAuditEntity.MngOrgName = txt_MNG_ORG_NAME.Text;//定价项目
- if (dt_REQ_DATE.Value != null)
- {
- TaskPriceAuditEntity.ReqDate = (DateTime)dt_REQ_DATE.Value;//申请日期
- }
- TaskPriceAuditEntity.ProcRecord = txt_procRecord.Text;//定价内容
- TaskPriceAuditEntity.TaskName = txt_taskName.Text;//任务名称
- TaskPriceAuditEntity.TaskId = txt_taskId.Text;//任务单号
- if (mngOrgId != null)
- {
- TaskPriceAuditEntity.ReqOrgId = mngOrgId;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("价格审批修改失败!");
- return;
- }
- else
- {
- MessageUtil.ShowTips("价格审批修改成功!");
- }
- getTaskPriceAudit();
- }
- /// <summary>
- /// 提报
- /// </summary>
- private void Sub_TaskRecord()
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- if (uge == null)
- {
- MessageUtil.ShowTips("请选择一条记录!");
- return;
- }
- PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
- TaskPriceAuditEntity.Status = "2";
- TaskPriceAuditEntity.Id = uge.Cells["id"].Value.ToString();
- TaskPriceAuditEntity.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- TaskPriceAuditEntity.UpdateTime = DateTime.Now;
- TaskPriceAuditEntity.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("提报成功!");
- }
- else
- {
- MessageUtil.ShowTips("提报失败!" + crt.Resultmsg);
- return;
- }
- getTaskPriceAudit();
- }
- /// <summary>
- /// 审批
- /// </summary>
- private void Con_TaskRecord()
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- if (uge == null)
- {
- MessageUtil.ShowTips("请选择一条纪要信息!");
- return;
- }
- frmExamineShow Fex = new frmExamineShow();
- Fex.ShowDialog();
- if (Fex.Status == null)
- {
- return;
- }
- if (!Fex.Status.Equals("2"))
- {
- Fex.Status = "1";//审批不通过
- }
- else
- {
- Fex.Status = "3";//审批通过
- }
-
- PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
- TaskPriceAuditEntity.Status = Fex.Status;
- TaskPriceAuditEntity.Id = uge.Cells["id"].Value.ToString();
- TaskPriceAuditEntity.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- TaskPriceAuditEntity.UpdateTime = DateTime.Now;
- TaskPriceAuditEntity.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
- if (crt.Resultcode == 0)
- {
- if (Fex.Status == "1")
- {
- MessageUtil.ShowTips("审批不通过!");
- }
- else
- {
- MessageUtil.ShowTips("审批通过!");
- }
- }
- else
- {
- MessageUtil.ShowTips("审批失败!");
- return;
- }
- getTaskPriceAudit();
- }
- /// <summary>
- /// 初始化加载界面
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void frmSummaryM_Load(object sender, EventArgs e)
- {
- Init();
- }
- /// <summary>
- /// 界面权限分配
- /// </summary>
- private void Init()
- {
- switch (this.CustomInfo.ToString().Trim())
- {
- case "@Confirming":
- #region
- ultraPanel2.Visible = false;
- #endregion
- break;
- }
- }
- /// <summary>
- /// 价格审批激活事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- txt_REMARK.Text = ultraGrid1.ActiveRow.Cells["REMARK"].Value.ToString();
- txt_TASK_AMT.Text = ultraGrid1.ActiveRow.Cells["TASKAMT"].Value.ToString();
- txt_TASK_QTY.Text = ultraGrid1.ActiveRow.Cells["TASKQTY"].Value.ToString();
- txt_MNG_ORG_NAME.Text = ultraGrid1.ActiveRow.Cells["MNGORGNAME"].Value.ToString();
- txt_REQ_ORG_NAME.Text = ultraGrid1.ActiveRow.Cells["REQORGNAME"].Value.ToString();
- dt_REQ_DATE.Text = ultraGrid1.ActiveRow.Cells["REQDATE"].Value.ToString();
- txt_procRecord.Text = ultraGrid1.ActiveRow.Cells["procRecord"].Value.ToString();
- txt_taskName.Text = ultraGrid1.ActiveRow.Cells["taskName"].Value.ToString();
- txt_taskId.Text = ultraGrid1.ActiveRow.Cells["taskId"].Value.ToString();
- }
- /// <summary>
- /// 科室弹窗
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- string mngOrgId = null;
- private void txt_REQ_ORG_NAME_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- frmdepartment fdt = new frmdepartment(ob);
- fdt.ShowDialog();
- if (fdt.BuyerUnitDesc == null)
- return;
- txt_REQ_ORG_NAME.Text = fdt.BuyerUnitDesc;
- mngOrgId = fdt.BuyerUnitCode;
- }
- }
- }
|