channelplanBasicinfo.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /**
  2. * channelplanInfo管理初始化
  3. */
  4. var ChannelplanBasicinfo = {
  5. id: "ChannelplanBasicinfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChannelplanBasicinfo.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '唯一标志', field: 'id', visible: false, align: 'center', valign: 'middle'},
  17. {title: '申报批次', field: 'batchId', visible: true, align: 'center', valign: 'middle',width:70},
  18. {title: '申报项目', field: 'project', visible: true, align: 'center', valign: 'middle',class:"uitd_showTip"},
  19. {title: '申报类型', field: 'type', visible: true, align: 'center', valign: 'middle',class:"uitd_showTip"},
  20. {title: '承载单位', field: 'enterprise', visible: true, align: 'center', valign: 'middle',class:"uitd_showTip"},
  21. {title: '专业领域', field: 'field', visible: true, align: 'center', valign: 'middle'},
  22. {title: '联系人', field: 'contactsName', visible: true, align: 'center', valign: 'middle'},
  23. {title: '评审分组', field: 'group', visible: true, align: 'center', valign: 'middle'},
  24. {title: '填表时间', field: 'createTime', visible: true, align: 'center', valign: 'middle',class:"uitd_showTip"},
  25. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',
  26. formatter:function (value) {
  27. if(value==1){
  28. return "待提交";
  29. }else if(value==5){
  30. return "待初审";
  31. }else if(value==10){
  32. return "待函审";
  33. }else if(value==15){
  34. return "待现场审核";
  35. }else if(value==20){
  36. return "待终审";
  37. }else if(value==25){
  38. return "审核通过";
  39. }else if(value==30){
  40. return "退回";
  41. }
  42. }
  43. },
  44. {title: '评审操作', field: 'checkState', visible : true, align: 'center', valign: 'middle',class:"uitd_showTip", formatter: assessAction},
  45. {title: '操作日志', field: 'operationLogId', visible : true, align: 'center', valign: 'middle', formatter: operationAction}
  46. ];
  47. };
  48. /**
  49. * 检查是否选中
  50. */
  51. ChannelplanBasicinfo.check = function () {
  52. var selected = $('#' + this.id).bootstrapTable('getSelections');
  53. if(selected.length == 0){
  54. Feng.info("请先选中表格中的某一记录!");
  55. return false;
  56. }else{
  57. ChannelplanBasicinfo.seItem = selected[0];
  58. return true;
  59. }
  60. };
  61. /**
  62. * 点击添加channelplanInfo
  63. */
  64. ChannelplanBasicinfo.openAddChannelplanBasicinfo = function () {
  65. var index = layer.open({
  66. type: 2,
  67. title: '添加申报信息',
  68. area: ['800px', '420px'], //宽高
  69. fix: false, //不固定
  70. maxmin: true,
  71. content: Feng.ctxPath + '/channelplanBasicinfo/channelplanBasicinfo_add'
  72. });
  73. this.layerIndex = index;
  74. };
  75. /**
  76. * 打开查看channelplanInfo详情
  77. */
  78. ChannelplanBasicinfo.openChannelplanBasicinfoDetail = function () {
  79. if (this.check()) {
  80. var index = layer.open({
  81. type: 2,
  82. title: '申报信息详情',
  83. area: ['800px', '420px'], //宽高
  84. fix: false, //不固定
  85. maxmin: true,
  86. content: Feng.ctxPath + '/channelplanBasicinfo/channelplanBasicinfo_update/' + ChannelplanBasicinfo.seItem.id
  87. });
  88. this.layerIndex = index;
  89. }
  90. };
  91. /**
  92. * 删除channelplanInfo
  93. */
  94. ChannelplanBasicinfo.delete = function () {
  95. if (this.check()) {
  96. var ajax = new $ax(Feng.ctxPath + "/channelplanBasicinfo/delete", function (data) {
  97. Feng.success("删除成功!");
  98. ChannelplanBasicinfo.table.refresh();
  99. }, function (data) {
  100. Feng.error("删除失败!" + data.responseJSON.message + "!");
  101. });
  102. ajax.set("channelplanBasicinfoId",this.seItem.id);
  103. ajax.start();
  104. }
  105. };
  106. /**
  107. * 查询channelplanInfo列表
  108. */
  109. ChannelplanBasicinfo.search = function () {
  110. var queryData = {};
  111. queryData['field'] = $("#field").val();
  112. queryData['type'] = $("#type").val();
  113. queryData['checkState'] = $("#checkState").val();
  114. queryData['project'] = $("#project").val();
  115. ChannelplanBasicinfo.table.refresh({query: queryData});
  116. };
  117. /**
  118. * 初始化评审操作
  119. */
  120. function assessAction(value,row,index){
  121. var str = JSON.stringify(row);
  122. if(value==10||value==15||value==25||value==20){
  123. return "<button class='btn btn-info btn-xs' onclick='popOperation("+str+")'>审核/查看</button>"
  124. }
  125. }
  126. /**
  127. * 初始化操作日志按钮
  128. */
  129. function operationAction(value,row,index){
  130. var cpId = row.id;
  131. return "<button class='btn btn-primary btn-xs' onclick='popCheckLog(\""+cpId+"\")'>查看日志</>"
  132. }
  133. /**
  134. * 弹出审核步骤选择界面
  135. * @param row
  136. *
  137. */
  138. function popOperation(row){
  139. if(row.checkState==10){
  140. $('#operation1').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckSec(\""+row.id+"\")' onclick='popScoreCheck("+row.id+")'>审核</a>");
  141. }
  142. if(row.checkState==15){
  143. $('#operation1').children().eq(1).html("已通过");
  144. $('#operation1').css("background-color","#f0f6ff");
  145. $('#operation1').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckSecDetail(\""+row.id+"\")'>查看详情</a>")
  146. $('#operation2').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckLive(\""+row.id+"\")'>审核</a>")
  147. }
  148. if(row.checkState==20){
  149. $('#operation1').children().eq(1).html("已通过");
  150. $('#operation1').css("background-color","#f0f6ff");
  151. $('#operation1').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckSecDetail(\""+row.id+"\")'>查看详情</a>")
  152. $('#operation2').children().eq(1).html("已通过");
  153. $('#operation2').css("background-color","#f0f6ff");
  154. $('#operation2').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckLiveDetail(\""+row.id+"\")'>查看详情</a>")
  155. $('#operation3').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckFinal(\""+row.id+"\")'>审核</a>")
  156. }
  157. if(row.checkState==25){
  158. $('#operation1').children().eq(1).html("已通过");
  159. $('#operation1').css("background-color","#f0f6ff");
  160. $('#operation1').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckSecDetail(\""+row.id+"\")'>查看详情</a>")
  161. $('#operation2').children().eq(1).html("已通过");
  162. $('#operation2').css("background-color","#f0f6ff");
  163. $('#operation2').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckLiveDetail(\""+row.id+"\")'>查看详情</a>")
  164. $('#operation3').children().eq(1).html("已通过");
  165. $('#operation3').css("background-color","#f0f6ff");
  166. $('#operation3').children().eq(2).html("<a href='javascript:void(0)' onclick='popScoreCheckFinalDetail(\""+row.id+"\")'>查看详情</a>")
  167. }
  168. $('#operationChoice').modal('show');
  169. }
  170. /**
  171. * 弹出函审窗口
  172. */
  173. function popScoreCheckSec(cpId){
  174. var index = layer.open({
  175. type: 2,
  176. title: '函审',
  177. area: ['800px', '420px'], //宽高
  178. fix: false, //不固定
  179. maxmin: true,
  180. content: Feng.ctxPath + '/channelplanExpert?cpId='+cpId
  181. });
  182. this.layerIndex = index;
  183. }
  184. /**
  185. * 弹出函审详情窗口
  186. */
  187. function popScoreCheckSecDetail(cpId){
  188. var index = layer.open({
  189. type: 2,
  190. title: '函审详情',
  191. area: ['800px', '420px'], //宽高
  192. fix: false, //不固定
  193. maxmin: true,
  194. content: Feng.ctxPath + '/channelplanExpert/indexDetail?cpId='+cpId
  195. });
  196. this.layerIndex = index;
  197. }
  198. /**
  199. * 弹出现场评审窗口
  200. */
  201. function popScoreCheckLive(cpId){
  202. var index = layer.open({
  203. type: 2,
  204. title: '现场评审',
  205. area: ['800px', '420px'], //宽高
  206. fix: false, //不固定
  207. maxmin: true,
  208. content: Feng.ctxPath + '/channelplanExpert/Live?cpId='+cpId
  209. });
  210. this.layerIndex = index;
  211. }
  212. /**
  213. * 弹出现场评审详情窗口
  214. */
  215. function popScoreCheckLiveDetail(cpId) {
  216. var index = layer.open({
  217. type: 2,
  218. title: '现场评审详情',
  219. area: ['800px', '420px'], //宽高
  220. fix: false, //不固定
  221. maxmin: true,
  222. content: Feng.ctxPath + '/channelplanExpert/LiveDetail?cpId='+cpId
  223. });
  224. }
  225. /**
  226. * 弹出终审窗口
  227. */
  228. function popScoreCheckFinal(cpId){
  229. var index = layer.open({
  230. type: 2,
  231. title: '终审',
  232. area: ['400px','420px'],
  233. fix: false,
  234. maxmin: true,
  235. content: Feng.ctxPath + '/channelplanExpert/final?cpId='+cpId
  236. });
  237. }
  238. /**
  239. * 弹出终审详情窗口
  240. */
  241. function popScoreCheckFinalDetail(cpId){
  242. var index = layer.open({
  243. type: 2,
  244. title: '终审',
  245. area: ['400px','420px'],
  246. fix: false,
  247. maxmin: true,
  248. content: Feng.ctxPath + '/channelplanExpert/finalDetail?cpId='+cpId
  249. });
  250. }
  251. /**
  252. * 弹出申报日志窗口
  253. */
  254. function popCheckLog(cpId){
  255. var index = layer.open({
  256. type: 2,
  257. title: '操作日志',
  258. area: ['800px', '420px'], //宽高
  259. fix: false, //不固定
  260. maxmin: true,
  261. content: Feng.ctxPath + '/channelplanChecklog?cpId='+cpId
  262. });
  263. ChannelplanBasicinfo.layerIndex = index;
  264. }
  265. $(function () {
  266. var defaultColunms = ChannelplanBasicinfo.initColumn();
  267. var table = new BSTable(ChannelplanBasicinfo.id, "/channelplanBasicinfo/list", defaultColunms);
  268. table.setPaginationType("client");
  269. ChannelplanBasicinfo.table = table.init();
  270. //初始化select选项
  271. var arr = new Array();
  272. arr.push({"id":"field","code":"un_professionalField"}); //专业领域
  273. arr.push({"id":"type","code":"un_declareSort"}); //申报类别
  274. for(var key in arr){
  275. Feng.addAjaxSelect({
  276. "id": arr[key].id,
  277. "displayCode": "code",
  278. "displayName": "name",
  279. "type": "GET",
  280. "url": Feng.ctxPath + "/channelplanBasicinfo/findChildDictByCode?code="+arr[key].code
  281. });
  282. }
  283. });