taskDetail.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <div class="container-fluid ">
  2. <div class="row">
  3. <h3 style="padding-top: 10px;padding-bottom: 15px;">考核基本信息</h3>
  4. <div>
  5. <table style="width:100%;">
  6. <tr>
  7. <td width="20%">考核任务名:<label id="name"></label></td>
  8. <!--<td width="20%">考核人:<label id="checkman"></label></td>-->
  9. <td width="20%">考核时间: <label id="checktime"></label></td>
  10. <td width="20%">考核人:<label id="checked_person"></label></td>
  11. <td width="20%">考核部门:<label id="checked_dept"></label></td>
  12. </tr>
  13. </table>
  14. </div>
  15. </div>
  16. <hr>
  17. <div class="row">
  18. <h3 style="padding-top: 10px;padding-bottom: 15px;">考核任务流程</h3>
  19. <div id="flow_div">
  20. </div>
  21. </div>
  22. <hr>
  23. <div class="row">
  24. <h3 style="padding-top: 10px;padding-bottom: 15px;">考核详细内容</h3>
  25. <div>
  26. <div id="score_datatable" data-checkable="true" data-sortable="true"></div>
  27. </div>
  28. </div>
  29. <hr>
  30. <div class="row" id="appeal_div">
  31. <h3 style="padding-top: 10px;padding-bottom: 15px;">申诉基本信息</h3>
  32. <div>
  33. <table style="width:100%;">
  34. <tr>
  35. <td width="20%">申诉时间:<label id="appeal_time"></label></td>
  36. <td width="20%">申诉原因:<label id="appeal_reason"></label></td>
  37. </tr>
  38. <tr>
  39. <td width="20%">附件:
  40. <div class="file-list" id="appeal_file_list">
  41. </div>
  42. </td>
  43. <td>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td width="20%">复核结果:
  48. <label id="recheck_result"></label>
  49. </td>
  50. <td>
  51. </td>
  52. </tr>
  53. </table>
  54. </div>
  55. </div>
  56. <div class="row" style="margin-top:5px;text-align:center">
  57. <div>
  58. <button id="submitBtn" style="display:none" type="button" class="btn btn-warning" onclick="submitCheck()">提交</button>
  59. <button id="confirmBtn" style="display:none" type="button" class="btn btn-warning" onclick="confirmCheck()">确认</button>
  60. <button id="submitAppealBtn" style="display:none" type="button" class="btn btn-warning" onclick="submitCheck4Appeal()">复核提交</button>
  61. <button id="confirmAppealBtn" style="display:none" type="button" class="btn btn-warning" onclick="confirmCheck4Appeal()">申诉结果确认</button>
  62. <button id="appealBtn" style="display:none" type="button" class="btn btn-danger" onclick="showAppeal()">申诉</button>
  63. <button id="assignBtn" style="display:none" type="button" class="btn btn-danger" onclick="showAssign()">分配</button>
  64. <button id="backBtn" style="display:none" type="button" class="btn btn-danger" onclick="back2Check()">退回重新稽查</button>
  65. <button id="backAppealBtn" style="display:none" type="button" class="btn btn-danger" onclick="back2AppealCheck()">退回重新复查</button>
  66. <button id="backConfirmBtn" style="display:none" type="button" class="btn btn-danger" onclick="back2Confirm()">退回重新确认</button>
  67. </div>
  68. </div>
  69. </div>
  70. <div id="form-div" style="display:none;text-align:center;height:300px;padding:5px;">
  71. <div class="row">
  72. <div id="img_container" class="cards cards-borderless col-sm-12">
  73. </div>
  74. </div>
  75. </div>
  76. <div id="appealDetail-div" style="display:none;text-align:center;">
  77. <link rel="import" href="/view/appeal_management/appealDetail.html?__inline">
  78. </div>
  79. <div id="chooseCheckman-div" style="display:none;text-align:center;">
  80. <link rel="import" href="/view/mytask/chooseCheckman.html?__inline">
  81. </div>
  82. <style>
  83. .line {
  84. text-align: center;
  85. font-size: 20px;
  86. height: 5px;
  87. margin: 15px 0px;
  88. width: 100%;
  89. background: #1296db;
  90. overflow: hidden;
  91. }
  92. .timeline_item_station {
  93. left: 42%;
  94. /* margin-left: 55px; */
  95. margin-top: 18px;
  96. width: 25px;
  97. height: 25px;
  98. padding: 15px;
  99. border-width: 6px;
  100. background-color: rgb(50, 141, 199);
  101. position: absolute;
  102. border-radius: 50%;
  103. padding: 10px;
  104. top: 0;
  105. -webkit-transition: all .3s ease-out;
  106. transition: all .3s ease-out;
  107. }
  108. </style>
  109. <script>
  110. $(document).ready(function() {
  111. addBreadMenu("/view/mytask/taskDetail.html", "稽查详情");
  112. checkAuth();
  113. $("#name").html($.checkTask.name);
  114. $("#checkman").html($.checkTask.checkman_name);
  115. $("#checktime").html($.checkTask.start_time);
  116. $("#checked_person").html($.checkTask.checked_person_name);
  117. $("#checked_dept").html($.checkTask.checked_dept_name);
  118. if ($.checkTask.appeal) {
  119. $("#appeal_div").show();
  120. $("#appeal_time").html($.checkTask.appeal.appeal_time);
  121. $("#appeal_reason").html($.checkTask.appeal.appeal_reason);
  122. $("#appeal_file_list").html(genAppeaFiles($.checkTask.appeal.file_src));
  123. $("#recheck_result").html($.checkTask.appeal.recheck_result);
  124. } else {
  125. $("#appeal_div").hide();
  126. }
  127. genFlow();
  128. queryScores();
  129. });
  130. //初始化表行按钮
  131. function initBtns() {
  132. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_2", ["#submitBtn"]);
  133. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_3", ["#submitBtn"]);
  134. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_7", ["#submitBtn"]);
  135. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_12", ["#submitAppealBtn"]);
  136. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_13", ["#submitAppealBtn"]);
  137. $.zui.store.set("task_detail_btn_" + ROLE_JICHA + "_17", ["#submitAppealBtn"]);
  138. $.zui.store.set("task_detail_btn_" + ROLE_JICHA_ADMIN + "_4", ["#backBtn"]);
  139. $.zui.store.set("task_detail_btn_" + ROLE_JICHA_ADMIN + "_6", ["#backConfirmBtn"]);
  140. $.zui.store.set("task_detail_btn_" + ROLE_JICHA_ADMIN + "_14", ["#backAppealBtn"]);
  141. $.zui.store.set("task_detail_btn_" + ROLE_JICHA_ADMIN + "_11", ["#assignBtn"]);
  142. $.zui.store.set("task_detail_btn_" + ROLE_STATION_ADMIN + "_5", ["#confirmBtn", "#appealBtn"]);
  143. $.zui.store.set("task_detail_btn_" + ROLE_STATION_ADMIN + "_15", ["#confirmAppealBtn"]);
  144. $.zui.store.set("task_detail_btn_" + ROLE_STATION_AGENT + "_5", ["#confirmBtn", "#appealBtn"]);
  145. $.zui.store.set("task_detail_btn_" + ROLE_STATION_AGENT + "_15", ["#confirmAppealBtn"]);
  146. }
  147. function checkAuth() {
  148. initBtns();
  149. showBtn(ROLE_JICHA, $.checkTask.check_status);
  150. showBtn(ROLE_JICHA_ADMIN, $.checkTask.check_status);
  151. showBtn(ROLE_STATION_ADMIN, $.checkTask.check_status);
  152. showBtn(ROLE_STATION_AGENT, $.checkTask.check_status);
  153. }
  154. function showBtn(role, status) {
  155. if (hasRole(role)) {
  156. var btnArr = $.zui.store.get("task_detail_btn_" + role + "_" + status);
  157. if (btnArr) {
  158. for (var i in btnArr) {
  159. $(btnArr[i]).show();
  160. }
  161. }
  162. }
  163. }
  164. function queryScores() {
  165. // 使用data参数更新数据:
  166. var data = {
  167. "task_id": $.checkTask.id
  168. }
  169. var cols = [{
  170. width: 80,
  171. text: '序号',
  172. type: 'number',
  173. flex: true,
  174. colClass: 'text-center',
  175. field: 'num'
  176. }, {
  177. width: 60,
  178. text: '评分记录',
  179. type: 'string',
  180. flex: true,
  181. sort: 'down',
  182. field: 'content'
  183. }, {
  184. width: 80,
  185. text: '分数',
  186. type: 'string',
  187. flex: true,
  188. colClass: '',
  189. field: 'check_item_score'
  190. }, {
  191. width: 80,
  192. text: '扣分人',
  193. type: 'string',
  194. flex: true,
  195. colClass: '',
  196. field: 'checked_person_name'
  197. }, {
  198. width: 80,
  199. text: '备注',
  200. type: 'string',
  201. flex: true,
  202. colClass: '',
  203. field: 'remark'
  204. }, {
  205. width: 200,
  206. text: '图片',
  207. type: 'imagedd',
  208. flex: true,
  209. colClass: '',
  210. field: 'pics'
  211. }];
  212. if (hasRole(ROLE_JICHA) && ($.checkTask.check_status == 2 || $.checkTask.check_status == 2 || $.checkTask.check_status == 12 ||
  213. $.checkTask.check_status == 13)) {
  214. var oper = {
  215. width: 160,
  216. text: '操作',
  217. type: 'string',
  218. flex: true,
  219. field: 'id',
  220. oper: [{
  221. func: 'showEditScore',
  222. text: '修改',
  223. icon_class: 'icon-edit'
  224. }, {
  225. func: 'deleteScore',
  226. text: '删除',
  227. icon_class: 'icon-remove-circle'
  228. }]
  229. }
  230. cols.push(oper);
  231. }
  232. $('#score_datatable').mytable({
  233. 'cols': cols,
  234. 'url': "/score/getScoreList/",
  235. 'param': data
  236. });
  237. $('a.lightbox-toggle').lightbox();
  238. }
  239. var curScoreId;
  240. function showEditScore(id) {
  241. var rowData = getItemByIdFromArr(id, $('#score_datatable').mytable('getTableData'));
  242. // alert(rowData.pics);
  243. curScoreId = rowData.id;
  244. scoreImageLayer = showPopup4Common('修改图片', updateImg, '600px');
  245. showTaskDetailPics(rowData.pics);
  246. }
  247. function showTaskDetailPics(pics, divId) {
  248. var picStr = '';
  249. if (!divId) divId = '#img_container';
  250. $(divId).html(picStr);
  251. if (pics) {
  252. var picArr = pics.split(',');
  253. for (var i in picArr) {
  254. var ispic = true;
  255. var src = picArr[i];
  256. if (!src.startWith("http"))
  257. src = base_image_server_url + src;
  258. var videosrc = src;
  259. if (src.indexOf('.avi') != -1) {
  260. src = src.split('.avi')[0] + "_screen_0.png"
  261. ispic = false;
  262. }
  263. if (src.indexOf('.mov') != -1) {
  264. src = src.split('.mov')[0] + "_screen_0.png"
  265. ispic = false;
  266. }
  267. if (src.indexOf('.mp4') != -1) {
  268. src = src.split('.mp4')[0] + "_screen_0.png"
  269. ispic = false;
  270. }
  271. var pic = '<div id="img_item_' + i + '" class="col-md-4 col-sm-6 col-lg-3">' +
  272. '<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>' +
  273. (ispic ? '<a class="card lightbox-toggle" data-group="image-group-1" data-lightbox-group="example-3" href="' + src + '" style="position:absolute">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="position:absolute">') +
  274. '<img class="pic-class img-thumbnail" style="width:200px;height:150px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 40px;left:80px;color: white;"></i>') +
  275. '</a>' +
  276. '</div>';
  277. picStr += pic;
  278. }
  279. $(divId).html(picStr);
  280. $('a.lightbox-toggle').lightbox();
  281. }
  282. }
  283. function updateImg() {
  284. var imgArr = $("#img_container .pic-class");
  285. var picsStr = "";
  286. if (imgArr && imgArr.length > 0) {
  287. for (var i = 0; i < imgArr.length; i++) {
  288. picsStr += imgArr[i].src + ","
  289. }
  290. picsStr = picsStr.substr(0, picsStr.length - 1);
  291. }
  292. var param = {
  293. 'id': curScoreId,
  294. 'pics': picsStr
  295. }
  296. // alert("dddd");
  297. addOrUpdateItem4Common(param, "/score/update", queryScores);
  298. curScoreId = "";
  299. }
  300. function deleteScore(id) {
  301. deleteItem4Common(id, "/score/delete/", queryScores);
  302. }
  303. function genFlow() {
  304. var data = {
  305. "id": $.checkTask.id
  306. };
  307. post_common_service("/task/getStatusById/", data, function(data) {
  308. if (data) {
  309. var flowStr = "";
  310. for (var i in data) {
  311. var str = "";
  312. if (i == 0) {
  313. str = '<div class="col-sm-2" style="text-align:center;padding:0px;width: 87px;margin-left:-60px;">' +
  314. '<div class="row" style=" margin-left: 56px;">' +
  315. ' <label>开始</label>' +
  316. '</div>' +
  317. ' <div class="timeline_item_station" style=" margin-left: 25px;"></div>' +
  318. '</div>'
  319. }
  320. str +=
  321. // '<div class="col-sm-2" style="text-align:center;padding:0px;width: 87px;margin-left:-88px;">' +
  322. // ' <img src="/images/end.png" style="width: 35px;margin-left: 36px;margin-top: 25px;">' +
  323. // '</div>' +
  324. '<div class="col-sm-2" style="text-align:center;padding:0px;width: 140px;margin-bottom: 33px;">' +
  325. '<div class="row">' +
  326. ' <label>' + data[i].check_status_name + '</label>' +
  327. '</div>' +
  328. '<div class="row line" style="margin-top: 3px;">' +
  329. ' <div class="timeline_item_station"></div>' +
  330. '</div>' +
  331. '<div class="row" style="margin-top: -5px;">' +
  332. ' <label style=" font-weight: 400;">' + data[i].update_time + '</label>' +
  333. '</div>' +
  334. (i == data.length - 1 ? (
  335. ' <img src="/images/end.png" style="width: 28px;right:-10px; position: absolute; top:16px;">'
  336. ) : "") +
  337. '</div>';
  338. flowStr += str;
  339. }
  340. $("#flow_div").html(flowStr);
  341. }
  342. })
  343. }
  344. function submitCheck() {
  345. var param = {
  346. "id": $.checkTask.id,
  347. "check_status": 4
  348. }
  349. no_return_common_service("/task/taskEnd/", param, function(data) {
  350. layer.msg("提交成功", {
  351. time: 2000 //20s后自动关闭
  352. });
  353. redirectLastPage();
  354. });
  355. }
  356. function submitCheck4Appeal() {
  357. var appeal_result = 1;
  358. //询问框
  359. layer.confirm('该申诉是否成功?', {
  360. btn: ['成功', '失败'] //按钮
  361. }, function() {
  362. appeal_result = 1;
  363. submitAppealResult(appeal_result);
  364. }, function() {
  365. appeal_result = 2;
  366. submitAppealResult(appeal_result);
  367. });
  368. }
  369. function submitAppealResult(appeal_result) {
  370. var param = {
  371. "id": $.checkTask.id,
  372. "check_status": 14,
  373. "appeal_id": $.checkTask.appeal.id,
  374. "appeal_result": appeal_result
  375. }
  376. no_return_common_service("/task/update/", param, function(data) {
  377. layer.msg("提交成功", {
  378. time: 2000 //20s后自动关闭
  379. });
  380. redirectLastPage();
  381. });
  382. }
  383. var appealLayer;
  384. function showAppeal() {
  385. // appealLayer = showPopup4Common('申诉',saveAppeal,'600px','#appealDetail-div');
  386. layer.open({
  387. type: 1,
  388. area: '600px',
  389. title: '申诉',
  390. closeBtn: 1,
  391. shadeClose: true,
  392. skin: 'layui-layer-lan',
  393. content: $('#appealDetail-div'),
  394. btn: '保存',
  395. btnAlign: 'c', //按钮居中
  396. shade: 0, //不显示遮罩
  397. yes: function(index) {
  398. saveAppeal();
  399. }
  400. });
  401. }
  402. function confirmCheck() {
  403. layer.confirm('是否确认该稽查结果?', {
  404. btn: ['确认', '取消'], //按钮
  405. offset: 'auto'
  406. }, function() {
  407. var param = {
  408. "id": $.checkTask.id,
  409. "check_status": 6
  410. }
  411. no_return_common_service("/task/update/", param, function(data) {
  412. layer.msg("确认成功", {
  413. time: 2000 //20s后自动关闭
  414. });
  415. redirectLastPage();
  416. });
  417. }, function(index) {
  418. layer.close(index);
  419. });
  420. }
  421. function confirmCheck4Appeal() {
  422. layer.confirm('是否确认该申诉结果?', {
  423. btn: ['确认', '取消'], //按钮
  424. offset: 'auto'
  425. }, function() {
  426. var param = {
  427. "id": $.checkTask.id,
  428. "check_status": 16
  429. }
  430. no_return_common_service("/task/update/", param, function(data) {
  431. layer.msg("确认成功", {
  432. time: 2000 //20s后自动关闭
  433. });
  434. redirectLastPage();
  435. });
  436. }, function(index) {
  437. layer.close(index);
  438. });
  439. }
  440. function showAssign() {
  441. showPopup4Common('分配稽查员', function() {
  442. saveAssign();
  443. }, '400px', '#chooseCheckman-div');
  444. setCheckmanSelect('#choseCheckmanList', null, $.checkTask.checkman,
  445. function() {
  446. $('#choseCheckmanList').chosen({
  447. // width:'200px',
  448. height: '100px',
  449. no_results_text: '没有找到', // 当检索时没有找到匹配项时显示的提示文本
  450. disable_search_threshold: 10, // 10 个以下的选择项则不显示检索框
  451. search_contains: true // 从任意位置开始检索
  452. });
  453. });
  454. }
  455. function saveAssign() {
  456. var param = {
  457. "id": $.checkTask.id,
  458. "recheckman": $('#choseCheckmanList').val(),
  459. "check_status": 12
  460. }
  461. no_return_common_service("/task/update/", param, function(data) {
  462. layer.msg("分配成功", {
  463. time: 2000 //20s后自动关闭
  464. });
  465. redirectLastPage();
  466. });
  467. }
  468. function back2Check() {
  469. //退回到待提交页面
  470. var param = {
  471. "id": $.checkTask.id,
  472. "check_status": 3,
  473. "check_status_name": "退回"
  474. }
  475. no_return_common_service("/task/update/", param, function(data) {
  476. layer.msg("退回成功", {
  477. time: 2000 //20s后自动关闭
  478. });
  479. redirectLastPage();
  480. });
  481. }
  482. function back2Confirm() {
  483. //退回到待提交页面
  484. var param = {
  485. "id": $.checkTask.id,
  486. "check_status": 5,
  487. "check_status_name": "退回重新确认"
  488. }
  489. no_return_common_service("/task/update/", param, function(data) {
  490. layer.msg("退回成功", {
  491. time: 2000 //20s后自动关闭
  492. });
  493. redirectLastPage();
  494. });
  495. }
  496. function back2AppealCheck() {
  497. //退回到待提交页面
  498. var param = {
  499. "id": $.checkTask.id,
  500. "check_status": 13,
  501. "check_status_name": "退回"
  502. }
  503. no_return_common_service("/task/update/", param, function(data) {
  504. layer.msg("退回成功", {
  505. time: 2000 //20s后自动关闭
  506. });
  507. redirectLastPage();
  508. });
  509. }
  510. </script>