BUG 30150

This commit is contained in:
aixianling
2022-06-13 14:32:40 +08:00
parent 95ac3d55ae
commit a3f5bc03d0
2 changed files with 54 additions and 87 deletions

View File

@@ -1,17 +1,15 @@
<template> <template>
<div class="doc-circulation ailist-wrapper"> <section class="AppReportAtWill">
<keep-alive :include="['List']"> <component ref="component" :is="currentPage" @change="onChange" :params="params" :instance="instance" :dict="dict"/>
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component> </section>
</keep-alive>
</div>
</template> </template>
<script> <script>
import List from './components/List' import List from './components/List'
import Detail from './components/Detail' import Detail from './components/Detail'
import Setting from './components/Setting' import Setting from './components/Setting'
export default { export default {
name: 'AppReportAtWill', name: 'AppReportAtWill',
label: '随手拍', label: '随手拍',
@@ -20,53 +18,37 @@
dict: Object dict: Object
}, },
data () { data() {
return { return {
component: 'List', component: 'List',
params: {} params: {}
} }
}, },
computed: {
currentPage() {
let {hash, query: {id}} = this.$route
return hash == "#Setting" ? Setting :
!!id ? Detail : List
}
},
components: { components: {
List, List,
Detail, Detail,
Setting Setting
}, },
mounted () {
},
methods: { methods: {
onChange (data) { onChange(data) {
if (data.type === 'Detail') { this.$router.push({query: data.params, hash: data.type == "Setting" ? "#Setting" : ""})
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'Setting') {
this.component = 'Setting'
this.params = data.params
}
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
} }
} }
}
</script> </script>
<style lang="scss"> <style lang="scss">
.doc-circulation { .AppReportAtWill {
height: 100%; height: 100%;
background: #F3F6F9; background: #F3F6F9;
overflow: auto; overflow: auto;
} }
</style> </style>

View File

@@ -99,7 +99,7 @@
<el-form-item label="转交" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请选择网格员或网格' }]"> <el-form-item label="转交" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请选择网格员或网格' }]">
<el-input disabled size="small" v-model="forwardForm.name" clearable placeholder="请选择网格员或网格"> <el-input disabled size="small" v-model="forwardForm.name" clearable placeholder="请选择网格员或网格">
<template slot="append"> <template slot="append">
<el-button @click="isShowUser = true">选择</el-button> <el-button @click="getGirdList().then(()=>isShowUser=true )">选择</el-button>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -157,7 +157,7 @@ import {mapState} from 'vuex'
export default { export default {
name: 'Detail', name: 'Detail',
props: ['dict', 'instance', 'params'], props: ['dict', 'instance'],
data() { data() {
return { return {
@@ -179,7 +179,6 @@ export default {
processList: [], processList: [],
dictList: [], dictList: [],
defaultProps: { defaultProps: {
children: 'girdList',
label: 'girdName' label: 'girdName'
}, },
isShowForward: false, isShowForward: false,
@@ -201,7 +200,6 @@ export default {
created() { created() {
this.getDict() this.getDict()
this.getGirdList()
this.dict.load('clapEventStatus').then(() => { this.dict.load('clapEventStatus').then(() => {
this.getDetail() this.getDetail()
}) })
@@ -210,7 +208,7 @@ export default {
methods: { methods: {
getDetail() { getDetail() {
this.instance.post('/app/appclapeventinfo/queryDetailById', null, { this.instance.post('/app/appclapeventinfo/queryDetailById', null, {
params: {id: this.params.id} params: {id: this.$route.query.id}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.detail = res.data this.detail = res.data
@@ -228,9 +226,9 @@ export default {
}, },
getGirdList() { getGirdList() {
this.instance.post(`/app/appgirdinfo/listAllByTop`).then(res => { return this.instance.post(`/app/appgirdinfo/listAllByTop`).then(res => {
if (res?.data) { if (res?.data) {
this.tree = this.formatList([res.data]) return this.tree = this.formatList([res.data])
} }
}) })
}, },
@@ -250,29 +248,16 @@ export default {
}, },
formatList(list) { formatList(list) {
let arr = []
for (let item of list) { for (let item of list) {
if (item.girdMemberList && item.girdMemberList.length) { item.children = [item.girdList, item.girdMemberList?.map(e => ({
let userList = JSON.parse(JSON.stringify(item.girdMemberList)).map(v => { ...e, isUser: true, girdName: item.girdName,
return {
...v,
isUser: true,
girdName: item.girdName,
girdId: item.id girdId: item.id
} })) || []].flat()
}) if (item.girdList?.length > 0) {
item.girdList = [
...userList
]
delete item.girdMemberList
}
if (item.girdList && item.girdList.length) {
this.formatList(item.girdList) this.formatList(item.girdList)
} }
arr.push(item)
} }
return arr return list
}, },
filterNode(value, data) { filterNode(value, data) {
@@ -290,7 +275,7 @@ export default {
if (v) { if (v) {
this.instance.post('/app/appclapeventinfo/transferByManager', { this.instance.post('/app/appclapeventinfo/transferByManager', {
...this.forwardForm, ...this.forwardForm,
id: this.params.id id: this.$route.query.id
}).then(res => { }).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
this.isShowForward = false this.isShowForward = false
@@ -330,7 +315,7 @@ export default {
close() { close() {
this.$confirm('确定关闭该事件?').then(() => { this.$confirm('确定关闭该事件?').then(() => {
this.instance.post(`/app/appmininotice/delete?ids=${this.params.id}`).then(res => { this.instance.post(`/app/appmininotice/delete?ids=${this.$route.query.id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('删除成功!') this.$message.success('删除成功!')
this.getList() this.getList()
@@ -380,7 +365,7 @@ export default {
this.instance.post('/app/appclapeventinfo/finishByManager', { this.instance.post('/app/appclapeventinfo/finishByManager', {
...this.form, ...this.form,
groupName: this.dictList.filter(v => v.dictValue === this.form.groupId)[0].dictName, groupName: this.dictList.filter(v => v.dictValue === this.form.groupId)[0].dictName,
id: this.params.id id: this.$route.query.id
}).then(res => { }).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
this.isShowAdd = false this.isShowAdd = false