事件上报

This commit is contained in:
liuye
2023-05-08 17:56:39 +08:00
parent a25da8f889
commit 5b57142d7d
7 changed files with 359 additions and 38 deletions

View File

@@ -33,7 +33,8 @@ export default {
resident: {url: "/components/pages/selectResident", label: "name"},
sysUser: {url: "/components/pages/selectSysUser", label: "name"},
gird: {url: "/components/pages/selectGird", label: "girdName"},
gridUser: {url: "/components/pages/selectGridMember", label: "name"},
gridMember: {url: "/components/pages/selectGridMember", label: "name"},
gridUser: {url: "/components/pages/selectGirdUser", label: "name"},
party: {url: "/components/pages/selectParty", label: "name"},
dept: {url: "/components/pages/selectDept", label: "name"},
custom: {...this.ops}

View File

@@ -0,0 +1,304 @@
<template>
<section class="selectGridMember">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in selectGridPath" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span
style="color:#3F8DF5" @click="girdNameClick(item, index)">{{ item.girdName }}</span></span>
</div>
<div class="cards" v-for="(item, index) in treeList" :key="item.id" @click="itemClick(item)">
<div class="imges">
<!-- <img src="./img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)"/>
<img src="./img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)"/> -->
<img src="./img/gird--select-icon.png" alt="" class="avatras"/>
</div>
<div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div>
<u-icon class="mar-r16" name="arrow-right" color="#ddd"/>
</div>
</div>
<div class="userCards" v-for="(e, index) in userList" :key="e.id">
<div class="imges">
<img src="./img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(e, index)"/>
<img src="./img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)"/>
<img src="./img/user-img.png" alt="" class="avatras"/>
</div>
<div class="rights fill">
<div class="applicationNames" v-text="e.name"/>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
<AiEmpty description="暂无数据" v-if="!hasData"/>
</div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</section>
</template>
<script>
export default {
name: "selectGridMember",
appName: "选择人员(网格成员)",
data() {
return {
selected: {},
allData: null,
treeList: [],
selectGridPath: [],
userList: [],
}
},
computed: {
hasData() {
return this.treeList?.length > 0 || this.userList?.length > 0
}
},
onLoad() {
this.selected.girdId = this.$route.query.id
this.getAllGrids()
},
onShow() {
document.title = '选择人员'
},
methods: {
getAllGrids() {
uni.showLoading({title: "数据加载中...", mask: true})
this.$http.post('/app/appgirdinfo/listByInfo').then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentGirdId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
this.gridInit()
}
}).finally(() => uni.hideLoading())
},
gridInit() {
this.treeList = this.allData.filter(e => !e.parentGirdId)
this.selectGridPath = [{girdName: "可选范围", id: ''}]
},
itemClick({id, girdName}) {
this.selectGridPath.push({girdName, id})
this.getGridsAndUsersByParent(id)
},
getGridsAndUsersByParent(id) {
this.treeList = this.allData.filter(e => e.parentGirdId == id)
this.userList = []
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${id}`).then((res) => {
if (res?.data) {
this.userList = res.data.map(e => ({...e, isChecked: e.girdId == this.selected.girdId}))
this.userList.map((item) => {
if(item.isChecked) {
this.selected = {...item}
}
})
}
})
},
girdNameClick(row, index) {
this.userList = []
if (!index) { //第一级别
this.gridInit()
} else {
let length = this.selectGridPath.length - index
this.selectGridPath.splice(index, length)
this.getGridsAndUsersByParent(row.id)
}
},
girdClick(row, index) {
if (this.treeList[index].isChecked) {//取消
this.treeList[index].isChecked = false
this.selected = {}
} else {
this.treeList.map((item, i) => {
item.isChecked = index == i
})
this.selected = {...row, kind: "grid"}
}
this.$forceUpdate()
},
userClick(row, index) {
if (this.userList[index].isChecked) {//取消
this.userList[index].isChecked = false
this.selected = {}
} else {
this.userList.map((item, i) => {
item.isChecked = index == i
})
this.selected = {...row, kind: "user"}
}
this.$forceUpdate()
},
submit() {
if (this.selected.id) {
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:gridUser", this.selected)
}
})
} else {
return this.$u.toast('请选择网格员')
}
},
}
}
</script>
<style lang="scss" scoped>
.selectGridMember {
height: 100%;
background: #fff;
.header-top {
background: #fff;
padding: 20px 32px;
}
.header-middle {
padding-bottom: 140px;
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0 1px 0 0 #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.empty-div {
height: 16px;
background: #f5f5f5;
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
.imgselect {
width: 48px;
height: 48px;
vertical-align: middle;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
width: calc(100% - 160px);
display: flex;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
flex: 1;
min-width: 0;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.imgs {
flex-shrink: 0;
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
.userCards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
.imgselect {
width: 48px;
height: 48px;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.rights {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
height: inherit;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.idNumbers {
color: #666;
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
}
</style>

View File

@@ -4,7 +4,7 @@
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="转交给" prop="status" required :border-bottom="false" class="first-form" v-if="status == 4">
<div flex class="flexEnd">
<AiPagePicker type="gridUser" :id="selectObject.id" @select="handleSelectObject">
<AiPagePicker type="gridMember" :id="selectObject.id" @select="handleSelectObject">
<AiMore v-model="forms.name"/>
</AiPagePicker>
</div>

View File

@@ -82,7 +82,7 @@ export default {
},
methods: {
typeList() {
this.$http.post(`/app/appclapeventgroup/list`, null, {
this.$http.post(`/app/appresidentreportgroup/list`, null, {
params: {
size: 9999,
},
@@ -126,7 +126,7 @@ export default {
return this.$u.toast('请输入手机号')
}
this.flag = true
this.$http.post(``).then((res) => {
this.$http.post(`/app/appresidentreportinfo/addByGirdMember`, {...this.forms, ...this.forms.mapInfo}).then((res) => {
if (res.code == 0) {
this.$u.toast('事件添加成功')
uni.$emit('getListInit')

View File

@@ -2,8 +2,10 @@
<div class="Transfer">
<div class="contents">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="转交给" prop="status" required :border-bottom="false" right-icon="arrow-right" class="first-form" v-if="status == 1">
<u-input v-model="forms.name" placeholder="请选择转交对象" @click="toSelectUser" disabled/>
<u-form-item label="转交给" prop="status" required :border-bottom="false" class="first-form" v-if="status == 1">
<AiPagePicker type="gridUser" :id="forms.girdId" @select="handleSelectGrid" nodeKey="girdId">
<AiMore v-model="forms.name"/>
</AiPagePicker>
</u-form-item>
<u-form-item label="事件分类" prop="groupName" required :border-bottom="false" right-icon="arrow-right" v-if="status != 1">
<!-- <u-input v-model="forms.groupName" placeholder="请选择事件分类" /> -->
@@ -69,20 +71,30 @@ export default {
this.forms.groupId = option.groupId
this.forms.groupName = option.groupName
this.typeList()
uni.$on('pagePicker:custom', (res) => {
this.selectUser = res
if (res.name) {
this.forms.name = res.name
} else {
this.forms.name = res.girdName
}
})
// uni.$on('pagePicker:custom', (res) => {
// this.selectUser = res
// if (res.name) {
// this.forms.name = res.name
// } else {
// this.forms.name = res.girdName
// }
// })
},
onShow() {
document.title = this.titleList[this.status]
},
methods: {
handleSelectGrid(v) {
// this.forms.name = v.girdName
// this.forms.girdId = v.girdId
// this.selectUser = v
this.forms.girdId = v.girdId
this.forms.girdName = v.girdName
this.forms.girdMemberId = v.id
this.forms.girdMemberName = v.name
this.forms.name = `${v.girdName}${v.name ? '-' + v.name : ''}`
this.selectUser = {...v}
},
typeList() {
this.$http.post(`/app/appclapeventgroup/list`, null, {
params: {
@@ -112,28 +124,28 @@ export default {
submit() { //status 1转交 2拒绝受理 3我已办结
var url = '', successText = '', params = ''
if (this.status == 1) {
url = `/app/appclapeventinfo/transfer`
url = `/app/appresidentreportinfo/transfer`
successText = '转交成功'
params = {
...this.forms,
girdId: this.selectUser.id,
girdName: this.selectUser.girdName,
}
if (this.selectUser.name) { //选择的网格员
params.girdId = this.selectUser.girdId
params.girdMemberId = this.selectUser.id
params.girdMemberName = this.selectUser.name
// girdId: this.selectUser.id,
// girdName: this.selectUser.girdName,
}
// if (this.selectUser.name) { //选择的网格员
// params.girdId = this.selectUser.girdId
// params.girdMemberId = this.selectUser.id
// params.girdMemberName = this.selectUser.name
// }
}
if (this.status == 2) {
url = `/app/appclapeventinfo/refuse`
url = `/app/appresidentreportinfo/finishByGirdMember`
successText = '拒绝成功'
params = {...this.forms}
params = {...this.forms, eventStatus: 0}
}
if (this.status == 3) {
url = `/app/appclapeventinfo/finishByGirdMember`
url = `/app/appresidentreportinfo/finishByGirdMember`
successText = '办结成功'
params = {...this.forms}
params = {...this.forms, eventStatus: 1}
}
params.id = this.id
this.$http.post(url, params).then((res) => {
@@ -155,9 +167,9 @@ export default {
this.forms.groupName = e[0].label
this.forms.groupId = e[0].value
},
toSelectUser() {
uni.navigateTo({url: '../AppGridManagement/selectGridMember'})
},
// toSelectUser() {
// uni.navigateTo({url: '../AppGridManagement/selectGridMember'})
// },
},
}
</script>
@@ -238,5 +250,9 @@ export default {
width: 100%;
text-align: right;
}
::v-deep .AiPagePicker {
width: 100%;
text-align: right;
}
}
</style>

View File

@@ -17,7 +17,7 @@
<div class="card">
<span class="card-left">事件来源</span>
<span class="card-right">{{ data.groupName }}</span>
<span class="card-right">{{ $dict.getLabel('residentEventSource', data.eventSource) }}</span>
</div>
<div class="card">
<span class="card-left">事件类型</span>
@@ -96,12 +96,12 @@
<div class="fixedBtn">
<div class="status00" v-if="data.eventStatus == 0">
<div class="columns border-r" @click="toContent(1)">
<!-- <img src="./components/img/zhuanjiao.png" alt="" /> -->
<img src="./components/img/zhuanjiao.png" alt="" />
<span class="hint">转交事件</span>
</div>
<div class="columns" @click="toContent(2)">
<!-- <img src="./components/img/jujue.png" alt="" /> -->
<img src="./components/img/jujue.png" alt="" />
<span class="hint">拒绝受理</span>
</div>
@@ -159,7 +159,7 @@ export default {
watch: {},
onLoad(o) {
this.id = o.id
this.$dict.load('realityStatus', 'clapDoStatus').then(() => {
this.$dict.load('realityStatus', 'clapDoStatus', 'residentEventSource').then(() => {
this.getDetail()
})
@@ -168,11 +168,11 @@ export default {
})
},
onShow() {
document.title = this.user.corpId == 'wpytYEDgAACQq2uZ5x54MvlJ9fgvSPXQ' ? '微心愿' : '随手拍'
document.title = '事件上报'
},
methods: {
getDetail() {
this.$http.post(`/app/appclapeventinfo/queryDetailById?id=${this.id}`).then((res) => {
this.$http.post(`/app/appresidentreportinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.data = res.data
}
@@ -184,7 +184,7 @@ export default {
},
doThings() {
this.$http.post(`/app/appclapeventinfo/acceptance?id=${this.id}`).then((res) => {
this.$http.post(`/app/appresidentreportinfo/finishByGirdMember?id=${this.id}&eventStatus=1`).then((res) => {
if (res.code == 0) {
this.getDetail()
}

View File

@@ -101,7 +101,7 @@ export default {
methods: {
getList() {
let {current, eventStatus, searchGrid: {id: girdId}} = this
this.$http.post(`/app/appclapeventinfo/listByGirdMember`, null, {
this.$http.post(`/app/appresidentreportinfo/list`, null, {
params: {
size: 10,
current, searchType: this.currentTabs == 1 ? '1' : '0',