From 07bf7fd304d1cae5457a0b8a49d979d87cf2aa0e Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 7 Jan 2022 13:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/AppHandSnapshot/Content.vue | 204 ++++++++------------- src/apps/AppHandSnapshot/Detail.vue | 5 +- src/apps/AppHandSnapshot/List.vue | 5 + src/apps/AppHandSnapshot/SelectUser.vue | 228 +++++++++++++----------- 4 files changed, 203 insertions(+), 239 deletions(-) diff --git a/src/apps/AppHandSnapshot/Content.vue b/src/apps/AppHandSnapshot/Content.vue index a1364b3a..704930a6 100644 --- a/src/apps/AppHandSnapshot/Content.vue +++ b/src/apps/AppHandSnapshot/Content.vue @@ -3,9 +3,7 @@
- - - + @@ -26,15 +24,15 @@
-
+
转交事件
-
+
拒绝受理
-
+
我已办结
@@ -52,12 +50,14 @@ export default { groupId: '', content: '', files: [], + name: '' }, flag: false, show: false, status: '', //1转交 2拒绝受理 3我已办结 myList: [], id: '', + selectUser: {} } }, onLoad(option) { @@ -66,135 +66,85 @@ 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, { - params: { - size: 9999, - }, - }) - .then((res) => { - if (res.code == 0) { - this.myList = res.data.records - this.$forceUpdate() - } - }) + this.$http.post(`/app/appclapeventgroup/list`, null, { + params: { + size: 9999, + }, + }) + .then((res) => { + if (res.code == 0) { + this.myList = res.data.records + this.$forceUpdate() + } + }) }, - selectStatus(e) { - console.log(e) - if (this.show) { - this.forms.groupName = e[0].label - this.forms.groupId = e[0].value - } else { + 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) { + this.forms.groupName = e[0].label + this.forms.groupId = e[0].value }, - - handerSelect() {}, - toSelectUser() { uni.navigateTo({ url: './SelectUser' }) }, diff --git a/src/apps/AppHandSnapshot/Detail.vue b/src/apps/AppHandSnapshot/Detail.vue index e16e15a5..aae9918e 100644 --- a/src/apps/AppHandSnapshot/Detail.vue +++ b/src/apps/AppHandSnapshot/Detail.vue @@ -114,7 +114,7 @@
我来受理
-
我已办结
+
前往办理
@@ -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() } }) diff --git a/src/apps/AppHandSnapshot/List.vue b/src/apps/AppHandSnapshot/List.vue index 232c9fde..96eef096 100644 --- a/src/apps/AppHandSnapshot/List.vue +++ b/src/apps/AppHandSnapshot/List.vue @@ -95,6 +95,11 @@ export default { this.current ++ this.getList() }) + uni.$on('getListInit', ()=>{ + this.current = 1 + this.getList() + }) + }, created() { this.$dict.load('clapEventStatus').then(() => { diff --git a/src/apps/AppHandSnapshot/SelectUser.vue b/src/apps/AppHandSnapshot/SelectUser.vue index 098ad200..47c4e0c4 100644 --- a/src/apps/AppHandSnapshot/SelectUser.vue +++ b/src/apps/AppHandSnapshot/SelectUser.vue @@ -1,14 +1,20 @@ @@ -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 - 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.treeInit() } }) }, + 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) { console.log(row) - this.$http.post(`/app/appgirdinfo/listAll2?id=${row.id}`).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 - } - }) + 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.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}¤t=${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() - }, - }, + } } @@ -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;