frmTaskPriceAuditManager.cs 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. using System.Collections.Generic;
  2. using System.ComponentModel;
  3. using System.Data;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;using Pur.Entity;
  9. using Infragistics.Win.UltraWinGrid;
  10. using System.Collections;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Pur.configure;
  14. using Pur.Entity.configureEntity;
  15. using com.hnshituo.pur.vo;
  16. using Pur.Pop_upWindow;
  17. using Pur.Entity.Purplan;
  18. using System;
  19. using Infragistics.Win;
  20. namespace Pur.pur_plan
  21. {
  22. public partial class frmTaskPriceAuditManager : FrmPmsBase
  23. {
  24. public frmTaskPriceAuditManager()
  25. {
  26. InitializeComponent();
  27. ultraGrid1.DisplayLayout.Bands[0].Override.AllowUpdate = DefaultableBoolean.False;
  28. }
  29. //菜单按钮事件
  30. public override void ToolBar_Click(object sender, string ToolbarKey)
  31. {
  32. switch (ToolbarKey)
  33. {
  34. case "Query":
  35. getTaskPriceAudit();
  36. break;
  37. case "Update":
  38. Upd_TaskRecord();
  39. break;
  40. case "Submittal":
  41. Sub_TaskRecord();
  42. break;
  43. case "Confirm":
  44. Con_TaskRecord();
  45. break;
  46. }
  47. }
  48. /// <summary>
  49. /// 查询
  50. /// </summary>
  51. private void getTaskPriceAudit()
  52. {
  53. PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
  54. if (txt_id.Text != "")
  55. {
  56. TaskPriceAuditEntity.Id = txt_id.Text;
  57. }
  58. if (Cop_taskId.Text != "")
  59. {
  60. TaskPriceAuditEntity.TaskId = Cop_taskId.Text;
  61. }
  62. if (Cop_taskName.Text != "")
  63. {
  64. TaskPriceAuditEntity.TaskName = Cop_taskName.Text;
  65. }
  66. if (txt_STATUS.Value != null && txt_STATUS.Value.ToString() !="")
  67. {
  68. TaskPriceAuditEntity.Status = txt_STATUS.Value.ToString();
  69. }
  70. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "getTaskPriceAudit", new object[] { TaskPriceAuditEntity });
  71. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  72. }
  73. /// <summary>
  74. /// 修改
  75. /// </summary>
  76. private void Upd_TaskRecord()
  77. {
  78. UltraGridRow uge = ultraGrid1.ActiveRow;
  79. if (uge == null)
  80. {
  81. MessageUtil.ShowTips("请选择一行数据");
  82. return;
  83. }
  84. if (uge.Cells["STATUS"].Value.ToString().Trim() != "待提报")
  85. {
  86. MessageUtil.ShowTips("不是待提报状态,不能修改");
  87. return;
  88. }
  89. PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
  90. TaskPriceAuditEntity.Id = uge.Cells["ID"].Value.ToString();
  91. TaskPriceAuditEntity.ReqOrgName = txt_REQ_ORG_NAME.Text;//填报单位名称
  92. TaskPriceAuditEntity.Remark = txt_REMARK.Text;//备注
  93. TaskPriceAuditEntity.TaskAmt = txt_TASK_AMT.Text.Trim() == "" ? 0 : double.Parse(txt_TASK_AMT.Text);//金额
  94. TaskPriceAuditEntity.TaskQty = txt_TASK_QTY.Text.Trim() == "" ? 0 : double.Parse(txt_TASK_QTY.Text);//数量
  95. TaskPriceAuditEntity.MngOrgName = txt_MNG_ORG_NAME.Text;//定价项目
  96. if (dt_REQ_DATE.Value != null)
  97. {
  98. TaskPriceAuditEntity.ReqDate = (DateTime)dt_REQ_DATE.Value;//申请日期
  99. }
  100. TaskPriceAuditEntity.ProcRecord = txt_procRecord.Text;//定价内容
  101. TaskPriceAuditEntity.TaskName = txt_taskName.Text;//任务名称
  102. TaskPriceAuditEntity.TaskId = txt_taskId.Text;//任务单号
  103. if (mngOrgId != null)
  104. {
  105. TaskPriceAuditEntity.ReqOrgId = mngOrgId;
  106. }
  107. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
  108. if (crt.Resultcode != 0)
  109. {
  110. MessageUtil.ShowTips("价格审批修改失败!");
  111. return;
  112. }
  113. else
  114. {
  115. MessageUtil.ShowTips("价格审批修改成功!");
  116. }
  117. getTaskPriceAudit();
  118. }
  119. /// <summary>
  120. /// 提报
  121. /// </summary>
  122. private void Sub_TaskRecord()
  123. {
  124. UltraGridRow uge = ultraGrid1.ActiveRow;
  125. if (uge == null)
  126. {
  127. MessageUtil.ShowTips("请选择一条记录!");
  128. return;
  129. }
  130. PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
  131. TaskPriceAuditEntity.Status = "2";
  132. TaskPriceAuditEntity.Id = uge.Cells["id"].Value.ToString();
  133. TaskPriceAuditEntity.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  134. TaskPriceAuditEntity.UpdateTime = DateTime.Now;
  135. TaskPriceAuditEntity.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  136. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
  137. if (crt.Resultcode == 0)
  138. {
  139. MessageUtil.ShowTips("提报成功!");
  140. }
  141. else
  142. {
  143. MessageUtil.ShowTips("提报失败!" + crt.Resultmsg);
  144. return;
  145. }
  146. getTaskPriceAudit();
  147. }
  148. /// <summary>
  149. /// 审批
  150. /// </summary>
  151. private void Con_TaskRecord()
  152. {
  153. UltraGridRow uge = ultraGrid1.ActiveRow;
  154. if (uge == null)
  155. {
  156. MessageUtil.ShowTips("请选择一条纪要信息!");
  157. return;
  158. }
  159. frmExamineShow Fex = new frmExamineShow();
  160. Fex.ShowDialog();
  161. if (Fex.Status == null)
  162. {
  163. return;
  164. }
  165. if (!Fex.Status.Equals("2"))
  166. {
  167. Fex.Status = "1";//审批不通过
  168. }
  169. else
  170. {
  171. Fex.Status = "3";//审批通过
  172. }
  173. PurTaskPriceAuditEntity TaskPriceAuditEntity = new PurTaskPriceAuditEntity();
  174. TaskPriceAuditEntity.Status = Fex.Status;
  175. TaskPriceAuditEntity.Id = uge.Cells["id"].Value.ToString();
  176. TaskPriceAuditEntity.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  177. TaskPriceAuditEntity.UpdateTime = DateTime.Now;
  178. TaskPriceAuditEntity.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  179. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskPriceAuditService", "doUpdate", new object[] { TaskPriceAuditEntity });
  180. if (crt.Resultcode == 0)
  181. {
  182. if (Fex.Status == "1")
  183. {
  184. MessageUtil.ShowTips("审批不通过!");
  185. }
  186. else
  187. {
  188. MessageUtil.ShowTips("审批通过!");
  189. }
  190. }
  191. else
  192. {
  193. MessageUtil.ShowTips("审批失败!");
  194. return;
  195. }
  196. getTaskPriceAudit();
  197. }
  198. /// <summary>
  199. /// 初始化加载界面
  200. /// </summary>
  201. /// <param name="sender"></param>
  202. /// <param name="e"></param>
  203. private void frmSummaryM_Load(object sender, EventArgs e)
  204. {
  205. Init();
  206. }
  207. /// <summary>
  208. /// 界面权限分配
  209. /// </summary>
  210. private void Init()
  211. {
  212. switch (this.CustomInfo.ToString().Trim())
  213. {
  214. case "@Confirming":
  215. #region
  216. ultraPanel2.Visible = false;
  217. #endregion
  218. break;
  219. }
  220. }
  221. /// <summary>
  222. /// 价格审批激活事件
  223. /// </summary>
  224. /// <param name="sender"></param>
  225. /// <param name="e"></param>
  226. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  227. {
  228. txt_REMARK.Text = ultraGrid1.ActiveRow.Cells["REMARK"].Value.ToString();
  229. txt_TASK_AMT.Text = ultraGrid1.ActiveRow.Cells["TASKAMT"].Value.ToString();
  230. txt_TASK_QTY.Text = ultraGrid1.ActiveRow.Cells["TASKQTY"].Value.ToString();
  231. txt_MNG_ORG_NAME.Text = ultraGrid1.ActiveRow.Cells["MNGORGNAME"].Value.ToString();
  232. txt_REQ_ORG_NAME.Text = ultraGrid1.ActiveRow.Cells["REQORGNAME"].Value.ToString();
  233. dt_REQ_DATE.Text = ultraGrid1.ActiveRow.Cells["REQDATE"].Value.ToString();
  234. txt_procRecord.Text = ultraGrid1.ActiveRow.Cells["procRecord"].Value.ToString();
  235. txt_taskName.Text = ultraGrid1.ActiveRow.Cells["taskName"].Value.ToString();
  236. txt_taskId.Text = ultraGrid1.ActiveRow.Cells["taskId"].Value.ToString();
  237. }
  238. /// <summary>
  239. /// 科室弹窗
  240. /// </summary>
  241. /// <param name="sender"></param>
  242. /// <param name="e"></param>
  243. string mngOrgId = null;
  244. private void txt_REQ_ORG_NAME_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  245. {
  246. frmdepartment fdt = new frmdepartment(ob);
  247. fdt.ShowDialog();
  248. if (fdt.BuyerUnitDesc == null)
  249. return;
  250. txt_REQ_ORG_NAME.Text = fdt.BuyerUnitDesc;
  251. mngOrgId = fdt.BuyerUnitCode;
  252. }
  253. }
  254. }