浏览代码

年计划合计问题

QuietShadow 3 年之前
父节点
当前提交
8a57946d64

+ 8 - 2
src/views/energyPlan/components/supplyAndDemand/planProjectCoke.vue

@@ -944,15 +944,21 @@ export default {
                 switch (0) {
                     case index % 7:
                     that.tableData[i].weight.forEach((item, key) => {
-                        weiItem = (isNaN(item['AT3010']) ? 0 : item['AT3010']);
+                        weiItem = (isNaN(item['AT3025']) ? 0 : item['AT3025']);
                         lineTotal += Number(weiItem);
                     });
                     break;
                     case index % 6:
                     that.tableData[i].weight.forEach((item, key) => {
-                        weiItem = (isNaN(item['AT3009']) ? 0 : item['AT3009']);
+                        weiItem = (isNaN(item['AT3010']) ? 0 : item['AT3010']);
                         lineTotal += Number(weiItem);
                     });
+                    break;
+                    case index % 5:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3009']) ? 0 : item['AT3009']);
+                        lineTotal += Number(weiItem);
+                    });
                     break;
                     default:
                     that.tableData[i].weight.forEach((item, key) => {

+ 13 - 13
src/views/energyPlan/components/supplyAndDemand/planProjectMachineCoke.vue

@@ -1254,8 +1254,8 @@ export default {
                     priductIdTotal3 += Number(weiItem);
                 });
             };
-            sums[index] = (index % 16 === 0) ? priductIdTotal3 : (
-            (index % 13 === 0) ? priductIdTotal2 : (index % 10 === 0) ? priductIdTotal1 : priductIdTotal);
+            sums[index] = (index % 17 === 0) ? priductIdTotal3 : (
+            (index % 14 === 0) ? priductIdTotal2 : (index % 10 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             case 'weight1':
             priductIdTotal = 0;
@@ -1280,7 +1280,7 @@ export default {
                     priductIdTotal3 += Number(weiItem);
                 });
             };
-            sums[index] = (index % 14 === 0) ? priductIdTotal3 : (
+            sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
             (index % 11 === 0) ? priductIdTotal2 : (index % 8 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             case 'weight2':
@@ -1306,7 +1306,7 @@ export default {
                         priductIdTotal3 += Number(weiItem);
                     });
                 };
-            sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
+            sums[index] = (index % 16 === 0) ? priductIdTotal3 : (
             (index % 12 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             case 'weight':
@@ -1332,8 +1332,8 @@ export default {
                         priductIdTotal3 += Number(weiItem);
                     });
                 };
-            sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
-            (index % 12 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
+            sums[index] = (index % 13 === 0) ? priductIdTotal2 : (
+            (index % 13 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             default:
             break;
@@ -1426,7 +1426,7 @@ export default {
                         // weight: that.tableFormDataObj[key].weight[i][keyname],
                         weight1: that.tableFormDataObj[key].weight1[i][keyname],
                         weight2: that.tableFormDataObj[key].weight2[i][keyname],
-                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        weight: that.tableFormDataObj[key].weight[i][keyname] ? '0' : that.tableFormDataObj[key].weight[i][keyname],
                         memo: memoArr[i],
                         unit: that.tableFormDataObj[key].unit,
                         parentid: that.filterForm.data.parentid,
@@ -1588,10 +1588,10 @@ export default {
                                 [i]: [i]
                             });
                             subtotalArr.push({
-                                [item[i].productid]: item[i].weight1 + item[i].weight2
+                                [item[i].productid]: item[i].weight1 + item[i].weight2 - item[i].weight
                                 });
                             // sum += item[i].weight + item[i].weight1 + item[i].weight2;
-                            sum += item[i].weight1 + item[i].weight2;
+                            sum += item[i].weight1 + item[i].weight2 - item[i].weight;
                             };
                             arr.push({
                                 seq: index,
@@ -1822,7 +1822,7 @@ export default {
                 // 取消选择时赋初始值
                 for (let weiIndex in that.tableData[item.seq].weight1) {
                     for (let weiKey in that.tableData[item.seq].weight1[weiIndex]) {
-                        // that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
                         that.tableData[item.seq].weight1[weiIndex][weiKey] = that.originalData[item.seq].weight1[weiIndex][weiKey];
                         that.tableData[item.seq].weight2[weiIndex][weiKey] = that.originalData[item.seq].weight2[weiIndex][weiKey];
                     }
@@ -1941,9 +1941,9 @@ export default {
                                 for (let keyname in that.tableFormDataObj[key].weight1[i]) {
                                     SubmitData.push({
                                     // weight: that.tableFormDataObj[key].weight[i][keyname],
-                                    weight1: that.tableFormDataObj[key].weight1[i][keyname] === '' ? '0' : that.tableFormDataObj[key].weight1[i][keyname],
-                                    weight2: that.tableFormDataObj[key].weight2[i][keyname] === '' ? '0' : that.tableFormDataObj[key].weight2[i][keyname],
-                                    weight: that.tableFormDataObj[key].weight[i][keyname] === '' ? '0' : that.tableFormDataObj[key].weight[i][keyname],
+                                    weight1: that.tableFormDataObj[key].weight1[i][keyname] ? that.tableFormDataObj[key].weight1[i][keyname] : '0',
+                                    weight2: that.tableFormDataObj[key].weight2[i][keyname] ? that.tableFormDataObj[key].weight2[i][keyname] : '0',
+                                    weight: that.tableFormDataObj[key].weight[i][keyname] ? that.tableFormDataObj[key].weight[i][keyname] : '0',
                                     no: that.tableFormDataObj[key].no[i][i],
                                     memo: memoArr[i],
                                     cjsj: that.tableFormDataObj[key].cjsj,