Commit 9cd53a9fba11b2868ae7feb10ce29caa10422b02
1 parent
2e81c59f
完成办公功能
Showing
6 changed files
with
568 additions
and
0 deletions
src/api/oa/simplifyNotepadManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取记事本列表 | |
| 4 | +export function listNotepad(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/notepad.listNotepad', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 保存记事本 | |
| 20 | +export function saveNotepad(data) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/notepad.saveNotepad', | |
| 24 | + method: 'post', | |
| 25 | + data | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 34 | + | |
| 35 | +// 更新记事本 | |
| 36 | +export function updateNotepad(data) { | |
| 37 | + return new Promise((resolve, reject) => { | |
| 38 | + request({ | |
| 39 | + url: '/notepad.updateNotepad', | |
| 40 | + method: 'post', | |
| 41 | + data | |
| 42 | + }).then(response => { | |
| 43 | + const res = response.data | |
| 44 | + resolve(res) | |
| 45 | + }).catch(error => { | |
| 46 | + reject(error) | |
| 47 | + }) | |
| 48 | + }) | |
| 49 | +} | |
| 50 | + | |
| 51 | +// 删除记事本 | |
| 52 | +export function deleteNotepad(data) { | |
| 53 | + return new Promise((resolve, reject) => { | |
| 54 | + request({ | |
| 55 | + url: '/notepad.deleteNotepad', | |
| 56 | + method: 'post', | |
| 57 | + data | |
| 58 | + }).then(response => { | |
| 59 | + const res = response.data | |
| 60 | + resolve(res) | |
| 61 | + }).catch(error => { | |
| 62 | + reject(error) | |
| 63 | + }) | |
| 64 | + }) | |
| 65 | +} | |
| 66 | + | |
| 67 | +// 获取记事本详情列表 | |
| 68 | +export function listNotepadDetail(params) { | |
| 69 | + return new Promise((resolve, reject) => { | |
| 70 | + request({ | |
| 71 | + url: '/notepad.listNotepadDetail', | |
| 72 | + method: 'get', | |
| 73 | + params | |
| 74 | + }).then(response => { | |
| 75 | + const res = response.data | |
| 76 | + resolve(res) | |
| 77 | + }).catch(error => { | |
| 78 | + reject(error) | |
| 79 | + }) | |
| 80 | + }) | |
| 81 | +} | |
| 82 | + | |
| 83 | +// 保存记事本详情 | |
| 84 | +export function saveNotepadDetail(data) { | |
| 85 | + return new Promise((resolve, reject) => { | |
| 86 | + request({ | |
| 87 | + url: '/notepad.saveNotepadDetail', | |
| 88 | + method: 'post', | |
| 89 | + data | |
| 90 | + }).then(response => { | |
| 91 | + const res = response.data | |
| 92 | + resolve(res) | |
| 93 | + }).catch(error => { | |
| 94 | + reject(error) | |
| 95 | + }) | |
| 96 | + }) | |
| 97 | +} | |
| 98 | + | |
| 99 | +// 删除记事本详情 | |
| 100 | +export function deleteNotepadDetail(data) { | |
| 101 | + return new Promise((resolve, reject) => { | |
| 102 | + request({ | |
| 103 | + url: '/notepad.deleteNotepadDetail', | |
| 104 | + method: 'post', | |
| 105 | + data | |
| 106 | + }).then(response => { | |
| 107 | + const res = response.data | |
| 108 | + resolve(res) | |
| 109 | + }).catch(error => { | |
| 110 | + reject(error) | |
| 111 | + }) | |
| 112 | + }) | |
| 113 | +} | |
| 114 | + | |
| 115 | +// 获取报修设置列表 | |
| 116 | +export function listRepairSettings(params) { | |
| 117 | + return new Promise((resolve, reject) => { | |
| 118 | + request({ | |
| 119 | + url: '/repair.listRepairSettings', | |
| 120 | + method: 'get', | |
| 121 | + params | |
| 122 | + }).then(response => { | |
| 123 | + const res = response.data | |
| 124 | + resolve(res) | |
| 125 | + }).catch(error => { | |
| 126 | + reject(error) | |
| 127 | + }) | |
| 128 | + }) | |
| 129 | +} | |
| 130 | + | |
| 131 | +// 保存业主报修 | |
| 132 | +export function saveOwnerRepair(data) { | |
| 133 | + return new Promise((resolve, reject) => { | |
| 134 | + request({ | |
| 135 | + url: '/ownerRepair.saveOwnerRepair', | |
| 136 | + method: 'post', | |
| 137 | + data | |
| 138 | + }).then(response => { | |
| 139 | + const res = response.data | |
| 140 | + resolve(res) | |
| 141 | + }).catch(error => { | |
| 142 | + reject(error) | |
| 143 | + }) | |
| 144 | + }) | |
| 145 | +} | |
| 0 | 146 | \ No newline at end of file | ... | ... |
src/components/oa/addNotepad.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('addNotepad.title')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="70%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <el-form :model="addNotepadInfo" ref="form" :rules="rules" label-width="120px"> | |
| 9 | + <el-form-item :label="$t('addNotepad.room')" prop="roomName"> | |
| 10 | + <el-input v-model="addNotepadInfo.roomName" disabled></el-input> | |
| 11 | + </el-form-item> | |
| 12 | + <el-form-item :label="$t('addNotepad.contact')" prop="objName"> | |
| 13 | + <el-input v-model="addNotepadInfo.objName" disabled></el-input> | |
| 14 | + </el-form-item> | |
| 15 | + <el-form-item :label="$t('addNotepad.phone')" prop="link"> | |
| 16 | + <el-input v-model="addNotepadInfo.link" disabled></el-input> | |
| 17 | + </el-form-item> | |
| 18 | + <el-form-item :label="$t('addNotepad.type')" prop="noteType"> | |
| 19 | + <el-select | |
| 20 | + v-model="addNotepadInfo.noteType" | |
| 21 | + style="width:100%" | |
| 22 | + :placeholder="$t('addNotepad.typePlaceholder')" | |
| 23 | + > | |
| 24 | + <el-option | |
| 25 | + v-for="item in addNotepadInfo.noteTypes" | |
| 26 | + :key="item.statusCd" | |
| 27 | + :label="item.name" | |
| 28 | + :value="item.statusCd" | |
| 29 | + /> | |
| 30 | + </el-select> | |
| 31 | + </el-form-item> | |
| 32 | + <el-form-item :label="$t('addNotepad.content')" prop="title"> | |
| 33 | + <el-input | |
| 34 | + type="textarea" | |
| 35 | + :rows="5" | |
| 36 | + v-model="addNotepadInfo.title" | |
| 37 | + :placeholder="$t('addNotepad.contentPlaceholder')" | |
| 38 | + /> | |
| 39 | + </el-form-item> | |
| 40 | + </el-form> | |
| 41 | + <span slot="footer" class="dialog-footer"> | |
| 42 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 43 | + <el-button type="primary" @click="saveNotepadInfo">{{ $t('common.save') }}</el-button> | |
| 44 | + </span> | |
| 45 | + </el-dialog> | |
| 46 | +</template> | |
| 47 | + | |
| 48 | +<script> | |
| 49 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 50 | +import { getDict } from '@/api/community/communityApi' | |
| 51 | +import { saveNotepad } from '@/api/oa/simplifyNotepadManageApi' | |
| 52 | + | |
| 53 | +export default { | |
| 54 | + name: 'AddNotepad', | |
| 55 | + data() { | |
| 56 | + return { | |
| 57 | + visible: false, | |
| 58 | + addNotepadInfo: { | |
| 59 | + noteId: '', | |
| 60 | + noteType: '', | |
| 61 | + title: '', | |
| 62 | + roomName: '', | |
| 63 | + roomId: '', | |
| 64 | + objId: '', | |
| 65 | + objName: '', | |
| 66 | + objType: '3309', | |
| 67 | + link: '', | |
| 68 | + noteTypes: [], | |
| 69 | + communityId: '' | |
| 70 | + }, | |
| 71 | + rules: { | |
| 72 | + roomName: [ | |
| 73 | + { required: true, message: this.$t('addNotepad.roomRequired'), trigger: 'blur' } | |
| 74 | + ], | |
| 75 | + objName: [ | |
| 76 | + { required: true, message: this.$t('addNotepad.contactRequired'), trigger: 'blur' } | |
| 77 | + ], | |
| 78 | + link: [ | |
| 79 | + { required: true, message: this.$t('addNotepad.phoneRequired'), trigger: 'blur' }, | |
| 80 | + { pattern: /^1[3-9]\d{9}$/, message: this.$t('addNotepad.phoneFormat'), trigger: 'blur' } | |
| 81 | + ], | |
| 82 | + noteType: [ | |
| 83 | + { required: true, message: this.$t('addNotepad.typeRequired'), trigger: 'change' } | |
| 84 | + ], | |
| 85 | + title: [ | |
| 86 | + { required: true, message: this.$t('addNotepad.contentRequired'), trigger: 'blur' }, | |
| 87 | + { max: 256, message: this.$t('addNotepad.contentMaxLength'), trigger: 'blur' } | |
| 88 | + ] | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }, | |
| 92 | + methods: { | |
| 93 | + open(params) { | |
| 94 | + this.visible = true | |
| 95 | + this.addNotepadInfo = { | |
| 96 | + ...this.addNotepadInfo, | |
| 97 | + ...params, | |
| 98 | + communityId: getCommunityId() | |
| 99 | + } | |
| 100 | + this.getNoteTypes() | |
| 101 | + }, | |
| 102 | + async getNoteTypes() { | |
| 103 | + try { | |
| 104 | + const data = await getDict('notepad', 'note_type') | |
| 105 | + this.addNotepadInfo.noteTypes = data | |
| 106 | + } catch (error) { | |
| 107 | + console.error('Failed to get note types:', error) | |
| 108 | + } | |
| 109 | + }, | |
| 110 | + async saveNotepadInfo() { | |
| 111 | + this.$refs.form.validate(async valid => { | |
| 112 | + if (!valid) return | |
| 113 | + | |
| 114 | + try { | |
| 115 | + await saveNotepad(this.addNotepadInfo) | |
| 116 | + this.$emit('success') | |
| 117 | + this.visible = false | |
| 118 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 119 | + } catch (error) { | |
| 120 | + this.$message.error(error.message || this.$t('common.saveFailed')) | |
| 121 | + } | |
| 122 | + }) | |
| 123 | + }, | |
| 124 | + handleClose() { | |
| 125 | + this.$refs.form.resetFields() | |
| 126 | + } | |
| 127 | + } | |
| 128 | +} | |
| 129 | +</script> | |
| 0 | 130 | \ No newline at end of file | ... | ... |
src/i18n/oaI18n.js
| ... | ... | @@ -49,6 +49,7 @@ import { messages as workDeductionMessages } from '../views/oa/workDeductionLang |
| 49 | 49 | import { messages as newOaWorkflowMessages } from '../views/oa/newOaWorkflowLang' |
| 50 | 50 | import { messages as newOaWorkflowDetailMessages } from '../views/oa/newOaWorkflowDetailLang' |
| 51 | 51 | import { messages as newOaWorkflowFormEditMessages } from '../views/oa/newOaWorkflowFormEditLang' |
| 52 | +import { messages as simplifyNotepadManageMessages } from '../views/oa/simplifyNotepadManageLang' | |
| 52 | 53 | |
| 53 | 54 | |
| 54 | 55 | export const messages ={ |
| ... | ... | @@ -103,6 +104,7 @@ export const messages ={ |
| 103 | 104 | ...newOaWorkflowMessages.en, |
| 104 | 105 | ...newOaWorkflowDetailMessages.en, |
| 105 | 106 | ...newOaWorkflowFormEditMessages.en, |
| 107 | + ...simplifyNotepadManageMessages.en, | |
| 106 | 108 | }, |
| 107 | 109 | zh:{ |
| 108 | 110 | ...activitiesTypeManageMessages.zh, |
| ... | ... | @@ -155,5 +157,6 @@ export const messages ={ |
| 155 | 157 | ...newOaWorkflowMessages.zh, |
| 156 | 158 | ...newOaWorkflowDetailMessages.zh, |
| 157 | 159 | ...newOaWorkflowFormEditMessages.zh, |
| 160 | + ...simplifyNotepadManageMessages.zh, | |
| 158 | 161 | } |
| 159 | 162 | } |
| 160 | 163 | \ No newline at end of file | ... | ... |
src/router/oaRouter.js
| ... | ... | @@ -234,4 +234,9 @@ export default [ |
| 234 | 234 | name: '/views/oa/newOaWorkflowFormEdit', |
| 235 | 235 | component: () => import('@/views/oa/newOaWorkflowFormEditList.vue') |
| 236 | 236 | }, |
| 237 | + { | |
| 238 | + path: '/pages/property/simplifyNotepadManage', | |
| 239 | + name: '/pages/property/simplifyNotepadManage', | |
| 240 | + component: () => import('@/views/oa/simplifyNotepadManageList.vue') | |
| 241 | + }, | |
| 237 | 242 | ] |
| 238 | 243 | \ No newline at end of file | ... | ... |
src/views/oa/simplifyNotepadManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + simplifyNotepadManage: { | |
| 4 | + title: 'Owner Feedback', | |
| 5 | + back: 'Back', | |
| 6 | + register: 'Register', | |
| 7 | + type: 'Type', | |
| 8 | + room: 'Room', | |
| 9 | + contact: 'Contact', | |
| 10 | + phone: 'Phone', | |
| 11 | + status: 'Status', | |
| 12 | + recordTime: 'Record Time', | |
| 13 | + registrant: 'Registrant', | |
| 14 | + content: 'Content', | |
| 15 | + operation: 'Operation', | |
| 16 | + completed: 'Completed', | |
| 17 | + following: 'Following', | |
| 18 | + transferred: 'Transferred to repair', | |
| 19 | + follow: 'Follow up', | |
| 20 | + progress: 'Progress', | |
| 21 | + transferRepair: 'Transfer to repair', | |
| 22 | + repairDetail: 'Repair Detail', | |
| 23 | + edit: 'Edit', | |
| 24 | + delete: 'Delete', | |
| 25 | + tip: 'Tip: Please register at the business acceptance page' | |
| 26 | + }, | |
| 27 | + addNotepad: { | |
| 28 | + title: 'Register', | |
| 29 | + room: 'Room', | |
| 30 | + contact: 'Contact', | |
| 31 | + phone: 'Phone', | |
| 32 | + type: 'Type', | |
| 33 | + content: 'Content', | |
| 34 | + roomRequired: 'Room is required', | |
| 35 | + contactRequired: 'Contact is required', | |
| 36 | + phoneRequired: 'Phone is required', | |
| 37 | + phoneFormat: 'Invalid phone format', | |
| 38 | + typeRequired: 'Type is required', | |
| 39 | + contentRequired: 'Content is required', | |
| 40 | + contentMaxLength: 'Content cannot exceed 256 characters', | |
| 41 | + typePlaceholder: 'Please select feedback type', | |
| 42 | + contentPlaceholder: 'Please enter content' | |
| 43 | + }, | |
| 44 | + }, | |
| 45 | + zh: { | |
| 46 | + simplifyNotepadManage: { | |
| 47 | + title: '业主反馈', | |
| 48 | + back: '返回', | |
| 49 | + register: '登记', | |
| 50 | + type: '类型', | |
| 51 | + room: '房屋', | |
| 52 | + contact: '联系人', | |
| 53 | + phone: '联系电话', | |
| 54 | + status: '状态', | |
| 55 | + recordTime: '记录时间', | |
| 56 | + registrant: '登记人', | |
| 57 | + content: '登记内容', | |
| 58 | + operation: '操作', | |
| 59 | + completed: '完成', | |
| 60 | + following: '跟进中', | |
| 61 | + transferred: '已转报修单', | |
| 62 | + follow: '跟进', | |
| 63 | + progress: '进度', | |
| 64 | + transferRepair: '转报修单', | |
| 65 | + repairDetail: '报修详情', | |
| 66 | + edit: '修改', | |
| 67 | + delete: '删除', | |
| 68 | + tip: '温馨提示:请到业务受理页面登记' | |
| 69 | + }, | |
| 70 | + addNotepad: { | |
| 71 | + title: '登记', | |
| 72 | + room: '房屋', | |
| 73 | + contact: '联系人', | |
| 74 | + phone: '联系电话', | |
| 75 | + type: '类型', | |
| 76 | + content: '内容', | |
| 77 | + roomRequired: '房屋不能为空', | |
| 78 | + contactRequired: '联系人不能为空', | |
| 79 | + phoneRequired: '联系电话不能为空', | |
| 80 | + phoneFormat: '联系电话格式错误', | |
| 81 | + typeRequired: '类型不能为空', | |
| 82 | + contentRequired: '内容不能为空', | |
| 83 | + contentMaxLength: '内容不能超过256字符', | |
| 84 | + typePlaceholder: '请选择反馈类型', | |
| 85 | + contentPlaceholder: '请填写内容' | |
| 86 | + } | |
| 87 | + } | |
| 88 | +} | |
| 0 | 89 | \ No newline at end of file | ... | ... |
src/views/oa/simplifyNotepadManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="simplify-notepad-manage-container"> | |
| 3 | + <el-card class="box-card"> | |
| 4 | + <div slot="header" class="flex justify-between"> | |
| 5 | + <span>{{ $t('simplifyNotepadManage.title') }}</span> | |
| 6 | + <div class="header-tools"> | |
| 7 | + <el-button type="primary" size="small" @click="goBack()"> | |
| 8 | + <i class="el-icon-close"></i> | |
| 9 | + <span>{{ $t('simplifyNotepadManage.back') }}</span> | |
| 10 | + </el-button> | |
| 11 | + <el-button type="primary" size="small" @click="_openAddNotepadModal()"> | |
| 12 | + <i class="el-icon-plus"></i> | |
| 13 | + <span>{{ $t('simplifyNotepadManage.register') }}</span> | |
| 14 | + </el-button> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + | |
| 18 | + <el-table :data="simplifyNotepadManageInfo.notepads" border style="width: 100%" v-loading="loading"> | |
| 19 | + <el-table-column prop="noteTypeName" :label="$t('simplifyNotepadManage.type')" align="center" /> | |
| 20 | + <el-table-column prop="roomName" :label="$t('simplifyNotepadManage.room')" align="center" /> | |
| 21 | + <el-table-column prop="objName" :label="$t('simplifyNotepadManage.contact')" align="center" /> | |
| 22 | + <el-table-column prop="link" :label="$t('simplifyNotepadManage.phone')" align="center" /> | |
| 23 | + <el-table-column prop="state" :label="$t('simplifyNotepadManage.status')" align="center"> | |
| 24 | + <template slot-scope="scope"> | |
| 25 | + {{ scope.row.state === 'F' ? $t('simplifyNotepadManage.completed') : $t('simplifyNotepadManage.following') | |
| 26 | + }} | |
| 27 | + <span v-if="scope.row.thridId">({{ $t('simplifyNotepadManage.transferred') }})</span> | |
| 28 | + </template> | |
| 29 | + </el-table-column> | |
| 30 | + <el-table-column prop="createTime" :label="$t('simplifyNotepadManage.recordTime')" align="center" /> | |
| 31 | + <el-table-column prop="createUserName" :label="$t('simplifyNotepadManage.registrant')" align="center" /> | |
| 32 | + <el-table-column prop="title" :label="$t('simplifyNotepadManage.content')" align="center" /> | |
| 33 | + <el-table-column :label="$t('simplifyNotepadManage.operation')" align="center" width="300"> | |
| 34 | + <template slot-scope="scope"> | |
| 35 | + <el-button-group> | |
| 36 | + <el-button v-if="scope.row.state === 'W'" size="mini" @click="_openAddNotepadDetailModal(scope.row)"> | |
| 37 | + {{ $t('simplifyNotepadManage.follow') }} | |
| 38 | + </el-button> | |
| 39 | + <el-button size="mini" @click="_openListNotepadDetailModal(scope.row)"> | |
| 40 | + {{ $t('simplifyNotepadManage.progress') }} | |
| 41 | + </el-button> | |
| 42 | + <el-button v-if="!scope.row.thridId" size="mini" @click="_openAddRepairModal(scope.row)"> | |
| 43 | + {{ $t('simplifyNotepadManage.transferRepair') }} | |
| 44 | + </el-button> | |
| 45 | + <el-button v-if="scope.row.thridId" size="mini" @click="_toRepairDetail(scope.row)"> | |
| 46 | + {{ $t('simplifyNotepadManage.repairDetail') }} | |
| 47 | + </el-button> | |
| 48 | + <el-button size="mini" @click="_openEditNotepadModel(scope.row)"> | |
| 49 | + {{ $t('simplifyNotepadManage.edit') }} | |
| 50 | + </el-button> | |
| 51 | + <el-button size="mini" type="danger" @click="_openDeleteNotepadModel(scope.row)"> | |
| 52 | + {{ $t('simplifyNotepadManage.delete') }} | |
| 53 | + </el-button> | |
| 54 | + </el-button-group> | |
| 55 | + </template> | |
| 56 | + </el-table-column> | |
| 57 | + </el-table> | |
| 58 | + | |
| 59 | + <el-row class="margin-top-xs"> | |
| 60 | + <el-col :span="18"> | |
| 61 | + <div>{{ $t('simplifyNotepadManage.tip') }}</div> | |
| 62 | + </el-col> | |
| 63 | + <el-col :span="6"> | |
| 64 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | |
| 65 | + :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize" | |
| 66 | + layout="total, sizes, prev, pager, next, jumper" :total="total" /> | |
| 67 | + </el-col> | |
| 68 | + </el-row> | |
| 69 | + </el-card> | |
| 70 | + | |
| 71 | + <add-notepad ref="addNotepad" @success="handleSuccess" /> | |
| 72 | + <edit-notepad ref="editNotepad" @success="handleSuccess" /> | |
| 73 | + <delete-notepad ref="deleteNotepad" @success="handleSuccess" /> | |
| 74 | + <add-notepad-detail ref="addNotepadDetail" @success="handleSuccess" /> | |
| 75 | + <notepad-detail ref="notepadDetail" /> | |
| 76 | + <notepad-owner-repair ref="notepadOwnerRepair" @success="handleSuccess" /> | |
| 77 | + </div> | |
| 78 | +</template> | |
| 79 | + | |
| 80 | +<script> | |
| 81 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 82 | +//import { getDict } from '@/api/community/communityApi' | |
| 83 | +import { listNotepad } from '@/api/oa/simplifyNotepadManageApi' | |
| 84 | +import AddNotepad from '@/components/oa/addNotepad' | |
| 85 | +import EditNotepad from '@/components/oa/editNotepad' | |
| 86 | +import DeleteNotepad from '@/components/oa/deleteNotepad' | |
| 87 | +import AddNotepadDetail from '@/components/oa/addNotepadDetail' | |
| 88 | +import NotepadDetail from '@/components/oa/notepadDetail' | |
| 89 | +import NotepadOwnerRepair from '@/components/oa/notepadOwnerRepair' | |
| 90 | + | |
| 91 | +export default { | |
| 92 | + name: 'SimplifyNotepadManageList', | |
| 93 | + components: { | |
| 94 | + AddNotepad, | |
| 95 | + EditNotepad, | |
| 96 | + DeleteNotepad, | |
| 97 | + AddNotepadDetail, | |
| 98 | + NotepadDetail, | |
| 99 | + NotepadOwnerRepair | |
| 100 | + }, | |
| 101 | + data() { | |
| 102 | + return { | |
| 103 | + loading: false, | |
| 104 | + currentPage: 1, | |
| 105 | + pageSize: 10, | |
| 106 | + total: 0, | |
| 107 | + simplifyNotepadManageInfo: { | |
| 108 | + notepads: [], | |
| 109 | + conditions: { | |
| 110 | + noteType: '', | |
| 111 | + title: '', | |
| 112 | + objName: '', | |
| 113 | + createUserName: '', | |
| 114 | + state: '', | |
| 115 | + objId: '', | |
| 116 | + communityId: '' | |
| 117 | + } | |
| 118 | + } | |
| 119 | + } | |
| 120 | + }, | |
| 121 | + created() { | |
| 122 | + this.communityId = getCommunityId() | |
| 123 | + this.simplifyNotepadManageInfo.conditions.communityId = this.communityId | |
| 124 | + this._listNotepads(this.currentPage, this.pageSize) | |
| 125 | + }, | |
| 126 | + methods: { | |
| 127 | + async _listNotepads(page, rows) { | |
| 128 | + this.loading = true | |
| 129 | + try { | |
| 130 | + const params = { | |
| 131 | + page, | |
| 132 | + row: rows, | |
| 133 | + ...this.simplifyNotepadManageInfo.conditions | |
| 134 | + } | |
| 135 | + const { data, total } = await listNotepad(params) | |
| 136 | + this.simplifyNotepadManageInfo.notepads = data | |
| 137 | + this.total = total | |
| 138 | + } catch (error) { | |
| 139 | + console.error('Failed to fetch notepads:', error) | |
| 140 | + } finally { | |
| 141 | + this.loading = false | |
| 142 | + } | |
| 143 | + }, | |
| 144 | + handleSizeChange(val) { | |
| 145 | + this.pageSize = val | |
| 146 | + this._listNotepads(this.currentPage, this.pageSize) | |
| 147 | + }, | |
| 148 | + handleCurrentChange(val) { | |
| 149 | + this.currentPage = val | |
| 150 | + this._listNotepads(this.currentPage, this.pageSize) | |
| 151 | + }, | |
| 152 | + _openAddNotepadModal() { | |
| 153 | + this.$refs.addNotepad.open({ | |
| 154 | + roomId: this.simplifyNotepadManageInfo.roomId, | |
| 155 | + ownerId: this.simplifyNotepadManageInfo.ownerId | |
| 156 | + }) | |
| 157 | + }, | |
| 158 | + _openAddNotepadDetailModal(notepad) { | |
| 159 | + this.$refs.addNotepadDetail.open(notepad) | |
| 160 | + }, | |
| 161 | + _openListNotepadDetailModal(notepad) { | |
| 162 | + this.$refs.notepadDetail.open(notepad) | |
| 163 | + }, | |
| 164 | + _openEditNotepadModel(notepad) { | |
| 165 | + this.$refs.editNotepad.open(notepad) | |
| 166 | + }, | |
| 167 | + _openDeleteNotepadModel(notepad) { | |
| 168 | + this.$refs.deleteNotepad.open(notepad) | |
| 169 | + }, | |
| 170 | + _openAddRepairModal(notepad) { | |
| 171 | + this.$refs.notepadOwnerRepair.open(notepad) | |
| 172 | + }, | |
| 173 | + _toRepairDetail(notepad) { | |
| 174 | + this.$router.push(`/pages/property/ownerRepairDetail?repairId=${notepad.thridId}`) | |
| 175 | + }, | |
| 176 | + handleSuccess() { | |
| 177 | + this._listNotepads(this.currentPage, this.pageSize) | |
| 178 | + }, | |
| 179 | + goBack() { | |
| 180 | + this.$router.back() | |
| 181 | + } | |
| 182 | + } | |
| 183 | +} | |
| 184 | +</script> | |
| 185 | + | |
| 186 | +<style scoped> | |
| 187 | +.simplify-notepad-manage-container { | |
| 188 | + padding: 20px; | |
| 189 | +} | |
| 190 | + | |
| 191 | +.header-tools { | |
| 192 | + float: right; | |
| 193 | +} | |
| 194 | + | |
| 195 | +.margin-top-xs { | |
| 196 | + margin-top: 10px; | |
| 197 | +} | |
| 198 | +</style> | |
| 0 | 199 | \ No newline at end of file | ... | ... |