微心愿

This commit is contained in:
liuye
2022-11-16 13:41:18 +08:00
parent c9cc263d52
commit 6542952597
3 changed files with 150 additions and 161 deletions

View File

@@ -5,7 +5,7 @@
<template #rightBtn>
<div class="title-btns">
<el-button type="primary" icon="iconfont iconPerson_Transfered" @click="isShowForward = true" v-if="detail.eventStatus < 2">指派事件</el-button>
<el-button type="primary" icon="iconfont iconRegister" @click="isShowAdd = true" v-if="detail.eventStatus < 2">处理事件</el-button>
<!-- <el-button type="primary" icon="iconfont iconRegister" @click="isShowAdd = true" v-if="detail.eventStatus < 2">处理事件</el-button> -->
</div>
</template>
</ai-title>
@@ -25,14 +25,14 @@
<ai-info-item label="现场照片" isLine>
<ai-uploader :instance="instance" disabled v-model="detail.files"></ai-uploader>
</ai-info-item>
<ai-info-item label="所属网格">{{ detail.girdName }}</ai-info-item>
<ai-info-item label="所属地区">{{ detail.areaName }}</ai-info-item>
<ai-info-item label="事件位置" isLine>
<div id="map" style="width: 500px; height: 280px;"></div>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="办事评价">
<ai-card title="办事评价" v-if="detail.eventStatus == 2">
<template #content>
<ai-wrapper>
<ai-info-item label="评价时间" :value="detail.name"></ai-info-item>
@@ -108,10 +108,12 @@
title="事件指派"
@onConfirm="onForwardConfirm">
<el-form class="ai-form" label-width="120px" :model="forwardForm" ref="forwardForm">
<el-form-item label="转交" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请选择网格员或网格' }]">
<el-input disabled size="small" v-model="forwardForm.name" clearable placeholder="请选择网格员或网格">
<el-form-item label="转交" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请选择人员' }]">
<el-input disabled size="small" v-model="forwardForm.name" clearable placeholder="请选择人员">
<template slot="append">
<el-button @click="getGirdList().then(()=>isShowUser=true )">选择</el-button>
<ai-wechat-selecter refs="addTags" :props="{id:'wxUserId',label:'name'}" :isMultiple="false" :instance="instance" v-model="forwardForm.user" @change="onChooseUser">
<el-button size="small">选择人员</el-button>
</ai-wechat-selecter>
</template>
</el-input>
</el-form-item>
@@ -128,37 +130,6 @@
</el-form-item>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowUser"
width="800px"
title="选择网格或网格员"
@onConfirm="onConfirm">
<div class="grid-wrapper">
<el-input
style="margin-bottom: 10px;"
size="small"
placeholder="请输入网格名称/网格员姓名/网格员电话"
v-model="name" @change="$refs.tree.filter(name)"
suffix-icon="iconfont iconSearch">
</el-input>
<el-tree
:filter-node-method="filterNode"
ref="tree"
:props="defaultProps"
node-key="id"
:data="tree"
highlight-current
@current-change="onTreeChange">
<div class="tree-container" slot-scope="{ data }">
<div class="tree-container__user">
<div class="tree-user__item">
<span>{{ data.isUser ? `${data.name}-${data.phone}` : data.girdName }}</span>
</div>
</div>
</div>
</el-tree>
</div>
</ai-dialog>
</template>
</ai-detail>
</template>
@@ -175,11 +146,9 @@ export default {
return {
forwardForm: {
content: '',
girdId: '',
girdName: '',
girdMemberId: '',
girdMemberName: '',
name: ''
user: [],
name: '',
files: []
},
isLoading: true,
name: '',
@@ -190,9 +159,6 @@ export default {
userList: [],
processList: [],
dictList: [],
defaultProps: {
label: 'girdName'
},
isShowForward: false,
tree: [],
gridInfo: {},
@@ -203,7 +169,7 @@ export default {
content: [],
eventStatus: '2'
},
evaluation: {}
evaluation: {},
}
},
@@ -225,7 +191,7 @@ export default {
methods: {
getDetail() {
this.instance.post('/app/appclapeventinfo/queryDetailById', null, {
this.instance.post('/app/appclapeventinfopingchang/queryDetailById', null, {
params: {id: this.$route.query.id}
}).then(res => {
if (res?.data) {
@@ -242,56 +208,27 @@ export default {
this.isLoading = false
})
},
getGirdList() {
return this.instance.post(`/app/appgirdinfo/listAllByTop`).then(res => {
if (res?.data) {
return this.tree = this.formatList([res.data])
}
})
onChooseUser(v) {
console.log(v)
this.forwardForm.user = v
this.forwardForm.name = v[0].name
},
onClose() {
this.form.files = []
this.form.groupId = ''
this.form.groupName = ''
this.form.content = ''
this.form.eventStatus = ''
this.forwardForm.content = ''
this.forwardForm.girdId = ''
this.forwardForm.girdName = ''
this.forwardForm.girdMemberId = ''
this.forwardForm.girdMemberName = ''
this.forwardForm.user = []
this.forwardForm.files = []
this.forwardForm.name = ''
},
formatList(list) {
for (let item of list) {
item.children = [item.girdList, item.girdMemberList?.map(e => ({
...e, isUser: true, girdName: item.girdName,
girdId: item.id
})) || []].flat()
if (item.girdList?.length > 0) {
this.formatList(item.girdList)
}
}
return list
},
filterNode(value, data) {
if (!value) return true
return (data.girdName && data.girdName.indexOf(value) !== -1) || (data.name && data.name.indexOf(value) !== -1) || (data.name && data.phone.indexOf(value) !== -1)
},
onTreeChange(e) {
this.gridInfo = e
},
onForwardConfirm() {
this.$refs.forwardForm.validate(v => {
if (v) {
this.instance.post('/app/appclapeventinfo/transferByManager', {
this.instance.post('/app/appclapeventinfopingchang/transfer', {
...this.forwardForm,
id: this.$route.query.id
}).then(res => {
@@ -304,22 +241,8 @@ export default {
}
})
},
onConfirm() {
if (this.gridInfo.userId) {
this.forwardForm.girdId = this.gridInfo.girdId
this.forwardForm.girdName = this.gridInfo.girdName
this.forwardForm.girdMemberId = this.gridInfo.id
this.forwardForm.girdMemberName = this.gridInfo.name
} else {
this.forwardForm.girdId = this.gridInfo.id
}
this.forwardForm.girdName = this.gridInfo.girdName
this.forwardForm.name = `${this.gridInfo.girdName}${this.gridInfo.name ? '-' + this.gridInfo.name : ''}`
this.isShowUser = false
},
getDict() {
this.instance.post(`/app/appclapeventgroup/list?current=1&size=100000`).then(res => {
this.instance.post(`/app/appclapeventgrouppingchang/list?current=1&size=100000`).then(res => {
if (res.code == 0) {
this.dictList = res.data.records.map(v => {
return {
@@ -330,25 +253,12 @@ export default {
}
})
},
close() {
this.$confirm('确定关闭该事件?').then(() => {
this.instance.post(`/app/appmininotice/delete?ids=${this.$route.query.id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
},
onChange(e) {
this.instance.post(`/app/appvillagerintegralrule/list?size=1000&classification=${e}&ruleStatus=1`).then(res => {
if (res.code === 0) {
@@ -357,12 +267,11 @@ export default {
}
})
},
initMap() {
let {lng, lat} = this.detail
let center = [lng, lat]
AMapLoader.load({
key: 'b553334ba34f7ac3cd09df9bc8b539dc',
key: '54a02a43d9828a8f9cd4f26fe281e74e',
version: '2.0'
}).then(AMap => {
let map = new AMap.Map('map', {
@@ -376,7 +285,6 @@ export default {
map.add(marker)
})
},
handleEvent() {
this.$refs.form.validate(v => {
if (v) {
@@ -587,5 +495,86 @@ export default {
}
}
}
.AppAnnounceDetail-select {
display: flex;
align-items: center;
min-height: 32px;
line-height: 1;
background: #F5F5F5;
border-radius: 4px;
border: 1px solid #D0D4DC;
cursor: pointer;
overflow: hidden;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:hover {
border-color: #26f;
}
& > i {
flex: 1;
height: 100%;
line-height: 32px;
padding: 0 12px;
color: #888888;
font-size: 14px;
font-style: normal;
border-right: 1px solid #D0D4DC;
background: #fff;
}
.AppAnnounceDetail-select__input {
position: absolute;
left: 0;
top: 0;
z-index: -1;
opacity: 0;
height: 100%;
}
.select-right {
height: 100%;
padding: 0 12px;
color: #222222;
font-size: 12px;
cursor: pointer;
transition: all ease 0.3s;
&:hover {
opacity: 0.5;
}
}
.select-left {
display: flex;
flex-wrap: wrap;
flex: 1;
padding: 5px 0 0px 12px;
border-right: 1px solid #D0D4DC;
border-radius: 4px 0 0 4px;
background: #fff;
em {
height: 22px;
line-height: 22px;
margin: 0 4px 5px 0;
color: #222222;
font-size: 12px;
font-style: normal;
}
span {
height: 22px;
line-height: 22px;
margin: 0 4px 5px 0;
padding: 0 8px;
font-size: 12px;
color: #222222;
background: #F3F4F7;
border-radius: 2px;
border: 1px solid #D0D4DC;
}
}
}
}
</style>