Bläddra i källkod

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

haojianlong 4 år sedan
förälder
incheckning
9cdb95cdae

+ 43 - 171
src/components/dialogs/list/batchDialog.vue

@@ -44,7 +44,7 @@
               :key="index"
           >
             <span @click="fourVendors(city.code)"> {{city.name}}:</span>
-            <span>{{city.rname}}</span>
+            <span :title="city.rname">{{city.rname | filterImgNames}}</span>
           </el-checkbox>
         </el-checkbox-group>
       </section>
@@ -61,125 +61,20 @@
         </el-radio-group>
         <div style="margin: 15px "></div>
         <div class="checkbox">
-          <p>
+          <p v-for="(item,index) in newEnclosure">
             <el-checkbox
-                v-model="videoModel.archive"
-                @change="multiple('archive')"
-            > <!--设备文档-->
-              {{information.archive.name}}
+              v-model="form[item.Path]"
+            >
+            <span  @click="multiple(item.Path)">{{item.InfoPointName}}</span>
             </el-checkbox>
             <span
-                class="text-color"
-                v-for="item in information.archive.Archive"
-            >{{item.Name | filterImgName}}</span>
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.checkReport"
-                @change="multiple('checkReport')"
-            ><!--安装质检报告-->
-              {{information.checkReport.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.checkReport.CheckReport"
-            >{{item.Name | filterImgName}}</span>
-
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.drawing"
-                @change="multiple('drawing')"
-            ><!--设备图纸-->
-              {{information.drawing.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.drawing.Drawing"
-            >{{item.Key | filterImgName}}</span>
-
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.installDrawing"
-                @change="multiple('installDrawing')"
-            ><!--安装图纸-->
-              {{information.installDrawing.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.installDrawing.InstallDrawing"
-            >{{item.Key | filterImgName}}</span>
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.installPic"
-                @change="multiple('installPic')"
-            ><!--安装照片-->
-              {{information.installPic.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.installPic.InstallPic"
-            >{{item.Key | filterImgName}}</span>
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.insuranceFile"
-                @change="multiple('insuranceFile')"
-            ><!--保险文件-->
-              {{information.insuranceFile.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.insuranceFile.InsuranceFile"
-            >{{item.Name | filterImgName}}</span>
+              class="text-color"
+              v-for="i in item.value"
+            >{{i.Name | filterImgName}}</span>
 
           </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.pic"
-                @change="multiple('pic')"
-            ><!--设备照片-->
-              {{information.pic.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.pic.Pic"
-            >{{item.Key | filterImgName}}</span>
-          </p>
-          <p>
-            <el-checkbox
-                v-model="videoModel.nameplate"
-                @change="multiple('nameplate')"><!--设备铭牌照片-->
-              {{information.nameplate.name}}
-            </el-checkbox>
-            <span
-                class="text-color"
-                v-for="item in information.nameplate.Nameplate"
-            >{{item.Key | filterImgName}}</span>
-          </p>
         </div>
-<!--        test-->
-<!--        <br><br>-->
-<!--        <div class="checkbox">-->
-<!--          <p v-for="(item,index) in newEnclosure">-->
-<!--            <el-checkbox-->
-<!--              v-model="item.Path"-->
-<!--              @change="multiple(item.InfoPointCode)"-->
-<!--            > &lt;!&ndash;设备文档&ndash;&gt;-->
-<!--              {{item.InfoPointName}}-->
-<!--            </el-checkbox>-->
-<!--&lt;!&ndash;            <span&ndash;&gt;-->
-<!--&lt;!&ndash;              class="text-color"&ndash;&gt;-->
-<!--&lt;!&ndash;              v-for="item in information.archive.Archive"&ndash;&gt;-->
-<!--&lt;!&ndash;            >{{item.Name | filterImgName}}</span>  &ndash;&gt;-->
-<!--            <span-->
-<!--              class="text-color"-->
-<!--            ></span>-->
-<!--          </p>-->
-<!--        </div>-->
-<!--        /test-->
+
       </section>
       <el-button
           class="next-step"
@@ -242,13 +137,14 @@
 
 <script>
   import myPagination from "@/components/ledger/lib/myPagination"
-
+  import tools from "@/utils/buildfloor/tools";
   export default {
     name: "batchDialog",
     props: ['firmName', 'allObject', 'page', 'information','newEnclosure'],
     components: {myPagination},
     data() {
       return {
+        form:{},
         batchDialog: false,//dialog
         active: 0,//进度条
         checkAll: false,//全选
@@ -295,7 +191,15 @@
       information() {
         return this.information
       },
-
+      newEnclosure:{
+        immediate:true,
+        handler(val){
+          this.newEnclosure = val
+        }
+      }
+    },
+    created() {
+      this.$forceUpdate()
     },
     computed: {
       newFirm() {
@@ -328,11 +232,18 @@
     },
     filters: {
       filterImgName(value) {
-        if (value.length > 16) {
+        if (value && value.length > 16) {
           return value.substring(0, 12) + '...'
         } else {
           return value
         }
+      } ,
+      filterImgNames(value) {
+        if (value && value.length > 16) {
+          return value.substring(0, 16) + '...'
+        } else {
+          return value
+        }
       }
     },
     methods: {
@@ -470,58 +381,32 @@
         }
 
         // this.information 多选信息
-        let {archive, checkReport, drawing, installDrawing, installPic, insuranceFile, nameplate, pic} = this.information
-        let multiple = {
-          InsuranceDoc: insuranceFile.InsuranceFile.length || this.videoModel.insuranceFile ? {
-            InsuranceFile: (insuranceFile.InsuranceFile.length && this.videoModel.insuranceFile) ? insuranceFile.InsuranceFile : undefined
-          } : undefined,
-          PhotoDoc: archive.Archive.length || drawing.Drawing.length || nameplate.Nameplate.length || pic.Pic.length ? {
-            Archive: (archive.Archive.length && this.videoModel.archive) ? archive.Archive : undefined,
-            Drawing: (drawing.Drawing.length && this.videoModel.drawing) ? drawing.Drawing : undefined,
-            Nameplate: (nameplate.Nameplate.length && this.videoModel.nameplate) ? nameplate.Nameplate : undefined,
-            Pic: (pic.Pic.length && this.videoModel.pic) ? pic.Pic : undefined
-          } : undefined,
-          Siteinstall: installPic.InstallPic.length || installDrawing.InstallDrawing.length || checkReport.CheckReport.length ? {
-            InstallPic: (installPic.InstallPic.length && this.videoModel.installPic) ? installPic.InstallPic : undefined,
-            InstallDrawing: (installDrawing.InstallDrawing.length && this.videoModel.installDrawing) ? installDrawing.InstallDrawing : undefined,
-            CheckReport: (checkReport.CheckReport.length && this.videoModel.checkReport) ? checkReport.CheckReport : undefined
-          } : undefined
-        }
-        let LedgerParam = {}
+        let valuable = [], newValuable  = []
+        valuable = this.newEnclosure.filter(i=>this.form[i.Path] && i.value ).forEach(({ InfoPointCode, value }) => newValuable[InfoPointCode] = value);
+        // console.log( newValuable,'多选信息')
         if (this.radio === 1) { //组装数据,根据是覆盖该是增量,1是增量
           //    1:单选数据
           let arr1 = this.deepCopy(arr).map(item => ({
             ...Id,
             ...item,
             LedgerParam: {...single}
-
           }))
-          //    2:多选数据
-          let {InsuranceDoc, PhotoDoc, Siteinstall} = multiple
           let arr2 = this.deepCopy(arr).map(item => ({
             ...item,
-            ...InsuranceDoc,
-            ...PhotoDoc,
-            ...Siteinstall
-            // LedgerParam: {...multiple}
+            ...newValuable
           }))
           this.$emit('upDataDevice', 1, arr1, arr2)
-
         }
         if (this.radio === 2) {
-          let {InsuranceDoc, PhotoDoc, Siteinstall} = multiple
-          LedgerParam = {
-            ...single,
-            ...PhotoDoc,
-            ...Siteinstall
-          };
+          let param = {}
+          this.newEnclosure.forEach(({Path,value})=>param[Path] = value)
+          param =  tools.formatData(param)
           let arr3 = this.deepCopy(arr).map(item => ({
             ...Id,
             ...item,
-            LedgerParam: {...LedgerParam}
+            ...param
           }))
           this.$emit('upDataDevice', 2, arr3)
-
         }
         this.closeDialog()
       },
@@ -541,26 +426,13 @@
         this.onlySelect = []
         // this.deviceList = []
         this.radio = 1 //返回到默认增量
-        // this.multipleSelection = [] //清空实例内容
-        this.videoModel = {
-          archive: false,
-          checkReport: false,
-          drawing: false,
-          installDrawing: false,
-          insuranceFile: false,
-          installPic: false,
-          nameplate: false,
-          pic: false
+        //清空附件信息
+        for(let i in this.form)  {
+          this.form[i] = false
         }
-        let {archive, checkReport, drawing, installDrawing, installPic, insuranceFile, nameplate, pic} = this.information
-        archive.Archive = []
-        checkReport.CheckReport = []
-        drawing.Drawing = []
-        installDrawing.InstallDrawing = []
-        installPic.InstallPic = []
-        insuranceFile.InsuranceFile = []
-        nameplate.Nameplate = []
-        pic.Pic = []
+          this.newEnclosure.map(i=>{
+          this.$set(i,'value',[])
+        })
       },
       handleSelectionChange(val) {
         this.multipleSelection = val
@@ -569,7 +441,7 @@
         this.$emit('getAllData')
       },
       multiple(val) {
-        this.$emit('multiple', val)
+        this.$emit('multiples',val)
       },
 
       deepCopy(obj) {

+ 78 - 36
src/components/dialogs/list/filesDialog.vue

@@ -19,29 +19,29 @@
     </el-dialog>
 </template>
 <script>
-    import uploadFiles from "@/components/ledger/lib/uploadFiles";
+  import uploadFiles from "@/components/ledger/lib/uploadFiles";
 
-    export default {
-        components: {
-            uploadFiles
-        },
-        props: {
-            dialog: {
-                type: Object,
-                default: function () {
-                    return {
-                        uploadFiles: false
-                    };
-                }
-            },
-            keysArr: {
-                type: Array,
-                default: function () {
-                    return []
-                }
-            },
-            read: {
-                type: Boolean,
+  export default {
+    components: {
+      uploadFiles
+    },
+    props: {
+      dialog: {
+        type: Object,
+        default: function () {
+          return {
+            uploadFiles: false
+          };
+        }
+      },
+      keysArr: {
+        type: Array,
+        default: function () {
+          return []
+        }
+      },
+      read: {
+        type: Boolean,
                 default: false
             },
             firmDataType: {
@@ -68,20 +68,62 @@
             changeItem(file) {
                 if (this.firmDataType === 'dialog') {
                     let info = this.infoType;
-                    switch (info) {
-                        case 'archive':
-                            this.information.archive.Archive = file
-                            this.$emit("changeFile", this.information, this.firmDataType)
-                            break
-                        case 'checkReport':
-                            this.information.checkReport.CheckReport = file
-                            this.$emit("changeFile", this.information, this.firmDataType)
-                            break
-                        case 'insuranceFile':
-                            this.information.insuranceFile.InsuranceFile = file
-                            this.$emit("changeFile", this.information, this.firmDataType)
-                            break
-                    }
+                  switch (info) {
+                    case 'archive':
+                      this.information.archive.Archive = file
+                      this.$emit("changeFile", this.information, this.firmDataType)
+                      break
+                    case 'checkReport':
+                      this.information.checkReport.CheckReport = file
+                      this.$emit("changeFile", this.information, this.firmDataType)
+                      break
+                    case 'insuranceFile':
+                      this.information.insuranceFile.InsuranceFile = file
+                      this.$emit("changeFile", this.information, this.firmDataType)
+                      break;
+                    case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.PhotoDoc.Archive': //设备文档
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.Siteinstall.CheckReport': //安装质检报告
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.OperationMainte.MaintainManual': //维修保养手册
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.SupplyPurchase.ApproachingAcceptance': //进场验收单
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.SupplyPurchase.AcceptanceReport': //验收报告
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.PhotoDoc.OperationManual': //操作说明书
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.EquipManufactor.OriginalCertificate': //原厂证明
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.EquipManufactor.TestReport': //检测报告
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                    case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
+                      this.$emit("changeFile", info, this.firmDataType,file)
+                      break
+                  }
                 } else {
                     this.$emit("changeFile", file, this.firmDataType)
 

+ 4 - 2
src/components/dialogs/list/picDialog.vue

@@ -107,8 +107,10 @@
         let panoramas = this.panoramaArr
         this.changeKeys = picsArr.concat(videos).concat(videoPics).concat(panoramas)
         if (this.firmDataType === 'dialog') {
-          this.information.pic.Pic = this.changeKeys
-          this.$emit("change", this.information, this.firmDataType)
+          // this.information.pic.Pic = this.changeKeys
+          // this.$emit("change", this.information, this.firmDataType)
+          // this.$emit("change", this.information, this.firmDataType, this.changeKeys)
+          this.$emit("change", this.infoType, this.firmDataType, this.changeKeys)
         } else {
           this.$emit("change", this.changeKeys)
 

+ 28 - 22
src/components/dialogs/list/uploadImgDialog.vue

@@ -10,19 +10,19 @@
   </el-dialog>
 </template>
 <script>
-    import uploadImgs from "@/components/ledger/lib/uploadImgs";
+  import uploadImgs from "@/components/ledger/lib/uploadImgs";
 
-    export default {
-        components: {
-            uploadImgs
-        },
-        props: {
-            dialog: {
-                type: Object,
-                default: function () {
-                    return {
-                        uploadImgs: true
-                    };
+  export default {
+    components: {
+      uploadImgs
+    },
+    props: {
+      dialog: {
+        type: Object,
+        default: function () {
+          return {
+            uploadImgs: true
+          };
                 }
             },
             keysArr: {
@@ -66,16 +66,22 @@
                     break
                 case 'installDrawing':
                     this.information.installDrawing.InstallDrawing = file
-                    this.$emit('changeFile', this.information, this.firmDataType)
-                    break
-                case 'nameplate':
-                    this.information.nameplate.Nameplate = file
-                    this.$emit('changeFile', this.information, this.firmDataType)
-                    break
-                case 'drawing':
-                    this.information.drawing.Drawing = file
-                    this.$emit('changeFile', this.information, this.firmDataType)
-                    break
+                  this.$emit('changeFile', this.information, this.firmDataType)
+                  break
+              case 'nameplate':
+                this.information.nameplate.Nameplate = file
+                this.$emit('changeFile', this.information, this.firmDataType)
+                break
+              case 'drawing':
+                this.information.drawing.Drawing = file
+                this.$emit('changeFile', this.information, this.firmDataType)
+                break
+              case 'LedgerParam.Siteinstall.InstallPic':
+                this.$emit("changeFile", info, this.firmDataType, file)
+                break
+              case 'LedgerParam.PhotoDoc.Nameplate':
+                this.$emit("changeFile", info, this.firmDataType, file)
+                break
             }
         } else {
             this.$emit("changeFile", file)

+ 2 - 2
src/components/ledger/details/detail/exhibitionBaseInformation.vue

@@ -49,7 +49,7 @@
             >下载</a>
           </div>
         </div>
-        <el-button slot="reference" type="text">{{value.Value? '有':'-'}}</el-button>
+        <el-button slot="reference" type="text">{{value.Value.length >0 ? '有':'-'}}</el-button>
       </el-popover>
       <el-popover
         v-else-if="Array.isArray(value.Value) && value.InputMode=='N2'"
@@ -61,7 +61,7 @@
         <div style="text-align: center; margin: 0">
           <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
         </div>
-        <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
+        <el-button slot="reference" type="text">{{value.Value.length >0  ? '有' :'-'}}</el-button>
       </el-popover>
       <el-popover
         v-else-if="value.Value && value.Value.length  && `${value.InfoPointName}:${value.Value}`.length>21 "

+ 216 - 96
src/components/ledger/handsontables/device.vue

@@ -124,16 +124,16 @@
     </el-dialog>
     <!--      维护信息弹窗-->
     <batchDialog
-        ref="batchDialogs"
-        @code="fourVendors"
-        :firmName="firmName"
-        :allObject="allObject"
-        :page="batchPage"
-        :information="information"
-        :newEnclosure="newEnclosure"
-        @getAllData="getAllData"
-        @multiple="multiple"
-        @upDataDevice="upDataDevice"
+      ref="batchDialogs"
+      @code="fourVendors"
+      :firmName="firmName"
+      :allObject="allObject"
+      :page="batchPage"
+      :information="information"
+      :newEnclosure="newEnclosure"
+      @getAllData="getAllData"
+      @multiples="multiples"
+      @upDataDevice="upDataDevice"
     />
   </div>
 </template>
@@ -915,62 +915,162 @@
             break;
         }
       },
-      multiple(val) {
+      forValue(arr, val) {
+        let enclosure = []
+        arr && arr.length && arr.map(i => {
+          if (i.Path == val) {
+            enclosure = i.value
+          }
+        })
+        return enclosure
+      },
+      multiples(val) {
         this.firmDataType = 'dialog'
         switch (val) {
-          //设备文档--安装质检报告--保险文件
-          case 'archive':
-            let adata = this.information.archive.Archive;
-            this.filesArr = adata ? adata : [];
-            this.infoType = 'archive';
+          case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
             this.myDialog.uploadFiles = true;
             break;
-          case 'checkReport':
-            let cdata = this.information.checkReport.CheckReport;
-            this.filesArr = cdata ? cdata : [];
-            this.infoType = 'checkReport'
+          case 'LedgerParam.PhotoDoc.Archive': //设备文档
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
             this.myDialog.uploadFiles = true;
             break;
-          case 'insuranceFile':
-            let idata = this.information.insuranceFile.InsuranceFile;
-            this.filesArr = idata ? idata : [];
-            this.infoType = 'insuranceFile';
+          case 'LedgerParam.Siteinstall.CheckReport': //安装质检报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
             this.myDialog.uploadFiles = true;
             break;
-          //安装照片--安装图纸--设备铭牌照片--设备图纸
-          case 'installPic':
-            let insData = this.information.installPic.InstallPic;
-            this.imgsArr = insData ? insData : [];
-            this.infoType = 'installPic';
-            this.myDialog.uploadImgs = true;
+          case 'LedgerParam.OperationMainte.MaintainManual': //维修保养手册
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
             break;
-          case 'installDrawing':
-            let drawData = this.information.installDrawing.InstallDrawing;
-            this.imgsArr = drawData ? drawData : [];
-            this.infoType = 'installDrawing';
-            this.myDialog.uploadImgs = true;
+          case 'LedgerParam.SupplyPurchase.ApproachingAcceptance': //进场验收单
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.SupplyPurchase.AcceptanceReport': //验收报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.OperationManual': //操作说明书
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.EquipManufactor.OriginalCertificate': //原厂证明
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.EquipManufactor.TestReport': //检测报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+            case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
             break;
-          case 'nameplate':
-            let nDate = this.information.nameplate.Nameplate;
-            this.imgsArr = nDate ? nDate : [];
-            this.infoType = 'nameplate';
+          case 'LedgerParam.Siteinstall.InstallPic':
+            this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
             this.myDialog.uploadImgs = true;
             break;
-          case 'drawing':
-            let dDate = this.information.drawing.Drawing;
-            this.imgsArr = dDate ? dDate : [];
-            this.infoType = 'drawing';
+          case 'LedgerParam.PhotoDoc.Nameplate':
+            this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
             this.myDialog.uploadImgs = true;
             break;
           //设备照片
-          case 'pic':
-            let picData = this.information.pic.Pic;
-            this.picsArr = picData ? picData : [];
-            this.infoType = 'pic';
+          case 'LedgerParam.PhotoDoc.Pic':
+            this.picsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
             this.myDialog.pic = true;
             break;
         }
       },
+      // multiple(val) {
+      //   this.firmDataType = 'dialog'
+      //   switch (val) {
+      //     //设备文档--安装质检报告--保险文件
+      //     case 'archive':
+      //       let adata = this.information.archive.Archive;
+      //       this.filesArr = adata ? adata : [];
+      //       this.infoType = 'archive';
+      //       this.myDialog.uploadFiles = true;
+      //       break;
+      //     case 'checkReport':
+      //       let cdata = this.information.checkReport.CheckReport;
+      //       this.filesArr = cdata ? cdata : [];
+      //       this.infoType = 'checkReport'
+      //       this.myDialog.uploadFiles = true;
+      //       break;
+      //     case 'insuranceFile':
+      //       let idata = this.information.insuranceFile.InsuranceFile;
+      //       this.filesArr = idata ? idata : [];
+      //       this.infoType = 'insuranceFile';
+      //       this.myDialog.uploadFiles = true;
+      //       break;
+      //     //安装照片--安装图纸--设备铭牌照片--设备图纸
+      //     case 'installPic':
+      //       let insData = this.information.installPic.InstallPic;
+      //       this.imgsArr = insData ? insData : [];
+      //       this.infoType = 'installPic';
+      //       this.myDialog.uploadImgs = true;
+      //       break;
+      //     case 'installDrawing':
+      //       let drawData = this.information.installDrawing.InstallDrawing;
+      //       this.imgsArr = drawData ? drawData : [];
+      //       this.infoType = 'installDrawing';
+      //       this.myDialog.uploadImgs = true;
+      //       break;
+      //     case 'nameplate':
+      //       let nDate = this.information.nameplate.Nameplate;
+      //       this.imgsArr = nDate ? nDate : [];
+      //       this.infoType = 'nameplate';
+      //       this.myDialog.uploadImgs = true;
+      //       break;
+      //     case 'drawing':
+      //       let dDate = this.information.drawing.Drawing;
+      //       this.imgsArr = dDate ? dDate : [];
+      //       this.infoType = 'drawing';
+      //       this.myDialog.uploadImgs = true;
+      //       break;
+      //     //设备照片
+      //     case 'pic':
+      //       let picData = this.information.pic.Pic;
+      //       this.picsArr = picData ? picData : [];
+      //       this.infoType = 'pic';
+      //       this.myDialog.pic = true;
+      //       break;
+      //   }
+      // },
       //获取到了正确的信息
       getInfors(infos, row, el) {
           let val = this.hot.colToProp(row.col);
@@ -1284,58 +1384,78 @@
       }
 
     },
-    //修改关联的资产
-    changeProperty(val) {
-      this.setDataToMain(val.PropertyId, 'PropertyId', this.row);
-      this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
-    },
-    //上传文件弹窗触发事件
-    fileChange(keys, type) {
-      if (type === 'dialog') {
-        this.information = keys
-      } else {
-        this.setDataToMain(keys, this.messKey, this.row);
-      }
-    },
-    //上传图片弹窗触发事件
-    imgChange(keys, type) {
-      if (type === 'dialog') {
-        this.information = keys
-      } else {
-        this.setDataToMain(keys, this.messKey, this.row);
+      //修改关联的资产
+      changeProperty(val) {
+        this.setDataToMain(val.PropertyId, 'PropertyId', this.row);
+        this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
+      },
+      //上传文件弹窗触发事件
+      fileChange(keys, type, file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
 
-      }
-    },
-    //关联系统更改
-    changeSystemType(data) {
-      tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
-    },
-    //设备图片弹窗改变事件
-    changePics(keys, type) {
-      if (type === 'dialog') {
-        this.information = keys
-      } else {
-        this.setDataToMain(keys, this.messKey, this.row);
-      }
-    },
-    utilToKey(key, name, data, messName) {
-      if (key == name) {
-        this.setDataToMain(data[key], messName, this.row)
-      }
-    },
-    //判断是否有值,有值赋值
-    setDataToMain(data, key, row) {
-      if (!!data && data != '--') {
-        if (!!this.tableData[row]) {
-          tools.setDataForKey(this.tableData[row], key, data);
-          this.handleUpdataTable([[row, key, null, data]], "edit");
         } else {
-          this.tableData[row] = {};
-          tools.setDataForKey(this.tableData[row], key, data);
+          this.setDataToMain(keys, this.messKey, this.row);
+        }
+        this.$forceUpdate()
+      },
+      //上传图片弹窗触发事件
+      imgChange(keys, type, file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
+        } else {
+          this.setDataToMain(keys, this.messKey, this.row);
+
+        }
+      },
+      //关联系统更改
+      changeSystemType(data) {
+        tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
+      },
+      //设备图片弹窗改变事件
+      changePics(keys, type,file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
+        } else {
+          this.setDataToMain(keys, this.messKey, this.row);
+        }
+      },
+      utilToKey(key, name, data, messName) {
+        if (key == name) {
+          this.setDataToMain(data[key], messName, this.row)
+        }
+      },
+      //判断是否有值,有值赋值
+      setDataToMain(data, key, row) {
+        if (!!data && data != '--') {
+          if (!!this.tableData[row]) {
+            tools.setDataForKey(this.tableData[row], key, data);
+            this.handleUpdataTable([[row, key, null, data]], "edit");
+          } else {
+            this.tableData[row] = {};
+            tools.setDataForKey(this.tableData[row], key, data);
+          }
+        } else {
+          tools.setDataForKey(this.tableData[row], key, "");
         }
-      } else {
-        tools.setDataForKey(this.tableData[row], key, "");
-      }
     },
     //    批量信息维护
     Batch() {

+ 69 - 56
src/components/ledger/lib/uploadFiles.vue

@@ -8,7 +8,7 @@
   isShow: 图片的显示
  -->
 <template>
-  <div id="saga-upload">
+  <div id="saga-upload" v-loading="loading">
     <div id="uploadFile">
       <el-upload
           class="upload-file"
@@ -27,7 +27,7 @@
             slot="tip"
             class="el-upload__tip"
             v-if="!readOnly"
-        >请上传文件
+        >请上传文件,且不大于50M
         </div>
       </el-upload>
 
@@ -85,7 +85,8 @@
     data() {
       return {
         filesArr: [],
-        isShow: Boolean
+        isShow: Boolean,
+        loading:false
       };
     },
     created() {
@@ -148,61 +149,73 @@
 
         let file = item.file;
         // try sending
-        let reader = new FileReader();
-
-        let vm = this;
-
-        let fileType = file.name.split(".");
-        let type = fileType[fileType.length - 1];
-        let key = "&key=" + fileType[0] + file.uid + "." + type
-        let CreateTime = tools.formatDate(new Date(file.lastModified))
-        reader.onloadstart = function () {
-          // 这个事件在读取开始时触发
-        };
-        reader.onprogress = function (p) {
-          // 这个事件在读取进行中定时触发
-        };
-
-        reader.onload = function () {
-          // 这个事件在读取成功结束后触发
-        };
-        reader.onloadend = function () {
-          // 这个事件在读取结束后,无论成功或者失败都会触发
-          if (reader.error) {
-          } else {
-            // document.getElementById("bytesRead").textContent = file.size;
-            // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
-            var xhr = new XMLHttpRequest();
-            xhr.open(
-              /* method */
-              "POST",
-              /* target url */
-              "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
-              /*, async, default to true */
-            );
-            //xhr.overrideMimeType("application/octet-stream");
-            xhr.send(reader.result);
-            xhr.onreadystatechange = function () {
-              if (xhr.readyState == 4) {
-                console.log(xhr)
-                if (xhr.status == 200) {
-                  let fileObject = {
-                    Key: key.split("=")[1],
-                    Type: type,
-                    Name: file.name,
-                    CreateTime,
-                    SystemId: 'dataPlatform'
+        let size = item.file.size;
+        if( size > 50*1024*1024 ) { //文件大于50M
+          this.$message.error('文件不可大于50M,请重新上传')
+          return false
+        }
+        else {
+          let reader = new FileReader();
+          let vm = this;
+          let fileType = file.name.split(".");
+          let type = fileType[fileType.length - 1];
+          let key = "&key=" + fileType[0] + file.uid + "." + type
+          let CreateTime = tools.formatDate(new Date(file.lastModified))
+          reader.onloadstart = function () {
+            // 这个事件在读取开始时触发
+          };
+          reader.onprogress = function (p) {
+            // 这个事件在读取进行中定时触发
+            let value = (p.loaded / size) * 100;
+            console.log(p.loaded,size,value,'loaded')
+          };
+
+          reader.onload = function () {
+
+            // 这个事件在读取成功结束后触发
+          };
+          reader.onloadend = function () {
+
+            this.loading = false
+            // 这个事件在读取结束后,无论成功或者失败都会触发
+            if (reader.error) {
+            } else {
+              // document.getElementById("bytesRead").textContent = file.size;
+              // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+              var xhr = new XMLHttpRequest();
+              xhr.open(
+                /* method */
+                "POST",
+                /* target url */
+                "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
+                /*, async, default to true */
+              );
+              //xhr.overrideMimeType("application/octet-stream");
+              xhr.send(reader.result);
+              xhr.onreadystatechange = function () {
+                if (xhr.readyState == 4) {
+                  console.log(xhr)
+                  if (xhr.status == 200) {
+                    let fileObject = {
+                      Key: key.split("=")[1],
+                      Type: type,
+                      Name: file.name,
+                      CreateTime,
+                      SystemId: 'dataPlatform'
+                    }
+                    vm.filesArr.push(fileObject);
+                    this.loading =false
+                    vm.$emit("change", vm.filesArr, vm.defined);
+                  } else {
+                    this.$message.error(res.data.ResultMsg)
                   }
-                  vm.filesArr.push(fileObject);
-                  vm.$emit("change", vm.filesArr, vm.defined);
-                } else {
-                  this.$message.error(res.data.ResultMsg)
                 }
-              }
-            };
-          }
-        };
-        reader.readAsArrayBuffer(file);
+              };
+            }
+          };
+          reader.readAsArrayBuffer(file);
+        }
+
       }
     },
     watch: {

+ 0 - 1
src/utils/scan/tools.js

@@ -557,7 +557,6 @@ tools.setDataForKey = function (data, key, value) {
 tools.flattenKeys = function (obj) {
   if(obj == undefined) return
   let res = {}
-
   function isObject(val) {
     return typeof val === 'object' && !Array.isArray(val)
   }

+ 2 - 2
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -3,7 +3,7 @@
     <div class="condition">
       <div class="header">
         <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
-        <span>{{exampleData.RoomLocalName||exampleData.RoomName||''}}</span>
+        <span>{{exampleData ? exampleData.RoomLocalName||exampleData.RoomName :''}}</span>
       </div>
       <el-row class="spaceTypes">
         <div class="types">
@@ -221,7 +221,7 @@
             let cur = tools.dataForKey(this.exampleData, item.Path);
             if (cur) {
               this.criterias.push({
-                id: exampleData.EquipID,
+                id: this.exampleData.EquipID,
                 code: item.InfoPointCode
               })
             }

+ 1 - 5
src/views/ready/buildfloor/addFloor/index.vue

@@ -5,7 +5,7 @@
     </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible=false">取消</el-button>
-      <el-button size="small" type="primary" @click="confirm" :disabled="disabled">确认</el-button>
+      <el-button size="small" type="primary" @click="confirm" >确认</el-button>
     </span>
   </el-dialog>
 </template>
@@ -36,7 +36,6 @@
         return {
           dialogVisible: false, //弹窗显示与隐藏
           floorData: {},
-          disabled: false
         };
       },
       methods: {
@@ -62,7 +61,6 @@
         handleClose() { },
         //创建
         confirm() {
-          this.disabled = true
           this.$refs.formItems.submitForm(this.save)
         },
         save() {
@@ -77,14 +75,12 @@
               this.$message.success('更新成功')
               this.$emit('refresh')
               this.dialogVisible = false;
-              this.disabled = false
             })
           } else {
             manageCreateFloor(Param, res => {
               this.$message.success('创建成功')
               this.$emit('refresh')
               this.dialogVisible = false;
-              this.disabled = false
             })
           }
         }

+ 1 - 3
src/views/ready/buildfloor/index.vue

@@ -374,17 +374,15 @@
         } else {
           // 删除建筑
           if (this.tableData && this.tableData.length) {
+            this.buildDisabled = false
             this.$message.error("当前建筑中包含楼层,不可删除");
             this.delDialogVis = false;
-            this.buildDisabled = false
           } else {
             let param = [{BuildId: this.curBuildId}];
             this.$message.success("删除成功");
             this.delDialogVis = false;
             objectDeleteBuild(param, res => {
-              this.$message.success("删除成功");
               this.buildDisabled = false
-              this.delDialogVis = false;
               this.handleBuildQuery()
               this.init()
             })

+ 2 - 0
src/views/relation/data/index.vue

@@ -10,10 +10,12 @@
             :disabled="isDisabled"
         >重新转换
         </el-button>
+        <el-tooltip content="编辑转换规则" placement="top">
         <span
             class="iconfont icon-guizeyingyong"
             @click="dataTable"
         ></span>
+        </el-tooltip>
         <span>需补充转换规则的:{{replenishCount}}</span>
       </section>
     </div>