微心愿

This commit is contained in:
liuye
2022-11-16 14:13:16 +08:00
parent 83a1e0efe5
commit 309d835894
4 changed files with 44 additions and 388 deletions

View File

@@ -5,13 +5,8 @@
@change="change"></u-tabs>
<div class="select-top">
<div class="tab-item">
<!-- <AiPagePicker type="gird" v-model="searchGrid" @change="confirm" valueObj nodeKey="id" formType="2">
<AiMore v-model="searchGrid.girdName" icon="arrow-down" placeholder="所属网格"/>
</AiPagePicker> -->
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>所在地区</span>
<u-icon name="arrow-down" color="#666" size="24" style="margin-left: 4px" />
<AiMore v-model="areaName" icon="arrow-down" placeholder="所在地区"/>
</AiAreaPicker>
</div>
<div class="tab-item" @click="showType = true">
@@ -32,8 +27,8 @@
</div>
<div class="gards">
<span>所属网格</span>
<span class="gards-right">{{ item.girdName }}</span>
<span>所属地区</span>
<span class="gards-right">{{ item.areaName }}</span>
</div>
</div>
@@ -100,6 +95,8 @@ export default {
document.title = '微心愿'
},
created() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory').then(() => {
this.getList()
})
@@ -107,15 +104,18 @@ export default {
methods: {
areaSelect(e) {
this.areaId = e
// this.getList()
this.current = 1
this.getList()
},
getList() {
let {current, eventStatus, searchGrid: {id: girdId}} = this
this.$http.post(`/app/appclapeventinfo/listByGirdMember`, null, {
let {current, eventStatus, areaId} = this
this.$http.post(`/app/appclapeventinfopingchang/listByGirdMember`, null, {
params: {
size: 10,
current, searchType: this.currentTabs == 1 ? '1' : '0',
eventStatus, girdId
current,
eventStatus,
areaId,
searchType: this.currentTabs == 1 ? '1' : '0',
},
})
.then((res) => {

View File

@@ -3,7 +3,10 @@
<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/>
<AiPagePicker type="sysUser" single :selected.sync="forms.user" action="/app/wxcp/wxuser/list?status=1" nodeKey="id" @select="handleSelectUser" class="select-user">
<span style="margin-left: 4px" v-if="forms.user && forms.user.length">{{ forms.user[0].name }}</span>
<span v-else class="color-999">请选择</span>
</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="请选择事件分类" /> -->
@@ -52,7 +55,9 @@ export default {
groupId: '',
content: '',
files: [],
name: ''
wxUserName: '',
wxUserId: '',
user: []
},
flag: false,
show: false,
@@ -69,20 +74,17 @@ 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
}
})
},
onShow() {
document.title = this.titleList[this.status]
},
methods: {
handleSelectUser(e) {
console.log(e)
this.forms.user = e
this.forms.wxUserId = e[0].id
this.forms.wxUserName = e[0].name
},
typeList() {
this.$http.post(`/app/appclapeventgroup/list`, null, {
params: {
@@ -98,7 +100,7 @@ export default {
},
confirm() {
if (this.status == 1 && !this.forms.name) {
if (this.status == 1 && !this.forms.wxUserName) {
return this.$u.toast('请选择转交对象')
}
if (this.status != 1 && !this.forms.groupName) {
@@ -112,29 +114,19 @@ export default {
submit() { //status 1转交 2拒绝受理 3我已办结
var url = '', successText = '', params = ''
if (this.status == 1) {
url = `/app/appclapeventinfo/transfer`
url = `/app/appclapeventinfopingchang/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
}
}
if (this.status == 2) {
url = `/app/appclapeventinfo/refuse`
url = `/app/appclapeventinfopingchang/refuse`
successText = '拒绝成功'
params = {...this.forms}
}
if (this.status == 3) {
url = `/app/appclapeventinfo/finishByGirdMember`
url = `/app/appclapeventinfopingchang/finishByGirdMember`
successText = '办结成功'
params = {...this.forms}
}
params = {...this.forms}
params.id = this.id
this.$http.post(url, params).then((res) => {
if (res.code == 0) {
@@ -155,9 +147,6 @@ export default {
this.forms.groupName = e[0].label
this.forms.groupId = e[0].value
},
toSelectUser() {
uni.navigateTo({url: '../AppGridManagement/selectGridMember'})
},
},
}
</script>
@@ -238,5 +227,10 @@ export default {
width: 100%;
text-align: right;
}
.select-user {
width: 100%;
text-align: right;
}
}
</style>

View File

@@ -21,8 +21,8 @@
</div>
<div class="card">
<span class="card-left">所属网格</span>
<span class="card-right">{{ data.girdName }}</span>
<span class="card-left">所属地区</span>
<span class="card-right">{{ data.areaName }}</span>
</div>
<div class="card">
@@ -92,12 +92,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>
@@ -166,7 +166,7 @@ export default {
},
methods: {
getDetail() {
this.$http.post(`/app/appclapeventinfo/queryDetailById?id=${this.id}`).then((res) => {
this.$http.post(`/app/appclapeventinfopingchang/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.data = res.data
}
@@ -178,7 +178,7 @@ export default {
},
doThings() {
this.$http.post(`/app/appclapeventinfo/acceptance?id=${this.id}`).then((res) => {
this.$http.post(`/app/appclapeventinfopingchang/acceptance?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.getDetail()
}
@@ -325,6 +325,7 @@ uni-page-body {
.plan {
padding: 0 32px;
background-color: #fff;
.nav {
padding: 26px 0;

View File

@@ -1,339 +0,0 @@
<template>
<div class="SelectUser">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in slectList" :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="showTypes" v-if="!userList.length">
<div v-if="treeList.length > 0">
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
<div class="imges">
<span v-if="item.girdLevel == 2">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
</span>
<img src="./components/img/gird--select-icon.png" alt="" class="avatras" />
</div>
<div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs" />
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
<div class="showUsers" v-else>
<div v-if="userList.length > 0">
<div class="cards" v-for="(e, index) in userList" :key="index">
<div class="imges">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(e, index)" />
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)" />
<img src="./components/img/tx@2x.png" alt="" class="avatras" />
</div>
<div class="rights">
<div class="applicationNames">{{ e.name }}</div>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
</div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</div>
</template>
<script>
export default {
name: 'SelectUser',
data() {
return {
selectUser: {},
allData: null,
treeList: [],
slectList: [],
userList: [],
}
},
onLoad() {
this.getTree()
},
onShow() {
document.title = '选择人员'
},
methods: {
getTree() {
this.slectList = []
this.$http.post('/app/appgirdinfo/listAllByTop').then((res) => {
if (res?.data) {
this.allData = res.data
this.treeInit()
}
})
},
treeInit() {
if(this.allData[0].girdLevel == 2) {
if(this.allData[0].girdMemberList && this.allData[0].girdMemberList.length) {
this.userList = this.allData[0].girdMemberList
this.userList.map((item) => {
item.isChecked = false
})
}
}else {
this.treeList = this.allData[0].girdList
}
var obj = {
girdName: this.allData[0].girdName,
id: this.allData[0].id,
girdLevel: this.allData[0].girdLevel
}
this.slectList.push(obj)
},
itemClick(row) {
console.log(row)
var obj = {
girdName: row.girdName,
id: row.id,
girdLevel: row.girdLevel
}
this.slectList.push(obj)
this.searckGird(row)
},
searckGird(row) {
this.treeList = []
if(row.girdLevel != 2) { //查网格
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
if (res?.data) {
this.treeList = res.data.records
}
})
}else { //查网格员
this.userList = []
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${row.id}`).then((res) => {
if (res?.data) {
this.userList = res.data
this.userList.map((item) => {
item.isChecked = false
})
}
})
}
},
girdNameClick(row, index) {
this.userList = []
if(!index) { //第一级别
this.slectList = []
this.treeInit()
}else {
var list = []
this.slectList.map((item, i) => {
if(i <= index) {
list.push(item)
}
})
this.slectList = list
this.searckGird(row)
}
},
girdClick(row, index) {
if (this.treeList[index].isChecked) {//取消
this.treeList[index].isChecked = false
this.selectUser = {}
} else {
this.treeList.map((item) => {
item.isChecked = false
})
this.treeList[index].isChecked = true
this.selectUser = row
}
this.$forceUpdate()
},
userClick(row, index) {
if (this.userList[index].isChecked) {//取消
this.userList[index].isChecked = false
this.selectUser = {}
} else {
this.userList.map((item) => {
item.isChecked = false
})
this.userList[index].isChecked = true
this.selectUser = row
}
this.$forceUpdate()
},
submit() {
if (this.selectUser.id != null) {
uni.$emit('goback', this.selectUser)
uni.navigateBack()
} else {
return this.$u.toast('请选择网格或网格员')
}
},
}
}
</script>
<style scoped lang="scss">
.SelectUser {
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: 0px 1px 0px 0px #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.showTypes {
.empty-div {
height: 16px;
background: #f5f5f5;
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
// width: 200px;
.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: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
}
.imgs {
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
}
.showUsers {
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
width: 200px;
.imgselect {
width: 48px;
height: 48px;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.rights {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
}
.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>