|
@@ -65,17 +65,7 @@ $(document).ready(function() {
|
|
bills_id: billsInfo.id
|
|
bills_id: billsInfo.id
|
|
};
|
|
};
|
|
postData(postUrl, postInfo, function (result) {
|
|
postData(postUrl, postInfo, function (result) {
|
|
- let index_html = '';
|
|
|
|
- const index_list = result.indexList;
|
|
|
|
- for(let i in index_list) {
|
|
|
|
- index_html += '<tr> <td>'+ index_list[i].code +'</td> <td>'+ index_list[i].name +'</td>' +
|
|
|
|
- '<td>'+ (index_list[i].unit1 !== null ? index_list[i].unit1 : '') +'</td>' +
|
|
|
|
- '<td>'+ (index_list[i].unit2 !== null ? index_list[i].unit2 : '') +'</td>' +
|
|
|
|
- '<td>'+ index_list[i].rule +'</td> <td>'+ (index_list[i].eval_rule !== null ? index_list[i].eval_rule : '') +'</td>' +
|
|
|
|
- '<td>'+ (index_list[i].value !== null ? index_list[i].value : '') +'</td> </tr>';
|
|
|
|
- }
|
|
|
|
- $('#indexList').html(index_html);
|
|
|
|
-
|
|
|
|
|
|
+ updateIndexHTML(result.indexList);
|
|
let param_html = '';
|
|
let param_html = '';
|
|
const param_list = result.paramList;
|
|
const param_list = result.paramList;
|
|
for(let i in param_list) {
|
|
for(let i in param_list) {
|
|
@@ -90,6 +80,19 @@ $(document).ready(function() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function updateIndexHTML(indexlist) {
|
|
|
|
+ let index_html = '';
|
|
|
|
+ const index_list = indexlist;
|
|
|
|
+ for(let i in index_list) {
|
|
|
|
+ index_html += '<tr> <td>'+ index_list[i].code +'</td> <td>'+ index_list[i].name +'</td>' +
|
|
|
|
+ '<td>'+ (index_list[i].unit1 !== null ? index_list[i].unit1 : '') +'</td>' +
|
|
|
|
+ '<td>'+ (index_list[i].unit2 !== null ? index_list[i].unit2 : '') +'</td>' +
|
|
|
|
+ '<td>'+ index_list[i].rule +'</td> <td>'+ (index_list[i].eval_rule !== null ? index_list[i].eval_rule : '') +'</td>' +
|
|
|
|
+ '<td>'+ (index_list[i].value !== null ? index_list[i].value : '') +'</td> </tr>';
|
|
|
|
+ }
|
|
|
|
+ $('#indexList').html(index_html);
|
|
|
|
+ }
|
|
|
|
|
|
$('body').on('blur', '#paramList input', function () {
|
|
$('body').on('blur', '#paramList input', function () {
|
|
const self = $(this);
|
|
const self = $(this);
|
|
@@ -104,6 +107,7 @@ $(document).ready(function() {
|
|
const postUrl = '/lib/updateParamValue';
|
|
const postUrl = '/lib/updateParamValue';
|
|
postData(postUrl, postInfo, function (result) {
|
|
postData(postUrl, postInfo, function (result) {
|
|
self.attr('data-old-value', result.param.calc_value);
|
|
self.attr('data-old-value', result.param.calc_value);
|
|
|
|
+ updateIndexHTML(result.indexes);
|
|
},function (result) {
|
|
},function (result) {
|
|
self.val(self.attr('data-old-value'));
|
|
self.val(self.attr('data-old-value'));
|
|
});
|
|
});
|