Browse Source

fix: 批量维护弹窗字段修复#2

quanchuan 4 years ago
parent
commit
02642ef461

+ 19 - 18
src/components/dialogs/list/batchDialog.vue

@@ -62,12 +62,12 @@
         <div style="margin: 15px "></div>
         <div class="checkbox">
           <p v-for="(item,index) in newEnclosure">
-            <el-checkbox v-model="form[item.Path]">
-            <span  @click="multiple(item.Path)"  style="cursor: pointer">{{item.InfoPointName}}</span>
+            <el-checkbox v-model="form[item.path]">
+            <span  @click="multiple(item.path)"  style="cursor: pointer">{{item.name}}</span>
             <span
               class="text-color"
               v-for="i in item.value"
-            >{{i.Name | filterImgName}}</span>
+            >{{i.name | filterImgName}}</span>
             </el-checkbox>
           </p>
         </div>
@@ -99,7 +99,7 @@
             label="设备本地名称"
             width=""
         >
-          <template slot-scope="scope">{{scope.row.name}}</template>
+          <template slot-scope="scope">{{scope.row.localName}}</template>
         </el-table-column>
         <el-table-column
             prop="localId"
@@ -317,9 +317,10 @@
         // DPSupplierID 供应商 DPManufacturerID 生产商 DPBrandID 品牌
         // DPSpecificationID 型号 DPInsurerID 保险商 DPMaintainerID 维修商
         this.multipleSelection.forEach(item => {
-          let EquipID = item.EquipID
-          arr.push({EquipID})
+          let id = item.id
+          arr.push({id})
         })
+
         let Id = {}
         let single = {};
         // this.filterList 单选数组,取到需要数据
@@ -327,10 +328,10 @@
         this.checkedCities.filter(item => item.num === 2).forEach(i => { //型号
           if (i.info) {
             let {venderName, brandName, Specification, venderId, brandId, specificationId} = i.info
-            single.EquipManufactor = {
-              Manufacturer: venderName,
-              Brand: brandName,
-              Specification: Specification
+            single.equipManufactor = {
+              manufacturer: venderName,
+              brand: brandName,
+              specification: Specification
             }
             Id.DPManufacturerID = venderId
             Id.DPBrandID = brandId
@@ -340,7 +341,7 @@
         this.checkedCities.filter(item => item.num === 8).forEach(i => {  //供应商8
           if (i.info) {
             let {website, name, venderId} = i.info
-            single.SupplyPurchase = {
+            single.supplyPurchase = {
               SupplierWeb: website,
               Supplier: name,
 
@@ -359,8 +360,8 @@
         })
         let insurance = this.checkedCities.filter(item => item.num === 42)
         let param = {}
-        this.newEnclosure.forEach(({Path, value}) => param[Path] = value)
-        let file = param['LedgerParam.InsuranceDoc.InsuranceFile']
+        this.newEnclosure.forEach(({path, value}) => param[path] = value)
+        let file = param['infos.insuranceFile']
         if (insurance.length) {
           insurance.forEach(i => {  //保险
             if (i.info) {
@@ -379,7 +380,7 @@
 
           if (this.radio === 2 && file && file.length > 0) {
             single.InsuranceDoc = {
-              InsuranceFile: file
+              insuranceFile: file
             }
           }
 
@@ -387,14 +388,14 @@
 
         // this.information 多选信息
         let valuable = [], newValuable  = []
-        valuable = this.newEnclosure.filter(i=>this.form[i.Path] && i.value ).forEach(({ InfoPointCode, value }) => newValuable[InfoPointCode] = value);
+        valuable = this.newEnclosure.filter(i=>this.form[i.path] && i.value ).forEach(({ code, value }) => newValuable[code] = value);
         // console.log( newValuable,'多选信息')
         if (this.radio === 1) { //组装数据,根据是覆盖该是增量,1是增量
           //    1:单选数据
           let arr1 = this.deepCopy(arr).map(item => ({
             ...Id,
             ...item,
-            LedgerParam: {...single}
+            infos: {...single}
           }))
           let arr2 = this.deepCopy(arr).map(item => ({
             ...item,
@@ -404,8 +405,8 @@
         }
         if (this.radio === 2) {
           let param = {},singleList = {}
-          this.newEnclosure.forEach(({Path, value}) => param[Path] = value)
-          singleList.LedgerParam = {...single}
+          this.newEnclosure.forEach(({path, value}) => param[path] = value)
+          singleList.infos = {...single}
           let pa = Object.assign(param,singleList)
           pa = tools.formatData(pa)
           let arr3 = this.deepCopy(arr).map(item => ({

+ 39 - 39
src/components/ledger/handsontables/device.vue

@@ -443,49 +443,49 @@ export default {
         archive: {
           Archive: [], //设备文档
           name: "设备文档",
-          code: "LedgerParam.PhotoDoc.Archive",
+          code: "infos.PhotoDoc.Archive",
           num: 14
         },
         checkReport: {
           CheckReport: [], //安装质检报告
           name: "安装质检报告",
-          code: "LedgerParam.Siteinstall.CheckReport",
+          code: "infos.Siteinstall.CheckReport",
           num: 18
         },
         drawing: {
           Drawing: [], //设备图纸
           name: "设备图纸",
-          code: "LedgerParam.PhotoDoc.Drawing",
+          code: "infos.PhotoDoc.Drawing",
           num: 13
         },
         installDrawing: {
           InstallDrawing: [], //安装图纸
           name: "安装图纸",
-          code: "LedgerParam.Siteinstall.InstallDrawing",
+          code: "infos.Siteinstall.InstallDrawing",
           num: 16
         },
         installPic: {
           InstallPic: [], //安装照片
           name: "安装照片",
-          code: "LedgerParam.Siteinstall.InstallPic",
+          code: "infos.Siteinstall.InstallPic",
           num: 17
         },
         insuranceFile: {
           InsuranceFile: [], //保险文件
           name: "保险文件",
-          code: "LedgerParam.InsuranceDoc.InsuranceFile",
+          code: "infos.InsuranceDoc.InsuranceFile",
           num: 11
         },
         nameplate: {
           Nameplate: [], //设备铭牌照片
           name: "设备铭牌照片",
-          code: "LedgerParam.PhotoDoc.Nameplate",
+          code: "infos.PhotoDoc.Nameplate",
           num: 12
         },
         pic: {
           Pic: [], //设备照片
           name: "设备照片",
-          code: "LedgerParam.PhotoDoc.Pic",
+          code: "infos.PhotoDoc.Pic",
           num: 15
         }
       },
@@ -1013,8 +1013,8 @@ export default {
       }
       let param = [];
       params.map(item => {
-        this.deleteCode = item.Category;
-        param.push({ EquipID: item.EquipID });
+        this.deleteCode = item.classCode;
+        param.push({ equipId: item.equipId });
       });
       this.$confirm("此操作将删除设备,是否继续?", "提示", {
         confirmButtonText: "确定",
@@ -1138,7 +1138,7 @@ export default {
       arr &&
       arr.length &&
       arr.map(i => {
-        if (i.Path == val) {
+        if (i.path == val) {
           enclosure = i.value;
         }
       });
@@ -1525,24 +1525,24 @@ export default {
         );
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.SupplyPurchase.Supplier",
+          "infos.SupplyPurchase.Supplier",
           data.name
         );
         this.handleUpdataTable(
           [
             [this.row, "DPSupplierID", null, data.venderId],
-            [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
+            [this.row, "infos.SupplyPurchase.Supplier", null, data.name]
           ],
           "edit"
         );
-        // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
+        // this.handleUpdataTable([[this.row, "infos.SupplyPurchase.Supplier", null, data.name]], "edit")
       }
     },
     //供应合同编号
     supplyChange(data) {
       tools.setDataForKey(
         this.tableData[this.row],
-        "LedgerParam.SupplyPurchase.SupplierContractID",
+        "infos.SupplyPurchase.SupplierContractID",
         { id: data }
       );
     },
@@ -1591,17 +1591,17 @@ export default {
         ); //型号ID
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.EquipManufactor.Manufacturer",
+          "infos.testReport",
           data.venderName
         );
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.EquipManufactor.Brand",
+          "infos.Brand",
           data.brandName
         );
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.EquipManufactor.Specification",
+          "infos.specification",
           data.name
         );
         this.handleUpdataTable(
@@ -1611,27 +1611,27 @@ export default {
             [this.row, "DPSpecificationID", null, data.specificationId],
             [
               this.row,
-              "LedgerParam.EquipManufactor.Manufacturer",
+              "infos.EquipManufactor.Manufacturer",
               null,
               data.venderName
             ],
             [
               this.row,
-              "LedgerParam.EquipManufactor.Brand",
+              "infos.EquipManufactor.Brand",
               null,
               data.brandName
             ],
             [
               this.row,
-              "LedgerParam.EquipManufactor.Specification",
+              "infos.EquipManufactor.Specification",
               null,
               data.name
             ]
           ],
           "edit"
         );
-        // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand]], "edit")
-        // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]], "edit")
+        // this.handleUpdataTable([[this.row, "infos.EquipManufactor.Brand", null, data.brand]], "edit")
+        // this.handleUpdataTable([[this.row, "infos.EquipManufactor.Specification", null, data.name]], "edit")
       }
     },
     //保险商变更
@@ -1647,17 +1647,17 @@ export default {
         );
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.InsuranceDoc.Insurer",
+          "infos.InsuranceDoc.Insurer",
           data.name
         );
         this.handleUpdataTable(
           [
             [this.row, "DPInsurerID", null, data.venderId],
-            [this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]
+            [this.row, "infos.InsuranceDoc.Insurer", null, data.name]
           ],
           "edit"
         );
-        // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
+        // this.handleUpdataTable([[this.row, "infos.InsuranceDoc.Insurer", null, data.name]], "edit")
       }
     },
     //维修商变更
@@ -1673,7 +1673,7 @@ export default {
         );
         tools.setDataForKey(
           this.tableData[this.row],
-          "LedgerParam.OperationMainte.Maintainer",
+          "infos.OperationMainte.Maintainer",
           data.name
         );
         this.handleUpdataTable(
@@ -1681,14 +1681,14 @@ export default {
             [this.row, "DPMaintainerID", null, data.venderId],
             [
               this.row,
-              "LedgerParam.OperationMainte.Maintainer",
+              "infos.OperationMainte.Maintainer",
               null,
               data.name
             ]
           ],
           "edit"
         );
-        // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
+        // this.handleUpdataTable([[this.row, "infos.OperationMainte.Maintainer", null, data.name]], "edit")
       }
     },
     //修改关联的资产
@@ -1705,7 +1705,7 @@ export default {
       if (type === "dialog") {
         // this.information = keys
         this.newEnclosure.forEach(i => {
-          if (i.Path == keys) {
+          if (i.path == keys) {
             this.$set(i, "value", file);
           }
           return i;
@@ -1719,7 +1719,7 @@ export default {
       if (type === "dialog") {
         // this.information = keys
         this.newEnclosure.forEach(i => {
-          if (i.Path == keys) {
+          if (i.path == keys) {
             this.$set(i, "value", file);
           }
           return i;
@@ -1737,7 +1737,7 @@ export default {
       if (type === "dialog") {
         // this.information = keys
         this.newEnclosure.forEach(i => {
-          if (i.Path == keys) {
+          if (i.path == keys) {
             this.$set(i, "value", file);
           }
           return i;
@@ -1772,7 +1772,7 @@ export default {
     },
     upDataDevice(type, data1, data2) {
       let param = { content: data1 };
-      let param1 = { Content: data2 };
+      let param1 = { content: data2 };
       if (type === 1) {
         //增量
         //LedgerParam
@@ -1804,17 +1804,17 @@ export default {
     },
     filterCheck(arr, type) {
       if (type === "sole") {
-        for (let i of arr.Content) {
-          return Object.keys(i.LedgerParam).length;
+        for (let i of arr.content) {
+          return Object.keys(i.infos).length;
         }
       } else if (type === "multiple") {
         let nArr = [];
-        arr.Content.forEach(i => {
-          let { EquipID, ...value } = i;
-          nArr.push({ LedgerParam: value });
+        arr.content.forEach(i => {
+          let { equipId, ...value } = i;
+          nArr.push({ infos: value });
         });
         for (let j of nArr) {
-          return Object.keys(j.LedgerParam).length;
+          return Object.keys(j.infos).length;
         }
       }
     }