update crm customer and bind customer and queue

This commit is contained in:
Aung Myo
2017-06-23 17:03:52 +06:30
parent 4b9291110d
commit f5f0f9e077
22 changed files with 480 additions and 302 deletions

View File

@@ -37,9 +37,10 @@
<th>Select</th>
<th>Sr.no</th>
<th>Name</th>
<th>Company</th>
<th>Card No</th>
<th>Contact no</th>
<th>Email</th>
<th>Action</th>
</tr>
</thead>
@@ -52,7 +53,7 @@
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td><%= @i += 1 %></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.card_no rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td><%= link_to 'Show', crm_customer_path(crm_customer) %></td>
@@ -126,7 +127,7 @@ $(document).on('click',".customer_tr",function(){
$('#customer_address').val(data.address);
$('#customer_date_of_birth').val(data.date_of_birth);
$('#customer_membership_type').val(data.membership_type);
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
if (data.gender == 'Male') {
$('.male').prop( "checked", true )
}else{
@@ -142,7 +143,7 @@ $(document).on('click',".customer_tr",function(){
}else{
$('.mdm').prop( "checked", true )
}
// $('.selectpicker > option[value="'+data.membership_id+'"]').attr('selected','selected');
$('.membership_authentication_code').val(data.membership_authentication_code);
$('#update_customer').removeAttr('disabled').val('');
@@ -150,11 +151,14 @@ $(document).on('click',".customer_tr",function(){
$('#submit_customer').attr('disabled','disabled');
$("#new_customer").attr('class', 'simple_form edit_customer');
var id = "edit_customer_"+$('#customer_id').val();
var id = "edit_customer_"+customer_id;
alert(id)
$("#new_customer").attr('id', id);
$(".edit_customer").attr('id', id);
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".patch_method").append('<input type="hidden" name="_method" value="patch">');
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
//$(".edit_customer").attr('method', 'PATCH');
}
});