GWM:jc select2

This commit is contained in:
Smart 2024-09-25 13:57:49 +05:30
parent c83e8bc82c
commit b188b6dd84
2 changed files with 50 additions and 35 deletions

View File

@ -34,6 +34,7 @@ class Jobcard extends BaseController
public $JobcardModel; public $JobcardModel;
public $JobcardOSModel; public $JobcardOSModel;
public $BranchModel; public $BranchModel;
public $UsersModel;
public function __construct() public function __construct()
{ {
@ -44,6 +45,7 @@ class Jobcard extends BaseController
$this->JobcardModel = new JobcardModel(); $this->JobcardModel = new JobcardModel();
$this->JobcardOSModel = new JobcardOSModel(); $this->JobcardOSModel = new JobcardOSModel();
$this->BranchModel = new BranchModel(); $this->BranchModel = new BranchModel();
$this->UsersModel = new UsersModel();
} }
@ -595,14 +597,15 @@ class Jobcard extends BaseController
{ {
$RoleModel = new RoleModel(); $RoleModel = new RoleModel();
$data['workers'] = $RoleModel->get_workers($this->session->get('logged_user_branch_id')); $data['workers'] = $RoleModel->get_workers($this->session->get('logged_user_branch_id'));
// echo json_encode($data['workers']);die;
} }
} }
$data['job_card_id'] = $job_card_id; $data['job_card_id'] = $job_card_id;
$bikeMakeModel = new BikeMakeModel(); $bikeMakeModel = new BikeMakeModel();
$data['makeData'] =$bikeMakeModel->findAll(); $data['makeData'] =$bikeMakeModel->findAll();
// echo "<pre>";
// print_r($data);die;
return view('job_card_form',$data); return view('job_card_form',$data);
} }

View File

@ -6,6 +6,33 @@
cursor: not-allowed; cursor: not-allowed;
} }
</style> </style>
<style>
.select2-container--default .select2-results__option--highlighted[aria-selected]{
color:#ffffff;
background: #526dee!important;
}
.select2-container .select2-selection--single{
height: 36px;
border:1px solid #ced4da;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
line-height: 36px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
top:4px;
}
.select2-container .select2-selection--multiple{
height: 36px;
border:1px solid #ced4da;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered{
line-height: 36px;
}
.select2-container--default .select2-selection--multiple .select2-selection__arrow{
top:4px;
}
</style>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
@ -399,7 +426,7 @@ $(document).ready(async function() {
<?php } ?> <?php } ?>
// console.log(value); // console.log(value);
tr = $('#productItemTable tbody').append(newRow); tr = $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
/** APPEND CHILD PRODUCT */ /** APPEND CHILD PRODUCT */
await edit_sub_service_data(value.sub_service); await edit_sub_service_data(value.sub_service);
await edit_product_data(value.product); await edit_product_data(value.product);
@ -450,7 +477,7 @@ $(document).ready(async function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
/** APPEND CHILD PRODUCT */ /** APPEND CHILD PRODUCT */
await edit_product_data(value.product); await edit_product_data(value.product);
editlabourcost(value,'complaint_lb') editlabourcost(value,'complaint_lb')
@ -500,7 +527,7 @@ $(document).ready(async function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
/** APPEND CHILD PRODUCT */ /** APPEND CHILD PRODUCT */
await edit_product_data(value.product); await edit_product_data(value.product);
editlabourcost(value,'os_lb') editlabourcost(value,'os_lb')
@ -538,7 +565,7 @@ $(document).ready(async function() {
<?php } ?> <?php } ?>
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
/** APPEND CHILD PRODUCT */ /** APPEND CHILD PRODUCT */
await edit_product_data(value.product); await edit_product_data(value.product);
editlabourcost(value,'custom_complaint_lb') editlabourcost(value,'custom_complaint_lb')
@ -568,7 +595,7 @@ $(document).ready(async function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// $(newRow).insertAfter(tr); // $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
} }
function edit_product_data(products) { function edit_product_data(products) {
@ -615,7 +642,7 @@ $(document).ready(async function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// $(newRow).insertAfter(tr); // $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
} }
} }
@ -664,7 +691,7 @@ $(document).ready(async function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// $(newRow).insertAfter(tr); // $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
} }
} }
@ -1380,7 +1407,7 @@ $(document).ready(function() {
'</tr>'; '</tr>';
$(newRow).insertAfter(tr); $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
} }
const service_child_products = async (data,tr) => { const service_child_products = async (data,tr) => {
@ -1416,7 +1443,7 @@ $(document).ready(function() {
// $('#productItemTable tbody').append(newRow); // $('#productItemTable tbody').append(newRow);
$(newRow).insertAfter(tr); $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
}); });
} }
@ -1455,7 +1482,7 @@ $(document).ready(function() {
// $('#productItemTable tbody').append(newRow); // $('#productItemTable tbody').append(newRow);
$(newRow).insertAfter(tr); $(newRow).insertAfter(tr);
// initializeSelect2(); initializeSelect2();
}); });
} }
@ -1610,7 +1637,7 @@ $(document).ready(function() {
// $('#productItemTable tbody').append(newRow); // $('#productItemTable tbody').append(newRow);
$(newRow).insertAfter($(this).closest('tr')); $(newRow).insertAfter($(this).closest('tr'));
// initializeSelect2(); initializeSelect2();
}); });
$('#addService').click(function() { $('#addService').click(function() {
@ -1652,7 +1679,7 @@ $(document).ready(function() {
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
}else{ }else{
toastr.warning("First Select Vehicle!"); toastr.warning("First Select Vehicle!");
} }
@ -1711,7 +1738,7 @@ $(document).ready(function() {
'<td hidden><input type="hidden" name="id"></td>' + '<td hidden><input type="hidden" name="id"></td>' +
'</tr>'; '</tr>';
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
}else{ }else{
toastr.warning("First Select Vehicle!"); toastr.warning("First Select Vehicle!");
} }
@ -1766,7 +1793,7 @@ $(document).ready(function() {
'</tr>'; '</tr>';
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
}else{ }else{
toastr.warning("First Select Vehicle!"); toastr.warning("First Select Vehicle!");
} }
@ -1852,7 +1879,7 @@ $(document).ready(function() {
'<td hidden><input type="hidden" name="id"></td>' + '<td hidden><input type="hidden" name="id"></td>' +
'</tr>'; '</tr>';
$('#productItemTable tbody').append(newRow); $('#productItemTable tbody').append(newRow);
// initializeSelect2(); initializeSelect2();
}else{ }else{
toastr.warning("First Select Vehicle!"); toastr.warning("First Select Vehicle!");
} }
@ -2225,19 +2252,4 @@ $closestTR.remove();
<style>
.select2-container--default .select2-results__option--highlighted[aria-selected]{
color:#ffffff;
background: #526dee!important;
}
.select2-container .select2-selection--single{
height: 36px;
border:1px solid #ced4da;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
line-height: 36px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
top:4px;
}
</style>