Browse Source

modify device add system

haojianlong 5 years ago
parent
commit
353f729108

+ 16 - 58
src/components/dialogs/list/systemType.vue

@@ -6,31 +6,11 @@
     <div>
       <div id="systemType">
         <div class="title-search query-form" style="padding: 10px;margin-bottom: 10px;" v-if="type != 'read' ">
-          <el-input
-            placeholder="输入名称或编码进行查询"
-            v-model="search"
-            size="small"
-            style="width:300px; margin-right:10px"
-            clearable
-          ></el-input>
+          <el-input placeholder="输入名称或编码进行查询" v-model="search" size="small" style="width:300px; margin-right:10px" clearable></el-input>
           <el-button size="small" @click="searchChecked">查找</el-button>
         </div>
-        <el-table
-        class='data-table'
-            border
-          :data="tableData"
-          @selection-change="handleSelectionChange"
-          style="width: 100%"
-          ref="multipleTable"
-        >
-          <el-table-column
-            v-if="type != 'read' "
-            type="selection"
-            :reserve-selection="true"
-            :disabled="true"
-            width="55"
-             
-          ></el-table-column>
+        <el-table class='data-table' border :data="tableData" @selection-change="handleSelectionChange" style="width: 100%" ref="multipleTable">
+          <el-table-column v-if="type != 'read' " type="selection" :reserve-selection="true" :disabled="true" width="55"></el-table-column>
           <el-table-column label="系统名称" header-align='center'>
             <template slot-scope="scope">{{scope.row.infos.SysLocalName || scope.row.infos.SysName}}</template>
           </el-table-column>
@@ -39,7 +19,7 @@
           </el-table-column>
           <el-table-column label="专业" header-align='center'>
             <template slot-scope="scope">{{getName(scope.row.category)}}</template>
-          </el-table-column> 
+          </el-table-column>
           <el-table-column label="详情" header-align='center' width="100" align="center">
             <template slot-scope="scope">
               <el-button @click="lookDeatils(scope.row)" type="text">详情</el-button>
@@ -52,36 +32,15 @@
             @click="getChange"
             style="display:block;margin: 10px auto 0;"
           >确 定</el-button>
-        </div> -->        
+        </div> -->
       </div>
     </div>
     <span slot="footer" class="dialog-footer">
-           <el-button
-            type="primary"
-            @click="getChange"            
-          >确 定</el-button>
-        </span>
-    <el-dialog
-      title="系统详情"
-      :visible.sync="iframeShow"
-      v-if="iframeShow"
-      width="500px"
-      append-to-body
-    >
-      <iframe
-        id="google_ads_frame2"
-        name="google_ads_frame2"
-        frameborder="0"
-        :src="iframeSrc"
-        marginwidth="0"
-        marginheight="0"
-        vspace="0"
-        hspace="0"
-        style="width:100%;height:500px;"
-        allowtransparency="true"
-        scrolling="no"
-        allowfullscreen="true"
-      ></iframe>
+      <el-button type="primary" @click="getChange">确 定</el-button>
+    </span>
+    <el-dialog title="系统详情" :visible.sync="iframeShow" v-if="iframeShow" width="500px" append-to-body>
+      <iframe id="google_ads_frame2" name="google_ads_frame2" frameborder="0" :src="iframeSrc" marginwidth="0" marginheight="0" vspace="0" hspace="0"
+        style="width:100%;height:500px;" allowtransparency="true" scrolling="no" allowfullscreen="true"></iframe>
     </el-dialog>
   </el-dialog>
 </template>
@@ -123,8 +82,7 @@ export default {
   data() {
     return {
       search: "", //搜索文案
-      tableData: [
-      ],
+      tableData: [],
       systemList: [],
       allData: [],
       multipleSelection: [],
@@ -135,9 +93,9 @@ export default {
   },
   computed: {
     ...mapGetters("layout", [
-        "projectId",
-        "secret",
-        "userId"
+      "projectId",
+      "secret",
+      "userId"
     ])
   },
   mounted() { },
@@ -315,8 +273,8 @@ export default {
 
 <style lang="less">
 #systemType {
-    height: 455px;
-    overflow-y:auto; 
+  height: 455px;
+  overflow-y: auto;
   .el-table thead {
     tr {
       th {

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

@@ -72,7 +72,7 @@
             
 
     
-    <system-type :infos="systemId" :graphyId="graphyId" :dialog="dialog"></system-type>
+    <system-type :infos="systemId" :graphyId="graphyId" :dialog="dialog" :type="onlyRead?'read':'edit'" @change="changeSystemType"></system-type>
     
     <div v-show="mess.deviceId && main && main.length" v-loading="loading" id="handsontable" ref="handsontable"></div>
     <div v-show="mess.deviceId && main && main.length" class="right">
@@ -482,7 +482,6 @@ export default {
     reset() {
       this.getMain();
     },
-
     //添加设备
     addDevice() {
       if(this.mess.deviceId){
@@ -1270,6 +1269,12 @@ export default {
       //   tools.setItem(this.deviceType.code, this.main)
     },
 
+    //关联系统更改
+    changeSystemType(data){
+
+      tools.setDataForKey(this.main[this.row], "linkSystem", data)
+      console.log(this.main[this.row])
+    },
     //设备图片弹窗改变事件
     changePics(keys) {
       this.setDataToMain(keys, this.messKey.split(".")[1], this.row)

+ 8 - 7
src/views/ledger/facility/addfacility.vue

@@ -39,7 +39,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 :infos="systemId" :graphyId="graphyId" :dialog="myDialog"></system-type>
+    <system-type :infos="systemId" :graphyId="graphyId" :dialog="myDialog" :type="'edit'" @change="changeSystemType"></system-type>
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
   </div>
 </template>
@@ -146,7 +146,6 @@ export default {
   },
   created() {
     this.category = this.$route.query;
-    console.log(this.category)
     this.getBelongs();
     this.getTableHeader();
   },
@@ -217,8 +216,7 @@ export default {
               if (i == newData.length - 1) {
                 this.$router.push({
                   path: "/ledger/facility",
-                  query: {
-                    deviceId: this.category.deviceId                  }
+                  query: { deviceId: this.category.deviceId }
                 });
                 session.remove("deviceAddData")
               }
@@ -229,8 +227,7 @@ export default {
             if (i == newData.length - 1) {
               this.$router.push({
                 path: "/ledger/partsmanage",
-                query: {
-                  deviceId: this.category.deviceId                }
+                query: { deviceId: this.category.deviceId }
               });
               session.remove("deviceAddData")
             }
@@ -439,6 +436,10 @@ export default {
     changePics(keys) {
       this.setDataToMain(keys, this.messKey, this.row);
     },
+    //关联系统变更
+    changeSystemType(data) {
+      tools.setDataForKey(this.tableData[this.row], "linkSystem", data)
+    },
     //表格点击事件
     handleTdClick(el, rowArr) {
       //点击的是表头
@@ -493,7 +494,7 @@ export default {
       }
       //关联系统
       if (val == "linkSystem") {
-        // this.systemList = this.tableData[row.row].linkSystem || [];
+        this.systemList = this.tableData[row.row].linkSystem || [];
         this.myDialog.systemType = true;
       }
       //品牌型号弹窗