Remove rows from order form

This commit is contained in:
Oliver Walters 2019-06-13 20:26:53 +10:00
parent 3bb76060d9
commit 4be82a31ce
4 changed files with 29 additions and 13 deletions

View File

@ -25,7 +25,7 @@
<table class='table table-condensed table-striped' id='order-wizard-part-table'>
<tr>
<th>Part</th>
<th>Supplier</th>
<th colspan='2'>Select Supplier</th>
<th>Quantity</th>
<th></th>
</tr>
@ -35,6 +35,11 @@
{% include "hover_image.html" with image=part.image hover=False %}
{{ part.full_name }} <small><i>{{ part.description }}</i></small>
</td>
<td>
<button class='btn btn-default btn-create' id='new_supplier_part_{{ part.id }}' title='Create new supplier part for {{ part }}' type='button'>
<span onClick='newSupplierPartFromWizard()' class='glyphicon glyphicon-small glyphicon-plus'></span>
</button>
</td>
<td>
<div class='control-group'>
<div class='controls'>
@ -59,7 +64,7 @@
</td>
<td>
<button class='btn btn-default btn-remove' id='del_item_{{ part.id }}' title='Remove part' type='button'>
<span row='part_row_{{ part.id }}' onclick='removeOrderRow()' class='glyphicon glyphicon-small glyphicon-remove'></span>
<span row='part_row_{{ part.id }}' onclick='removeOrderRowFromOrderWizard()' class='glyphicon glyphicon-small glyphicon-remove'></span>
</button>
</td>
</tr>

View File

@ -27,8 +27,7 @@
<tr>
<th>Supplier</th>
<th>Items</th>
<th>Purchase Order</th>
<th></th>
<th colspan='2'>Select Purchase Order</th>
</tr>
{% for supplier in suppliers %}
<tr id='suppier_row_{{ supplier.id }}'>
@ -37,6 +36,15 @@
{{ supplier.name }}
</td>
<td>{{ supplier.order_items|length }}</td>
<td>
<button
class='btn btn-default btn-create'
id='new_po_{{ supplier.id }}'
title='Create new purchase order for {{ supplier.name }}'
type='button'>
<span onclick='newPurchaseOrderFromWizard()' class='glyphicon glyphicon-small glyphicon-plus'></span>
</button>
</td>
<td>
<div class='control-group'>
<div class='controls'>
@ -57,15 +65,6 @@
{% endif %}
</div>
</td>
<td>
<button
class='btn btn-default btn-create'
id='new_po_{{ supplier.id }}'
title='Create new purchase order for {{ supplier.name }}'
type='button'>
<span onclick='newPurchaseOrderFromWizard()' class='glyphicon glyphicon-small glyphicon-plus'></span>
</button>
</td>
</tr>
{% endfor %}

View File

@ -0,0 +1,11 @@
function removeOrderRowFromOrderWizard(e) {
/* Remove a part selection from an order form. */
e = e || window.event;
var src = e.target || e.srcElement;
var row = $(src).attr('row');
$('#' + row).remove();
}

View File

@ -99,6 +99,7 @@ InvenTree
<script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/tables.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/order.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script>
{% block js_load %}