Browse Source

添加临时维护信息点功能

zhangyu 5 years ago
parent
commit
cb85c70cc8

+ 54 - 15
src/components/ledger/handsontables/device.vue

@@ -58,6 +58,19 @@
     <!-- 关联资产 -->
     <change-rea @changeProperty="changeProperty" :dialog="myDialog" :category="deviceType"></change-rea>
     <look-pic :dialog="myDialog" :keysArr="picsArr"></look-pic>
+    <!-- 不支持的输入方式 -->
+    <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击<el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>。
+      </el-row>
+      <el-row style="margin-top:20px;" v-show="updateInputShow">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容" v-model="updateInput"></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
     <!-- 新增设备 -->
     <el-dialog title="确定新增设备的类型" :visible.sync="myDialog.addDevice" width="670px">
       <el-row>
@@ -159,6 +172,9 @@ export default {
       tableData: [],
       mess: {},
       tableHeader: null,
+      inputMap: {
+        flowBuild: 'D1'
+      }, //信息点和输入方式映射表
       page: {
         size: 50,
         sizes: [10, 30, 50, 100, 150, 200],
@@ -181,6 +197,7 @@ export default {
         details: false,//详情页
         changeRea: false,//关联资产
         lookPic: false,//图片查看
+        update: false,//临时维护信息点
       },
       row: null, //被修改的row
       filesArr: [], //保存临时的文件key
@@ -200,6 +217,8 @@ export default {
       floorData: [],
       curDevice: '',//当前点击的设备id
       addData: {}, //添加设备选择的设备类型
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInput: '', //临时维护信息点值
     };
   },
   methods: {
@@ -213,12 +232,17 @@ export default {
           data: {
             Orders: "sort asc",
             PageNumber: 1,
-            PageSize: 500
+            PageSize: 1000
           },
           type: this.mess.deviceId
         };
         getDataDictionary(params, res => {
           this.tableHeader = res.Content;
+          this.tableHeader.forEach(item => {
+            if(item.Path && item.InputMode){
+              this.inputMap[item.Path] = item.InputMode
+            }
+          })
           this.getTableData()
         });
       }
@@ -635,6 +659,7 @@ export default {
     //获取到了正确的信息
     getInfors(infos, row, el) {
       let val = this.hot.colToProp(row.col);
+      let inputMode = this.inputMap[val];
       this.row = row.row;
       this.messKey = val;
       switch (val) {
@@ -642,7 +667,7 @@ export default {
         case 'caozuo':
           // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
           this.$message("开发中...")
-          break;
+          return false
         //设备二维码图片
         case 'EquipQRCode':
           this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
@@ -651,7 +676,7 @@ export default {
           } else {
             this.$message("此设备没有设备二维码");
           }
-          break;
+          return false
         //关联系统
         case 'LinkSystem':
           if (!this.onlyRead) {
@@ -659,37 +684,37 @@ export default {
             this.systemList = this.tableData[row.row].LinkSystem || [];
             this.myDialog.systemType = true;
           }
-          break;
+          return false
         //关联资产
         case 'LinkEquipLocalName':
           if (this.linkNameFalg) {
             this.myDialog.changeRea = true;
           }
-          break;
+          return false
         //品牌型号弹窗
         case 'DPManufacturerID':
           if (!this.onlyRead) {
             this.myDialog.firm = true;
           }
-          break;
+          return false
         //供应商信息弹窗
         case 'DPSupplierID':
           if (!this.onlyRead) {
             this.myDialog.supplier = true;
           }
-          break;
+          return false
         //维修商信息弹窗
         case 'DPMaintainerID':
           if (!this.onlyRead) {
             this.myDialog.maintainer = true;
           }
-          break;
+          return false
         //保险公司信息
         case 'DPInsurerID':
           if (!this.onlyRead) {
             this.myDialog.insurer = true;
           }
-          break;
+          return false
         //供应合同编号
         case 'LedgerParam.SupplyPurchase.SupplierContractID':
           if (!this.onlyRead) {
@@ -705,7 +730,7 @@ export default {
               this.$message("请先选择供应商");
             }
           }
-          break;
+          return false
         //保险单号
         case 'LedgerParam.InsuranceDoc.InsuranceNum':
           if (!this.onlyRead) {
@@ -721,7 +746,7 @@ export default {
               this.$message("请先选择保险商");
             }
           }
-          break;
+          return false
         //保险文件--设备文档--安装质检报告
         case 'LedgerParam.InsuranceDoc.InsuranceFile':
         case 'LedgerParam.PhotoDoc.Archive':
@@ -729,7 +754,7 @@ export default {
           let IPSdata = tools.dataForKey(this.tableData[row.row], val);
           this.filesArr = IPSdata ? IPSdata : [];
           this.myDialog.uploadFiles = true;
-          break;
+          return false
         //安装照片--安装图纸--设备铭牌照片--设备图纸
         case 'LedgerParam.Siteinstall.InstallPic':
         case 'LedgerParam.Siteinstall.InstallDrawing':
@@ -738,13 +763,13 @@ export default {
           let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
           this.imgsArr = SSPPdata ? SSPPdata : [];
           this.myDialog.uploadImgs = true;
-          break;
+          return false
         //设备照片
         case 'LedgerParam.PhotoDoc.Pic':
           let Pdata = tools.dataForKey(this.tableData[row.row], val);
           this.picsArr = Pdata ? Pdata : [];
           this.myDialog.pic = true;
-          break;
+          return false
         //包含的部件字段
         case 'Count':
           if (this.onlyRead) {
@@ -752,10 +777,24 @@ export default {
           } else {
             this.$router.push({ path: '/ledger/partsmanage', query: { deviceId: infos.EquipID, typeId: this.mess.deviceId } });
           }
-          break;
+          return false
         default:
           break;
       }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val)
+        this.myDialog.update = true
+      }
+    },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+      this.updateInputShow = false
+      this.updateInput = ''
+    },
+    //更新临时维护信息点
+    handleClickUpdate(){
+      this.updateInputShow = false
+      this.updateInput = ''
     },
     //获取被筛选掉的行号
     trimmedRows() {

+ 96 - 84
src/components/ledger/lib/linkassets.vue

@@ -2,17 +2,26 @@
   <el-dialog title="批量关联资产" :visible.sync="dialog.linkAssets" width="700px">
     <el-row>
       <span class="condition-title">设备类型:</span>
-      <el-select v-model="deviceType" filterable size="small" @change="handleChangeDevice" style="width:250px;">
+      <el-select v-model="deviceType" filterable size="small" @change="handleChangeDevice" style="width:350px;">
         <el-option  v-for="item in deviceTypeList" :key="item.Category" :label="item.CategoryName" :value="item.Category"></el-option>
       </el-select>
     </el-row>
     <el-row style="margin-top:30px;">
       <span class="condition-title">建筑楼层:</span>
-      <el-cascader :options="bfoptions" v-model="buildFloor" filterable size="small" @change="handleChangeBf" style="width:250px;"></el-cascader>
+      <el-cascader :options="bfoptions" v-model="buildFloor" filterable size="small" @change="handleChangeBf" style="width:350px;"></el-cascader>
     </el-row>
-    <el-row style="margin-top:30px;" v-if="spaceShow">
-      <span class="condition-title">分区类型空间实例:</span>
-      <el-cascader v-model="space" filterable clearable collapse-tags size="small" :options="spaceList" :props="props" @active-item-change='handleChangeSpaceItem' style="width:250px;"></el-cascader>
+    <el-row style="margin-top:30px;"  v-show="spaceShow">
+      <span class="condition-title">分区类型:</span>
+      <el-select v-model="zone" filterable size="small" @change="handleChangeZone" style="width:350px;">
+        <el-option  v-for="item in zoneList" :key="item.Code" :label="item.Name" :value="item.Code"></el-option>
+      </el-select>
+    </el-row>
+    <el-row style="margin-top:30px;" v-show="spaceShow && zone != 'all' && zone != 'noKnow'">
+      <span class="condition-title">空间实例:</span>
+      <el-select v-model="space" multiple filterable collapse-tags style="width:350px;" placeholder="请选择">
+        <el-option v-for="item in spaceList" :key="item.value" :label="item.label" :value="item.value">
+        </el-option>
+      </el-select>
     </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button @click="handleClickClose">取 消</el-button>
@@ -45,14 +54,11 @@ export default {
       buildFloor: ['all'], //选择的建筑楼层
       deviceTypeList: [], //未关联资产的设备或部件列表
       deviceType: '', //选择的设备类型
+      zone: 'all', //空间分区
+      zoneList: [], //空间分区列表
       spaceList: [], //空间实例列表
       space: [], //选择的空间实例
-      spaceShow: false,
-      props: { 
-        multiple: true,
-        children: 'children'
-      }, //多选级联配置
-
+      spaceShow: false
     };
   },
   created() {
@@ -153,84 +159,77 @@ export default {
         Projection: [ "Code", "Name" ]
       }
       queryDictionaryHead(params, res => {
-        this.spaceList = res.Content.map((item) => {
-          return {
-            label: item.Name,
-            value: item.Code,
-            children: []
-          }
+        this.zoneList = res.Content
+        this.zoneList.unshift({
+          Name: '全部',
+          Code: 'all'
         })
-        this.spaceList.unshift({
-          label: '不在任何业务空间内',
-          value: 'noKnow'
+        this.zoneList.push({
+          Name: '不在任何业务空间内',
+          Code: 'noKnow'
         })
       })
     },
     // 修改设备类型
-    handleChangeDevice() {
-
+    handleChangeDevice(val) {
+      this.zoneListIsShow()
     },
     // 修改建筑楼层
     handleChangeBf(val) {
-      let lastVal = val.slice(-1)[0]
-      // 重置空间实例选择
-      this.space = []
-      this.spaceList.map(item => {
-        if (item.children)
-        item.children = []
-      })
-      if(!lastVal || lastVal == 'noKnow' || val[0] == 'all') {
+      this.zoneListIsShow()
+    },
+    //判断是否显示空间分区选择
+    zoneListIsShow(){
+      let lastVal = this.buildFloor.slice(-1)[0]
+      if(!lastVal || lastVal == 'noKnow' || this.buildFloor[0] == 'all' || this.deviceType.length != 4) {
         this.spaceShow = false
       } else {
-        this.spaceShow = false
-        this.$nextTick(() => {
-          this.spaceShow = true
-        })
+        this.spaceShow = true
       }
     },
+    //修改分区类型
+    handleChangeZone() {
+      // 重置空间实例选择
+      this.space = []
+      this.spaceList = []
+
+      this.handleChangeSpaceItem()
+    },
     // 获取空间实例
-    handleChangeSpaceItem(val) {
-      let type = val[0]
-      if(val.length == 1) {
-        if(type) {
-          let zone = type,
-              nodes = []
-          let recursionGetData = (pageNum, zone) => {
-            pageNum = pageNum ? pageNum : 1
-            let params = {
-              zone: zone,
-              data: {
-                Orders: "CreateTime desc, RoomID asc",
-                PageNumber: pageNum,
-                PageSize: 1000,
-                Projection: ["RoomID", "RoomName", "RoomLocalName", "CreateTime"]
-              },
-            }
-            if(this.spaceShow) {
-              if(this.buildFloor.length == 2 && this.buildFloor[1] != 'all') {
-                params.data.Filters = `buildingId='${this.buildFloor[0]}';floorId='${this.buildFloor[1]}'`
-              } else {
-                params.data.Filters = `buildingId='${this.buildFloor[0]}'`
-              }
+    handleChangeSpaceItem() {
+      if(this.zone != 'all' && this.zone != 'noKnow') {
+        let nodes = []
+        let recursionGetData = (pageNum, zone) => {
+          pageNum = pageNum ? pageNum : 1
+          let params = {
+            zone: zone,
+            data: {
+              Orders: "CreateTime desc, RoomID asc",
+              PageNumber: pageNum,
+              PageSize: 1000,
+              Projection: ["RoomID", "RoomName", "RoomLocalName", "CreateTime"]
+            },
+          }
+          if(this.spaceShow) {
+            if(this.buildFloor.length == 2 && this.buildFloor[1] != 'all') {
+              params.data.Filters = `buildingId='${this.buildFloor[0]}';floorId='${this.buildFloor[1]}'`
+            } else {
+              params.data.Filters = `buildingId='${this.buildFloor[0]}'`
             }
-            queryZone(params, res => {
-              nodes = nodes.concat(res.Content.map(item => ({
-                value: item.RoomID,
-                label: item.RoomLocalName?item.RoomLocalName:item.RoomName
-              })))
-              if (res.Total / (res.PageSize * res.PageNumber) > 1) {
-                recursionGetData(res.PageNumber + 1, zone)
-              } else {
-                this.spaceList.map(item => {
-                  if(item.value == type) {
-                    item.children = nodes
-                  }
-                })
-              }
-            })
           }
-          recursionGetData(1, zone)
+          queryZone(params, res => {
+            nodes = nodes.concat(res.Content.map(item => ({
+              value: item.RoomID,
+              label: item.RoomLocalName?item.RoomLocalName:item.RoomName
+            })))
+            if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+              recursionGetData(res.PageNumber + 1, zone)
+            } else {
+              this.spaceList = nodes
+            }
+          })
         }
+        recursionGetData(1, this.zone)
       }
     },
     // 点击取消关闭弹窗
@@ -248,16 +247,29 @@ export default {
         this.$message.info('请选择建筑楼层!')
         return false
       }
-      if(this.spaceShow) {
-        query = {
-          deviceType: this.deviceType,
-          buildFloor: this.buildFloor,
-          spaceList: this.space.map(item => {
-            if(item[0] == 'noKnow')
-            return item[0]
-            if(item[1])
-            return item[1]
-          })
+      if(this.spaceShow) { //选择了空间
+        if(this.zone == 'all'){//全部空间
+          query = {
+            deviceType: this.deviceType,
+            buildFloor: this.buildFloor
+          }
+        } else if (this.zone == 'noKnow'){//不在空间内
+          query = {
+            deviceType: this.deviceType,
+            buildFloor: this.buildFloor,
+            spaceList: this.zone
+          }
+        } else {
+          if(this.space.length){//选择了具体的空间实例
+            query = {
+              deviceType: this.deviceType,
+              buildFloor: this.buildFloor,
+              spaceList: this.space
+            }
+          } else {
+            this.$message.info('请选择空间实例!')
+            return false
+          }
         }
       } else {
         query = {
@@ -279,7 +291,7 @@ export default {
 
 <style lang="less" scoped>
   .condition-title{
-    width: 200px;
+    width: 100px;
     display: inline-block;
     text-align: right;
     margin-left: 10px;

+ 3 - 6
src/utils/handsontable/notShow.js

@@ -139,6 +139,7 @@ let partsAddNoShow = [
     "InsurerFax",
 ]
 const showTools = {
+    InputModeArr: ["A1", "A2", "B1", "B2", "C5", "D1", "D1L", "D2", "E1", "E2", "L", "L1", "L2", "F1", "F2", "M"],
     addArr: () => {
         return cutArr
     },
@@ -1055,9 +1056,7 @@ const showTools = {
                 readOnly: onlyRead,
                 correctFormat: true
             };
-        } else if (item.InputMode == "A3" ||
-            item.InputMode == "A4" ||
-            item.InputMode == "B1" ||
+        } else if (item.InputMode == "B1" ||
             item.InputMode == "B2" ||
             item.InputMode == "F1" ||
             item.InputMode == "F2" ||
@@ -1166,9 +1165,7 @@ const showTools = {
                 readOnly: !item.Editable,
                 correctFormat: true
             };
-        } else if (item.InputMode == "A3" ||
-            item.InputMode == "A4" ||
-            item.InputMode == "B1" ||
+        } else if (item.InputMode == "B1" ||
             item.InputMode == "B2" ||
             item.InputMode == "F1" ||
             item.InputMode == "F2" ||

+ 3 - 1
src/views/ledger/facility/batchlink.vue

@@ -139,7 +139,9 @@ export default {
     
   },
   watch: {
-    projectId() {}
+    projectId() {
+      this.$router.push({ name: "facilityLedger" })
+    }
   },
   methods: {
     //返回