Commit 8c214582 by guanzhenshan

优化每日销进比汇总页面显示

parent 62ef3cde
......@@ -46,7 +46,9 @@
<thead>
<tr></tr>
</thead>
<tbody></tbody>
<tbody>
</tbody>
</table>
</div>
</div>
......@@ -94,13 +96,22 @@
return false;
}
var w = $('#roletable').parent().width()+40;
if (w < (160 * result.head.length + 40)) {
w = (160 * result.head.length + 40);
}
$('#roletable').parent().css('width', (w) + 'px');
$('#roletable').css('width', (w-40) + 'px');
$('#roletable').find('tbody').html('');
$('#roletable').find('thead').html('');
if (result.head.length > 0) {
var s = '<tr>';
for (var i = 0; i < result.head.length; i++) {
s += ('<th>' + result.head[i] + '</th>');
s += ('<th style="width:160px;">' + result.head[i] + '</th>');
}
s += '</tr>';
......@@ -111,11 +122,11 @@
var s = '<tr>';
var obj = result.data[i];
s += ('<td>' + (obj.category_simple_name == '' ? '空' : obj.category_simple_name) + '</td>');
s += ('<td style="width:160px;">' + (obj.category_simple_name == '' ? '空' : obj.category_simple_name) + '</td>');
if (obj.list.length > 0) {
for (var j = 0; j < obj.list.length; j++) {
s += ('<td><a onclick="showdetail(\'' + obj.category_simple_name + '\',\'' + result.head[j + 1] +'\')">' + obj.list[j] + '</a></td>')
s += ('<td style="width:160px;"><a onclick="showdetail(\'' + obj.category_simple_name + '\',\'' + result.head[j + 1] +'\')">' + obj.list[j] + '</a></td>')
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment