VM暫存
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cario_temp_not_finished_query_all.php 8.8KB

пре 8 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <?php /* ----- 臨停未結清單 ----- */?>
  2. <div data-items="cario_temp_not_finished_query_all" class="row" style="display:none;">
  3. <div class="col-lg-12">
  4. <div class="panel panel-default">
  5. <div class="panel-heading">
  6. 臨停未結清單 (2017-02-01 00:00:00 進場 ~ 至 <span id='altob_current_time_str'></span>)
  7. </div>
  8. <!-- /.panel-heading -->
  9. <div class="panel-body">
  10. <div class="dataTable_wrapper">
  11. <table class="table table-striped table-bordered table-hover">
  12. <thead>
  13. <tr>
  14. <th style="text-align:left;">代號</th>
  15. <th style="text-align:left;">車牌號碼</th>
  16. <th style="text-align:center;">進場時間</th>
  17. <th style="text-align:center;">最後付款時間</th>
  18. <th style="text-align:center;">限時離場時間</th>
  19. <th style="text-align:center;">功能</th>
  20. </tr>
  21. </thead>
  22. <tbody id="cario_temp_not_finished_query_all" style="font-size:18px;"></tbody>
  23. </table>
  24. </div><?php /* ----- end of dataTable_wrapper ----- */?>
  25. </div><?php /* ----- end of panel-body ----- */?>
  26. </div><?php /* ----- end of panel panel-default ----- */?>
  27. </div><?php /* ----- end of col-lg-12 ----- */?>
  28. </div>
  29. <?php /* ----- 臨停未結清單(結束) ----- */?>
  30. <!-- ----- 臨停未結確認小框 ----- -->
  31. <div class="modal fade" id="cario_temp_check_dialog">
  32. <div class="modal-dialog modal-sm">
  33. <div class="modal-content">
  34. <div class="modal-header"><h3>臨停未結查核作業</h3></div>
  35. <div class="modal-body">
  36. <form id="cario_temp_check_form" class="center-block">
  37. <div class="main">
  38. <div class="dataTable_wrapper">
  39. <table class="table table-striped table-bordered table-hover" style="font-size:12px;">
  40. <tbody id="cario_temp_check_list">
  41. <tr>
  42. <td style="text-align:right;">進場車號</td>
  43. <td style="text-align:left;" id="cario_temp_check_lpr"></td>
  44. </tr>
  45. <tr>
  46. <td style="text-align:right;">進場時間</td>
  47. <td style="text-align:left;" id="cario_temp_check_in_time"></td>
  48. </tr>
  49. <tr>
  50. <td style="text-align:right;">限時離場時間</td>
  51. <td style="text-align:left;" id="cario_temp_check_out_before_time"></td>
  52. </tr>
  53. <tr>
  54. <td style="text-align:right;">最後付款時間</td>
  55. <td style="text-align:left;" id="cario_temp_check_pay_time"></td>
  56. </tr>
  57. <tr>
  58. <td style="text-align:right;vertical-align:middle">臨停未結說明</td>
  59. <td style="text-align:left;"><input type="text" id="cario_temp_check_remarks" class="form-control" style="width:150px !important;" /></td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. <button type="button" class="btn btn-large btn-success pull-left" onclick="do_cario_temp_check_ok();">確認完成</button>
  64. &nbsp;&nbsp;
  65. <button type="button" class="btn btn-large btn-cancel" onclick="$('#cario_temp_check_dialog').modal('hide');">取消</button>
  66. </div><!-- ----- end of dataTable_wrapper ----- -->
  67. </div><!-- ----- end of main ----- -->
  68. </form>
  69. </div><!-- end of modal-body -->
  70. </div><!-- end of modal-content -->
  71. </div><!-- end of modal-dialog -->
  72. </div><!-- end of modal show -->
  73. <!-- ----- 臨停未結確認小框 (結束) ----- -->
  74. <script>
  75. // 載入
  76. function reload_cario_temp_not_finished_query_all()
  77. {
  78. $("#altob_current_time_str").text(moment(new Date()).format("YYYY-MM-DD HH:mm:ss"));
  79. $("#cario_temp_not_finished_query_all").html(""); // -- 清除原內容 --
  80. $.ajax
  81. ({
  82. url: "<?=APP_URL?>cario_temp_not_finished_query_all",
  83. type: "post",
  84. dataType:"json",
  85. data:{"station_no":$("#station_select").val(), "q_item":'in_time', "q_str":'2017-02-01'},
  86. success:function(jdata)
  87. {
  88. var cario_temp_list = ["<tr>"];
  89. for(idx in jdata)
  90. {
  91. cario_no = jdata[idx]['cario_no'];
  92. cario_temp_list = cario_temp_list.concat(["<td style='text-align:left;'>", cario_no, "</td>"]);
  93. cario_temp_list = cario_temp_list.concat(["<td id='cario_temp_not_finished_query_all_lpr_", cario_no,
  94. "' data-station_no='", jdata[idx]['station_no'],
  95. "' data-cario_no='", jdata[idx]['cario_no'],
  96. "' data-lpr='", jdata[idx]['lpr'],
  97. "' data-in_time='", jdata[idx]['in_time'],
  98. "' data-out_before_time='", jdata[idx]['out_before_time'],
  99. "' data-pay_time='", jdata[idx]['pay_time'],
  100. "' style='text-align:left;'>", jdata[idx]['lpr'], "</td>"]);
  101. cario_temp_list = cario_temp_list.concat(["<td style='text-align:center;'>", jdata[idx]['in_time'], "</td>"]);
  102. cario_temp_list = cario_temp_list.concat(["<td style='text-align:center;'>", jdata[idx]['pay_time'], "</td>"]);
  103. cario_temp_list = cario_temp_list.concat(["<td style='text-align:center;'>", jdata[idx]['out_before_time'], "</td>"]);
  104. cario_temp_list = cario_temp_list.concat(["<td style='color:red;text-align:center;'><button class='btn btn-default' style='color:red;' onclick='cario_temp_check(", cario_no + ");'>人工審核</button></td>"]);
  105. cario_temp_list = cario_temp_list.concat(["</tr>"]);
  106. }
  107. $("#cario_temp_not_finished_query_all").append(cario_temp_list.join(''));
  108. }
  109. });
  110. }
  111. // 臨停未結確認
  112. function cario_temp_check(cario_no)
  113. {
  114. var station_no = $("#cario_temp_not_finished_query_all_lpr_"+cario_no).data("station_no");
  115. var lpr = $("#cario_temp_not_finished_query_all_lpr_"+cario_no).data("lpr");
  116. var in_time = $("#cario_temp_not_finished_query_all_lpr_"+cario_no).data("in_time");
  117. var pay_time = $("#cario_temp_not_finished_query_all_lpr_"+cario_no).data("pay_time");
  118. var out_before_time = $("#cario_temp_not_finished_query_all_lpr_"+cario_no).data("out_before_time");
  119. // 發票資訊
  120. xvars["cario_temp_check"] = Array();
  121. xvars["cario_temp_check"]["cario_no"] = cario_no;
  122. xvars["cario_temp_check"]["station_no"] = station_no;
  123. xvars["cario_temp_check"]["in_time"] = in_time;
  124. xvars["cario_temp_check"]["pay_time"] = (pay_time == "") ? '未付款': pay_time;
  125. xvars["cario_temp_check"]["out_before_time"] = out_before_time;
  126. $("#cario_temp_check_lpr").text("").text(lpr);
  127. $("#cario_temp_check_in_time").text("").text(in_time);
  128. $("#cario_temp_check_pay_time").text("").text(pay_time);
  129. $("#cario_temp_check_out_before_time").text("").text(out_before_time);
  130. $("#cario_temp_check_remarks").text("");
  131. $("#cario_temp_check_dialog").modal({backdrop:false,keyboard:false});
  132. }
  133. // 臨停未結確認完成
  134. function do_cario_temp_check_ok()
  135. {
  136. if (!confirm("確認審核通過 ?")) return false;
  137. var station_no = xvars["cario_temp_check"]["station_no"];
  138. var cario_no = xvars["cario_temp_check"]["cario_no"];
  139. var cario_temp_check_remarks = $("#cario_temp_check_remarks").val();
  140. if (cario_temp_check_remarks == "")
  141. {
  142. alertify_msg("請說明原因,謝謝");
  143. return false;
  144. }
  145. //alertify_msg("施工中..zzz");
  146. //return false;
  147. // 新增審核資訊
  148. $.ajax
  149. ({
  150. url:APP_URL+"cario_temp_confirmed",
  151. dataType:"text",
  152. type:"post",
  153. data:
  154. {
  155. "station_no": station_no,
  156. "cario_no": cario_no,
  157. "remarks": cario_temp_check_remarks
  158. },
  159. error:function(xhr, ajaxOptions, thrownError)
  160. {
  161. var error_msg = xhr.responseText ? xhr.responseText : "連線失敗, 請稍候再試";
  162. alertify_msg(error_msg);
  163. console.log("error:"+error_msg+"|"+ajaxOptions+"|"+thrownError);
  164. },
  165. success:function(jdata)
  166. {
  167. if (jdata == "ok")
  168. {
  169. alertify_msg("確認完成!");
  170. reload_cario_temp_not_finished_query_all();
  171. }
  172. else if(jdata == "not_synced")
  173. {
  174. alertify_sync(station_no);
  175. }
  176. else if (jdata == "check_fail")
  177. {
  178. alertify_msg("操作失敗,已取消");
  179. }
  180. else
  181. {
  182. alertify_msg("操作失敗 !");
  183. }
  184. }
  185. });
  186. delete xvars["cario_temp_check"];
  187. $('#cario_temp_check_dialog').modal('hide');
  188. }
  189. </script>