Sfoglia il codice sorgente

调试清单js,测试bug

laiguoran 3 anni fa
parent
commit
936e182c84
2 ha cambiato i file con 9 aggiunte e 12 eliminazioni
  1. 5 1
      app/controller/material_controller.js
  2. 4 11
      app/public/js/material_list.js

+ 5 - 1
app/controller/material_controller.js

@@ -372,7 +372,11 @@ module.exports = app => {
                     for (const [mindex, mb] of renderData.materialBillsData.entries()) {
                         const result = await ctx.service.materialBillsHistory.getByMbId(ctx.material.id, ctx.material.order, mb.id);
                         _.forEach(result, function(value, key) {
-                            renderData.materialBillsData[mindex][key] = result ? result[key] : null;
+                            if (key === 'mb_id') {
+                                renderData.materialBillsData[mindex].id = result ? result[key] : null;
+                            } else {
+                                renderData.materialBillsData[mindex][key] = result ? result[key] : null;
+                            }
                         });
                     }
                 }

+ 4 - 11
app/public/js/material_list.js

@@ -24,17 +24,10 @@ function findNotJoinLeafXmj(x, type = '') {
 }
 
 function getMpSpreadByMBData(id) {
-    let info = null;
-    if (parseInt(getStageId()) === parseInt(stage_order)) {
-        info = materialBillsData.find(function (item) {
-            return item.id === parseInt(id);
-        });
-    } else {
-        info = materialBillsData.find(function (item) {
-            return item.mb_id === parseInt(id);
-        });
-    }
-    console.log(info, id, parseInt(getStageId()), parseInt(stage_order));
+    const info = materialBillsData.find(function (item) {
+        return item.id === parseInt(id);
+    });
+    console.log(info);
     return info ? info.m_spread : 0;
 }