Commit 788477fb125dfbad17a4a5c6e1f21d93f6dbf418
1 parent
daaebda8
保养功能开发完成
Showing
11 changed files
with
1370 additions
and
0 deletions
src/api/inspection/maintainanceTaskDetailsApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 3 | + | |
| 4 | +// 获取保养任务详情列表 | |
| 5 | +export function getMaintainanceTaskDetailList(params) { | |
| 6 | + return new Promise((resolve, reject) => { | |
| 7 | + params.communityId = getCommunityId() | |
| 8 | + request({ | |
| 9 | + url: '/maintainanceTask.listMaintainanceTaskDetail', | |
| 10 | + method: 'get', | |
| 11 | + params | |
| 12 | + }).then(response => { | |
| 13 | + const res = response.data | |
| 14 | + resolve(res) | |
| 15 | + }).catch(error => { | |
| 16 | + reject(error) | |
| 17 | + }) | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 获取保养计划列表 | |
| 22 | +export function getMaintainancePlanList(params) { | |
| 23 | + return new Promise((resolve, reject) => { | |
| 24 | + params.communityId = getCommunityId() | |
| 25 | + request({ | |
| 26 | + url: '/maintainancePlan.listMaintainancePlan', | |
| 27 | + method: 'get', | |
| 28 | + params | |
| 29 | + }).then(response => { | |
| 30 | + const res = response.data | |
| 31 | + resolve(res) | |
| 32 | + }).catch(error => { | |
| 33 | + reject(error) | |
| 34 | + }) | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 导出Excel | |
| 39 | +export function exportMaintainanceTaskDetail(params) { | |
| 40 | + return new Promise((resolve, reject) => { | |
| 41 | + params.communityId = getCommunityId() | |
| 42 | + request({ | |
| 43 | + url: '/callComponent/exportReportFee/exportData', | |
| 44 | + method: 'get', | |
| 45 | + params: { | |
| 46 | + pagePath: 'maintainanceTaskDetails', | |
| 47 | + ...params | |
| 48 | + } | |
| 49 | + }).then(response => { | |
| 50 | + const res = response.data | |
| 51 | + resolve(res) | |
| 52 | + }).catch(error => { | |
| 53 | + reject(error) | |
| 54 | + }) | |
| 55 | + }) | |
| 56 | +} | |
| 0 | 57 | \ No newline at end of file | ... | ... |
src/api/inspection/maintainanceTaskManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 获取保养任务列表 | |
| 5 | + * @param {Object} params 查询参数 | |
| 6 | + * @returns {Promise} | |
| 7 | + */ | |
| 8 | +export function listMaintainanceTask(params) { | |
| 9 | + return new Promise((resolve, reject) => { | |
| 10 | + request({ | |
| 11 | + url: '/maintainanceTask.listMaintainanceTask', | |
| 12 | + method: 'get', | |
| 13 | + params | |
| 14 | + }).then(response => { | |
| 15 | + const res = response.data | |
| 16 | + resolve({ | |
| 17 | + data: res.data, | |
| 18 | + total: res.total, | |
| 19 | + records: res.records | |
| 20 | + }) | |
| 21 | + }).catch(error => { | |
| 22 | + reject(error) | |
| 23 | + }) | |
| 24 | + }) | |
| 25 | +} | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * 获取保养任务详情列表 | |
| 29 | + * @param {Object} params 查询参数 | |
| 30 | + * @returns {Promise} | |
| 31 | + */ | |
| 32 | +export function listMaintainanceTaskDetail(params) { | |
| 33 | + return new Promise((resolve, reject) => { | |
| 34 | + request({ | |
| 35 | + url: '/maintainanceTask.listMaintainanceTaskDetail', | |
| 36 | + method: 'get', | |
| 37 | + params | |
| 38 | + }).then(response => { | |
| 39 | + const res = response.data | |
| 40 | + resolve({ | |
| 41 | + data: res.data, | |
| 42 | + total: res.total | |
| 43 | + }) | |
| 44 | + }).catch(error => { | |
| 45 | + reject(error) | |
| 46 | + }) | |
| 47 | + }) | |
| 48 | +} | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * 更新保养任务信息 | |
| 52 | + * @param {Object} data 任务数据 | |
| 53 | + * @returns {Promise} | |
| 54 | + */ | |
| 55 | +export function updateMaintainanceTask(data) { | |
| 56 | + return new Promise((resolve, reject) => { | |
| 57 | + request({ | |
| 58 | + url: '/maintainanceTask.updateMaintainanceTask', | |
| 59 | + method: 'post', | |
| 60 | + data | |
| 61 | + }).then(response => { | |
| 62 | + const res = response.data | |
| 63 | + if (res.code === 0) { | |
| 64 | + resolve(res) | |
| 65 | + } else { | |
| 66 | + reject(new Error(res.msg)) | |
| 67 | + } | |
| 68 | + }).catch(error => { | |
| 69 | + reject(error) | |
| 70 | + }) | |
| 71 | + }) | |
| 72 | +} | |
| 73 | + | |
| 74 | +/** | |
| 75 | + * 删除保养任务 | |
| 76 | + * @param {Object} data 任务数据 | |
| 77 | + * @returns {Promise} | |
| 78 | + */ | |
| 79 | +export function deleteMaintainanceTask(data) { | |
| 80 | + return new Promise((resolve, reject) => { | |
| 81 | + request({ | |
| 82 | + url: '/maintainanceTask.deleteMaintainanceTask', | |
| 83 | + method: 'post', | |
| 84 | + data | |
| 85 | + }).then(response => { | |
| 86 | + const res = response.data | |
| 87 | + if (res.code === 0) { | |
| 88 | + resolve(res) | |
| 89 | + } else { | |
| 90 | + reject(new Error(res.msg)) | |
| 91 | + } | |
| 92 | + }).catch(error => { | |
| 93 | + reject(error) | |
| 94 | + }) | |
| 95 | + }) | |
| 96 | +} | |
| 97 | + | |
| 98 | +/** | |
| 99 | + * 获取保养任务状态字典 | |
| 100 | + * @param {String} dictType 字典类型 | |
| 101 | + * @param {String} dictName 字典名称 | |
| 102 | + * @returns {Promise} | |
| 103 | + */ | |
| 104 | +export function getMaintainanceTaskDict(dictType, dictName) { | |
| 105 | + return new Promise((resolve, reject) => { | |
| 106 | + request({ | |
| 107 | + url: '/dict.getDict', | |
| 108 | + method: 'get', | |
| 109 | + params: { | |
| 110 | + dictType, | |
| 111 | + dictName | |
| 112 | + } | |
| 113 | + }).then(response => { | |
| 114 | + resolve(response.data) | |
| 115 | + }).catch(error => { | |
| 116 | + reject(error) | |
| 117 | + }) | |
| 118 | + }) | |
| 119 | +} | |
| 0 | 120 | \ No newline at end of file | ... | ... |
src/components/inspection/deleteMaintainanceTask.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('deleteMaintainanceTask.title')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="500px" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <div class="confirm-content"> | |
| 9 | + <i class="el-icon-warning warning-icon"></i> | |
| 10 | + <span>{{ $t('deleteMaintainanceTask.confirmText') }}</span> | |
| 11 | + </div> | |
| 12 | + <div slot="footer" class="dialog-footer"> | |
| 13 | + <el-button @click="visible = false"> | |
| 14 | + {{ $t('deleteMaintainanceTask.cancel') }} | |
| 15 | + </el-button> | |
| 16 | + <el-button type="primary" @click="handleConfirm" :loading="loading"> | |
| 17 | + {{ $t('deleteMaintainanceTask.confirm') }} | |
| 18 | + </el-button> | |
| 19 | + </div> | |
| 20 | + </el-dialog> | |
| 21 | +</template> | |
| 22 | + | |
| 23 | +<script> | |
| 24 | +import { deleteMaintainanceTask } from '@/api/inspection/maintainanceTaskManageApi' | |
| 25 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 26 | + | |
| 27 | +export default { | |
| 28 | + name: 'DeleteMaintainanceTask', | |
| 29 | + data() { | |
| 30 | + return { | |
| 31 | + visible: false, | |
| 32 | + loading: false, | |
| 33 | + task: { | |
| 34 | + taskId: '', | |
| 35 | + communityId: '' | |
| 36 | + } | |
| 37 | + } | |
| 38 | + }, | |
| 39 | + methods: { | |
| 40 | + open(data) { | |
| 41 | + this.task = { | |
| 42 | + taskId: data.taskId, | |
| 43 | + communityId: getCommunityId() | |
| 44 | + } | |
| 45 | + this.visible = true | |
| 46 | + }, | |
| 47 | + handleClose() { | |
| 48 | + this.task = { | |
| 49 | + taskId: '', | |
| 50 | + communityId: '' | |
| 51 | + } | |
| 52 | + }, | |
| 53 | + handleConfirm() { | |
| 54 | + this.loading = true | |
| 55 | + deleteMaintainanceTask(this.task) | |
| 56 | + .then(() => { | |
| 57 | + this.$message.success(this.$t('deleteMaintainanceTask.success')) | |
| 58 | + this.$emit('success') | |
| 59 | + this.visible = false | |
| 60 | + }) | |
| 61 | + .catch(error => { | |
| 62 | + this.$message.error(error.message || this.$t('deleteMaintainanceTask.error')) | |
| 63 | + }) | |
| 64 | + .finally(() => { | |
| 65 | + this.loading = false | |
| 66 | + }) | |
| 67 | + } | |
| 68 | + } | |
| 69 | +} | |
| 70 | +</script> | |
| 71 | + | |
| 72 | +<style scoped> | |
| 73 | +.confirm-content { | |
| 74 | + display: flex; | |
| 75 | + align-items: center; | |
| 76 | + justify-content: center; | |
| 77 | + font-size: 16px; | |
| 78 | +} | |
| 79 | + | |
| 80 | +.warning-icon { | |
| 81 | + color: #e6a23c; | |
| 82 | + font-size: 24px; | |
| 83 | + margin-right: 10px; | |
| 84 | +} | |
| 85 | +</style> | |
| 0 | 86 | \ No newline at end of file | ... | ... |
src/components/inspection/maintainanceTaskDetail.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('maintainanceTaskDetail.title')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="90%" | |
| 6 | + top="5vh" | |
| 7 | + @close="handleClose" | |
| 8 | + > | |
| 9 | + <el-table | |
| 10 | + :data="taskDetails" | |
| 11 | + border | |
| 12 | + style="width: 100%" | |
| 13 | + v-loading="loading" | |
| 14 | + > | |
| 15 | + <el-table-column | |
| 16 | + prop="machineName" | |
| 17 | + :label="$t('maintainanceTaskDetail.machineName')" | |
| 18 | + align="center" | |
| 19 | + /> | |
| 20 | + <el-table-column | |
| 21 | + prop="planName" | |
| 22 | + :label="$t('maintainanceTaskDetail.planName')" | |
| 23 | + align="center" | |
| 24 | + /> | |
| 25 | + <el-table-column | |
| 26 | + prop="standardName" | |
| 27 | + :label="$t('maintainanceTaskDetail.standardName')" | |
| 28 | + align="center" | |
| 29 | + /> | |
| 30 | + <el-table-column | |
| 31 | + prop="planUserName" | |
| 32 | + :label="$t('maintainanceTaskDetail.planUserName')" | |
| 33 | + align="center" | |
| 34 | + /> | |
| 35 | + <el-table-column | |
| 36 | + :label="$t('maintainanceTaskDetail.timeRange')" | |
| 37 | + align="center" | |
| 38 | + > | |
| 39 | + <template slot-scope="scope"> | |
| 40 | + {{ scope.row.planInsTime }}<br />{{ scope.row.planEndTime }} | |
| 41 | + </template> | |
| 42 | + </el-table-column> | |
| 43 | + <el-table-column | |
| 44 | + :label="$t('maintainanceTaskDetail.actInsTime')" | |
| 45 | + align="center" | |
| 46 | + > | |
| 47 | + <template slot-scope="scope"> | |
| 48 | + {{ scope.row.inspectionTime || '-' }} | |
| 49 | + </template> | |
| 50 | + </el-table-column> | |
| 51 | + <el-table-column | |
| 52 | + :label="$t('maintainanceTaskDetail.actUserName')" | |
| 53 | + align="center" | |
| 54 | + > | |
| 55 | + <template slot-scope="scope"> | |
| 56 | + {{ scope.row.actUserName || '-' }} | |
| 57 | + </template> | |
| 58 | + </el-table-column> | |
| 59 | + <el-table-column | |
| 60 | + prop="stateName" | |
| 61 | + :label="$t('maintainanceTaskDetail.stateName')" | |
| 62 | + align="center" | |
| 63 | + /> | |
| 64 | + <el-table-column | |
| 65 | + :label="$t('maintainanceTaskDetail.description')" | |
| 66 | + align="center" | |
| 67 | + > | |
| 68 | + <template slot-scope="scope"> | |
| 69 | + <span class="text-primary"> | |
| 70 | + {{ scope.row.description || '-' }} | |
| 71 | + </span> | |
| 72 | + </template> | |
| 73 | + </el-table-column> | |
| 74 | + <el-table-column | |
| 75 | + :label="$t('maintainanceTaskDetail.photos')" | |
| 76 | + align="center" | |
| 77 | + > | |
| 78 | + <template slot-scope="scope"> | |
| 79 | + <div v-if="scope.row.photos && scope.row.photos.length > 0" class="photo-container"> | |
| 80 | + <el-image | |
| 81 | + v-for="(photo, index) in scope.row.photos" | |
| 82 | + :key="index" | |
| 83 | + :src="photo.url" | |
| 84 | + :preview-src-list="scope.row.photos.map(p => p.url)" | |
| 85 | + style="width: 60px; height: 60px; margin-right: 5px;" | |
| 86 | + fit="cover" | |
| 87 | + /> | |
| 88 | + </div> | |
| 89 | + <span v-else>-</span> | |
| 90 | + </template> | |
| 91 | + </el-table-column> | |
| 92 | + <el-table-column | |
| 93 | + prop="createTime" | |
| 94 | + :label="$t('maintainanceTaskDetail.createTime')" | |
| 95 | + align="center" | |
| 96 | + /> | |
| 97 | + <el-table-column | |
| 98 | + :label="$t('maintainanceTaskDetail.operation')" | |
| 99 | + align="center" | |
| 100 | + width="100" | |
| 101 | + > | |
| 102 | + <template slot-scope="scope"> | |
| 103 | + <el-button | |
| 104 | + type="text" | |
| 105 | + @click="handleViewDetail(scope.row.taskDetailId)" | |
| 106 | + > | |
| 107 | + {{ $t('maintainanceTaskDetail.viewDetail') }} | |
| 108 | + </el-button> | |
| 109 | + </template> | |
| 110 | + </el-table-column> | |
| 111 | + </el-table> | |
| 112 | + | |
| 113 | + <div class="pagination-wrapper"> | |
| 114 | + <el-pagination | |
| 115 | + :current-page="pagination.current" | |
| 116 | + :page-sizes="[10, 20, 30, 50]" | |
| 117 | + :page-size="pagination.size" | |
| 118 | + :total="pagination.total" | |
| 119 | + layout="total, sizes, prev, pager, next, jumper" | |
| 120 | + @size-change="handleSizeChange" | |
| 121 | + @current-change="handleCurrentChange" | |
| 122 | + /> | |
| 123 | + </div> | |
| 124 | + </el-dialog> | |
| 125 | +</template> | |
| 126 | + | |
| 127 | +<script> | |
| 128 | +import { listMaintainanceTaskDetail } from '@/api/inspection/maintainanceTaskManageApi' | |
| 129 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 130 | + | |
| 131 | +export default { | |
| 132 | + name: 'MaintainanceTaskDetail', | |
| 133 | + data() { | |
| 134 | + return { | |
| 135 | + visible: false, | |
| 136 | + loading: false, | |
| 137 | + taskDetails: [], | |
| 138 | + taskId: '', | |
| 139 | + pagination: { | |
| 140 | + current: 1, | |
| 141 | + size: 10, | |
| 142 | + total: 0 | |
| 143 | + }, | |
| 144 | + communityId: '' | |
| 145 | + } | |
| 146 | + }, | |
| 147 | + created() { | |
| 148 | + this.communityId = getCommunityId() | |
| 149 | + }, | |
| 150 | + methods: { | |
| 151 | + open(data) { | |
| 152 | + this.taskId = data.taskId | |
| 153 | + this.visible = true | |
| 154 | + this.loadTaskDetails() | |
| 155 | + }, | |
| 156 | + handleClose() { | |
| 157 | + this.taskDetails = [] | |
| 158 | + this.pagination.current = 1 | |
| 159 | + }, | |
| 160 | + loadTaskDetails() { | |
| 161 | + this.loading = true | |
| 162 | + const params = { | |
| 163 | + page: this.pagination.current, | |
| 164 | + row: this.pagination.size, | |
| 165 | + taskId: this.taskId, | |
| 166 | + communityId: this.communityId | |
| 167 | + } | |
| 168 | + | |
| 169 | + listMaintainanceTaskDetail(params) | |
| 170 | + .then(response => { | |
| 171 | + this.taskDetails = response.data || [] | |
| 172 | + this.pagination.total = response.total || 0 | |
| 173 | + }) | |
| 174 | + .catch(error => { | |
| 175 | + console.error('获取任务详情失败:', error) | |
| 176 | + this.$message.error(this.$t('maintainanceTaskDetail.fetchError')) | |
| 177 | + }) | |
| 178 | + .finally(() => { | |
| 179 | + this.loading = false | |
| 180 | + }) | |
| 181 | + }, | |
| 182 | + handleSizeChange(val) { | |
| 183 | + this.pagination.size = val | |
| 184 | + this.loadTaskDetails() | |
| 185 | + }, | |
| 186 | + handleCurrentChange(val) { | |
| 187 | + this.pagination.current = val | |
| 188 | + this.loadTaskDetails() | |
| 189 | + }, | |
| 190 | + handleViewDetail(taskDetailId) { | |
| 191 | + window.open(`/#/pages/property/maintainanceTaskDetailView?taskDetailId=${taskDetailId}`, '_blank') | |
| 192 | + } | |
| 193 | + } | |
| 194 | +} | |
| 195 | +</script> | |
| 196 | + | |
| 197 | +<style scoped> | |
| 198 | +.photo-container { | |
| 199 | + display: flex; | |
| 200 | + flex-wrap: wrap; | |
| 201 | + justify-content: center; | |
| 202 | +} | |
| 203 | + | |
| 204 | +.text-primary { | |
| 205 | + color: #409EFF; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.pagination-wrapper { | |
| 209 | + margin-top: 20px; | |
| 210 | + text-align: right; | |
| 211 | +} | |
| 212 | +</style> | |
| 0 | 213 | \ No newline at end of file | ... | ... |
src/components/inspection/maintainanceTaskTransfer.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('maintainanceTaskTransfer.title')" :visible.sync="visible" width="50%" @close="handleClose"> | |
| 3 | + <el-form :model="form" :rules="rules" ref="form" label-width="120px"> | |
| 4 | + <el-form-item :label="$t('maintainanceTaskTransfer.transferTarget')" prop="staffId"> | |
| 5 | + <el-select v-model="form.staffId" :placeholder="$t('inspectionTaskTransfer.required')"> | |
| 6 | + <el-option v-for="item in staffs" :key="item.userId" :label="item.name" :value="item.userId"></el-option> | |
| 7 | + </el-select> | |
| 8 | + </el-form-item> | |
| 9 | + <el-form-item :label="$t('maintainanceTaskTransfer.transferDesc')" prop="transferDesc"> | |
| 10 | + <el-input type="textarea" :rows="3" v-model="form.transferDesc" | |
| 11 | + :placeholder="$t('maintainanceTaskTransfer.transferDescPlaceholder')" /> | |
| 12 | + </el-form-item> | |
| 13 | + </el-form> | |
| 14 | + <div slot="footer" class="dialog-footer"> | |
| 15 | + <el-button @click="visible = false"> | |
| 16 | + {{ $t('maintainanceTaskTransfer.cancel') }} | |
| 17 | + </el-button> | |
| 18 | + <el-button type="primary" @click="handleSubmit"> | |
| 19 | + {{ $t('maintainanceTaskTransfer.submit') }} | |
| 20 | + </el-button> | |
| 21 | + </div> | |
| 22 | + </el-dialog> | |
| 23 | +</template> | |
| 24 | + | |
| 25 | +<script> | |
| 26 | +import { updateMaintainanceTask } from '@/api/inspection/maintainanceTaskManageApi' | |
| 27 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 28 | +import { queryStaffInfos } from '@/api/staff/staffApi.js' | |
| 29 | + | |
| 30 | + | |
| 31 | +export default { | |
| 32 | + name: 'MaintainanceTaskTransfer', | |
| 33 | + components: { | |
| 34 | + }, | |
| 35 | + data() { | |
| 36 | + return { | |
| 37 | + visible: false, | |
| 38 | + staffs:[], | |
| 39 | + form: { | |
| 40 | + flowComponent: 'maintainanceTaskManage', | |
| 41 | + transferDesc: '', | |
| 42 | + staffId: '', | |
| 43 | + staffName: '', | |
| 44 | + communityId: '', | |
| 45 | + actInsTime: '', | |
| 46 | + actUserId: '', | |
| 47 | + actUserName: '', | |
| 48 | + maintainancePlanId: '', | |
| 49 | + maintainancePlanName: '', | |
| 50 | + planEndTime: '', | |
| 51 | + planInsTime: '', | |
| 52 | + planUserId: '', | |
| 53 | + planUserName: '', | |
| 54 | + signType: '', | |
| 55 | + signTypeName: '', | |
| 56 | + state: '', | |
| 57 | + stateName: '', | |
| 58 | + statusCd: '', | |
| 59 | + taskId: '', | |
| 60 | + taskType: 2000, | |
| 61 | + currentUserId: '', | |
| 62 | + orgId: '', | |
| 63 | + parentId: '' | |
| 64 | + }, | |
| 65 | + rules: { | |
| 66 | + staffId: [ | |
| 67 | + { required: true, message: this.$t('maintainanceTaskTransfer.staffRequired'), trigger: 'blur' } | |
| 68 | + ], | |
| 69 | + transferDesc: [ | |
| 70 | + { required: true, message: this.$t('maintainanceTaskTransfer.descRequired'), trigger: 'blur' }, | |
| 71 | + { max: 512, message: this.$t('maintainanceTaskTransfer.descMaxLength'), trigger: 'blur' } | |
| 72 | + ] | |
| 73 | + } | |
| 74 | + } | |
| 75 | + }, | |
| 76 | + methods: { | |
| 77 | + open(data) { | |
| 78 | + this.form = { | |
| 79 | + ...this.form, | |
| 80 | + ...data, | |
| 81 | + currentUserId: this.$store.getters.userId, | |
| 82 | + communityId: getCommunityId() | |
| 83 | + } | |
| 84 | + this.loadStaffs() | |
| 85 | + this.visible = true | |
| 86 | + }, | |
| 87 | + async loadStaffs() { | |
| 88 | + const { staffs } = await queryStaffInfos({ | |
| 89 | + page: 1, | |
| 90 | + row: 1000 | |
| 91 | + }) | |
| 92 | + this.staffs = staffs | |
| 93 | + }, | |
| 94 | + handleClose() { | |
| 95 | + this.$refs.form.resetFields() | |
| 96 | + this.$refs.orgTree.clearAll() | |
| 97 | + this.$refs.staffSelect.clearStaff() | |
| 98 | + }, | |
| 99 | + handleSwitchOrg(org) { | |
| 100 | + this.form.orgId = org.orgId | |
| 101 | + this.form.parentId = org.parentId | |
| 102 | + this.$refs.staffSelect.setStaff(org) | |
| 103 | + }, | |
| 104 | + handleStaffSelect(param) { | |
| 105 | + if (param.staffId) { | |
| 106 | + this.form.staffId = param.staffId | |
| 107 | + this.form.staffName = param.staffName | |
| 108 | + } | |
| 109 | + }, | |
| 110 | + handleSubmit() { | |
| 111 | + this.$refs.form.validate(valid => { | |
| 112 | + if (!valid) return | |
| 113 | + | |
| 114 | + if (this.form.staffId === this.form.planUserId) { | |
| 115 | + this.$message.warning(this.$t('maintainanceTaskTransfer.sameUserError')) | |
| 116 | + return | |
| 117 | + } | |
| 118 | + | |
| 119 | + this.loading = true | |
| 120 | + updateMaintainanceTask(this.form) | |
| 121 | + .then(() => { | |
| 122 | + this.$message.success(this.$t('maintainanceTaskTransfer.success')) | |
| 123 | + this.$emit('success') | |
| 124 | + this.visible = false | |
| 125 | + }) | |
| 126 | + .catch(error => { | |
| 127 | + this.$message.error(error.message || this.$t('maintainanceTaskTransfer.error')) | |
| 128 | + }) | |
| 129 | + .finally(() => { | |
| 130 | + this.loading = false | |
| 131 | + }) | |
| 132 | + }) | |
| 133 | + } | |
| 134 | + } | |
| 135 | +} | |
| 136 | +</script> | |
| 0 | 137 | \ No newline at end of file | ... | ... |
src/i18n/inspectionI18n.js
| ... | ... | @@ -5,6 +5,8 @@ import { messages as maintainancePlanManageMessages } from '../views/inspection/ |
| 5 | 5 | import { messages as addMaintainancePlanMessages } from '../views/inspection/addMaintainancePlanLang' |
| 6 | 6 | import { messages as editMaintainancePlanMessages } from '../views/inspection/editMaintainancePlanLang' |
| 7 | 7 | import { messages as maintainancePlanMachineMessages } from '../views/inspection/maintainancePlanMachineLang' |
| 8 | +import { messages as maintainanceTaskDetailsMessages } from '../views/inspection/maintainanceTaskDetailsLang' | |
| 9 | +import { messages as maintainanceTaskManageMessages } from '../views/inspection/maintainanceTaskManageLang' | |
| 8 | 10 | |
| 9 | 11 | export const messages = { |
| 10 | 12 | en: { |
| ... | ... | @@ -15,6 +17,8 @@ export const messages = { |
| 15 | 17 | ...addMaintainancePlanMessages.en, |
| 16 | 18 | ...editMaintainancePlanMessages.en, |
| 17 | 19 | ...maintainancePlanMachineMessages.en, |
| 20 | + ...maintainanceTaskDetailsMessages.en, | |
| 21 | + ...maintainanceTaskManageMessages.en, | |
| 18 | 22 | }, |
| 19 | 23 | zh: { |
| 20 | 24 | ...maintainanceItemMessages.zh, |
| ... | ... | @@ -24,6 +28,8 @@ export const messages = { |
| 24 | 28 | ...addMaintainancePlanMessages.zh, |
| 25 | 29 | ...editMaintainancePlanMessages.zh, |
| 26 | 30 | ...maintainancePlanMachineMessages.zh, |
| 31 | + ...maintainanceTaskDetailsMessages.zh, | |
| 32 | + ...maintainanceTaskManageMessages.zh, | |
| 27 | 33 | } |
| 28 | 34 | |
| 29 | 35 | } |
| 30 | 36 | \ No newline at end of file | ... | ... |
src/router/inspectionRouter.js
| ... | ... | @@ -94,4 +94,14 @@ export default [ |
| 94 | 94 | name: '/views/inspection/maintainancePlanMachine', |
| 95 | 95 | component: () => import('@/views/inspection/maintainancePlanMachineList.vue') |
| 96 | 96 | }, |
| 97 | + { | |
| 98 | + path: '/pages/property/maintainanceTaskDetails', | |
| 99 | + name: '/pages/property/maintainanceTaskDetails', | |
| 100 | + component: () => import('@/views/inspection/maintainanceTaskDetailsList.vue') | |
| 101 | + }, | |
| 102 | + { | |
| 103 | + path: '/pages/property/maintainanceTaskManage', | |
| 104 | + name: '/pages/property/maintainanceTaskManage', | |
| 105 | + component: () => import('@/views/inspection/maintainanceTaskManageList.vue') | |
| 106 | + }, | |
| 97 | 107 | ] |
| 98 | 108 | \ No newline at end of file | ... | ... |
src/views/inspection/maintainanceTaskDetailsLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + maintainanceTaskDetails: { | |
| 4 | + search: { | |
| 5 | + title: 'Search Conditions', | |
| 6 | + planUserName: 'Please enter maintainer', | |
| 7 | + maintainanceStartTime: 'Please enter actual maintenance start time', | |
| 8 | + maintainanceEndTime: 'Please enter actual maintenance end time', | |
| 9 | + maintainancePlanId: 'Please select maintenance plan', | |
| 10 | + selectPlan: 'Select plan', | |
| 11 | + taskDetailId: 'Please enter task detail ID', | |
| 12 | + taskState: 'Please select task status', | |
| 13 | + selectState: 'Select status' | |
| 14 | + }, | |
| 15 | + list: { | |
| 16 | + title: 'Maintenance Details' | |
| 17 | + }, | |
| 18 | + table: { | |
| 19 | + taskDetailId: 'ID', | |
| 20 | + machineName: 'Equipment Name', | |
| 21 | + planName: 'Plan Name', | |
| 22 | + standardName: 'Maintenance Standard', | |
| 23 | + planUserName: 'Planned Maintainer', | |
| 24 | + planTime: 'Maintainer\nStart/End Time', | |
| 25 | + inspectionTime: 'Actual Maintenance Time', | |
| 26 | + actUserName: 'Actual Maintainer', | |
| 27 | + stateName: 'Task Status', | |
| 28 | + description: 'Maintenance Situation', | |
| 29 | + photos: 'Maintenance Photos', | |
| 30 | + createTime: 'Create Time' | |
| 31 | + }, | |
| 32 | + fetchError: 'Failed to fetch maintenance task details', | |
| 33 | + noLocation: 'No location information available' | |
| 34 | + } | |
| 35 | + }, | |
| 36 | + zh: { | |
| 37 | + maintainanceTaskDetails: { | |
| 38 | + search: { | |
| 39 | + title: '查询条件', | |
| 40 | + planUserName: '请输入保养人', | |
| 41 | + maintainanceStartTime: '请输入实际保养开始时间', | |
| 42 | + maintainanceEndTime: '请输入实际保养结束时间', | |
| 43 | + maintainancePlanId: '请选择保养计划', | |
| 44 | + selectPlan: '选择计划', | |
| 45 | + taskDetailId: '请输入任务详情ID', | |
| 46 | + taskState: '请选择任务状态', | |
| 47 | + selectState: '选择状态' | |
| 48 | + }, | |
| 49 | + list: { | |
| 50 | + title: '保养明细信息' | |
| 51 | + }, | |
| 52 | + table: { | |
| 53 | + taskDetailId: '编号', | |
| 54 | + machineName: '设备名称', | |
| 55 | + planName: '计划名称', | |
| 56 | + standardName: '保养标准', | |
| 57 | + planUserName: '计划保养人', | |
| 58 | + planTime: '保养人\n开始/结束时间', | |
| 59 | + inspectionTime: '实际保养时间', | |
| 60 | + actUserName: '实际保养人', | |
| 61 | + stateName: '任务状态', | |
| 62 | + description: '保养情况', | |
| 63 | + photos: '保养照片', | |
| 64 | + createTime: '创建时间' | |
| 65 | + }, | |
| 66 | + fetchError: '获取保养任务详情失败', | |
| 67 | + noLocation: '暂无位置信息' | |
| 68 | + } | |
| 69 | + } | |
| 70 | +} | |
| 0 | 71 | \ No newline at end of file | ... | ... |
src/views/inspection/maintainanceTaskDetailsList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="maintainance-task-details-container"> | |
| 3 | + <!-- 查询条件 --> | |
| 4 | + <el-card class="search-wrapper"> | |
| 5 | + <div slot="header" class="flex justify-between"> | |
| 6 | + <span>{{ $t('maintainanceTaskDetails.search.title') }}</span> | |
| 7 | + </div> | |
| 8 | + <el-row :gutter="20"> | |
| 9 | + <el-col :span="4"> | |
| 10 | + <el-input v-model="searchForm.planUserName" :placeholder="$t('maintainanceTaskDetails.search.planUserName')" | |
| 11 | + clearable /> | |
| 12 | + </el-col> | |
| 13 | + <el-col :span="4"> | |
| 14 | + <el-date-picker v-model="searchForm.maintainanceStartTime" type="datetime" | |
| 15 | + :placeholder="$t('maintainanceTaskDetails.search.maintainanceStartTime')" | |
| 16 | + value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 17 | + </el-col> | |
| 18 | + <el-col :span="4"> | |
| 19 | + <el-date-picker v-model="searchForm.maintainanceEndTime" type="datetime" | |
| 20 | + :placeholder="$t('maintainanceTaskDetails.search.maintainanceEndTime')" value-format="yyyy-MM-dd HH:mm:ss" /> | |
| 21 | + </el-col> | |
| 22 | + <el-col :span="4"> | |
| 23 | + <el-select v-model="searchForm.maintainancePlanId" | |
| 24 | + :placeholder="$t('maintainanceTaskDetails.search.maintainancePlanId')" style="width:100%"> | |
| 25 | + <el-option :label="$t('maintainanceTaskDetails.search.selectPlan')" value="" /> | |
| 26 | + <el-option v-for="(item, index) in planList" :key="index" :label="item.planName" :value="item.planId" /> | |
| 27 | + </el-select> | |
| 28 | + </el-col> | |
| 29 | + <el-col :span="4"> | |
| 30 | + <el-input v-model="searchForm.taskDetailId" :placeholder="$t('maintainanceTaskDetails.search.taskDetailId')" | |
| 31 | + clearable /> | |
| 32 | + </el-col> | |
| 33 | + <el-col :span="4"> | |
| 34 | + <el-select v-model="searchForm.taskState" :placeholder="$t('maintainanceTaskDetails.search.taskState')" | |
| 35 | + style="width:100%"> | |
| 36 | + <el-option :label="$t('maintainanceTaskDetails.search.selectState')" value="" /> | |
| 37 | + <el-option v-for="(item, index) in taskStateList" :key="index" :label="item.name" :value="item.statusCd" /> | |
| 38 | + </el-select> | |
| 39 | + </el-col> | |
| 40 | + </el-row> | |
| 41 | + <el-row :gutter="20" style="margin-top:20px"> | |
| 42 | + <el-col :span="24" style="text-align:right"> | |
| 43 | + <el-button type="primary" @click="handleSearch"> | |
| 44 | + <i class="el-icon-search"></i> | |
| 45 | + {{ $t('common.search') }} | |
| 46 | + </el-button> | |
| 47 | + <el-button @click="handleReset"> | |
| 48 | + <i class="el-icon-refresh"></i> | |
| 49 | + {{ $t('common.reset') }} | |
| 50 | + </el-button> | |
| 51 | + </el-col> | |
| 52 | + </el-row> | |
| 53 | + </el-card> | |
| 54 | + | |
| 55 | + <!-- 保养明细信息 --> | |
| 56 | + <el-card class="list-wrapper"> | |
| 57 | + <div slot="header" class="flex justify-between"> | |
| 58 | + <span>{{ $t('maintainanceTaskDetails.list.title') }}</span> | |
| 59 | + </div> | |
| 60 | + <el-table v-loading="loading" :data="tableData" border style="width:100%"> | |
| 61 | + <el-table-column prop="taskDetailId" :label="$t('maintainanceTaskDetails.table.taskDetailId')" align="center" /> | |
| 62 | + <el-table-column prop="machineName" :label="$t('maintainanceTaskDetails.table.machineName')" align="center" /> | |
| 63 | + <el-table-column prop="planName" :label="$t('maintainanceTaskDetails.table.planName')" align="center" /> | |
| 64 | + <el-table-column prop="standardName" :label="$t('maintainanceTaskDetails.table.standardName')" align="center" /> | |
| 65 | + <el-table-column prop="planUserName" :label="$t('maintainanceTaskDetails.table.planUserName')" align="center" /> | |
| 66 | + <el-table-column :label="$t('maintainanceTaskDetails.table.planTime')" align="center"> | |
| 67 | + <template slot-scope="scope"> | |
| 68 | + {{ scope.row.planInsTime }}<br />{{ scope.row.planEndTime }} | |
| 69 | + </template> | |
| 70 | + </el-table-column> | |
| 71 | + <el-table-column :label="$t('maintainanceTaskDetails.table.inspectionTime')" align="center"> | |
| 72 | + <template slot-scope="scope"> | |
| 73 | + {{ scope.row.inspectionTime || '-' }} | |
| 74 | + </template> | |
| 75 | + </el-table-column> | |
| 76 | + <el-table-column :label="$t('maintainanceTaskDetails.table.actUserName')" align="center"> | |
| 77 | + <template slot-scope="scope"> | |
| 78 | + {{ scope.row.actUserName || '-' }} | |
| 79 | + </template> | |
| 80 | + </el-table-column> | |
| 81 | + <el-table-column prop="stateName" :label="$t('maintainanceTaskDetails.table.stateName')" align="center" /> | |
| 82 | + <el-table-column :label="$t('maintainanceTaskDetails.table.description')" align="center"> | |
| 83 | + <template slot-scope="scope"> | |
| 84 | + <span class="text-primary"> | |
| 85 | + {{ scope.row.description || '-' }} | |
| 86 | + </span> | |
| 87 | + </template> | |
| 88 | + </el-table-column> | |
| 89 | + <el-table-column :label="$t('maintainanceTaskDetails.table.photos')" align="center"> | |
| 90 | + <template slot-scope="scope"> | |
| 91 | + <span v-for="photo in scope.row.photos" :key="photo.url"> | |
| 92 | + <el-image style="width:60px;height:60px;margin-right:5px" :src="photo.url" :preview-src-list="[photo.url]" | |
| 93 | + fit="cover" /> | |
| 94 | + </span> | |
| 95 | + </template> | |
| 96 | + </el-table-column> | |
| 97 | + <el-table-column prop="createTime" :label="$t('maintainanceTaskDetails.table.createTime')" align="center" /> | |
| 98 | + <el-table-column :label="$t('common.operation')" align="center" width="120"> | |
| 99 | + <template slot-scope="scope"> | |
| 100 | + <el-button type="text" @click="handleDetail(scope.row.taskDetailId)"> | |
| 101 | + {{ $t('common.detail') }} | |
| 102 | + </el-button> | |
| 103 | + </template> | |
| 104 | + </el-table-column> | |
| 105 | + </el-table> | |
| 106 | + <el-pagination :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | |
| 107 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 108 | + @current-change="handleCurrentChange" /> | |
| 109 | + </el-card> | |
| 110 | + | |
| 111 | + <!-- 组件 --> | |
| 112 | + <view-map ref="viewMap" /> | |
| 113 | + <view-image ref="viewImage" /> | |
| 114 | + </div> | |
| 115 | +</template> | |
| 116 | + | |
| 117 | +<script> | |
| 118 | +import { getMaintainanceTaskDetailList, getMaintainancePlanList } from '@/api/inspection/maintainanceTaskDetailsApi' | |
| 119 | +import { getDict } from '@/api/community/communityApi' | |
| 120 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 121 | +import ViewMap from '@/components/system/ViewMap' | |
| 122 | +import ViewImage from '@/components/system/viewImage' | |
| 123 | + | |
| 124 | +export default { | |
| 125 | + name: 'MaintainanceTaskDetailsList', | |
| 126 | + components: { | |
| 127 | + ViewMap, | |
| 128 | + ViewImage | |
| 129 | + }, | |
| 130 | + data() { | |
| 131 | + return { | |
| 132 | + loading: false, | |
| 133 | + searchForm: { | |
| 134 | + planUserName: '', | |
| 135 | + taskDetailId: '', | |
| 136 | + maintainanceStartTime: '', | |
| 137 | + maintainanceEndTime: '', | |
| 138 | + maintainancePlanId: '', | |
| 139 | + taskState: '' | |
| 140 | + }, | |
| 141 | + tableData: [], | |
| 142 | + planList: [], | |
| 143 | + taskStateList: [], | |
| 144 | + page: { | |
| 145 | + current: 1, | |
| 146 | + size: 10, | |
| 147 | + total: 0 | |
| 148 | + }, | |
| 149 | + communityId: '' | |
| 150 | + } | |
| 151 | + }, | |
| 152 | + created() { | |
| 153 | + this.communityId = getCommunityId() | |
| 154 | + this.getList() | |
| 155 | + this.getPlanList() | |
| 156 | + this.getTaskStateList() | |
| 157 | + }, | |
| 158 | + methods: { | |
| 159 | + async getList() { | |
| 160 | + try { | |
| 161 | + this.loading = true | |
| 162 | + const params = { | |
| 163 | + ...this.searchForm, | |
| 164 | + page: this.page.current, | |
| 165 | + row: this.page.size, | |
| 166 | + communityId: this.communityId | |
| 167 | + } | |
| 168 | + const { data, total } = await getMaintainanceTaskDetailList(params) | |
| 169 | + this.tableData = data | |
| 170 | + this.page.total = total | |
| 171 | + } catch (error) { | |
| 172 | + this.$message.error(this.$t('maintainanceTaskDetails.fetchError')) | |
| 173 | + } finally { | |
| 174 | + this.loading = false | |
| 175 | + } | |
| 176 | + }, | |
| 177 | + async getPlanList() { | |
| 178 | + try { | |
| 179 | + const params = { | |
| 180 | + communityId: this.communityId, | |
| 181 | + page: 1, | |
| 182 | + row: 200 | |
| 183 | + } | |
| 184 | + const { data } = await getMaintainancePlanList(params) | |
| 185 | + this.planList = data | |
| 186 | + } catch (error) { | |
| 187 | + console.error('获取保养计划列表失败:', error) | |
| 188 | + } | |
| 189 | + }, | |
| 190 | + async getTaskStateList() { | |
| 191 | + try { | |
| 192 | + const data = await getDict('maintainance_task_detail', 'state') | |
| 193 | + this.taskStateList = data | |
| 194 | + } catch (error) { | |
| 195 | + console.error('获取任务状态字典失败:', error) | |
| 196 | + } | |
| 197 | + }, | |
| 198 | + handleSearch() { | |
| 199 | + this.page.current = 1 | |
| 200 | + this.getList() | |
| 201 | + }, | |
| 202 | + handleReset() { | |
| 203 | + this.searchForm = { | |
| 204 | + planUserName: '', | |
| 205 | + taskDetailId: '', | |
| 206 | + maintainanceStartTime: '', | |
| 207 | + maintainanceEndTime: '', | |
| 208 | + maintainancePlanId: '', | |
| 209 | + taskState: '' | |
| 210 | + } | |
| 211 | + this.page.current = 1 | |
| 212 | + this.getList() | |
| 213 | + }, | |
| 214 | + handleSizeChange(val) { | |
| 215 | + this.page.size = val | |
| 216 | + this.getList() | |
| 217 | + }, | |
| 218 | + handleCurrentChange(val) { | |
| 219 | + this.page.current = val | |
| 220 | + this.getList() | |
| 221 | + }, | |
| 222 | + handleDetail(taskDetailId) { | |
| 223 | + this.$router.push({ | |
| 224 | + path: '/inspection/maintainanceTaskDetailView', | |
| 225 | + query: { taskDetailId } | |
| 226 | + }) | |
| 227 | + }, | |
| 228 | + openFile(photo) { | |
| 229 | + this.$refs.viewImage.open(photo.url) | |
| 230 | + }, | |
| 231 | + openMap(lat, lng) { | |
| 232 | + if (!lat || !lng) { | |
| 233 | + this.$message.warning(this.$t('maintainanceTaskDetails.noLocation')) | |
| 234 | + return | |
| 235 | + } | |
| 236 | + this.$refs.viewMap.open({ lat, lng }) | |
| 237 | + } | |
| 238 | + } | |
| 239 | +} | |
| 240 | +</script> | |
| 241 | + | |
| 242 | +<style lang="scss" scoped> | |
| 243 | +.maintainance-task-details-container { | |
| 244 | + padding: 20px; | |
| 245 | + | |
| 246 | + .search-wrapper { | |
| 247 | + margin-bottom: 20px; | |
| 248 | + | |
| 249 | + .el-row { | |
| 250 | + margin-bottom: 10px; | |
| 251 | + } | |
| 252 | + } | |
| 253 | + | |
| 254 | + .list-wrapper { | |
| 255 | + margin-bottom: 20px; | |
| 256 | + } | |
| 257 | + | |
| 258 | + .text-primary { | |
| 259 | + color: #409EFF; | |
| 260 | + } | |
| 261 | + | |
| 262 | + .el-pagination { | |
| 263 | + margin-top: 20px; | |
| 264 | + text-align: right; | |
| 265 | + } | |
| 266 | +} | |
| 267 | +</style> | |
| 0 | 268 | \ No newline at end of file | ... | ... |
src/views/inspection/maintainanceTaskManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + maintainanceTaskManage: { | |
| 4 | + searchTitle: 'Search Conditions', | |
| 5 | + listTitle: 'Maintenance Tasks', | |
| 6 | + planUserNamePlaceholder: 'Please enter executor', | |
| 7 | + startTimePlaceholder: 'Please enter actual maintenance start time', | |
| 8 | + endTimePlaceholder: 'Please enter actual maintenance end time', | |
| 9 | + planNamePlaceholder: 'Please enter maintenance plan name', | |
| 10 | + statePlaceholder: 'Please select maintenance status', | |
| 11 | + search: 'Search', | |
| 12 | + reset: 'Reset', | |
| 13 | + taskId: 'Task Code', | |
| 14 | + planName: 'Maintenance Plan', | |
| 15 | + timeRange: 'Start/End Time', | |
| 16 | + actInsTime: 'Actual Maintenance Time', | |
| 17 | + originalPlanUser: 'Planned Maintainer', | |
| 18 | + currentPlanUser: 'Current Maintainer', | |
| 19 | + transferDesc: 'Transfer Description', | |
| 20 | + state: 'Maintenance Status', | |
| 21 | + operation: 'Operation', | |
| 22 | + transfer: 'Transfer', | |
| 23 | + detail: 'Detail', | |
| 24 | + delete: 'Delete', | |
| 25 | + tip: 'Maintenance tasks are automatically generated based on maintenance plans. If not generated, please confirm whether the scheduled task is enabled (and wait about 30 minutes) or whether the maintenance plan is set correctly', | |
| 26 | + fetchError: 'Failed to get maintenance tasks' | |
| 27 | + }, | |
| 28 | + maintainanceTaskTransfer: { | |
| 29 | + title: 'Transfer', | |
| 30 | + transferTarget: 'Transfer Target', | |
| 31 | + transferDesc: 'Transfer Description', | |
| 32 | + transferDescPlaceholder: 'Required, please fill in the transfer description', | |
| 33 | + staffRequired: 'Please select staff', | |
| 34 | + descRequired: 'Description cannot be empty', | |
| 35 | + descMaxLength: 'Description is too long', | |
| 36 | + sameUserError: 'Cannot transfer to current maintainer', | |
| 37 | + cancel: 'Cancel', | |
| 38 | + submit: 'Submit', | |
| 39 | + success: 'Transfer successful', | |
| 40 | + error: 'Transfer failed' | |
| 41 | + }, | |
| 42 | + maintainanceTaskDetail: { | |
| 43 | + title: 'Task Details', | |
| 44 | + machineName: 'Equipment Name', | |
| 45 | + standardName: 'Maintenance Standard', | |
| 46 | + planUserName: 'Planned Maintainer', | |
| 47 | + actUserName: 'Actual Maintainer', | |
| 48 | + stateName: 'Task Status', | |
| 49 | + description: 'Maintenance Situation', | |
| 50 | + photos: 'Maintenance Photos', | |
| 51 | + createTime: 'Create Time', | |
| 52 | + viewDetail: 'View Details', | |
| 53 | + fetchError: 'Failed to get task details' | |
| 54 | + }, | |
| 55 | + deleteMaintainanceTask: { | |
| 56 | + title: 'Confirm Operation', | |
| 57 | + confirmText: 'Are you sure to delete this maintenance task?', | |
| 58 | + cancel: 'Cancel', | |
| 59 | + confirm: 'Confirm', | |
| 60 | + success: 'Delete successful', | |
| 61 | + error: 'Delete failed' | |
| 62 | + }, | |
| 63 | + chooseOrgTree2: { | |
| 64 | + placeholder: 'Required, please select related organization', | |
| 65 | + title: 'Select Organization', | |
| 66 | + cancel: 'Cancel', | |
| 67 | + confirm: 'Confirm' | |
| 68 | + }, | |
| 69 | + staffSelect2: { | |
| 70 | + placeholder: 'Required, please select staff' | |
| 71 | + }, | |
| 72 | + viewMap: { | |
| 73 | + noLocation: 'No location information available' | |
| 74 | + }, | |
| 75 | + viewImage: { | |
| 76 | + noImage: 'No image available', | |
| 77 | + loadError: 'Image load failed' | |
| 78 | + } | |
| 79 | + }, | |
| 80 | + zh: { | |
| 81 | + maintainanceTaskManage: { | |
| 82 | + searchTitle: '查询条件', | |
| 83 | + listTitle: '保养任务', | |
| 84 | + planUserNamePlaceholder: '请输入执行人', | |
| 85 | + startTimePlaceholder: '请输入实际保养开始时间', | |
| 86 | + endTimePlaceholder: '请输入实际保养结束时间', | |
| 87 | + planNamePlaceholder: '请输入保养计划名称', | |
| 88 | + statePlaceholder: '请选择保养状态', | |
| 89 | + search: '查询', | |
| 90 | + reset: '重置', | |
| 91 | + taskId: '任务编码', | |
| 92 | + planName: '保养计划', | |
| 93 | + timeRange: '开始/结束时间', | |
| 94 | + actInsTime: '实际保养时间', | |
| 95 | + originalPlanUser: '计划保养人', | |
| 96 | + currentPlanUser: '当前保养人', | |
| 97 | + transferDesc: '转移描述', | |
| 98 | + state: '保养状态', | |
| 99 | + operation: '操作', | |
| 100 | + transfer: '流转', | |
| 101 | + detail: '详情', | |
| 102 | + delete: '删除', | |
| 103 | + tip: '保养任务是根据保养计划,自动生成,如果没有生成 请确认是否开启了定时任务(并等待30分钟左右),或者保养计划是否设置正确', | |
| 104 | + fetchError: '获取保养任务失败' | |
| 105 | + }, | |
| 106 | + maintainanceTaskTransfer: { | |
| 107 | + title: '流转', | |
| 108 | + transferTarget: '流转对象', | |
| 109 | + transferDesc: '流转说明', | |
| 110 | + transferDescPlaceholder: '必填,请填写转赠说明', | |
| 111 | + staffRequired: '请选择员工', | |
| 112 | + descRequired: '说明不能为空', | |
| 113 | + descMaxLength: '说明太长', | |
| 114 | + sameUserError: '不能流转给当前保养人', | |
| 115 | + cancel: '取消', | |
| 116 | + submit: '提交', | |
| 117 | + success: '流转成功', | |
| 118 | + error: '流转失败' | |
| 119 | + }, | |
| 120 | + maintainanceTaskDetail: { | |
| 121 | + title: '任务详情', | |
| 122 | + machineName: '设备名称', | |
| 123 | + standardName: '保养标准', | |
| 124 | + planUserName: '计划保养人', | |
| 125 | + actUserName: '实际保养人', | |
| 126 | + stateName: '任务状态', | |
| 127 | + description: '保养情况', | |
| 128 | + photos: '保养照片', | |
| 129 | + createTime: '创建时间', | |
| 130 | + viewDetail: '详情', | |
| 131 | + fetchError: '获取任务详情失败' | |
| 132 | + }, | |
| 133 | + deleteMaintainanceTask: { | |
| 134 | + title: '请确认您的操作', | |
| 135 | + confirmText: '确定删除保养任务?', | |
| 136 | + cancel: '点错了', | |
| 137 | + confirm: '确认删除', | |
| 138 | + success: '删除成功', | |
| 139 | + error: '删除失败' | |
| 140 | + }, | |
| 141 | + chooseOrgTree2: { | |
| 142 | + placeholder: '必填,请填写关联组织', | |
| 143 | + title: '选择组织', | |
| 144 | + cancel: '取消', | |
| 145 | + confirm: '确定' | |
| 146 | + }, | |
| 147 | + staffSelect2: { | |
| 148 | + placeholder: '必填,请选择员工' | |
| 149 | + }, | |
| 150 | + viewMap: { | |
| 151 | + noLocation: '暂无位置信息' | |
| 152 | + }, | |
| 153 | + viewImage: { | |
| 154 | + noImage: '暂无图片', | |
| 155 | + loadError: '图片加载失败' | |
| 156 | + } | |
| 157 | + } | |
| 158 | +} | |
| 0 | 159 | \ No newline at end of file | ... | ... |
src/views/inspection/maintainanceTaskManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="maintainance-task-manage-container"> | |
| 3 | + <!-- 查询条件 --> | |
| 4 | + <el-card class="search-card"> | |
| 5 | + <div slot="header" class="flex justify-between"> | |
| 6 | + <span>{{ $t('maintainanceTaskManage.searchTitle') }}</span> | |
| 7 | + </div> | |
| 8 | + <el-row :gutter="20"> | |
| 9 | + <el-col :span="4"> | |
| 10 | + <el-input v-model="searchForm.planUserName" :placeholder="$t('maintainanceTaskManage.planUserNamePlaceholder')" | |
| 11 | + clearable /> | |
| 12 | + </el-col> | |
| 13 | + <el-col :span="4"> | |
| 14 | + <el-date-picker v-model="searchForm.startTime" type="datetime" | |
| 15 | + :placeholder="$t('maintainanceTaskManage.startTimePlaceholder')" style="width: 100%" /> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="4"> | |
| 18 | + <el-date-picker v-model="searchForm.endTime" type="datetime" | |
| 19 | + :placeholder="$t('maintainanceTaskManage.endTimePlaceholder')" style="width: 100%" /> | |
| 20 | + </el-col> | |
| 21 | + <el-col :span="4"> | |
| 22 | + <el-input v-model="searchForm.planName" :placeholder="$t('maintainanceTaskManage.planNamePlaceholder')" | |
| 23 | + clearable /> | |
| 24 | + </el-col> | |
| 25 | + <el-col :span="4"> | |
| 26 | + <el-select v-model="searchForm.state" :placeholder="$t('maintainanceTaskManage.statePlaceholder')" | |
| 27 | + style="width: 100%"> | |
| 28 | + <el-option v-for="item in stateTypes" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 29 | + </el-select> | |
| 30 | + </el-col> | |
| 31 | + <el-col :span="4"> | |
| 32 | + <el-button type="primary" @click="handleSearch"> | |
| 33 | + {{ $t('maintainanceTaskManage.search') }} | |
| 34 | + </el-button> | |
| 35 | + <el-button @click="handleReset"> | |
| 36 | + {{ $t('maintainanceTaskManage.reset') }} | |
| 37 | + </el-button> | |
| 38 | + </el-col> | |
| 39 | + </el-row> | |
| 40 | + </el-card> | |
| 41 | + | |
| 42 | + <!-- 保养任务列表 --> | |
| 43 | + <el-card class="list-card"> | |
| 44 | + <div slot="header" class="flex justify-between"> | |
| 45 | + <span>{{ $t('maintainanceTaskManage.listTitle') }}</span> | |
| 46 | + </div> | |
| 47 | + <el-table :data="tableData" border style="width: 100%" v-loading="loading"> | |
| 48 | + <el-table-column prop="taskId" :label="$t('maintainanceTaskManage.taskId')" align="center" /> | |
| 49 | + <el-table-column prop="planName" :label="$t('maintainanceTaskManage.planName')" align="center" /> | |
| 50 | + <el-table-column :label="$t('maintainanceTaskManage.timeRange')" align="center"> | |
| 51 | + <template slot-scope="scope"> | |
| 52 | + {{ scope.row.planInsTime }}<br />{{ scope.row.planEndTime }} | |
| 53 | + </template> | |
| 54 | + </el-table-column> | |
| 55 | + <el-table-column prop="actInsTime" :label="$t('maintainanceTaskManage.actInsTime')" align="center"> | |
| 56 | + <template slot-scope="scope"> | |
| 57 | + {{ scope.row.actInsTime || '-' }} | |
| 58 | + </template> | |
| 59 | + </el-table-column> | |
| 60 | + <el-table-column prop="originalPlanUserName" :label="$t('maintainanceTaskManage.originalPlanUser')" | |
| 61 | + align="center"> | |
| 62 | + <template slot-scope="scope"> | |
| 63 | + {{ scope.row.originalPlanUserName || '-' }} | |
| 64 | + </template> | |
| 65 | + </el-table-column> | |
| 66 | + <el-table-column prop="planUserName" :label="$t('maintainanceTaskManage.currentPlanUser')" align="center" /> | |
| 67 | + <el-table-column prop="transferDesc" :label="$t('maintainanceTaskManage.transferDesc')" align="center"> | |
| 68 | + <template slot-scope="scope"> | |
| 69 | + {{ scope.row.transferDesc || '-' }} | |
| 70 | + </template> | |
| 71 | + </el-table-column> | |
| 72 | + <el-table-column prop="stateName" :label="$t('maintainanceTaskManage.state')" align="center"> | |
| 73 | + <template slot-scope="scope"> | |
| 74 | + <span v-if="scope.row.state === '20200408'" class="text-danger"> | |
| 75 | + {{ scope.row.stateName }} | |
| 76 | + </span> | |
| 77 | + <span v-else> | |
| 78 | + {{ scope.row.stateName }} | |
| 79 | + </span> | |
| 80 | + </template> | |
| 81 | + </el-table-column> | |
| 82 | + <el-table-column :label="$t('maintainanceTaskManage.operation')" align="center" width="200"> | |
| 83 | + <template slot-scope="scope"> | |
| 84 | + <el-button size="mini" v-if="scope.row.state === '20200406' || scope.row.state === '20200405'" | |
| 85 | + @click="handleTransfer(scope.row)"> | |
| 86 | + {{ $t('maintainanceTaskManage.transfer') }} | |
| 87 | + </el-button> | |
| 88 | + <el-button size="mini" @click="handleDetail(scope.row)"> | |
| 89 | + {{ $t('maintainanceTaskManage.detail') }} | |
| 90 | + </el-button> | |
| 91 | + <el-button size="mini" type="danger" v-if="hasPrivilege('502022031612550001')" | |
| 92 | + @click="handleDelete(scope.row)"> | |
| 93 | + {{ $t('maintainanceTaskManage.delete') }} | |
| 94 | + </el-button> | |
| 95 | + </template> | |
| 96 | + </el-table-column> | |
| 97 | + </el-table> | |
| 98 | + | |
| 99 | + <div class="pagination-wrapper"> | |
| 100 | + <el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | |
| 101 | + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 102 | + @current-change="handleCurrentChange" /> | |
| 103 | + </div> | |
| 104 | + | |
| 105 | + <div class="tip-text"> | |
| 106 | + {{ $t('maintainanceTaskManage.tip') }} | |
| 107 | + </div> | |
| 108 | + </el-card> | |
| 109 | + | |
| 110 | + <!-- 子组件 --> | |
| 111 | + <maintainance-task-transfer ref="transferModal" @success="handleSuccess" /> | |
| 112 | + <maintainance-task-detail ref="detailModal" /> | |
| 113 | + <delete-maintainance-task ref="deleteModal" @success="handleSuccess" /> | |
| 114 | + </div> | |
| 115 | +</template> | |
| 116 | + | |
| 117 | +<script> | |
| 118 | +import { listMaintainanceTask } from '@/api/inspection/maintainanceTaskManageApi' | |
| 119 | +import { getDict } from '@/api/community/communityApi' | |
| 120 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 121 | +import MaintainanceTaskTransfer from '@/components/inspection/maintainanceTaskTransfer' | |
| 122 | +import MaintainanceTaskDetail from '@/components/inspection/maintainanceTaskDetail' | |
| 123 | +import DeleteMaintainanceTask from '@/components/inspection/deleteMaintainanceTask' | |
| 124 | + | |
| 125 | +export default { | |
| 126 | + name: 'MaintainanceTaskManageList', | |
| 127 | + components: { | |
| 128 | + MaintainanceTaskTransfer, | |
| 129 | + MaintainanceTaskDetail, | |
| 130 | + DeleteMaintainanceTask | |
| 131 | + }, | |
| 132 | + data() { | |
| 133 | + return { | |
| 134 | + loading: false, | |
| 135 | + searchForm: { | |
| 136 | + planUserName: '', | |
| 137 | + startTime: '', | |
| 138 | + endTime: '', | |
| 139 | + planName: '', | |
| 140 | + state: '' | |
| 141 | + }, | |
| 142 | + stateTypes: [], | |
| 143 | + tableData: [], | |
| 144 | + pagination: { | |
| 145 | + current: 1, | |
| 146 | + size: 10, | |
| 147 | + total: 0 | |
| 148 | + }, | |
| 149 | + communityId: '' | |
| 150 | + } | |
| 151 | + }, | |
| 152 | + created() { | |
| 153 | + this.communityId = getCommunityId() | |
| 154 | + this.getDictData() | |
| 155 | + this.getList() | |
| 156 | + }, | |
| 157 | + methods: { | |
| 158 | + async getDictData() { | |
| 159 | + try { | |
| 160 | + const data = await getDict('maintainance_task', 'state') | |
| 161 | + this.stateTypes = data | |
| 162 | + } catch (error) { | |
| 163 | + console.error('获取字典数据失败:', error) | |
| 164 | + } | |
| 165 | + }, | |
| 166 | + async getList() { | |
| 167 | + try { | |
| 168 | + this.loading = true | |
| 169 | + const params = { | |
| 170 | + page: this.pagination.current, | |
| 171 | + row: this.pagination.size, | |
| 172 | + communityId: this.communityId, | |
| 173 | + ...this.searchForm | |
| 174 | + } | |
| 175 | + const { data, total } = await listMaintainanceTask(params) | |
| 176 | + this.tableData = data | |
| 177 | + this.pagination.total = total | |
| 178 | + } catch (error) { | |
| 179 | + this.$message.error(this.$t('maintainanceTaskManage.fetchError')) | |
| 180 | + } finally { | |
| 181 | + this.loading = false | |
| 182 | + } | |
| 183 | + }, | |
| 184 | + handleSearch() { | |
| 185 | + this.pagination.current = 1 | |
| 186 | + this.getList() | |
| 187 | + }, | |
| 188 | + handleReset() { | |
| 189 | + this.searchForm = { | |
| 190 | + planUserName: '', | |
| 191 | + startTime: '', | |
| 192 | + endTime: '', | |
| 193 | + planName: '', | |
| 194 | + state: '' | |
| 195 | + } | |
| 196 | + this.pagination.current = 1 | |
| 197 | + this.getList() | |
| 198 | + }, | |
| 199 | + handleSizeChange(val) { | |
| 200 | + this.pagination.size = val | |
| 201 | + this.getList() | |
| 202 | + }, | |
| 203 | + handleCurrentChange(val) { | |
| 204 | + this.pagination.current = val | |
| 205 | + this.getList() | |
| 206 | + }, | |
| 207 | + handleTransfer(row) { | |
| 208 | + this.$refs.transferModal.open(row) | |
| 209 | + }, | |
| 210 | + handleDetail(row) { | |
| 211 | + this.$refs.detailModal.open(row) | |
| 212 | + }, | |
| 213 | + handleDelete(row) { | |
| 214 | + this.$refs.deleteModal.open(row) | |
| 215 | + }, | |
| 216 | + handleSuccess() { | |
| 217 | + this.getList() | |
| 218 | + }, | |
| 219 | + } | |
| 220 | +} | |
| 221 | +</script> | |
| 222 | + | |
| 223 | +<style lang="scss" scoped> | |
| 224 | +.maintainance-task-manage-container { | |
| 225 | + padding: 20px; | |
| 226 | + | |
| 227 | + .search-card { | |
| 228 | + margin-bottom: 20px; | |
| 229 | + } | |
| 230 | + | |
| 231 | + .list-card { | |
| 232 | + margin-bottom: 20px; | |
| 233 | + } | |
| 234 | + | |
| 235 | + .pagination-wrapper { | |
| 236 | + margin-top: 20px; | |
| 237 | + text-align: right; | |
| 238 | + } | |
| 239 | + | |
| 240 | + .tip-text { | |
| 241 | + margin-top: 20px; | |
| 242 | + color: #999; | |
| 243 | + font-size: 14px; | |
| 244 | + } | |
| 245 | + | |
| 246 | + .text-danger { | |
| 247 | + color: #f56c6c; | |
| 248 | + font-weight: bold; | |
| 249 | + } | |
| 250 | +} | |
| 251 | +</style> | |
| 0 | 252 | \ No newline at end of file | ... | ... |