/
home
/
sjslayjy
/
public_html
/
assets
/
resources
/
views
/
admin
/
Upload File
HOME
@extends('layout.master') @push('plugin-styles') <!-- {!! Html::style('/assets/plugins/plugin.css') !!} --> <style type="text/css"> .table th, .table td { white-space: break-spaces !important; } .table-responsive.small-text > table > tbody > tr > td {font-size: 12px !important;} </style> @endpush @section('content') <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row grid-margin"> <div class="col-lg-3"> <h4 class="card-title">Spares Parts At Engineers</h4> </div> <div class="col-lg-3"> <a href="#"class="btn btn-info" onclick="submit_now()" title="file-excel"><i class="glyphicon glyphicon-circle-arrow-down" ></i>Export Excel</a> </div> <div class="col-lg-3"> <small>Select Warehouse</small> <select class="form-control mr" id="warehouse" onchange="get_ware_house(this)"> <option value=""> -- Select WareHouse --</option> @foreach($warehouses as $warehouse) <option value="{{$warehouse}}">{{$warehouse}}</option> @endforeach </select> </div> <div class="col-lg-3"> <small>Select Engineer</small> <select class="form-control mr" id="engineer" onchange="getSpareParts(this)"> <option value=""> -- Select Engineer --</option> </select> </div> </div> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th> Spare Code </th> <th> Description </th> <th> Fresh</th> <th> Repaird </th> <th> Faulty </th> <th> Total </th> </tr> </thead> <tbody id="spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="row grid-margin"> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Fresh Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="fresh_spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Repaired Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="repaired_spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Faulty Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="faulty_spare_list"> </tbody> </table> </div> </div> </div> </div> </div> </div> @endsection @push('plugin-scripts') {!! Html::script('/assets/plugins/chartjs/chart.min.js') !!} {!! Html::script('/assets/plugins/jquery-sparkline/jquery.sparkline.min.js') !!} @endpush @push('custom-scripts') {!! Html::script('/assets/js/dashboard.js') !!} <script type="text/javascript"> function submit_now() { var action_type = 'export'; var values = $.map($('#warehouse option'), function(e){ return e.value; }) values = values.join(',').replace(',', ''); var url = window.location.origin+"/admin/resigned-tech-stocks?action_type="+action_type+"&warehouse="+values; window.location.href = url; } function get_ware_house(t){ var warehouse = $(t).val(); if(warehouse !=""){ var url = window.location.origin+"/circle-store/get-resigned-admin-engineer-of-warehouse" var data = {}; data._token = "{{ csrf_token() }}"; data.warehouse = warehouse; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: data, success:function(res){ if(res.success == true){ var html = '<option value=""> -- Select Engineer --</option>'; $.each(res.engineers,function(key,val){ html +=`<option value="`+val.LoginID+`">`+val.LoginID+` - `+val.StaffName+`</option>`; }); $('#engineer').html(html); }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); }else{ swal("Please Select warehouse !", { icon: "error", }); } } function getSpareParts(t){ var engineer_id = $(t).val(); if(engineer_id != ""){ var url = window.location.origin+"/circle-store/get-spare-part-at-engineer" var mydata = {}; mydata._token = "{{ csrf_token() }}"; mydata.engineer_id = engineer_id; $.ajax({ type: "POST", url: url, data: mydata, success:function(res){ console.log(res); if(res.success == true){ var html = ""; $.each(res.spares,function(key,spare_part){ html +=`<tr class="row_`+spare_part.id+`"> <td>`+spare_part.spare_code+`</td> <td>`+spare_part.description+`</td> <td><label class="badge badge-success">`+spare_part.fresh_qty+`</label></td> <td><label class="badge badge-warning">`+spare_part.repaired_qty+`</label></td> <td><label class="badge badge-danger">`+spare_part.faulty_qty+`</label></td> <td><label class="badge badge-danger">`+(spare_part.fresh_qty+spare_part.repaired_qty+spare_part.faulty_qty)+`</label></td> </tr>`; }); $('#spare_list').html(html); var fhtml = ''; $.each(res.fresh_items,function(key,fspare){ fhtml +=`<tr class="frow_`+fspare.id+`"> <td>`+fspare.spare_code+`</td> <td>`+fspare.available_qty+`</td> <td>`+fspare.rate+`</td> <td>`+(fspare.available_qty*fspare.rate)+`</td> </tr>`; }); $('#fresh_spare_list').html(fhtml); var rhtml = ''; $.each(res.repaired_items,function(key,rspare){ rhtml +=`<tr class="rrow_`+rspare.id+`"> <td>`+rspare.spare_code+`</td> <td>`+rspare.available_qty+`</td> <td>`+rspare.rate+`</td> <td>`+(rspare.available_qty*rspare.rate)+`</td> </tr>`; }); $('#repaired_spare_list').html(rhtml); var flhtml = ''; $.each(res.faulty_items,function(key,flspare){ flhtml +=`<tr class="frow_`+flspare.id+`"> <td>`+flspare.spare_code+`</td> <td>`+flspare.available_qty+`</td> <td>`+flspare.rate+`</td> <td>`+(flspare.available_qty*flspare.rate)+`</td> </tr>`; }); $('#faulty_spare_list').html(flhtml); }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); }else{ } } </script> @endpush