走访慰问

This commit is contained in:
yanran200830
2022-11-22 14:19:52 +08:00
parent 288e652f93
commit 2320fcd462
2 changed files with 50 additions and 247 deletions

View File

@@ -1,163 +1,63 @@
<template> <template>
<section class="AppInterview"> <div class="doc-circulation">
<ai-list v-if="!isDetail"> <keep-alive :include="['List']">
<template #title> <component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
<ai-title title="事务记录" isShowBottomBorder/> </keep-alive>
</template> </div>
<template #content>
<ai-search-bar>
<template #left>
<ai-search label="创建日期">
<el-date-picker
size="small"
v-model="search.startTime"
placeholder="开始日期"
@change="page.current = 1, getTableData()"
value-format="yyyy-MM-dd"/>
<el-date-picker
size="small"
v-model="search.endTime"
placeholder="结束日期"
@change="page.current = 1, getTableData()"
value-format="yyyy-MM-dd"/>
</ai-search>
</template>
<template #right>
<el-input
suffix-icon="iconfont iconSearch"
v-model="search.title"
placeholder="标题"
clearable
v-throttle="() => {page.current = 1, getTableData()}"
@clear="page.current = 1, search.title = '', getTableData()"
size="small"/>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:colConfigs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
@getList="getTableData">
<el-table-column label="操作" align="center" slot="options" fixed="right" width="160">
<template slot-scope="{row}">
<div class="table-options">
<el-button type="text" title="详情" @click="handleShow(row.id)">详情</el-button>
<el-button type="text" title="删除" @click="handleDelete(row.id)"
v-if="permissions('app_appinterview_del')">删除
</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<interview-detail v-else/>
</section>
</template> </template>
<script> <script>
import InterviewDetail from "./interviewDetail"; import List from './components/List'
import {mapState} from "vuex"; import Detail from './components/Detail'
export default { export default {
name: "AppInterview", name: 'AppInterview',
label: "调查走访", label: '调查走访',
components: {InterviewDetail},
provide() { props: {
return { instance: Function,
interview: this dict: Object
}
},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
...mapState(['user']),
colConfigs() {
return [
{label: "标题", prop: "title"},
{label: "时间", prop: "createTime"},
{label: "操作人", prop: "createUserId", openType: 'userName'},
{slot: "options"}
]
}, },
isDetail() {
return !!this.$route.query.id data () {
} return {
}, component: 'List',
data() { params: {},
return { include: []
search: {startTime: null, endTime: null, title: ""}, }
page: {current: 1, size: 10, total: 0}, },
tableData: []
} components: {
}, Detail,
created() { List
if (this.isDetail) { },
} else this.getTableData()
}, methods: {
methods: { onChange (data) {
getTableData() { if (data.type === 'Detail') {
this.instance.post("/app/appinterview/list", null, { this.component = 'Detail'
params: {...this.search, ...this.page} this.params = data.params
}).then(res => {
if (res?.data) {
this.tableData = res.data.records
this.page.total = res.data.total
this.$store.dispatch('initOpenData')
} }
})
}, if (data.type === 'List') {
handleShow(id) { this.component = 'List'
if (id) { this.params = data.params
this.$router.push({query: {id}})
} else this.$message.error('该条数据异常,无法打开!') this.$nextTick(() => {
}, if (data.isRefresh) {
handleDelete(ids) { this.$refs.component.getList()
this.$confirm("是否要删除该调查走访?").then(() => { }
this.instance.post("/app/appinterview/delete", null, {params: {ids}}).then(res => { })
if (res?.code == 0) { }
this.$message.success("删除成功!") }
this.getTableData()
}
})
}).catch(() => 0)
},
back() {
this.$router.push({query: null})
this.getTableData()
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.AppInterview { .doc-circulation {
height: 100%; height: 100%;
background: #F3F6F9;
::v-deep .dateRange { overflow: auto;
.dateLabel {
height: 32px;
border: 1px solid #D0D4DC;
line-height: 32px;
padding: 0 8px;
background: #F5F5F5;
}
.el-input__inner {
border-radius: 0;
transform: translateX(-1px);
}
} }
::v-deep .ai-list__content--right-wrapper {
display: flex;
flex-direction: column;
gap: 10px;
}
}
</style> </style>

View File

@@ -1,97 +0,0 @@
<template>
<section class="interviewDetail">
<ai-detail>
<template #title>
<ai-title title="事务记录详情" isShowBottomBorder isShowBack @onBackClick="interview.back()"/>
</template>
<template #content>
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="56px">
<ai-info-item label="标题" isLine>{{ detail.title }}</ai-info-item>
<ai-info-item label="内容" isLine>{{ detail.content }}</ai-info-item>
<ai-info-item label="图片" isLine>
<div class="images">
<el-image
v-for="(op,i) in detail.fileList"
:key="i"
:src="op.accessUrl"
:preview-src-list="detail.fileList.map(e=>e.accessUrl)">
<i slot="placeholder" class="el-icon-picture-outline"/>
<i slot="error" class="el-icon-picture-outline"/>
</el-image>
</div>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
<!-- <template #footer>
<el-button @click="interview.back()">取消</el-button>
<el-button type="primary" @click="submitInterview" v-if="interview.permissions('app_appinterview_edit')">保存</el-button>
</template> -->
</ai-detail>
</section>
</template>
<script>
export default {
name: "interviewDetail",
inject: ['interview'],
data() {
return {
detail: {
fileList: []
}
}
},
created() {
this.getDetail()
},
methods: {
getDetail() {
let {id} = this.$route.query
this.interview.instance.post("/app/appinterview/queryDetailById", null, {params: {id}}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
submitInterview() {
this.$refs.interviewForm.validate(v => {
if (v) {
this.interview.instance.post("/app/appinterview/update-web", this.detail).then(res => {
if (res?.code == 0) {
this.$message.success("保存成功!")
this.interview.back()
}
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.interviewDetail {
height: 100%;
::v-deep .images {
display: flex;
gap: 16px;
flex-wrap: wrap;
&:before {
content: none;
}
.el-image__inner {
width: 82px !important;
height: 82px !important;
margin-right: 16px;
}
}
}
</style>