Pārlūkot izejas kodu

王子文 月报Cracker Utility Consumption, Aromatics Utility Consumption修改

wangggziwen 2 gadi atpakaļ
vecāks
revīzija
0587f3f6f8

+ 20 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyProductionReportController.java

@@ -36,6 +36,26 @@ public class TMonthlyProductionReportController extends BaseController
     @Autowired
     private ITMonthlyProductionReportService tMonthlyProductionReportService;
 
+    /**
+     * 修改Aromatics Utility Consumption
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/aromaticsUtilityConsumption")
+    public AjaxResult editAromaticsUtilityConsumption(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateAromaticsUtilityConsumption(monthlyUpdateVO));
+    }
+
+    /**
+     * 修改Cracker Utility Consumption
+     */
+    @PreAuthorize("@ss.hasPermi('production:monthly:edit')")
+    @PutMapping(value = "/crackerUtilityConsumption")
+    public AjaxResult editCrackerUtilityConsumption(@RequestBody MonthlyUpdateVO monthlyUpdateVO)
+    {
+        return toAjax(tMonthlyProductionReportService.updateCrackerUtilityConsumption(monthlyUpdateVO));
+    }
+
     /**
      * 修改Eligible Product Rate
      */

+ 145 - 13
master/src/main/java/com/ruoyi/project/production/mapper/TMonthlyProductionReportMapper.java

@@ -64,51 +64,183 @@ public interface TMonthlyProductionReportMapper
      */
     public int deleteTMonthlyProductionReportByIds(Long[] ids);
 
+
+    /**
+     * 按年份查询Cracker Raw Material
+     */
     public List<TMonthlyProductionReport> selectCrackerRawMaterialByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Output Product
+     */
     public List<TMonthlyProductionReport> selectCrackerOutputProductByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics RawM aterial
+     */
     public List<TMonthlyProductionReport> selectAromaticsRawMaterialByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Output Product
+     */
     public List<TMonthlyProductionReport> selectAromaticsOutputProductByYear(Long year);
+
+    /**
+     * 按年份查询Eligible Product Rate
+     */
     public List<TMonthlyProductionReport> selectEligibleProductRateByYear(Long year);
+
+    /**
+     * 按年份查询Product Yield
+     */
     public List<TMonthlyProductionReport> selectProductYieldByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Utility Consumption
+     */
     public List<TMonthlyProductionReport> selectCrackerUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Energy Consumption
+     */
     public List<TMonthlyProductionReport> selectCrackerEnergyConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Utility Consumption
+     */
     public List<TMonthlyProductionReport> selectAromaticsUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Energy Consumption
+     */
     public List<TMonthlyProductionReport> selectAromaticsEnergyConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Plant Load
+     */
     public List<TMonthlyProductionReport> selectPlantLoadByYear(Long year);
+
+    /**
+     * 按年份查询Cost Fr Ethylene
+     */
     public List<TMonthlyProductionReport> selectCostFrEthyleneByYear(Long year);
+
+    /**
+     * 按年份查询Runing Rate
+     */
     public List<TMonthlyProductionReport> selectRuningRateByYear(Long year);
+
+    /**
+     * 按年份查询ShoudownHour
+     */
     public List<TMonthlyProductionReport> selectShoudownHourByYear(Long year);
+
+    /**
+     * 按年份查询Otherside
+     */
     public List<TMonthlyProductionReport> selectOthersideByYear(Long year);
+
+    /**
+     * 按年份查询Chemical Consume
+     */
     public List<TMonthlyProductionReport> selectChemicalConsumeByYear(Long year);
+
+    /**
+     * 按年份查询SCTU Utility Consumption
+     */
     public List<TMonthlyProductionReport> selectSCTUUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询SUB Utility Consumption
+     */
     public List<TMonthlyProductionReport> selectSUBUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询SCTF Utility Consumption
+     */
     public List<TMonthlyProductionReport> selectSCTFUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询KBI
+     */
     public List<TMonthlyProductionReport> selectKbiByYear(Long year);
+
+    /**
+     * 按年份查询Summary
+     */
     public List<TMonthlyProductionReport> selectSummarByYear(Long year);
 
+    /**
+     * 查询趋势分析数据
+     * fromYear==toYear
+     *
+     * @param item      指标
+     * @param fromYear  开始年份
+     * @param fromMonth 开始月份
+     * @param toYear    截止年份
+     * @param toMonth   截止月份
+     * @return  item从开始日期至结束日期的数据集合
+     */
     @Select(" select d.${item} as valueData, concat(concat(d.REPORT_YEAR, '-'), d.REPORT_MONTH) as dateData, " +
             " d.REPORT_MONTH, d.REPORT_YEAR from t_monthly_production_report d " +
             " where (d.REPORT_YEAR = ${fromYear} and d.REPORT_MONTH >= ${fromMonth}) " +
             " and (d.REPORT_YEAR = ${toYear} and d.REPORT_MONTH <= ${toMonth}) " +
             " ORDER by d.REPORT_YEAR, d.REPORT_MONTH ")
-    public List<MonthlyAnalysisDataVO> selectAnalysisDataSameYear(@Param("item") String item,
-                                                   @Param("fromYear") int fromYear,
-                                                   @Param("fromMonth") int fromMonth,
-                                                   @Param("toYear") int toYear,
-                                                   @Param("toMonth") int toMonth);
+    public List<MonthlyAnalysisDataVO> selectAnalysisDataSameYear(
+            @Param("item") String item,
+            @Param("fromYear") int fromYear,
+            @Param("fromMonth") int fromMonth,
+            @Param("toYear") int toYear,
+            @Param("toMonth") int toMonth
+    );
 
+    /**
+     * 查询趋势分析数据
+     * fromYear!=toYear
+     *
+     * @param item      指标
+     * @param fromYear  开始年份
+     * @param fromMonth 开始月份
+     * @param toYear    截止年份
+     * @param toMonth   截止月份
+     * @return  item从开始日期至结束日期的数据集合
+     */
     @Select(" select d.${item} as valueData, concat(concat(d.REPORT_YEAR, '-'), d.REPORT_MONTH) as dateData, " +
             " d.REPORT_MONTH, d.REPORT_YEAR from t_monthly_production_report d " +
             " where (d.REPORT_YEAR = ${fromYear} and d.REPORT_MONTH >= ${fromMonth}) " +
             " or (d.REPORT_YEAR = ${toYear} and d.REPORT_MONTH <= ${toMonth}) " +
             " ORDER by d.REPORT_YEAR, d.REPORT_MONTH ")
-    public List<MonthlyAnalysisDataVO> selectAnalysisDataDiffYear(@Param("item") String item,
-                                                           @Param("fromYear") int fromYear,
-                                                           @Param("fromMonth") int fromMonth,
-                                                           @Param("toYear") int toYear,
-                                                           @Param("toMonth") int toMonth);
-
-    public int selectTMonthlyProductionReportCountByDate(@Param("reportYear")int reportYear,
-                                                  @Param("reportMonth")int reportMonth);
+    public List<MonthlyAnalysisDataVO> selectAnalysisDataDiffYear(
+            @Param("item") String item,
+            @Param("fromYear") int fromYear,
+            @Param("fromMonth") int fromMonth,
+            @Param("toYear") int toYear,
+            @Param("toMonth") int toMonth
+    );
+
+    /**
+     * 查询月报记录是否已存在
+     * 返回结果==0表示不存在,>=0表示已存在
+     *
+     * @param reportYear    报告年份
+     * @param reportMonth   报告月份
+     * @return
+     */
+    public int selectTMonthlyProductionReportCountByDate(
+            @Param("reportYear")int reportYear,
+            @Param("reportMonth")int reportMonth
+    );
+
+    /**
+     * 查询月报
+     *
+     * @param reportYear    报告年份
+     * @param reportMonth   报告月份
+     * @return
+     */
+    public TMonthlyProductionReport selectTMonthlyProductionReportByDate(
+            @Param("reportYear")int reportYear,
+            @Param("reportMonth")int reportMonth
+    );
 
 }

+ 99 - 0
master/src/main/java/com/ruoyi/project/production/service/ITMonthlyProductionReportService.java

@@ -64,32 +64,131 @@ public interface ITMonthlyProductionReportService
      */
     public int deleteTMonthlyProductionReportById(Long id);
 
+    /**
+     * 按年份查询Cracker Raw Material
+     */
     public List<MonthlyProductionReportVO> selectCrackerRawMaterialByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Output Product
+     */
     public List<MonthlyProductionReportVO> selectCrackerOutputProductByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Raw Material
+     */
     public List<MonthlyProductionReportVO> selectAromaticsRawMaterialByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Output Product
+     */
     public List<MonthlyProductionReportVO> selectAromaticsOutputProductByYear(Long year);
+
+    /**
+     * 按年份查询Eligible Product Rate
+     */
     public List<MonthlyProductionReportVO> selectEligibleProductRateByYear(Long year);
+
+    /**
+     * 按年份查询Product Yield
+     */
     public List<MonthlyProductionReportVO> selectProductYieldByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Utility Consumption
+     */
     public List<MonthlyProductionReportVO> selectCrackerUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Cracker Energy Consumption
+     */
     public List<MonthlyProductionReportVO> selectCrackerEnergyConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Utility Consumption
+     */
     public List<MonthlyProductionReportVO> selectAromaticsUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Aromatics Energy Consumption
+     */
     public List<MonthlyProductionReportVO> selectAromaticsEnergyConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询Plant Load
+     */
     public List<MonthlyProductionReportVO> selectPlantLoadByYear(Long year);
+
+    /**
+     * 按年份查询Cost Fr Ethylene
+     */
     public List<MonthlyProductionReportVO> selectCostFrEthyleneByYear(Long year);
+
+    /**
+     * 按年份查询Runing Rate
+     */
     public List<MonthlyProductionReportVO> selectRuningRateByYear(Long year);
+
+    /**
+     * 按年份查询Shoudown Hour
+     */
     public List<MonthlyProductionReportVO> selectShoudownHourByYear(Long year);
+
+    /**
+     * 按年份查询Otherside
+     */
     public List<MonthlyProductionReportVO> selectOthersideByYear(Long year);
+
+    /**
+     * 按年份查询Chemical Consume
+     */
     public List<MonthlyProductionReportVO> selectChemicalConsumeByYear(Long year);
+
+    /**
+     * 按年份查询SCTUUtility Consumption
+     */
     public List<MonthlyProductionReportVO> selectSCTUUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询SUB Utility Consumption
+     */
     public List<MonthlyProductionReportVO> selectSUBUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询SCTF Utility Consumption
+     */
     public List<MonthlyProductionReportVO> selectSCTFUtilityConsumptionByYear(Long year);
+
+    /**
+     * 按年份查询KBI
+     */
     public List<MonthlyProductionReportVO> selectKbiByYear(Long year);
+
+    /**
+     * 按年份查询Summary
+     */
     public List<MonthlyProductionReportVO> selectSummaryByYear(Long year);
 
+    /**
+     * 查询趋势分析数据
+     *
+     * @param monthlyAnalysisQueryVO 查询参数
+     * @return
+     */
     List<MonthlyAnalysisDataVO> selectAnalysisData(MonthlyAnalysisQueryVO monthlyAnalysisQueryVO);
 
     /**
      * 修改Eligible Product Rate
      */
     public int updateEligibleProductRate(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改Cracker Utility Consumption
+     */
+    public int updateCrackerUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO);
+
+    /**
+     * 修改Aromatics Utility Consumption
+     */
+    public int updateAromaticsUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO);
 }

+ 7 - 7
master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java

@@ -8,7 +8,7 @@ import java.util.List;
 
 import com.ruoyi.project.production.controller.vo.DailyAnalysisDataVO;
 import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
-import com.ruoyi.project.production.service.impl.thread.SyncMonthlyThread;
+import com.ruoyi.project.production.service.impl.thread.SyncAfterDailyUpdateThread;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -86,12 +86,12 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
         int result = tDailyProductionReportMapper.updateTDailyProductionReport(tDailyProductionReport);
         if (result > 0) {
             // 同步更新月报数据
-            SyncMonthlyThread syncMonthlyThread = new SyncMonthlyThread(
+            SyncAfterDailyUpdateThread syncAfterDailyUpdateThread = new SyncAfterDailyUpdateThread(
                     tDailyProductionReport.getReportDate(),
                     this.tDailyProductionReportMapper,
                     this.tMonthlyProductionReportMapper
             );
-            syncMonthlyThread.run();
+            syncAfterDailyUpdateThread.run();
         }
         return result;
     }
@@ -798,22 +798,22 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
                 tDailyProductionReportMapper.updateTDailyProductionReportByReportDate(tDailyProductionReport);
                 message = this.reportDateFormatter(tDailyProductionReport.getReportDate()) + "生产日报已更新!";
                 // 同步更新月报数据
-                SyncMonthlyThread syncMonthlyThread = new SyncMonthlyThread(
+                SyncAfterDailyUpdateThread syncAfterDailyUpdateThread = new SyncAfterDailyUpdateThread(
                         tDailyProductionReport.getReportDate(),
                         this.tDailyProductionReportMapper,
                         this.tMonthlyProductionReportMapper
                 );
-                syncMonthlyThread.run();
+                syncAfterDailyUpdateThread.run();
             } else {
                 tDailyProductionReportMapper.insertTDailyProductionReport(tDailyProductionReport);
                 message = this.reportDateFormatter(tDailyProductionReport.getReportDate()) + "生产日报已上传!";
                 // 同步更新月报数据
-                SyncMonthlyThread syncMonthlyThread = new SyncMonthlyThread(
+                SyncAfterDailyUpdateThread syncAfterDailyUpdateThread = new SyncAfterDailyUpdateThread(
                         tDailyProductionReport.getReportDate(),
                         this.tDailyProductionReportMapper,
                         this.tMonthlyProductionReportMapper
                 );
-                syncMonthlyThread.run();
+                syncAfterDailyUpdateThread.run();
             }
         } catch (Exception e) {
             message = "导入失败,请联系管理员!";

+ 172 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyProductionReportServiceImpl.java

@@ -11,6 +11,8 @@ import java.util.List;
 import com.ruoyi.project.production.controller.vo.MonthlyAnalysisDataVO;
 import com.ruoyi.project.production.controller.vo.MonthlyAnalysisQueryVO;
 import com.ruoyi.project.production.controller.vo.MonthlyUpdateVO;
+import com.ruoyi.project.production.service.impl.thread.SyncAfterDailyUpdateThread;
+import com.ruoyi.project.production.service.impl.thread.SyncAfterMonthlyUpdateThread;
 import com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -1407,4 +1409,174 @@ public class TMonthlyProductionReportServiceImpl implements ITMonthlyProductionR
         }
         return affectedRows;
     }
+
+    /**
+     * 修改Cracker Utility Consumption
+     */
+    @Override
+    public int updateCrackerUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO) {
+        // 受影响行数
+        int affectedRows = 0;
+        List<MonthlyProductionReportVO> tableData = monthlyUpdateVO.getTableData();
+        long year = monthlyUpdateVO.getYear();
+        Class clazz = null;
+        try {
+            clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        for (MonthlyProductionReportVO tableDatum : tableData) {
+            for (int i = 0; i < 12; i++) {
+                TMonthlyProductionReport report = new TMonthlyProductionReport();
+                report.setReportMonth((long)(i + 1));
+                report.setReportYear(year);
+                Method getMethod = null;
+                String monthValue = null;
+                try {
+                    if (i == 0) { getMethod =  clazz.getDeclaredMethod("getJan"); }
+                    if (i == 1) { getMethod =  clazz.getDeclaredMethod("getFeb"); }
+                    if (i == 2) { getMethod =  clazz.getDeclaredMethod("getMar"); }
+                    if (i == 3) { getMethod =  clazz.getDeclaredMethod("getApr"); }
+                    if (i == 4) { getMethod =  clazz.getDeclaredMethod("getMay"); }
+                    if (i == 5) { getMethod =  clazz.getDeclaredMethod("getJun"); }
+                    if (i == 6) { getMethod =  clazz.getDeclaredMethod("getJul"); }
+                    if (i == 7) { getMethod =  clazz.getDeclaredMethod("getAug"); }
+                    if (i == 8) { getMethod =  clazz.getDeclaredMethod("getSep"); }
+                    if (i == 9) { getMethod =  clazz.getDeclaredMethod("getOct"); }
+                    if (i == 10) { getMethod =  clazz.getDeclaredMethod("getNov"); }
+                    if (i == 11) { getMethod =  clazz.getDeclaredMethod("getDec"); }
+                    monthValue = (String) getMethod.invoke(tableDatum);
+                } catch (NoSuchMethodException e1){
+                    e1.printStackTrace();
+                } catch (IllegalAccessException e2) {
+                    e2.printStackTrace();
+                } catch (InvocationTargetException e3) {
+                    e3.printStackTrace();
+                }
+                if (monthValue == null) {
+                    continue;
+                }
+                if ("cracker_consumption_ia".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionIa(monthValue);
+                }
+                if ("cracker_consumption_pww".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionPww(monthValue);
+                }
+                if ("cracker_consumption_cnww".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionCnww(monthValue);
+                }
+                if ("cracker_consumption_dww".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionDww(monthValue);
+                }
+                if ("cracker_consumption_wo".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionWo(monthValue);
+                }
+                if ("cracker_consumption_pw".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionPw(monthValue);
+                }
+                if ("cracker_consumption_ng".equals(tableDatum.getDictLabel())) {
+                    report.setCrackerConsumptionNg(monthValue);
+                }
+                // 当前报告年份
+                int reportYear = Integer.parseInt(report.getReportYear().toString());
+                // 当前报告月份
+                int reportMonth = Integer.parseInt(report.getReportMonth().toString());
+                // 查询年份=reportYear,月份=reportMonth的月报数据
+                int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
+                if (count == 0) {   // 新增月报数据
+                    affectedRows += tMonthlyProductionReportMapper.insertTMonthlyProductionReport(report);
+                } else {    // 更新月报数据
+                    affectedRows += tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
+                }
+                // 修改cracker_consumption_ia后同步更新月报数据
+                if (report.getCrackerConsumptionIa() != null) {
+                    // 同步更新月报数据
+                    SyncAfterMonthlyUpdateThread thread = new SyncAfterMonthlyUpdateThread(
+                            (int)year,
+                            (i + 1),
+                            this.tMonthlyProductionReportMapper
+                    );
+                    thread.run();
+                }
+            }
+        }
+        return affectedRows;
+    }
+
+    /**
+     * 修改Aromatics Utility Consumption
+     */
+    @Override
+    public int updateAromaticsUtilityConsumption(MonthlyUpdateVO monthlyUpdateVO) {
+        // 受影响行数
+        int affectedRows = 0;
+        List<MonthlyProductionReportVO> tableData = monthlyUpdateVO.getTableData();
+        long year = monthlyUpdateVO.getYear();
+        Class clazz = null;
+        try {
+            clazz = Class.forName("com.ruoyi.project.production.service.impl.vo.MonthlyProductionReportVO");
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        for (MonthlyProductionReportVO tableDatum : tableData) {
+            for (int i = 0; i < 12; i++) {
+                TMonthlyProductionReport report = new TMonthlyProductionReport();
+                report.setReportMonth((long)(i + 1));
+                report.setReportYear(year);
+                Method getMethod = null;
+                String monthValue = null;
+                try {
+                    if (i == 0) { getMethod =  clazz.getDeclaredMethod("getJan"); }
+                    if (i == 1) { getMethod =  clazz.getDeclaredMethod("getFeb"); }
+                    if (i == 2) { getMethod =  clazz.getDeclaredMethod("getMar"); }
+                    if (i == 3) { getMethod =  clazz.getDeclaredMethod("getApr"); }
+                    if (i == 4) { getMethod =  clazz.getDeclaredMethod("getMay"); }
+                    if (i == 5) { getMethod =  clazz.getDeclaredMethod("getJun"); }
+                    if (i == 6) { getMethod =  clazz.getDeclaredMethod("getJul"); }
+                    if (i == 7) { getMethod =  clazz.getDeclaredMethod("getAug"); }
+                    if (i == 8) { getMethod =  clazz.getDeclaredMethod("getSep"); }
+                    if (i == 9) { getMethod =  clazz.getDeclaredMethod("getOct"); }
+                    if (i == 10) { getMethod =  clazz.getDeclaredMethod("getNov"); }
+                    if (i == 11) { getMethod =  clazz.getDeclaredMethod("getDec"); }
+                    monthValue = (String) getMethod.invoke(tableDatum);
+                } catch (NoSuchMethodException e1){
+                    e1.printStackTrace();
+                } catch (IllegalAccessException e2) {
+                    e2.printStackTrace();
+                } catch (InvocationTargetException e3) {
+                    e3.printStackTrace();
+                }
+                if (monthValue == null) {
+                    continue;
+                }
+                if ("aromatics_consumption_pw".equals(tableDatum.getDictLabel())) {
+                    report.setAromaticsConsumptionPw(monthValue);
+                }
+                if ("aromatics_consumption_cww".equals(tableDatum.getDictLabel())) {
+                    report.setAromaticsConsumptionCww(monthValue);
+                }
+                if ("aromatics_consumption_pww".equals(tableDatum.getDictLabel())) {
+                    report.setAromaticsConsumptionPww(monthValue);
+                }
+                if ("aromatics_consumption_dww".equals(tableDatum.getDictLabel())) {
+                    report.setAromaticsConsumptionDww(monthValue);
+                }
+                if ("aromatics_consumption_wl".equals(tableDatum.getDictLabel())) {
+                    report.setAromaticsConsumptionWl(monthValue);
+                }
+                // 当前报告年份
+                int reportYear = Integer.parseInt(report.getReportYear().toString());
+                // 当前报告月份
+                int reportMonth = Integer.parseInt(report.getReportMonth().toString());
+                // 查询年份=reportYear,月份=reportMonth的月报数据
+                int count = tMonthlyProductionReportMapper.selectTMonthlyProductionReportCountByDate(reportYear, reportMonth);
+                if (count == 0) {   // 新增月报数据
+                    affectedRows += tMonthlyProductionReportMapper.insertTMonthlyProductionReport(report);
+                } else {    // 更新月报数据
+                    affectedRows += tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
+                }
+            }
+        }
+        return affectedRows;
+    }
 }

+ 6 - 33
master/src/main/java/com/ruoyi/project/production/service/impl/thread/SyncMonthlyThread.java → master/src/main/java/com/ruoyi/project/production/service/impl/thread/SyncAfterDailyUpdateThread.java

@@ -10,11 +10,13 @@ import java.math.RoundingMode;
 import java.util.Date;
 
 /**
+ * 修改日报后同步更新数据
+ *
  * @author: Wang Zi Wen
  * @email: wangggziwen@163.com
  * @datetime: 2022/11/3 13:44
  */
-public class SyncMonthlyThread extends Thread {
+public class SyncAfterDailyUpdateThread extends Thread {
 
     private Date reportDate;
 
@@ -22,11 +24,11 @@ public class SyncMonthlyThread extends Thread {
 
     private TMonthlyProductionReportMapper tMonthlyProductionReportMapper;
 
-    public SyncMonthlyThread() {
+    public SyncAfterDailyUpdateThread() {
         super();
     }
 
-    public SyncMonthlyThread(
+    public SyncAfterDailyUpdateThread(
             Date reportDate,
             TDailyProductionReportMapper tDailyProductionReportMapper,
             TMonthlyProductionReportMapper tMonthlyProductionReportMapper) {
@@ -376,32 +378,6 @@ public class SyncMonthlyThread extends Thread {
         BigDecimal polishedConCracker = new BigDecimal(polishedConCrackerStr == null ? "0" : polishedConCrackerStr);
         BigDecimal turbineConCracker = new BigDecimal(turbineConCrackerStr == null ? "0" : turbineConCrackerStr);
         BigDecimal prodWaterCracker = new BigDecimal(prodWaterCrackerStr == null ? "0" : prodWaterCrackerStr);
-        BigDecimal crackerEnergyTeTeo = new BigDecimal("0");
-//        crackerEnergyTeTeo = (fuelGasOffgasCracker.multiply(new BigDecimal("1.2")))
-//                .add(shpCracker.multiply(new BigDecimal("0.092")))
-//                .add(hpCracker.multiply(new BigDecimal("0.088")))
-//                .add(mpCracker.multiply(new BigDecimal("0.08")))
-//                .add(lpCracker.multiply(new BigDecimal("0.066")))
-//                .add(electricityCracker.multiply(new BigDecimal("0.233")))
-//                .add(coolingWaterCracker.multiply(new BigDecimal("0.1")))
-//                .add((D93+D94).multiply(new BigDecimal("0.038")))
-//                .add(n2Cracker.multiply(new BigDecimal("0.15")))
-//                .add(hpBfwCracker.multiply(new BigDecimal("0.0092")))
-//                .add(polishedConCracker.multiply(new BigDecimal("0.0023")))
-//                .add(turbineConCracker.multiply(new BigDecimal("0.00365")))
-//                .add((D103+D104).multiply(new BigDecimal("0.00017")));
-        BigDecimal crackerEnergyTeTec = new BigDecimal("0");
-        crackerEnergyTeTec = crackerEnergyTeTeo.divide(new BigDecimal("0.7"), 2, RoundingMode.HALF_UP);
-        BigDecimal crackerEnergyEeKgeot = new BigDecimal("0");
-        if (ethylenProduced.compareTo(BigDecimal.ZERO) != 0) {
-            crackerEnergyEeKgeot = crackerEnergyTeTeo.divide(ethylenProduced, 2, RoundingMode.HALF_UP)
-                    .multiply(new BigDecimal("1000"));
-        }
-        BigDecimal crackerEnergyEeKgect = new BigDecimal("0");
-        if (ethylenProduced.compareTo(BigDecimal.ZERO) != 0) {
-            crackerEnergyEeKgect = crackerEnergyTeTec.divide(ethylenProduced, 2, RoundingMode.HALF_UP)
-                    .multiply(new BigDecimal("1000"));
-        }
         BigDecimal shpPguAeu = new BigDecimal(shpPguAeuStr == null ? "0" : shpPguAeuStr);
         BigDecimal hpPguAeu = new BigDecimal(hpPguAeuStr == null ? "0" : hpPguAeuStr);
         BigDecimal mpPguAeu = new BigDecimal(mpPguAeuStr == null ? "0" : mpPguAeuStr);
@@ -420,6 +396,7 @@ public class SyncMonthlyThread extends Thread {
                 .add(lpPguAeu.multiply(new BigDecimal("0.0666")))
                 .add(electricityPguAeu.multiply(new BigDecimal("0.233")))
                 .add(coolingWaterPguAeu.multiply(new BigDecimal("0.1")));
+        aromaticsEnergyTeTeo = aromaticsEnergyTeTeo.divide(new BigDecimal("1"), 2, RoundingMode.HALF_UP);
         BigDecimal aromaticsEnergyTeTec = new BigDecimal("0");
         aromaticsEnergyTeTec = aromaticsEnergyTeTeo.divide(new BigDecimal("0.7"), 2, RoundingMode.HALF_UP);
         BigDecimal aromaticsEnergyEeKgeot = new BigDecimal("0");
@@ -443,10 +420,6 @@ public class SyncMonthlyThread extends Thread {
         monthly.setTurbineConCracker(turbineConCracker.toString());
         monthly.setProdWaterCracker(prodWaterCracker.toString());
         monthly.setCrackerConsumptionOffgas(offgasProduced.toString());
-        monthly.setCrackerEnergyTeTeo(crackerEnergyTeTeo.toString());
-        monthly.setCrackerEnergyTeTec(crackerEnergyTeTec.toString());
-        monthly.setCrackerEnergyEeKgeot(crackerEnergyEeKgeot.toString());
-        monthly.setCrackerEnergyEeKgect(crackerEnergyEeKgect.toString());
         monthly.setShpPguAeu(shpPguAeu.toString());
         monthly.setHpPguAeu(hpPguAeu.toString());
         monthly.setMpPguAeu(mpPguAeu.toString());

+ 104 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/thread/SyncAfterMonthlyUpdateThread.java

@@ -0,0 +1,104 @@
+package com.ruoyi.project.production.service.impl.thread;
+
+import com.ruoyi.project.production.domain.TMonthlyProductionReport;
+import com.ruoyi.project.production.mapper.TMonthlyProductionReportMapper;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+/**
+ * 修改月报后同步更新数据
+ *
+ * @author: Wang Zi Wen
+ * @email: wangggziwen@163.com
+ * @datetime: 2022/11/15 10:24
+ */
+public class SyncAfterMonthlyUpdateThread extends Thread {
+
+    private int reportYear;
+
+    private int reportMonth;
+
+    private TMonthlyProductionReportMapper tMonthlyProductionReportMapper;
+
+    public SyncAfterMonthlyUpdateThread() {
+        super();
+    }
+
+    public SyncAfterMonthlyUpdateThread(
+            int reportYear,
+            int reportMonth,
+            TMonthlyProductionReportMapper tMonthlyProductionReportMapper) {
+        super();
+        this.reportYear = reportYear;
+        this.reportMonth = reportMonth;
+        this.tMonthlyProductionReportMapper = tMonthlyProductionReportMapper;
+    }
+
+    @Override
+    public void run() {
+        this.syncMonthlyData();
+    }
+
+    /**
+     * 同步更新月报数据
+     */
+    private void syncMonthlyData() {
+        TMonthlyProductionReport report = tMonthlyProductionReportMapper
+                .selectTMonthlyProductionReportByDate(this.reportYear, this.reportMonth);
+
+        BigDecimal ethylenProduced = new BigDecimal(report.getEthylenProduced());
+        BigDecimal fuelGasOffgasCracker  = new BigDecimal(report.getFuelGasOffgasCracker());
+        BigDecimal shpCracker = new BigDecimal(report.getShpCracker());
+        BigDecimal hpCracker = new BigDecimal(report.getHpCracker());
+        BigDecimal mpCracker = new BigDecimal(report.getMpCracker());
+        BigDecimal lpCracker = new BigDecimal(report.getLpCracker());
+        BigDecimal electricityCracker = new BigDecimal(report.getElectricityCracker());
+        BigDecimal coolingWaterCracker = new BigDecimal(report.getCoolingWaterCracker());
+        BigDecimal n2Cracker = new BigDecimal(report.getN2Cracker());
+        BigDecimal hpBfwCracker = new BigDecimal(report.getHpBfwCracker());
+        BigDecimal polishedConCracker = new BigDecimal(report.getPolishedConCracker());
+        BigDecimal turbineConCracker = new BigDecimal(report.getTurbineConCracker());
+        BigDecimal crackerConsumptionIa = new BigDecimal(report.getCrackerConsumptionIa());
+        BigDecimal paIaCracker = new BigDecimal(report.getPaIaCracker());
+        BigDecimal crackerConsumptionPw = new BigDecimal(report.getCrackerConsumptionPw());
+        BigDecimal prodWaterCracker = new BigDecimal(report.getProdWaterCracker());
+
+        BigDecimal crackerEnergyTeTeo = new BigDecimal("0");
+        crackerEnergyTeTeo = (fuelGasOffgasCracker.multiply(new BigDecimal("1.2")))
+                .add(shpCracker.multiply(new BigDecimal("0.092")))
+                .add(hpCracker.multiply(new BigDecimal("0.088")))
+                .add(mpCracker.multiply(new BigDecimal("0.08")))
+                .add(lpCracker.multiply(new BigDecimal("0.066")))
+                .add(electricityCracker.multiply(new BigDecimal("0.233")))
+                .add(coolingWaterCracker.multiply(new BigDecimal("0.1")))
+                .add((crackerConsumptionIa.add(paIaCracker)).multiply(new BigDecimal("0.038")))
+                .add(n2Cracker.multiply(new BigDecimal("0.15")))
+                .add(hpBfwCracker.multiply(new BigDecimal("0.0092")))
+                .add(polishedConCracker.multiply(new BigDecimal("0.0023")))
+                .add(turbineConCracker.multiply(new BigDecimal("0.00365")))
+                .add((crackerConsumptionPw.add(prodWaterCracker)).multiply(new BigDecimal("0.00017")));
+        crackerEnergyTeTeo = crackerEnergyTeTeo.divide(new BigDecimal("1"), 2, RoundingMode.HALF_UP);
+        BigDecimal crackerEnergyTeTec = new BigDecimal("0");
+        crackerEnergyTeTec = crackerEnergyTeTeo.divide(new BigDecimal("0.7"), 2, RoundingMode.HALF_UP);
+        BigDecimal crackerEnergyEeKgeot = new BigDecimal("0");
+        if (ethylenProduced.compareTo(BigDecimal.ZERO) != 0) {
+            crackerEnergyEeKgeot = crackerEnergyTeTeo.divide(ethylenProduced, 2, RoundingMode.HALF_UP)
+                    .multiply(new BigDecimal("1000"));
+        }
+        BigDecimal crackerEnergyEeKgect = new BigDecimal("0");
+        if (ethylenProduced.compareTo(BigDecimal.ZERO) != 0) {
+            crackerEnergyEeKgect = crackerEnergyTeTec.divide(ethylenProduced, 2, RoundingMode.HALF_UP)
+                    .multiply(new BigDecimal("1000"));
+        }
+
+        report.setCrackerEnergyTeTeo(crackerEnergyTeTeo.toString());
+        report.setCrackerEnergyTeTec(crackerEnergyTeTec.toString());
+        report.setCrackerEnergyEeKgeot(crackerEnergyEeKgeot.toString());
+        report.setCrackerEnergyEeKgect(crackerEnergyEeKgect.toString());
+
+        tMonthlyProductionReportMapper.updateTMonthlyProductionReport(report);
+
+    }
+
+}

+ 26 - 0
master/src/main/resources/mybatis/production/TMonthlyProductionReportMapper.xml

@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectCrackerOutputProductByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
             d.id, d.report_month, d.report_year, d.H2_PRODUCED, d.ETHYLEN_PRODUCED, d.PROPYLENE_PRODUCED,
@@ -148,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectAromaticsRawMaterialByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.pgu_rpg2, d.pgu_h2,
@@ -156,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectAromaticsOutputProductByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.aeu_benzene_produced, d.aeu_toluene_produced,
@@ -166,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectProductYieldByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year,
@@ -177,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectEligibleProductRateByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.c2_product_rate, d.c3_product_rate, d.c4s_product_rate
@@ -184,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectCrackerUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.fuel_gas_offgas_cracker, d.shp_cracker, d.hp_cracker,
@@ -195,6 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectCrackerEnergyConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.cracker_energy_te_teo, d.cracker_energy_te_tec,
@@ -203,6 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectAromaticsUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.shp_pgu_aeu, d.hp_pgu_aeu, d.mp_pgu_aeu, d.lp_pgu_aeu,
@@ -213,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectAromaticsEnergyConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year, d.aromatics_energy_te_teo, d.aromatics_energy_te_tec,
@@ -221,10 +230,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectPlantLoadByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectCostFrEthyleneByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectRuningRateByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectShoudownHourByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectOthersideByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult">
         select
                d.id, d.report_month, d.report_year,
@@ -233,11 +247,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              t_monthly_production_report d
         where d.report_year = #{year}
     </select>
+
     <select id="selectChemicalConsumeByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectSCTUUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectSUBUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectSCTFUtilityConsumptionByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectKbiByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
+
     <select id="selectSummaryByYear" parameterType="Long" resultMap="TMonthlyProductionReportResult"></select>
 
     <select id="selectTMonthlyProductionReportCountByDate" parameterType="int" resultType="int">
@@ -246,6 +266,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where d.report_month = #{reportMonth} and d.report_year = #{reportYear}
     </select>
 
+    <select id="selectTMonthlyProductionReportByDate" parameterType="int" resultMap="TMonthlyProductionReportResult">
+        select *
+        from t_monthly_production_report d
+        where d.report_month = #{reportMonth} and d.report_year = #{reportYear}
+    </select>
+
     <insert id="insertTMonthlyProductionReport" parameterType="TMonthlyProductionReport">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT SEQ_T_MONTHLY_REPORT.NEXTVAL as id FROM DUAL

+ 20 - 0
ui/src/api/production/monthly.js

@@ -1,5 +1,25 @@
 import request from '@/utils/request'
 
+// 修改Aromatics Utility Consumption
+export function updateAromaticsUtilityConsumption(data) {
+  return request({
+    url: '/production/monthly/aromaticsUtilityConsumption',
+    method: 'put',
+    data: data
+  })
+}
+
+
+// 修改Cracker Utility Consumption
+export function updateCrackerUtilityConsumption(data) {
+  return request({
+    url: '/production/monthly/crackerUtilityConsumption',
+    method: 'put',
+    data: data
+  })
+}
+
+
 // 修改Eligible Product Rate
 export function updateEligibleProductRate(data) {
   return request({

+ 826 - 78
ui/src/views/production/monthly/index.vue

@@ -291,6 +291,32 @@
       </el-table-column>
     </el-table>
     <!-- Cracker Utility Consumption -->
+    <div class="editDiv">
+      <el-button
+        :disabled="crackerUtilityConsumptionUpdating"
+        type="primary"
+        icon="el-icon-edit"
+        size="mini"
+        @click="handleCrackerUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('编辑Cracker Utility Consumption') }}</el-button>
+      <el-button
+        :disabled="!crackerUtilityConsumptionUpdating"
+        type="success"
+        icon="el-icon-check"
+        size="mini"
+        @click="handleConfirmCrackerUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('保存') }}</el-button>
+      <el-button
+        :disabled="!crackerUtilityConsumptionUpdating"
+        type="info"
+        icon="el-icon-close"
+        size="mini"
+        @click="handleCancelCrackerUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('取消') }}</el-button>
+    </div>
     <el-table border :data="tableCrackerUtilityConsumption" style="width: 100%;">
       <el-table-column label="Cracker Utility Consumption">
         <el-table-column width="150" prop="title" label="">
@@ -300,18 +326,378 @@
         </el-table-column>
         <el-table-column prop="unit" label="unit"></el-table-column>
         <el-table-column prop="currently" label="currently"></el-table-column>
-        <el-table-column prop="jan" :label="this.monthList[0]"></el-table-column>
-        <el-table-column prop="feb" :label="this.monthList[1]"></el-table-column>
-        <el-table-column prop="mar" :label="this.monthList[2]"></el-table-column>
-        <el-table-column prop="apr" :label="this.monthList[3]"></el-table-column>
-        <el-table-column prop="may" :label="this.monthList[4]"></el-table-column>
-        <el-table-column prop="jun" :label="this.monthList[5]"></el-table-column>
-        <el-table-column prop="jul" :label="this.monthList[6]"></el-table-column>
-        <el-table-column prop="aug" :label="this.monthList[7]"></el-table-column>
-        <el-table-column prop="sep" :label="this.monthList[8]"></el-table-column>
-        <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
-        <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
-        <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
+        <el-table-column prop="jan" :label="this.monthList[0]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.jan}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.jan" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.jan}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="feb" :label="this.monthList[1]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.feb}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.feb" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.feb}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="mar" :label="this.monthList[2]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.mar}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.mar" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.mar}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="apr" :label="this.monthList[3]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.apr}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.apr" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.apr}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="may" :label="this.monthList[4]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.may}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.may" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.may}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jun" :label="this.monthList[5]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.jun}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.jun" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.jun}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jul" :label="this.monthList[6]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.jul}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.jul" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.jul}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="aug" :label="this.monthList[7]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.aug}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.aug" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.aug}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sep" :label="this.monthList[8]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.sep}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.sep" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.sep}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="oct" :label="this.monthList[9]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.oct}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.oct" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.oct}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="nov" :label="this.monthList[10]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.nov}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.nov" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.nov}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dec" :label="this.monthList[11]">
+          <template slot-scope="{row}">
+            <div v-if="!crackerUtilityConsumptionUpdating">{{row.dec}}</div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title == 'Instru. Air' ||
+                row.title == 'P. W. Water' ||
+                row.title == 'CNWW' ||
+                row.title == 'DWW' ||
+                row.title == 'waste oil' ||
+                row.title == 'Potable Water' ||
+                row.title == 'NG to furnace or offags to SUB'
+              )
+            ">
+              <el-input v-model="row.dec" clearable="true"></el-input>
+            </div>
+            <div v-if="crackerUtilityConsumptionUpdating &&
+              (
+                row.title != 'Instru. Air' &&
+                row.title != 'P. W. Water' &&
+                row.title != 'CNWW' &&
+                row.title != 'DWW' &&
+                row.title != 'waste oil' &&
+                row.title != 'Potable Water' &&
+                row.title != 'NG to furnace or offags to SUB'
+              )
+            ">
+              {{row.dec}}
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
       </el-table-column>
     </el-table>
@@ -341,6 +727,32 @@
       </el-table-column>
     </el-table>
     <!-- Aromatics Utility Consumption -->
+    <div class="editDiv">
+      <el-button
+        :disabled="aromaticsUtilityConsumptionUpdating"
+        type="primary"
+        icon="el-icon-edit"
+        size="mini"
+        @click="handleAromaticsUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('编辑Aromatics Utility Consumption') }}</el-button>
+      <el-button
+        :disabled="!aromaticsUtilityConsumptionUpdating"
+        type="success"
+        icon="el-icon-check"
+        size="mini"
+        @click="handleConfirmAromaticsUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('保存') }}</el-button>
+      <el-button
+        :disabled="!aromaticsUtilityConsumptionUpdating"
+        type="info"
+        icon="el-icon-close"
+        size="mini"
+        @click="handleCancelAromaticsUtilityConsumptionUpdate"
+        v-hasPermi="['production:monthly:edit']"
+      >{{ $t('取消') }}</el-button>
+    </div>
     <el-table border :data="tableAromaticsUtilityConsumption" style="width: 100%;">
       <el-table-column label="Aromatics Utility Consumption">
         <el-table-column width="150" prop="title" label="">
@@ -350,18 +762,330 @@
         </el-table-column>
         <el-table-column prop="unit" label="unit"></el-table-column>
         <el-table-column prop="currently" label="currently"></el-table-column>
-        <el-table-column prop="jan" :label="this.monthList[0]"></el-table-column>
-        <el-table-column prop="feb" :label="this.monthList[1]"></el-table-column>
-        <el-table-column prop="mar" :label="this.monthList[2]"></el-table-column>
-        <el-table-column prop="apr" :label="this.monthList[3]"></el-table-column>
-        <el-table-column prop="may" :label="this.monthList[4]"></el-table-column>
-        <el-table-column prop="jun" :label="this.monthList[5]"></el-table-column>
-        <el-table-column prop="jul" :label="this.monthList[6]"></el-table-column>
-        <el-table-column prop="aug" :label="this.monthList[7]"></el-table-column>
-        <el-table-column prop="sep" :label="this.monthList[8]"></el-table-column>
-        <el-table-column prop="oct" :label="this.monthList[9]"></el-table-column>
-        <el-table-column prop="nov" :label="this.monthList[10]"></el-table-column>
-        <el-table-column prop="dec" :label="this.monthList[11]"></el-table-column>
+        <el-table-column prop="jan" :label="this.monthList[0]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.jan}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.jan" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.jan}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="feb" :label="this.monthList[1]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.feb}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.feb" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.feb}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="mar" :label="this.monthList[2]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.mar}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.mar" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.mar}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="apr" :label="this.monthList[3]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.apr}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.apr" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.apr}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="may" :label="this.monthList[4]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.may}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.may" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.may}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jun" :label="this.monthList[5]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.jun}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.jun" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.jun}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="jul" :label="this.monthList[6]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.jul}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.jul" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.jul}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="aug" :label="this.monthList[7]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.aug}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.aug" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.aug}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="sep" :label="this.monthList[8]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.sep}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.sep" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.sep}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="oct" :label="this.monthList[9]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.oct}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.oct" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.oct}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="nov" :label="this.monthList[10]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.nov}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.nov" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.nov}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dec" :label="this.monthList[11]">
+          <template slot-scope="{row}">
+            <div v-if="!aromaticsUtilityConsumptionUpdating">{{row.dec}}</div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title == 'Potable Water' ||
+                row.title == 'Contaminated WW' ||
+                row.title == 'Production WW' ||
+                row.title == 'DWW' ||
+                row.title == 'Waste Liquid'
+              )
+            ">
+              <el-input v-model="row.dec" clearable="true"></el-input>
+            </div>
+            <div v-if="aromaticsUtilityConsumptionUpdating &&
+              (
+                row.title != 'Potable Water' &&
+                row.title != 'Contaminated WW' &&
+                row.title != 'Production WW' &&
+                row.title != 'DWW' &&
+                row.title != 'Waste Liquid'
+              )
+            ">
+              {{row.dec}}
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column prop="total" label="total"></el-table-column>
       </el-table-column>
     </el-table>
@@ -704,13 +1428,19 @@ import {
   getSCTFUtilityConsumption,
   getKbi,
   getSummary,
-  updateEligibleProductRate
+  updateEligibleProductRate,
+  updateCrackerUtilityConsumption,
+  updateAromaticsUtilityConsumption
 } from "@/api/production/monthly";
 
 export default {
   name: "Monthly",
   data() {
     return {
+      // Aromatics Utility Consumption修改中
+      aromaticsUtilityConsumptionUpdating: false,
+      // Cracker Utility Consumption修改中
+      crackerUtilityConsumptionUpdating: false,
       // Eligible Product Rate修改中
       eligibleProductRateUpdating: false,
       // 趋势图y轴数值
@@ -760,59 +1490,10 @@ export default {
       tableAromaticsOutputProduct: [],
       tableEligibleProductRate: [],
       tableProductYield: [],
-      tableCrackerUtilityConsumption: [
-        {title: "FG(include NG+Offage)"},
-        {title: "SS"},
-        {title: "HS"},
-        {title: "MS"},
-        {title: "LS"},
-        {title: "Electricity"},
-        {title: "coiling water"},
-        {title: "Instru. Air"},
-        {title: "Plant Air"},
-        {title: "N2"},
-        {title: "BFW"},
-        {title: "Polished Condensate"},
-        {title: "P. W. Water"},
-        {title: "TC"},
-        {title: "CNWW"},
-        {title: "DWW"},
-        {title: "waste oil"},
-        {title: "Potable Water"},
-        {title: "Production Water"},
-        {title: "NG to furnace or offags to SUB"},
-        {title: "offage product"},
-      ],
-      tableCrackerEnergyConsumption: [
-        {title: "total energy"},
-        {title: "total energy"},
-        {title: "Energy/ethylene"},
-        {title: "Energy/ethylene"},
-      ],
-      tableAromaticsUtilityConsumption: [
-        {title: "SS"},
-        {title: "HS"},
-        {title: "MS"},
-        {title: "LS"},
-        {title: "Electricity"},
-        {title: "coiling water"},
-        {title: "Potable Water"},
-        {title: "Production Water"},
-        {title: "BFW"},
-        {title: "N2"},
-        {title: "PA&IA"},
-        {title: "Turbine Condensate"},
-        {title: "Contaminated WW"},
-        {title: "Production WW"},
-        {title: "DWW"},
-        {title: "Waste Liquid"},
-      ],
-      tableAromaticsEnergyConsumption: [
-        {title: "total energy"},
-        {title: "total energy"},
-        {title: "Energy/ethylene"},
-        {title: "Energy/ethylene"},
-      ],
+      tableCrackerUtilityConsumption: [],
+      tableCrackerEnergyConsumption: [],
+      tableAromaticsUtilityConsumption: [],
+      tableAromaticsEnergyConsumption: [],
       tablePlantLoad: [
         {title: "Cracker load"},
         {title: "C2+C3 Capacity"},
@@ -988,10 +1669,65 @@ export default {
   },
   methods: {
     /** 编辑按钮操作 */
+    handleAromaticsUtilityConsumptionUpdate(row) {
+      this.aromaticsUtilityConsumptionUpdating = true;
+    },
+    handleCrackerUtilityConsumptionUpdate(row) {
+      this.crackerUtilityConsumptionUpdating = true;
+    },
     handleEligibleProductRateUpdate(row) {
       this.eligibleProductRateUpdating = true;
     },
     /** 确定修改按钮操作 */
+    handleConfirmAromaticsUtilityConsumptionUpdate(row) {
+      this.aromaticsUtilityConsumptionUpdating = false;
+      updateAromaticsUtilityConsumption({
+        tableData: [
+          this.tableAromaticsUtilityConsumption[6],
+          this.tableAromaticsUtilityConsumption[12],
+          this.tableAromaticsUtilityConsumption[13],
+          this.tableAromaticsUtilityConsumption[14],
+          this.tableAromaticsUtilityConsumption[15]
+        ],
+        year: this.year.getFullYear()
+      }).then(response => {
+        if (response.code == 200) {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("未知错误,请联系管理员。");
+        }
+        getAromaticsUtilityConsumption(year).then(response => {
+          this.tableCrackerUtilityConsumption = response.data;
+        });
+      });
+    },
+    handleConfirmCrackerUtilityConsumptionUpdate(row) {
+      this.crackerUtilityConsumptionUpdating = false;
+      updateCrackerUtilityConsumption({
+        tableData: [
+          this.tableCrackerUtilityConsumption[7],
+          this.tableCrackerUtilityConsumption[12],
+          this.tableCrackerUtilityConsumption[14],
+          this.tableCrackerUtilityConsumption[15],
+          this.tableCrackerUtilityConsumption[16],
+          this.tableCrackerUtilityConsumption[17],
+          this.tableCrackerUtilityConsumption[19]
+        ],
+        year: this.year.getFullYear()
+      }).then(response => {
+        if (response.code == 200) {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("未知错误,请联系管理员。");
+        }
+        getCrackerUtilityConsumption(year).then(response => {
+          this.tableCrackerUtilityConsumption = response.data;
+        });
+        getCrackerEnergyConsumption(year).then(response => {
+          this.tableCrackerEnergyConsumption = response.data;
+        });
+      });
+    },
     handleConfirmEligibleProductRateUpdate(row) {
       this.eligibleProductRateUpdating = false;
       updateEligibleProductRate({
@@ -1009,6 +1745,18 @@ export default {
       });
     },
     /** 取消修改按钮操作 */
+    handleCancelAromaticsUtilityConsumptionUpdate(row) {
+      this.aromaticsUtilityConsumptionUpdating = false;
+      getAromaticsUtilityConsumption(year).then(response => {
+        this.aromaticsUtilityConsumptionUpdating = response.data;
+      });
+    },
+    handleCancelCrackerUtilityConsumptionUpdate(row) {
+      this.crackerUtilityConsumptionUpdating = false;
+      getCrackerUtilityConsumption(year).then(response => {
+        this.tableCrackerUtilityConsumption = response.data;
+      });
+    },
     handleCancelEligibleProductRateUpdate(row) {
       this.eligibleProductRateUpdating = false;
       getEligibleProductRate(year).then(response => {