haojianlong 5 år sedan
förälder
incheckning
5791bdeae3

+ 218 - 92
src/components/point/dynamicdata/applyRulesDialog.vue

@@ -5,46 +5,57 @@
       <el-tab-pane label="人工填写过表号功能号" name="first"></el-tab-pane>
       <!-- <el-tab-pane label="多个标识对应同一个信息点" name="second"></el-tab-pane> -->
     </el-tabs>
-    <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)">
+    <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)" @expand-change="expandRow" ref="expandTable">
       <el-table-column type="expand" class-name="bgf5">
-        <template slot-scope="props">
+        <template slot-scope="scope">
           <el-row>
-            <el-col :span="8">
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
+            <el-col :span="12">
+              <p>{{scope.row.BuildLocalName}}-{{scope.row.FloorLocalName}}</p>
+              <p>{{scope.row.RoomLocalName}}</p>
+              <p>{{scope.row.SubTypeName}}</p>
             </el-col>
-            <el-col :span="8">
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
+            <el-col :span="6">
+              <p>{{scope.row.OldMsg.Description}}</p>
+              <p>
+                {{scope.row.OldMsg.EquipmentMark}}
+                {{scope.row.OldMsg.KeyEquipmentType}}
+                {{scope.row.OldMsg.KeyEquipmentParameter}}
+              </p>
+              <p>{{scope.row.OldMsg.LocationFlag&&scope.row.OldMsg.LocationFlag.toString()}}</p>
             </el-col>
-            <el-col :span="8">
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
-              <p>{{props.row.desc}}</p>
+            <el-col :span="6">
+              <p>{{scope.row.NewMsg.Description}}</p>
+              <p>
+                {{scope.row.NewMsg.EquipmentMark}}
+                {{scope.row.NewMsg.KeyEquipmentType}}
+                {{scope.row.NewMsg.KeyEquipmentParameter}}
+              </p>
+              <p>{{scope.row.NewMsg.LocationFlag&&scope.row.NewMsg.LocationFlag.toString()}}</p>
             </el-col>
           </el-row>
         </template>
       </el-table-column>
-      <el-table-column label="设备实例本地名(本地编码)" prop="name" class-name="bgf5" align="center">
-        
+      <el-table-column label="设备实例本地名(本地编码)" class-name="bgf5" align="center">
+        <template slot-scope="scope">
+          {{scope.row.EquipLocalName}}({{scope.row.ObjectID}})
+        </template>
       </el-table-column>
-      <el-table-column label="信息点" prop="name" align="center"></el-table-column>
-      <el-table-column label="原值" prop="desc" align="center">
+      <el-table-column label="信息点" prop="InfomationPoint" align="center"></el-table-column>
+      <el-table-column label="原值" prop="Old" align="center">
         <template slot-scope="scope">
-          <el-radio v-model="scope.row.checked" label="old">备选项</el-radio>
+          <el-radio v-model="scope.row.checked" label="Old">{{scope.row.Old}}</el-radio>
         </template>
       </el-table-column>
-      <el-table-column label="新值" prop="desc" align="center">
+      <el-table-column label="新值" prop="New" align="center">
         <template slot-scope="scope">
-          <el-radio v-model="scope.row.checked" label="new">备选项</el-radio>
+          <el-radio v-model="scope.row.checked" label="New">{{scope.row.New}}</el-radio>
         </template>
       </el-table-column>
     </el-table>
     <span slot="footer" class="dialog-footer">
+      <span style="font-size:12px;color:red;" v-show="finished">请处理所有冲突</span>
       <el-button size="small">取消</el-button>
-      <el-button size="small" type="primary">使用选择的表号功能号</el-button>
+      <el-button size="small" type="primary" @click="userSelected">使用选择的表号功能号</el-button>
     </span>
   </el-dialog>
 </template>
@@ -56,76 +67,14 @@ import {
   dynamicQueryPoint, //查点位
   dynamicExecute, //执行规则
 } from "@/api/scan/request";
+import Vue from 'vue'
 export default {
   data() {
     return {
       dialogVisible: false, //弹窗显示与隐藏
-      tableData: [
-        {
-          id: "12987122",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987123",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987125",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987126",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987127",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987128",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        },
-        {
-          id: "12987129",
-          name: "好滋好味鸡蛋仔",
-          category: "江浙小吃、小吃零食",
-          desc: "荷兰优质淡奶,奶香浓而不腻",
-          address: "上海市普陀区真北路",
-          shop: "王小虎夫妻店",
-          shopId: "10333"
-        }
-      ],
-      activeName: "first" //当前所在tab页
+      tableData: [],
+      activeName: "first", //当前所在tab页
+      finished: false, //未处理所有冲突提示文字
     };
   },
   methods: {
@@ -140,13 +89,190 @@ export default {
     },
     handleClick() { },
     handleClose(done) { },
-    handleDelete(i, t) { },
+    //检查是否处理完所有冲突
+    userSelected() {
+      let flag = true;
+      this.tableData.map(t => {
+        if (!t.checked) {
+          flag = false;
+        }
+      })
+      this.finished = !flag;
+    },
     //查询是否有冲突
     getPromptobjs() {
       dynamicPromptobjs('', res => {
-        this.tableData = res.Content;
+        res.Content = [{
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "1002-102",
+          ObjectID: "string",
+          Old: "1002-102",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }, {
+          BuildLocalName: "string",
+          CreateTime: "2019-03-01 10:10:10",
+          EquipLocalName: "string",
+          EquipmentMark: "string",
+          FloorLocalName: "string",
+          Id: "string",
+          InstallLocation: "string",
+          LastUpdate: "2019-03-01 10:10:10",
+          New: "string",
+          ObjectID: "string",
+          Old: "string",
+          ProjectId: "string",
+          InfomationPoint: '123123',
+          RoomLocalName: "string",
+          SpaceType: "string",
+          SubTypeCode: "string",
+          SubTypeName: "string",
+          TypeCode: "string",
+          TypeName: "string"
+        }]
+        this.tableData = res.Content.map((item) => {
+          item.OldMsg = {}
+          item.NewMsg = {}
+          return item
+        });
       })
-    }
+    },
+    //展开行
+    expandRow(row) {
+      let index = this.tableData.indexOf(row);
+      if (row.OldMsg.TypeCode || row.NewMsg.TypeCode) return;
+      let param1 = {
+        Filters: `MeterFuncid='${row.Old}'`,
+        PageNumber: 1,
+        PageSize: 50
+      }
+      let param2 = {
+        Filters: `MeterFuncid='${row.New}'`,
+        PageNumber: 1,
+        PageSize: 50
+      }
+      dynamicQueryPoint(param1, res => {
+        row.OldMsg = res.Content[0]
+        this.tableData[index] = row
+      })
+      dynamicQueryPoint(param2, res => {
+        row.NewMsg = res.Content[0]
+        this.tableData[index] = row
+      })
+    },
   },
   mounted() { },
   created() {
@@ -163,4 +289,4 @@ export default {
     text-align: center;
   }
 }
-</style>
+</style>

+ 1 - 1
src/views/point/dynamicdata/index.vue

@@ -4,7 +4,7 @@
     <el-row>
       <el-col :span="17">
         <el-tabs v-model="curType">
-          <el-tab-pane v-for="(item) in typeList" :key="item.Name" :label="item.Name+'('+item.Rcount+'/'+item.Sum+')'" :name="item.Name">
+          <el-tab-pane v-for="(item) in typeList" :key="item.Name" :label="item.Name+'('+item.Sum+'/'+item.Rcount+')'" :name="item.Name">
           </el-tab-pane>
         </el-tabs>
       </el-col>