change customer UI and header css

This commit is contained in:
phyusin
2018-09-13 11:58:57 +06:30
parent ffca0af445
commit 57adb09162
9 changed files with 995 additions and 542 deletions

View File

@@ -1,18 +1,18 @@
<div class="container-fluid">
<!-- <div class="page-header">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<span class="float-right">
<a href="#" id="back">Back</a>
<%= link_to 'Back', dashboard_path %>
</span>
</ul>
</div> -->
</div>
<div class="row">
<div class="<%= @create_flag ? 'col-lg-8 col-md-8 col-sm-8' : 'col-lg-11 col-md-11 col-sm-11' %>">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="body">
<div class="row p-t-20 p-l-20">
@@ -46,242 +46,305 @@
<% end %>
</div>
</div>
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
<div class="table-responsive">
<table id="origami-crm-table" class="table table-striped" style="width:100%">
<thead>
<tr>
<th></th>
<th><%= t("views.right_panel.detail.sr_no") %></th>
<th><%= t("views.right_panel.detail.name") %></th>
<th><%= t("views.right_panel.detail.card_no") %></th>
<th><%= t("views.right_panel.detail.membership_type") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.email") %></th>
<!-- <th>Paypar No</th> -->
</tr>
</thead>
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
<%= paginate @crm_customers %>
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
<div class="table-responsive">
<table id="origami-crm-table" class="table table-striped" style="width:100%">
<thead>
<tr>
<th></th>
<th><%= t("views.right_panel.detail.sr_no") %></th>
<th><%= t("views.right_panel.detail.name") %></th>
<th><%= t("views.right_panel.detail.card_no") %></th>
<th><%= t("views.right_panel.detail.membership_type") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.email") %></th>
<!-- <th>Paypar No</th> -->
</tr>
</thead>
<tbody>
<% if @crm_customers.count > 0 %>
<% @i = 0 %>
<% @crm_customers.each do |crm_customer| %>
<tbody>
<% if @crm_customers.count > 0 %>
<% @i = 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<%= @i += 1 %>
<%else%>
-
<% end %>
</td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.card_no rescue '-' %></td>
<td>
<% if !@membership_types.nil? %>
<% @membership_types.each do |member_type| %>
<% if member_type[1] == crm_customer.membership_type %>
<%= member_type[0] %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<%= @i += 1 %>
<%else%>
-
<% end %>
<% end %>
</td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.card_no rescue '-' %></td>
<td>
<% if !@membership_types.nil? %>
<% @membership_types.each do |member_type| %>
<% if member_type[1] == crm_customer.membership_type %>
<%= member_type[0] %>
<% end %>
<% end %>
<% end %>
</td>
<td style="width:20%;word-break: break-all;"><%= crm_customer.contact_no %></td>
<td style="width:20%;word-break: break-all;"><%= crm_customer.email %></td>
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
</tr>
<% end %>
</td>
<td style="width:20%;word-break: break-all;"><%= crm_customer.contact_no %></td>
<td style="width:20%;word-break: break-all;"><%= crm_customer.email %></td>
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
<%else%>
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div> <!-- .end-of-col-md-8 -->
<div class="col-sm-4 col-md-4 col-lg-4">
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%if !@dining_facility.nil?%>
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
<% elsif @cashier_type == 'quick_service' %>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%else%>
<input type="hidden" id="table_id" name="table_id" value="" />
<input type="hidden" id="type" name="type" value="" />
<input type="hidden" id="table_type" name="table_type" value="" />
<%end%>
</tr>
<% end %>
<%else%>
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
<% end %>
</tbody>
</table>
<br>
<section>
<div class="wizard">
<div class="wizard-inner">
<div class="active-line"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item">
<div class="connecting-line border-right"></div>
<a href="#step1" class="nav-link active" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1">
<span class="round-tab">
1
</span>
</a>
</li>
<li role="presentation" class="nav-item disabled">
<div class="connecting-line"></div>
<a href="#complete" class="nav-link disable" data-toggle="tab" aria-controls="complete" role="tab" title="Complete">
<span class="round-tab">
2
</span>
</a>
</li>
</ul>
</div>
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" id="step1">
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.sr_no") %></label>
<div class="form-line disabled">
<input type="text" name="" value="<%=@count_customer%>" class="form-control" disabled="" >
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label for="customer[salutation]" class="control-label"> <%= t("views.right_panel.detail.salutation") %> :</label><br>
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mr", :class => "salutation mr with-gap radio-col-indigo", :value=>"Mr"%><%= t("views.right_panel.detail.mr") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs"%><%= t("views.right_panel.detail.miss") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss"%><%= t("views.right_panel.detail.mrs") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm with-gap radio-col-indigo", :value=>"Mdm"%><%= t("views.right_panel.detail.mdm") %>
</label>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :name, :class => "form-control name", :required => true %>
<%= paginate @crm_customers %>
</div>
</div>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :contact_no, :class => "form-control contact_no" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['contact_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :email, :class => "form-control email" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['email']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label for="customer[gender]" class="control-label"><%= t("views.right_panel.detail.gender") %> :</label><br>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male"%><%= t("views.right_panel.detail.male") %></label>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female"%><%= t("views.right_panel.detail.female") %></label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['company']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end -%>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.date_of_birth") %></label>
<%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :address, :class => "form-control address" %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue btn-info-full next-step">Next</button>
</div>
</div>
</div> <!-- .end-of-step1 -->
<div class="tab-pane" role="tabpanel" id="complete">
<!-- <h4>Step 2</h4> -->
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.customer_photo") %></label>
<div class="panel padding-10">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
<select class="form-control col-md-12 selectpicker show-tick" id="customer_type" name="customer[customer_type]" style="height: " >
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control tax_profiles" %>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :card_no, :class => "form-control card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
<div class="-group">
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly/>
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.select_membership_group") %></label>
<select class="form-control col-md-12 selectpicker show-tick" name="member_group_id" style="height: " >
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue prev-step">Prev</button>
<%= f.submit t("views.btn.submit"),:class => 'btn bg-blue btn-md waves-effect', :id => 'submit_customer' %>
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
</div>
</div>
</div><!-- .end-of-step2 -->
</div> <!-- .end-of-tab-content -->
<% end %>
</div> <!-- .end-of-wizard -->
</section> <!-- .end-of-section -->
</div><!-- .end-of-col-md-4 -->
</div> <!-- .end-of-row -->
</div>
</div>
</div>
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%if !@dining_facility.nil?%>
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
<% elsif @cashier_type == 'quick_service' %>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%else%>
<input type="hidden" id="table_id" name="table_id" value="" />
<input type="hidden" id="type" name="type" value="" />
<input type="hidden" id="table_type" name="table_type" value="" />
<%end%>
<% if @create_flag %>
<div class="col-lg-3 col-md-3 col-sm-3" >
<div class="card">
<div class="body" id="custom-slimscroll">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
<label><%= t("views.right_panel.detail.salutation") %> :</label><br>
<label class="font-15"><%= t("views.right_panel.detail.mr") %>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%></label>
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.miss") %>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%></label>
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mrs") %>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%></label>
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mdm") %>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%></label>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.gender") %> :</label><br>
<label><%= t("views.right_panel.detail.male") %>
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label>
<label><%= t("views.right_panel.detail.female") %>
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label>
</div>
<div class="form-group">
<%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
</div>
<div class="form-group">
<%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['company']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['contact_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['contact_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div>
<div class="form-group">
<%= f.input :address, :class => "form-control col-md-6 address" %>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.sr_no") %></label>
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.date_of_birth") %></label>
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.customer_photo") %></label>
<div class="panel padding-10">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-10px"><%= str %></span>
<% end -%>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
<div class="input-group">
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly />
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
</div>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.select_membership_group") %></label>
<select class="form-control col-md-12" name="member_group_id">
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.submit t("views.btn.submit"),:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %>
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
</div>
<%end%>
</div>
</div>
</div>
<% end %>
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
</div>
</div>
<div id="sxModal">
@@ -361,8 +424,45 @@
}
},100);
});
/*new customer UI func:*/
//Initialize tooltips
$('.nav-tabs > li a[title]').tooltip();
//Wizard
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
var $target = $(e.target);
if ($target.parent().hasClass('disabled')) {
return false;
}
});
$(".next-step").click(function (e) {
var $active = $('.wizard .nav-tabs li a.active');
$active.parent().next().removeClass('disabled');
nextTab($active);
$('.wizard .nav-tabs li.active .connecting-line').css({"border-bottom-left-radius": 0, "border-top-left-radius": 0});
});
$(".prev-step").click(function (e) {
var $active = $('.wizard .nav-tabs li a.active');
prevTab($active);
});
/*new customer UI func:*/
});
/*customer UI tab btn*/
function nextTab(elem) {
$(elem).parent().next().find('a[data-toggle="tab"]').click();
}
function prevTab(elem) {
$(elem).parent().prev().find('a[data-toggle="tab"]').click();
}
/*customer UI tab btn*/
// Read NFC card no from java
function getCardNo(){