channelplanExpert_info.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /**
  2. * 初始化海峡计划专家评分详情对话框
  3. */
  4. var ChannelplanExpertInfoDlg = {
  5. layerIndex:-1,
  6. channelplanExpertInfoData : {}
  7. };
  8. /**
  9. * 清除数据
  10. */
  11. ChannelplanExpertInfoDlg.clearData = function() {
  12. this.channelplanExpertInfoData = {};
  13. }
  14. /**
  15. * 设置对话框中的数据
  16. *
  17. * @param key 数据的名称
  18. * @param val 数据的具体值
  19. */
  20. ChannelplanExpertInfoDlg.set = function(key, val) {
  21. this.channelplanExpertInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
  22. return this;
  23. }
  24. /**
  25. * 设置对话框中的数据
  26. *
  27. * @param key 数据的名称
  28. * @param val 数据的具体值
  29. */
  30. ChannelplanExpertInfoDlg.get = function(key) {
  31. return $("#" + key).val();
  32. }
  33. /**
  34. * 关闭此对话框
  35. */
  36. ChannelplanExpertInfoDlg.close = function() {
  37. if($("#step").val()==2){
  38. parent.layer.close(window.parent.ChannelplanExpertLive.layerIndex);
  39. }
  40. if($("#step").val()==1){
  41. parent.layer.close(window.parent.ChannelplanExpert.layerIndex);
  42. }
  43. }
  44. /**
  45. * 收集数据
  46. */
  47. ChannelplanExpertInfoDlg.collectData = function() {
  48. this
  49. .set('id')
  50. .set('step')
  51. .set('cpId')
  52. .set('score')
  53. .set('expertId')
  54. .set('group')
  55. .set('checkMsg')
  56. .set('recommendType')
  57. .set('description')
  58. .set('createTime')
  59. .set('createUser')
  60. .set('updateTime')
  61. .set('updateUser');
  62. }
  63. /**
  64. * 提交添加
  65. */
  66. ChannelplanExpertInfoDlg.addSubmit = function() {
  67. this.clearData();
  68. this.collectData();
  69. //提交信息
  70. var ajax = new $ax(Feng.ctxPath + "/channelplanExpert/add", function(data){
  71. Feng.success("添加成功!");
  72. if($("#step").val()==1){
  73. window.parent.ChannelplanExpert.table.refresh();
  74. window.parent.ChannelplanExpert.calScore(1);
  75. }
  76. if($("#step").val()==2){
  77. window.parent.ChannelplanExpertLive.table.refresh();
  78. window.parent.ChannelplanExpertLive.calScore(2);
  79. }
  80. ChannelplanExpertInfoDlg.close();
  81. },function(data){
  82. Feng.error("添加失败!" + data.responseJSON.message + "!");
  83. });
  84. ajax.set(this.channelplanExpertInfoData);
  85. ajax.start();
  86. }
  87. /**
  88. * 提交修改
  89. */
  90. ChannelplanExpertInfoDlg.editSubmit = function() {
  91. this.clearData();
  92. this.collectData();
  93. //提交信息
  94. var ajax = new $ax(Feng.ctxPath + "/channelplanExpert/update", function(data){
  95. Feng.success("修改成功!");
  96. window.parent.ChannelplanExpert.table.refresh();
  97. ChannelplanExpertInfoDlg.close();
  98. },function(data){
  99. Feng.error("修改失败!" + data.responseJSON.message + "!");
  100. });
  101. ajax.set(this.channelplanExpertInfoData);
  102. ajax.start();
  103. }
  104. /**
  105. * 弹出详细分数填写框
  106. * end:function () {
  107. * window.parent.TalentInfo.xxx(value);
  108. * }
  109. */
  110. popDetailScore=function(obj){
  111. var id = $(obj).parent().children("input").eq(0).val();
  112. var expertId=$("#expertId").val();
  113. var index = layer.open({
  114. type: 2,
  115. title: '评审分值',
  116. area: ['420px', '420px'], //宽高
  117. fix: false, //不固定
  118. maxmin: true,
  119. content: Feng.ctxPath + '/channelplanExpertDetail?id='+id+"&expertId="+expertId
  120. });
  121. ChannelplanExpertInfoDlg.layerIndex = index;
  122. }
  123. /**
  124. * 弹出详细分数详情页
  125. */
  126. popDetailScoreDetail=function(obj){
  127. var id = $(obj).parent().children("input").eq(0).val();
  128. var expertId=$("#expertId").val();
  129. var index = layer.open({
  130. type: 2,
  131. title: '评审分值',
  132. area: ['420px', '420px'], //宽高
  133. fix: false, //不固定
  134. maxmin: true,
  135. content: Feng.ctxPath + '/channelplanExpertDetail/indexDetail?id='+id+"&expertId="+expertId
  136. });
  137. ChannelplanExpertInfoDlg.layerIndex = index;
  138. }
  139. /**
  140. * 求取总分
  141. */
  142. function addSum(){
  143. var sum=0;
  144. $("input[name='mScore']").each(function (index,e) {
  145. var num=$(e).html();
  146. if(num!=null&&num!=""){
  147. sum=sum+Number(num);
  148. }
  149. })
  150. $("#score").val(sum);
  151. }
  152. $(function() {
  153. //获取有效专家列表
  154. Feng.addAjaxSelect({
  155. "id": "expertId",
  156. "displayCode": "id",
  157. "displayName": "name",
  158. "type": "GET",
  159. "url": Feng.ctxPath + "/channelplanExpert/queryExpert"
  160. });
  161. //获取评审分组
  162. Feng.addAjaxSelect({
  163. "id": "group",
  164. "displayCode": "code",
  165. "displayName": "name",
  166. "type": "GET",
  167. "url": Feng.ctxPath + "/dict/findChildDictByCode?code=reviewGroup"
  168. });
  169. //获取推荐类别
  170. Feng.addAjaxSelect({
  171. "id": "recommendType",
  172. "displayCode": "code",
  173. "displayName": "name",
  174. "type": "GET",
  175. "url": Feng.ctxPath + "/dict/findChildDictByCode?code=un_declareSort"
  176. });
  177. $("select").each(function () {
  178. $(this).val($(this).attr("selectVal"));
  179. });
  180. });