diff --git a/project/biaopin/AppWorkOrder/components/Detail.vue b/project/biaopin/AppWorkOrder/components/Detail.vue index 4ab362bd..c397e099 100644 --- a/project/biaopin/AppWorkOrder/components/Detail.vue +++ b/project/biaopin/AppWorkOrder/components/Detail.vue @@ -14,6 +14,9 @@
+ @@ -197,7 +306,20 @@ export default { content: [], eventStatus: '1' }, - evaluation: {} + evaluation: {}, + isShowEdit: false, //编辑工单信息 + editInfo: {}, + placeDetail: { + lng: '', + lat: '', + address: '' + }, + showMap: false, + searchPlace: '', + map: null, + typeList: [], + isEditShowUser: false, + treeEdit: [] } }, @@ -231,6 +353,7 @@ export default { this.initMap() }) this.isLoading = false + this.getTypeList() } }).catch(() => { this.isLoading = false @@ -284,6 +407,11 @@ export default { return (data.girdName && data.girdName.indexOf(value) !== -1) || (data.name && data.name.indexOf(value) !== -1) || (data.name && data.phone.indexOf(value) !== -1) }, + filterNodeEdit(value, data) { + if (!value) return true + + return (data.girdName && data.girdName.indexOf(value) !== -1) + }, onTreeChange(e) { this.gridInfo = e @@ -395,7 +523,129 @@ export default { }) } }) - } + }, + + editClick() { + this.isShowEdit = true + this.editInfo = {...this.detail} + this.editInfo.girdIds = [] + if(this.editInfo.girdId) { + this.editInfo.girdIds.push(this.editInfo.girdId) + } + }, + + selectMap() { + this.editInfo.lng = this.placeDetail.lng + this.editInfo.lat = this.placeDetail.lat + this.editInfo.address = this.placeDetail.address + this.showMap = false + }, + + initMapSelect() { + AMapLoader.load({ + key: 'b553334ba34f7ac3cd09df9bc8b539dc', + version: '2.0', + plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete', 'AMap.Geocoder'], + }).then((AMap2) => { + this.map = new AMap2.Map('mapDialog', { + resizeEnable: true, + zooms: [6, 20], + zoom: 11, + center:[107.11059, 31.56618], + }) + this.placeSearch = new AMap2.PlaceSearch({ map: this.map }) + new AMap2.AutoComplete({ + input: 'searchPlaceInput', + output: 'searchPlaceOutput', + }).on('select', (e) => { + if (e?.poi) { + this.placeSearch.setCity(e.poi.adcode) + this.movePosition(e.poi.location) + } + }) + this.map.on('click', (e) => { + new AMap2.Geocoder().getAddress(e.lnglat, (sta, res) => { + if (res?.regeocode) { + this.placeDetail = { + lng: e.lnglat?.lng, + lat: e.lnglat?.lat, + address: res.regeocode.formattedAddress, + } + } + }) + this.movePosition(e.lnglat) + }) + }) + }, + + movePosition(center) { + if (this.map) { + this.map.clearMap() + this.map.panTo(center) + this.map.add([ + new AMap.Marker({ + position: center, + clickable: true, + }), + ]) + this.map.setFitView() + } + }, + + getEditGirdList() { + return this.instance.post(`/app/appgirdmemberinfo/queryMyGirdList`).then(res => { + if (res?.data) { + this.treeEdit = res.data + } + }) + }, + + onTreeEditChange(e) { + console.log(e) + this.editInfo.girdId = e.id + this.editInfo.girdName = e.girdName + }, + + onEditConfirm() { + if(!this.editInfo.girdId) { + return this.$message.error('请选择网格!') + } + this.isEditShowUser = false + }, + + onCloseEdit() { + this.isShowEdit = false + this.editInfo = {} + }, + + onConfirmEdit() { + this.$refs.editInfo.validate(v => { + if (v) { + this.instance.post('/app/apppatrolreportinfov2/addByGirdMember', { + ...this.editInfo, + id: this.$route.query.id + }).then(res => { + if (res?.code == 0) { + this.isShowEdit = false + this.getDetail() + this.$message.success('编辑成功!') + } + }) + } + }) + }, + + getTypeList() { + this.typeList = [] + this.instance.post(`/app/apppatrolreportinfov2/eventTypeList?eventSource=${this.detail.eventSource}`).then(res => { + if (res.code == 0) { + res.data.map((item) => { + var i = {dictName: item, dictValue: item} + this.typeList.push(i) + }) + } + }) + }, } } diff --git a/project/biaopin/AppWorkOrder/components/List.vue b/project/biaopin/AppWorkOrder/components/List.vue index 3c65f9b8..35fd6bd7 100644 --- a/project/biaopin/AppWorkOrder/components/List.vue +++ b/project/biaopin/AppWorkOrder/components/List.vue @@ -259,7 +259,7 @@ export default { }, handleDelete(ids) { this.$confirm("是否要进行删除?").then(() => { - this.instance.post("/app/appsessionarchivereportinfo/delete", null, { + this.instance.post("/app/apppatrolreportinfov2/delete", null, { params: {ids} }).then(res => { if (res?.code == 0) {