checkDetail.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. function initCheck(){
  2. // 仅选择日期
  3. $("#start-time").datetimepicker({
  4. language: "zh-CN",
  5. weekStart: 1,
  6. todayBtn: 1,
  7. autoclose: 1,
  8. todayHighlight: 1,
  9. startView: 2,
  10. minView: 2,
  11. forceParse: 0,
  12. format: "yyyy-mm-dd"
  13. });
  14. // 仅选择日期
  15. $("#end-time").datetimepicker({
  16. language: "zh-CN",
  17. weekStart: 1,
  18. todayBtn: 1,
  19. autoclose: 1,
  20. todayHighlight: 1,
  21. startView: 2,
  22. minView: 2,
  23. forceParse: 0,
  24. format: "yyyy-mm-dd"
  25. });
  26. if($.checkTask) {
  27. setFeSelect("#fsList",$.checkTask.deptid);
  28. setLaneSelect("#lane",$.checkTask.checked_location);
  29. get_common_service('user/getUserById/'+$.checkTask.checked_person, null, function(data){
  30. $("#checked_person").html(data.truename);
  31. })
  32. //查询评分情况
  33. queryScores();
  34. }
  35. }
  36. // 使用data参数更新数据:
  37. function queryScores(){
  38. var data = {
  39. "task_id": $.checkTask.id
  40. }
  41. var cols = [
  42. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  43. {width: 160, text: '评分记录', type: 'string', flex: true, sort: 'down',field: 'content'},
  44. {width: 80, text: '分数', type: 'string', flex: true, colClass: '',field: 'check_item_score'},
  45. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  46. oper:[
  47. {func:'showEditScore',text:'修改',icon_class:'icon-edit'},
  48. {func:'deleteScore',text:'删除',icon_class:'icon-remove-circle'}
  49. ]
  50. }
  51. ];
  52. // var pager = {
  53. // page_size:10
  54. // }
  55. $('.datatable').mytable({'cols':cols,
  56. 'url':"/score/getScoreList/",
  57. 'param':data}
  58. );
  59. }
  60. function showEditScore(id){
  61. // deleteItem4Common(id,"/score/delete/",queryScores);
  62. var rowData=getItemByIdFromArr(id,$('.datatable').mytable('getTableData'));
  63. showPics(rowData.pics);
  64. }
  65. function deleteScore(id){
  66. deleteItem4Common(id,"/score/delete/",queryScores);
  67. }
  68. function showPics(pics){
  69. var picStr='';
  70. $('#img_container').html(picStr);
  71. if(pics){
  72. var picArr = pics.split(',');
  73. for(var i in picArr){
  74. var pic = '<div id="img_item_'+i+'" class="col-md-4 col-sm-6 col-lg-3">'
  75. + '<a href="javascript:void(0)" onclick="removeImg(\'#img_item_'+i+'\')" style="float:right;position:absolute;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>'
  76. + '<a class="card lightbox-toggle" href="'+picArr[i]+'" style="position:absolute">'
  77. + '<img src="'+picArr[i]+'" alt="">'
  78. + '</a>'
  79. +'</div>';
  80. picStr+=pic;
  81. }
  82. $('#img_container').html(picStr);
  83. $('a.lightbox-toggle').lightbox();
  84. }
  85. }
  86. function removeImg(img_id){
  87. $(img_id).remove();
  88. }
  89. function clearAllImg(){
  90. $('#img_container').empty();
  91. }
  92. function showPre(id){
  93. // $('#myModal').modal({name:"dd"});
  94. changePage("/view/mytask/taskDetail.html");
  95. }
  96. function saveValidReason(){
  97. alert("提交成功!");
  98. $('#validSubmitWin').modal('toggle');
  99. }
  100. function changePerson(id){
  101. $('#checkedPerson').html(id);
  102. $('#changePersonWin').modal('toggle');
  103. }
  104. function score(score){
  105. alert("扣分:"+score);
  106. $('#scoreWin').modal('toggle');
  107. }
  108. function refuseApply(){
  109. alert("拒绝申请");
  110. $('#refuseApplyWin').modal('toggle');
  111. }
  112. function agreeApply(){
  113. alert("同意申请");
  114. }