dCommon.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. function errorMessage()
  2. {
  3. var errorMes = model.getValue("/root/resData/errorData");
  4. if(errorMes != "")
  5. {
  6. window.alert(errorMes,"错误信息");
  7. model.removenode("/root/resData/errorData");
  8. return;
  9. }
  10. }
  11. function retrunMessage()
  12. {
  13. var errorMes = model.getValue("/root/resData/errorData");
  14. if(errorMes != "")
  15. {
  16. window.alert(errorMes,"错误信息");
  17. model.removenode("/root/resData/errorData");
  18. return;
  19. }else{
  20. window.alert("操作成功","提示信息");
  21. return;
  22. }
  23. }
  24. //获取最大板坏号
  25. function querySlabMax(temp,gridData, datagrid)
  26. {
  27. model.removenode("/root/reqData");
  28. model.makeNode("/root/reqData");
  29. //获取板坏结果表中的最大板坏号
  30. commSubmit("UID010050-service","findSlabNoMax","glueAction.do");
  31. var DSN_SLAB_NO_ONE = model.getValue("/root/resData/EmpListResult_VO/EmpListResult_Row/DSN_SLAB_NO");
  32. model.removenode("/root/resData/EmpListResult_VO");
  33. var count = model.getXPathValue("count(/root/"+gridData+"/EmpListResult_VO/EmpListResult_Row)");
  34. var DSN_SLAB_NO_TWO = 0;
  35. var DSN_SLAB_NO_RES = "";
  36. //获取datagrid2中的最大板坏号
  37. for(var i = 1; i<count; i++)
  38. {
  39. //将当前行的板坏号排除在比较之外
  40. if((datagrid.row-1)!=i)
  41. {
  42. var DSN_SLAB_NO = model.getValue("/root/"+gridData+"/EmpListResult_VO/EmpListResult_Row["+i+"]/"+temp);
  43. if(Number(DSN_SLAB_NO) > DSN_SLAB_NO_TWO )
  44. {
  45. DSN_SLAB_NO_TWO = Number(DSN_SLAB_NO);
  46. }
  47. }
  48. }
  49. //两者比较取其最大值做为新的板坏号,实现板坏号逐步叠加
  50. if(DSN_SLAB_NO_ONE >= DSN_SLAB_NO_TWO+1)
  51. {
  52. DSN_SLAB_NO_RES = DSN_SLAB_NO_ONE;
  53. }
  54. else
  55. {
  56. DSN_SLAB_NO_RES = DSN_SLAB_NO_TWO+1;
  57. }
  58. // 将数字形式的板坏号组织成“00000000”形式的板坏号
  59. for(var j = 0; j<8; j++)
  60. {
  61. if(DSN_SLAB_NO_RES.length >= 8)
  62. {
  63. break;
  64. }
  65. else
  66. {
  67. DSN_SLAB_NO_RES = "0" + DSN_SLAB_NO_RES;
  68. }
  69. }
  70. return DSN_SLAB_NO_RES;
  71. }
  72. /*
  73. *add by wangli
  74. */
  75. function setSlabRes(datagrid, gridData1Ref, gridData2Ref)
  76. {
  77. var ORD_NO = model.getValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/ORD_NO");
  78. var CHK = model.getValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/CHK");
  79. var count = model.getXPathValue("count("+gridData1Ref+"/EmpListResult_Row)");
  80. var SLAB_WTH = "";
  81. var SLAB_LEN = "";
  82. var COIL_PACK_WGT_MIN = "";
  83. var COIL_PACK_WGT_MAX = "";
  84. var SPEC_ABBSYMBL = "";
  85. var SPEC_YY = "";
  86. var SPEC_STL_GRD = "";
  87. var FAC_STL_GRD = "";
  88. var COIL_LEN = "";
  89. var COIL_WGT = "";
  90. var PROC_PATH = "";
  91. var SLAB_THK = "";
  92. var PRDNM_CD = "";
  93. var COIL_THK = "";
  94. var COIL_WTH = "";
  95. var GRAVITY = "";
  96. var ORD_SEQ = "";
  97. for(var i = 1; i<=count; i++)
  98. {
  99. var ORD_NO1 = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/ORD_NO");
  100. if(ORD_NO == ORD_NO1)
  101. {
  102. SLAB_WTH = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SLAB_WTH");
  103. SLAB_LEN = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SLAB_LEN");
  104. COIL_PACK_WGT_MIN = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_PACK_WGT_MIN");
  105. COIL_PACK_WGT_MAX = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_PACK_WGT_MAX");
  106. GRAVITY = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/GRAVITY");
  107. SPEC_ABBSYMBL = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SPEC_ABBSYMBL");
  108. SPEC_YY = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SPEC_YY");
  109. SPEC_STL_GRD = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SPEC_STL_GRD");
  110. FAC_STL_GRD = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/FAC_STL_GRD");
  111. COIL_LEN = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_LEN");
  112. COIL_WGT = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_WGT");
  113. PROC_PATH = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/PROC_PATH");
  114. SLAB_THK = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/SLAB_THK");
  115. PRDNM_CD = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/PRDNM_CD");
  116. COIL_THK = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_THK");
  117. COIL_WTH = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/COIL_WTH");
  118. ORD_SEQ = model.getValue(gridData1Ref+"/EmpListResult_Row["+i+"]/ORD_SEQ");
  119. }
  120. }
  121. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/CHK",CHK);
  122. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SLAB_WTH",SLAB_WTH);
  123. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SLAB_LEN",SLAB_LEN);
  124. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SLAB_TRMTH_TP","Y");//待处理
  125. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/AUTODSN_YN","N");//待处理
  126. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/EMGMTR_YN","Y");//待处理
  127. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_PACK_WGT_MIN",COIL_PACK_WGT_MIN);
  128. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_PACK_WGT_MAX",COIL_PACK_WGT_MAX);
  129. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/HCR_YN","Y");//待处理
  130. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SPEC_ABBSYMBL",SPEC_ABBSYMBL);
  131. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SPEC_YY",SPEC_YY);
  132. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SPEC_STL_GRD",SPEC_STL_GRD);
  133. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/FAC_STL_GRD",FAC_STL_GRD);
  134. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_LEN",COIL_LEN);
  135. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_WGT",COIL_WGT);
  136. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/PROC_PATH",PROC_PATH);
  137. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/SLAB_THK","230");
  138. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/PRDNM_CD",PRDNM_CD);
  139. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_THK",COIL_THK);
  140. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/COIL_WTH",COIL_WTH);
  141. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/GRAVITY",GRAVITY);
  142. model.makeValue(gridData2Ref+"/EmpListResult_Row["+(datagrid2.row-1)+"]/ORD_SEQ",ORD_SEQ);
  143. }
  144. /*
  145. *add by wangli
  146. */
  147. function addall(rcf, label, value)
  148. {
  149. model.makeValue("/root/custom/DropDownRes_Row/"+label,"--全部--");
  150. model.makeValue("/root/custom/DropDownRes_Row/"+value,"all");
  151. model.duplicate(rcf, "/root/custom/DropDownRes_Row");
  152. }
  153. function addall2(rcf, label, value)
  154. {
  155. model.makeValue("/root/custom/DropDownRes_Row/"+label,"--全部--");
  156. model.makeValue("/root/custom/DropDownRes_Row/"+value,"");
  157. model.duplicate(rcf, "/root/custom/DropDownRes_Row");
  158. }
  159. /*
  160. * 检查空串
  161. *
  162. */
  163. function isNullOrEmpty(str)
  164. {
  165. if(str.length != 0)
  166. {
  167. return true;
  168. }
  169. else
  170. {
  171. return false;
  172. }
  173. }