|
@@ -69,36 +69,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Table.api.bindevent(table);
|
|
Table.api.bindevent(table);
|
|
|
},
|
|
},
|
|
|
add: function () {
|
|
add: function () {
|
|
|
|
|
+ var gy_num = 1;
|
|
|
$('#add').click(function () {
|
|
$('#add').click(function () {
|
|
|
- // $.ajax({
|
|
|
|
|
- // method:"POST",
|
|
|
|
|
- // url:'formula/gyName',
|
|
|
|
|
- // success(res){
|
|
|
|
|
- // var html = '';
|
|
|
|
|
- // html += '<tr><td><input class="form-control material" type="text" value=""></td>';
|
|
|
|
|
- // html += '<td><input class="form-control percentage" type="number" value=""></td>';
|
|
|
|
|
- // html += "<td><select class='form-control selectpicker' name='gy_name' id=''><option value=''>请选择工艺</option>";
|
|
|
|
|
- // for (var key in res){
|
|
|
|
|
- // html += "<option value='"+res[key].title+"'>"+res[key].title+"</option>";
|
|
|
|
|
- // }
|
|
|
|
|
- // html += "</select></td>";
|
|
|
|
|
- // // html += '<td><input class="form-control gy_name" type="text" value=""></td>';
|
|
|
|
|
- // // html += '<td><input class="form-control gy_num" type="text" value=""></td>';
|
|
|
|
|
- // html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
|
|
|
- // $('#gy').append(html);
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ var material = $('#add_material').val();
|
|
|
|
|
+ var percentage = $('#add_percentage').val();
|
|
|
|
|
+ var gy_name = $('#add_gy_name').selectPageText();
|
|
|
var html = '';
|
|
var html = '';
|
|
|
- html += '<tr><td><input class="form-control material" type="text" value=""></td>';
|
|
|
|
|
- html += '<td><input class="form-control percentage" type="number" value=""></td>';
|
|
|
|
|
- html += '<td><input class="form-control gy_name" type="text" value=""></td>';
|
|
|
|
|
- html += '<td><input class="form-control gy_num" type="text" value=""></td>';
|
|
|
|
|
|
|
+ html += '<tr><td><input class="form-control material" type="text" value="'+material+'"></td>';
|
|
|
|
|
+ html += '<td><input class="form-control percentage" type="number" value="'+percentage+'"></td>';
|
|
|
|
|
+ html += '<td><input class="form-control gy_name" type="text" value="'+gy_name+'" ></td>';
|
|
|
|
|
+ html += '<td><input class="form-control gy_num" type="text" value="'+gy_num+'" ></td>';
|
|
|
html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
|
$('#gy').append(html);
|
|
$('#gy').append(html);
|
|
|
|
|
+ if (gy_name !=''){
|
|
|
|
|
+ gy_num = gy_num +1;
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
$(document).on('click','.del',function () {
|
|
$(document).on('click','.del',function () {
|
|
|
$(this).parent().parent().remove();
|
|
$(this).parent().parent().remove();
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
Controller.api.bindevent();
|
|
Controller.api.bindevent();
|
|
|
|
|
|
|
|
$(document).on('click','.submit',function () {
|
|
$(document).on('click','.submit',function () {
|
|
@@ -197,27 +187,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
},
|
|
},
|
|
|
edit: function () {
|
|
edit: function () {
|
|
|
$('#add').click(function () {
|
|
$('#add').click(function () {
|
|
|
- // $.ajax({
|
|
|
|
|
- // method: "POST",
|
|
|
|
|
- // url: 'formula/gyName',
|
|
|
|
|
- // success(res) {
|
|
|
|
|
- // var html = '';
|
|
|
|
|
- // html += '<tr><td><input class="form-control material" type="text" value=""></td>';
|
|
|
|
|
- // html += '<td><input class="form-control percentage" type="number" value=""></td>';
|
|
|
|
|
- // html += "<td><select class='form-control selectpicker' name='gy_name' id=''><option value=''>请选择工艺</option>";
|
|
|
|
|
- // for (var key in res) {
|
|
|
|
|
- // html += "<option value='" + res[key].title + "'>" + res[key].title + "</option>";
|
|
|
|
|
- // }
|
|
|
|
|
- // html += "</select></td>";
|
|
|
|
|
- // // html += '<td><input class="form-control gy_num" type="text" value=""></td>';
|
|
|
|
|
- // html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
|
|
|
- // $('#gy').append(html);
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ var material = $('#add_material').val();
|
|
|
|
|
+ var percentage = $('#add_percentage').val();
|
|
|
|
|
+ var gy_name = $('#add_gy_name').selectPageText();
|
|
|
var html = '';
|
|
var html = '';
|
|
|
- html += '<tr><td><input class="form-control material" type="text" value=""></td>';
|
|
|
|
|
- html += '<td><input class="form-control percentage" type="number" value=""></td>';
|
|
|
|
|
- html += '<td><input class="form-control gy_name" type="text" value=""></td>';
|
|
|
|
|
|
|
+ html += '<tr><td><input class="form-control material" type="text" value="'+material+'"></td>';
|
|
|
|
|
+ html += '<td><input class="form-control percentage" type="number" value="'+percentage+'"></td>';
|
|
|
|
|
+ html += '<td><input class="form-control gy_name" type="text" value="'+gy_name+'"></td>';
|
|
|
html += '<td><input class="form-control gy_num" type="text" value=""></td>';
|
|
html += '<td><input class="form-control gy_num" type="text" value=""></td>';
|
|
|
html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
html += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
|
$('#gy').append(html);
|
|
$('#gy').append(html);
|