فهرست منبع

1.修改供需项目维护无法新增

QuietShadow 3 سال پیش
والد
کامیت
7759871904
2فایلهای تغییر یافته به همراه30 افزوده شده و 15 حذف شده
  1. 4 2
      cors.js
  2. 26 13
      src/views/energyPerformance/components/supplyAnddemand/Project.vue

+ 4 - 2
cors.js

@@ -113,6 +113,8 @@ module.exports = {
       },
   },
   //devModules: ['index','workFlow','ApiManage','apollo','authManage','configManager','devops','dingtalk','serviceManager','microService','monitor','systemConfig','metaData','multEntry','demo']
-    devModules: ['all'] // 不建议使用,运行速度太慢
-  // devModules: ['index','workFlow','systemConfig','multEntry','microService','basicInformation','energyAnalysis','energyBalance','energyOperationSupport','energyPerformance','energyPlan','energyQuality','systemInterface']
+  //  devModules: ['all'] // 不建议使用,运行速度太慢,发布构建会失败
+    devModules: ['dingtalk','dingtalkMobileEnd','formGenerator','gatewayCfg','index','logAudit','metaData','workFlow','preview','serviceManager',
+    'systemConfig','multEntry','microService','basicInformation','energyAnalysis','energyBalance','energyOperationSupport',
+    'energyPerformance','energyPlan','energyQuality','energyScheduling','systemInterface']
 }

+ 26 - 13
src/views/energyPerformance/components/supplyAnddemand/Project.vue

@@ -1197,22 +1197,35 @@ export default {
             that.getTableData(1);
         },
         handleCurrentChange (currentRow) {
-            let that = this;
-            that.currentData = currentRow;
+            let that = this;
+            if (currentRow !== null) {
+              that.currentData = currentRow;
+            } else {
+              that.currentData.itemid = '';
+              that.currentData.itemname = '';
+              that.currentData.itemdesc = '';
+              that.currentData.energyid = '';
+              that.currentData.workprocid = '';
+              that.currentData.unitid = unitid;
+              that.currentData.fid = '';
+              that.currentData.isup = '1';
+              that.currentData.mintimegranid = '';
+            }
+
         },
         but_add () {
             let that = this;
-            let unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
-            that.dialog.editorBox.form.data.itemid = that.currentData.itemid === undefined ? '' : that.currentData.itemid;
-            that.dialog.editorBox.form.data.itemname = that.currentData.itemname === undefined ? '' : that.currentData.itemname;
-            that.dialog.editorBox.form.data.itemdesc = that.currentData.itemdesc === undefined ? '' : that.currentData.itemdesc;
-            that.dialog.editorBox.form.data.energyid = that.currentData.energyid === undefined ? '' : that.currentData.energyid;
-            that.dialog.editorBox.form.data.workprocid = that.currentData.workprocid === undefined ? '' : that.currentData.workprocid;
-            that.dialog.editorBox.form.data.propertyid = that.currentData.propertyid === undefined ? '' : that.currentData.propertyid;
-            that.dialog.editorBox.form.data.unitid = that.currentData.unitid === undefined ? unitid : that.currentData.unitid;
-            that.dialog.editorBox.form.data.fid = that.currentData.fid === undefined ? '' : that.currentData.fid;
-            that.dialog.editorBox.form.data.isup = that.currentData.isup === undefined ? '1' : that.currentData.isup;
-            that.dialog.editorBox.form.data.mintimegranid = that.currentData.mintimegranid === undefined ? '' : that.currentData.mintimegranid;
+            let unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
+              that.dialog.editorBox.form.data.itemid = that.currentData.itemid || that.currentData.itemid === undefined ? '' : that.currentData.itemid;
+              that.dialog.editorBox.form.data.itemname = that.currentData.itemname === undefined ? '' : that.currentData.itemname;
+              that.dialog.editorBox.form.data.itemdesc = that.currentData.itemdesc === undefined ? '' : that.currentData.itemdesc;
+              that.dialog.editorBox.form.data.energyid = that.currentData.energyid === undefined ? '' : that.currentData.energyid;
+              that.dialog.editorBox.form.data.workprocid = that.currentData.workprocid === undefined ? '' : that.currentData.workprocid;
+              that.dialog.editorBox.form.data.propertyid = that.currentData.propertyid === undefined ? '' : that.currentData.propertyid;
+              that.dialog.editorBox.form.data.unitid = that.currentData.unitid === undefined ? unitid : that.currentData.unitid;
+              that.dialog.editorBox.form.data.fid = that.currentData.fid === undefined ? '' : that.currentData.fid;
+              that.dialog.editorBox.form.data.isup = that.currentData.isup === undefined ? '1' : that.currentData.isup;
+              that.dialog.editorBox.form.data.mintimegranid = that.currentData.mintimegranid === undefined ? '' : that.currentData.mintimegranid;
             that.dialog.editorBox.type = 'add';
             that.dialog.editorBox.show = true;
             console.log(that.dialog.editorBox.form.data.unitid)