charge_team_schedule.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. // $(document).ready(function() {
  2. // initChargeTeamSchedule()
  3. // })
  4. function initChargeTeamSchedule(){
  5. $("#main_content_title").html("收费人员排班")
  6. var user = $.zui.store.get("user") ; // 缓存用户信息,取出dept_id
  7. // 用户的dept_id
  8. var user_dept_id = user.organid ;
  9. // 收费小组type
  10. var team_type = 1 ;
  11. // 日期游标
  12. var date_cursor = 0 ;
  13. $('#calendar').calendar();
  14. var calendar = $('#calendar').data('zui.calendar');
  15. calendarInit();
  16. // 请求收费人员排班数据
  17. function calendarInit(data_param){
  18. var datap = {
  19. "dept_id": user_dept_id ,
  20. "start_time":getMonthByCondition(date_cursor,'first').Format("yyyy-MM-dd HH:mm:ss"),//getCurrentMonthFirst(),
  21. "end_time":getMonthByCondition(date_cursor,'last').Format("yyyy-MM-dd HH:mm:ss"),//getCurrentMonthLast(),
  22. 'type':team_type
  23. }
  24. if(data_param != undefined){
  25. datap = data_param ;
  26. }
  27. getTeamClass(datap,function(data){
  28. var newEvents = [];
  29. // console.log(data);
  30. for(var i=0;i<data.length;i++){
  31. var obj = {id:data[i].id ,desc:data[i].team_name ,title: data[i].team_name+"-"+getTeamName(data[i].class_type), start: data[i].end_time, end: data[i].end_time};//都以开始时间的日期为准
  32. newEvents.push(obj);
  33. }
  34. // 这里轮训给每天都增加一个事件
  35. var date = getMonthByCondition(date_cursor,'first');//new Date();
  36. var end_date = getMonthByCondition(date_cursor,'last');//new Date(getCurrentMonthLast2()) ;
  37. if(data_param != undefined){
  38. date = new Date(data_param.start_time);
  39. end_date = new Date(data_param.end_time) ;
  40. }
  41. for(var i =0;i<31;i++){
  42. if( date.setDate(i+1) < end_date ){
  43. var obj = {id:-1 ,desc:'详细排班' ,title: '+详细排班', start:date.Format('yyyy-MM-dd'), end: date.Format('yyyy-MM-dd'),color:'#bd7b46'};
  44. newEvents.push(obj);
  45. }
  46. }
  47. calendar.addEvents(newEvents);
  48. })
  49. }
  50. // 获取排班信息
  51. function getTeamClass(data,_function){
  52. post_common_service( "teamClass/getClassList",data,function(data){
  53. _function(data);
  54. },function(error){
  55. return "" ;
  56. })
  57. }
  58. getStation();
  59. var lans = 0;
  60. var entrance_number = 0;
  61. var exit_number = 0;
  62. // 获取收费站信息
  63. function getStation(){
  64. get_common_service( "dept/getFsByDept","",function(data){
  65. if(data != null){
  66. $(".thread_charge").append("<th>"+data.name+"</th>");
  67. $(".thread_charge").append("<th>值班室</th>");
  68. // console.log(data);
  69. lans = data.lanes_number;
  70. entrance_number = data.entrance_numer ;
  71. exit_number = data.exit_numer ;
  72. // for(var i=0;i<data.lanes_number;i++){
  73. // $(".thread_charge").append("<th>进口车道"+(i+1)+"</th>");
  74. // }
  75. for(var i=0;i<entrance_number;i++){
  76. $(".thread_charge").append("<th>入口"+(i+1)+"</th>");
  77. }
  78. for(var i=0;i<exit_number;i++){
  79. $(".thread_charge").append("<th>出口"+(i+1)+"</th>");
  80. }
  81. }
  82. },function(error){
  83. return "" ;
  84. })
  85. }
  86. getClassCode();
  87. var classCode = {};
  88. /**
  89. * 获取班组信息
  90. */
  91. function getClassCode(){
  92. var data = {} ;
  93. post_common_service( "teamClass/getClassCode",data,function(data){
  94. for(var i=0;i<data.length;i++){
  95. classCode[data[i].code] = data[i];
  96. }
  97. // console.log(classCode);
  98. $(".class_type_1").html(classCode[1].class_name);
  99. $(".class_type_2").html(classCode[2].class_name);
  100. $(".class_type_3").html(classCode[3].class_name);
  101. },function(error){
  102. return "" ;
  103. })
  104. }
  105. // 更新日历数据
  106. function updateCalendar(data){
  107. calendar.events = [];
  108. calendar.display();
  109. calendarInit(data);
  110. }
  111. // 当月第一天
  112. function getCurrentMonthFirst(){
  113. var date=new Date();
  114. date.setDate(1);
  115. date.setHours(0);
  116. date.setMinutes(0);
  117. date.setSeconds(0);
  118. return date.Format("yyyy-MM-dd HH:mm:ss");
  119. }
  120. // 当月最后一天
  121. function getCurrentMonthLast(){
  122. var date=new Date();
  123. var currentMonth=date.getMonth();
  124. var nextMonth=++currentMonth;
  125. var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
  126. var oneDay=1000*60*60*24;
  127. var date1 = new Date(nextMonthFirstDay-oneDay);
  128. date1.setHours(23);
  129. date1.setMinutes(59);
  130. date1.setSeconds(59);
  131. return date1.Format("yyyy-MM-dd HH:mm:ss");
  132. }
  133. // 当月最后一天
  134. function getCurrentMonthLast2(){
  135. var date=new Date();
  136. var currentMonth=date.getMonth();
  137. var nextMonth=++currentMonth;
  138. var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
  139. var oneDay=0;//1000*60*60*24;
  140. var date1 = new Date(nextMonthFirstDay-oneDay);
  141. date1.setHours(0);
  142. date1.setMinutes(0);
  143. date1.setSeconds(0);
  144. return date1.Format("yyyy-MM-dd HH:mm:ss");
  145. }
  146. // 上一个月或者下个月的第一天或者最后一天
  147. function getMonthByCondition(pre_or_after,first_or_last){
  148. if(first_or_last == 'first'){
  149. var date=new Date();
  150. date.setDate(1);
  151. date.setHours(0);
  152. date.setMinutes(0);
  153. date.setSeconds(0);
  154. date.setMonth(date.getMonth()+pre_or_after);
  155. return date;
  156. }else if(first_or_last == 'last'){
  157. var date = new Date();
  158. date.setMonth(date.getMonth()+pre_or_after);//此处月份加减,不能放到最后加减,会引起月份天数不对
  159. var currentMonth=date.getMonth();
  160. var nextMonth=++currentMonth;
  161. var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
  162. var date1 = nextMonthFirstDay;
  163. date1.setDate(date1.getDate()-1);
  164. date1.setHours(23);
  165. date1.setMinutes(59);
  166. date1.setSeconds(59);
  167. return date1 ;
  168. }
  169. }
  170. $("#save_user_class").click(function(){
  171. var dutyList = [];
  172. var work_date = $("#save_user_class").data("work_date")+"00:00:00";
  173. for(var j=1;j<4;j++){
  174. var cache = $(".tr-"+j).data("cache");
  175. if(cache) {
  176. for(var i=0;i<lans+1;i++){
  177. if($(".tr-"+j+" td select").eq(i).val()!='' ){
  178. var start_time = $("#save_user_class").data("work_date")+ classCode[j].start_time+":00" ;
  179. if(j==3) {
  180. var date = new Date($("#save_user_class").data("work_date").replace(/-/,"/"));
  181. date.setDate(date.getDate()-1);
  182. start_time = date.Format("yyyy-MM-dd")+" "+classCode[j].start_time+":00";
  183. }
  184. var end_time = $("#save_user_class").data("work_date")+classCode[j].end_time+":00";
  185. // 这边需要
  186. // console.log($(".tr-"+j+" td select").eq(i).data("data"));
  187. var list = $(".tr-"+j+" td select").eq(i).data("data");
  188. var obj = {"list":list , "work_date":work_date,"dept_id":cache.dept_id,"user_id": $(".tr-"+j+" td select").eq(i).val() , "class_type":j,"team_id":cache.team_id,"start_time":start_time, "end_time":end_time,"lane":$(".tr-"+j+" td select").eq(i).parent().attr('tag') };
  189. dutyList.push(obj);
  190. }
  191. }
  192. }
  193. }
  194. $("#save_user_class").attr("disabled","disabled");
  195. if($("#save_user_class").data("modify_flag")){
  196. $("#save_user_class").data("modify_flag",false);
  197. post_common_service( "userClass/updateList",dutyList,function(data){
  198. tip("修改成功");
  199. $('#add_fee_station').modal('hide');
  200. $("#save_user_class").attr("disabled",false );
  201. },function(error){
  202. return "" ;
  203. })
  204. return ;
  205. }
  206. post_common_service( "userClass/addList",dutyList,function(data){
  207. tip("添加成功");
  208. $('#add_fee_station').modal('hide');
  209. $("#save_user_class").attr("disabled",false );
  210. },function(error){
  211. return "" ;
  212. })
  213. })
  214. var cols = [{width: 60,text: '序号',type: 'number',flex: false,colClass: 'text-center'},
  215. { width: 130,text: '开始时间',type: 'string',flex: false,colClass: 'text-center'},
  216. { width: 130, text: '结束时间',type: 'string',flex: false,sort: 'down',colClass: 'text-center'},
  217. {width: 130,text: '人员姓名',type: 'string',flex: false,colClass: 'text-center'},
  218. {width: 230, text: '操作',type: 'string',flex: false,colClass: 'text-center'}
  219. ];
  220. $('.datatable').datatable({
  221. checkable: false,
  222. sortable: false,
  223. data: {
  224. cols: cols,
  225. rows: []
  226. }
  227. });
  228. var temp_data ;
  229. // 更新表格数据
  230. function updateTableData(obj){
  231. var rowdata =[];
  232. if (obj != null && obj.length > 0) {
  233. for(var i=0;i<obj.length;i++){
  234. var userdata = {};
  235. userdata["checked"] = false;
  236. userdata["data"] = [i + 1, obj[i].start_time, obj[i].end_time, obj[i].user_name, ' <button class="btn btn-primary btn_remove" value=' + i + ' ><i class="icon icon-remove-circle"></i>删除</button>'];
  237. rowdata.push(userdata);
  238. }
  239. }
  240. $('.datatable').datatable('load', {
  241. cols: cols,
  242. rows: rowdata
  243. });
  244. }
  245. $(".datatable").delegate(".btn_remove","click",function(){
  246. var bind_data = temp_data;
  247. // alert($(this).val())
  248. if($(this).val()!=null && $(this).val()!=''){
  249. bind_data.splice( $(this).val() ,1)
  250. // $(".add-btn").data("data",bind_data);
  251. temp_data = bind_data;
  252. updateTableData(temp_data);
  253. }
  254. })
  255. var time_interval_obj = "";
  256. $(".table").delegate(".i-self","click",function(){
  257. $("#team_info_ti").html($(this).prev().html());
  258. $(".save_class_info").data("data",$(this).prev());
  259. // 将时间区间值的span 对象缓存起来
  260. time_interval_obj = $(this).parent().prev().children();
  261. temp_data = $(this).prev().data("data") ;
  262. $("#lists").show();
  263. $("#add_update").hide();
  264. updateTableData(temp_data);
  265. showPopup4CommonBtns("添加顶班详情","720px","#add_detail_info","",function(){
  266. },function(){})
  267. })
  268. // 增加按钮
  269. $(".add-btn").click(function(){
  270. $("#team_info_ti").val("");
  271. $("#lists").hide();
  272. $("#add_update").show();
  273. })
  274. // 保存班组信息
  275. $(".save_class_info").click(function(){
  276. $(".save_class_info").data("data").data("data", temp_data);
  277. layer.closeAll();
  278. })
  279. $(".return-btn").click(function(){
  280. $("#lists").show();
  281. $("#add_update").hide();
  282. })
  283. // 保存
  284. $("#save_btn").click(function(){
  285. var bind_data = temp_data;
  286. if(bind_data == null){
  287. bind_data = [] ;
  288. }
  289. var id = $("#team_info_ti").val();
  290. var start_time = $("#start_time").val();
  291. var end_time = $("#end_time").val() ;
  292. var name = $("#team_info_ti").find("option:selected").text();
  293. if(start_time >= end_time){
  294. tip("时间设置不合理,开始时间不能大于结束时间");
  295. return ;
  296. }
  297. // 判断时间区间
  298. var start_time_interval = $(".modal-title span").html()+" "+ time_interval_obj.eq(1).html();
  299. var end_time_interval = $(".modal-title span").html()+" "+ time_interval_obj.eq(2).html();
  300. if(start_time_interval > end_time_interval){
  301. var prev_date = new Date((start_time_interval+':00').replace(/-/,"/"));
  302. prev_date.setDate(prev_date.getDate()-1) ;
  303. start_time_interval = prev_date.Format("yyyy-MM-dd HH:mm:00") ;
  304. }
  305. if(!(start_time >= start_time_interval && end_time <= end_time_interval)){
  306. tip("不是当前值班时间段");
  307. return ;
  308. }
  309. // 这边需要判断一下,时间不能重叠
  310. for(var i=0;i<bind_data.length;i++){
  311. if(!(start_time >= bind_data[i].end_time || end_time <= bind_data[i].start_time)){
  312. tip("设置的时间不能重叠");
  313. return ;
  314. }
  315. }
  316. if( id !="" && start_time !='' && end_time !=''){
  317. bind_data.push({"user_name":name , "start_time":start_time , "end_time": end_time,"id":id});
  318. temp_data = bind_data;
  319. $("#lists").show();
  320. $("#add_update").hide();
  321. updateTableData(temp_data);
  322. }else{
  323. tip("信息需填写完整");
  324. }
  325. })
  326. $('#calendar').calendar().on("clickEvent.zui.calendar", function(event) {
  327. // console.log(event。event.id);
  328. if(event.event.id == -1){
  329. // 这边负责添加整个页面的数据 按车道排班
  330. $('#add_fee_station').modal({'backdrop': 'static'});
  331. $(".modal-title").html("收费站排班表-<span>"+event.event.start.Format("yyyy-MM-dd")+"</span>");
  332. $("#save_user_class").data("work_date",event.event.start.Format("yyyy-MM-dd "));
  333. var data = {
  334. "dept_id": user_dept_id ,
  335. "start_time":event.event.start.Format("yyyy-MM-dd 00:00:00"),
  336. "end_time": event.event.start.Format("yyyy-MM-dd 00:00:00"),
  337. 'type':team_type
  338. }
  339. post_common_service( "teamClass/getClassListAndUsers",data,function(data){
  340. $("#save_user_class").html("生成今日值班");
  341. $(".tr-1,.tr-2,.tr-3").empty();
  342. for(var i=0;i<data.length;i++){
  343. var ct = data[i].class_type ;
  344. $(".tr-"+ct ).data("cache",data[i]);
  345. $(".tr-"+ct).append("<td><span>"+ classCode[ct].class_name +"</span> <span>"+classCode[ct].start_time+"</span> - <span>"+classCode[ct].end_time +"</span></td>");
  346. var selectv = "<select class='form-control select-self'>"
  347. selectv += ("<option value=''>请选择</option>");
  348. for(var j=0;j<data[i].users.length;j++){
  349. var obj = data[i].users[j];
  350. selectv += ("<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename +"</option>");
  351. }
  352. selectv += "</select> <i title='顶班详情' alt='顶班详情' class='icon icon-tags i-self'></i>";
  353. $(".tr-"+ct).append("<td class='c-"+ct+"-0' tag='0'>"+ selectv +"</td>")
  354. for(var z=0;z<entrance_number;z++){
  355. $(".tr-"+ct).append("<td class='c-"+ct+"-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv +"</td>")
  356. }
  357. for(var z=0;z<exit_number;z++){
  358. $(".tr-"+ct).append("<td class='c-"+ct+"--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv +"</td>")
  359. }
  360. }
  361. if(data.length ==0){
  362. $(".tr-1").append("<td>"+ classCode["1"].class_name +" "+classCode["1"].start_time+" - "+classCode["1"].end_time +"</td>");
  363. $(".tr-2").append("<td>"+ classCode[2].class_name +" "+classCode[2].start_time+" - "+classCode[2].end_time +"</td>");
  364. $(".tr-3").append("<td>"+ classCode[3].class_name +" "+classCode[3].start_time+" - "+classCode[3].end_time +"</td>");
  365. for(var i=0;i<lans+1;i++){
  366. $(".tr-1,.tr-2,.tr-3").append("<td></td>");
  367. }
  368. }else{
  369. var cache = $(".tr-1").data("cache");
  370. var work_date = $("#save_user_class").data("work_date")+"00:00:00";
  371. var param = {
  372. 'dept_id':user_dept_id,
  373. 'work_date':work_date
  374. }
  375. post_common_service( "userClass/getList",param,function(data){
  376. // 这边将值班数据检索出来,初始化收费站车道排班中
  377. // console.log(data);
  378. if(data.length > 0){
  379. $("#save_user_class").data("modify_flag",true);
  380. $("#save_user_class").html("修改今日值班");
  381. }else{
  382. $("#save_user_class").html("生成今日值班");
  383. $("#save_user_class").data("modify_flag",false);
  384. }
  385. for(var i=0;i<data.length;i++){
  386. console.log(data[i].list)
  387. if(data[i].list != null)
  388. $(".c-"+data[i].class_type+"-"+data[i].lane+" select").data("data",data[i].list);
  389. $(".c-"+data[i].class_type+"-"+data[i].lane+" select").val(data[i].user_id);
  390. // $(".table .tr-"+data[i].class_type+" select").eq(i%(lans+1)).val(data[i].user_id);
  391. }
  392. },function(error){
  393. return "" ;
  394. })
  395. }
  396. },function(error){
  397. return "" ;
  398. })
  399. }else{
  400. click_function(event.event.start);
  401. }
  402. });
  403. /**
  404. * 点击日历触发函数
  405. */
  406. function click_function(date){
  407. setAddTermTitle(date.Format("yyyy-MM-dd"));
  408. // 保存当前日期
  409. $("#save_term_class").data("date",date.Format("yyyy-MM-dd"));
  410. var data = {
  411. "dept_id": user_dept_id ,
  412. "start_time":date.Format("yyyy-MM-dd 00:00:00"),
  413. "end_time": date.Format("yyyy-MM-dd 00:00:00"),
  414. 'type':team_type
  415. }
  416. getTeamClass(data,function(data){
  417. for(var i=0;i<$("select[id*='_term']").length;i++){
  418. $("select[id*='_term']").eq(i).val("");
  419. }
  420. if(data.length > 0){
  421. $("#save_term_class").data("modify_flag",1);
  422. for(var i=0;i<data.length;i++){
  423. $(".class_team_"+data[i].class_type).val(data[i].team_id);
  424. }
  425. }else{
  426. $("#save_term_class").data("modify_flag",0);
  427. }
  428. $('#myModal').modal();
  429. })
  430. }
  431. $('#calendar').calendar().on("clickCell.zui.calendar", function(event) {
  432. // console.log(event);
  433. click_function(event.date);
  434. });
  435. // 下一个日期
  436. $('#calendar').calendar().on("clickNextBtn.zui.calendar", function(event) {
  437. // console.log(event);
  438. date_cursor++ ;
  439. var data = {
  440. "dept_id": user_dept_id ,
  441. "start_time":getMonthByCondition(date_cursor,'first').Format("yyyy-MM-dd HH:mm:ss"),
  442. "end_time": getMonthByCondition(date_cursor,'last').Format("yyyy-MM-dd HH:mm:ss"),
  443. 'type':team_type
  444. }
  445. updateCalendar(data);
  446. });
  447. // 上一个日期
  448. $('#calendar').calendar().on("clickPrevBtn.zui.calendar", function(event) {
  449. date_cursor-- ;
  450. var data = {
  451. "dept_id": user_dept_id ,
  452. "start_time":getMonthByCondition(date_cursor,'first').Format("yyyy-MM-dd HH:mm:ss"),
  453. "end_time": getMonthByCondition(date_cursor,'last').Format("yyyy-MM-dd HH:mm:ss"),
  454. 'type':team_type
  455. }
  456. updateCalendar(data);
  457. });
  458. // 今天
  459. $('#calendar').calendar().on("clickTodayBtn.zui.calendar", function(event) {
  460. // console.log(event);
  461. date_cursor = 0 ;
  462. calendarInit();
  463. });
  464. $("#save_term_class").click(function(){
  465. var data = [];
  466. for(var i=0;i<$("select[id*='_term']").length;i++){
  467. if($("select[id*='_term']").eq(i).val()!=""){
  468. var start_time = $("#save_term_class").data("date")+" "+classCode[i+1].start_time+":00";
  469. if(i+1==3){
  470. var date = new Date($("#save_term_class").data("date").replace(/-/,"/"));
  471. date.setDate(date.getDate()-1);
  472. start_time = date.Format("yyyy-MM-dd")+" "+classCode[i+1].start_time+":00";
  473. }
  474. // 这边需要转换一下,关于值
  475. var team_type_value = 1;
  476. if(i+1 == 1){
  477. team_type_value = 3 ;
  478. }else if(i+1 == 2){
  479. team_type_value = 1 ;
  480. }else{
  481. team_type_value = 2 ;
  482. }
  483. var obj = {
  484. "class_type":team_type_value,
  485. "team_id":$("select[id*='_term']").eq(i).val(),
  486. "work_date": $("#save_term_class").data("date")+" 00:00:00",
  487. "start_time": start_time,
  488. "end_time": $("#save_term_class").data("date")+" "+classCode[i+1].end_time+":00",
  489. "dept_id":user_dept_id
  490. };
  491. // console.log(obj);
  492. data.push(obj);
  493. }
  494. }
  495. if(data.length == 0 ){
  496. tip("请增加排班!");
  497. return ;
  498. }
  499. if( $("#save_term_class").data("modify_flag") != 1){
  500. post_common_service("teamClass/add/list",data,function(data){
  501. updateCalendar();
  502. $('#myModal').modal('hide');
  503. },function(error){
  504. $('#myModal').modal('hide');
  505. })
  506. }else{
  507. post_common_service("teamClass/update/list",data,function(data){
  508. updateCalendar();
  509. $('#myModal').modal('hide');
  510. },function(error){
  511. $('#myModal').modal('hide');
  512. })
  513. }
  514. })
  515. $(".close_btn").click(function(){
  516. $('#myModal,#add_fee_station').modal('hide');
  517. })
  518. // 获取部门为1的班组信息
  519. getTermClass(user_dept_id);
  520. // 获取班组信息
  521. function getTermClass(dept_id){
  522. var data = {
  523. 'dept_id':dept_id ,
  524. 'type':team_type
  525. }
  526. post_common_service( "team/getTeamByDeptId/1/50",data,function(data){
  527. for(var i=0;i<data.list.length;i++){
  528. $("#mooring_term,#middle_term,#night_term,#all_term").append("<option value='"+data.list[i].id+"'>"+data.list[i].name +"</option>")
  529. }
  530. },function(error){})
  531. }
  532. }
  533. // 根据class_type 获取班次名称
  534. function getTeamName(class_type){
  535. if(class_type == 1){
  536. return "早班";
  537. }else if(class_type == 2){
  538. return "中班";
  539. }else if(class_type == 3){
  540. return "夜班";
  541. }else if(class_type == 4){
  542. return "全班";
  543. }
  544. }
  545. function setAddTermTitle(title){
  546. $(".modal-title").html("添加班组-"+title);
  547. }