rjkcbHomep_dm.ss.jsp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <html>
  2. <head>
  3. <style>
  4. #pmtEdit {
  5. /*overflow: auto!important;*/
  6. }
  7. .icon {
  8. float: left;
  9. width: 50px;
  10. height: 20px;
  11. font-size: 10px;
  12. /* text-align: center; */
  13. margin-right: 8px;
  14. line-height: 20px;
  15. }
  16. .name {
  17. font-size: 14px;
  18. /* font-weight: bold; */
  19. }
  20. .warningProgress-div {
  21. position: absolute;
  22. bottom: 0px;
  23. left: 0px;
  24. width: 100%;
  25. }
  26. .warningProgress-done {
  27. position: absolute;
  28. bottom: 0px;
  29. }
  30. .checkin .warningProgress-done {
  31. width: 0%;
  32. }
  33. .toolate .warningProgress-done {
  34. width: 50%;
  35. left: 0px;
  36. }
  37. .tooearly .warningProgress-done {
  38. width: 50%;
  39. right: 0px;
  40. }
  41. .crunk .warningProgress-done {
  42. width: 100%;
  43. left: 0px;
  44. }
  45. .top-font {
  46. font-size: 12px;
  47. color: #000;
  48. }
  49. .red {
  50. font-size: 12px;
  51. color: #f00;
  52. }
  53. .checkin .red {
  54. color: #010101;
  55. }
  56. .bottom-div {
  57. /*bottom: 40px !important;*/
  58. }
  59. #ascrail2001 {
  60. margin-top: -4px;
  61. }
  62. .bjbox:last-child {
  63. margin-bottom: 70px;
  64. }
  65. .scrollbar:last-child {
  66. /*margin-bottom: 1rem;*/
  67. }
  68. </style>
  69. <script type="text/javascript">
  70. window.onunload = function(){
  71. var twin = wd.display.getwdDialogOpener();
  72. $(twin.document).find("li[bjlb=5011] .icon-schedule").trigger("click");//触发外层的刷新
  73. }
  74. function refreshHomePluginRjkcb(){
  75. var twin = wd.display.getwdDialogOpener();
  76. $(twin.document).find("li[bjlb=5011] .icon-schedule").trigger("click");//触发外层的刷新
  77. wd.display.closeDialog();
  78. }
  79. </script>
  80. </head>
  81. <body>
  82. <input name="kcbid" type="hidden" value="${kcb.kcbid}" />
  83. <div class="search-div hLine" style="position: sticky;background: #fff;top: 0;z-index: 99999;">
  84. <div style="padding: 15px 25px 12px 25px;">
  85. <div style="height: 20px;display: inline-block;vertical-align: middle;position: relative;text-indent: 5px;margin-right:20px;" class="top-font">
  86. 出勤:<span class="zc">${later==0?'-':(pmtDataSize - kqtj.kk - kqtj.cd - kqtj.zt -kqtj.qj)}</span>
  87. <div class="warningProgress-div" style="width: 34px;bottom: 0px;left: 12px;">
  88. <div class="warningProgress-done" style="width: 0%;right: 0px;"></div>
  89. </div>
  90. </div>
  91. <div style="height: 20px;display: inline-block;vertical-align: middle;position: relative;text-indent: 5px;margin-right:20px;" class="top-font">
  92. 旷课:<span class="kk">${later==0?'-':kqtj.kk}</span>
  93. <div class="warningProgress-div" style="width: 34px;bottom: 0px;left: 12px;">
  94. <div class="warningProgress-done" style="width: 100%;left: 0px;"></div>
  95. </div>
  96. </div>
  97. <div style="height: 20px;display: inline-block;vertical-align: middle;position: relative;text-indent: 5px;margin-right:20px;" class="top-font">
  98. 迟到:<span class="cd">${later==0?'-':kqtj.cd}</span>
  99. <div class="warningProgress-div" style="width: 34px;bottom: 0px;left: 12px;">
  100. <div class="warningProgress-done" style="width: 50%;left: 0px;"></div>
  101. </div>
  102. </div>
  103. <div style="height: 20px;display: inline-block;vertical-align: middle;position: relative;text-indent: 5px;margin-right:20px;" class="top-font">
  104. 早退:<span class="zt">${later==0?'-':kqtj.zt}</span>
  105. <div class="warningProgress-div" style="width: 34px;bottom: 0px;left: 12px;">
  106. <div class="warningProgress-done" style="width: 50%;right: 0px;"></div>
  107. </div>
  108. </div>
  109. <div style="height: 20px;display: inline-block;vertical-align: middle;position: relative;text-indent: 5px;margin-right:20px;" class="top-font">
  110. 请假:<span class="qj">${kqtj.qj}</span>
  111. <div class="warningProgress-div" style="width: 34px;bottom: 0px;left: 12px;">
  112. <div class="progress-done" style="width: 100%;right: 0px;height: 3px"></div>
  113. </div>
  114. </div>
  115. <input type="button" id="rjkcb_qq" class="content-onButton" style="float: right;margin-right: -12px;display:none;" value="全勤">
  116. <equal.ss val="${later==0}" val2="false">
  117. <script>
  118. $("#rjkcb_qq").css("display","");
  119. var yczs=${kqtj.kk + kqtj.cd + kqtj.zt + kqtj.qj}
  120. if(yczs==0){
  121. $("#rjkcb_qq").removeClass("content-offButton").addClass("content-onButton");
  122. }else{
  123. $("#rjkcb_qq").removeClass("content-onButton").addClass("content-offButton");
  124. }
  125. </script>
  126. </equal.ss>
  127. </div>
  128. <equal.ss val="${later==0}" val2="true">
  129. <script>
  130. function isQQ() { // 全勤。Lin
  131. $.ajax({
  132. url: '@service{name:"homePluginRjkcb_dm_qqdm"}@',
  133. data: {
  134. kcbid: kcbid
  135. },
  136. dataType: "json",
  137. type: "post",
  138. success: function(result) {
  139. if (result.success) {
  140. $(".cd").text(0);
  141. $(".zt").text(0);
  142. $(".kk").text(0);
  143. var rs = $('#pmtDataSize').val();
  144. $(".zc").text(rs);
  145. $("#rjkcbDiv").remove();
  146. $("#rjkcb_qq").css("display","");
  147. $("#rjkcb_qq").removeClass("content-offButton").addClass("content-onButton");
  148. }
  149. }
  150. })
  151. }
  152. function tsj() { // 同上节。Lin
  153. $.ajax({
  154. url: '@service{name:"homePluginRjkcb_dm_tsj"}@',
  155. data: {
  156. kcbid: kcbid
  157. },
  158. dataType: "json",
  159. type: "post",
  160. success: function(result) {
  161. if (result.success) {
  162. location.reload();
  163. $("#rjkcbDiv").remove();
  164. }
  165. }
  166. })
  167. }
  168. </script>
  169. <div id="rjkcbDiv" style="float: right;margin-right: 10px;">
  170. <input type="button" id="rjkcb_qd" onclick="isQQ()" class="content-button" value="全到">
  171. <equal.ss val="${hasSjdm==1}" val2="true">
  172. <input type="button" id="rjkcb_tsj" onclick="tsj()" class="content-button" value="同上节">
  173. </equal.ss>
  174. </div>
  175. </equal.ss>
  176. <%--
  177. <wd:equal leftValue="${later==0}" rightValue="true">
  178. <script>
  179. function isQQ(){
  180. $.ajax({
  181. url:'@service{name:"homePluginRjkcb_dm_qqdm"}@',
  182. data:{kcbid:kcbid},
  183. dataType:"json",
  184. type:"post",
  185. success:function(result){
  186. if(result.success){
  187. //$("#rjkcbDiv").remove();
  188. }
  189. }
  190. })
  191. }
  192. function tsj(){
  193. $.ajax({
  194. url:'@service{name:"homePluginRjkcb_dm_tsj"}@',
  195. data:{kcbid:kcbid},
  196. dataType:"json",
  197. type:"post",
  198. success:function(result){
  199. if(result.success){
  200. location.reload();
  201. // $("#rjkcbDiv").remove();
  202. }
  203. }
  204. })
  205. }
  206. </script>
  207. <div id="rjkcbDiv" style="display:flex;justify-content: flex-end; position: absolute;right: 0;top:10px;z-index:9999;">
  208. <input type="button" id="rjkcb_tsj" class="content-offButton" onclick="tsj()" style="margin-right: 40px;" value="同上节" >
  209. <input type="button" id="rjkcb_qq" class="content-offButton" onclick="isQQ()" style="margin-right: 40px;" value="全勤" >
  210. </div>
  211. </wd:equal>
  212. --%>
  213. </div>
  214. <input type="hidden" id="pmtDataSize" value='${pmtDataSize}' />
  215. <div class="plugin-component-div">
  216. <div id="sybjBody" class="scrollbar" style="height: calc(100% - 111px)!important;width: 100%;box-sizing: border-box;padding: 0 10px;margin-top:10px;">
  217. <equal.ss val="${!empty pmtid }" val2="true">
  218. <div style="overflow: auto;height: 500px;margin-bottom: 26px;" class="scrollbar">
  219. <%-- 改。Lin
  220. <input type="hidden" id="changestateUrl" value='@service{name:"homePluginRjkcb_dm_qhzt"}@' /> --%>
  221. <input type="hidden" id="changestateUrl" value="<serv.ss name='rjkcbHomep_swState'/>"/>
  222. <input type="hidden" name="pmtid" value='${pmtid}' />
  223. <input type="hidden" name="pmtdata" value='${pmtData}' />
  224. <div id="pmtEdit" class="scrollbar" style='border: 1px solid #E4E4E4;position: absolute;height: 425px;width: calc(100% - 20px);margin-left:10px;overflow: auto;'>
  225. </div>
  226. <form.ss name="pmt"/>
  227. </div>
  228. </equal.ss>
  229. <equal.ss val="${empty pmtid }" val2="true">
  230. <rpt.ss name="bjList" id="bjItem">
  231. <div style="overflow: auto;height: auto;margin-bottom: 26px;display: grid;" class="scrollbar bjbox">
  232. <div id="bt" class="plugin-title hLine-highlightBlod" style="margin-bottom: 5px;">
  233. <span style="vertical-align: middle;margin-left: 15px;">${bjItem[0].bjmc} 班级人数:${bjItem[0].size}人</span>
  234. </div>
  235. <div style="padding-left:36px;">
  236. <rpt.ss name="${bjItem}" id="item">
  237. <equal.ss val="${item.rcid &gt; 0}" val2="true">
  238. <div name="kqjl" kqjlid="${item.kqjlid eq 0? '' : item.kqjlid}" kqlbm="${item.kqlbm}" rcid="${item.rcid}"
  239. xyid="${item.xyid}" jlztm="${item.jlztm}" class='toolate wd leave' style="border-radius:0;width: 240px;height: 84px;display: flex;margin-bottom: 5px;margin-top: 0px;float:left;;padding:0 6px 6px 6px">
  240. <div class="rightBar" style="background:rgb(108,158,215)">
  241. </div>
  242. <equal.ss val="${empty item.zpwj}" val2="true">
  243. <div style="box-sizing: border-box;width:auto;height:82px;padding-top: 6px;">
  244. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0 src="${sessionScope.ssUser.skinDir}image/default-photo.png" /> <%-- ="$@{sessionScope['wd.yh'].pflj}。Lin --%>
  245. </div>
  246. </equal.ss>
  247. <equal.ss val="${empty item.zpwj}" val2="false">
  248. <div style="box-sizing: border-box;padding-top: 6px;width:60px;height:82px;display: flex;align-items: center;justify-content: center;">
  249. <%-- 改。Lin
  250. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0 src="@service{name:'getData',param:{path:'${item.zpwj}'}}@" /> --%>
  251. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0
  252. src="<serv.ss name='dlByHttp' parm='{path:"${item.zpwj}"}'/>"/>
  253. </div>
  254. </equal.ss>
  255. <div style="display: flex;flex-direction: column;justify-content: flex-start;align-items: flex-start;margin-left: 6px;">
  256. <span class="name longCardList-highlight" style="">${item.xm}</span>
  257. <div class="longCardList-dim" id="ms" style="overflow: unset!important;padding-top: 8px;line-height: 16px;width: 182px;font-size:12px;color:#666;font-family:'黑体';">
  258. <span>${item.pwxh}</span>
  259. <br />
  260. <span>${item.xyh}</span>
  261. <span class="longCardList" style="display: flex;margin-top: 9px;">
  262. <span class="red">请假</span>
  263. </span>
  264. </div>
  265. </div>
  266. </div>
  267. </equal.ss>
  268. <equal.ss val="${item.rcid == 0}" val2="true">
  269. <div name="kqjl" kqjlid="${item.kqjlid eq 0? '' : item.kqjlid }" kqlbm="${item.kqlbm }" rcid="${item.rcid }"
  270. xyid="${item.ryid}" xyxm="${item.xm}" jlztm="${item.jlztm}" onclick="xy_dm_lr(this)" <%-- 增加 xyxm,RjkcbHomepServ.swStateByA() 不用再取。Lin --%>
  271. class='
  272. <equal.ss val="${item.kqlbm==81 &amp;&amp; item.rcid==0}" val2="true">
  273. checkin wd
  274. </equal.ss>
  275. <equal.ss val="${item.kqlbm==11 &amp;&amp; item.rcid==0}" val2="true">
  276. toolate wd
  277. </equal.ss>
  278. <equal.ss val="${item.kqlbm==21 &amp;&amp; item.rcid==0}" val2="true">
  279. tooearly wd
  280. </equal.ss>
  281. <equal.ss val="${item.kqlbm==1 &amp;&amp; item.rcid==0}" val2="true">
  282. crunk wd
  283. </equal.ss>
  284. '
  285. style="border-radius:0;width: 240px;height: 84px;display: flex;margin-bottom: 5px;margin-top: 0px;float: none;padding:0 6px 6px 6px;float: left;">
  286. <div class="rightBar">
  287. <div class="rightBar-xdiv"></div>
  288. </div>
  289. <equal.ss val="${empty item.zpwj}" val2="true">
  290. <div style="box-sizing: border-box;width:auto;height:82px;padding-top: 6px;">
  291. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0 src='${sessionScope.ssUser.skinDir}image/default-photo.png' /> <%-- ='$@{sessionScope["wd.yh"].pflj}。Lin --%>
  292. </div>
  293. </equal.ss>
  294. <equal.ss val="${empty item.zpwj}" val2="false">
  295. <div style="box-sizing: border-box;padding-top: 6px;width:60px;height:82px;display: flex;align-items: center;justify-content: center;">
  296. <%-- 改。Lin
  297. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0 src="@service{name:'getData',param:{path:'${item.zpwj}'}}@" /> --%>
  298. <img style="border-bottom:none;margin-bottom: 0px;width:auto;height:auto;max-width: 100%;max-height: 100%" border=0
  299. src="<serv.ss name='dlByHttp' parm='{path:"${item.zpwj}"}'/>"/>
  300. </div>
  301. </equal.ss>
  302. <div style="display: flex;flex-direction: column;justify-content: flex-start;align-items: flex-start;margin-left: 6px;">
  303. <span class="name longCardList-highlight" style="">${item.xm}</span>
  304. <div class="longCardList-dim" id="ms" style="overflow: unset!important;padding-top: 8px;line-height: 16px;width: 182px;font-size:12px;color:#666;font-family:'黑体';">
  305. <span>${item.pwxh}</span>
  306. <br />
  307. <span>${item.xyh}</span>
  308. <span class="longCardList" style="display: flex;margin-top: 9px;">
  309. <span class="itemZt red" id="zt">
  310. <equal.ss val="${item.kqlbm == 81}" val2="true">
  311. 出勤
  312. </equal.ss>
  313. <equal.ss val="${item.kqlbm == 11}" val2="true">
  314. 迟到
  315. </equal.ss>
  316. <equal.ss val="${item.kqlbm == 21}" val2="true">
  317. 早退
  318. </equal.ss>
  319. <equal.ss val="${item.kqlbm == 1}" val2="true">
  320. 旷课
  321. </equal.ss>
  322. </span>
  323. </span>
  324. </div>
  325. </div>
  326. </div>
  327. </equal.ss>
  328. </rpt.ss>
  329. </div>
  330. </div>
  331. </rpt.ss>
  332. </equal.ss>
  333. </div>
  334. </div>
  335. <div class="bottom-div">
  336. <div class="bottom-down-div">
  337. <equal.ss val="${empty dataType}" val2="true">
  338. <input class="bottom-button" type="button" value="关闭" onclick="refreshHomePluginRjkcb()">
  339. </equal.ss>
  340. </div>
  341. </div>
  342. </body>
  343. <style>
  344. /* 顶掉样式表line-height */
  345. .longCardList-highlight {
  346. line-height: 29px;
  347. }
  348. .wd {
  349. width: 150px;
  350. height: 150px;
  351. border-radius: 15px;
  352. margin: 5px;
  353. overflow-x: hidden;
  354. overflow: auto;
  355. float: left;
  356. border: 1px solid #E4E4E5;
  357. font-size: 14px;
  358. position: relative;
  359. background-color: #fff;
  360. }
  361. .wd img {
  362. max-width: 100%;
  363. width: 100%;
  364. height: 100px;
  365. border-bottom: 1px solid #e4e4e4;
  366. margin-bottom: 15px;
  367. }
  368. .wraper img {
  369. width: 80px;
  370. height: 90px;
  371. margin-left: 10px;
  372. }
  373. .bottomDiv {
  374. width: 100%;
  375. height: 20px;
  376. line-height: 20px;
  377. position: absolute;
  378. bottom: 0;
  379. font-size: 12px;
  380. overflow: hidden;
  381. }
  382. .bottomDiv .num {
  383. display: inline-block;
  384. width: 20px;
  385. text-align: center;
  386. background: #999;
  387. padding: 0;
  388. color: #fff;
  389. line-height: 20px;
  390. height: 20px;
  391. }
  392. .rightBar {
  393. width: 15px;
  394. height: 100%;
  395. position: absolute;
  396. right: 0px;
  397. background: #e1e1e1;
  398. }
  399. .rightBar-xdiv {
  400. width: 100%;
  401. position: absolute;
  402. background-color: #f00;
  403. }
  404. .checkin .rightBar .rightBar-xdiv {
  405. display: none
  406. }
  407. .crunk .rightBar .rightBar-xdiv {
  408. height: 100%;
  409. }
  410. .toolate .rightBar .rightBar-xdiv {
  411. height: 50%;
  412. top: 0px;
  413. }
  414. .tooearly .rightBar .rightBar-xdiv {
  415. height: 50%;
  416. bottom: 0;
  417. }
  418. </style>
  419. <equal.ss val='${dataType=="play"}' val2="false">
  420. <script>
  421. var kcbid = "${kcbid}";
  422. var bdm = "${bdm}";
  423. var lskcbid = "${lskcbid==null?kcbid:lskcbid}";
  424. //jlztm为1时 或不存在考情记录
  425. function xy_homePluginRjkcb_dm_qhzt(_obj) {
  426. var kqjlid = $(_obj).attr("kqjlid");
  427. var kqlbm = getQhKqlbm(_obj);
  428. var xyid = $(_obj).attr("xyid");
  429. var xyxm = $(_obj).attr("xyxm"); // 增加,RjkcbHomepServ.swStateByA() 不用再取。Lin --%>
  430. ajaxqhzt(_obj, kqjlid, kqlbm, xyid, xyxm); // 增加 xyxm,RjkcbHomepServ.swStateByA() 不用再取。Lin --%>
  431. }
  432. function onOrOffQq(kqtj) {
  433. var yczs = kqtj.kk + kqtj.cd + kqtj.zt + Number($(".qj").text());
  434. if (yczs > 0) {
  435. $("#rjkcb_qq").removeClass("content-onButton").addClass("content-offButton");
  436. } else {
  437. $("#rjkcb_qq").removeClass("content-offButton").addClass("content-onButton");
  438. }
  439. }
  440. function ajaxqhzt(_obj, kqjlid, kqlbm, xyid, xyxm) { // 增加 xyxm,RjkcbHomepServ.swStateByA() 不用再取。Lin --%>
  441. /* 改。Lin
  442. var qhztUrl = '@service{name:"homePluginRjkcb_dm_qhzt"}@';
  443. */ var qhztUrl = "<serv.ss name='rjkcbHomep_swState'/>";
  444. $.ajax({
  445. url: qhztUrl,
  446. type: "POST",
  447. data: {
  448. kcbid: kcbid,
  449. kqjlid: kqjlid,
  450. kqlbm: kqlbm,
  451. ryid: xyid,
  452. xyxm: xyxm, // 增加,RjkcbHomepServ.swStateByA() 不用再取。Lin --%>
  453. aa: 1,
  454. lskcbid: lskcbid,
  455. bdm: bdm
  456. },
  457. dataType: "json",
  458. async: true,
  459. success: function(result) {
  460. console.log("==aaa===:" + result.msg);
  461. if (result.msg) {
  462. onOrOffQq(result.kqjl);
  463. if (result.kqjlid) {
  464. $(_obj).attr("kqjlid", result.kqjlid);
  465. }
  466. if (result.del) {
  467. $(_obj).attr("kqjlid", "");
  468. }
  469. $(".search-div").find(".cd").text(result.kqjl.cd);
  470. $(".search-div").find(".zt").text(result.kqjl.zt);
  471. $(".search-div").find(".kk").text(result.kqjl.kk);
  472. //
  473. var rs = $('#pmtDataSize').val();
  474. var qj = $('.qj').text();
  475. var zc = rs - result.kqjl.cd - result.kqjl.zt - result.kqjl.kk - qj;
  476. $(".search-div").find(".zc").text(zc);
  477. //
  478. qhzt(_obj, kqlbm);
  479. $("#rjkcbDiv").remove();
  480. }
  481. if (window.parent.isExist) {
  482. window.parent.isExist(kcbid, false);
  483. }
  484. }
  485. });
  486. }
  487. //pmt切换状态
  488. function pmt_qhzt(cell) {
  489. var dom = cell._dom;
  490. var rcid = $(dom).children(".bottomDiv").attr("rcid");
  491. if (rcid != 0) {
  492. return;
  493. }
  494. if (cell.data) {
  495. var objectState = parseInt(cell.objectState);
  496. console.log(typeof objectState);
  497. //正常-缺勤-迟到-早退
  498. switch (objectState) {
  499. case 81:
  500. cell.objectState = 1 //正常->缺勤
  501. break;
  502. case 1:
  503. cell.objectState = 11 //缺勤->迟到
  504. break;
  505. case 11:
  506. cell.objectState = 21 //迟到->早退
  507. break;
  508. case 21:
  509. cell.objectState = 81 //早退->正常
  510. break;
  511. }
  512. var qhztUrl = document.querySelector("#changestateUrl").value;
  513. $.ajax({
  514. url: qhztUrl,
  515. type: "POST",
  516. data: {
  517. kqjlid: cell.data.kqjlid,
  518. kqlbm: cell.objectState,
  519. ryid: cell.data.ryid,
  520. kcbid: kcbid,
  521. bb: 2,
  522. bdm: bdm
  523. },
  524. dataType: "json",
  525. async: true,
  526. success: function(result) {
  527. console.log("??????===" + result.msg);
  528. if (result.msg) {
  529. onOrOffQq(result.kqjl);
  530. if (result.kqjlid) {
  531. cell.data.kqjlid = result.kqjlid;
  532. }
  533. if (result.del) {
  534. cell.data.kqjlid = "";
  535. }
  536. wd.form.pmt.refresh();
  537. $(".cd").text(result.kqjl.cd);
  538. $(".zt").text(result.kqjl.zt);
  539. $(".kk").text(result.kqjl.kk);
  540. var rs = $('#pmtDataSize').val();
  541. var qj = $(".qj").text();
  542. var zc = rs - result.kqjl.cd - result.kqjl.zt - result.kqjl.kk - qj;
  543. $(".zc").text(zc);
  544. console.log(result.kqjl)
  545. $("#rjkcbDiv").remove();
  546. }
  547. if (window.parent.isExist) {
  548. window.parent.isExist(kcbid, false);
  549. }
  550. }
  551. });
  552. }
  553. }
  554. //获取切换的类别
  555. function getQhKqlbm(_obj) {
  556. var kqlbm = parseInt($(_obj).attr("kqlbm"));
  557. //正常-缺勤-迟到-早退
  558. switch (kqlbm) {
  559. case 81:
  560. return 1 //正常->缺勤
  561. case 11:
  562. return 21 //迟到->早退
  563. case 21:
  564. return 81 //早退->正常
  565. case 1:
  566. return 11 //缺勤->迟到
  567. }
  568. }
  569. function qhzt(_obj, kqlbm) {
  570. $(_obj).removeClass();
  571. switch (parseInt(kqlbm)) {
  572. case 81:
  573. $(_obj).addClass("checkin wd");
  574. $(_obj).find('.itemZt').text('出勤');
  575. break;
  576. case 11:
  577. $(_obj).addClass("toolate wd"); //迟到
  578. $(_obj).find('.itemZt').text('迟到');
  579. break;
  580. case 21:
  581. $(_obj).addClass("tooearly wd"); //早退
  582. $(_obj).find('.itemZt').text('早退');
  583. break;
  584. case 1:
  585. $(_obj).addClass("crunk wd"); // 旷课
  586. $(_obj).find('.itemZt').text('旷课');
  587. break;
  588. }
  589. $(_obj).attr("kqlbm", kqlbm);
  590. }
  591. </script>
  592. </equal.ss>
  593. <script>
  594. function wdAlert(msg) {
  595. var json = {};
  596. json["msg"] = encodeURI(msg);
  597. var url = '@service{dest:"sys_alert",show:"wdDialog",param: {"msg":"wdVal{msg}"}}@';
  598. evalUrl(url, json);
  599. }
  600. function wdInfo(msg) {
  601. var json = {};
  602. json["msg"] = encodeURI(msg);
  603. var url = '@service{dest:"sys_info",show:"wdDialog",param: {"msg":"wdVal{msg}"}}@';
  604. evalUrl(url, json);
  605. }
  606. function evalUrl(url, json) {
  607. url = wd.display.replaceDynamicParam(url, json);
  608. eval(url, json);
  609. }
  610. function notNull(str) {
  611. if (str != null && str != undefined && str != "") {
  612. return true;
  613. }
  614. return false;
  615. }
  616. // 没平面图的切换
  617. function xy_dm_lr(_obj) {
  618. if (xy_homePluginRjkcb_dm_qhzt) {
  619. var jlztm = $(_obj).attr("jlztm");
  620. xy_homePluginRjkcb_dm_qhzt(_obj);
  621. }
  622. }
  623. //有平面图的切换
  624. wd.form.pmt.cellClass = {
  625. objectState: {
  626. "81": "checkin iconList-boxDiv", //正常
  627. "11": "toolate iconList-boxDiv",
  628. "21": "tooearly iconList-boxDiv",
  629. "1": "crunk iconList-boxDiv"
  630. }
  631. }
  632. wd.form.pmt.leftClick = function(cell) {
  633. if (pmt_qhzt) {
  634. var jlztm = cell.data.jlztm;
  635. pmt_qhzt(cell);
  636. }
  637. }
  638. wd.form.pmt.loadFinish = function() {
  639. console.log("这是点名的log!!!!!!!!!!!!!!!!");
  640. var $div = $("#pmtEdit").find("div");
  641. $div.addClass('iconList-boxDiv');
  642. var $data = $("input[name='pmtdata']").val();
  643. var json = JSON.parse($data);
  644. var qj = 0;
  645. for (var i = 0; i < json.length; i++) {
  646. if (json[i].rcid != 0) {
  647. qj++
  648. };
  649. var image = json[i].image;
  650. var hl = json[i].lineNum + '_' + json[i].columnNum;
  651. if (!image) {
  652. image = '${sessionScope.ssUser.skinDir}image/default-photo.png'; // = '$@{sessionScope["wd.yh"].pflj}。Lin
  653. } else {
  654. image = "/service?wdService=getData&path=" + encodeURIComponent(image);
  655. }
  656. console.log(image);
  657. var width = $("[hl='" + hl + "']").width();
  658. if (json[i].rcid == 0) {
  659. $("[hl='" + hl + "']").empty().append(
  660. '<img style="max-height:calc(100% - 26px);height:auto;width:auto;max-width:calc(100% - 2px);display:block;margin:0 auto;margin-top:5px;" src="' +
  661. image + '" width="' + width +
  662. '"><div class="bottomDiv" rcid="' + json[i].rcid +
  663. '"><span class="className" style="display:inline-block;text-align:center;line-height:15px;width:100%;">' +
  664. json[i].text +
  665. '</span><div class="warningProgress-div"><div class="warningProgress-done"></div></div></div>');
  666. } else {
  667. $("[hl='" + hl + "']").empty().append(
  668. '<img style="max-height:calc(100% - 26px);height:auto;width:auto;max-width:calc(100% - 2px);display:block;margin:0 auto;margin-top:5px;" src="' +
  669. image + '" width="' + width +
  670. '"><div class="bottomDiv" rcid="' + json[i].rcid +
  671. '"><span class="className" style="display:inline-block;text-align:center;line-height:15px;width:100%;">' +
  672. json[i].text +
  673. '</span><div class="warningProgress-div" style="background:rgb(108,158,215)"></div></div>');
  674. }
  675. }
  676. $('.qj').text(qj);
  677. }
  678. //wd.form.pmt.loadFinish();
  679. initShake();
  680. // 抖动
  681. function initShake() {
  682. var rector = 16
  683. ///////DONE EDITTING///////////
  684. var stopit = 0
  685. var a = 1
  686. function init(which) {
  687. stopit = 0;
  688. shake = which;
  689. shake.style.left = 0;
  690. shake.style.top = 0;
  691. shake.style.position = "relative";
  692. // alert("init")
  693. }
  694. function rattleimage() {
  695. // alert("rattleimage")
  696. if ((!document.all && !document.getElementById) || stopit == 1)
  697. return
  698. if (a == 1) {
  699. shake.style.left = parseInt(shake.style.left) + rector
  700. } else if (a == 2) {
  701. shake.style.left = 0
  702. } else if (a == 3) {
  703. shake.style.left = parseInt(shake.style.left) - rector
  704. } else if (a == 4) {
  705. shake.style.left = 0
  706. } else if (a == 5) {
  707. shake.style.left = parseInt(shake.style.left) + rector / 2
  708. } else if (a == 6) {
  709. shake.style.left = 0
  710. } else if (a == 7) {
  711. shake.style.left = parseInt(shake.style.left) - rector / 2
  712. } else if (a == 8) {
  713. shake.style.left = 0
  714. }
  715. console.log(a, parseInt(shake.style.left))
  716. if (a < 8) {
  717. a++
  718. } else {
  719. a = 1
  720. }
  721. setTimeout(rattleimage, 65)
  722. }
  723. function stoprattle(which) {
  724. a = 1
  725. stopit = 1
  726. which.style.left = 0
  727. which.style.top = 0
  728. }
  729. $(document).on('click', ".leave", function() {
  730. init(this);
  731. rattleimage();
  732. setTimeout(() => {
  733. stoprattle(this)
  734. }, 500)
  735. })
  736. }
  737. function aa(a) {
  738. $(window.parent.document.body).find('iframe').eq(0).attr('src', a)
  739. }
  740. </script>
  741. </html>