소스 검색

设备清单问题处理

zhangyu 5 년 전
부모
커밋
4785e97c7c
3개의 변경된 파일124개의 추가작업 그리고 132개의 파일을 삭제
  1. 4 4
      config/prod.env.js
  2. 14 22
      src/components/ledger/handsontables/device.vue
  3. 106 106
      src/utils/handsontable/notShow.js

+ 4 - 4
config/prod.env.js

@@ -1,8 +1,8 @@
 'use strict'
 'use strict'
 module.exports = {
 module.exports = {
     NODE_ENV: '"production"',
     NODE_ENV: '"production"',
-    // BASE_URL: '"http://172.16.0.239"', //测试iframe地址
-    // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
-    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
+    BASE_URL: '"http://172.16.0.239"', //测试iframe地址
+    SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
+    // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+    // SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
 }
 }

+ 14 - 22
src/components/ledger/handsontables/device.vue

@@ -60,7 +60,7 @@
     <!-- 二维码弹窗 -->
     <!-- 二维码弹窗 -->
     <qrcode :dialog="dialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <qrcode :dialog="dialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <!-- 型号弹窗 -->
     <!-- 型号弹窗 -->
-    <firm :mess="{deviceId: deviceType.code}" ref="firm" @changeFirm="firmChange" :dialog="dialog"></firm>
+    <firm :mess="{deviceId: deviceType.assetType}" ref="firm" @changeFirm="firmChange" :dialog="dialog"></firm>
     <!-- 供应商合同弹窗 -->
     <!-- 供应商合同弹窗 -->
     <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="dialog"></supply-dialog>
     <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="dialog"></supply-dialog>
     <!-- 供应商弹窗 -->
     <!-- 供应商弹窗 -->
@@ -547,7 +547,7 @@ export default {
       let arr = tools.copyArr(list)
       let arr = tools.copyArr(list)
       // 如果不是只读状态,添加四大厂商选择
       // 如果不是只读状态,添加四大厂商选择
       if (!this.onlyRead) {
       if (!this.onlyRead) {
-        // arr = showTools.arrToArr(arr)
+        arr = showTools.arrToArr(arr)
       }
       }
       let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2", "M"]
       let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2", "M"]
       if (!this.onlyRead) {
       if (!this.onlyRead) {
@@ -569,7 +569,7 @@ export default {
       let arr = tools.copyArr(list)
       let arr = tools.copyArr(list)
       // 如果不是只读状态,添加四大厂商选择
       // 如果不是只读状态,添加四大厂商选择
       if (!this.onlyRead) {
       if (!this.onlyRead) {
-        // arr = showTools.arrToArr(arr)
+        arr = showTools.arrToArr(arr)
       }
       }
       let data = showTools.showTypes(arr, this.onlyRead, this.isWatch, this.allMess)
       let data = showTools.showTypes(arr, this.onlyRead, this.isWatch, this.allMess)
       data.map(item => {
       data.map(item => {
@@ -607,15 +607,6 @@ export default {
           renderer: tools.lookDetails
           renderer: tools.lookDetails
         }
         }
       );
       );
-      //   data.splice(1, 0, {
-      //     data: "flowBuild",
-      //     renderer: tools.customDropdownRenderer,
-      //     editor: "chosen",
-      //     chosenOptions: {
-      //       // multiple: true,//多选
-      //       data: this.floorData
-      //     }
-      //   })
       if (!!this.onlyRead) {
       if (!!this.onlyRead) {
         data.map(item => {
         data.map(item => {
           item.readOnly = true
           item.readOnly = true
@@ -1114,7 +1105,11 @@ export default {
       }
       }
 
 
       if (val == "infos.DPManufacturerID") {
       if (val == "infos.DPManufacturerID") {
-        this.dialog.firm = true;
+        if (!!infos.linkId) {
+          this.dialog.firm = true
+        } else {
+          this.$message("该设备无关联资产")
+        }
       }
       }
 
 
       if (val == "infos.SupplierContractID") {
       if (val == "infos.SupplierContractID") {
@@ -1148,9 +1143,7 @@ export default {
         }
         }
       }
       }
 
 
-      if (
-        val == "infos.DPSupplierID"
-      ) {
+      if (val == "infos.DPSupplierID") {
         if (!!infos.linkId) {
         if (!!infos.linkId) {
           this.dialog.supplier = true;
           this.dialog.supplier = true;
         } else {
         } else {
@@ -1159,15 +1152,14 @@ export default {
       }
       }
 
 
       if (val == "infos.DPMaintainerID") {
       if (val == "infos.DPMaintainerID") {
-        if (!!infos.linkId) {
+        // if (!!infos.linkId) {
           this.dialog.maintainer = true;
           this.dialog.maintainer = true;
-        } else {
-          this.$message("该设备无关联资产")
-        }
+        // } else {
+        //   this.$message("该设备无关联资产")
+        // }
       }
       }
 
 
-      if (
-        val == "infos.DPInsurerID") {
+      if (val == "infos.DPInsurerID") {
         if (!!infos.linkId) {
         if (!!infos.linkId) {
           this.dialog.insurer = true;
           this.dialog.insurer = true;
         } else {
         } else {

+ 106 - 106
src/utils/handsontable/notShow.js

@@ -1,6 +1,7 @@
 // 不显示的信息点数组
 // 不显示的信息点数组
 import text from "@/utils/handsontable/mainText"
 import text from "@/utils/handsontable/mainText"
 import tools from "@/utils/scan/tools"
 import tools from "@/utils/scan/tools"
+let InputModeArr = ["A1", "A2", "B1", "C5", "D1", "D2", "E1", "L", "L1", "L2", "F1", "F2", "M", "Own"]
 //在编辑模式下并且勾选隐藏自动填充的信息点不显示的字段
 //在编辑模式下并且勾选隐藏自动填充的信息点不显示的字段
 let noShowArr = [
 let noShowArr = [
         "Brand",
         "Brand",
@@ -420,125 +421,124 @@ const showTools = {
             if (item.InfoPointCode == "BIMLocation") {
             if (item.InfoPointCode == "BIMLocation") {
                 return undefined
                 return undefined
             }
             }
-            if (onlyRead || (!!typeArr && typeArr.indexOf(item.InputMode) > -1)) {
-                return undefined
-            }
-            if (item.Visible || !allMess) {
-                //固定不显示的code
-                if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
-                    return undefined
-                }
-
-                if (!showTools.isShow(item.InfoPointCode)) {
-                    if (isWatch && !onlyRead) {
+            if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
+                if (item.Visible || !allMess) {
+                    //固定不显示的code
+                    if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
                         return undefined
                         return undefined
                     }
                     }
-                }
 
 
-                if (item.InfoPointCode == "EquipQRCode" || item.InfoPointCode == "RoomQRCode") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: text.lookQRCode,
-                        readOnly: true
+                    if (!showTools.isShow(item.InfoPointCode)) {
+                        if (isWatch && !onlyRead) {
+                            return undefined
+                        }
                     }
                     }
-                }
 
 
-                //图片类型
-                if (
-                    item.InfoPointCode == "InstallPic" ||
-                    item.InfoPointCode == "InstallDrawing" ||
-                    item.InfoPointCode == "Nameplate" ||
-                    item.InfoPointCode == "Pic" ||
-                    item.InfoPointCode == "Drawing"
-                ) {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: text.picType,
-                        readOnly: true
+                    if (item.InfoPointCode == "EquipQRCode" || item.InfoPointCode == "RoomQRCode") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: text.lookQRCode,
+                            readOnly: true
+                        }
                     }
                     }
-                }
 
 
-                //文件类型
-                if (item.InfoPointCode == "InsuranceFile" ||
-                    item.InfoPointCode == "Archive" ||
-                    item.InfoPointCode == "CheckReport") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: text.fileType,
-                        readOnly: true
+                    //图片类型
+                    if (
+                        item.InfoPointCode == "InstallPic" ||
+                        item.InfoPointCode == "InstallDrawing" ||
+                        item.InfoPointCode == "Nameplate" ||
+                        item.InfoPointCode == "Pic" ||
+                        item.InfoPointCode == "Drawing"
+                    ) {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: text.picType,
+                            readOnly: true
+                        }
                     }
                     }
-                }
 
 
-                if (item.InputMode == "D1") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: tools.customDropdownRenderer,
-                        editor: "chosen",
-                        chosenOptions: {
-                            // multiple: true,//多选
-                            data: item.DataSource || ""
+                    //文件类型
+                    if (item.InfoPointCode == "InsuranceFile" ||
+                        item.InfoPointCode == "Archive" ||
+                        item.InfoPointCode == "CheckReport") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: text.fileType,
+                            readOnly: true
                         }
                         }
-                    };
-                } else if (item.InputMode == "A1" || item.InputMode == "A2") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        type: "numeric",
-                        numericFormat: {
-                            pattern: "0,0.00"
-                                // culture: 'de-DE' // use this for EUR (German),
-                                // more cultures available on http://numbrojs.com/languages.html
+                    }
+
+                    if (item.InputMode == "D1") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: tools.customDropdownRenderer,
+                            editor: "chosen",
+                            chosenOptions: {
+                                // multiple: true,//多选
+                                data: item.DataSource || ""
+                            }
+                        };
+                    } else if (item.InputMode == "A1" || item.InputMode == "A2") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            type: "numeric",
+                            numericFormat: {
+                                pattern: "0,0.00"
+                                    // culture: 'de-DE' // use this for EUR (German),
+                                    // more cultures available on http://numbrojs.com/languages.html
+                            }
+                        };
+                    } else if (item.InputMode == "C5") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            type: "date",
+                            dateFormat: "YYYY-MM-DD",
+                            correctFormat: true
+                        };
+                    } else if (
+                        item.InputMode == "B1" ||
+                        item.InputMode == "L" ||
+                        item.InputMode == "L1" ||
+                        item.InputMode == "L2" ||
+                        item.InputMode == "M"
+                    ) {
+                        return {
+                            data: "infos." + item.InfoPointCode
                         }
                         }
-                    };
-                } else if (item.InputMode == "C5") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        type: "date",
-                        dateFormat: "YYYY-MM-DD",
-                        correctFormat: true
-                    };
-                } else if (
-                    item.InputMode == "B1" ||
-                    item.InputMode == "L" ||
-                    item.InputMode == "L1" ||
-                    item.InputMode == "L2" ||
-                    item.InputMode == "M"
-                ) {
-                    return {
-                        data: "infos." + item.InfoPointCode
-                    };
-                } else if (
-                    item.InputMode == "X" ||
-                    item.InputMode == "F2"
-                    // item.InputMode == "L1" ||
-                    // item.InputMode == "L2"
-                ) {
-                    //   return undefined
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        readOnly: true
-                    };
-                } else if (item.InputMode == "D2") {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: tools.customDropdownRenderer,
-                        editor: "chosen",
-                        chosenOptions: {
-                            multiple: true, //多选
-                            data: item.DataSource || ""
+                    } else if (
+                        item.InputMode == "X" ||
+                        item.InputMode == "F2"
+                    ) {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            readOnly: true
+                        };
+                    } else if (item.InputMode == "D2") {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: tools.customDropdownRenderer,
+                            editor: "chosen",
+                            chosenOptions: {
+                                multiple: true, //多选
+                                data: item.DataSource || ""
+                            }
+                        };
+                    } else if (item.InputMode == "Own" && !onlyRead) {
+                        return {
+                            data: "infos." + item.InfoPointCode,
+                            renderer: text.idType,
+                        }
+                    } else {
+                        return {
+                            data: "infos." + item.InfoPointCode
                         }
                         }
-                    };
-                } else if (item.InputMode == "Own" && !onlyRead) {
-                    return {
-                        data: "infos." + item.InfoPointCode,
-                        renderer: text.idType,
                     }
                     }
                 } else {
                 } else {
-                    return undefined;
+                    return undefined
                 }
                 }
             } else {
             } else {
                 return undefined
                 return undefined
             }
             }
-
         }).filter(item => item);
         }).filter(item => item);
         return data
         return data
     },
     },
@@ -556,7 +556,7 @@ const showTools = {
             if (item.InfoPointCode == "BIMLocation") {
             if (item.InfoPointCode == "BIMLocation") {
                 return undefined
                 return undefined
             }
             }
-            if (onlyRead || (!!readArr && readArr.indexOf(item.InputMode) > -1)) {
+            if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
                 if (item.Visible || !allMess) {
                 if (item.Visible || !allMess) {
                     if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
                     if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
                         return undefined
                         return undefined
@@ -576,7 +576,7 @@ const showTools = {
                     return undefined
                     return undefined
                 }
                 }
             } else {
             } else {
-                return undefined;
+                return undefined
             }
             }
         }).filter(d => d);
         }).filter(d => d);
         return data
         return data
@@ -594,7 +594,7 @@ const showTools = {
             if (item.InfoPointCode == "BIMLocation") {
             if (item.InfoPointCode == "BIMLocation") {
                 return undefined
                 return undefined
             }
             }
-            if (onlyRead || (!!typeArr && typeArr.indexOf(item.InputMode) > -1)) {
+            if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
                 if (item.Visible || !allMess) {
                 if (item.Visible || !allMess) {
                     //固定不显示的code
                     //固定不显示的code
                     if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
                     if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
@@ -719,7 +719,7 @@ const showTools = {
             if (item.InfoPointCode == "BIMLocation") {
             if (item.InfoPointCode == "BIMLocation") {
                 return undefined
                 return undefined
             }
             }
-            if (onlyRead || (!!readArr && readArr.indexOf(item.InputMode) > -1)) {
+            if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
                 if (item.Visible || !allMess) {
                 if (item.Visible || !allMess) {
                     if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
                     if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
                         return undefined
                         return undefined
@@ -758,7 +758,7 @@ const showTools = {
             if (item.Path == "BIMLocation") {
             if (item.Path == "BIMLocation") {
                 return undefined
                 return undefined
             }
             }
-            if (onlyRead || (!!typeArr && typeArr.indexOf(item.InputMode) > -1)) {
+            if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
                 if (item.Visible || !allMess) {
                 if (item.Visible || !allMess) {
                     //固定不显示的code
                     //固定不显示的code
                     if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
                     if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {