mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
remove product barcode tags
This commit is contained in:
parent
6676e3c508
commit
2bb792af99
|
|
@ -166,33 +166,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
$('#barcode-taginput').tagsManager({
|
||||
'hiddenTagListName': 'barcode',
|
||||
'tagsContainer': '#barcode-taginput-container',
|
||||
'tagClass': 'badge badge-secondary',
|
||||
'delimiters': [13, 44]
|
||||
});
|
||||
|
||||
if (Grocy.EditMode === 'edit')
|
||||
{
|
||||
Grocy.Api.Get('objects/products/' + Grocy.EditObjectId,
|
||||
function (product)
|
||||
{
|
||||
if (product.barcode !== null && product.barcode.length > 0)
|
||||
{
|
||||
product.barcode.split(',').forEach(function(item)
|
||||
{
|
||||
$('#barcode-taginput').tagsManager('pushTag', item);
|
||||
});
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var prefillName = GetUriParam('prefillname');
|
||||
if (prefillName !== undefined)
|
||||
{
|
||||
|
|
@ -200,18 +173,6 @@ if (prefillName !== undefined)
|
|||
$('#name').focus();
|
||||
}
|
||||
|
||||
var prefillBarcode = GetUriParam('prefillbarcode');
|
||||
if (prefillBarcode !== undefined)
|
||||
{
|
||||
$('#barcode-taginput').tagsManager('pushTag', prefillBarcode);
|
||||
$('#name').focus();
|
||||
}
|
||||
|
||||
$("#barcode-taginput").on("blur", function(e)
|
||||
{
|
||||
$("#barcode-taginput").tagsManager("pushTag", $("#barcode-taginput").val());
|
||||
});
|
||||
|
||||
$('.input-group-qu').on('change', function(e)
|
||||
{
|
||||
var quIdPurchase = $("#qu_id_purchase").val();
|
||||
|
|
@ -435,29 +396,6 @@ $(document).on('click', '.qu-conversion-delete-button', function(e)
|
|||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
|
||||
var newBarcode = '';
|
||||
productBarcode.split(',').forEach(function(item)
|
||||
{
|
||||
if(barcode != item)
|
||||
{
|
||||
newBarcode += ',' + item;
|
||||
}
|
||||
});
|
||||
|
||||
var jsonDataProduct = {};
|
||||
jsonDataProduct.barcode = newBarcode;
|
||||
|
||||
Grocy.Api.Put('objects/products/' + productId, jsonDataProduct,
|
||||
function(result)
|
||||
{
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("product-form");
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -562,13 +500,3 @@ $('#qu_id_purchase').blur(function(e)
|
|||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("Grocy.BarcodeScanned", function(e, barcode, target)
|
||||
{
|
||||
if (target != "#barcode-taginput")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$("#barcode-taginput").tagsManager("pushTag", barcode);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@
|
|||
@endphp
|
||||
@include('components.productpicker', array(
|
||||
'products' => $products,
|
||||
'nextInputSelector' => '#barcode-taginput',
|
||||
'prefillById' => $prefillById,
|
||||
'disallowAllProductWorkflows' => true,
|
||||
'isRequired' => false,
|
||||
|
|
@ -70,14 +69,6 @@
|
|||
<textarea class="form-control wysiwyg-editor" id="description" name="description">@if($mode == 'edit'){{ $product->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group tm-group">
|
||||
<label for="barcode-taginput">{{ $__t('Barcode(s)') }} <i class="fas fa-barcode"></i></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control tm-input barcodescanner-input" id="barcode-taginput" data-target="#barcode-taginput">
|
||||
</div>
|
||||
<div id="barcode-taginput-container"></div>
|
||||
</div>
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
|
||||
<div class="form-group">
|
||||
<label for="location_id">{{ $__t('Default location') }}</label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user