走访慰问
This commit is contained in:
		| @@ -1,163 +1,63 @@ | ||||
| <template> | ||||
|   <section class="AppInterview"> | ||||
|     <ai-list v-if="!isDetail"> | ||||
|       <template #title> | ||||
|         <ai-title title="事务记录" isShowBottomBorder/> | ||||
|       </template> | ||||
|       <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> | ||||
|   <div class="doc-circulation"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import InterviewDetail from "./interviewDetail"; | ||||
| import {mapState} from "vuex"; | ||||
|   import List from './components/List' | ||||
|   import Detail from './components/Detail' | ||||
|  | ||||
| export default { | ||||
|   name: "AppInterview", | ||||
|   label: "调查走访", | ||||
|   components: {InterviewDetail}, | ||||
|   provide() { | ||||
|     return { | ||||
|       interview: this | ||||
|     } | ||||
|   }, | ||||
|   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"} | ||||
|       ] | ||||
|   export default { | ||||
|     name: 'AppInterview', | ||||
|     label: '调查走访', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|     isDetail() { | ||||
|       return !!this.$route.query.id | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       search: {startTime: null, endTime: null, title: ""}, | ||||
|       page: {current: 1, size: 10, total: 0}, | ||||
|       tableData: [] | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     if (this.isDetail) { | ||||
|     } else this.getTableData() | ||||
|   }, | ||||
|   methods: { | ||||
|     getTableData() { | ||||
|       this.instance.post("/app/appinterview/list", null, { | ||||
|         params: {...this.search, ...this.page} | ||||
|       }).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data.records | ||||
|           this.page.total = res.data.total | ||||
|           this.$store.dispatch('initOpenData') | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         component: 'List', | ||||
|         params: {}, | ||||
|         include: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     components: { | ||||
|       Detail, | ||||
|       List | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         if (data.type === 'Detail') { | ||||
|           this.component = 'Detail' | ||||
|           this.params = data.params | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handleShow(id) { | ||||
|       if (id) { | ||||
|         this.$router.push({query: {id}}) | ||||
|       } else this.$message.error('该条数据异常,无法打开!') | ||||
|     }, | ||||
|     handleDelete(ids) { | ||||
|       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() | ||||
|  | ||||
|         if (data.type === 'List') { | ||||
|           this.component = 'List' | ||||
|           this.params = data.params | ||||
|  | ||||
|           this.$nextTick(() => { | ||||
|             if (data.isRefresh) { | ||||
|               this.$refs.component.getList() | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .AppInterview { | ||||
|   height: 100%; | ||||
|  | ||||
|   ::v-deep .dateRange { | ||||
|     .dateLabel { | ||||
|       height: 32px; | ||||
|       border: 1px solid #D0D4DC; | ||||
|       line-height: 32px; | ||||
|       padding: 0 8px; | ||||
|       background: #F5F5F5; | ||||
|     } | ||||
|  | ||||
|     .el-input__inner { | ||||
|       border-radius: 0; | ||||
|       transform: translateX(-1px); | ||||
|     } | ||||
| <style lang="scss"> | ||||
|   .doc-circulation { | ||||
|     height: 100%; | ||||
|     background: #F3F6F9; | ||||
|     overflow: auto; | ||||
|   } | ||||
|  | ||||
|   ::v-deep .ai-list__content--right-wrapper { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     gap: 10px; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -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> | ||||
		Reference in New Issue
	
	Block a user