|
@@ -60,11 +60,11 @@
|
|
|
import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
import {
|
|
|
BeatchQueryParam,
|
|
|
- deleteZone,
|
|
|
+ handleZoneDelete,
|
|
|
+ handleZoneObjectUpdate,
|
|
|
+ handleZoneUpdateBd,
|
|
|
queryAllZoneType,
|
|
|
searchZoneQuery,
|
|
|
- updateRelateInSpAndBuild,
|
|
|
- updateZone,
|
|
|
zoneCreate
|
|
|
} from "@/api/scan/request";
|
|
|
import {mapGetters} from "vuex";
|
|
@@ -193,6 +193,13 @@
|
|
|
this.getZoneMessage(this.zoneParam)
|
|
|
} else {
|
|
|
// 其他分区类型查询表数据接口
|
|
|
+ if (this.OtherValue) {
|
|
|
+ this.zoneParam.ZoneType = this.OtherValue;
|
|
|
+ this.getZoneMessage(this.zoneParam)
|
|
|
+ } else {
|
|
|
+ this.main = []
|
|
|
+
|
|
|
+ }
|
|
|
this.isLoading = false
|
|
|
this.getOtherType();
|
|
|
}
|
|
@@ -426,20 +433,27 @@
|
|
|
if (params.length < 1 || this.main > this.copyMain) {
|
|
|
return
|
|
|
}
|
|
|
- let param = {
|
|
|
- data: [],
|
|
|
- zone: this.zoneCode
|
|
|
- }
|
|
|
- params.map(item => {
|
|
|
- if (item.RoomID)
|
|
|
- param.data.push({ RoomID: item.RoomID })
|
|
|
- })
|
|
|
+ // let param = {
|
|
|
+ // data: [],
|
|
|
+ // zone: this.zoneCode
|
|
|
+ // }
|
|
|
+ // params.map(item => {
|
|
|
+ //
|
|
|
+ // if (item.RoomID)
|
|
|
+ // param.data.push({ RoomID: item.RoomID })
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ params.map(i => i.ObjectType = this.zoneParam.ZoneType ? this.zoneParam.ZoneType : i.ObjectType);
|
|
|
this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- deleteZone(param, res => {
|
|
|
+ // deleteZone(params, res => {
|
|
|
+ // this.$message.success("删除成功!")
|
|
|
+ // this.getData()
|
|
|
+ // })
|
|
|
+ handleZoneDelete(params, res => {
|
|
|
this.$message.success("删除成功!")
|
|
|
this.getData()
|
|
|
})
|
|
@@ -495,9 +509,12 @@
|
|
|
// this.$message.success("添加成功!")
|
|
|
// this.getData()
|
|
|
// })
|
|
|
- zoneCreate(params, res => {
|
|
|
+ let {ObjectType, ...msg} = param;
|
|
|
+ msg.ZoneType = ObjectType;
|
|
|
+ zoneCreate(msg, res => {
|
|
|
this.$message.success("添加成功!")
|
|
|
this.getData()
|
|
|
+ this.getZoneMessage(params)
|
|
|
})
|
|
|
},
|
|
|
// 修改
|
|
@@ -553,16 +570,31 @@
|
|
|
if (param.data.Projection.indexOf('BuildingId') > -1) {
|
|
|
let pa = param.data.Content.map(t => {
|
|
|
return {
|
|
|
- type: this.zoneCode,
|
|
|
- spaceId: t.RoomID,
|
|
|
- id: t.FloorId || t.BuildingId || null,
|
|
|
+ Type: this.zoneCode,
|
|
|
+ SpaceId: t.RoomID,
|
|
|
+ Id: t.FloorId || t.BuildingId || null,
|
|
|
}
|
|
|
})
|
|
|
- updateRelateInSpAndBuild(pa, res => {
|
|
|
+ handleZoneUpdateBd(pa, res => {
|
|
|
this.$message.success('修改成功')
|
|
|
})
|
|
|
+ // updateRelateInSpAndBuild(pa, res => {
|
|
|
+ // this.$message.success('修改成功')
|
|
|
+ // })
|
|
|
} else {
|
|
|
- updateZone(param, (res) => {
|
|
|
+ // updateZone(param, (res) => {
|
|
|
+ // })
|
|
|
+ let obj = param.data.Content.map(i => {
|
|
|
+ return {
|
|
|
+ ...i,
|
|
|
+ ObjectType: this.zoneParam.ZoneType || i.ObjectType
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let updateParam = {
|
|
|
+ Content: obj
|
|
|
+ };
|
|
|
+ handleZoneObjectUpdate(updateParam, res => {
|
|
|
+ this.$message.success('更新成功')
|
|
|
})
|
|
|
}
|
|
|
},
|