|
@@ -15,14 +15,16 @@
|
|
|
<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" 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 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 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"
|
|
@@ -30,24 +32,34 @@
|
|
|
@changeFile="fileChange"
|
|
|
:keysArr="filesArr"
|
|
|
:dialog="myDialog"
|
|
|
+ :firmDataType="firmDataType"
|
|
|
/>
|
|
|
<upload-img-dialog
|
|
|
:read="onlyRead ? true : false"
|
|
|
@changeFile="imgChange"
|
|
|
:keysArr="imgsArr"
|
|
|
:dialog="myDialog"
|
|
|
+ :firmDataType="firmDataType"
|
|
|
/>
|
|
|
<maintainer-dialog
|
|
|
@changeMaintainer="changeMaintainer"
|
|
|
ref="maintainer"
|
|
|
:dialog="myDialog"
|
|
|
+ :firmDataType="firmDataType"
|
|
|
/>
|
|
|
<insurer-dialog
|
|
|
@changeInsurer="changeInsurer"
|
|
|
ref="insurer"
|
|
|
:dialog="myDialog"
|
|
|
+ :firmDataType="firmDataType"
|
|
|
+ />
|
|
|
+ <pic-dialog
|
|
|
+ :read="onlyRead ? true : false"
|
|
|
+ :dialog="myDialog"
|
|
|
+ :keysArr="picsArr"
|
|
|
+ @change="changePics"
|
|
|
+ :firmDataType="firmDataType"
|
|
|
/>
|
|
|
- <pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"/>
|
|
|
<div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
|
|
|
<p>
|
|
|
<i class="icon-wushuju iconfont"></i>
|
|
@@ -105,6 +117,18 @@
|
|
|
<el-button v-show="showAddByDie" type="primary" :disabled="dieNum == 0" @click="createByDie">批量创建</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 维护信息弹窗-->
|
|
|
+ <batchDialog
|
|
|
+ ref="batchDialogs"
|
|
|
+ @code="fourVendors"
|
|
|
+ :firmName="firmName"
|
|
|
+ :allObject="allObject"
|
|
|
+ :page="batchPage"
|
|
|
+ :newEnclosure="newEnclosure"
|
|
|
+ @getAllData="getAllData"
|
|
|
+ @multiples="multiples"
|
|
|
+ @upDataDevice="upDataDevice"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -115,7 +139,10 @@
|
|
|
deleteProperty,
|
|
|
getDataDictionary,
|
|
|
propertyLinkEq,
|
|
|
- updateProperty
|
|
|
+ updateProperty,
|
|
|
+ queryEquip, //替换掉
|
|
|
+ queryUpdate,//替换掉
|
|
|
+ updateEquip//替换掉
|
|
|
} from "@/api/scan/request";
|
|
|
|
|
|
import tools from "@/utils/scan/tools"
|
|
@@ -143,6 +170,7 @@
|
|
|
import lookPic from "@/components/ledger/lib/lookImages"
|
|
|
import Handsontable from "handsontable-pro"
|
|
|
import 'handsontable-pro/dist/handsontable.full.css'
|
|
|
+ import batchDialog from "../../dialogs/list/batchDialog";
|
|
|
//下拉插件
|
|
|
// import "@/assets/js/chosen.jquery.min";
|
|
|
// import "@/assets/js/handsontable-chosen-editor";
|
|
@@ -165,7 +193,8 @@
|
|
|
floorCascader,
|
|
|
dieCascader,
|
|
|
// detailsDialog,
|
|
|
- lookPic
|
|
|
+ lookPic,
|
|
|
+ batchDialog
|
|
|
},
|
|
|
created() {
|
|
|
buildFloor.getData(this.buildFloorData)
|
|
@@ -180,6 +209,16 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ batchPage: {
|
|
|
+ size: 50,
|
|
|
+ sizes: [10, 30, 50, 100, 150, 200],
|
|
|
+ total: 0,
|
|
|
+ currentPage: 1
|
|
|
+ },
|
|
|
+ newEnclosure:[],
|
|
|
+ firmName: '',//维护信息显示厂家名称
|
|
|
+ firmDataType: 'row',
|
|
|
+ allObject: [],
|
|
|
options: [{
|
|
|
value: true,
|
|
|
label: '只读模式'
|
|
@@ -272,6 +311,9 @@
|
|
|
}
|
|
|
})
|
|
|
this.getTableData()
|
|
|
+ this.getTableData()
|
|
|
+ // 信息维护
|
|
|
+ this.newEnclosure = res.Content.filter(i=>i.InputMode =='F2')
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -310,14 +352,64 @@
|
|
|
this.copyMain = tools.deepCopy(this.tableData)
|
|
|
this.page.total = res.Total
|
|
|
if (this.tableData && this.tableData.length) {
|
|
|
- // if (this.onlyRead) {
|
|
|
- // this.getBatch(this.tableData)
|
|
|
- // }
|
|
|
+ if (this.onlyRead) {
|
|
|
+ this.getBatch(this.tableData)
|
|
|
+ }
|
|
|
this.initTable()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ //获取所以主体数据---用于维护信息
|
|
|
+ getAllData() {
|
|
|
+ if (!!this.mess.deviceId) {
|
|
|
+ // 查询step2
|
|
|
+ let params = {
|
|
|
+ "Cascade": [
|
|
|
+ {
|
|
|
+ "Name": "property",
|
|
|
+ "Projection": [
|
|
|
+ "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Name": "building",
|
|
|
+ "Projection": [
|
|
|
+ "BuildLocalName", "BuildName", "BuildID"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "Name": "floor",
|
|
|
+ "Projection": [
|
|
|
+ "FloorLocalName", "FloorName", "FloorID"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ Filters: `category='${this.mess.deviceId}'`,
|
|
|
+ PageSize: this.batchPage.size,
|
|
|
+ Orders: "createTime desc, EquipID desc",
|
|
|
+ PageNumber: this.batchPage.currentPage,
|
|
|
+ "Projection": [
|
|
|
+ "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ if (this.mess.buildId == "noKnow") {
|
|
|
+ params.Filters += `;buildingId isNull`
|
|
|
+ } else if (this.mess.buildId && this.mess.buildId != "all") {
|
|
|
+ params.Filters += `;buildingId='${this.mess.buildId}'`
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.mess.floorId == "noKnow") {
|
|
|
+ params.Filters += `;floorId isNull`
|
|
|
+ } else if (this.mess.floorId && this.mess.floorId != "all") {
|
|
|
+ params.Filters += `;floorId='${this.mess.floorId}'`
|
|
|
+ }
|
|
|
+ queryEquip(params, res => {
|
|
|
+ this.allObject = res.Content
|
|
|
+ this.batchPage.total = res.Total
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//获取动态参数
|
|
|
getBatch(data) {
|
|
|
let param = {
|
|
@@ -1061,6 +1153,181 @@
|
|
|
this.graphyId = graphyId
|
|
|
this.assetGroupList = assetGroupList
|
|
|
},
|
|
|
+ // 批量信息维护
|
|
|
+ Batch() {
|
|
|
+ this.firmDataType = 'dialog'
|
|
|
+ this.$refs.batchDialogs.batchDialog = true
|
|
|
+ },
|
|
|
+ // 接受维护信息传来的code,显示弹窗
|
|
|
+ fourVendors(code) {
|
|
|
+ this.firmDataType = 'dialog'
|
|
|
+ switch (code) {
|
|
|
+ //品牌型号弹窗
|
|
|
+ case 'DPManufacturerID':
|
|
|
+ // this.dataFirmType = 'dia'
|
|
|
+ this.myDialog.firm = true;
|
|
|
+ break;
|
|
|
+ //供应商信息弹窗
|
|
|
+ case 'DPSupplierID':
|
|
|
+ this.myDialog.supplier = true;
|
|
|
+ break;
|
|
|
+ //维修商信息弹窗
|
|
|
+ case 'DPMaintainerID':
|
|
|
+ this.myDialog.maintainer = true;
|
|
|
+ break;
|
|
|
+ //保险公司信息
|
|
|
+ case 'DPInsurerID':
|
|
|
+ this.myDialog.insurer = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
|
|
|
+ this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
|
|
|
+ this.infoType = val;
|
|
|
+ this.myDialog.uploadFiles = true;
|
|
|
+ break;
|
|
|
+ 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 'LedgerParam.Siteinstall.CheckReport': //安装质检报告
|
|
|
+ this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
|
|
|
+ this.infoType = val;
|
|
|
+ this.myDialog.uploadFiles = true;
|
|
|
+ break;
|
|
|
+ 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 '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 'LedgerParam.Siteinstall.InstallPic':
|
|
|
+ this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
|
|
|
+ this.infoType = val
|
|
|
+ this.myDialog.uploadImgs = true;
|
|
|
+ break;
|
|
|
+ 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 'LedgerParam.PhotoDoc.Pic':
|
|
|
+ this.picsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
|
|
|
+ this.infoType = val
|
|
|
+ this.myDialog.pic = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ upDataDevice(type, data1, data2) {
|
|
|
+ let param = {Content: data1}
|
|
|
+ let param1 = {Content: data2}
|
|
|
+ if (type === 1) { //增量
|
|
|
+ //LedgerParam
|
|
|
+ let filterParam = this.filterCheck(param, 'sole')
|
|
|
+ let filterParam1 = this.filterCheck(param1, 'multiple')
|
|
|
+ if (filterParam) {
|
|
|
+ updateEquip(param, res => {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (filterParam1) {
|
|
|
+ setTimeout(() => {
|
|
|
+ queryUpdate(param1, res => {
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type === 2) {//覆盖
|
|
|
+ let filterParams = this.filterCheck(param, 'sole')
|
|
|
+ if (filterParams) {
|
|
|
+ updateEquip(param, res => {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getTableData()
|
|
|
+ this.getAllData()
|
|
|
+ }, 10)
|
|
|
+ },
|
|
|
+ filterCheck(arr, type) {
|
|
|
+ if (type === 'sole') {
|
|
|
+ for (let i of arr.Content) {
|
|
|
+ return Object.keys(i.LedgerParam).length
|
|
|
+ }
|
|
|
+ } else if (type === 'multiple') {
|
|
|
+ let nArr = [];
|
|
|
+ arr.Content.forEach(i => {
|
|
|
+ let {EquipID, ...value} = i
|
|
|
+ nArr.push({LedgerParam: value})
|
|
|
+ })
|
|
|
+ for (let j of nArr) {
|
|
|
+ return Object.keys(j.LedgerParam).length
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
projectId() {
|