소스 검색

'信息维护'

shaun-sheep 5 년 전
부모
커밋
4f230b00dd
2개의 변경된 파일49개의 추가작업 그리고 45개의 파일을 삭제
  1. 45 39
      src/components/dialogs/list/batchDialog.vue
  2. 4 6
      src/components/ledger/handsontables/device.vue

+ 45 - 39
src/components/dialogs/list/batchDialog.vue

@@ -224,7 +224,6 @@
                 checkedFile: [],//多项
                 multipleSelection: [],//checkbox选择的对象数组
                 filterList: [],//过滤单项选择的值
-                allMessage: {},//收集所有数据
                 deviceList: [],//过滤全选数据
                 onlySelect: [],//检测是否有勾选单值信息
                 videoModel: {
@@ -343,7 +342,6 @@
                     });
                     return false
                 }
-                // this.multipleSelection 实例对象
                 let arr = []
                 // DPSupplierID 供应商 DPManufacturerID 生产商 DPBrandID 品牌
                 // DPSpecificationID 型号 DPInsurerID 保险商 DPMaintainerID 维修商
@@ -351,31 +349,25 @@
                     let EquipID = item.EquipID
                     arr.push({EquipID})
                 })
-
+                let Id = {}
                 let single = {
                     EquipManufactor: {
-                        Manufacturer: '', //生产商
-                        // venderId: '',
-                        Brand: '',//品牌
-                        brandId: '',
-                        Specification: '',//型号
-                        specificationId: ''
+                        // Manufacturer: '', //生产商
+                        // Brand: '',//品牌
+                        // Specification: '',//型号
                     },
                     SupplyPurchase: { //供应商
-                        SupplierWeb: '',
-                        Supplier: '',
-                        // venderId: ''
+                        // SupplierWeb: '',
+                        // Supplier: '',
                         // PurchasePrice: ''
                     },
                     OperationMainte: { //维修商
-                        Maintainer: '',
-                        // venderId: ''
+                        // Maintainer: '',
                     },
                     InsuranceDoc: {
-                        Insurer: '',
-                        InsurerWeb: '',
-                        // venderId: '',
-                        InsuranceFile: this.information.insuranceFile.InsuranceFile
+                        // Insurer: '',
+                        // InsurerWeb: '',
+                        InsuranceFile: this.information.insuranceFile.InsuranceFile ? this.information.insuranceFile.InsuranceFile : null
                     }
                 };
                 // this.deviceList 单选数组,取到需要数据
@@ -383,68 +375,77 @@
                 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
+                    Id.DPManufacturerID = venderId
                     single.EquipManufactor.Brand = brandName
-                    // single.EquipManufactor.brandId = brandId
+                    Id.DPBrandID = brandId
                     single.EquipManufactor.Specification = Specification
-                    // single.EquipManufactor.specificationId = specificationId
+                    Id.DPSpecificationID = 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
+                    Id.DPSupplierID = venderId
                 })
                 this.deviceList.filter(item => item.num === 35).forEach(i => {  //维修商
                     let {name, venderId} = i.info
                     single.OperationMainte.Maintainer = name
-                    // single.OperationMainte.venderId = venderId
+                    Id.DPMaintainerID = 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
+                    Id.DPInsurerID = venderId
                 })
                 // this.information 多选信息
                 let {archive, checkReport, drawing, installDrawing, installPic, insuranceFile, nameplate, pic} = this.information
                 let multiple = {
                     InsuranceDoc: {
-                        InsuranceFile: insuranceFile.InsuranceFile
+                        InsuranceFile: insuranceFile.InsuranceFile ? insuranceFile.InsuranceFile : null
                     },
                     PhotoDoc: {
-                        Archive: archive.Archive,
-                        Drawing: drawing.Drawing,
-                        Nameplate: nameplate.Nameplate,
-                        Pic: pic.Pic
+                        Archive: archive.Archive ? archive.Archive : null,
+                        Drawing: drawing.Drawing ? drawing.Drawing : null,
+                        Nameplate: nameplate.Nameplate ? nameplate.Nameplate : null,
+                        Pic: pic.Pic ? pic.Pic : null
                     },
                     Siteinstall: {
-                        InstallPic: installPic.InstallPic,
-                        InstallDrawing: installDrawing.InstallDrawing,
-                        CheckReport: checkReport.CheckReport
+                        InstallPic: installPic.InstallPic ? installPic.InstallPic : null,
+                        InstallDrawing: installDrawing.InstallDrawing ? installDrawing.InstallDrawing : null,
+                        CheckReport: checkReport.CheckReport ? checkReport.CheckReport : null
                     }
                 }
                 let LedgerParam = {}
                 if (this.radio === 1) { //组装数据,根据是覆盖该是增量,1是增量
                     //    1:单选数据
-                    let arr1 = this.deepCopy(arr)
-                    arr1.forEach(item => (item.LedgerParam = {...single}))
+                    let arr1 = this.deepCopy(arr).map(item => ({
+                        ...Id,
+                        ...item,
+                        LedgerParam: {...single}
+                    }))
                     //    2:多选数据
-                    let arr2 = this.deepCopy(arr)
-                    arr2.forEach(item => (item.LedgerParam = {...multiple}))
-                    console.log(arr1, arr2)
+                    let arr2 = this.deepCopy(arr).map(item => ({
+                        ...Id,
+                        ...item,
+                        LedgerParam: {...multiple}
+                    }))
                     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})
+                    let arr3 = this.deepCopy(arr).map(item => ({
+                        ...Id,
+                        ...item,
+                        LedgerParam: {...LedgerParam}
+                    }))
                     this.$emit('upDataDevice', 2, arr3)
                 }
                 this.closeDialog()
@@ -452,6 +453,11 @@
             closeDialog() {  //关闭弹窗,返回初始状态
                 this.batchDialog = false
                 this.active = 0
+                // this.checkedCities = []//清空单项的checkbox
+                // this.deviceList = [] //清空单选数组内容
+                // this.radio = 1 //返回到默认增量
+                // this.multipleSelection = [] //清空实例内容
+
             },
             handleSelectionChange(val) {
                 this.multipleSelection = val

+ 4 - 6
src/components/ledger/handsontables/device.vue

@@ -834,10 +834,11 @@ export default {
         },
         //  接受维护信息传来的code,显示弹窗
         fourVendors(code) {
+            this.firmDataType = 'dialog'
             switch (code) {
                 //品牌型号弹窗
                 case 'DPManufacturerID':
-                    this.dataFirmType = 'dia'
+                    // this.dataFirmType = 'dia'
                     this.myDialog.firm = true;
                     break;
                 //供应商信息弹窗
@@ -855,6 +856,7 @@ export default {
             }
         },
         multiple(val) {
+            this.firmDataType = 'dialog'
             switch (val) {
                 //设备文档--安装质检报告--保险文件
                 case 'archive':
@@ -916,6 +918,7 @@ export default {
             let inputMode = this.inputMap[val];
             this.row = row.row;
             this.messKey = val;
+            this.firmDataType = 'row'
             switch (val) {
                 //操作
                 case 'caozuo':
@@ -1088,11 +1091,6 @@ 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
             } else {