[enter image description here][1]
please check image
when i add same product i want update only quantity
enter image description here 1:https://i.stack.imgur.com/B3cVe.png
enter image description here enter image description here 请检查我的代码:
function addRow(product) {
var qty = $('#qty').val();
var code_chk = $(".code_chk").text();
if ($('#procode_1').val() == code_chk) {
var add_qty = $('#add_qty').text();
v = ++add_qty;
$('.set_qty').val(v);
} else {
sr++;
$('#productlist').show();
var $tableB = $('#productlist tbody');
var $row = $(
"<tr>" +
"<td style='display: none;'>" + sr + "</td>" +
"<td class='code_chk'>" + product.procode + "</td>" +
"<td>" + product.prname + "</td>" +
}
}