Commit 578d072a by guanzhenshan

完善添加描述功能

parent 5f3ec9ca
......@@ -94,6 +94,15 @@
for (var i in result.data) {
//描述
var objDesc;
for (var d in result.listdesc) {
if (result.listdesc[d]['month'] == result.data[i]["month"]) {
objDesc = result.listdesc[d];
}
}
//值
for (var c in result.data[i]) {
if (c == result.head[h].item1) {
var str_template = result.head[h].item3;
......@@ -129,11 +138,19 @@
col_2 = col_2.replace('{' + result.head[h].item1 + '}', result.data[i][c]);
col_2 = col_2.replace('{' + result.head[h].item1 + '_}', result.data[i][c + '_']);
var temps = '';
if (objDesc != undefined && objDesc != null) {
str_template = str_template.replace('{' + result.head[h].item1 + '_desc}', "说明:" + objDesc[result.head[h].item1]);
temps = objDesc[result.head[h].item1];
}
else {
str_template = str_template.replace('{'+result.head[h].item1 + '_desc}', "说明:无");
}
s += '<td>' + str_template.replace('{' + result.head[h].item1 + '+}', col_2) + '<a style="color:#bbb;" onclick=\"EditDescription(\'' + result.head[h].item1 + '\',\'' + temps+'\',\'' + result.data[i]['month'] + '\')\">修改说明</a></td>';
s += '<td>' + str_template.replace('{' + result.head[h].item1 + '+}', col_2) + '</td>';
//合计
s += ('<td>' + result.data[i][c] + '<img src="/img/icon-quetion.png" style="width:18px;" /><img src="/img/icon-edit.png" style="width:18px;margin-left:5px;" title="修改取数说明" onclick="EditDescription()" /></td>');
s += ('<td>' + result.data[i][c] + '</td>');
break;
......
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