check.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. function initCheck() {
  2. addBreadMenu("/view/mytask/check.html", "视频稽查");
  3. $('#ex1').slider({ tooltip: 'hide' });
  4. $("#ex1").on("slideStop", function (slideEvt) {
  5. setVideoProcess(slideEvt.value);
  6. });
  7. $("#tabcontent").css("height", ($("#video_content").height() - 80) + "px");
  8. event = document.createEvent('MessageEvent');
  9. var origin = window.location.protocol + '//' + window.location.host;
  10. event.initMessageEvent('setvideoposition', true, true, getVideoPosition(null), origin, 1234, window, null);
  11. document.dispatchEvent(event);
  12. // 仅选择日期
  13. $("#start-time").datetimepicker({
  14. language: "zh-CN",
  15. weekStart: 1,
  16. todayBtn: 1,
  17. autoclose: 1,
  18. todayHighlight: 1,
  19. startView: 2,
  20. minView: 2,
  21. forceParse: 0,
  22. format: "yyyy-mm-dd"
  23. });
  24. // 仅选择日期
  25. $("#end-time").datetimepicker({
  26. language: "zh-CN",
  27. weekStart: 1,
  28. todayBtn: 1,
  29. autoclose: 1,
  30. todayHighlight: 1,
  31. startView: 2,
  32. minView: 2,
  33. forceParse: 0,
  34. format: "yyyy-mm-dd"
  35. });
  36. if ($.checkTask) {
  37. initCheckAppealBtns();
  38. setFeSelect("#fsList", $.checkTask.checked_dept);
  39. // $("#fsList").on("change",function(){
  40. // $.checkTask.checked_dept = this.value;
  41. // })
  42. $("#lane").val($.checkTask.checked_location);
  43. // setLaneSelect("#lane", $.checkTask.checked_location);
  44. get_common_service('user/getUserById/' + $.checkTask.checked_person, null, function (data) {
  45. changePersonContent(data);
  46. })
  47. //查询评分情况
  48. queryCheckScores();
  49. //查询录像播放列表
  50. var videos = $.checkTask.video_id.split(',');
  51. if (videos[0]) {
  52. curVideo = videos[0];
  53. queryVideoList();
  54. } else {
  55. callFunc("showvideoview", "false");
  56. layer.msg('该处暂无视屏!', {
  57. time: 2000, //20s后自动关闭
  58. });
  59. callFunc("stop", "");
  60. }
  61. }
  62. $("select#video_list").change(function () {
  63. playVideo($(this).val());
  64. });
  65. }
  66. function setfastorslow(type, speed) {
  67. if (type == 0) {
  68. $("#fast_info").html("");
  69. $("#slow_info").html("");
  70. if ($("#full_fast_info")) {
  71. $("#full_fast_info").html("");
  72. $("#full_slow_info").html("");
  73. }
  74. }
  75. if (type == 1) {
  76. $("#fast_info").html(speed + "x");
  77. $("#slow_info").html("");
  78. if ($("#full_fast_info")) {
  79. $("#full_fast_info").html(speed + "x");
  80. $("#full_slow_info").html("");
  81. }
  82. }
  83. if (type == 2) {
  84. $("#slow_info").html(speed + "x");
  85. $("#fast_info").html("");
  86. if ($("#full_fast_info")) {
  87. $("#full_fast_info").html("");
  88. $("#full_slow_info").html(speed + "x");
  89. }
  90. }
  91. }
  92. function normalscreen() {
  93. if (layer_full) {
  94. layer.close(layer_full)
  95. }
  96. }
  97. var layer_full = null;
  98. function fullscreen() {
  99. var height = window.innerWidth * 0.8 * 1 / 2.0 + 90
  100. var contenthtml = ' <div class="tab-content" id="full_tabcontent" style="height:400px;text-align: center;background:black;">' +
  101. ' <p style="padding-top:180px;font-size:20px">加载中...</p>' +
  102. ' <!--<i class="icon icon-spin icon-spinner icon-5x" style="margin-top:100px"></i>-->' +
  103. ' </div>' +
  104. ' <div class="row" class="col-md-12" style="padding:5px 10px 5px 10px;text-align:center;margin:0px">' +
  105. ' <input id="full_ex1" class="col-md-12" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0"' +
  106. ' />' +
  107. ' </div>' +
  108. ' <div class="row" style="padding:0px 5px 0px 5px;text-align:center;margin:0px">' +
  109. ' <select class="form-control" id="full_video_list" style="width:200px;float:left;display:none;"></select>' +
  110. ' <div class="btn-group" style="float:right;">' +
  111. ' <button type="button" class="btn btn-info" onclick="doAction(\'start\')"><i class="icon icon-play-circle icon-2x"></i></button>' +
  112. ' <button type="button" class="btn btn-info" onclick="doAction(\'stop\')"><i class="icon icon-pause icon-2x"></i></button>' +
  113. ' <button type="button" class="btn btn-info" onclick="doAction(\'fast\')"><i class="icon icon-forward icon-2x"></i><span id=\"full_fast_info\"></span></button>' +
  114. ' <button type="button" class="btn btn-info" onclick="doAction(\'slow\')"><span id=\"full_slow_info\"></span><i class="icon icon-backward icon-2x"></i></button>' +
  115. ' <button type="button" class="btn btn-success" onclick="doAction(\'screenshot\')"><i class="icon icon-camera icon-2x"></i></button>' +
  116. ' </div>' +
  117. ' </div>';
  118. layer_full = layer.open({
  119. area: ['80%', height + "px"],
  120. type: 1,
  121. title: false,
  122. anim: -1,
  123. closeBtn: 0,
  124. shadeClose: false,
  125. content: "<div id='layer_content' >" + contenthtml + "</div>",
  126. success: function (layero, index) {
  127. $('#full_ex1').slider({ tooltip: 'hide' });
  128. $("#full_ex1").on("slideStop", function (slideEvt) {
  129. setVideoProcess(slideEvt.value);
  130. });
  131. $("#full_ex1").val($("#ex1").value)
  132. $("#full_ex1").slider({ step: 5, min: 0, max: maxVV });
  133. $("#full_fast_info").html($("#fast_info").html());
  134. $("#full_slow_info").html($("#slow_info").html());
  135. $("#full_tabcontent").css("height", (height - 90) + "px");
  136. $("#full_tabcontent").css("width", "100%");
  137. setTimeout(function () {
  138. callFunc("setvideoposition", getVideoPosition($("#full_tabcontent")))
  139. }, 800)
  140. }
  141. });
  142. }
  143. function initInfo() {
  144. }
  145. function initCheckAppealBtns() {
  146. if ($.checkTask.appeal) {
  147. $("#btn_appeal_task").show();
  148. $("#btn_task").hide();
  149. $("#appeal_div").show();
  150. $("#appeal_time").html($.checkTask.appeal.appeal_time);
  151. $("#appeal_reason").html($.checkTask.appeal.appeal_reason);
  152. $("#appeal_file_list").html(genAppeaFiles($.checkTask.appeal.file_src));
  153. layer.open({
  154. type: 1,
  155. title: "申诉详情",
  156. closeBtn: 1,
  157. shade: false,
  158. maxmin: true,
  159. shadeClose: true,
  160. offset: 'rb',
  161. content: $('#appeal_div'), //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
  162. min: function (index) {
  163. // layer.close(index);
  164. layer.style(index,{width: 50,height:50});
  165. return false;
  166. },
  167. cancel:function(index){
  168. layer.style(index,{width: 50,height:50,offset:'r'});
  169. return false;
  170. }
  171. });
  172. } else {
  173. $("#appeal_div").hide();
  174. $("#btn_appeal_task").hide();
  175. $("#btn_task").show();
  176. }
  177. }
  178. // 使用data参数更新数据:
  179. function queryCheckScores() {
  180. //$('#score_datatable').score_datatable("");
  181. console.log("任务id:" + $.checkTask.id);
  182. var data = {
  183. "task_id": $.checkTask.id
  184. }
  185. // alert("ff");
  186. var cols = [
  187. { width: 40, text: '序号', type: 'number', flex: true, colClass: 'text-center', field: 'num' },
  188. { width: 160, text: '评分记录', type: 'string', flex: true, sort: 'down', field: 'content' },
  189. { width: 50, text: '分数', type: 'string', flex: true, colClass: '', field: 'check_item_score' },
  190. { width: 100, text: '备注', type: 'string', flex: true, colClass: '', field: 'remark' },
  191. { width: 55, text: '考核人', type: 'string', flex: true, colClass: '', field: 'checked_person_name' },
  192. // {width: 80, text: '图片', type: 'imagedd', flex: true, colClass: '',field: 'pics'},
  193. {
  194. width: 110, text: '操作', type: 'string', flex: true, field: 'id',
  195. oper: [
  196. { func: 'showEditCheckScore', text: '修改', icon_class: 'icon-edit' },
  197. { func: 'showEditPic', text: '修改图片', icon_class: 'icon-edit' },
  198. { func: 'deleteCheckScore', text: '删除', icon_class: 'icon-remove-circle' }
  199. ]
  200. }
  201. ];
  202. // var pager = {
  203. // page_size:10
  204. // }
  205. $('#score_datatable').mytable({
  206. 'cols': cols,
  207. 'url': "/score/getScoreList/",
  208. 'param': data
  209. }
  210. );
  211. }
  212. function showEditPic(){
  213. var rowData = getItemByIdFromArr(id, $('#score_datatable').mytable('getTableData'));
  214. showPics(rowData.pics);
  215. $("#saveEditBtn").show();
  216. editScoreId = id;
  217. }
  218. function showEditCheckScore(id) {
  219. // deleteItem4Common(id,"/score/delete/",queryCheckScores);
  220. var rowData = getItemByIdFromArr(id, $('#score_datatable').mytable('getTableData'));
  221. scoreDetailLayer = showPopup4Common('修改考核项',function(data){
  222. saveScoreEdit();
  223. },['350px','400px'],'#score-detail-div','r');
  224. $("#score_id_text").val(rowData.id);
  225. $("#check_item_text").val(rowData.content);
  226. $("#check_score_text").val(rowData.check_item_score);
  227. $("#check_remark_text").val(rowData.remark);
  228. var param = {
  229. 'organid': $.checkTask.checked_dept
  230. };
  231. post_common_service("/user/getUserList/", param, function (data) {
  232. setFeeUserSelect("#check_checked_person_select",rowData.checked_person,data);
  233. });
  234. }
  235. function setFeeUserSelect(div,selectId,userList){
  236. var optStr = '';
  237. for(var i in userList) {
  238. if(userList[i].deptid==selectId)
  239. optStr += '<option value="'+userList[i].id+'" selected="selected">'+userList[i].truename+'</option>';
  240. else
  241. optStr += '<option value="'+userList[i].id+'">'+userList[i].truename+'</option>';
  242. }
  243. $(div).html('');
  244. $(div).html(optStr);
  245. }
  246. function saveScoreEdit(){
  247. var param = {
  248. 'id': $("#score_id_text").val(),
  249. 'content': $("#check_item_text").val(),
  250. 'check_item_score': $("#check_score_text").val(),
  251. 'remark': $("#check_remark_text").val(),
  252. 'checked_person': $("#check_checked_person_select").val(),
  253. };
  254. editScoreId = null;
  255. $("#saveEditBtn").hide();
  256. no_return_common_service("/score/update", param, function (data) {
  257. if (scoreLayer) layer.close(scoreLayer);
  258. //查询评分情况
  259. queryCheckScores();
  260. // layer.msg(data, {
  261. // time: 2000//20s后自动关闭
  262. // });
  263. });
  264. }
  265. var editScoreId;
  266. function saveEdit() {
  267. if (editScoreId) {
  268. var imgArr = $("#img_container .pic-class");
  269. var picsStr = "";
  270. if (imgArr && imgArr.length > 0) {
  271. for (var i = 0; i < imgArr.length; i++) {
  272. picsStr += imgArr[i].src + ","
  273. }
  274. picsStr = picsStr.substr(0, picsStr.length - 1);
  275. }
  276. var param = {
  277. 'id': editScoreId,
  278. 'pics': picsStr
  279. };
  280. editScoreId = null;
  281. $("#saveEditBtn").hide();
  282. no_return_common_service("/score/update", param, function (data) {
  283. if (scoreLayer) layer.close(scoreLayer);
  284. //查询评分情况
  285. queryCheckScores();
  286. layer.msg(data, {
  287. time: 2000//20s后自动关闭
  288. });
  289. });
  290. }
  291. }
  292. function deleteCheckScore(id) {
  293. deleteItem4Common(id, "/score/delete/", queryCheckScores, 'r');
  294. }
  295. function setVideoList(videos) {
  296. var videoArr;
  297. if (videos) {
  298. videoArr = videos.split("|");
  299. var selectStr = "";
  300. for (var i in videoArr) {
  301. if (i == 0)
  302. selectStr += '<option value="' + videoArr[i] + '" selected="selected">视频' + (videoArr[i] + 1) + '</option>'
  303. else
  304. selectStr += '<option value="' + videoArr[i] + '">视频' + (videoArr[i] + 1) + '</option>';
  305. }
  306. }
  307. $('#video_list').html(selectStr);
  308. }
  309. function addPic(pic) {
  310. if (pic) {
  311. var i = 0;
  312. // var imgArr = $("#img_container .pic-class");
  313. // if(imgArr && imgArr.length>0) i = imgArr.length;
  314. if (pic.startWith("http"))
  315. pic = pic.replace(base_image_server_url, "/");
  316. var picStr = genPicstr(pic);
  317. $('#img_container').append(picStr);
  318. $('a.lightbox-toggle').lightbox();
  319. }
  320. }
  321. function showPics(pics, divId) {
  322. var picStr = '';
  323. if (!divId) divId = '#img_container';
  324. $(divId).html(picStr);
  325. if (pics) {
  326. var picArr = pics.split(',');
  327. for (var i in picArr) {
  328. var pic = genPicstr(picArr[i]);
  329. picStr += pic;
  330. }
  331. $(divId).html(picStr);
  332. $('a.lightbox-toggle').lightbox();
  333. }
  334. }
  335. function genPicstr(imgSrc) {
  336. var src = imgSrc;
  337. if (!src.startWith("http"))
  338. src = base_image_server_url + src;
  339. var pic = '<div class="img_item" style="width:100px;height:90px;float:left;">'
  340. + '<a href="javascript:void(0)" onclick="removeImg(this)" style="float:right;position:relative;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>'
  341. + '<a class="card lightbox-toggle" data-group="image-group-1" data-lightbox-group="example-3" href="' + src + '" style="position:absolute">'
  342. + '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">'
  343. + '</a>'
  344. + '</div>';
  345. if (ISCLIENT) {
  346. pic = '<div class="img_item" style="width:100px;height:90px;float:left;">'
  347. + '<a href="javascript:void(0)" onclick="removeImg(this)" style="float:right;position:relative;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>'
  348. + '<a class="card" onclick="showClientImg(\'' + src + '\')" href="javascript:void(0)" style="position:absolute">'
  349. + '<img class="pic-class img-thumbnail" path="' + imgSrc + '" style="width:100px;height:70px;" src="' + src + '" alt="">'
  350. + '</a>'
  351. + '</div>';
  352. }
  353. return pic;
  354. }
  355. function removeImg(this1) {
  356. $(this1).parent('.img_item').remove();
  357. }
  358. function clearAllImg() {
  359. $('#img_container').empty();
  360. }
  361. var changePersonLayer;
  362. function showChangeUser() {
  363. var param = {
  364. 'organid': $.checkTask.checked_dept
  365. };
  366. post_common_service("/user/getUserList/", param, function (data) {
  367. changePersonLayer = showPopup4Common('更改人员', null, ['550px', '600px'], null, 'r');
  368. $("#user_container").empty();
  369. var userStr = "";
  370. for (var i in data) {
  371. var name = data[i].truename;
  372. if (data[i].workno) name = name + " " + data[i].workno.substr(data[i].workno.length - 3);
  373. var pic = "../../images/body-bg.png";
  374. if (data[i].pic) pic = base_image_server_url + data[i].pic;
  375. str = '<div style="width:90px;float:left;margin:5px;">'
  376. + '<a class="card" href="javascript:void(0)">'
  377. + '<img src="' + pic + '" alt="" style="height:100px;width:90px;" onclick="showBigImg(\'' + pic + '\')">'
  378. + '<div class="card-heading"><strong>' + name + '</strong></div>'
  379. + '<div class="card-actions">'
  380. + '<button type="button" class="btn btn-mini btn-danger" onclick="changePerson(\'' + data[i].id + '\')">选择</button>'
  381. + '</div>'
  382. + '</a>'
  383. + '</div>';
  384. userStr += str;
  385. }
  386. $("#user_container").html(userStr);
  387. })
  388. }
  389. function changePerson(id) {
  390. // $('#checked_person').html(id);
  391. var param = {
  392. "id": $.checkTask.id,
  393. "checked_person": id,
  394. }
  395. post_common_service("task/update/", param, function (task_data) {
  396. //重置当前任务
  397. $.checkTask = task_data;
  398. //获取用户信息
  399. get_common_service('user/getUserById/' + id, null, function (data) {
  400. changePersonContent(data);
  401. })
  402. //更新用户次数表
  403. no_return_common_service('task/updateUserCount/', param, function (data) {
  404. // changePersonContent(data);
  405. })
  406. layer.close(changePersonLayer);
  407. }, function (error) {
  408. alert(error);
  409. });
  410. }
  411. function showBigImg(src) {
  412. $('#userBigImg').attr("src", src);
  413. layer.open({
  414. offset: 'r',
  415. type: 1,
  416. title: false,
  417. closeBtn: 1,
  418. area: '450px',
  419. skin: 'layui-layer-nobg', //没有背景色
  420. shadeClose: true,
  421. shade: 0,
  422. content: $('#userBigImg')
  423. });
  424. }
  425. function resetUserImgInfo() {
  426. $("#user_img_container").empty();
  427. var str = '<a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle">'
  428. + '<img src="../../images/img4.jpg" class="img-thumbnail" style="width:50px;height:50px;margin-top:-10px;"></a>'
  429. + '<label id="checked_person"></label>';
  430. $("#user_img_container").html(str);
  431. }
  432. function changePersonContent(data) {
  433. resetUserImgInfo();
  434. var name = data.truename;
  435. if (data.workno) name = data.workno + " " + data.truename;
  436. $("#checked_person").html(name);
  437. var imgSrc = base_image_server_url + data.pic;
  438. $("#person_img > img").attr("src", imgSrc);
  439. if (ISCLIENT) {
  440. $("#person_img").attr("href", "javascript:void(0)");
  441. $("#person_img").removeClass("lightbox-toggle");
  442. $("#person_img").click(function () {
  443. showClientImg(imgSrc);
  444. });
  445. $("#person_img > img").attr("src", imgSrc);
  446. return;
  447. } else {
  448. $("#person_img").attr("href", imgSrc);
  449. $('a.lightbox-toggle').lightbox();
  450. }
  451. }
  452. var scoreLayer;
  453. function showScore() {
  454. scoreLayer = showPopup4Common('选择考核项', null, ['400px', '500px'], '#items-div', 'r');
  455. buildTree();
  456. }
  457. function buildTree() {
  458. var zTreeObj;
  459. var zNodes = [];
  460. check_item_tree = $.fn.zTree.init($("#items_tree"), {}, zNodes);
  461. getCheckItems();
  462. }
  463. function getCheckItems() {
  464. function zTreeOnRename(event, treeId, treeNode, isCancel) {
  465. alert(treeNode.tId + ", " + treeNode.name);
  466. }
  467. function zTreeOnRemove(event, treeId, treeNode) {
  468. alert(treeNode.tId + ", " + treeNode.name);
  469. }
  470. var setting = {
  471. data: {
  472. simpleData: {
  473. enable: true,
  474. idKey: "id",
  475. pIdKey: "pId",
  476. rootPId: null
  477. }
  478. },
  479. view: { //表示tree的显示状态
  480. selectMulti: false //表示禁止多选
  481. },
  482. check: { //表示tree的节点在点击时的相关设置
  483. enable: false, //是否显示radio/checkbox
  484. chkStyle: "checkbox", //值为checkbox或者radio表示
  485. checkboxType: { p: "", s: "" }, //表示父子节点的联动效果
  486. radioType: "level" //设置tree的分组
  487. },
  488. callback: {
  489. onDblClick: zTreeOnClick
  490. },
  491. edit: {
  492. enable: true,
  493. drag: {
  494. autoExpandTrigger: true,
  495. isMove: true,
  496. prev: false,
  497. next: true,
  498. inner: true,
  499. autoOpenTime: 0
  500. },
  501. showRenameBtn: false,
  502. showRemoveBtn: false
  503. }
  504. };
  505. get_common_service('checkItem/getAll', null, function (data) {
  506. zdata = [];
  507. for (var i = 0; i < data.length; i++) {
  508. var m = data[i];
  509. zdata.push(genNode(m));
  510. }
  511. menu_tree = $.fn.zTree.init($("#items_tree"), setting, zdata)
  512. }, function (error) {
  513. });
  514. }
  515. function addobj(data) {
  516. var zdata = [];
  517. if (typeof (data.subCheckItem) != "undefinde" && data.subCheckItem != null &&
  518. data.subCheckItem.length > 0) {
  519. for (var i = 0; i < data.subCheckItem.length; i++) {
  520. var m = data.subCheckItem[i];
  521. zdata.push(genNode(m));
  522. }
  523. return zdata;
  524. } else {
  525. return [];
  526. }
  527. }
  528. function genNode(m) {
  529. var zdataItem = {};
  530. zdataItem["id"] = m.id;
  531. zdataItem["value"] = m.name;
  532. zdataItem["pId"] = m.parent_id;
  533. zdataItem["score"] = m.score;
  534. zdataItem["icon"] = "";
  535. zdataItem["name"] = m.name;
  536. //zdataItem["content"] = m.name;
  537. if (m.score) zdataItem["name"] = m.name + '(' + m.score + ')';
  538. zdataItem["open"] = true;
  539. zdataItem["children"] = addobj(m);
  540. return zdataItem;
  541. }
  542. function zTreeOnClick(event, treeId, treeNode) {
  543. var imgArr = $("#img_container .pic-class");
  544. var picsStr = "";
  545. if (imgArr && imgArr.length > 0) {
  546. for (var i = 0; i < imgArr.length; i++) {
  547. picsStr += $(imgArr[i]).attr("path") + ","
  548. }
  549. picsStr = picsStr.substr(0, picsStr.length - 1);
  550. }
  551. var param = {
  552. 'task_id': $.checkTask.id,
  553. 'pics': picsStr,
  554. 'name': treeNode.value,
  555. 'check_item_score': treeNode.score,
  556. 'content': treeNode.value,
  557. 'check_item_id': treeNode.id,
  558. 'checkman': treeNode.id,
  559. 'checked_person': $.checkTask.checked_person,
  560. 'checked_dept': $.checkTask.checked_dept
  561. };
  562. no_return_common_service("/score/add", param, function (data) {
  563. if (scoreLayer) layer.close(scoreLayer);
  564. clearAllImg();
  565. //查询评分情况
  566. queryCheckScores();
  567. layer.msg(data, {
  568. time: 2000//20s后自动关闭
  569. });
  570. });
  571. }
  572. function submitCheck() {
  573. var param = {
  574. "id": $.checkTask.id,
  575. "check_status": 4
  576. }
  577. no_return_common_service("/task/taskEnd/", param, function (data) {
  578. layer.msg("提交成功", {
  579. time: 2000//20s后自动关闭
  580. });
  581. changePage("/view/mytask/task_list.html?status=2");
  582. });
  583. }
  584. function showPre(id) {
  585. // $('#myModal').modal({name:"dd"});
  586. //预览提交把任务状态改为待提交
  587. no_return_common_service('/task/update', {"id":$.checkTask.id,"check_status":7})
  588. changePage("/view/mytask/taskDetail.html");
  589. }
  590. function showInvalid() {
  591. invalidLayer = showPopup4Common('申请无效', function () {
  592. saveValidReason();
  593. }, ['400px', '500px'], '#invalid_div', 'r');
  594. }
  595. function submitCheck4Appeal() {
  596. var param = {
  597. "id": $.checkTask.id,
  598. "check_status": 14
  599. }
  600. no_return_common_service("/task/taskEnd/", param, function (data) {
  601. layer.msg("提交成功", {
  602. time: 2000//20s后自动关闭
  603. });
  604. changePage("/view/mytask/task_list.html?status=2");
  605. });
  606. }
  607. function showPre4Appeal(id) {
  608. // $('#myModal').modal({name:"dd"});
  609. //预览提交把任务状态改为待提交
  610. no_return_common_service('/task/update', {"id":$.checkTask.id,"check_status":17})
  611. changePage("/view/mytask/taskDetail.html");
  612. }
  613. function saveValidReason() {
  614. var param = {
  615. "task_id": $.checkTask.id,
  616. "apply_reason": $("#apply_reason").val()
  617. }
  618. no_return_common_service("/checkApply/add/", param, function (data) {
  619. layer.msg("申请提交成功", {
  620. time: 2000//20s后自动关闭
  621. });
  622. changePage("/view/mytask/task_list.html?status=2");
  623. });
  624. }
  625. function score(score) {
  626. alert("扣分:" + score);
  627. $('#scoreWin').modal('toggle');
  628. }
  629. function refuseApply() {
  630. alert("拒绝申请");
  631. $('#refuseApplyWin').modal('toggle');
  632. }
  633. function agreeApply() {
  634. alert("同意申请");
  635. }
  636. function getVideoPosition(obj) {
  637. if (obj == null) obj = $('#tabcontent');
  638. var X = obj.offset().top;
  639. var Y = obj.offset().left;
  640. var width = obj.width();
  641. var height = obj.height();
  642. return parseInt(Y) + "|" + parseInt(X) + "|" + parseInt(width) + "|" + parseInt(height);
  643. }
  644. function initUpLoad() {
  645. var uploader = WebUploader.create({
  646. // swf文件路径
  647. swf: 'lib/webuploader/js/Uploader.swf',
  648. // 文件接收服务端。
  649. server: base_image_server_url + '/filesSrver/' + FILE_UPLOAD,
  650. // 选择文件的按钮。可选。
  651. // 内部根据当前运行是创建,可能是input元素,也可能是flash.
  652. pick: '#picker',
  653. // 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
  654. resize: false
  655. });
  656. }