update search and crm

This commit is contained in:
Aung Myo
2017-06-14 00:09:54 +06:30
parent 713e0a367c
commit 3db6252304
20 changed files with 352 additions and 677 deletions

View File

@@ -25,8 +25,8 @@
<tr>
<td colspan="6">
<%= form_tag crm_customers_path, :method => :get do %>
<div class="input-append form-group pull-left">
<input type="text" name="filter" placeholder="Search" class="form-control input-sm col-md-8">
<div class="input-append col-md-12 form-group pull-left">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" class="form-control input-sm col-md-4">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<% end %>
@@ -44,9 +44,9 @@
<tbody>
<% if @crm_customers.count > 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" value="<%= crm_customer.customer_id %>" name="checkbox" class="checkbox_check" ></td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
@@ -117,8 +117,9 @@
<%end%>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<a href="<%= crm_customers_path%>" class="btn btn-primary btn-lg ">
Back
<br>
<a href="<%= crm_customers_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div>
</div>
@@ -135,11 +136,10 @@ $(function() {
$('.datepicker').css('cursor','pointer');
});
$(document).on('click',".checkbox_check",function(){
if(this.checked){
$(document).on('click',".customer_tr",function(){
// if(this.checked){
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).val();
var customer_id = $(this).attr('data-ref');
if(sale_id != 0){
// var url = "/"+customer_id;
@@ -178,9 +178,9 @@ $(function() {
//$(".edit_customer").attr('method', 'PATCH');
}
});
}else{
// }else{
}
// }
})
function update_sale(customer_id,sale_id) {
@@ -205,7 +205,6 @@ $(function() {
success: function(data) {
if(data.status == true)
{
alert('Customer has assigned');
window.location.href = '/origami'
}else{
alert('Record not found!');