|
@@ -43,7 +43,7 @@
|
|
|
<maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
|
|
|
<insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
|
|
|
<pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
|
|
|
- <system-type :infos="systemId" :graphyId="graphyId" :dialog="myDialog" :type="'edit'" @change="changeSystemType"></system-type>
|
|
|
+ <system-type :device="category" :dialog="myDialog" :type="onlyRead?'read':'edit'" @change="changeSystemType"></system-type>
|
|
|
<details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -53,6 +53,7 @@ import handsonUtils from "@/utils/hasontableUtils";
|
|
|
import showTools from "@/utils/handsontable/notShow";
|
|
|
import text from "@/utils/handsontable/mainText";
|
|
|
import session from "@/framework/utils/storage";
|
|
|
+import buildFloorData from '@/utils/handsontable/buildFloorData'
|
|
|
|
|
|
import handsonTable from "@/components/common/handsontable";
|
|
|
import {
|
|
@@ -60,7 +61,8 @@ import {
|
|
|
createEquip,
|
|
|
createPropertyData,
|
|
|
getEquipBelongs,
|
|
|
- getSpaceFloor
|
|
|
+ getSpaceFloor,
|
|
|
+ createEquipAndProperty
|
|
|
} from "@/api/scan/request";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
|
|
@@ -273,51 +275,63 @@ export default {
|
|
|
}
|
|
|
// 处理建筑-楼层
|
|
|
if (item.flowBuild) {
|
|
|
+ let bid = item.flowBuild.split("-");
|
|
|
item.BuildingId = item.flowBuild.split("-")[0]
|
|
|
- item.FloorId = item.flowBuild.split("-")[1]
|
|
|
+ if (bid[1]) {
|
|
|
+ item.FloorId = item.flowBuild.split("-")[1]
|
|
|
+ }
|
|
|
}
|
|
|
//处理管理的系统
|
|
|
if (item.LinkSystem && item.LinkSystem.length) {
|
|
|
item.SystemList = []
|
|
|
item.LinkSystem.map(t => {
|
|
|
- item.SystemList.push(t.id)
|
|
|
+ item.SystemList.push(t.SysID)
|
|
|
})
|
|
|
}
|
|
|
+ item.PropertyId = !!item.Checked;
|
|
|
+ item.Category = this.category.deviceId;
|
|
|
})
|
|
|
if (flag) {
|
|
|
this.$message.info("存在设备的本地名称为空,请检查")
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- for (let i = 0; i < newData.length; i++) {
|
|
|
- let params = newData[i]
|
|
|
- params.Family = this.firmId;
|
|
|
- params.Category = this.category.deviceId;
|
|
|
- if (newData[i].Checked) {//同时创建资产
|
|
|
- await createPropertyData([params], async res => {
|
|
|
- params.PropertyId = res.EntityList[0].EquipID
|
|
|
- await createEquip([params], res => {
|
|
|
- if (i == newData.length - 1) {
|
|
|
- this.$router.push({
|
|
|
- path: "/ledger/facility",
|
|
|
- query: { deviceId: this.category.deviceId }
|
|
|
- });
|
|
|
- session.remove("deviceAddData")
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- await createEquip([params], res => {
|
|
|
- if (i == newData.length - 1) {
|
|
|
- this.$router.push({
|
|
|
- path: "/ledger/facility",
|
|
|
- query: { deviceId: this.category.deviceId }
|
|
|
- });
|
|
|
- session.remove("deviceAddData")
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i = 0; i < newData.length; i++) {
|
|
|
+ // let params = newData[i]
|
|
|
+ // params.Family = this.firmId;
|
|
|
+ // params.Category = this.category.deviceId;
|
|
|
+ // if (newData[i].PropertyId) {//同时创建资产
|
|
|
+ // await createPropertyData([params], async res => {
|
|
|
+ // params.PropertyId = res.EntityList[0].EquipID
|
|
|
+ // await createEquip([params], res => {
|
|
|
+ // if (i == newData.length - 1) {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: "/ledger/facility",
|
|
|
+ // query: { deviceId: this.category.deviceId }
|
|
|
+ // });
|
|
|
+ // session.remove("deviceAddData")
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // await createEquip([params], res => {
|
|
|
+ // if (i == newData.length - 1) {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: "/ledger/facility",
|
|
|
+ // query: { deviceId: this.category.deviceId }
|
|
|
+ // });
|
|
|
+ // session.remove("deviceAddData")
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ createEquipAndProperty(newData, res => {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/ledger/facility",
|
|
|
+ query: { deviceId: this.category.deviceId }
|
|
|
+ });
|
|
|
+ session.remove("deviceAddData")
|
|
|
+ })
|
|
|
},
|
|
|
// 删除表格行
|
|
|
handleDeleteTableRow() {
|
|
@@ -356,7 +370,7 @@ export default {
|
|
|
//格式化表头显示的数据
|
|
|
formatHeaderData(list) {
|
|
|
let arr = tools.copyArr(list);
|
|
|
- let showType = this.showTypeFlag?'partInfo':'all';
|
|
|
+ let showType = this.showTypeFlag ? 'partInfo' : 'all';
|
|
|
let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, showType, true);
|
|
|
data.unshift("同时创建资产", "所属系统实例");
|
|
|
if (this.floorFlag) {
|
|
@@ -367,7 +381,7 @@ export default {
|
|
|
formatHeaderType(list) {
|
|
|
//格式化表头头映射的数据
|
|
|
let arr = tools.copyArr(list);
|
|
|
- let showType = this.showTypeFlag?'partInfo':'all';
|
|
|
+ let showType = this.showTypeFlag ? 'partInfo' : 'all';
|
|
|
let data = showTools.headerTypeFilter(arr, 'equipment', this.onlyRead, showType, true);
|
|
|
data.unshift({
|
|
|
type: "checkbox",
|
|
@@ -389,7 +403,7 @@ export default {
|
|
|
editor: "chosen",
|
|
|
chosenOptions: {
|
|
|
// multiple: true,//多选
|
|
|
- data: this.floorData
|
|
|
+ data: buildFloorData.data
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -547,7 +561,7 @@ export default {
|
|
|
}
|
|
|
break;
|
|
|
//关联系统
|
|
|
- case 'linkSystem':
|
|
|
+ case 'LinkSystem':
|
|
|
if (!this.onlyRead) {
|
|
|
this.systemList = this.tableData[row.row].LinkSystem || [];
|
|
|
this.myDialog.systemType = true;
|