Sfoglia il codice sorgente

'信息维护测试'

shaun-sheep 5 anni fa
parent
commit
86108c1fdc

+ 7 - 1
src/api/scan/request.js

@@ -1,6 +1,7 @@
 import fetch from './fetch'
-import { api, physics, business, venders, baseUrl, zone } from './config.js'
+import {api, baseUrl, business, physics, venders, zone} from './config.js'
 import http from './httpUtil'
+
 let arithmetic = '/arithmetic'
 
 var Comming = 'revit'
@@ -980,6 +981,11 @@ export function queryProperty(param, success) {
     http.postJson(url, param, success)
 }
 
+// 修改设备的附件功能
+export function queryUpdate(param, success) {
+    let url = `${baseUrl}/equip-component/equip-query/update`;
+    http.postJson(url, param, success)
+}
 //查询资产 同时关联设备信息
 export function propertyLinkEq(param, success) {
     let url = `${baseUrl}/equip-component/property/property-query`;

+ 211 - 65
src/components/dialogs/list/batchDialog.vue

@@ -18,7 +18,7 @@
             />
         </el-steps>
         <hr>
-        <div v-if="active === 0">
+        <div v-show="active === 0">
             <section>
                 <p class="text-message">维护只有单值的信息点</p>
                 <span class="small">请选择需维护的信息点</span>
@@ -57,56 +57,82 @@
                     <el-radio :label="2">以覆盖方式维护</el-radio>
                 </el-radio-group>
                 <div style="margin: 15px "></div>
-                <!--                <el-checkbox-group-->
-                <!--                    v-model="checkedFile"-->
-                <!--                    @change="handleCheckedFileChange"-->
-                <!--                >-->
-                <!--                    <el-checkbox-->
-                <!--                        v-for="(file,index) in newFolder"-->
-                <!--                        :label="file"-->
-                <!--                        :key="index"-->
-
-                <!--                    >-->
-                <!--                        <span @click="fourVendors(file)"> {{file.name}}:</span>-->
-                <!--                        <span v-for="name in file.img">{{name}}   </span>-->
-                <!--                    </el-checkbox>-->
-                <!--                </el-checkbox-group>-->
                 <div class="checkbox">
                     <p>
-                        <el-checkbox @change="multiple('archive')">
+                        <el-checkbox
+                            v-model="videoModel.archive"
+                            @change="multiple('archive')"
+                        > <!--设备文档-->
                             {{information.archive.name}}
                         </el-checkbox>
                         <span v-for="item in information.archive.Archive">{{item | filterImgName}}</span>
                     </p>
                     <p>
-                        <el-checkbox @change="multiple('checkPoint')">
-                            {{information.checkPoint.name}}
+                        <el-checkbox
+                            v-model="videoModel.checkReport"
+                            @change="multiple('checkReport')"
+                        ><!--安装质检报告-->
+                            {{information.checkReport.name}}
                         </el-checkbox>
-                        <span v-for="item in information.checkPoint.CheckReport">{{item | filterImgName}}</span>
+                        <span v-for="item in information.checkReport.CheckReport">{{item | filterImgName}}</span>
 
                     </p>
                     <p>
-                        <el-checkbox>{{information.drawing.name}}</el-checkbox>
+                        <el-checkbox
+                            v-model="videoModel.drawing"
+                            @change="multiple('drawing')"
+                        ><!--设备图纸-->
+                            {{information.drawing.name}}
+                        </el-checkbox>
+                        <span v-for="item in information.drawing.Drawing">{{item.key | filterImgName}}</span>
+
                     </p>
                     <p>
-                        <el-checkbox>{{information.installDrawing.name}}</el-checkbox>
+                        <el-checkbox
+                            v-model="videoModel.installDrawing"
+                            @change="multiple('installDrawing')"
+                        ><!--安装图纸-->
+                            {{information.installDrawing.name}}
+                        </el-checkbox>
+                        <span
+                            v-for="item in information.installDrawing.InstallDrawing">{{item.key | filterImgName}}</span>
                     </p>
 
                     <p>
-                        <el-checkbox>{{information.installPic.name}}</el-checkbox>
+                        <el-checkbox
+                            v-model="videoModel.installPic"
+                            @change="multiple('installPic')"
+                        ><!--安装照片-->
+                            {{information.installPic.name}}
+                        </el-checkbox>
+                        <span v-for="item in information.installPic.InstallPic">{{item.key | filterImgName}}</span>
                     </p>
                     <p>
-                        <el-checkbox @change="multiple('insuranceFile')">
+                        <el-checkbox
+                            v-model="videoModel.insuranceFile"
+                            @change="multiple('insuranceFile')"
+                        ><!--保险文件-->
                             {{information.insuranceFile.name}}
                         </el-checkbox>
                         <span v-for="item in information.insuranceFile.InsuranceFile">{{item | filterImgName}}</span>
 
                     </p>
                     <p>
-                        <el-checkbox>{{information.pic.name}}</el-checkbox>
+                        <el-checkbox
+                            v-model="videoModel.pic"
+                            @change="multiple('pic')"
+                        ><!--设备照片-->
+                            {{information.pic.name}}
+                        </el-checkbox>
+                        <span v-for="item in information.pic.Pic">{{item.key | filterImgName}}</span>
                     </p>
                     <p>
-                        <el-checkbox>{{information.nameplate.name}}</el-checkbox>
+                        <el-checkbox
+                            v-model="videoModel.nameplate"
+                            @change="multiple('nameplate')"><!--设备铭牌照片-->
+                            {{information.nameplate.name}}
+                        </el-checkbox>
+                        <span v-for="item in information.nameplate.Nameplate">{{item.key | filterImgName}}</span>
                     </p>
                 </div>
             </section>
@@ -117,11 +143,11 @@
             </el-button>
         </div>
         <div
-            v-if="active === 1"
+            v-show="active === 1"
             class="all-message"
         >
             <el-table
-                ref="nultipleTable"
+                ref="multipleTable"
                 :data="tableData"
                 tooltip-effect="dark"
                 style="width:100%;margin-bottom: 10px"
@@ -152,7 +178,6 @@
                 @change="getAllData"
                 :page="page"
             ></my-pagination>
-            <el-button @click="maintenanceAll">维护所有</el-button>
             <el-button
                 type="primary"
                 @click="maintenanceSelect"
@@ -195,12 +220,23 @@
                     num: 42
                     }
                 ],
-
-                radio: 1,
+                radio: 1, //1增加,2覆盖
                 checkedFile: [],//多项
                 multipleSelection: [],//checkbox选择的对象数组
                 filterList: [],//过滤单项选择的值
-
+                allMessage: {},//收集所有数据
+                deviceList: [],//过滤全选数据
+                onlySelect: [],//检测是否有勾选单值信息
+                videoModel: {
+                    archive: false,
+                    checkReport: false,
+                    drawing: false,
+                    installDrawing: false,
+                    insuranceFile: false,
+                    installPic: false,
+                    nameplate: false,
+                    pic: false
+                }
             }
         },
         watch:{
@@ -210,7 +246,7 @@
         },
         computed: {
             newFirm() {
-                this.firm.map((item, index) => {
+                this.firm.map(item => {
                     if (item.num === this.firmName.num) {
                         item.rname = this.firmName.name
                         item.info = this.firmName
@@ -219,14 +255,6 @@
                 })
                 return this.firm
             },
-            // informationList() {
-            //     let {name, code} = this.fileDataType
-            //     if (this.information.archive.code === code) {
-            //         this.information.archive[name] = this.fileDataType.img
-            //     }
-            //     this.$forceUpdate()
-            //     return this.information
-            // },
             tableData() {
                 this.allObject.map(item => {
                     let build = ''
@@ -247,30 +275,43 @@
         },
         filters: {
             filterImgName(value) {
-                if (value.length > 20) {
-                    return value.substr(0, 15) + '...'
+                if (value.length > 16) {
+                    return value.substring(0, 12) + '...'
+                } else {
+                    return value
                 }
             }
         },
         methods: {
-            next() { //下一步
+            next() { //下一步按钮
                 // if (this.active++ > 1) this.active = 0
-                // 如果单项全选
-                if (this.checkAll) {
-                    let deviceList = this.firm.filter(item => item.info)
-                    if (deviceList.length < 4) {
+                this.deviceList = this.firm.filter(item => item.info)
+                if (!this.onlySelect.length) { //对单项全选进行过滤
+                    this.$message({
+                        message: '还没有选择单值信息哦',
+                        type: 'warning'
+                    });
+                    return false
+                }
+                if (!this.deviceList.length) { //对单项全选进行过滤
+                    this.$message({
+                        message: '单值信息没有填写哦',
+                        type: 'warning'
+                    });
+                    return false
+                }
+                if (this.checkAll) {    // 如果单项全选
+                    if (this.deviceList.length < 4) { //对单项全选进行过滤
                         this.$message({
-                            message: '单值的信息点有未填写',
+                            message: '单值的信息点存在未填写',
                             type: 'warning'
                         });
+                        return false
                     } else {
-                        this.$emit('deviceList', deviceList)
-
+                        this.active++
                     }
                 } else {
-                    if (this.filterList.length) {
-                        this.$emit('deviceList', this.filterList)
-                    }
+                    this.active++
                 }
             },
             handleCheckChange(val) { //全选
@@ -279,6 +320,7 @@
 
             },
             handleCheckedCitiesChange(value) { //维护单项触发
+                this.onlySelect = value
                 this.filterList = value.filter(item => item.info)
                 let checkCount = value.length
                 this.checkAll = checkCount === this.firm.length
@@ -291,27 +333,127 @@
             },
             //    选择维护方式
             maintenance(val) {
-                if (val === 1) { //增量
+            },
 
+            maintenanceSelect() { //维护已选
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        message: '还没有选择实例哦',
+                        type: 'warning'
+                    });
+                    return false
                 }
-                if (val === 2) { //覆盖
+                // this.multipleSelection 实例对象
+                let arr = []
+                // DPSupplierID 供应商 DPManufacturerID 生产商 DPBrandID 品牌
+                // DPSpecificationID 型号 DPInsurerID 保险商 DPMaintainerID 维修商
+                this.multipleSelection.forEach(item => {
+                    let EquipID = item.EquipID
+                    arr.push({EquipID})
+                })
 
+                let single = {
+                    EquipManufactor: {
+                        Manufacturer: '', //生产商
+                        // venderId: '',
+                        Brand: '',//品牌
+                        brandId: '',
+                        Specification: '',//型号
+                        specificationId: ''
+                    },
+                    SupplyPurchase: { //供应商
+                        SupplierWeb: '',
+                        Supplier: '',
+                        // venderId: ''
+                        // PurchasePrice: ''
+                    },
+                    OperationMainte: { //维修商
+                        Maintainer: '',
+                        // venderId: ''
+                    },
+                    InsuranceDoc: {
+                        Insurer: '',
+                        InsurerWeb: '',
+                        // venderId: '',
+                        InsuranceFile: this.information.insuranceFile.InsuranceFile
+                    }
+                };
+                // this.deviceList 单选数组,取到需要数据
+                // 过滤数组,取对象
+                this.deviceList.filter(item => item.num === 2).forEach(i => { //型号
+                    let {venderName, brandName, Specification, venderId, brandId, specificationId} = i.info
+                    single.EquipManufactor.Manufacturer = venderName
+                    // single.EquipManufactor.venderId = venderId
+                    single.EquipManufactor.Brand = brandName
+                    // single.EquipManufactor.brandId = brandId
+                    single.EquipManufactor.Specification = Specification
+                    // single.EquipManufactor.specificationId = specificationId
+                })
+                this.deviceList.filter(item => item.num === 8).forEach(i => {  //供应商8
+                    let {website, name, venderId} = i.info
+                    single.SupplyPurchase.SupplierWeb = website
+                    single.SupplyPurchase.Supplier = name
+                    // single.SupplyPurchase.venderId = venderId
+                })
+                this.deviceList.filter(item => item.num === 35).forEach(i => {  //维修商
+                    let {name, venderId} = i.info
+                    single.OperationMainte.Maintainer = name
+                    // single.OperationMainte.venderId = venderId
+                })
+                this.deviceList.filter(item => item.num === 42).forEach(i => {  //保险
+                    let {website, name, venderId} = i.info
+                    single.InsuranceDoc.Insurer = name
+                    single.InsuranceDoc.InsurerWeb = website
+                    // single.InsuranceDoc.venderId = venderId
+                })
+                // this.information 多选信息
+                let {archive, checkReport, drawing, installDrawing, installPic, insuranceFile, nameplate, pic} = this.information
+                let multiple = {
+                    InsuranceDoc: {
+                        InsuranceFile: insuranceFile.InsuranceFile
+                    },
+                    PhotoDoc: {
+                        Archive: archive.Archive,
+                        Drawing: drawing.Drawing,
+                        Nameplate: nameplate.Nameplate,
+                        Pic: pic.Pic
+                    },
+                    Siteinstall: {
+                        InstallPic: installPic.InstallPic,
+                        InstallDrawing: installDrawing.InstallDrawing,
+                        CheckReport: checkReport.CheckReport
+                    }
                 }
-            },
-            maintenanceAll() { //维护所有
-                console.log(this.tableData)
-                // this.closeDialog()
-            },
-            maintenanceSelect() { //维护已选
-                console.log(this.multipleSelection)
-                // this.closeDialog()
+                let LedgerParam = {}
+                if (this.radio === 1) { //组装数据,根据是覆盖该是增量,1是增量
+                    //    1:单选数据
+                    let arr1 = this.deepCopy(arr)
+                    arr1.forEach(item => (item.LedgerParam = {...single}))
+                    //    2:多选数据
+                    let arr2 = this.deepCopy(arr)
+                    arr2.forEach(item => (item.LedgerParam = {...multiple}))
+                    console.log(arr1, arr2)
+                    this.$emit('upDataDevice', 1, arr1, arr2)
+
+                }
+                if (this.radio === 2) {
+                    let {InsuranceDoc, ...multiples} = multiple
+                    LedgerParam = {
+                        ...single,
+                        ...multiples
+
+                    };
+                    let arr3 = this.deepCopy(arr)
+                    arr3.forEach(item => item.LedgerParam = {...LedgerParam})
+                    this.$emit('upDataDevice', 2, arr3)
+                }
+                this.closeDialog()
             },
             closeDialog() {  //关闭弹窗,返回初始状态
                 this.batchDialog = false
                 this.active = 0
             },
-            handleSelectionChange(val) { //表格复选
-                console.log(val, this.multipleSelection, '表格按钮checkbox')
+            handleSelectionChange(val) {
                 this.multipleSelection = val
             },
             getAllData() {
@@ -319,6 +461,10 @@
             },
             multiple(val) {
                 this.$emit('multiple',val)
+            },
+
+            deepCopy(obj) {
+                return JSON.parse(JSON.stringify(obj))
             }
         }
     }

+ 8 - 2
src/components/dialogs/list/filesDialog.vue

@@ -58,6 +58,9 @@
         },
         created() {
         },
+        computed: {
+
+        },
         mounted() {
         },
         methods: {
@@ -69,8 +72,8 @@
                             this.information.archive.Archive = file
                             this.$emit("changeFile", this.information, this.firmDataType)
                             break
-                        case 'checkPoint':
-                            this.information.checkPoint.CheckReport = file
+                        case 'checkReport':
+                            this.information.checkReport.CheckReport = file
                             this.$emit("changeFile", this.information, this.firmDataType)
                             break
                         case 'insuranceFile':
@@ -82,6 +85,9 @@
                     this.$emit("changeFile", file, this.firmDataType)
 
                 }
+            },
+            deepCopy(obj) {
+                return JSON.parse((JSON.stringify(obj)))
             }
         },
     };

+ 147 - 126
src/components/dialogs/list/picDialog.vue

@@ -3,139 +3,160 @@
 -->
 
 <template>
-  <el-dialog title="上传图片" :visible.sync="dialog.pic" width="500px;">
-    <div style="max-height:500px;overflow-y:auto;">
-      <div>
-        <h3>设备图片</h3>
-        <upload-imgs :readOnly="read" :keysArr="picArrs" @change="imageItem" max="6"></upload-imgs>
-      </div>
-      <div>
-        <h3>视频</h3>
-        <upload-imgs
-          :accept="'video/*'"
-          type="video"
-          :keysArr="videoArr"
-          @change="videoItem"
-          :videoPicArr="videoPicArr"
-          max="2"
-          :readOnly="read"
-        ></upload-imgs>
-      </div>
-    </div>
-  </el-dialog>
+    <el-dialog title="上传图片" :visible.sync="dialog.pic" width="500px;">
+        <div style="max-height:500px;overflow-y:auto;">
+            <div>
+                <h3>设备图片</h3>
+                <upload-imgs
+                    :readOnly="read"
+                    :keysArr="picArrs"
+                    @change="imageItem"
+                    max="6"
+                />
+            </div>
+            <div>
+                <h3>视频</h3>
+                <upload-imgs
+                    :accept="'video/*'"
+                    type="video"
+                    :keysArr="videoArr"
+                    @change="videoItem"
+                    :videoPicArr="videoPicArr"
+                    max="2"
+                    :readOnly="read"
+                />
+            </div>
+        </div>
+    </el-dialog>
 </template>
 <script>
-import uploadImgs from "@/components/ledger/lib/uploadImgsName";
-import tools from "@/utils/scan/tools"
-export default {
-  components: {
-    uploadImgs
-  },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          pic: true
-        };
-      }
-    },
-    keysArr: {
-      type: Array,
-      default: function () {
-        return []
-      }
-    },
-    read: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      picArrs: [],
-      panoramaArr: [],
-      videoArr: [],
-      videoPicArr: [],
-      changeKeys: []
-    };
-  },
-  created() { },
-  mounted() { },
-  methods: {
-    imageItem(images) {
-      this.picArrs = images
-      this.change()
-    },
+    import uploadImgs from "@/components/ledger/lib/uploadImgsName";
+
+    export default {
+        components: {
+            uploadImgs
+        },
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        pic: true
+                    };
+                }
+            },
+            keysArr: {
+                type: Array,
+                default: function () {
+                    return []
+                }
+            },
+            read: {
+                type: Boolean,
+                default: false
+            },
+            firmDataType: {
+                type: String
+            },
+            information: {
+                type: Object
+            },
+            infoType: {
+                type: String
+            }
+        },
+        data() {
+            return {
+                picArrs: [],
+                panoramaArr: [],
+                videoArr: [],
+                videoPicArr: [],
+                changeKeys: []
+            };
+        },
+        created() {
+        },
+        mounted() {
+        },
+        methods: {
+            imageItem(images) {
+                this.picArrs = images
+                this.change()
+            },
 
-    panoramaItem(images) {
-      this.panoramaArr = images
-      this.change()
-    },
+            panoramaItem(images) {
+                this.panoramaArr = images
+                this.change()
+            },
 
-    videoItem(videos, pe, pics) {
-      this.videoArr = videos
-      this.videoPicArr = pics
-      this.change()
-    },
+            videoItem(videos, pe, pics) {
+                this.videoArr = videos
+                this.videoPicArr = pics
+                this.change()
+            },
 
-    change() {
-      //   let picsArr = this.getArr(this.picArrs, "设备图片", "image")
-      //   let videos = this.getArr(this.videoArr, "视频", "video")
-      //   let videoPics = this.getArr(this.videoPicArr, "视频资料", "image_video")
-      //   let panoramas = this.getArr(this.panoramaArr, "全景照片", "panorama")
-      let picsArr = this.picArrs
-      let videos = this.videoArr
-      let videoPics = this.videoPicArr
-      let panoramas = this.panoramaArr
-      this.changeKeys = picsArr.concat(videos).concat(videoPics).concat(panoramas)
-      console.log(this.changeKeys)
-      this.$emit("change", this.changeKeys)
-    },
+            change() {
+                //   let picsArr = this.getArr(this.picArrs, "设备图片", "image")
+                //   let videos = this.getArr(this.videoArr, "视频", "video")
+                //   let videoPics = this.getArr(this.videoPicArr, "视频资料", "image_video")
+                //   let panoramas = this.getArr(this.panoramaArr, "全景照片", "panorama")
+                let picsArr = this.picArrs
+                let videos = this.videoArr
+                let videoPics = this.videoPicArr
+                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)
+                } else {
+                    this.$emit("change", this.changeKeys)
 
-    getArr(arr, name, type) {
-      return arr.map(item => {
-        return { "systemId": "dataPlatform", "name": name, "type": type, "key": item }
-      })
-    },
+                }
+            },
 
-    //将父组件传来的数据进行分组
-    fatherTochild() {
-      this.panoramaArr = []
-      this.videoArr = []
-      this.videoPicArr = []
-      this.picArrs = []
-      if (this.keysArr instanceof Array) {
-        this.keysArr.map(item => {
-          if (item.type == 'panorama') {
-            this.panoramaArr.push(item)
-          } else if (item.type == "video") {
-            this.videoArr.push(item)
-          } else if (item.type == 'image_video') {
-            this.videoPicArr.push(item)
-          } else {
-            this.picArrs.push(item)
-          }
-        })
-      } else {
-        this.panoramaArr = []
-        this.videoArr = []
-        this.videoPicArr = []
-        this.picArrs = []
-      }
-    }
-  },
-  watch: {
-    dialog: {
-      deep: true,
-      handler: function () {
-        if (this.dialog.pic) {
-          this.fatherTochild()
+            getArr(arr, name, type) {
+                return arr.map(item => {
+                    return {"systemId": "dataPlatform", "name": name, "type": type, "key": item}
+                })
+            },
+
+            //将父组件传来的数据进行分组
+            fatherTochild() {
+                this.panoramaArr = []
+                this.videoArr = []
+                this.videoPicArr = []
+                this.picArrs = []
+                if (this.keysArr instanceof Array) {
+                    this.keysArr.map(item => {
+                        if (item.type == 'panorama') {
+                            this.panoramaArr.push(item)
+                        } else if (item.type == "video") {
+                            this.videoArr.push(item)
+                        } else if (item.type == 'image_video') {
+                            this.videoPicArr.push(item)
+                        } else {
+                            this.picArrs.push(item)
+                        }
+                    })
+                } else {
+                    this.panoramaArr = []
+                    this.videoArr = []
+                    this.videoPicArr = []
+                    this.picArrs = []
+                }
+            }
+        },
+        watch: {
+            dialog: {
+                deep: true,
+                handler: function () {
+                    if (this.dialog.pic) {
+                        this.fatherTochild()
+                    }
+                }
+            }
         }
-      }
-    }
-  }
-};
+    };
 </script>
 <style>
-</style>
+</style>

+ 68 - 34
src/components/dialogs/list/uploadImgDialog.vue

@@ -10,47 +10,81 @@
   </el-dialog>
 </template>
 <script>
-import uploadImgs from "@/components/ledger/lib/uploadImgs";
-export default {
-  components: {
-    uploadImgs
-  },
-  props: {
-    dialog: {
-      type: Object,
-      default: function () {
-        return {
-          uploadImgs: true
-        };
-      }
-    },
-    keysArr: {
-      type: Array,
-      default: function () {
-        return []
-      }
-    },
-    read: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {};
-  },
-  created() { },
-  mounted() { },
-  methods: {
+    import uploadImgs from "@/components/ledger/lib/uploadImgs";
+
+    export default {
+        components: {
+            uploadImgs
+        },
+        props: {
+            dialog: {
+                type: Object,
+                default: function () {
+                    return {
+                        uploadImgs: true
+                    };
+                }
+            },
+            keysArr: {
+                type: Array,
+                default: function () {
+                    return []
+                }
+            },
+            read: {
+                type: Boolean,
+                default: false
+            },
+            firmDataType: {
+                type: String
+            },
+            information: {
+                type: Object
+            },
+            infoType: {
+                type: String
+            }
+        },
+        data() {
+            return {};
+        },
+        created() {
+        },
+        mounted() {
+        },
+        methods: {
     deepcopy(obj) {
       console.log(obj, "out")
       return JSON.parse(JSON.stringify(obj));
     },
     changeItem(file) {
-      console.log(file, "changed")
-      this.$emit("changeFile", file)
+        if (this.firmDataType === 'dialog') {
+            let info = this.infoType
+            switch (info) {
+                case 'installPic':
+                    this.information.installPic.InstallPic = file
+                    this.$emit('changeFile', this.information, this.firmDataType)
+                    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
+            }
+        } else {
+            this.$emit("changeFile", file)
+        }
+
     }
   },
 };
 </script>
 <style>
-</style>
+</style>

+ 122 - 51
src/components/ledger/handsontables/device.vue

@@ -22,8 +22,13 @@
     <!-- 二维码弹窗 -->
     <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <!-- 型号弹窗 -->
-      <firm :mess="{deviceId: deviceType.assetType}" :firmDataType="firmDataType" ref="firm" @changeFirm="firmChange"
-            :dialog="myDialog"></firm>
+      <firm
+          :mess="{deviceId: deviceType.assetType}"
+          :firmDataType="firmDataType"
+          ref="firm"
+          @changeFirm="firmChange"
+          :dialog="myDialog"
+      ></firm>
     <!-- 供应商合同弹窗 -->
       <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"/>
     <!-- 供应商弹窗 -->
@@ -31,21 +36,39 @@
 
       <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="myDialog"/>
       <!--      上传文件-->
-      <upload-files-dialog :read="onlyRead ? true : false"
-                           ref="upload"
-                           @changeFile="fileChange"
-                           :keysArr="filesArr"
-                           :firmDataType="firmDataType"
-                           :information="information"
-                           :infoType="infoType"
-                           :dialog="myDialog"/>
+      <upload-files-dialog
+          :read="onlyRead ? true : false"
+          ref="upload"
+          @changeFile="fileChange"
+          :keysArr="filesArr"
+          :firmDataType="firmDataType"
+          :information="information"
+          :infoType="infoType"
+          :dialog="myDialog"
+      />
       <!--      上传图片-->
-      <upload-img-dialog :read="onlyRead ? true : false" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"/>
+      <upload-img-dialog
+          :read="onlyRead ? true : false"
+          @changeFile="imgChange"
+          :keysArr="imgsArr"
+          :dialog="myDialog"
+          :firmDataType="firmDataType"
+          :information="information"
+          :infoType="infoType"
+      />
       <!--      维修商信息-->
       <maintainer-dialog @changeMaintainer="changeMaintainer" :firmDataType="firmDataType" ref="maintainer"
                          :dialog="myDialog"/>
       <insurer-dialog @changeInsurer="changeInsurer" :firmDataType="firmDataType" ref="insurer" :dialog="myDialog"/>
-      <pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"/>
+      <pic-dialog
+          :read="onlyRead ? true : false"
+          :dialog="myDialog"
+          :keysArr="picsArr"
+          @change="changePics"
+          :firmDataType="firmDataType"
+          :information="information"
+          :infoType="infoType"
+      />
     <div class=" middle_sty" style="height: 91%; text-align:center" v-show="!mess.deviceId && (!tableData || !tableData.length)">
       <p>
         <i class="icon-wushuju iconfont"></i>
@@ -101,9 +124,9 @@
           :allObject="allObject"
           :page="batchPage"
           :information="information"
-          @deviceList="deviceList"
           @getAllData="getAllData"
           @multiple="multiple"
+          @upDataDevice="upDataDevice"
       />
   </div>
 </template>
@@ -115,6 +138,7 @@
         getEquipBelongs,
         getEquipTableCon,
         queryEquip,
+        queryUpdate,
         updateEquip
     } from "@/api/scan/request";
 
@@ -185,6 +209,9 @@ export default {
             // return !(!this.onlyRead && this.copyMain)
             return !(!this.onlyRead && this.page.total > 1)
         },
+        batchDialogShow() {
+            return this.$refs.batchDialogs.batchDialog
+        }
     },
     data() {
         return {
@@ -263,7 +290,7 @@ export default {
                     code: 'LedgerParam.PhotoDoc.Archive',
                     num: 14
                 },
-                checkPoint: {
+                checkReport: {
                     CheckReport: [],//安装质检报告
                     name: '安装质检报告',
                     code: 'LedgerParam.Siteinstall.CheckReport',
@@ -390,6 +417,12 @@ export default {
                 let params = {
                     "Cascade": [
                         {
+                            "Name": "property",
+                            "Projection": [
+                                "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType"
+                            ]
+                        },
+                        {
                             "Name": "building",
                             "Projection": [
                                 "BuildLocalName", "BuildName", "BuildID"
@@ -800,7 +833,7 @@ export default {
             }
         },
         //  接受维护信息传来的code,显示弹窗
-        fourVendors(code,) {
+        fourVendors(code) {
             switch (code) {
                 //品牌型号弹窗
                 case 'DPManufacturerID':
@@ -819,59 +852,64 @@ export default {
                 case 'DPInsurerID':
                     this.myDialog.insurer = true;
                     break;
-                //安装照片--安装图纸--设备铭牌照片--设备图纸
-                case 'LedgerParam.Siteinstall.InstallPic':
-                case 'LedgerParam.Siteinstall.InstallDrawing':
-                case 'LedgerParam.PhotoDoc.Nameplate':
-                case 'LedgerParam.PhotoDoc.Drawing':
-                    this.myDialog.uploadImgs = true;
-                    break;
-                //设备照片
-                case 'LedgerParam.PhotoDoc.Pic':
-                    this.myDialog.pic = true;
-                    break;
-
             }
         },
         multiple(val) {
             switch (val) {
-                //保险文件--设备文档--安装质检报告
+                //设备文档--安装质检报告--保险文件
                 case 'archive':
                     let adata = this.information.archive.Archive;
                     this.filesArr = adata ? adata : [];
-                    this.infoType = 'archive'
-                    debugger
+                    this.infoType = 'archive';
                     this.myDialog.uploadFiles = true;
                     break;
-                case 'checkPoint':
-                    let cdata = this.information.checkPoint.CheckReport;
+                case 'checkReport':
+                    let cdata = this.information.checkReport.CheckReport;
                     this.filesArr = cdata ? cdata : [];
-                    this.infoType = 'checkPoint'
-                    debugger
+                    this.infoType = 'checkReport'
                     this.myDialog.uploadFiles = true;
                     break;
                 case 'insuranceFile':
                     let idata = this.information.insuranceFile.InsuranceFile;
                     this.filesArr = idata ? idata : [];
-                    this.infoType = 'insuranceFile'
+                    this.infoType = 'insuranceFile';
                     this.myDialog.uploadFiles = true;
                     break;
                 //安装照片--安装图纸--设备铭牌照片--设备图纸
-                case 'LedgerParam.Siteinstall.InstallPic':
-                case 'LedgerParam.Siteinstall.InstallDrawing':
-                case 'LedgerParam.PhotoDoc.Nameplate':
-                case 'LedgerParam.PhotoDoc.Drawing':
+                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 'LedgerParam.PhotoDoc.Pic':
+                case 'pic':
+                    let picData = this.information.pic.Pic;
+                    this.picsArr = picData ? picData : [];
+                    this.infoType = 'pic';
                     this.myDialog.pic = true;
                     break;
             }
         },
-        deviceList(data) {
-            console.log(data,'我是单项传来的单项值')
-        },
+
         //获取到了正确的信息
         getInfors(infos, row, el) {
             let val = this.hot.colToProp(row.col);
@@ -1050,10 +1088,13 @@ export default {
         //如果选择供应商之后
         supplierChange(data, type) {
             if (type === 'dialog') {
+                // let SupplyPurchase = {
+                //     SupplierWeb: data.website,
+                //     Supplier: data.name
+                // }
+                // let firm = {SupplyPurchase, num: 8}
                 let firm = {...data, num: 8}
                 this.firmName = firm
-                console.log(data, '供应商')
-                // this.maintenanceList.supplier = data
             } else {
                 tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
                 tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
@@ -1087,7 +1128,12 @@ export default {
         //选择型号修改
         firmChange(data, type) {
             if (type === 'dialog') { // 如果是批量信息维护
-                let firm = {...data, num: 2, name: `${data.venderName}/${data.brand}/${data.name}`}
+                let firm = {
+                    ...data,
+                    num: 2,
+                    Specification: data.name,
+                    name: `${data.venderName}/${data.brandName}/${data.name}`
+                }
                 this.firmName = firm //批量维护dialog显示对象的字段
             } else {  //如果是表格操作
                 tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
@@ -1153,21 +1199,30 @@ export default {
             if (type === 'dialog') {
                 this.information = keys
             } else {
+                console.log(keys, 'file keys')
                 this.setDataToMain(keys, this.messKey, this.row);
             }
         },
         //上传图片弹窗触发事件
-        imgChange(keys) {
-            console.log(keys, '上传图片返回的keys')
-            this.setDataToMain(keys, this.messKey, this.row);
+        imgChange(keys, type) {
+            if (type === 'dialog') {
+                this.information = keys
+            } else {
+                this.setDataToMain(keys, this.messKey, this.row);
+
+            }
         },
         //关联系统更改
         changeSystemType(data) {
             tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
         },
         //设备图片弹窗改变事件
-        changePics(keys) {
-            this.setDataToMain(keys, this.messKey, this.row);
+        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) {
@@ -1192,6 +1247,22 @@ export default {
         Batch() {
             this.firmDataType = 'dialog'
             this.$refs.batchDialogs.batchDialog = true
+        },
+        upDataDevice(type, data1, data2) {
+            let param = {Content: data1}
+            let param1 = {Content: data2}
+            if (type === 1) { //增量
+                queryUpdate(param1, res => {
+                })
+                updateEquip(param, res => {
+                });
+            }
+            if (type === 2) {//覆盖
+                updateEquip(param, res => {
+                });
+            }
+            this.getTableData()
+            this.getAllData()
         }
     },
     watch: {

+ 20 - 3
src/components/ledger/lib/uploadFiles.vue

@@ -10,13 +10,16 @@
 <template>
     <div id="saga-upload">
         <div id="uploadFile">
+
             <el-upload
                 v-if="filesArr.length < max"
                 class="upload-file"
                 action
+                :show-file-list="showFileList"
                 :http-request="uploadAndSubmit"
                 drag
             >
+
                 <el-button
                     size="small"
                     type="primary"
@@ -30,8 +33,9 @@
                 >请上传文件
                 </div>
             </el-upload>
+
             <div
-                v-if="item && filesArr.length"
+                v-show="item && filesArr.length"
                 v-for="(item,index) in filesArr"
             >
                 <el-button
@@ -82,7 +86,8 @@
         },
         data() {
             return {
-                filesArr: []
+                filesArr: [],
+                isShow: Boolean
             };
         },
         created() {
@@ -90,14 +95,26 @@
             this.fileFalg()
             // this.resetFile()
         },
+        computed: {
+            showFileList() {
+                if (this.firmDataType === 'dialog') {
+                    this.isShow = false
+                } else {
+                    this.isShow = true
+                }
+                return this.isShow
+            }
+        },
         methods: {
             //判断是否为空
             fileFalg() {
                 let type = typeof (this.keysArr)
                 if (type == 'string') {
                     this.filesArr = [this.keysArr]
+
                 } else {
                     this.filesArr = tools.deepCopy(this.keysArr)
+
                 }
 
                 if (!this.keysArr) {
@@ -106,7 +123,7 @@
             },
             //处理地址
             delFile(name) {
-                return name.length > 20 ? name.substring(0, 20) + "..." : ""
+                return name.length > 20 ? name.substring(0, 20) + "..." : name
             },
 
             resetFile() {

+ 1 - 1
src/components/ledger/lib/uploadImgsName.vue

@@ -34,7 +34,7 @@
           :accept="accept"
           action
           drag
-          style="position: relation"
+          style="position: relative"
         >
           <i class="el-icon-plus avatar-uploader-icon"></i>
         </el-upload>