浏览代码

新增和修改后实时更新前端的“特殊要求"

zhangy 3 年之前
父节点
当前提交
0ebd3c1bb6
共有 1 个文件被更改,包括 39 次插入2 次删除
  1. 39 2
      src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

+ 39 - 2
src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

@@ -1614,6 +1614,37 @@ export default {
                                 type: 'success'
                                 type: 'success'
                                 });
                                 });
                             that.gethxcfDate(row);
                             that.gethxcfDate(row);
+                            if (row.dataByGmid) {
+                              for (let item of SubmitData) {
+                                row.dataByGmid.push({
+                                  chemCode: item.chemCode,
+                                  gmid: item.gmid,
+                                  id: {
+                                    chemCode: item.chemCode,
+                                    gmid: item.gmid
+                                  },
+                                  nkStdMax: item.nkStdMax,
+                                  nkStdMin: item.nkStdMin
+                                });
+                              }
+                              // row.dataByGmid.concat(SubmitData);
+                            } else {
+                              let arr = [];
+                              for (let item of SubmitData) {
+                                arr.push({
+                                  chemCode: item.chemCode,
+                                  gmid: item.gmid,
+                                  id: {
+                                    chemCode: item.chemCode,
+                                    gmid: item.gmid
+                                  },
+                                  nkStdMax: item.nkStdMax,
+                                  nkStdMin: item.nkStdMin
+                                });
+                              }
+                              row.dataByGmid = arr;
+                              row.teshu = '是';
+                            }
                             } else {
                             } else {
                               that.$message.error(res.message);
                               that.$message.error(res.message);
                             }
                             }
@@ -1690,7 +1721,7 @@ export default {
           }
           }
         this.gridData.unshift(list)
         this.gridData.unshift(list)
       },
       },
-      delData () {
+      delData (row) {
           let that = this;
           let that = this;
           let gridData = that.gridData;
           let gridData = that.gridData;
           // let val = that.hxcfSelection;
           // let val = that.hxcfSelection;
@@ -1719,7 +1750,13 @@ export default {
                         gridData.splice(i, 1)
                         gridData.splice(i, 1)
                         }
                         }
                     })
                     })
+                    row.dataByGmid.forEach((v, i) => {
+                    if (val.chemcode === v.chemCode) {
+                        row.dataByGmid.splice(i, 1)
+                        }
+                    })
                 })
                 })
+                row.teshu = row.dataByGmid ? (row.dataByGmid.length > 0 ? '是' : '否') : '否'
                  // this.$refs.multipleTable.clearSelection();
                  // this.$refs.multipleTable.clearSelection();
             }
             }
         });
         });
@@ -2645,7 +2682,7 @@ export default {
         // 订单类型下拉框选择事件
         // 订单类型下拉框选择事件
         isMileageCardOrder (val) {
         isMileageCardOrder (val) {
           let that = this;
           let that = this;
-          if (val == '1') {
+          if (val === '1') {
            that.dialog.editorBox.form.data.deliveryDate = '2020-01-01';
            that.dialog.editorBox.form.data.deliveryDate = '2020-01-01';
            that.dialog.editorBox.form.data.jhTime = '2020-01-01';
            that.dialog.editorBox.form.data.jhTime = '2020-01-01';
            that.dialog.editorBox.form.data.dateEnable = true;
            that.dialog.editorBox.form.data.dateEnable = true;