This commit is contained in:
liuye
2022-01-07 13:58:07 +08:00
parent 519c9139ab
commit 07bf7fd304
4 changed files with 203 additions and 239 deletions

View File

@@ -3,9 +3,7 @@
<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.status" placeholder="请选择转交对象" @click="toSelectUser" disabled />
<!-- <AiTreePicker :ops="treeList" v-model="forms.status" @select="handerSelect"> </AiTreePicker> -->
<u-input v-model="forms.name" placeholder="请选择转交对象" @click="toSelectUser" disabled />
</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="请选择事件分类" @click="show = true" />
@@ -26,15 +24,15 @@
</u-form>
</div>
<div class="btn" v-if="this.status == 1" @click="submit3">
<div class="btn" v-if="this.status == 1" @click="confirm">
<span>转交事件</span>
</div>
<div class="btn" v-if="this.status == 2" @click="submit2">
<div class="btn" v-if="this.status == 2" @click="confirm">
<span>拒绝受理</span>
</div>
<div class="btn" v-if="this.status == 3" @click="submit3">
<div class="btn" v-if="this.status == 3" @click="confirm">
<span>我已办结</span>
</div>
</div>
@@ -52,12 +50,14 @@ export default {
groupId: '',
content: '',
files: [],
name: ''
},
flag: false,
show: false,
status: '', //1转交 2拒绝受理 3我已办结
myList: [],
id: '',
selectUser: {}
}
},
onLoad(option) {
@@ -66,112 +66,19 @@ export default {
this.forms.groupId = option.groupId
this.forms.groupName = option.groupName
this.typeList()
uni.$on('goback', (res) => {
this.selectUser = res
if(res.name) {
this.forms.name = res.name
}else{
this.forms.name = res.girdName
}
})
},
methods: {
// 拒绝 /app/appclapeventinfo/finishByManager
// 同意 /app/appclapeventinfo/finishByGirdMember
// 拒绝
submit2() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
if (this.status == 2 || this.status == 3) {
if (!this.forms.groupName) {
return this.$u.toast('请选择事件分类')
}
if (!this.forms.content) {
return this.$u.toast(this.status == 2 ? '请输入拒绝受理意见' : '请输入你的办结意见')
}
}
const imgs = []
if (this.forms.files) {
this.forms.files.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
.post('/app/appclapeventinfo/refuse', {
groupName: this.forms.groupName,
groupId: this.forms.groupId,
content: this.forms.content,
files: imgs || [],
id: this.id,
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('受理成功')
this.forms = {}
this.flag = false
uni.$emit('nextList')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
} else {
this.$u.toast('失败')
}
})
},
// 同意
submit3() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
if (this.status == 2 || this.status == 3) {
if (!this.forms.groupName) {
return this.$u.toast('请选择事件分类')
}
if (!this.forms.content) {
return this.$u.toast(this.status == 2 ? '请输入拒绝受理意见' : '请输入你的办结意见')
}
}
const imgs = []
if (this.forms.files) {
this.forms.files.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
.post('/app/appclapeventinfo/finishByGirdMember', {
groupName: this.forms.groupName,
groupId: this.forms.groupId,
content: this.forms.content,
files: imgs || [],
id: this.id,
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('受理成功')
this.flag = false
this.forms = {}
uni.$emit('nextList')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
} else {
this.$u.toast('失败')
}
})
},
typeList() {
this.$http
.post(`/app/appclapeventgroup/list`, null, {
this.$http.post(`/app/appclapeventgroup/list`, null, {
params: {
size: 9999,
},
@@ -184,17 +91,60 @@ export default {
})
},
confirm() {
if(this.status == 1 && !this.forms.name) {
return this.$u.toast('请选择转交对象')
}
if(this.status != 1 && !this.forms.groupName) {
return this.$u.toast('请选择分类')
}
if(this.status != 1 && !this.forms.content) {
return this.$u.toast('请输入意见')
}
this.submit()
},
submit() { //status 1转交 2拒绝受理 3我已办结
var url = '', successText= '', params= ''
if(this.status == 1) {
url = `/app/appclapeventinfo/transfer`
successText = '转交成功'
params = {
...this.forms,
girdId: this.selectUser.id,
girdName: this.selectUser.girdName,
}
if(this.selectUser.name) { //选择的网格员
this.params.girdId = this.selectUser.girdId
this.params.girdMemberId = this.selectUser.id
this.params.girdMemberName = this.selectUser.name
}
}
if(this.status == 2) {
url = `/app/appclapeventinfo/refuse`
successText = '拒绝成功'
params = {...this.forms}
}
if(this.status == 3) {
url = `/app/appclapeventinfo/finishByGirdMember`
successText = '办结成功'
params = {...this.forms}
}
params.id = this.id
this.$http.post(url, params).then((res) => {
if (res.code == 0) {
this.$u.toast(successText)
uni.$emit('updateDeatil')
uni.$emit('getListInit')
setTimeout(() => {
uni.navigateBack()
},600)
}
})
},
selectStatus(e) {
console.log(e)
if (this.show) {
this.forms.groupName = e[0].label
this.forms.groupId = e[0].value
} else {
}
},
handerSelect() {},
toSelectUser() {
uni.navigateTo({ url: './SelectUser' })
},

View File

@@ -114,7 +114,7 @@
<div class="doIt" @click="doItShow = true">我来受理</div>
</div>
<div class="endDoIt" v-if="data.eventStatus == 1" @click="toContent(3)">我已办结</div>
<div class="endDoIt" v-if="data.eventStatus == 1" @click="toContent(3)">前往办理</div>
</div>
<u-modal v-model="doItShow" :mask-close-able="true" z-index="99" content="确定受理该事件?" :show-cancel-button="true" @confirm="doThings"></u-modal>
@@ -141,7 +141,7 @@ export default {
this.getDetail()
})
uni.$on('nextList', () => {
uni.$on('updateDeatil', () => {
this.getDetail()
})
},
@@ -162,7 +162,6 @@ export default {
doThings() {
this.$http.post(`/app/appclapeventinfo/acceptance?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.$u.toast('受理成功!')
this.getDetail()
}
})

View File

@@ -95,6 +95,11 @@ export default {
this.current ++
this.getList()
})
uni.$on('getListInit', ()=>{
this.current = 1
this.getList()
})
},
created() {
this.$dict.load('clapEventStatus').then(() => {

View File

@@ -1,14 +1,20 @@
<template>
<div class="SelectUser" v-if="showPage">
<div class="SelectUser">
<div class="header-middle">
<div class="hint">
<span style="color:#3F8DF5" v-for="(item, index) in slectList" :key="index">{{item.girdName}}</span>
<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">
<div class="showTypes" v-if="!userList.length">
<div v-if="treeList.length > 0">
<div class="cards" v-for="(item, i) in treeList" :key="i" @click="itemClick(item)">
<img src="./components/img/tx@2x.png" alt="" />
<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/tx@2x.png" alt="" class="avatras" />
</div>
<div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs" />
@@ -19,7 +25,7 @@
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
<!-- <div class="showUsers" v-else>
<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">
@@ -31,20 +37,19 @@
<div class="rights">
<div class="applicationNames">{{ e.name }}</div>
<div class="idNumbers">{{ e.idNumber && e.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1******$2') }}</div>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div> -->
</div>
</div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
<!-- <AiBck /> -->
</div>
</template>
@@ -53,20 +58,11 @@ export default {
name: 'SelectUser',
data() {
return {
typeList: [],
userList: [],
keyword: '',
current: 1,
showType: true,
applicationName: '',
applicationId: '',
selectUser: {},
allData: null,
showPage: false,
treeList: [],
slectList: []
slectList: [],
userList: [],
}
},
onLoad() {
@@ -74,47 +70,100 @@ export default {
},
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].isLastLevel == 1) {
this.treeList = this.allData[0].girdMemberList
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,
girdId: this.allData[0].girdId
id: this.allData[0].id,
girdLevel: this.allData[0].girdLevel
}
this.slectList.push(obj)
this.showPage = true
}
})
},
itemClick(row) {
console.log(row)
this.$http.post(`/app/appgirdinfo/listAll2?id=${row.id}`).then((res) => {
var obj = {
girdName: row.girdName,
id: row.id,
girdLevel: row.girdLevel
}
this.slectList.push(obj)
this.searckGird(row)
},
searckGird(row) {
if(row.girdLevel != 2) { //查网格
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
if (res?.data) {
// this.allData = res.data
// if(this.allData[0].isLastLevel == 1) {
// this.treeList = this.allData[0].girdMemberList
// }else {
// this.treeList = this.allData[0].girdList
// }
// var obj = {
// girdName: this.allData[0].girdName,
// girdId: this.allData[0].girdId
// }
// this.slectList.push(obj)
// this.showPage = true
this.treeList = res.data.records
}
})
}else { //查网格员
this.$http.post(`/app/appgirdmemberinfo/listByGirdId`, {
appGirdMemberInfo: {
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) {
//取消
if (this.userList[index].isChecked) {//取消
this.userList[index].isChecked = false
this.selectUser = {}
} else {
@@ -124,74 +173,18 @@ export default {
this.userList[index].isChecked = true
this.selectUser = row
}
},
getTypeList() {
this.userList = []
this.$http.post(`/app/appapplicationinfo/queryApplicationListByType?type=0&status=1`).then((res) => {
if (res.code == 0) {
this.typeList = res.data
}
})
},
getUsers() {
uni.showLoading({
title: '加载中',
})
this.$http.post(`/app/appapplicationinfo/list?appId=${this.appId}&current=${this.current}&size=${999}`, { searchParam: this.keyword }).then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
item.isChecked = false
})
uni.hideLoading()
this.userList = res.data.records
}
})
this.$forceUpdate()
},
submit() {
if (this.selectUser.id != null) {
uni.$emit('goBack', { selectUser: this.selectUser, applicationName: this.applicationName, applicationId: this.applicationId })
uni.$emit('goback', this.selectUser)
uni.navigateBack()
} else {
return this.$u.toast('请选择员')
return this.$u.toast('请选择网格或网格员')
}
},
toUserSelect(item) {
this.applicationName = item.applicationName
this.applicationId = item.id
this.appId = item.id
this.getUsers()
this.showType = false
},
back() {
this.keyword = ''
this.typeList = []
this.userList = []
this.applicationName = ''
this.showType = true
this.getTypeList()
},
handerSearch(e) {
if (!this.showType) {
this.keyword = e
this.current = 1
// this.getUser()
this.getUsers()
}
},
handerClear() {
this.keyword = ''
this.current = 1
this.getUsers()
},
},
}
</script>
@@ -229,6 +222,23 @@ export default {
// 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;