update print
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
<% @booking.each do |booking| %>
|
||||
<% if booking.booking_status == "new" %>
|
||||
<div class="card">
|
||||
<div class="card-block booking_click" data-id="sfddf" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;" >
|
||||
<div class="card-block booking_click" data-id="sfddf" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" >
|
||||
<p class="hidden booking-id"><%= booking.id %></p>
|
||||
<h4 class="card-title">
|
||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||
- <%= booking.id %>
|
||||
@@ -36,50 +37,50 @@
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
|
||||
|
||||
$(".booking_click").on("click", function(){
|
||||
$(".booking_click").on("click", function(){
|
||||
$(".summary-items tbody tr").remove();
|
||||
$("#cancel").removeAttr("disabled");
|
||||
$("#assign").removeAttr("disabled");
|
||||
|
||||
|
||||
$("#crm_print").removeAttr("disabled");
|
||||
var booking_id = $(this).find(".booking-id").text();
|
||||
$("#crm_print").val(booking_id);
|
||||
$("#crm_print").removeAttr("disabled");
|
||||
|
||||
var url = $(this).attr('data-ref');
|
||||
show_details(url);
|
||||
});
|
||||
|
||||
$('.crm_print').click(function() {
|
||||
var id = $(this).val();
|
||||
alert(id)
|
||||
});
|
||||
|
||||
$('.crm_print').click(function() {
|
||||
var booking_id = $('#crm_print').val();
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "crm/print/"+id,
|
||||
url: "crm/print/"+booking_id,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.assign').click(function(e){
|
||||
$('.assign').click(function(e){
|
||||
var booking_id = $(this).val()
|
||||
var type = $(this).attr("data-type")
|
||||
|
||||
update_booking(booking_id,type)
|
||||
});
|
||||
});
|
||||
|
||||
$('.cancel').click(function(e){
|
||||
$('.cancel').click(function(e){
|
||||
var booking_id = $(this).val()
|
||||
var type = $(this).attr("data-type")
|
||||
|
||||
update_booking(booking_id,type)
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function show_details(url_item){
|
||||
$.ajax({
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<% if booking.booking_status == "assign" %>
|
||||
<div class="card booking_click" data-ref="<%= api_booking_path booking.id%>" id="booking_block">
|
||||
<div class="card-block" id="card-block" style="width:100%;">
|
||||
<p class="hidden booking-id"><%= booking.id %></p>
|
||||
<h4 class="card-title">
|
||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||
- <%= booking.id %>
|
||||
|
||||
@@ -102,10 +102,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user