Bladeren bron

资产-联调-待后台接口调整

shaun-sheep 4 jaren geleden
bovenliggende
commit
21dfa4c476

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

@@ -1180,7 +1180,16 @@ export function queryEquip(param, success) {
   let url = `${baseUrl}/datacenter/equip/query`;
   http.postJson(url, param, success)
 }
-
+// //资产清单 - 查询资产信息
+// export function queryProperty(param, success) {
+//   let url = `${baseUrl}/datacenter/property/query`;
+//   http.postJson(url, param, success)
+// }
+//资产清单 - 更新资产
+// export function updateProperty(param, success) {
+//   let url = `${baseUrl}/datacenter/property/update`;
+//   http.postJson(url, param, success)
+// }
 //查询项目下的设备或部件-根据项目、建筑、楼层、设备或部件分类、业务空间实例筛选设备 然后通过计算匹配资产
 export function equipCategoryProperty(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/equip-category-property?category=${param.category}${param.spaceIdList?param.spaceIdList:''}`;
@@ -1218,6 +1227,11 @@ export function queryUpdate(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/update`;
   http.postJson(url, param, success)
 }
+// 修改资产的附件功能
+export function propertyUpdate(param, success) {
+  let url = `${baseUrl}/equip-component/property/update`;
+  http.postJson(url, param, success)
+}
 //查询资产 同时关联设备信息
 export function propertyLinkEq(param, success) {
   let url = `${baseUrl}/equip-component/property/property-query`;

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

@@ -138,6 +138,7 @@
 <script>
   import myPagination from "@/components/ledger/lib/myPagination"
   import tools from "@/utils/buildfloor/tools";
+
   export default {
     name: "batchDialog",
     props: ['firmName', 'allObject', 'page', 'information','newEnclosure'],
@@ -360,24 +361,31 @@
           }
         })
         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']
         if (insurance.length) {
           insurance.forEach(i => {  //保险
             if (i.info) {
+
               let {website, name, venderId} = i.info
               single.InsuranceDoc = {
                 Insurer: name,
                 InsurerWeb: website,
-                InsuranceFile: this.information.insuranceFile.InsuranceFile.length && this.radio === 2 ? this.information.insuranceFile.InsuranceFile : undefined
+                InsuranceFile: file && file.length > 0 && this.radio === 2 ? file : ''
               }
               Id.DPInsurerID = venderId
+
             }
           })
         } else {
-          if (this.radio === 2 && this.information.insuranceFile.InsuranceFile.length) {
+
+          if (this.radio === 2 && file && file.length > 0) {
             single.InsuranceDoc = {
-              InsuranceFile: this.information.insuranceFile.InsuranceFile.length ? this.information.insuranceFile.InsuranceFile : undefined
+              InsuranceFile: file
             }
           }
+
         }
 
         // this.information 多选信息
@@ -398,13 +406,16 @@
           this.$emit('upDataDevice', 1, arr1, arr2)
         }
         if (this.radio === 2) {
-          let param = {}
-          this.newEnclosure.forEach(({Path,value})=>param[Path] = value)
-          param =  tools.formatData(param)
+          let param = {},singleList = {}
+          this.newEnclosure.forEach(({Path, value}) => param[Path] = value)
+          singleList.LedgerParam = {...single}
+          let pa = Object.assign(param,singleList)
+          pa = tools.formatData(pa)
           let arr3 = this.deepCopy(arr).map(item => ({
             ...Id,
             ...item,
-            ...param
+            ...pa,
+
           }))
           this.$emit('upDataDevice', 2, arr3)
         }

+ 0 - 1
src/components/dialogs/list/firm.vue

@@ -177,7 +177,6 @@ export default {
                         this.tableData = res.content
                     })
                 }
-                console.log(this.tableData)
             },
             handleChangeType(item) {
                 this.page.total = 0

+ 129 - 47
src/components/ledger/handsontables/assets.vue

@@ -15,24 +15,31 @@
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-button size="small" style="width: 80px;" @click="addDevice" icon="iconfont icon-tianjia">添加资产</el-button>
-<!--      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点-->
-<!--      </el-button>-->
+      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点
+      </el-button>
       <el-button size="small" style="width: 80px;" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
       <el-button v-show="!onlyRead" size="small" style="width: 80px;" @click="undo" icon="iconfont icon-undo">撤销
       </el-button>
     </div>
     <qrcode :qrcodeUrl="qrcodeUrl" :dialog="myDialog" :addBody="true" ref="qrcode"/>
-    <firm   :firmDataType="firmDataType" ref="firm" :mess="mess" @changeFirm="firmChange" :dialog="myDialog"/>
+    <firm
+      :firmDataType="firmDataType"
+      ref="firm"
+      :mess="mess"
+      @changeFirm="firmChange"
+      :dialog="myDialog"
+    />
     <supply-dialog @change="supplyChange" ref="supply" :id="id" :dialog="myDialog"/>
-    <supplier-dialog   :firmDataType="firmDataType" ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
+    <supplier-dialog :firmDataType="firmDataType" ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
     <guarantee-dialog @change="guaranteeChange" :id="id" ref="guarantee" :dialog="myDialog"/>
     <upload-files-dialog
-        :read="onlyRead ? true : false"
-        ref="upload"
-        @changeFile="fileChange"
-        :keysArr="filesArr"
-        :dialog="myDialog"
-        :firmDataType="firmDataType"
+      :read="onlyRead ? true : false"
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+      :firmDataType="firmDataType"
+      :infoType="infoType"
     />
     <upload-img-dialog
         :read="onlyRead ? true : false"
@@ -40,6 +47,7 @@
         :keysArr="imgsArr"
         :dialog="myDialog"
         :firmDataType="firmDataType"
+        :infoType="infoType"
     />
     <maintainer-dialog
         @changeMaintainer="changeMaintainer"
@@ -59,6 +67,7 @@
       :keysArr="picsArr"
       @change="changePics"
       :firmDataType="firmDataType"
+      :infoType="infoType"
     />
     <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
       <p>
@@ -139,28 +148,34 @@
     deleteProperty,
     getDataDictionary,
     propertyLinkEq,
-    updateProperty,
-    queryEquip, //替换掉
-    queryUpdate,//替换掉
-    updateEquip//替换掉
+    queryProperty,
+    propertyUpdate,
+    updateProperty
   } from "@/api/scan/request";
 
   import tools from "@/utils/scan/tools"
   import handsonUtils from "@/utils/scan/hasontableUtils"
   import showTools from "@/utils/handsontable/notShow"
   import buildFloor from '@/utils/handsontable/buildFloorData'
+  import firm from "@/components/dialogs/list/firm"
+  import supplierDialog from "@/components/dialogs/list/supplierDialog"
+  import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
+  import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
+  import maintainerDialog from "@/components/dialogs/list/maintainerDialog"
+  import insurerDialog from "@/components/dialogs/list/insurerDialog"
+  import picDialog from "@/components/dialogs/list/picDialog"
 
   import qrcode from "@/components/business_space/lib/qrcode"
-  import firm from "@/components/business_space/dialogs/list/firm"
+  // import firm from "@/components/business_space/dialogs/list/firm"
   import supplyDialog from "@/components/business_space/dialogs/list/supplyDialog"
-  import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog"
-  import maintainerDialog from "@/components/business_space/dialogs/list/maintainerDialog"
-  import insurerDialog from "@/components/business_space/dialogs/list/insurerDialog"
+  // import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog"
+  // import maintainerDialog from "@/components/business_space/dialogs/list/maintainerDialog"
+  // import insurerDialog from "@/components/business_space/dialogs/list/insurerDialog"
   import guaranteeDialog from "@/components/business_space/dialogs/list/guaranteeDialog"
-  import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
-  import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
+  // import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
+  // import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
   // import detailsDialog from "@/components/business_space/lib/detailsDia"
-  import picDialog from "@/components/business_space/dialogs/list/picDialog"
+  // import picDialog from "@/components/business_space/dialogs/list/picDialog"
   import myPagination from "@/components/common/myPagination"
   import myCascader from "@/components/ledger/lib/assets"
   import floorCascader from "@/components/ledger/lib/floorCascader"
@@ -209,6 +224,7 @@
     },
     data() {
       return {
+        infoType: '',
         batchPage: {
           size: 50,
           sizes: [10, 30, 50, 100, 150, 200],
@@ -317,7 +333,7 @@
               }
             })
             this.getTableData()
-            this.getTableData()
+            this.getAllData()
             //  信息维护
             this.newEnclosure = res.Content.filter(i=>i.InputMode =='F2')
           });
@@ -373,30 +389,34 @@
           let params = {
             "Cascade": [
               {
-                "Name": "property",
-                "Projection": [
-                  "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType"
+                "Name":"building",
+                "Projection":[
+                  "BuildLocalName",
+                  "BuildName",
+                  "BuildID"
                 ]
               },
               {
-                "Name": "building",
-                "Projection": [
-                  "BuildLocalName", "BuildName", "BuildID"
-                ]
-              },
-              {
-                "Name": "floor",
-                "Projection": [
-                  "FloorLocalName", "FloorName", "FloorID"
+                "Name":"floor",
+                "Projection":[
+                  "FloorLocalName",
+                  "FloorName",
+                  "FloorID"
                 ]
               }
             ],
-            Filters: `category='${this.mess.deviceId}'`,
+            Filters: `Family='${this.mess.deviceId}'`,
             PageSize: this.batchPage.size,
             Orders: "createTime desc, EquipID desc",
             PageNumber: this.batchPage.currentPage,
             "Projection": [
-              "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"
+              "BuildingId",
+              "FloorId",
+              "Family",
+              "EquipLocalName",
+              "EquipLocalID",
+              "EquipID",
+              "BIMID"
             ]
           };
           if (this.mess.buildId == "noKnow") {
@@ -410,7 +430,7 @@
           } else if (this.mess.floorId && this.mess.floorId != "all") {
             params.Filters += `;floorId='${this.mess.floorId}'`
           }
-          queryEquip(params, res => {
+          queryProperty(params, res => {
             this.allObject = res.Content
             this.batchPage.total = res.Total
           })
@@ -846,6 +866,7 @@
         let inputData = this.inputMap[val];
         this.row = row.row;
         this.messKey = val;
+        this.firmDataType = 'row'
         switch (val) {
           //操作
           case 'caozuo':
@@ -1045,7 +1066,11 @@
         return a;
       },
       //如果选择供应商之后
-      supplierChange(data) {
+      supplierChange(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 8}
+          this.firmName = firm
+        } else {
         tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
         this.handleUpdataTable(
@@ -1056,6 +1081,7 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
+        }
       },
       //供应合同编号
       supplyChange(data) {
@@ -1074,7 +1100,20 @@
         }
       },
       //选择型号修改
-      firmChange(data) {
+      firmChange(data,type) {
+        if (type === 'dialog') { // 如果是批量信息维护
+          let venderName = data.venderName ? data.venderName : '空'
+          let brandName = data.brandName ? data.brandName : '空'
+          let name = data.name ? data.name : '空'
+          let firm = {
+            ...data,
+            num: 2,
+            Specification: data.name,
+            name: `${venderName}/${brandName}/${name}`
+          }
+          this.firmName = firm //批量维护dialog显示对象的字段
+        } else {
+
         tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
         tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
         tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
@@ -1094,9 +1133,14 @@
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand]], "edit")
         // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]], "edit")
+        }
       },
       //保险商变更
-      changeInsurer(data) {
+      changeInsurer(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 42}
+          this.firmName = firm
+        } else {
         tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
         this.handleUpdataTable(
@@ -1107,9 +1151,15 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
+        }
       },
       //维修商变更
-      changeMaintainer(data) {
+      changeMaintainer(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 35}
+          this.firmName = firm
+        } else {
+
         tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
         this.handleUpdataTable(
@@ -1120,6 +1170,7 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
+        }
       },
       //修改关联的资产
       changeProperty(val) {
@@ -1127,20 +1178,51 @@
         this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
       },
       //上传文件弹窗触发事件
-      fileChange(keys) {
+      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
+          })
+
+        } else {
         this.setDataToMain(keys, this.messKey, this.row);
+        }
       },
       //上传图片弹窗触发事件
-      imgChange(keys) {
+      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) {
+      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) {
@@ -1302,12 +1384,12 @@
           let filterParam = this.filterCheck(param, 'sole')
           let filterParam1 = this.filterCheck(param1, 'multiple')
           if (filterParam) {
-            updateEquip(param, res => {
+            updateProperty(param, res => {
             });
           }
           if (filterParam1) {
             setTimeout(() => {
-              queryUpdate(param1, res => {
+              propertyUpdate(param1, res => {
               })
             })
 
@@ -1316,7 +1398,7 @@
         if (type === 2) {//覆盖
           let filterParams = this.filterCheck(param, 'sole')
           if (filterParams) {
-            updateEquip(param, res => {
+            updateProperty(param, res => {
             });
           }
         }

+ 21 - 17
src/components/ledger/handsontables/device.vue

@@ -49,26 +49,30 @@
     />
     <!--      上传图片-->
     <upload-img-dialog
-        :read="onlyRead ? true : false"
-        @changeFile="imgChange"
-        :keysArr="imgsArr"
-        :dialog="myDialog"
-        :firmDataType="firmDataType"
-        :information="information"
-        :infoType="infoType"
+      :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"/>
+    <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"
-        :firmDataType="firmDataType"
-        :information="information"
-        :infoType="infoType"
+      :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)">
@@ -1357,7 +1361,7 @@
         } else {
           this.setDataToMain(keys, this.messKey, this.row);
         }
-        this.$forceUpdate()
+
       },
       //上传图片弹窗触发事件
       imgChange(keys, type, file) {