Jelajahi Sumber

Merge branch 'apiupdate' of git.sagacloud.cn:web/ibms into apiupdate-zy

zhangyu 5 tahun lalu
induk
melakukan
e0148775cf

+ 2 - 2
src/components/dialogs/changeRea.vue

@@ -165,8 +165,8 @@ export default {
     },
     //查询表数据
     getPropertyData() {
-      let param = {
-        Filters: `EquipID isNull;Family="${this.category.assetType}"`,
+      let param = { 
+        Filters: `EquipmentId isNull;Family="${this.category.assetType}"`,
         PageNumber: this.page.currentPage,
         PageSize: this.page.size
       }

+ 11 - 29
src/components/dialogs/list/systemType.vue

@@ -78,7 +78,6 @@ export default {
       type: String,
       default: "read"
     },
-    //默认值
     list: {
       type: [Array]
     }
@@ -90,7 +89,6 @@ export default {
       systemList: [],
       allData: [],
       multipleSelection: [],
-      changeData: [],
       iframeSrc: "",
       iframeShow: false,
       buildId: 'all', //查询条件
@@ -153,43 +151,27 @@ export default {
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
-      if (this.changeData.length) {
-        this.multipleSelection = this.changeData
-        this.changeData = []
-      }
     },
-
     //设置默认
     toggleSelection(rows) {
-      if (rows) {
-        rows.forEach(row => {
-          this.$refs.multipleTable.toggleRowSelection(row);
-        });
-      } else {
-        this.$refs.multipleTable.clearSelection();
+      this.$refs.multipleTable.clearSelection();
+      if (rows.length&&this.list.length) {
+        rows.map(row => {
+          this.list.map(t => {
+            if(row.SysID == t.SysID){
+              this.$refs.multipleTable.toggleRowSelection(row)
+            }
+          })
+        })
       }
     },
-
+    //确认
     getChange() {
       this.createRelatSys()
       this.$emit("change", this.multipleSelection)
       this.dialog.systemType = false
       this.multipleSelection = []
     },
-
-    //设置默认选中项
-    getSelected(list, all) {
-      let map = []
-      if (all && all.length && list && list.length) {
-        all.map((item, index) => {
-          list.map(child => {
-            if (item.id == child.id) {
-              this.$refs.multipleTable.toggleRowSelection(item)
-            }
-          })
-        })
-      }
-    },
     //点击详情
     lookDeatils(infos) {
       this.iframeSrc =
@@ -224,7 +206,7 @@ export default {
       queryLinkSys(param, res => {
         this.allData = res.Content
         this.tableData = res.Content
-        this.multipleSelection = []
+        this.toggleSelection(res.Content)
       })
     },
     //添加设备关联系统关系

+ 2 - 1
src/components/ledger/handsontables/device.vue

@@ -54,7 +54,7 @@
     </div>
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
     <!-- 关联的系统 -->
-    <system-type :device="mess" :curDevice="curDevice" :dialog="myDialog" :type="onlyRead?'read':'edit'" @change="changeSystemType"></system-type>
+    <system-type :device="mess" :curDevice="curDevice" :dialog="myDialog" :type="onlyRead?'read':'edit'" @change="changeSystemType" :list="systemList"></system-type>
     <!-- 关联资产 -->
     <change-rea @changeProperty="changeProperty" :dialog="myDialog" :category="deviceType"></change-rea>
     <look-pic :dialog="myDialog" :keysArr="picsArr"></look-pic>
@@ -178,6 +178,7 @@ export default {
       messKey: null,
       imgsArr: [], //临时保存的图片key数组
       picsArr: [], //临时设备图片keys数组
+      systemList:[], //关联的系统
       copyMain: null,
       graphyId: null,
       assetGroupList: [],

+ 1 - 1
src/components/ledger/handsontables/system.vue

@@ -239,7 +239,7 @@ export default {
     toAddDevice() {
       if (this.addData.Category) {
         this.$router.push({
-          path: "/system/addsystem",
+          path: "/system/systemadd",
           query: this.addData
         });
       }

+ 8 - 8
src/router/system.js

@@ -34,11 +34,11 @@ const OwnerManage = () =>
 
 /**  台账管理 */
 import systemLedger from '@/views/ledger/system/index'
-import addsystem from '@/views/ledger/system/addsystem'
+import systemadd from '@/views/ledger/system/addsystem'
 import facilityLedger from '@/views/ledger/facility/index'
 import partsLedger from '@/views/ledger/facility/parts/index'
 import partsmanageLedger from '@/views/ledger/facility/partsmanage/index'
-import addparts from '@/views/ledger/facility/partsmanage/addparts/index'
+import partsadd from '@/views/ledger/facility/partsmanage/addparts/index'
 import deviceadd from '@/views/ledger/facility/addfacility'
 import propertyadd from '@/views/ledger/property/addproperty'
 import propertyLedger from '@/views/ledger/property/index'
@@ -173,9 +173,9 @@ export default [
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '管理部件' }] },
             },
             {
-                path: 'addparts',
-                name: 'addparts',
-                component: addparts,
+                path: 'partsadd',
+                name: 'partsadd',
+                component: partsadd,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '设备清单', path: '/ledger/facility' }, { label: '添加部件' }] },
             },
             {
@@ -335,9 +335,9 @@ export default [
                 meta: { keepAlive: false, breadcrumbs: [{ label: '系统管理', path: '/system/list' }, { label: '系统清单' }] }
             },
             {
-                path: 'addsystem',
-                name: 'addsystem',
-                component: addsystem,
+                path: 'systemadd',
+                name: 'systemadd',
+                component: systemadd,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '系统管理', path: '/system/list' }, { label: '系统清单', path: '/system/list' }, { label: '添加系统' }] }
             },
         ]

+ 3 - 1
src/utils/authutils.js

@@ -58,7 +58,9 @@ export default {
                     (from.path == "/rent/rentadd" && session.get("rentAddData") && session.get("rentAddData").length) ||
                     (from.path == "/ledger/cenoteadd" && session.get("cenoteAddData") && session.get("cenoteAddData").length) ||
                     (from.path == "/ledger/deviceadd" && session.get("deviceAddData") && session.get("deviceAddData").length) ||
-                    (from.path == "/ledger/propertyadd" && session.get("propertyAddData") && session.get("propertyAddData").length)
+                    (from.path == "/ledger/propertyadd" && session.get("propertyAddData") && session.get("propertyAddData").length) ||
+                    (from.path == "/ledger/partsadd" && session.get("partsAddData") && session.get("partsAddData").length) ||
+                    (from.path == "/system/systemadd" && session.get("systemAddData") && session.get("systemAddData").length)
                 ) { //判断新增信息是否保存
                     MessageBox.confirm("新增信息未保存,离开将丢失新增信息,是否继续?", "提示", {
                         confirmButtonText: '确定',

+ 4 - 2
src/views/ledger/facility/addfacility.vue

@@ -43,7 +43,7 @@
     <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
     <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
     <pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
-    <system-type :device="category" :dialog="myDialog" :type="onlyRead?'read':'edit'" @change="changeSystemType"></system-type>
+    <system-type :device="category" :dialog="myDialog" :type="onlyRead?'read':'edit'" @change="changeSystemType" :list="systemList"></system-type>
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
   </div>
 </template>
@@ -125,6 +125,7 @@ export default {
       filesArr: [], //保存临时的文件key
       imgsArr: [], //临时保存的图片key数组
       picsArr: [], //临时设备图片keys数组
+      systemList:[], //关联的系统
       systemId: null,
       graphyId: null,
       id: 0,
@@ -326,11 +327,12 @@ export default {
       //   }
       // }
       createEquipAndProperty(newData, res => {
+        this.$message.success('创建成功')
+        session.remove("deviceAddData")
         this.$router.push({
           path: "/ledger/facility",
           query: { deviceId: this.category.deviceId }
         });
-        session.remove("deviceAddData")
       })
     },
     // 删除表格行

+ 11 - 8
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -212,14 +212,17 @@ export default {
             params.EquipmentId = res.EntityList[0].EquipID
             await createPropertyData([params], res => { })
           }
-          this.$router.push({
-            path: "/ledger/partsmanage",
-            query: {
-              deviceId: this.category.deviceId,
-              typeId: this.category.ParentId
-            }
-          });
-          session.remove("partsAddData")
+          if (i == newData.length - 1) {
+            this.$message.success('创建成功')
+            session.remove("partsAddData")
+            this.$router.push({
+              path: "/ledger/partsmanage",
+              query: {
+                deviceId: this.category.deviceId,
+                typeId: this.category.ParentId
+              }
+            });
+          }
         })
 
         // if (newData[i].Checked) {//同时创建资产

+ 1 - 1
src/views/ledger/facility/partsmanage/index.vue

@@ -293,7 +293,7 @@ export default {
     handleCreateTableData() {
       this.activeTab.deviceId = this.deviceId;
       this.$router.push({
-        name: "addparts",
+        name: "partsadd",
         params: this.activeTab
       });
     },

+ 2 - 1
src/views/ledger/system/addsystem.vue

@@ -215,11 +215,12 @@ export default {
         return;
       }
       createGeneralSys(newData, res => {
+        this.$message.success('创建成功')
+        session.remove("systemAddData")
         this.$router.push({
           path: "/system/list",
           query: { deviceId: this.category.Category }
         });
-        session.remove("systemAddData")
       })
     },
     // 删除表格行