stock module dev -vadivel J
This commit is contained in:
parent
dec3690092
commit
801d891c61
@ -267,7 +267,7 @@
|
|||||||
<!-- hidden input fields -->
|
<!-- hidden input fields -->
|
||||||
<input type="hidden" class="form-control" id="machineRunningInHrsId" name="machineRunningInHrs">
|
<input type="hidden" class="form-control" id="machineRunningInHrsId" name="machineRunningInHrs">
|
||||||
<input type="hidden" class="form-control" id="perHourGasConsumptionId" name="perHourGasConsumption">
|
<input type="hidden" class="form-control" id="perHourGasConsumptionId" name="perHourGasConsumption">
|
||||||
<input type="hidden" class="form-control" id="perHourCoatingSandQTYId" name="perHourCoatingSandQTYId" >
|
<input type="hidden" class="form-control" id="perHourCoatingSandQTYId" name="perHourCoatingSandQTY" >
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -317,13 +317,13 @@
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editMachineOnTimeId">Machine On Time</label>
|
<label for="editMachineOnTimeId">Machine On Time</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="time" class="form-control" id="editMachineOnTimeId"
|
<input type="datetime-local" class="form-control" id="editMachineOnTimeId"
|
||||||
name="machineOnTime" value="" required>
|
name="machineOnTime" value="" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editMachineOffTimeId">Machine Off Time</label>
|
<label for="editMachineOffTimeId">Machine Off Time</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="time" class="form-control" id="editMachineOffTimeId"
|
<input type="datetime-local" class="form-control" id="editMachineOffTimeId"
|
||||||
name="machineOffTime" value="" required>
|
name="machineOffTime" value="" required>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -359,7 +359,7 @@
|
|||||||
<!-- hidden input fields -->
|
<!-- hidden input fields -->
|
||||||
<input type="hidden" class="form-control" id="editMachineRunningInHrsId" name="machineRunningInHrs">
|
<input type="hidden" class="form-control" id="editMachineRunningInHrsId" name="machineRunningInHrs">
|
||||||
<input type="hidden" class="form-control" id="editPerHourGasConsumptionId" name="perHourGasConsumption">
|
<input type="hidden" class="form-control" id="editPerHourGasConsumptionId" name="perHourGasConsumption">
|
||||||
<input type="hidden" class="form-control" id="editPerHourCoatingSandQTYId" name="perHourCoatingSandQTYId" >
|
<input type="hidden" class="form-control" id="editPerHourCoatingSandQTYId" name="perHourCoatingSandQTY" >
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -496,19 +496,18 @@ $(document).ready(function() {
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
$('#machineOnTimeId').change(function(){
|
$('#machineOnTimeId').change(function(){
|
||||||
let machineOnTime = $(this).val();
|
let machineOnTime = $(this).val();
|
||||||
let machineOffTime =$('#machineOffTimeId').val();
|
let machineOffTime =$('#machineOffTimeId').val();
|
||||||
|
|
||||||
|
|
||||||
console.log(machineOnTime);
|
|
||||||
console.log(machineOffTime);
|
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime){
|
if( machineOnTime && machineOffTime){
|
||||||
|
|
||||||
let machineRunningInHrs= calculateHours(machineOnTime , machineOffTime );
|
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
||||||
if(!machineRunningInHrs){
|
|
||||||
|
|
||||||
|
if(!machineRunningInHrs){
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -527,12 +526,9 @@ $(document).ready(function() {
|
|||||||
let machineOnTime =$('#machineOnTimeId').val();
|
let machineOnTime =$('#machineOnTimeId').val();
|
||||||
|
|
||||||
|
|
||||||
console.log(machineOnTime);
|
|
||||||
console.log(machineOffTime);
|
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime ){
|
if( machineOnTime && machineOffTime ){
|
||||||
|
|
||||||
let machineRunningInHrs= calculateHours(machineOnTime , machineOffTime );
|
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
||||||
if(!machineRunningInHrs){
|
if(!machineRunningInHrs){
|
||||||
|
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
@ -549,7 +545,7 @@ $(document).ready(function() {
|
|||||||
$('#totalCoatingSandId').change(function(){
|
$('#totalCoatingSandId').change(function(){
|
||||||
|
|
||||||
let totalCoatingSandValue= $(this).val();
|
let totalCoatingSandValue= $(this).val();
|
||||||
let machineRunningInHrsValue= $('#machineRunningInHrsId');
|
let machineRunningInHrsValue= $('#machineRunningInHrsId').val();
|
||||||
|
|
||||||
if(totalCoatingSandValue && machineRunningInHrsValue){
|
if(totalCoatingSandValue && machineRunningInHrsValue){
|
||||||
let perHourCoatingSandQTYValue= (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
let perHourCoatingSandQTYValue= (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
||||||
@ -558,10 +554,11 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#totalGasConsumptionId').change(function(){
|
$('#totalGasConsumptionId').change(function(){
|
||||||
|
|
||||||
let totalGasConsumptionValue=$(this).val();
|
let totalGasConsumptionValue=$(this).val();
|
||||||
let machineRunningInHrsValue= $('#machineRunningInHrsId');
|
let machineRunningInHrsValue= $('#machineRunningInHrsId').val();
|
||||||
if(totalGasConsumptionValue && machineRunningInHrsValue){
|
if(totalGasConsumptionValue && machineRunningInHrsValue){
|
||||||
let perHourGasConsumptionValue= (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
let perHourGasConsumptionValue= (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
||||||
$('#perHourGasConsumptionId').val(perHourGasConsumptionValue);
|
$('#perHourGasConsumptionId').val(perHourGasConsumptionValue);
|
||||||
@ -578,49 +575,85 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('#editMachineOnTimeId')
|
|
||||||
$('#editMachineOffTimeId')
|
|
||||||
$('#editTotalCoatingSandId')
|
|
||||||
$('#editTotalGasConsumptionId')
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#editMachineOnTimeId').change(function(){
|
||||||
|
let machineOnTime = $(this).val();
|
||||||
|
let machineOffTime =$('#editMachineOffTimeId').val();
|
||||||
|
|
||||||
|
|
||||||
$('#editMachineRunningInHrsId')
|
if( machineOnTime && machineOffTime){
|
||||||
$('#editPerHourGasConsumptionId')
|
|
||||||
$('#editPerHourCoatingSandQTYId')
|
|
||||||
|
|
||||||
|
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
||||||
|
|
||||||
|
if(!machineRunningInHrs){
|
||||||
|
$(this).val('');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
||||||
|
$('#editTotalCoatingSandId').trigger('change');
|
||||||
|
$('#editTotalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#editMachineOffTimeId').change(function(){
|
||||||
|
|
||||||
|
let machineOffTime = $(this).val();
|
||||||
|
let machineOnTime =$('#editMachineOnTimeId').val();
|
||||||
|
|
||||||
|
|
||||||
|
if( machineOnTime && machineOffTime ){
|
||||||
|
|
||||||
|
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
||||||
|
if(!machineRunningInHrs){
|
||||||
|
|
||||||
|
$(this).val('');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
||||||
|
$('#editTotalCoatingSandId').trigger('change');
|
||||||
|
$('#editTotalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#editTotalCoatingSandId').change(function(){
|
||||||
|
|
||||||
|
let totalCoatingSandValue= $(this).val();
|
||||||
|
let machineRunningInHrsValue= $('#editMachineRunningInHrsId').val();
|
||||||
|
|
||||||
|
if(totalCoatingSandValue && machineRunningInHrsValue){
|
||||||
|
let perHourCoatingSandQTYValue= (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
||||||
|
$('#editPerHourCoatingSandQTYId').val(perHourCoatingSandQTYValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#editTotalGasConsumptionId').change(function(){
|
||||||
|
|
||||||
|
let totalGasConsumptionValue=$(this).val();
|
||||||
|
let machineRunningInHrsValue= $('#editMachineRunningInHrsId').val();
|
||||||
|
if(totalGasConsumptionValue && machineRunningInHrsValue){
|
||||||
|
let perHourGasConsumptionValue= (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
||||||
|
$('#editPerHourGasConsumptionId').val(perHourGasConsumptionValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- utility function for input elements of type="time" -->
|
<!-- utility function for input elements of type="time" -->
|
||||||
|
|
||||||
<script>
|
|
||||||
function calculateHours(machineOnTime , machineOffTime , date){
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return hours;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function calculateHours(machineOnTime , machineOffTime ){
|
function calculateMachineRunInHrs(machineOnTime , machineOffTime ){
|
||||||
|
|
||||||
let startTime = new Date(machineOnTime);
|
let startTime = new Date(machineOnTime);
|
||||||
let endTime = new Date(machineOffTime);
|
let endTime = new Date(machineOffTime);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user