This commit is contained in:
yanran200730
2022-01-07 14:12:58 +08:00
5 changed files with 251 additions and 241 deletions

View File

@@ -3,9 +3,7 @@
<div class="contents"> <div class="contents">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false"> <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-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 /> <u-input v-model="forms.name" placeholder="请选择转交对象" @click="toSelectUser" disabled />
<!-- <AiTreePicker :ops="treeList" v-model="forms.status" @select="handerSelect"> </AiTreePicker> -->
</u-form-item> </u-form-item>
<u-form-item label="事件分类" prop="groupName" required :border-bottom="false" right-icon="arrow-right" v-if="status != 1"> <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" /> <u-input v-model="forms.groupName" placeholder="请选择事件分类" @click="show = true" />
@@ -26,15 +24,15 @@
</u-form> </u-form>
</div> </div>
<div class="btn" v-if="this.status == 1" @click="submit3"> <div class="btn" v-if="this.status == 1" @click="confirm">
<span>转交事件</span> <span>转交事件</span>
</div> </div>
<div class="btn" v-if="this.status == 2" @click="submit2"> <div class="btn" v-if="this.status == 2" @click="confirm">
<span>拒绝受理</span> <span>拒绝受理</span>
</div> </div>
<div class="btn" v-if="this.status == 3" @click="submit3"> <div class="btn" v-if="this.status == 3" @click="confirm">
<span>我已办结</span> <span>我已办结</span>
</div> </div>
</div> </div>
@@ -52,12 +50,14 @@ export default {
groupId: '', groupId: '',
content: '', content: '',
files: [], files: [],
name: ''
}, },
flag: false, flag: false,
show: false, show: false,
status: '', //1转交 2拒绝受理 3我已办结 status: '', //1转交 2拒绝受理 3我已办结
myList: [], myList: [],
id: '', id: '',
selectUser: {}
} }
}, },
onLoad(option) { onLoad(option) {
@@ -66,135 +66,85 @@ export default {
this.forms.groupId = option.groupId this.forms.groupId = option.groupId
this.forms.groupName = option.groupName this.forms.groupName = option.groupName
this.typeList() this.typeList()
uni.$on('goback', (res) => {
this.selectUser = res
if(res.name) {
this.forms.name = res.name
}else{
this.forms.name = res.girdName
}
})
}, },
methods: { 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() { typeList() {
this.$http this.$http.post(`/app/appclapeventgroup/list`, null, {
.post(`/app/appclapeventgroup/list`, null, { params: {
params: { size: 9999,
size: 9999, },
}, })
}) .then((res) => {
.then((res) => { if (res.code == 0) {
if (res.code == 0) { this.myList = res.data.records
this.myList = res.data.records this.$forceUpdate()
this.$forceUpdate() }
} })
})
}, },
selectStatus(e) { confirm() {
console.log(e) if(this.status == 1 && !this.forms.name) {
if (this.show) { return this.$u.toast('请选择转交对象')
this.forms.groupName = e[0].label
this.forms.groupId = e[0].value
} else {
} }
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) {
this.forms.groupName = e[0].label
this.forms.groupId = e[0].value
}, },
handerSelect() {},
toSelectUser() { toSelectUser() {
uni.navigateTo({ url: './SelectUser' }) uni.navigateTo({ url: './SelectUser' })
}, },

View File

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

View File

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

View File

@@ -1,14 +1,20 @@
<template> <template>
<div class="SelectUser" v-if="showPage"> <div class="SelectUser">
<div class="header-middle"> <div class="header-middle">
<div class="hint"> <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>
<div class="showTypes"> <div class="showTypes" v-if="!userList.length">
<div v-if="treeList.length > 0"> <div v-if="treeList.length > 0">
<div class="cards" v-for="(item, i) in treeList" :key="i" @click="itemClick(item)"> <div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
<img src="./components/img/tx@2x.png" alt="" /> <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="rightes">
<div class="applicationNames">{{ item.girdName }}</div> <div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs" /> <img src="./components/img/right-icon.png" alt="" class="imgs" />
@@ -19,7 +25,7 @@
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty> <AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div> </div>
<!-- <div class="showUsers" v-else> <div class="showUsers" v-else>
<div v-if="userList.length > 0"> <div v-if="userList.length > 0">
<div class="cards" v-for="(e, index) in userList" :key="index"> <div class="cards" v-for="(e, index) in userList" :key="index">
<div class="imges"> <div class="imges">
@@ -31,20 +37,19 @@
<div class="rights"> <div class="rights">
<div class="applicationNames">{{ e.name }}</div> <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> </div>
</div> </div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty> <AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div> --> </div>
</div> </div>
<div class="subBtn" @click="submit"> <div class="subBtn" @click="submit">
<div>确定选择</div> <div>确定选择</div>
</div> </div>
<!-- <AiBck /> -->
</div> </div>
</template> </template>
@@ -53,20 +58,11 @@ export default {
name: 'SelectUser', name: 'SelectUser',
data() { data() {
return { return {
typeList: [],
userList: [],
keyword: '',
current: 1,
showType: true,
applicationName: '',
applicationId: '',
selectUser: {}, selectUser: {},
allData: null, allData: null,
showPage: false,
treeList: [], treeList: [],
slectList: [] slectList: [],
userList: [],
} }
}, },
onLoad() { onLoad() {
@@ -74,47 +70,100 @@ export default {
}, },
methods: { methods: {
getTree() { getTree() {
this.slectList = []
this.$http.post('/app/appgirdinfo/listAllByTop').then((res) => { this.$http.post('/app/appgirdinfo/listAllByTop').then((res) => {
if (res?.data) { if (res?.data) {
this.allData = res.data this.allData = res.data
if(this.allData[0].isLastLevel == 1) { this.treeInit()
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
} }
}) })
}, },
treeInit() {
if(this.allData[0].isLastLevel == 1) {
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) { itemClick(row) {
console.log(row) console.log(row)
this.$http.post(`/app/appgirdinfo/listAll2?id=${row.id}`).then((res) => { var obj = {
if (res?.data) { girdName: row.girdName,
// this.allData = res.data id: row.id,
// if(this.allData[0].isLastLevel == 1) { girdLevel: row.girdLevel
// this.treeList = this.allData[0].girdMemberList }
// }else { this.slectList.push(obj)
// this.treeList = this.allData[0].girdList this.searckGird(row)
// } },
// var obj = {
// girdName: this.allData[0].girdName, searckGird(row) {
// girdId: this.allData[0].girdId if(row.girdLevel != 2) { //查网格
// } this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
// this.slectList.push(obj) if (res?.data) {
// 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) { userClick(row, index) {
if (this.userList[index].isChecked) { if (this.userList[index].isChecked) {//取消
//取消
this.userList[index].isChecked = false this.userList[index].isChecked = false
this.selectUser = {} this.selectUser = {}
} else { } else {
@@ -124,74 +173,18 @@ export default {
this.userList[index].isChecked = true this.userList[index].isChecked = true
this.selectUser = row this.selectUser = row
} }
}, this.$forceUpdate()
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
}
})
}, },
submit() { submit() {
if (this.selectUser.id != null) { if (this.selectUser.id != null) {
uni.$emit('goBack', { selectUser: this.selectUser, applicationName: this.applicationName, applicationId: this.applicationId }) uni.$emit('goback', this.selectUser)
uni.navigateBack() uni.navigateBack()
} else { } 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> </script>
@@ -229,6 +222,23 @@ export default {
// background: pink; // background: pink;
padding: 0 0 0 32px; 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 { img {
width: 74px; width: 74px;
height: 74px; height: 74px;

View File

@@ -46,7 +46,8 @@
<div class="leftInput" @click="showBottomInput = true">我来说两句...</div> <div class="leftInput" @click="showBottomInput = true">我来说两句...</div>
<div class="righticon"> <div class="righticon">
<u-icon name="thumb-up"></u-icon> <u-icon name="thumb-up" @click="praise"></u-icon>
<span class="icontext"></span> <span class="icontext"></span>
</div> </div>
</div> </div>
@@ -69,6 +70,8 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
export default { export default {
name: 'Detail', name: 'Detail',
props: {}, props: {},
@@ -79,15 +82,19 @@ export default {
timestamp: '', timestamp: '',
showBottomInput: false, showBottomInput: false,
content: '', content: '',
flag: false,
} }
}, },
computed: { computed: {
...mapState(['user']),
commentCount() { commentCount() {
return this.data.messages?.length || 0 return this.data.messages?.length || 0
}, },
}, },
watch: {}, watch: {},
onLoad(o) { onLoad(o) {
console.log(this.user)
this.id = o.id this.id = o.id
this.getDetail() this.getDetail()
this.$dict.load('discussStatus') this.$dict.load('discussStatus')
@@ -115,7 +122,43 @@ export default {
}) })
}, },
publish() {}, publish() {
if (this.flag) return
if (!this.content) {
return this.$u.toast('请输入你的想法')
}
this.$http
.post(`/app/appvillagediscussmessage/addOrUpdate`, {
content: this.content,
avatar: this.user.avatar,
createUserId: this.user.id,
createUserName: this.user.name,
discussId: this.id,
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast('留言成功')
this.flag = true
this.showBottomInput = false
this.getDetail()
}
})
},
praise() {
console.log('点赞')
this.$http.post(`/app/appvillagediscussmessage/suport?id=${this.id}&userId=${this.user.id}`).then((res) => {
if (res?.code == 0) {
this.$u.toast('点赞成功!')
this.getDetail()
}
})
},
a() {
console.log(aa)
},
previewImage(images, img) { previewImage(images, img) {
uni.previewImage({ uni.previewImage({
@@ -322,6 +365,9 @@ export default {
.uni-textarea-placeholder { .uni-textarea-placeholder {
padding: 16px 0 0 16px; padding: 16px 0 0 16px;
} }
.uni-textarea-textarea {
padding: 16px 0 0 16px;
}
} }
.words { .words {
background: #f7f7f7; background: #f7f7f7;