Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js
===================================================================
diff -u -r33393 -r33406
--- ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js (.../qualityMonitoringView.js) (revision 33393)
+++ ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js (.../qualityMonitoringView.js) (revision 33406)
@@ -110,6 +110,9 @@
}
}
}
+ if (!tableHeader) {
+ return {}
+ }
var fixedColumnIndex = 0;
if (tableHeader.indexOf('日期') >= 0) {
fixedColumnIndex += 1;
@@ -248,24 +251,21 @@
for (var materialName in tableBody[dateTime][goodsName]) {
var tdHtml = "";
var arr = tableBody[dateTime][goodsName][materialName];
+ var newAmount = arr[0].amount;
+ var newRegisterMaterialAmount = arr[0].registerMaterialAmount;
if (dateTime !== '合计') {
if (result.scope == "材料和器械包") {
- tdHtml += "
" + arr[0].materialName + " | ";
- if (arr[0].materialName !== '空' && arr[0].materialName !== '') {
- tdHtml += " | ";
- tdHtml += "" + arr[0].amount + " | ";
- amount2 += arr[0].amount;
- } else {
- tdHtml += "" + arr[0].amount + " | ";
- tdHtml += " | ";
- amount1 += arr[0].amount;
- }
+ tdHtml += "" + arr[0].materialName + " | ";
+ tdHtml += "" + newAmount + " | ";
+ tdHtml += "" + newRegisterMaterialAmount + " | ";
+ amount1 += newAmount;
+ amount2 += newRegisterMaterialAmount;
} else if (result.scope == "器械包") {
- tdHtml += "" + arr[0].amount + " | ";
- amount1 += arr[0].amount;
+ tdHtml += "" + newAmount + " | ";
+ amount1 += newAmount;
} else if (result.scope == "材料") {
- tdHtml += "" + arr[0].amount + " | ";
- amount2 += arr[0].amount;
+ tdHtml += "" + newRegisterMaterialAmount + " | ";
+ amount2 += newRegisterMaterialAmount;
}
}
if (result.dataType == '监测范围为材料和器械包的质量监测数据') {
@@ -382,23 +382,39 @@
if (result.fixedColumnNames.indexOf('材料') >= 0) {
tdHtml += "" + arr[0].materialName + " | ";
}
+ var newAmount = arr[0].amount;
+ var newRegisterMaterialAmount = arr[0].registerMaterialAmount;
if (dateTime !== '合计') {
if (result.scope == "材料和器械包") {
- if (result.fixedColumnNames.indexOf('材料') >= 0 && arr[0].materialName !== '空' && arr[0].materialName !== '') {
- tdHtml += " | ";
- tdHtml += "" + arr[0].amount + " | ";
- amount2 += arr[0].amount;
+ tdHtml += "" + newAmount + " | ";
+ tdHtml += "" + newRegisterMaterialAmount + " | ";
+ if (result.dataType == '定期监测') {
+ if (dateTime == '合格' || dateTime == '不合格') {
+ amount1 += newAmount;
+ amount2 += newRegisterMaterialAmount;
+ }
} else {
- tdHtml += "" + arr[0].amount + " | ";
- tdHtml += " | ";
- amount1 += arr[0].amount;
+ amount1 += newAmount;
+ amount2 += newRegisterMaterialAmount;
}
} else if (result.scope == "器械包") {
- tdHtml += "" + arr[0].amount + " | ";
- amount1 += arr[0].amount;
+ tdHtml += "" + newAmount + " | ";
+ if (result.dataType == '定期监测') {
+ if (dateTime == '合格' || dateTime == '不合格') {
+ amount1 += newAmount;
+ }
+ } else {
+ amount1 += newAmount;
+ }
} else if (result.scope == "材料") {
- tdHtml += "" + arr[0].amount + " | ";
- amount2 += arr[0].amount;
+ tdHtml += "" + newRegisterMaterialAmount + " | ";
+ if (result.dataType == '定期监测') {
+ if (dateTime == '合格' || dateTime == '不合格') {
+ amount2 += newRegisterMaterialAmount;
+ }
+ } else {
+ amount2 += newRegisterMaterialAmount;
+ }
}
}
if (result.dataType == '质量监测') {