|
@@ -282,7 +282,8 @@
|
|
deviceType: {}, //族3位编码及名称
|
|
deviceType: {}, //族3位编码及名称
|
|
floorData: [],
|
|
floorData: [],
|
|
curDevice: '',//当前点击的设备id
|
|
curDevice: '',//当前点击的设备id
|
|
- addData: {}, //添加设备选择的设备类型
|
|
|
|
|
|
+ addData: {}, //
|
|
|
|
+ showParts: false,
|
|
inputMap: {
|
|
inputMap: {
|
|
flowBuild: 'D1'
|
|
flowBuild: 'D1'
|
|
}, //信息点和输入方式映射表
|
|
}, //信息点和输入方式映射表
|
|
@@ -411,6 +412,7 @@
|
|
}
|
|
}
|
|
getEquipTableCon(param, res => {
|
|
getEquipTableCon(param, res => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
|
+ this.showParts = res.Message == "1"?true:false;// 判断是否显示包含的部件列
|
|
this.tableData = res.Content.map((item) => {
|
|
this.tableData = res.Content.map((item) => {
|
|
if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
|
|
if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
|
|
item.flowBuild = item.BuildingId + "-" + item.FloorId
|
|
item.flowBuild = item.BuildingId + "-" + item.FloorId
|
|
@@ -617,9 +619,15 @@
|
|
formatHeaderData(list) {
|
|
formatHeaderData(list) {
|
|
let arr = tools.copyArr(list)
|
|
let arr = tools.copyArr(list)
|
|
let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, this.showType, true)
|
|
let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, this.showType, true)
|
|
- data.unshift("操作", "当前关联的资产", "所属系统实例", "包含的部件");
|
|
|
|
- if (this.showType == "all") {
|
|
|
|
|
|
+ if (this.showParts) {
|
|
|
|
+ data.unshift("操作", "当前关联的资产", "所属系统实例", "包含的部件");
|
|
|
|
+ } else {
|
|
|
|
+ data.unshift("操作", "当前关联的资产", "所属系统实例");
|
|
|
|
+ }
|
|
|
|
+ if (this.showType == "all" && this.showParts) {
|
|
data.splice(6, 0, "所属建筑楼层")
|
|
data.splice(6, 0, "所属建筑楼层")
|
|
|
|
+ } else if (this.showType == "all" && !this.showParts) {
|
|
|
|
+ data.splice(5, 0, "所属建筑楼层")
|
|
}
|
|
}
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|
|
@@ -627,27 +635,46 @@
|
|
formatHeaderType(list) {
|
|
formatHeaderType(list) {
|
|
let arr = tools.copyArr(list)
|
|
let arr = tools.copyArr(list)
|
|
let data = showTools.headerTypeFilter(arr, 'equipment', this.onlyRead, this.showType, true)
|
|
let data = showTools.headerTypeFilter(arr, 'equipment', this.onlyRead, this.showType, true)
|
|
- data.unshift(
|
|
|
|
- {
|
|
|
|
- data: "caozuo",
|
|
|
|
- renderer: tools.lookDetails,
|
|
|
|
- readOnly: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- data: "LinkEquipLocalName",
|
|
|
|
- readOnly: true,
|
|
|
|
- renderer: tools.LinkEquipLocalName
|
|
|
|
- }, {
|
|
|
|
- data: "LinkSystem",
|
|
|
|
- renderer: text.systemList,
|
|
|
|
- readOnly: true
|
|
|
|
- }, {
|
|
|
|
- data: "Count",
|
|
|
|
- readOnly: true,
|
|
|
|
- renderer: tools.lookDetails
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- if (this.showType == "all") {
|
|
|
|
|
|
+ if (this.showParts) {
|
|
|
|
+ data.unshift(
|
|
|
|
+ {
|
|
|
|
+ data: "caozuo",
|
|
|
|
+ renderer: tools.lookDetails,
|
|
|
|
+ readOnly: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ data: "LinkEquipLocalName",
|
|
|
|
+ readOnly: true,
|
|
|
|
+ renderer: tools.LinkEquipLocalName
|
|
|
|
+ }, {
|
|
|
|
+ data: "LinkSystem",
|
|
|
|
+ renderer: text.systemList,
|
|
|
|
+ readOnly: true
|
|
|
|
+ }, {
|
|
|
|
+ data: "Count",
|
|
|
|
+ readOnly: true,
|
|
|
|
+ renderer: tools.lookDetails
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ data.unshift(
|
|
|
|
+ {
|
|
|
|
+ data: "caozuo",
|
|
|
|
+ renderer: tools.lookDetails,
|
|
|
|
+ readOnly: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ data: "LinkEquipLocalName",
|
|
|
|
+ readOnly: true,
|
|
|
|
+ renderer: tools.LinkEquipLocalName
|
|
|
|
+ }, {
|
|
|
|
+ data: "LinkSystem",
|
|
|
|
+ renderer: text.systemList,
|
|
|
|
+ readOnly: true
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ if (this.showType == "all" && this.showParts) {
|
|
data.splice(6, 0, {
|
|
data.splice(6, 0, {
|
|
data: "flowBuild",
|
|
data: "flowBuild",
|
|
renderer: tools.customDropdownRenderer,
|
|
renderer: tools.customDropdownRenderer,
|
|
@@ -657,6 +684,16 @@
|
|
},
|
|
},
|
|
readOnly: this.onlyRead
|
|
readOnly: this.onlyRead
|
|
})
|
|
})
|
|
|
|
+ } else if (this.showType == "all" && !this.showParts) {
|
|
|
|
+ data.splice(5, 0, {
|
|
|
|
+ data: "flowBuild",
|
|
|
|
+ renderer: tools.customDropdownRenderer,
|
|
|
|
+ editor: "chosen",
|
|
|
|
+ chosenOptions: {
|
|
|
|
+ data: this.buildFloorData
|
|
|
|
+ },
|
|
|
|
+ readOnly: this.onlyRead
|
|
|
|
+ })
|
|
}
|
|
}
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|
|
@@ -670,7 +707,7 @@
|
|
}
|
|
}
|
|
this.hot = new Handsontable(container, {
|
|
this.hot = new Handsontable(container, {
|
|
data: this.tableData,
|
|
data: this.tableData,
|
|
- fixedColumnsLeft: 6,
|
|
|
|
|
|
+ fixedColumnsLeft: this.showParts?6:5,
|
|
colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
|
|
colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
|
|
columns: this.formatHeaderType(this.tableHeader), //数据显示格式
|
|
columns: this.formatHeaderType(this.tableHeader), //数据显示格式
|
|
filters: true,
|
|
filters: true,
|
|
@@ -934,417 +971,424 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
- //获取到了正确的信息
|
|
|
|
- getInfors(infos, row, el) {
|
|
|
|
- let val = this.hot.colToProp(row.col);
|
|
|
|
- let inputMode = this.inputMap[val];
|
|
|
|
- this.row = row.row;
|
|
|
|
- this.messKey = val;
|
|
|
|
- this.firmDataType = 'row'
|
|
|
|
- lStorage.set('screen_data', { path: this.$route.path, data: { equip: infos } })
|
|
|
|
- switch (val) {
|
|
|
|
- //操作
|
|
|
|
- case 'caozuo':
|
|
|
|
- // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
|
|
|
|
- // this.$message("开发中...")
|
|
|
|
- this.$router.push({
|
|
|
|
- path: "deviceDetails",
|
|
|
|
- query: {
|
|
|
|
- type: this.mess.deviceId,
|
|
|
|
- equipId: infos.EquipID,
|
|
|
|
- equipName: infos.EquipLocalName?infos.EquipLocalName:infos.EquipName?infos.EquipName:'',
|
|
|
|
- equipCode: infos.EquipLocalID?infos.EquipLocalID:'',
|
|
|
|
- data: this.tableData.map(item => {
|
|
|
|
- return {
|
|
|
|
- value: item.EquipID,
|
|
|
|
- label: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- //设备二维码图片
|
|
|
|
- case 'EquipQRCode':
|
|
|
|
- this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
|
|
|
|
- if (!!this.qrcodeUrl) {
|
|
|
|
- this.myDialog.qrcode = true;
|
|
|
|
- } else {
|
|
|
|
- this.$message("此设备没有设备二维码");
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //关联系统
|
|
|
|
- case 'LinkSystem':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.curDevice = infos.EquipID;
|
|
|
|
- this.systemList = this.tableData[row.row].LinkSystem || [];
|
|
|
|
- this.myDialog.systemType = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //关联资产
|
|
|
|
- case 'LinkEquipLocalName':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.myDialog.changeRea = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //品牌型号弹窗
|
|
|
|
- case 'DPManufacturerID':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.myDialog.firm = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //供应商信息弹窗
|
|
|
|
- case 'DPSupplierID':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.myDialog.supplier = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //维修商信息弹窗
|
|
|
|
- case 'DPMaintainerID':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.myDialog.maintainer = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //保险公司信息
|
|
|
|
- case 'DPInsurerID':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- this.myDialog.insurer = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //供应合同编号
|
|
|
|
- case 'LedgerParam.SupplyPurchase.SupplierContractID':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- let ContractIDflag = null;
|
|
|
|
- let DPSdata = this.tableData[row.row].DPSupplierID;
|
|
|
|
- if (DPSdata) {
|
|
|
|
- ContractIDflag = DPSdata.split("-")[0];
|
|
|
|
|
|
+ //获取到了正确的信息
|
|
|
|
+ getInfors(infos, row, el) {
|
|
|
|
+ let val = this.hot.colToProp(row.col);
|
|
|
|
+ let inputMode = this.inputMap[val];
|
|
|
|
+ this.row = row.row;
|
|
|
|
+ this.messKey = val;
|
|
|
|
+ this.firmDataType = 'row'
|
|
|
|
+ lStorage.set('screen_data', { path: this.$route.path, data: { equip: infos } })
|
|
|
|
+ switch (val) {
|
|
|
|
+ //操作
|
|
|
|
+ case 'caozuo':
|
|
|
|
+ // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
|
|
|
|
+ // this.$message("开发中...")
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "deviceDetails",
|
|
|
|
+ query: {
|
|
|
|
+ type: this.mess.deviceId,
|
|
|
|
+ equipId: infos.EquipID,
|
|
|
|
+ equipName: infos.EquipLocalName?infos.EquipLocalName:infos.EquipName?infos.EquipName:'',
|
|
|
|
+ equipCode: infos.EquipLocalID?infos.EquipLocalID:'',
|
|
|
|
+ data: this.tableData.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ value: item.EquipID,
|
|
|
|
+ label: item.EquipLocalName?item.EquipLocalName:item.EquipName?item.EquipName:''
|
|
}
|
|
}
|
|
- if (!!ContractIDflag) {
|
|
|
|
- this.id = ContractIDflag;
|
|
|
|
- this.myDialog.supply = true;
|
|
|
|
- } else {
|
|
|
|
- this.$message("请先选择供应商");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //保险单号
|
|
|
|
- case 'LedgerParam.InsuranceDoc.InsuranceNum':
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- let DPInsurerIDflag = null;
|
|
|
|
- let DPIdata = this.tableData[row.row].DPInsurerID;
|
|
|
|
- if (DPIdata) {
|
|
|
|
- DPInsurerIDflag = DPIdata.split("-")[0];
|
|
|
|
- }
|
|
|
|
- if (!!DPInsurerIDflag) {
|
|
|
|
- this.id = DPInsurerIDflag;
|
|
|
|
- this.myDialog.guarantee = true;
|
|
|
|
- } else {
|
|
|
|
- this.$message("请先选择保险商");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //保险文件--设备文档--安装质检报告
|
|
|
|
- case 'LedgerParam.InsuranceDoc.InsuranceFile':
|
|
|
|
- case 'LedgerParam.PhotoDoc.Archive':
|
|
|
|
- case 'LedgerParam.Siteinstall.CheckReport':
|
|
|
|
- let IPSdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
- this.filesArr = IPSdata ? IPSdata : [];
|
|
|
|
- if (!this.onlyRead || this.filesArr.length) {
|
|
|
|
- this.myDialog.uploadFiles = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //安装照片--安装图纸--设备铭牌照片--设备图纸
|
|
|
|
- case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
|
- case 'LedgerParam.Siteinstall.InstallDrawing':
|
|
|
|
- case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
|
- case 'LedgerParam.PhotoDoc.Drawing':
|
|
|
|
- let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
- this.imgsArr = SSPPdata ? SSPPdata : [];
|
|
|
|
- if (!this.onlyRead || this.imgsArr.length) {
|
|
|
|
- this.myDialog.uploadImgs = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //设备照片
|
|
|
|
- case 'LedgerParam.PhotoDoc.Pic':
|
|
|
|
- let Pdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
- this.picsArr = Pdata ? Pdata : [];
|
|
|
|
- if (!this.onlyRead || this.picsArr.length) {
|
|
|
|
- this.myDialog.pic = true;
|
|
|
|
- }
|
|
|
|
- return false
|
|
|
|
- //包含的部件字段
|
|
|
|
- case 'Count':
|
|
|
|
- let countUrl = this.onlyRead ? '/ledger/parts' : '/ledger/partsmanage';
|
|
|
|
- this.$router.push({path: countUrl, query: {
|
|
|
|
- deviceId: infos.EquipID,
|
|
|
|
- typeId: this.mess.deviceId,
|
|
|
|
- pageNo: this.page.currentPage,
|
|
|
|
- pageSize: this.page.size
|
|
|
|
- }});
|
|
|
|
- return false
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
|
|
|
|
- this.updateInfoPoint = val
|
|
|
|
- this.updateInput = tools.dataForKey(this.tableData[row.row], val)
|
|
|
|
- this.myDialog.update = true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //关闭临时维护弹窗回调
|
|
|
|
- handleCloseUpdate() {
|
|
|
|
- this.updateInputShow = false
|
|
|
|
- this.updateInfoPoint = ''
|
|
|
|
- this.updateInput = ''
|
|
|
|
- },
|
|
|
|
- //更新临时维护信息点
|
|
|
|
- handleClickUpdate() {
|
|
|
|
- tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
|
|
|
|
- this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
|
|
|
|
- this.updateInputShow = false
|
|
|
|
- this.myDialog.update = false
|
|
|
|
- this.updateInput = ''
|
|
|
|
- },
|
|
|
|
- //获取被筛选掉的行号
|
|
|
|
- trimmedRows() {
|
|
|
|
- var plugin = this.hot.getPlugin("trimRows").trimmedRows;
|
|
|
|
- let dataLength = this.tableData.length;
|
|
|
|
- let dataArr = new Array();
|
|
|
|
- for (let i = 0; i < dataLength; i++) {
|
|
|
|
- dataArr.push(i);
|
|
|
|
- }
|
|
|
|
- if (plugin.length <= 0) {
|
|
|
|
- dataArr = undefined;
|
|
|
|
- } else {
|
|
|
|
- dataArr = this.array_diff(dataArr, plugin);
|
|
|
|
- }
|
|
|
|
- return dataArr || [];
|
|
|
|
- },
|
|
|
|
- //去除数组中相同的元素
|
|
|
|
- array_diff(a, b) {
|
|
|
|
- for (var i = 0; i < b.length; i++) {
|
|
|
|
- for (var j = 0; j < a.length; j++) {
|
|
|
|
- if (a[j] == b[i]) {
|
|
|
|
- a.splice(j, 1);
|
|
|
|
- j = j - 1;
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
- return a;
|
|
|
|
- },
|
|
|
|
- //如果选择供应商之后
|
|
|
|
- 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(
|
|
|
|
- [
|
|
|
|
- [this.row, "DPSupplierID", null, data.venderId],
|
|
|
|
- [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
|
|
|
|
- ],
|
|
|
|
- "edit"
|
|
|
|
- )
|
|
|
|
- // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ //设备二维码图片
|
|
|
|
+ case 'EquipQRCode':
|
|
|
|
+ this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
|
|
|
|
+ if (!!this.qrcodeUrl) {
|
|
|
|
+ this.myDialog.qrcode = true;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message("此设备没有设备二维码");
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //关联系统
|
|
|
|
+ case 'LinkSystem':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.curDevice = infos.EquipID;
|
|
|
|
+ this.systemList = this.tableData[row.row].LinkSystem || [];
|
|
|
|
+ this.myDialog.systemType = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //关联资产
|
|
|
|
+ case 'LinkEquipLocalName':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.myDialog.changeRea = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //品牌型号弹窗
|
|
|
|
+ case 'DPManufacturerID':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.myDialog.firm = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //供应商信息弹窗
|
|
|
|
+ case 'DPSupplierID':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.myDialog.supplier = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //维修商信息弹窗
|
|
|
|
+ case 'DPMaintainerID':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.myDialog.maintainer = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //保险公司信息
|
|
|
|
+ case 'DPInsurerID':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ this.myDialog.insurer = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //供应合同编号
|
|
|
|
+ case 'LedgerParam.SupplyPurchase.SupplierContractID':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ let ContractIDflag = null;
|
|
|
|
+ let DPSdata = this.tableData[row.row].DPSupplierID;
|
|
|
|
+ if (DPSdata) {
|
|
|
|
+ ContractIDflag = DPSdata.split("-")[0];
|
|
|
|
+ }
|
|
|
|
+ if (!!ContractIDflag) {
|
|
|
|
+ this.id = ContractIDflag;
|
|
|
|
+ this.myDialog.supply = true;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message("请先选择供应商");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //保险单号
|
|
|
|
+ case 'LedgerParam.InsuranceDoc.InsuranceNum':
|
|
|
|
+ if (!this.onlyRead) {
|
|
|
|
+ let DPInsurerIDflag = null;
|
|
|
|
+ let DPIdata = this.tableData[row.row].DPInsurerID;
|
|
|
|
+ if (DPIdata) {
|
|
|
|
+ DPInsurerIDflag = DPIdata.split("-")[0];
|
|
|
|
+ }
|
|
|
|
+ if (!!DPInsurerIDflag) {
|
|
|
|
+ this.id = DPInsurerIDflag;
|
|
|
|
+ this.myDialog.guarantee = true;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message("请先选择保险商");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //保险文件--设备文档--安装质检报告
|
|
|
|
+ case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
|
|
|
|
+ case 'LedgerParam.PhotoDoc.Archive': //设备文档
|
|
|
|
+ case 'LedgerParam.Siteinstall.CheckReport': //安装质检报告
|
|
|
|
+ case 'LedgerParam.OperationMainte.MaintainManual': //维修保养手册
|
|
|
|
+ case 'LedgerParam.SupplyPurchase.ApproachingAcceptance': //进场验收单
|
|
|
|
+ case 'LedgerParam.SupplyPurchase.AcceptanceReport': //验收报告
|
|
|
|
+ case 'LedgerParam.PhotoDoc.OperationManual': //操作说明书
|
|
|
|
+ case 'LedgerParam.EquipManufactor.OriginalCertificate': //原厂证明
|
|
|
|
+ case 'LedgerParam.EquipManufactor.TestReport': //检测报告
|
|
|
|
+ case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
|
|
|
|
+ case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
|
|
|
|
+ case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
|
|
|
|
+ case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
|
|
|
|
+ let IPSdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
+ this.filesArr = IPSdata ? IPSdata : [];
|
|
|
|
+ if (!this.onlyRead || this.filesArr.length) {
|
|
|
|
+ this.myDialog.uploadFiles = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //安装照片--设备铭牌照片
|
|
|
|
+ case 'LedgerParam.Siteinstall.InstallPic':
|
|
|
|
+ case 'LedgerParam.PhotoDoc.Nameplate':
|
|
|
|
+ let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
+ this.imgsArr = SSPPdata ? SSPPdata : [];
|
|
|
|
+ if (!this.onlyRead || this.imgsArr.length) {
|
|
|
|
+ this.myDialog.uploadImgs = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //设备照片
|
|
|
|
+ case 'LedgerParam.PhotoDoc.Pic':
|
|
|
|
+ let Pdata = tools.dataForKey(this.tableData[row.row], val);
|
|
|
|
+ this.picsArr = Pdata ? Pdata : [];
|
|
|
|
+ if (!this.onlyRead || this.picsArr.length) {
|
|
|
|
+ this.myDialog.pic = true;
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ //包含的部件字段
|
|
|
|
+ case 'Count':
|
|
|
|
+ let countUrl = this.onlyRead ? '/ledger/parts' : '/ledger/partsmanage';
|
|
|
|
+ this.$router.push({path: countUrl, query: {
|
|
|
|
+ deviceId: infos.EquipID,
|
|
|
|
+ typeId: this.mess.deviceId,
|
|
|
|
+ pageNo: this.page.currentPage,
|
|
|
|
+ pageSize: this.page.size
|
|
|
|
+ }});
|
|
|
|
+ return false
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
|
|
|
|
+ this.updateInfoPoint = val
|
|
|
|
+ this.updateInput = tools.dataForKey(this.tableData[row.row], val)
|
|
|
|
+ this.myDialog.update = true
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- //供应合同编号
|
|
|
|
- supplyChange(data) {
|
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", {id: data})
|
|
|
|
|
|
+ //关闭临时维护弹窗回调
|
|
|
|
+ handleCloseUpdate() {
|
|
|
|
+ this.updateInputShow = false
|
|
|
|
+ this.updateInfoPoint = ''
|
|
|
|
+ this.updateInput = ''
|
|
},
|
|
},
|
|
- //保险单号-保险文件
|
|
|
|
- guaranteeChange(data) {
|
|
|
|
- for (let key in data) {
|
|
|
|
- this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
|
|
|
|
- if (key == "contractFile") {
|
|
|
|
- if (!!data[key]) {
|
|
|
|
- data[key] = [data[key]]
|
|
|
|
- }
|
|
|
|
|
|
+ //更新临时维护信息点
|
|
|
|
+ handleClickUpdate() {
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
|
|
|
|
+ this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
|
|
|
|
+ this.updateInputShow = false
|
|
|
|
+ this.myDialog.update = false
|
|
|
|
+ this.updateInput = ''
|
|
|
|
+ },
|
|
|
|
+ //获取被筛选掉的行号
|
|
|
|
+ trimmedRows() {
|
|
|
|
+ var plugin = this.hot.getPlugin("trimRows").trimmedRows;
|
|
|
|
+ let dataLength = this.tableData.length;
|
|
|
|
+ let dataArr = new Array();
|
|
|
|
+ for (let i = 0; i < dataLength; i++) {
|
|
|
|
+ dataArr.push(i);
|
|
}
|
|
}
|
|
- this.utilToKey(key, "contractFile", data, "InsuranceFile")
|
|
|
|
- }
|
|
|
|
|
|
+ if (plugin.length <= 0) {
|
|
|
|
+ dataArr = undefined;
|
|
|
|
+ } else {
|
|
|
|
+ dataArr = this.array_diff(dataArr, plugin);
|
|
|
|
+ }
|
|
|
|
+ return dataArr || [];
|
|
|
|
+ },
|
|
|
|
+ //去除数组中相同的元素
|
|
|
|
+ array_diff(a, b) {
|
|
|
|
+ for (var i = 0; i < b.length; i++) {
|
|
|
|
+ for (var j = 0; j < a.length; j++) {
|
|
|
|
+ if (a[j] == b[i]) {
|
|
|
|
+ a.splice(j, 1);
|
|
|
|
+ j = j - 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return a;
|
|
},
|
|
},
|
|
- //选择型号修改
|
|
|
|
- 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}`
|
|
|
|
|
|
+ //如果选择供应商之后
|
|
|
|
+ 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(
|
|
|
|
+ [
|
|
|
|
+ [this.row, "DPSupplierID", null, data.venderId],
|
|
|
|
+ [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
|
|
|
|
+ ],
|
|
|
|
+ "edit"
|
|
|
|
+ )
|
|
|
|
+ // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //供应合同编号
|
|
|
|
+ supplyChange(data) {
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", {id: data})
|
|
|
|
+ },
|
|
|
|
+ //保险单号-保险文件
|
|
|
|
+ guaranteeChange(data) {
|
|
|
|
+ for (let key in data) {
|
|
|
|
+ this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
|
|
|
|
+ if (key == "contractFile") {
|
|
|
|
+ if (!!data[key]) {
|
|
|
|
+ data[key] = [data[key]]
|
|
}
|
|
}
|
|
- 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
|
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
|
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
|
|
|
|
- tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
|
|
|
|
- this.handleUpdataTable(
|
|
|
|
- [
|
|
|
|
- [this.row, "DPManufacturerID", null, data.venderId],
|
|
|
|
- [this.row, "DPBrandID", null, data.brandId],
|
|
|
|
- [this.row, "DPSpecificationID", null, data.specificationId],
|
|
|
|
- [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
|
|
|
|
- [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
|
|
|
|
- [this.row, "LedgerParam.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")
|
|
|
|
}
|
|
}
|
|
- },
|
|
|
|
- //保险商变更
|
|
|
|
- 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(
|
|
|
|
- [
|
|
|
|
- [this.row, "DPInsurerID", null, data.venderId],
|
|
|
|
- [this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]
|
|
|
|
- ],
|
|
|
|
- "edit"
|
|
|
|
- )
|
|
|
|
- // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
|
|
|
|
|
|
+ this.utilToKey(key, "contractFile", data, "InsuranceFile")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //选择型号修改
|
|
|
|
+ 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
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
|
|
|
|
+ this.handleUpdataTable(
|
|
|
|
+ [
|
|
|
|
+ [this.row, "DPManufacturerID", null, data.venderId],
|
|
|
|
+ [this.row, "DPBrandID", null, data.brandId],
|
|
|
|
+ [this.row, "DPSpecificationID", null, data.specificationId],
|
|
|
|
+ [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
|
|
|
|
+ [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
|
|
|
|
+ [this.row, "LedgerParam.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")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //保险商变更
|
|
|
|
+ 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(
|
|
|
|
+ [
|
|
|
|
+ [this.row, "DPInsurerID", null, data.venderId],
|
|
|
|
+ [this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]
|
|
|
|
+ ],
|
|
|
|
+ "edit"
|
|
|
|
+ )
|
|
|
|
+ // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
|
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
|
- //维修商变更
|
|
|
|
- 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(
|
|
|
|
- [
|
|
|
|
- [this.row, "DPMaintainerID", null, data.venderId],
|
|
|
|
- [this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]
|
|
|
|
- ],
|
|
|
|
- "edit"
|
|
|
|
- )
|
|
|
|
- // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //维修商变更
|
|
|
|
+ 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(
|
|
|
|
+ [
|
|
|
|
+ [this.row, "DPMaintainerID", null, data.venderId],
|
|
|
|
+ [this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]
|
|
|
|
+ ],
|
|
|
|
+ "edit"
|
|
|
|
+ )
|
|
|
|
+ // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
|
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
|
- //修改关联的资产
|
|
|
|
- changeProperty(val) {
|
|
|
|
- this.setDataToMain(val.PropertyId, 'PropertyId', this.row);
|
|
|
|
- this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
|
|
|
|
- },
|
|
|
|
- //上传文件弹窗触发事件
|
|
|
|
- fileChange(keys, type) {
|
|
|
|
- if (type === 'dialog') {
|
|
|
|
- this.information = keys
|
|
|
|
- } else {
|
|
|
|
- this.setDataToMain(keys, this.messKey, this.row);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //上传图片弹窗触发事件
|
|
|
|
- imgChange(keys, type) {
|
|
|
|
- if (type === 'dialog') {
|
|
|
|
- this.information = keys
|
|
|
|
- } else {
|
|
|
|
- this.setDataToMain(keys, this.messKey, this.row);
|
|
|
|
|
|
+ },
|
|
|
|
+ //修改关联的资产
|
|
|
|
+ changeProperty(val) {
|
|
|
|
+ this.setDataToMain(val.PropertyId, 'PropertyId', this.row);
|
|
|
|
+ this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
|
|
|
|
+ },
|
|
|
|
+ //上传文件弹窗触发事件
|
|
|
|
+ fileChange(keys, type) {
|
|
|
|
+ if (type === 'dialog') {
|
|
|
|
+ this.information = keys
|
|
|
|
+ } else {
|
|
|
|
+ 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, type) {
|
|
|
|
- if (type === 'dialog') {
|
|
|
|
- this.information = keys
|
|
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //关联系统更改
|
|
|
|
+ changeSystemType(data) {
|
|
|
|
+ tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
|
|
|
|
+ },
|
|
|
|
+ //设备图片弹窗改变事件
|
|
|
|
+ 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) {
|
|
|
|
+ this.setDataToMain(data[key], messName, this.row)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //判断是否有值,有值赋值
|
|
|
|
+ setDataToMain(data, key, row) {
|
|
|
|
+ if (!!data && data != '--') {
|
|
|
|
+ if (!!this.tableData[row]) {
|
|
|
|
+ tools.setDataForKey(this.tableData[row], key, data);
|
|
|
|
+ this.handleUpdataTable([[row, key, null, data]], "edit");
|
|
} else {
|
|
} else {
|
|
- this.setDataToMain(keys, this.messKey, this.row);
|
|
|
|
|
|
+ this.tableData[row] = {};
|
|
|
|
+ tools.setDataForKey(this.tableData[row], key, data);
|
|
}
|
|
}
|
|
- },
|
|
|
|
- utilToKey(key, name, data, messName) {
|
|
|
|
- if (key == name) {
|
|
|
|
- this.setDataToMain(data[key], messName, this.row)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //判断是否有值,有值赋值
|
|
|
|
- setDataToMain(data, key, row) {
|
|
|
|
- if (!!data && data != '--') {
|
|
|
|
- if (!!this.tableData[row]) {
|
|
|
|
- tools.setDataForKey(this.tableData[row], key, data);
|
|
|
|
- this.handleUpdataTable([[row, key, null, data]], "edit");
|
|
|
|
- } else {
|
|
|
|
- this.tableData[row] = {};
|
|
|
|
- tools.setDataForKey(this.tableData[row], key, data);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- tools.setDataForKey(this.tableData[row], key, "");
|
|
|
|
|
|
+ } else {
|
|
|
|
+ tools.setDataForKey(this.tableData[row], key, "");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 批量信息维护
|
|
|
|
+ Batch() {
|
|
|
|
+ this.firmDataType = 'dialog'
|
|
|
|
+ this.$refs.batchDialogs.batchDialog = true
|
|
|
|
+ },
|
|
|
|
+ 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 => {
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- },
|
|
|
|
- // 批量信息维护
|
|
|
|
- Batch() {
|
|
|
|
- this.firmDataType = 'dialog'
|
|
|
|
- this.$refs.batchDialogs.batchDialog = true
|
|
|
|
- },
|
|
|
|
- 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 (filterParam1) {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ queryUpdate(param1, res => {
|
|
})
|
|
})
|
|
|
|
+ })
|
|
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- if (type === 2) {//覆盖
|
|
|
|
- let filterParams = this.filterCheck(param, 'sole')
|
|
|
|
- if (filterParams) {
|
|
|
|
- updateEquip(param, 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
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ 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: {
|
|
watch: {
|
|
projectId() {
|
|
projectId() {
|