livingAllowanceInfo_info.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /**
  2. * 初始化硕博人才生活补贴申报详情对话框
  3. */
  4. var LivingAllowanceInfoInfoDlg = {
  5. livingAllowanceInfoInfoData: {}
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. LivingAllowanceInfoInfoDlg.close = function () {
  11. parent.layer.close(window.parent.LivingAllowanceInfo.layerIndex);
  12. }
  13. /**
  14. * 显示审核模态框
  15. * @param process
  16. */
  17. LivingAllowanceInfoInfoDlg.showCheckModal = function (process) {
  18. var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/validateIsCheck", function (data) {
  19. if (data.code == 200) {
  20. layer.open({
  21. type: 1,
  22. id: "neewFieldFormModel",
  23. title: '审核',
  24. area: ['800px', '450px'],
  25. fix: false,
  26. shade: 0,
  27. maxmin: true,
  28. content: $("#checkTemplate").html(),
  29. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  30. btnAlign: 'c',
  31. zIndex: layer.zIndex,
  32. success: function (layero, index) {
  33. layer.setTop(layero);
  34. var obj = data.obj.obj;
  35. var fileList = data.obj.fileList;
  36. var html = '';
  37. for (var key in fileList) {
  38. html = html + '<ul><li style="width: 100%"><input type="checkbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
  39. }
  40. $("#field_file").empty().append(html);
  41. $("#firstCheckForm")[0].reset();
  42. $("#state").val(obj.checkState).trigger("change");
  43. $("#msg").val(obj.checkMsg);
  44. $("#process").val(process);
  45. if (Feng.isNotEmptyStr(obj.fields)) {
  46. $("#field_info input").each(function () {
  47. var arr = obj.fields.split(",");
  48. for (var key in arr) {
  49. if ($(this).val() == arr[key]) {
  50. this.checked = true;
  51. }
  52. }
  53. });
  54. }
  55. if (Feng.isNotEmptyStr(obj.files)) {
  56. $("#field_file input").each(function () {
  57. if (obj.files.indexOf($(this).val()) != -1) {
  58. this.checked = true;
  59. }
  60. });
  61. }
  62. },
  63. yes: function (index, layero) {
  64. var checkState = $("#state").val();
  65. var checkMsg = $("#msg").val();
  66. if (Feng.isEmptyStr(checkState)) {
  67. Feng.info("请选择审核状态");
  68. return;
  69. }
  70. if (Feng.isEmptyStr(checkMsg)) {
  71. Feng.info("请填写审核意见");
  72. return;
  73. }
  74. var fields = '';
  75. var files = '';
  76. $("#field_info li input").each(function (index) {
  77. if ($(this).is(":checked")) {
  78. fields = fields + $(this).val() + ",";
  79. }
  80. });
  81. $("#field_file li input").each(function (index) {
  82. if ($(this).is(":checked")) {
  83. files = files + $(this).val() + ",";
  84. }
  85. });
  86. if (checkState == 2 && fields == '' && files == '') {
  87. Feng.info("请选择可修改的字段或附件!");
  88. return;
  89. }
  90. var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/check", function (data) {
  91. if (data.code == 200) {
  92. layer.close(index);
  93. Feng.success(data.msg);
  94. } else {
  95. Feng.error(data.msg);
  96. }
  97. }, function (data) {
  98. Feng.error("提交失败!" + data.responseJSON.message + "!");
  99. });
  100. ajax.setData({
  101. "id": $("#id").val(),
  102. "checkState": checkState,
  103. "checkMsg": checkMsg,
  104. "process": process,
  105. "fields": fields,
  106. "files": files
  107. })
  108. ajax.start();
  109. }
  110. });
  111. } else {
  112. Feng.error(data.msg);
  113. }
  114. }, function (data) {
  115. Feng.error("校验失败!" + data.responseJSON.message + "!");
  116. });
  117. ajax.set("id", $("#id").val());
  118. ajax.set("process", process);
  119. ajax.start();
  120. }
  121. /**
  122. * 提交审核
  123. * @param process
  124. */
  125. LivingAllowanceInfoInfoDlg.submitCheck = function (process) {
  126. var operation = function () {
  127. var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/submitCheck", function (data) {
  128. if (data.code == 200) {
  129. Feng.success(data.msg);
  130. window.parent.LivingAllowanceInfo.table.refresh();
  131. LivingAllowanceInfoInfoDlg.close();
  132. } else {
  133. Feng.error(data.msg);
  134. }
  135. }, function (data) {
  136. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  137. });
  138. ajax.set("id", $("#id").val());
  139. ajax.set("process", process);
  140. ajax.start();
  141. }
  142. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  143. }
  144. LivingAllowanceInfoInfoDlg.fieldCheckd = function (context) {
  145. if ($(context).get(0).checked) {
  146. $(context).parent().next().children()[0].checked = true;
  147. $(context).parent().next().children().eq(0).trigger("change");
  148. }
  149. }
  150. LivingAllowanceInfoInfoDlg.checkAll = function () {
  151. $("#field input").each(function () {
  152. this.checked = true;
  153. })
  154. }
  155. /**
  156. * 反选
  157. */
  158. LivingAllowanceInfoInfoDlg.unCheckAll = function () {
  159. $("#field input").each(function () {
  160. if (this.checked) {
  161. this.checked = false;
  162. } else {
  163. this.checked = true;
  164. }
  165. })
  166. }
  167. /**
  168. * 显示字段或者隐藏字段选择
  169. */
  170. LivingAllowanceInfoInfoDlg.toggleField = function () {
  171. var checkState = $("#state").val();
  172. var process = $("#process").val();
  173. var checkMsg = $("#msg").val();
  174. if (checkState == 2) {
  175. $("#field").show();
  176. $("#msg").val("");
  177. } else if (checkState == 3) {
  178. $("#field").hide();
  179. $("#field").find("input[type=checkbox]").removeAttr("checked");
  180. if (Feng.isEmptyStr(checkMsg)) {
  181. if(process == 1){
  182. $("#msg").val("初审通过,待部门审核!");
  183. }
  184. if(process == 2){
  185. $("#msg").val("部门审核通过,待复核!");
  186. }
  187. if(process == 3){
  188. $("#msg").val("复核通过,待公示!");
  189. }
  190. }
  191. } else if (checkState == -1) {
  192. $("#field").hide();
  193. if(process == 1){
  194. $("#msg").val("初审不通过!");
  195. }
  196. if(process == 2){
  197. $("#msg").val("部门审核不通过!");
  198. }
  199. if(process == 3){
  200. $("#msg").val("复核不通过!");
  201. }
  202. }
  203. }
  204. LivingAllowanceInfoInfoDlg.showMiniFileModal = function (){
  205. Feng.showMiniFileModal(CONFIG.project_master_living_allowance, $("#type").val(), $("#id").val());
  206. }
  207. $(function () {
  208. Feng.getCheckLog("logTable", {
  209. "type": CONFIG.project_master_living_allowance,
  210. "mainId": $("#id").val(),
  211. "typeFileId": "",
  212. "active": 1
  213. });
  214. $('#identifyTable').bootstrapTable({
  215. url: Feng.ctxPath + "/talentInfo/getTalentInfoByIdCard",
  216. method: 'POST',
  217. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  218. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  219. showRefresh: false, // 是否显示刷新按钮
  220. clickToSelect: true, // 是否启用点击选中行
  221. singleSelect: true, // 设置True 将禁止多选
  222. striped: true, // 是否显示行间隔色
  223. pagination: false, // 设置为 true 会在表格底部显示分页条
  224. paginationHAlign: "left",
  225. paginationDetailHAlign: "right",
  226. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  227. showColumns: false,
  228. queryParams: function (params) {
  229. return {"idCard":$("#idCard").val()};
  230. },
  231. rowStyle : function(row,index){
  232. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  233. },
  234. columns:
  235. [
  236. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:'80px'},
  237. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  238. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
  239. formatter : function(value,row,index){
  240. if(row.sex==1){
  241. return value+'<span style="color:#6495ED">【男】</span>';
  242. }if(row.sex==2){
  243. return value+'<span style="color:#FF82AB">【女】</span>';
  244. }
  245. }
  246. },
  247. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px"},
  248. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
  249. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  250. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  251. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",
  252. formatter : function (value,row,index) {
  253. if(value==-1){
  254. return "<span class='label label-danger'>审核不通过</span>"
  255. }else if(value==1){
  256. return "<span class='label'>待提交</span>"
  257. }else if(value==10){
  258. return "<span class='label label-danger'>已驳回</span>"
  259. }else if(value==35){
  260. return "<span class='label label-primary'>已通过</span>"
  261. }else{
  262. return "<span class='label label-success'>审核中</span>"
  263. }
  264. }
  265. },
  266. {title: '公示状态', field: 'isPublic', visible: true, align: 'center', valign: 'middle',width:'120px',
  267. formatter : function (value,row,index) {
  268. if(value == 1){
  269. return "<span class='label label-info'>待核查征信</span>"
  270. }if(value == 2){
  271. return "<span class='label label-success'>待公示</span>"
  272. }if(value == 3){
  273. return "<span class='label label-danger'>公示中</span>"
  274. }if(value == 4){
  275. return "<span class='label label-warning'>待公布</span>"
  276. }if(value == 5){
  277. if(row.checkState == -1){
  278. return "<span class='label label-danger'>审核不通过</span>"
  279. }
  280. return "<span class='label label-primary'>待发证</span>"
  281. }if(value == 6){
  282. return "<span class='label label-primary'>已发证</span>"
  283. }
  284. }
  285. },
  286. ]
  287. ,
  288. onPostBody: function () {
  289. $('#identifyTable'+"td.uitd_showTip").bind("mouseover", function () {
  290. var htm = $(this).html();
  291. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  292. });
  293. }
  294. });
  295. $('#allowanceTable').bootstrapTable({
  296. url: Feng.ctxPath + "/talentAllowanceInfo/getTalentAllowanceByIdCard",
  297. method: 'POST',
  298. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  299. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  300. showRefresh: false, // 是否显示刷新按钮
  301. clickToSelect: true, // 是否启用点击选中行
  302. singleSelect: true, // 设置True 将禁止多选
  303. striped: true, // 是否显示行间隔色
  304. pagination: false, // 设置为 true 会在表格底部显示分页条
  305. paginationHAlign: "left",
  306. paginationDetailHAlign: "right",
  307. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  308. showColumns: false,
  309. queryParams: function (params) {
  310. return {"idCard":$("#idCard").val()};
  311. },
  312. rowStyle : function(row,index){
  313. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  314. },
  315. columns:
  316. [
  317. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"60px"},
  318. {title: '单位名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  319. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  320. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  321. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  322. {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  323. {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle',width:"120px"},
  324. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
  325. formatter(value,row,index){
  326. if(value==-1){
  327. return "<span class='label label-warning-light'>审核不通过</span>";
  328. }else if(value==1){
  329. return "<span class='label'>待提交</span>"
  330. }
  331. else if(value==10){
  332. return "<span class='label label-danger'>已驳回</span>";
  333. }else if( value==30){
  334. return "<span class='label label-primary'>已通过</span>"
  335. }else {
  336. return "<span class='label label-success'>审核中</span>";
  337. }
  338. }
  339. },
  340. {title: '兑现状态', field: 'publicState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
  341. formatter(value,row,index){
  342. if(value==1)return "<span style='color: #9d8189'>待核查征信</span>";
  343. if(value==2)return "<span style='color: #00d3ee'>待公示</span>";
  344. if(value==3)return "<span style='color: #af2cc5'>公示中</span>";
  345. if(value==4){
  346. return (row.allowanceType == 3)?"<span style='color: #f55a4e'>不予兑现</span>":"<span style='color: #ca9fab'>待兑现</span>";
  347. }
  348. if(value==5)return "<span style='color: #5cb860'>已兑现</span>";
  349. }
  350. },
  351. {title: '推荐津补贴类型', field: 'recommendAllowanceType', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
  352. formatter(value,row,index){
  353. if(value==null || value=="")return "<span style='color: black'>未判定</span>";
  354. if(value==1)return "<span style='color: green'>人才津贴</span>";
  355. if(value==2)return "<span style='color: blue'>一次性交通补贴</span>";
  356. if(value==3)return "<span style='color: red'>不予兑现</span>";
  357. }
  358. },
  359. {title: '推荐兑现月份', field: 'recommendMonths', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  360. {title: '推荐兑现金额', field: 'recommendMoney', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  361. {title: '推荐金额说明', field: 'recommendMoneyDesc', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  362. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px",
  363. formatter(value,row,index){
  364. if(value==null || value=="")return "<span style='color: black'>未判定</span>";
  365. if(value==1)return "<span style='color: green'>人才津贴</span>";
  366. if(value==2)return "<span style='color: blue'>一次性交通补贴</span>";
  367. if(value==3)return "<span style='color: red'>不予兑现</span>";
  368. }
  369. },
  370. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  371. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  372. {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  373. ]
  374. ,
  375. onPostBody: function () {
  376. $('#allowanceTable'+"td.uitd_showTip").bind("mouseover", function () {
  377. var htm = $(this).html();
  378. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  379. });
  380. }
  381. });
  382. LivingAllowanceInfoInfoDlg.showMiniFileModal();
  383. });