FrmGpExaminJudge.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.YdmStuffManage.Entity;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinEditors;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. namespace Core.StlMes.Client.YdmStuffManage
  18. {
  19. public partial class FrmGpExaminJudge : FrmBase
  20. {
  21. private QcmJhyElementsCtrl qcmJhyCtrl;
  22. private Dal _d;
  23. public FrmGpExaminJudge()
  24. {
  25. InitializeComponent();
  26. }
  27. private void FrmGpExaminJudge_Load(object sender, EventArgs e)
  28. {
  29. EntityHelper.ShowGridCaption<QcmGpJudgeChangeEntity>(ultraGrid2.DisplayLayout.Bands[0]);
  30. qcmJhyCtrl = new QcmJhyElementsCtrl(splitContainer1.Panel2,ob, JudgeType.SteelMakingChem);
  31. _d = new Dal(ob);
  32. }
  33. /// <summary>
  34. /// 重写基类方法
  35. /// </summary>
  36. /// <param name="sender"></param>
  37. /// <param name="ToolbarKey"></param>
  38. public override void ToolBar_Click(object sender, string ToolbarKey)
  39. {
  40. switch (ToolbarKey)
  41. {
  42. case "Query":
  43. if (!CheckQuery()) return;
  44. doQueryData();
  45. break;
  46. case "ApplyJudgePass":
  47. applyJudgePass();
  48. break;
  49. case "ApplyJudgeNoPass":
  50. applyJudgeNoPass();
  51. break;
  52. case "cancelApplyJudge":
  53. cancelApplyJudge();
  54. break;
  55. case"Print":
  56. printData();
  57. break;
  58. case "Export":
  59. GridHelper.ulGridToExcel(ultraGrid2, "管坯审批信息");
  60. break;
  61. case "Close":
  62. close();
  63. break;
  64. }
  65. }
  66. /// <summary>
  67. /// 管坯判定书打印
  68. /// </summary>
  69. private void printData()
  70. {
  71. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  72. if (uRow == null)
  73. {
  74. return;
  75. }
  76. if(!uRow.Cells["AgreeFlag"].Text.Equals("终审通过"))
  77. {
  78. MessageUtil.ShowTips("未终审通过的不允许打印!");
  79. return;
  80. }
  81. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepGpCertificateGaiPan.cpt&format=pdf&JUDGE_ID="
  82. + uRow.Cells["JudgeId"].Text + "&JUDGE_STOVE_NO_GP=" + uRow.Cells["JudgeStoveNoGp"].Text + "&PRO_PLAN_ID="
  83. + uRow.Cells["ProPlanId"].Text + "&GX_PLAN_NO=" + uRow.Cells["GxPlanNo"].Text;
  84. ;
  85. FrmExcel fre = new FrmExcel(this.ob, strurl);
  86. fre.AutoSize = true;
  87. fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  88. fre.WindowState = FormWindowState.Maximized;
  89. fre.Show();
  90. }
  91. /// <summary>
  92. /// 查询
  93. /// </summary>
  94. private void doQueryData()
  95. {
  96. string stoveNo = "";
  97. string judgeNo = "";
  98. string judgeNoJudge = "";
  99. qcmJhyCtrl.ClearData();
  100. if (chkStoveNo.Checked && txtStoveNo.Text.Trim() != "")
  101. {
  102. stoveNo = this.txtStoveNo.Text.Trim();
  103. }
  104. if (chkjudgeNo.Checked && txtjudgeNo.Text.Trim() != "")
  105. {
  106. judgeNo = this.txtjudgeNo.Text.Trim();
  107. }
  108. if (chkjudgeNo1.Checked && txtjudgeNo1.Text.Trim() != "")
  109. {
  110. judgeNoJudge = this.txtjudgeNo1.Text.Trim();
  111. }
  112. ArrayList parmList = new ArrayList();
  113. parmList.Add(stoveNo);
  114. parmList.Add(judgeNo);
  115. parmList.Add(judgeNoJudge);
  116. parmList.Add(this.ultraOptionSet2.CheckedItem.DataValue.ToString());
  117. List<QcmGpJudgeChangeEntity> listSource = EntityHelper.GetData<QcmGpJudgeChangeEntity>(
  118. "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge.doQueryData", new object[] { parmList,this.CustomInfo }, this.ob);
  119. QcmGpJudgeChangeEntitybindingSource.DataSource = listSource;
  120. }
  121. /// <summary>
  122. /// 审批通过
  123. /// </summary>
  124. private void applyJudgePass()
  125. {
  126. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  127. if (uRow == null)
  128. {
  129. return;
  130. }
  131. QcmGpJudgeChangeEntity qcmGpJudgeTity = (QcmGpJudgeChangeEntity)uRow.ListObject;
  132. string qcmGpJudgeEntity = JSONFormat.Format(qcmGpJudgeTity);
  133. CoreClientParam ccp = new CoreClientParam();
  134. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge";
  135. ccp.MethodName = "applyJudgePass";
  136. ccp.ServerParams = new object[] { qcmGpJudgeEntity,this.UserInfo.GetUserName() };
  137. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  138. if (ccp.ReturnCode != -1)
  139. {
  140. if (ccp.ReturnInfo.Equals("审批通过!"))
  141. {
  142. doQueryData();
  143. MessageUtil.ShowTips(ccp.ReturnInfo);
  144. }
  145. else
  146. {
  147. MessageUtil.ShowTips(ccp.ReturnInfo);
  148. }
  149. }
  150. }
  151. /// <summary>
  152. /// 审批不通过
  153. /// </summary>
  154. private void applyJudgeNoPass()
  155. {
  156. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  157. if (uRow == null)
  158. {
  159. return;
  160. }
  161. QcmGpJudgeChangeEntity qcmGpJudgeTity = (QcmGpJudgeChangeEntity)uRow.ListObject;
  162. if (qcmGpJudgeTity.AgreeMemo.Equals(""))
  163. {
  164. MessageUtil.ShowTips("审批不通过,请填写审批说明!");
  165. return;
  166. }
  167. string qcmGpJudgeEntity = JSONFormat.Format(qcmGpJudgeTity);
  168. CoreClientParam ccp = new CoreClientParam();
  169. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge";
  170. ccp.MethodName = "applyJudgeNoPass";
  171. ccp.ServerParams = new object[] { qcmGpJudgeEntity,UserInfo.GetUserName() };
  172. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  173. if (ccp.ReturnCode != -1)
  174. {
  175. if (ccp.ReturnInfo.Equals("审批不通过成功!"))
  176. {
  177. doQueryData();
  178. MessageUtil.ShowTips(ccp.ReturnInfo);
  179. }
  180. else
  181. {
  182. MessageUtil.ShowTips(ccp.ReturnInfo);
  183. }
  184. }
  185. }
  186. /// <summary>
  187. /// 撤销审批
  188. /// </summary>
  189. private void cancelApplyJudge()
  190. {
  191. }
  192. private void close()
  193. {
  194. this.Close();
  195. }
  196. private bool CheckQuery()
  197. {
  198. if (this.chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text.Trim()))
  199. {
  200. MessageBox.Show("请输入熔炼炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  201. return false;
  202. }
  203. if (this.chkjudgeNo.Checked && string.IsNullOrEmpty(this.txtjudgeNo.Text.Trim()))
  204. {
  205. MessageBox.Show("请输入判定炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  206. return false;
  207. }
  208. return true;
  209. }
  210. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  211. {
  212. this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
  213. }
  214. private void chkjudgeNo_CheckedChanged(object sender, EventArgs e)
  215. {
  216. this.txtjudgeNo.Enabled = this.chkjudgeNo.Checked;
  217. }
  218. private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  219. {
  220. UltraTextEditor textEditor = (UltraTextEditor)sender;
  221. PopupTextBox popupText = new PopupTextBox(textEditor.Text, 500);
  222. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  223. {
  224. textEditor.Text = popupText.TextInfo.Trim();
  225. }
  226. this.ultraGrid2.ActiveCell.Value = textEditor.Text;
  227. this.ultraGrid2.ActiveRow.Update();
  228. }
  229. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  230. {
  231. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  232. if (uRow == null) return;
  233. // List<QcmJhyElementsEntity> listSource = EntityHelper.GetData<QcmJhyElementsEntity>(
  234. //"Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge.doQueryQcmJhy", new object[] { uRow.Cells["StoveNo"].Text }, this.ob);
  235. // QcmJhyElementsEntitybindingSource.DataSource = listSource;
  236. DataTable dtCraftCic = _d.GetTableByXmlId("JdgPlnOrderZgS.queryCraftCicByZgProPlanId", new object[] { uRow.Cells["ProPlanId"].Text + uRow.Cells["GxPlanNo"].Text });
  237. qcmJhyCtrl.QueryCraftResultByStoveNo(uRow.Cells["StoveNo"].Text, uRow.Cells["JudgeStoveNo"].Text, dtCraftCic,"A",uRow.Cells["Cic"].Text);
  238. }
  239. private void chkjudgeNo1_CheckedChanged(object sender, EventArgs e)
  240. {
  241. this.txtjudgeNo1.Enabled = this.chkjudgeNo1.Checked;
  242. }
  243. }
  244. }