Commit 0fbb1447dc86c1a6098ae655f2b25e6fe21ff9fc
1 parent
7cf20db6
vcFramework.js 转vue2+elementui 基础版本算是完成
Showing
14 changed files
with
1761 additions
and
0 deletions
src/api/oa/copyWorkApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 查询抄送工单列表 | ||
| 5 | + * @param {Object} params 查询参数 | ||
| 6 | + * @returns {Promise} | ||
| 7 | + */ | ||
| 8 | +export function queryCopyWork(params) { | ||
| 9 | + return new Promise((resolve, reject) => { | ||
| 10 | + request({ | ||
| 11 | + url: '/work.queryCopyWork', | ||
| 12 | + method: 'get', | ||
| 13 | + params | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * 提交抄送工单处理结果 | ||
| 25 | + * @param {Object} data 处理数据 | ||
| 26 | + * @returns {Promise} | ||
| 27 | + */ | ||
| 28 | +export function finishWorkCopy(data) { | ||
| 29 | + return new Promise((resolve, reject) => { | ||
| 30 | + request({ | ||
| 31 | + url: '/work.finishWorkCopy', | ||
| 32 | + method: 'post', | ||
| 33 | + data | ||
| 34 | + }).then(response => { | ||
| 35 | + const res = response.data | ||
| 36 | + resolve(res) | ||
| 37 | + }).catch(error => { | ||
| 38 | + reject(error) | ||
| 39 | + }) | ||
| 40 | + }) | ||
| 41 | +} | ||
| 0 | \ No newline at end of file | 42 | \ No newline at end of file |
src/api/oa/doWorkApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 查询工单列表 | ||
| 4 | +export function queryTaskWork(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/work.queryTaskWork', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve({ | ||
| 13 | + data: res.data, | ||
| 14 | + total: res.total | ||
| 15 | + }) | ||
| 16 | + }).catch(error => { | ||
| 17 | + reject(error) | ||
| 18 | + }) | ||
| 19 | + }) | ||
| 20 | +} | ||
| 0 | \ No newline at end of file | 21 | \ No newline at end of file |
src/api/oa/workDeductionApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 获取工单扣款列表 | ||
| 5 | + * @param {Object} params 查询参数 | ||
| 6 | + * @returns {Promise} | ||
| 7 | + */ | ||
| 8 | +export function listWorkDeduction(params) { | ||
| 9 | + return new Promise((resolve, reject) => { | ||
| 10 | + request({ | ||
| 11 | + url: '/work.listWorkDeduction', | ||
| 12 | + method: 'get', | ||
| 13 | + params | ||
| 14 | + }) | ||
| 15 | + .then(response => { | ||
| 16 | + const res = response.data | ||
| 17 | + resolve(res) | ||
| 18 | + }) | ||
| 19 | + .catch(error => { | ||
| 20 | + reject(error) | ||
| 21 | + }) | ||
| 22 | + }) | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * 添加工单扣款 | ||
| 27 | + * @param {Object} data 扣款数据 | ||
| 28 | + * @returns {Promise} | ||
| 29 | + */ | ||
| 30 | +export function addWorkDeduction(data) { | ||
| 31 | + return new Promise((resolve, reject) => { | ||
| 32 | + request({ | ||
| 33 | + url: '/work.saveWorkDeduction', | ||
| 34 | + method: 'post', | ||
| 35 | + data | ||
| 36 | + }) | ||
| 37 | + .then(response => { | ||
| 38 | + const res = response.data | ||
| 39 | + resolve(res) | ||
| 40 | + }) | ||
| 41 | + .catch(error => { | ||
| 42 | + reject(error) | ||
| 43 | + }) | ||
| 44 | + }) | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +/** | ||
| 48 | + * 更新工单扣款 | ||
| 49 | + * @param {Object} data 扣款数据 | ||
| 50 | + * @returns {Promise} | ||
| 51 | + */ | ||
| 52 | +export function updateWorkDeduction(data) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/work.updateWorkDeduction', | ||
| 56 | + method: 'post', | ||
| 57 | + data | ||
| 58 | + }) | ||
| 59 | + .then(response => { | ||
| 60 | + const res = response.data | ||
| 61 | + resolve(res) | ||
| 62 | + }) | ||
| 63 | + .catch(error => { | ||
| 64 | + reject(error) | ||
| 65 | + }) | ||
| 66 | + }) | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +/** | ||
| 70 | + * 删除工单扣款 | ||
| 71 | + * @param {String} workId 工单ID | ||
| 72 | + * @returns {Promise} | ||
| 73 | + */ | ||
| 74 | +export function deleteWorkDeduction(workId) { | ||
| 75 | + return new Promise((resolve, reject) => { | ||
| 76 | + request({ | ||
| 77 | + url: '/work.deleteWorkDeduction', | ||
| 78 | + method: 'post', | ||
| 79 | + data: { workId } | ||
| 80 | + }) | ||
| 81 | + .then(response => { | ||
| 82 | + const res = response.data | ||
| 83 | + resolve(res) | ||
| 84 | + }) | ||
| 85 | + .catch(error => { | ||
| 86 | + reject(error) | ||
| 87 | + }) | ||
| 88 | + }) | ||
| 89 | +} | ||
| 0 | \ No newline at end of file | 90 | \ No newline at end of file |
src/api/oa/workPoolApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取工作单池列表 | ||
| 4 | +export function listWorkTask(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/work.listWorkTask', | ||
| 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 | +} | ||
| 0 | \ No newline at end of file | 18 | \ No newline at end of file |
src/i18n/oaI18n.js
| @@ -42,6 +42,10 @@ import { messages as startWorkMessages } from '../views/oa/startWorkLang' | @@ -42,6 +42,10 @@ import { messages as startWorkMessages } from '../views/oa/startWorkLang' | ||
| 42 | import { messages as addWorkMessages } from '../views/oa/addWorkLang' | 42 | import { messages as addWorkMessages } from '../views/oa/addWorkLang' |
| 43 | import { messages as editWorkMessages } from '../views/oa/editWorkLang' | 43 | import { messages as editWorkMessages } from '../views/oa/editWorkLang' |
| 44 | import { messages as workDetailMessages } from '../views/oa/workDetailLang' | 44 | import { messages as workDetailMessages } from '../views/oa/workDetailLang' |
| 45 | +import { messages as doWorkMessages } from '../views/oa/doWorkLang' | ||
| 46 | +import { messages as copyWorkMessages } from '../views/oa/copyWorkLang' | ||
| 47 | +import { messages as workPoolMessages } from '../views/oa/workPoolLang' | ||
| 48 | +import { messages as workDeductionMessages } from '../views/oa/workDeductionLang' | ||
| 45 | export const messages ={ | 49 | export const messages ={ |
| 46 | en:{ | 50 | en:{ |
| 47 | ...activitiesTypeManageMessages.en, | 51 | ...activitiesTypeManageMessages.en, |
| @@ -87,6 +91,10 @@ export const messages ={ | @@ -87,6 +91,10 @@ export const messages ={ | ||
| 87 | ...addWorkMessages.en, | 91 | ...addWorkMessages.en, |
| 88 | ...editWorkMessages.en, | 92 | ...editWorkMessages.en, |
| 89 | ...workDetailMessages.en, | 93 | ...workDetailMessages.en, |
| 94 | + ...doWorkMessages.en, | ||
| 95 | + ...copyWorkMessages.en, | ||
| 96 | + ...workPoolMessages.en, | ||
| 97 | + ...workDeductionMessages.en, | ||
| 90 | }, | 98 | }, |
| 91 | zh:{ | 99 | zh:{ |
| 92 | ...activitiesTypeManageMessages.zh, | 100 | ...activitiesTypeManageMessages.zh, |
| @@ -132,5 +140,9 @@ export const messages ={ | @@ -132,5 +140,9 @@ export const messages ={ | ||
| 132 | ...addWorkMessages.zh, | 140 | ...addWorkMessages.zh, |
| 133 | ...editWorkMessages.zh, | 141 | ...editWorkMessages.zh, |
| 134 | ...workDetailMessages.zh, | 142 | ...workDetailMessages.zh, |
| 143 | + ...doWorkMessages.zh, | ||
| 144 | + ...copyWorkMessages.zh, | ||
| 145 | + ...workPoolMessages.zh, | ||
| 146 | + ...workDeductionMessages.zh, | ||
| 135 | } | 147 | } |
| 136 | } | 148 | } |
| 137 | \ No newline at end of file | 149 | \ No newline at end of file |
src/router/oaRouter.js
| @@ -199,4 +199,24 @@ export default [ | @@ -199,4 +199,24 @@ export default [ | ||
| 199 | name: '/views/oa/workDetail', | 199 | name: '/views/oa/workDetail', |
| 200 | component: () => import('@/views/oa/workDetailList.vue') | 200 | component: () => import('@/views/oa/workDetailList.vue') |
| 201 | }, | 201 | }, |
| 202 | + { | ||
| 203 | + path: '/pages/oa/doWork', | ||
| 204 | + name: '/pages/oa/doWork', | ||
| 205 | + component: () => import('@/views/oa/doWorkList.vue') | ||
| 206 | + }, | ||
| 207 | + { | ||
| 208 | + path: '/pages/oa/copyWork', | ||
| 209 | + name: '/pages/oa/copyWork', | ||
| 210 | + component: () => import('@/views/oa/copyWorkList.vue') | ||
| 211 | + }, | ||
| 212 | + { | ||
| 213 | + path: '/pages/oa/workPool', | ||
| 214 | + name: '/pages/oa/workPool', | ||
| 215 | + component: () => import('@/views/oa/workPoolList.vue') | ||
| 216 | + }, | ||
| 217 | + { | ||
| 218 | + path: '/pages/oa/workDeduction', | ||
| 219 | + name: '/pages/oa/workDeduction', | ||
| 220 | + component: () => import('@/views/oa/workDeductionList.vue') | ||
| 221 | + }, | ||
| 202 | ] | 222 | ] |
| 203 | \ No newline at end of file | 223 | \ No newline at end of file |
src/views/oa/copyWorkLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + copyWork: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + workName: 'Work Order Name', | ||
| 7 | + createUser: 'Creator', | ||
| 8 | + startTime: 'Start Time', | ||
| 9 | + endTime: 'End Time' | ||
| 10 | + }, | ||
| 11 | + list: { | ||
| 12 | + title: 'Work Orders Copied to Me' | ||
| 13 | + }, | ||
| 14 | + table: { | ||
| 15 | + id: 'ID', | ||
| 16 | + workName: 'Work Order Name', | ||
| 17 | + typeName: 'Type Name', | ||
| 18 | + workCycle: 'Cycle', | ||
| 19 | + startTime: 'Start Time', | ||
| 20 | + endTime: 'End Time', | ||
| 21 | + createUser: 'Creator', | ||
| 22 | + handler: 'Handler', | ||
| 23 | + copyUser: 'Copy To', | ||
| 24 | + status: 'Status', | ||
| 25 | + createTime: 'Create Time' | ||
| 26 | + }, | ||
| 27 | + state: { | ||
| 28 | + all: 'All', | ||
| 29 | + W: 'Pending', | ||
| 30 | + C: 'Processed' | ||
| 31 | + }, | ||
| 32 | + cycle: { | ||
| 33 | + once: 'One-time', | ||
| 34 | + periodic: 'Periodic' | ||
| 35 | + }, | ||
| 36 | + audit: { | ||
| 37 | + title: 'Read Note', | ||
| 38 | + message: 'Note', | ||
| 39 | + messagePlaceholder: 'Required, please fill in the note' | ||
| 40 | + }, | ||
| 41 | + fetchError: 'Failed to fetch work orders' | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + zh: { | ||
| 45 | + copyWork: { | ||
| 46 | + search: { | ||
| 47 | + title: '查询条件', | ||
| 48 | + workName: '工单名称', | ||
| 49 | + createUser: '发起人', | ||
| 50 | + startTime: '开始时间', | ||
| 51 | + endTime: '结束时间' | ||
| 52 | + }, | ||
| 53 | + list: { | ||
| 54 | + title: '抄送我的工作单' | ||
| 55 | + }, | ||
| 56 | + table: { | ||
| 57 | + id: '编号', | ||
| 58 | + workName: '工单名称', | ||
| 59 | + typeName: '类型名称', | ||
| 60 | + workCycle: '标识', | ||
| 61 | + startTime: '开始时间', | ||
| 62 | + endTime: '结束时间', | ||
| 63 | + createUser: '发起人', | ||
| 64 | + handler: '处理人', | ||
| 65 | + copyUser: '抄送人', | ||
| 66 | + status: '状态', | ||
| 67 | + createTime: '创建时间' | ||
| 68 | + }, | ||
| 69 | + state: { | ||
| 70 | + all: '全部', | ||
| 71 | + W: '待处理', | ||
| 72 | + C: '已处理' | ||
| 73 | + }, | ||
| 74 | + cycle: { | ||
| 75 | + once: '一次性工单', | ||
| 76 | + periodic: '周期性工单' | ||
| 77 | + }, | ||
| 78 | + audit: { | ||
| 79 | + title: '已阅说明', | ||
| 80 | + message: '说明', | ||
| 81 | + messagePlaceholder: '必填,请填写说明' | ||
| 82 | + }, | ||
| 83 | + fetchError: '获取工单列表失败' | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | +} | ||
| 0 | \ No newline at end of file | 87 | \ No newline at end of file |
src/views/oa/copyWorkList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="copy-work-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <div class="border-radius"> | ||
| 6 | + <div class="margin-xs-r treeview"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li | ||
| 9 | + v-for="(item,index) in copyWorkInfo.states" | ||
| 10 | + :key="index" | ||
| 11 | + class="list-group-item node-orgTree" | ||
| 12 | + :class="{'vc-node-selected':copyWorkInfo.conditions.state == item.state}" | ||
| 13 | + @click="swatchWorkState(item)" | ||
| 14 | + > | ||
| 15 | + {{ $t(`copyWork.state.${item.state || 'all'}`) }} | ||
| 16 | + </li> | ||
| 17 | + </ul> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + </el-col> | ||
| 21 | + <el-col :span="20"> | ||
| 22 | + <el-card class="box-card"> | ||
| 23 | + <div slot="header" class="flex justify-between"> | ||
| 24 | + <h5>{{ $t('copyWork.search.title') }}</h5> | ||
| 25 | + </div> | ||
| 26 | + <div class="search-wrapper"> | ||
| 27 | + <el-row :gutter="20"> | ||
| 28 | + <el-col :span="4"> | ||
| 29 | + <el-input | ||
| 30 | + v-model="copyWorkInfo.conditions.workName" | ||
| 31 | + :placeholder="$t('copyWork.search.workName')" | ||
| 32 | + clearable | ||
| 33 | + /> | ||
| 34 | + </el-col> | ||
| 35 | + <el-col :span="4"> | ||
| 36 | + <el-input | ||
| 37 | + v-model="copyWorkInfo.conditions.createUserNameLike" | ||
| 38 | + :placeholder="$t('copyWork.search.createUser')" | ||
| 39 | + clearable | ||
| 40 | + /> | ||
| 41 | + </el-col> | ||
| 42 | + <el-col :span="4"> | ||
| 43 | + <el-date-picker | ||
| 44 | + v-model="copyWorkInfo.conditions.queryStartTime" | ||
| 45 | + type="datetime" | ||
| 46 | + :placeholder="$t('copyWork.search.startTime')" | ||
| 47 | + style="width: 100%" | ||
| 48 | + /> | ||
| 49 | + </el-col> | ||
| 50 | + <el-col :span="4"> | ||
| 51 | + <el-date-picker | ||
| 52 | + v-model="copyWorkInfo.conditions.queryEndTime" | ||
| 53 | + type="datetime" | ||
| 54 | + :placeholder="$t('copyWork.search.endTime')" | ||
| 55 | + style="width: 100%" | ||
| 56 | + /> | ||
| 57 | + </el-col> | ||
| 58 | + <el-col :span="4"> | ||
| 59 | + <el-button type="primary" @click="_queryCopyWorkMethod"> | ||
| 60 | + <i class="el-icon-search"></i> | ||
| 61 | + {{ $t('common.search') }} | ||
| 62 | + </el-button> | ||
| 63 | + <el-button @click="_resetCopyWorkMethod"> | ||
| 64 | + <i class="el-icon-refresh"></i> | ||
| 65 | + {{ $t('common.reset') }} | ||
| 66 | + </el-button> | ||
| 67 | + </el-col> | ||
| 68 | + </el-row> | ||
| 69 | + </div> | ||
| 70 | + </el-card> | ||
| 71 | + | ||
| 72 | + <el-card class="box-card"> | ||
| 73 | + <div slot="header" class="flex justify-between"> | ||
| 74 | + <div>{{ $t('copyWork.list.title') }}</div> | ||
| 75 | + </div> | ||
| 76 | + <el-table | ||
| 77 | + :data="copyWorkInfo.works" | ||
| 78 | + border | ||
| 79 | + style="width: 100%" | ||
| 80 | + v-loading="loading" | ||
| 81 | + > | ||
| 82 | + <el-table-column | ||
| 83 | + prop="workId" | ||
| 84 | + :label="$t('copyWork.table.id')" | ||
| 85 | + align="center" | ||
| 86 | + /> | ||
| 87 | + <el-table-column | ||
| 88 | + prop="workName" | ||
| 89 | + :label="$t('copyWork.table.workName')" | ||
| 90 | + align="center" | ||
| 91 | + /> | ||
| 92 | + <el-table-column | ||
| 93 | + prop="typeName" | ||
| 94 | + :label="$t('copyWork.table.typeName')" | ||
| 95 | + align="center" | ||
| 96 | + /> | ||
| 97 | + <el-table-column | ||
| 98 | + :label="$t('copyWork.table.workCycle')" | ||
| 99 | + align="center" | ||
| 100 | + > | ||
| 101 | + <template slot-scope="scope"> | ||
| 102 | + {{ scope.row.workCycle == '1001' ? $t('copyWork.cycle.once') : $t('copyWork.cycle.periodic') }} | ||
| 103 | + </template> | ||
| 104 | + </el-table-column> | ||
| 105 | + <el-table-column | ||
| 106 | + prop="startTime" | ||
| 107 | + :label="$t('copyWork.table.startTime')" | ||
| 108 | + align="center" | ||
| 109 | + /> | ||
| 110 | + <el-table-column | ||
| 111 | + prop="endTime" | ||
| 112 | + :label="$t('copyWork.table.endTime')" | ||
| 113 | + align="center" | ||
| 114 | + /> | ||
| 115 | + <el-table-column | ||
| 116 | + prop="createUserName" | ||
| 117 | + :label="$t('copyWork.table.createUser')" | ||
| 118 | + align="center" | ||
| 119 | + /> | ||
| 120 | + <el-table-column | ||
| 121 | + prop="curStaffName" | ||
| 122 | + :label="$t('copyWork.table.handler')" | ||
| 123 | + align="center" | ||
| 124 | + > | ||
| 125 | + <template slot-scope="scope"> | ||
| 126 | + {{ scope.row.curStaffName || '-' }} | ||
| 127 | + </template> | ||
| 128 | + </el-table-column> | ||
| 129 | + <el-table-column | ||
| 130 | + prop="curCopyName" | ||
| 131 | + :label="$t('copyWork.table.copyUser')" | ||
| 132 | + align="center" | ||
| 133 | + > | ||
| 134 | + <template slot-scope="scope"> | ||
| 135 | + {{ scope.row.curCopyName || '-' }} | ||
| 136 | + </template> | ||
| 137 | + </el-table-column> | ||
| 138 | + <el-table-column | ||
| 139 | + prop="stateName" | ||
| 140 | + :label="$t('copyWork.table.status')" | ||
| 141 | + align="center" | ||
| 142 | + /> | ||
| 143 | + <el-table-column | ||
| 144 | + prop="createTime" | ||
| 145 | + :label="$t('copyWork.table.createTime')" | ||
| 146 | + align="center" | ||
| 147 | + /> | ||
| 148 | + <el-table-column | ||
| 149 | + :label="$t('common.operation')" | ||
| 150 | + align="center" | ||
| 151 | + width="180" | ||
| 152 | + > | ||
| 153 | + <template slot-scope="scope"> | ||
| 154 | + <el-button | ||
| 155 | + v-if="scope.row.state != 'C'" | ||
| 156 | + size="mini" | ||
| 157 | + type="primary" | ||
| 158 | + @click="_openCopyWorkModel(scope.row)" | ||
| 159 | + > | ||
| 160 | + {{ $t('common.process') }} | ||
| 161 | + </el-button> | ||
| 162 | + <el-button | ||
| 163 | + size="mini" | ||
| 164 | + @click="_toWorkDetailPage(scope.row)" | ||
| 165 | + > | ||
| 166 | + {{ $t('common.detail') }} | ||
| 167 | + </el-button> | ||
| 168 | + </template> | ||
| 169 | + </el-table-column> | ||
| 170 | + </el-table> | ||
| 171 | + <el-pagination | ||
| 172 | + :current-page.sync="page.current" | ||
| 173 | + :page-sizes="[10, 20, 30, 50]" | ||
| 174 | + :page-size="page.size" | ||
| 175 | + :total="page.total" | ||
| 176 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 177 | + @size-change="handleSizeChange" | ||
| 178 | + @current-change="handleCurrentChange" | ||
| 179 | + /> | ||
| 180 | + </el-card> | ||
| 181 | + </el-col> | ||
| 182 | + </el-row> | ||
| 183 | + | ||
| 184 | + <el-dialog | ||
| 185 | + :title="$t('copyWork.audit.title')" | ||
| 186 | + :visible.sync="auditDialogVisible" | ||
| 187 | + width="50%" | ||
| 188 | + > | ||
| 189 | + <el-form> | ||
| 190 | + <el-form-item :label="$t('copyWork.audit.message')"> | ||
| 191 | + <el-input | ||
| 192 | + type="textarea" | ||
| 193 | + :placeholder="$t('copyWork.audit.messagePlaceholder')" | ||
| 194 | + v-model="copyWorkInfo.audit.auditMessage" | ||
| 195 | + :rows="4" | ||
| 196 | + /> | ||
| 197 | + </el-form-item> | ||
| 198 | + </el-form> | ||
| 199 | + <span slot="footer" class="dialog-footer"> | ||
| 200 | + <el-button @click="auditDialogVisible = false"> | ||
| 201 | + {{ $t('common.cancel') }} | ||
| 202 | + </el-button> | ||
| 203 | + <el-button type="primary" @click="_auditSubmit"> | ||
| 204 | + {{ $t('common.submit') }} | ||
| 205 | + </el-button> | ||
| 206 | + </span> | ||
| 207 | + </el-dialog> | ||
| 208 | + </div> | ||
| 209 | +</template> | ||
| 210 | + | ||
| 211 | +<script> | ||
| 212 | +import { queryCopyWork, finishWorkCopy } from '@/api/oa/copyWorkApi' | ||
| 213 | + | ||
| 214 | +export default { | ||
| 215 | + name: 'CopyWorkList', | ||
| 216 | + data() { | ||
| 217 | + return { | ||
| 218 | + loading: false, | ||
| 219 | + auditDialogVisible: false, | ||
| 220 | + page: { | ||
| 221 | + current: 1, | ||
| 222 | + size: 10, | ||
| 223 | + total: 0 | ||
| 224 | + }, | ||
| 225 | + copyWorkInfo: { | ||
| 226 | + works: [], | ||
| 227 | + states: [ | ||
| 228 | + { | ||
| 229 | + name: '全部', | ||
| 230 | + state: '' | ||
| 231 | + }, { | ||
| 232 | + name: '待处理', | ||
| 233 | + state: 'W' | ||
| 234 | + }, { | ||
| 235 | + name: '已处理', | ||
| 236 | + state: 'C' | ||
| 237 | + } | ||
| 238 | + ], | ||
| 239 | + audit: { | ||
| 240 | + copyId: '', | ||
| 241 | + auditMessage: '', | ||
| 242 | + }, | ||
| 243 | + conditions: { | ||
| 244 | + workName: '', | ||
| 245 | + state: '', | ||
| 246 | + typeName: '', | ||
| 247 | + timeout: '', | ||
| 248 | + queryEndTime: '', | ||
| 249 | + queryStartTime: '', | ||
| 250 | + createUserNameLike: '', | ||
| 251 | + page: 1, | ||
| 252 | + row: 10 | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + } | ||
| 256 | + }, | ||
| 257 | + created() { | ||
| 258 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 259 | + }, | ||
| 260 | + methods: { | ||
| 261 | + async _listCopyWorks(page, size) { | ||
| 262 | + try { | ||
| 263 | + this.loading = true | ||
| 264 | + this.copyWorkInfo.conditions.page = page | ||
| 265 | + this.copyWorkInfo.conditions.row = size | ||
| 266 | + const { data, total } = await queryCopyWork(this.copyWorkInfo.conditions) | ||
| 267 | + this.copyWorkInfo.works = data | ||
| 268 | + this.page.total = total | ||
| 269 | + } catch (error) { | ||
| 270 | + this.$message.error(this.$t('copyWork.fetchError')) | ||
| 271 | + } finally { | ||
| 272 | + this.loading = false | ||
| 273 | + } | ||
| 274 | + }, | ||
| 275 | + _queryCopyWorkMethod() { | ||
| 276 | + this.page.current = 1 | ||
| 277 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 278 | + }, | ||
| 279 | + _resetCopyWorkMethod() { | ||
| 280 | + this.copyWorkInfo.conditions = { | ||
| 281 | + workName: '', | ||
| 282 | + state: '', | ||
| 283 | + typeName: '', | ||
| 284 | + timeout: '', | ||
| 285 | + queryEndTime: '', | ||
| 286 | + queryStartTime: '', | ||
| 287 | + createUserNameLike: '', | ||
| 288 | + page: 1, | ||
| 289 | + row: 10 | ||
| 290 | + } | ||
| 291 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 292 | + }, | ||
| 293 | + swatchWorkState(state) { | ||
| 294 | + this.copyWorkInfo.conditions.state = state.state | ||
| 295 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 296 | + }, | ||
| 297 | + _toWorkDetailPage(work) { | ||
| 298 | + this.$router.push(`/pages/oa/workDetail?workId=${work.workId}`) | ||
| 299 | + }, | ||
| 300 | + _openCopyWorkModel(work) { | ||
| 301 | + this.$router.push(`/pages/oa/doCopyWork?workId=${work.workId}©Id=${work.copyId}`) | ||
| 302 | + }, | ||
| 303 | + async _auditSubmit() { | ||
| 304 | + try { | ||
| 305 | + await finishWorkCopy(this.copyWorkInfo.audit) | ||
| 306 | + this.$message.success(this.$t('common.submitSuccess')) | ||
| 307 | + this.auditDialogVisible = false | ||
| 308 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 309 | + } catch (error) { | ||
| 310 | + this.$message.error(error.message || this.$t('common.submitFailed')) | ||
| 311 | + } | ||
| 312 | + }, | ||
| 313 | + handleSizeChange(val) { | ||
| 314 | + this.page.size = val | ||
| 315 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 316 | + }, | ||
| 317 | + handleCurrentChange(val) { | ||
| 318 | + this.page.current = val | ||
| 319 | + this._listCopyWorks(this.page.current, this.page.size) | ||
| 320 | + } | ||
| 321 | + } | ||
| 322 | +} | ||
| 323 | +</script> | ||
| 324 | + | ||
| 325 | +<style lang="scss" scoped> | ||
| 326 | +.copy-work-container { | ||
| 327 | + padding: 20px; | ||
| 328 | + | ||
| 329 | + .border-radius { | ||
| 330 | + border-radius: 4px; | ||
| 331 | + overflow: hidden; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + .margin-xs-r { | ||
| 335 | + margin-right: 10px; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + .list-group { | ||
| 339 | + list-style: none; | ||
| 340 | + padding: 0; | ||
| 341 | + margin: 0; | ||
| 342 | + | ||
| 343 | + .list-group-item { | ||
| 344 | + padding: 10px 15px; | ||
| 345 | + border: 1px solid #ddd; | ||
| 346 | + margin-bottom: -1px; | ||
| 347 | + cursor: pointer; | ||
| 348 | + background-color: #fff; | ||
| 349 | + | ||
| 350 | + &:hover { | ||
| 351 | + background-color: #f5f5f5; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + &.vc-node-selected { | ||
| 355 | + background-color: #409EFF; | ||
| 356 | + color: #fff; | ||
| 357 | + } | ||
| 358 | + } | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + .box-card { | ||
| 362 | + margin-bottom: 20px; | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + .search-wrapper { | ||
| 366 | + margin-bottom: 20px; | ||
| 367 | + } | ||
| 368 | +} | ||
| 369 | +</style> | ||
| 0 | \ No newline at end of file | 370 | \ No newline at end of file |
src/views/oa/doWorkLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + doWork: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + workNameLike: 'Work Order Name', | ||
| 7 | + staffNameLike: 'Processor', | ||
| 8 | + queryStartTime: 'Start Time', | ||
| 9 | + queryEndTime: 'End Time' | ||
| 10 | + }, | ||
| 11 | + table: { | ||
| 12 | + title: 'Work Order List', | ||
| 13 | + workId: 'ID', | ||
| 14 | + workName: 'Work Order Name', | ||
| 15 | + typeName: 'Type Name', | ||
| 16 | + workCycle: 'Type', | ||
| 17 | + startTime: 'Start Time', | ||
| 18 | + endTime: 'End Time', | ||
| 19 | + createUserName: 'Creator', | ||
| 20 | + curStaffName: 'Processor', | ||
| 21 | + curCopyName: 'CC', | ||
| 22 | + stateName: 'Status', | ||
| 23 | + createTime: 'Create Time' | ||
| 24 | + }, | ||
| 25 | + state: { | ||
| 26 | + all: 'All', | ||
| 27 | + pending: 'Pending', | ||
| 28 | + processed: 'Processed' | ||
| 29 | + }, | ||
| 30 | + workCycle: { | ||
| 31 | + once: 'One-time Work Order', | ||
| 32 | + periodic: 'Periodic Work Order' | ||
| 33 | + }, | ||
| 34 | + fetchError: 'Failed to fetch work orders' | ||
| 35 | + }, | ||
| 36 | + }, | ||
| 37 | + zh: { | ||
| 38 | + doWork: { | ||
| 39 | + search: { | ||
| 40 | + title: '查询条件', | ||
| 41 | + workNameLike: '工单名称', | ||
| 42 | + staffNameLike: '处理人', | ||
| 43 | + queryStartTime: '开始时间', | ||
| 44 | + queryEndTime: '结束时间' | ||
| 45 | + }, | ||
| 46 | + table: { | ||
| 47 | + title: '工单列表', | ||
| 48 | + workId: '编号', | ||
| 49 | + workName: '工单名称', | ||
| 50 | + typeName: '类型名称', | ||
| 51 | + workCycle: '类型', | ||
| 52 | + startTime: '开始时间', | ||
| 53 | + endTime: '结束时间', | ||
| 54 | + createUserName: '发起人', | ||
| 55 | + curStaffName: '处理人', | ||
| 56 | + curCopyName: '抄送人', | ||
| 57 | + stateName: '状态', | ||
| 58 | + createTime: '创建时间' | ||
| 59 | + }, | ||
| 60 | + state: { | ||
| 61 | + all: '全部', | ||
| 62 | + pending: '待处理', | ||
| 63 | + processed: '已处理' | ||
| 64 | + }, | ||
| 65 | + workCycle: { | ||
| 66 | + once: '一次性工单', | ||
| 67 | + periodic: '周期性工单' | ||
| 68 | + }, | ||
| 69 | + fetchError: '获取工单列表失败' | ||
| 70 | + }, | ||
| 71 | + } | ||
| 72 | +} | ||
| 0 | \ No newline at end of file | 73 | \ No newline at end of file |
src/views/oa/doWorkList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="do-work-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <el-card class="tree-card"> | ||
| 6 | + <ul class="state-list"> | ||
| 7 | + <li | ||
| 8 | + v-for="(item,index) in doWorkInfo.states" | ||
| 9 | + :key="index" | ||
| 10 | + @click="swatchWorkState(item)" | ||
| 11 | + :class="{'active-state':doWorkInfo.conditions.state === item.state}"> | ||
| 12 | + {{item.name}} | ||
| 13 | + </li> | ||
| 14 | + </ul> | ||
| 15 | + </el-card> | ||
| 16 | + </el-col> | ||
| 17 | + <el-col :span="20"> | ||
| 18 | + <el-card class="search-card"> | ||
| 19 | + <div slot="header" class="flex justify-between"> | ||
| 20 | + <span>{{ $t('doWork.search.title') }}</span> | ||
| 21 | + </div> | ||
| 22 | + <el-row :gutter="20"> | ||
| 23 | + <el-col :span="4"> | ||
| 24 | + <el-input | ||
| 25 | + v-model.trim="doWorkInfo.conditions.workNameLike" | ||
| 26 | + :placeholder="$t('doWork.search.workNameLike')" | ||
| 27 | + clearable /> | ||
| 28 | + </el-col> | ||
| 29 | + <el-col :span="4"> | ||
| 30 | + <el-input | ||
| 31 | + v-model.trim="doWorkInfo.conditions.staffNameLike" | ||
| 32 | + :placeholder="$t('doWork.search.staffNameLike')" | ||
| 33 | + clearable /> | ||
| 34 | + </el-col> | ||
| 35 | + <el-col :span="4"> | ||
| 36 | + <el-date-picker | ||
| 37 | + v-model="doWorkInfo.conditions.queryStartTime" | ||
| 38 | + type="datetime" | ||
| 39 | + :placeholder="$t('doWork.search.queryStartTime')" | ||
| 40 | + value-format="yyyy-MM-dd HH:mm:ss"> | ||
| 41 | + </el-date-picker> | ||
| 42 | + </el-col> | ||
| 43 | + <el-col :span="4"> | ||
| 44 | + <el-date-picker | ||
| 45 | + v-model="doWorkInfo.conditions.queryEndTime" | ||
| 46 | + type="datetime" | ||
| 47 | + :placeholder="$t('doWork.search.queryEndTime')" | ||
| 48 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 49 | + :disabled="!doWorkInfo.conditions.queryStartTime"> | ||
| 50 | + </el-date-picker> | ||
| 51 | + </el-col> | ||
| 52 | + <el-col :span="4"> | ||
| 53 | + <el-button type="primary" @click="_queryDoWorkMethod"> | ||
| 54 | + <i class="el-icon-search"></i> | ||
| 55 | + {{ $t('common.search') }} | ||
| 56 | + </el-button> | ||
| 57 | + <el-button @click="_resetDoWorkMethod"> | ||
| 58 | + <i class="el-icon-refresh"></i> | ||
| 59 | + {{ $t('common.reset') }} | ||
| 60 | + </el-button> | ||
| 61 | + </el-col> | ||
| 62 | + </el-row> | ||
| 63 | + </el-card> | ||
| 64 | + | ||
| 65 | + <el-card class="table-card"> | ||
| 66 | + <div slot="header" class="flex justify-between"> | ||
| 67 | + <span>{{ $t('doWork.table.title') }}</span> | ||
| 68 | + </div> | ||
| 69 | + <el-table | ||
| 70 | + :data="doWorkInfo.works" | ||
| 71 | + border | ||
| 72 | + style="width: 100%" | ||
| 73 | + v-loading="loading"> | ||
| 74 | + <el-table-column | ||
| 75 | + prop="workId" | ||
| 76 | + :label="$t('doWork.table.workId')" | ||
| 77 | + align="center"> | ||
| 78 | + </el-table-column> | ||
| 79 | + <el-table-column | ||
| 80 | + prop="workName" | ||
| 81 | + :label="$t('doWork.table.workName')" | ||
| 82 | + align="center"> | ||
| 83 | + </el-table-column> | ||
| 84 | + <el-table-column | ||
| 85 | + prop="typeName" | ||
| 86 | + :label="$t('doWork.table.typeName')" | ||
| 87 | + align="center"> | ||
| 88 | + </el-table-column> | ||
| 89 | + <el-table-column | ||
| 90 | + prop="workCycle" | ||
| 91 | + :label="$t('doWork.table.workCycle')" | ||
| 92 | + align="center"> | ||
| 93 | + <template slot-scope="scope"> | ||
| 94 | + {{ scope.row.workCycle === '1001' ? $t('doWork.workCycle.once') : $t('doWork.workCycle.periodic') }} | ||
| 95 | + </template> | ||
| 96 | + </el-table-column> | ||
| 97 | + <el-table-column | ||
| 98 | + prop="startTime" | ||
| 99 | + :label="$t('doWork.table.startTime')" | ||
| 100 | + align="center"> | ||
| 101 | + </el-table-column> | ||
| 102 | + <el-table-column | ||
| 103 | + prop="endTime" | ||
| 104 | + :label="$t('doWork.table.endTime')" | ||
| 105 | + align="center"> | ||
| 106 | + </el-table-column> | ||
| 107 | + <el-table-column | ||
| 108 | + prop="createUserName" | ||
| 109 | + :label="$t('doWork.table.createUserName')" | ||
| 110 | + align="center"> | ||
| 111 | + </el-table-column> | ||
| 112 | + <el-table-column | ||
| 113 | + prop="curStaffName" | ||
| 114 | + :label="$t('doWork.table.curStaffName')" | ||
| 115 | + align="center"> | ||
| 116 | + <template slot-scope="scope"> | ||
| 117 | + {{ scope.row.curStaffName || '-' }} | ||
| 118 | + </template> | ||
| 119 | + </el-table-column> | ||
| 120 | + <el-table-column | ||
| 121 | + prop="curCopyName" | ||
| 122 | + :label="$t('doWork.table.curCopyName')" | ||
| 123 | + align="center"> | ||
| 124 | + <template slot-scope="scope"> | ||
| 125 | + {{ scope.row.curCopyName || '-' }} | ||
| 126 | + </template> | ||
| 127 | + </el-table-column> | ||
| 128 | + <el-table-column | ||
| 129 | + prop="stateName" | ||
| 130 | + :label="$t('doWork.table.stateName')" | ||
| 131 | + align="center"> | ||
| 132 | + </el-table-column> | ||
| 133 | + <el-table-column | ||
| 134 | + prop="createTime" | ||
| 135 | + :label="$t('doWork.table.createTime')" | ||
| 136 | + align="center"> | ||
| 137 | + </el-table-column> | ||
| 138 | + <el-table-column | ||
| 139 | + :label="$t('common.operation')" | ||
| 140 | + align="center" | ||
| 141 | + width="180"> | ||
| 142 | + <template slot-scope="scope"> | ||
| 143 | + <el-button | ||
| 144 | + v-if="scope.row.state === 'W' || scope.row.state === 'D'" | ||
| 145 | + type="text" | ||
| 146 | + size="small" | ||
| 147 | + @click="_openTodoTaskDetail(scope.row)"> | ||
| 148 | + {{ $t('common.process') }} | ||
| 149 | + </el-button> | ||
| 150 | + <el-button | ||
| 151 | + type="text" | ||
| 152 | + size="small" | ||
| 153 | + @click="_toWorkDetailPage(scope.row)"> | ||
| 154 | + {{ $t('common.detail') }} | ||
| 155 | + </el-button> | ||
| 156 | + </template> | ||
| 157 | + </el-table-column> | ||
| 158 | + </el-table> | ||
| 159 | + <el-pagination | ||
| 160 | + @size-change="handleSizeChange" | ||
| 161 | + @current-change="handleCurrentChange" | ||
| 162 | + :current-page="pagination.current" | ||
| 163 | + :page-sizes="[10, 20, 30, 50]" | ||
| 164 | + :page-size="pagination.size" | ||
| 165 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 166 | + :total="pagination.total"> | ||
| 167 | + </el-pagination> | ||
| 168 | + </el-card> | ||
| 169 | + </el-col> | ||
| 170 | + </el-row> | ||
| 171 | + </div> | ||
| 172 | +</template> | ||
| 173 | + | ||
| 174 | +<script> | ||
| 175 | +import { queryTaskWork } from '@/api/oa/doWorkApi' | ||
| 176 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 177 | + | ||
| 178 | +export default { | ||
| 179 | + name: 'DoWorkList', | ||
| 180 | + data() { | ||
| 181 | + return { | ||
| 182 | + loading: false, | ||
| 183 | + communityId: '', | ||
| 184 | + doWorkInfo: { | ||
| 185 | + works: [], | ||
| 186 | + states: [ | ||
| 187 | + { | ||
| 188 | + name: this.$t('doWork.state.all'), | ||
| 189 | + state: '' | ||
| 190 | + }, | ||
| 191 | + { | ||
| 192 | + name: this.$t('doWork.state.pending'), | ||
| 193 | + state: 'W' | ||
| 194 | + }, | ||
| 195 | + { | ||
| 196 | + name: this.$t('doWork.state.processed'), | ||
| 197 | + state: 'C' | ||
| 198 | + } | ||
| 199 | + ], | ||
| 200 | + conditions: { | ||
| 201 | + workNameLike: '', | ||
| 202 | + staffNameLike: '', | ||
| 203 | + state: '', | ||
| 204 | + typeName: '', | ||
| 205 | + timeout: '', | ||
| 206 | + queryEndTime: '', | ||
| 207 | + queryStartTime: '', | ||
| 208 | + page: 1, | ||
| 209 | + row: 10 | ||
| 210 | + } | ||
| 211 | + }, | ||
| 212 | + pagination: { | ||
| 213 | + current: 1, | ||
| 214 | + size: 10, | ||
| 215 | + total: 0 | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + }, | ||
| 219 | + created() { | ||
| 220 | + this.communityId = getCommunityId() | ||
| 221 | + this._listDoWorks() | ||
| 222 | + }, | ||
| 223 | + methods: { | ||
| 224 | + async _listDoWorks() { | ||
| 225 | + try { | ||
| 226 | + this.loading = true | ||
| 227 | + const params = { | ||
| 228 | + ...this.doWorkInfo.conditions, | ||
| 229 | + communityId: this.communityId | ||
| 230 | + } | ||
| 231 | + const { data, total } = await queryTaskWork(params) | ||
| 232 | + this.doWorkInfo.works = data | ||
| 233 | + this.pagination.total = total | ||
| 234 | + } catch (error) { | ||
| 235 | + this.$message.error(this.$t('doWork.fetchError')) | ||
| 236 | + } finally { | ||
| 237 | + this.loading = false | ||
| 238 | + } | ||
| 239 | + }, | ||
| 240 | + _queryDoWorkMethod() { | ||
| 241 | + this.pagination.current = 1 | ||
| 242 | + this.doWorkInfo.conditions.page = 1 | ||
| 243 | + this._listDoWorks() | ||
| 244 | + }, | ||
| 245 | + _resetDoWorkMethod() { | ||
| 246 | + this.doWorkInfo.conditions = { | ||
| 247 | + workNameLike: '', | ||
| 248 | + staffNameLike: '', | ||
| 249 | + state: '', | ||
| 250 | + typeName: '', | ||
| 251 | + timeout: '', | ||
| 252 | + queryEndTime: '', | ||
| 253 | + queryStartTime: '', | ||
| 254 | + page: 1, | ||
| 255 | + row: 10 | ||
| 256 | + } | ||
| 257 | + this._listDoWorks() | ||
| 258 | + }, | ||
| 259 | + swatchWorkState(state) { | ||
| 260 | + this.doWorkInfo.conditions.state = state.state | ||
| 261 | + this._listDoWorks() | ||
| 262 | + }, | ||
| 263 | + _openTodoTaskDetail(work) { | ||
| 264 | + this.$router.push({ | ||
| 265 | + path: '/pages/oa/workTaskDetail', | ||
| 266 | + query: { | ||
| 267 | + workId: work.workId, | ||
| 268 | + taskId: work.taskId, | ||
| 269 | + todo: 'ON' | ||
| 270 | + } | ||
| 271 | + }) | ||
| 272 | + }, | ||
| 273 | + _toWorkDetailPage(work) { | ||
| 274 | + this.$router.push({ | ||
| 275 | + path: '/pages/oa/workDetail', | ||
| 276 | + query: { | ||
| 277 | + workId: work.workId | ||
| 278 | + } | ||
| 279 | + }) | ||
| 280 | + }, | ||
| 281 | + handleSizeChange(val) { | ||
| 282 | + this.pagination.size = val | ||
| 283 | + this.doWorkInfo.conditions.row = val | ||
| 284 | + this._listDoWorks() | ||
| 285 | + }, | ||
| 286 | + handleCurrentChange(val) { | ||
| 287 | + this.pagination.current = val | ||
| 288 | + this.doWorkInfo.conditions.page = val | ||
| 289 | + this._listDoWorks() | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | +} | ||
| 293 | +</script> | ||
| 294 | + | ||
| 295 | +<style lang="scss" scoped> | ||
| 296 | +.do-work-container { | ||
| 297 | + padding: 20px; | ||
| 298 | + | ||
| 299 | + .tree-card { | ||
| 300 | + height: 100%; | ||
| 301 | + | ||
| 302 | + .state-list { | ||
| 303 | + list-style: none; | ||
| 304 | + padding: 0; | ||
| 305 | + margin: 0; | ||
| 306 | + | ||
| 307 | + li { | ||
| 308 | + padding: 10px; | ||
| 309 | + text-align: center; | ||
| 310 | + cursor: pointer; | ||
| 311 | + border-radius: 4px; | ||
| 312 | + margin-bottom: 5px; | ||
| 313 | + | ||
| 314 | + &:hover { | ||
| 315 | + background-color: #f5f7fa; | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + &.active-state { | ||
| 319 | + background-color: #409EFF; | ||
| 320 | + color: white; | ||
| 321 | + } | ||
| 322 | + } | ||
| 323 | + } | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + .search-card { | ||
| 327 | + margin-bottom: 20px; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + .el-date-editor { | ||
| 331 | + width: 100%; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + .el-pagination { | ||
| 335 | + margin-top: 20px; | ||
| 336 | + text-align: right; | ||
| 337 | + } | ||
| 338 | +} | ||
| 339 | +</style> | ||
| 0 | \ No newline at end of file | 340 | \ No newline at end of file |
src/views/oa/workDeductionLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + workDeduction: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + staffNameLike: 'Please enter handler', | ||
| 7 | + deductionPersonNameLike: 'Please enter deduction person' | ||
| 8 | + }, | ||
| 9 | + list: { | ||
| 10 | + title: 'Work Order Deduction' | ||
| 11 | + }, | ||
| 12 | + table: { | ||
| 13 | + staffName: 'Staff Name', | ||
| 14 | + timeRange: 'Time Range', | ||
| 15 | + content: 'Content', | ||
| 16 | + finishTime: 'Completion Time', | ||
| 17 | + state: 'Status', | ||
| 18 | + remark: 'Remark', | ||
| 19 | + score: 'Score', | ||
| 20 | + deductionMoney: 'Deduction Amount', | ||
| 21 | + deductionReason: 'Deduction Reason', | ||
| 22 | + deductionPersonName: 'Deduction Person', | ||
| 23 | + createTime: 'Time' | ||
| 24 | + }, | ||
| 25 | + state: { | ||
| 26 | + W: 'Pending', | ||
| 27 | + C: 'Handler Completed', | ||
| 28 | + CC: 'Copier Completed' | ||
| 29 | + }, | ||
| 30 | + fetchError: 'Failed to fetch work deduction data' | ||
| 31 | + } | ||
| 32 | + }, | ||
| 33 | + zh: { | ||
| 34 | + workDeduction: { | ||
| 35 | + search: { | ||
| 36 | + title: '查询条件', | ||
| 37 | + staffNameLike: '请输入处理人', | ||
| 38 | + deductionPersonNameLike: '请输入扣款人' | ||
| 39 | + }, | ||
| 40 | + list: { | ||
| 41 | + title: '工单扣款' | ||
| 42 | + }, | ||
| 43 | + table: { | ||
| 44 | + staffName: '员工名称', | ||
| 45 | + timeRange: '时间段', | ||
| 46 | + content: '内容', | ||
| 47 | + finishTime: '完成时间', | ||
| 48 | + state: '状态', | ||
| 49 | + remark: '说明', | ||
| 50 | + score: '评分', | ||
| 51 | + deductionMoney: '扣款金额', | ||
| 52 | + deductionReason: '扣款说明', | ||
| 53 | + deductionPersonName: '扣款人', | ||
| 54 | + createTime: '时间' | ||
| 55 | + }, | ||
| 56 | + state: { | ||
| 57 | + W: '待处理', | ||
| 58 | + C: '处理人已办理', | ||
| 59 | + CC: '抄送人已办理' | ||
| 60 | + }, | ||
| 61 | + fetchError: '获取工单扣款数据失败' | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | +} | ||
| 0 | \ No newline at end of file | 65 | \ No newline at end of file |
src/views/oa/workDeductionList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="work-deduction-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('workDeduction.search.title') }}</span> | ||
| 7 | + </div> | ||
| 8 | + <el-row :gutter="20"> | ||
| 9 | + <el-col :span="6"> | ||
| 10 | + <el-input | ||
| 11 | + v-model.trim="searchForm.staffNameLike" | ||
| 12 | + :placeholder="$t('workDeduction.search.staffNameLike')" | ||
| 13 | + clearable | ||
| 14 | + @keyup.enter.native="handleSearch" | ||
| 15 | + /> | ||
| 16 | + </el-col> | ||
| 17 | + <el-col :span="6"> | ||
| 18 | + <el-input | ||
| 19 | + v-model.trim="searchForm.deductionPersonNameLike" | ||
| 20 | + :placeholder="$t('workDeduction.search.deductionPersonNameLike')" | ||
| 21 | + clearable | ||
| 22 | + @keyup.enter.native="handleSearch" | ||
| 23 | + /> | ||
| 24 | + </el-col> | ||
| 25 | + <el-col :span="4"> | ||
| 26 | + <el-button type="primary" @click="handleSearch"> | ||
| 27 | + {{ $t('common.search') }} | ||
| 28 | + </el-button> | ||
| 29 | + </el-col> | ||
| 30 | + </el-row> | ||
| 31 | + </el-card> | ||
| 32 | + | ||
| 33 | + <!-- 工单扣款列表 --> | ||
| 34 | + <el-card class="list-wrapper"> | ||
| 35 | + <div slot="header" class="flex justify-between"> | ||
| 36 | + <span>{{ $t('workDeduction.list.title') }}</span> | ||
| 37 | + </div> | ||
| 38 | + | ||
| 39 | + <el-table | ||
| 40 | + v-loading="loading" | ||
| 41 | + :data="tableData" | ||
| 42 | + border | ||
| 43 | + style="width: 100%" | ||
| 44 | + > | ||
| 45 | + <el-table-column | ||
| 46 | + prop="staffName" | ||
| 47 | + :label="$t('workDeduction.table.staffName')" | ||
| 48 | + align="center" | ||
| 49 | + /> | ||
| 50 | + <el-table-column | ||
| 51 | + :label="$t('workDeduction.table.timeRange')" | ||
| 52 | + align="center" | ||
| 53 | + > | ||
| 54 | + <template slot-scope="scope"> | ||
| 55 | + {{ scope.row.startTime }}<br />~{{ scope.row.endTime }} | ||
| 56 | + </template> | ||
| 57 | + </el-table-column> | ||
| 58 | + <el-table-column | ||
| 59 | + prop="content" | ||
| 60 | + :label="$t('workDeduction.table.content')" | ||
| 61 | + align="center" | ||
| 62 | + width="400" | ||
| 63 | + /> | ||
| 64 | + <el-table-column | ||
| 65 | + prop="finishTime" | ||
| 66 | + :label="$t('workDeduction.table.finishTime')" | ||
| 67 | + align="center" | ||
| 68 | + /> | ||
| 69 | + <el-table-column | ||
| 70 | + :label="$t('workDeduction.table.state')" | ||
| 71 | + align="center" | ||
| 72 | + > | ||
| 73 | + <template slot-scope="scope"> | ||
| 74 | + <span v-if="scope.row.state === 'CC'"> | ||
| 75 | + {{ $t('workDeduction.state.CC') }} | ||
| 76 | + </span> | ||
| 77 | + <span v-else-if="scope.row.state === 'C'"> | ||
| 78 | + {{ $t('workDeduction.state.C') }} | ||
| 79 | + </span> | ||
| 80 | + <span v-else> | ||
| 81 | + {{ $t('workDeduction.state.W') }} | ||
| 82 | + </span> | ||
| 83 | + </template> | ||
| 84 | + </el-table-column> | ||
| 85 | + <el-table-column | ||
| 86 | + prop="remark" | ||
| 87 | + :label="$t('workDeduction.table.remark')" | ||
| 88 | + align="center" | ||
| 89 | + /> | ||
| 90 | + <el-table-column | ||
| 91 | + prop="score" | ||
| 92 | + :label="$t('workDeduction.table.score')" | ||
| 93 | + align="center" | ||
| 94 | + /> | ||
| 95 | + <el-table-column | ||
| 96 | + prop="deductionMoney" | ||
| 97 | + :label="$t('workDeduction.table.deductionMoney')" | ||
| 98 | + align="center" | ||
| 99 | + /> | ||
| 100 | + <el-table-column | ||
| 101 | + prop="deductionReason" | ||
| 102 | + :label="$t('workDeduction.table.deductionReason')" | ||
| 103 | + align="center" | ||
| 104 | + /> | ||
| 105 | + <el-table-column | ||
| 106 | + prop="deductionPersonName" | ||
| 107 | + :label="$t('workDeduction.table.deductionPersonName')" | ||
| 108 | + align="center" | ||
| 109 | + /> | ||
| 110 | + <el-table-column | ||
| 111 | + prop="createTime" | ||
| 112 | + :label="$t('workDeduction.table.createTime')" | ||
| 113 | + align="center" | ||
| 114 | + /> | ||
| 115 | + <el-table-column | ||
| 116 | + :label="$t('common.operation')" | ||
| 117 | + align="center" | ||
| 118 | + width="120" | ||
| 119 | + > | ||
| 120 | + <template slot-scope="scope"> | ||
| 121 | + <el-button | ||
| 122 | + size="mini" | ||
| 123 | + type="primary" | ||
| 124 | + @click="handleDetail(scope.row)" | ||
| 125 | + > | ||
| 126 | + {{ $t('common.detail') }} | ||
| 127 | + </el-button> | ||
| 128 | + </template> | ||
| 129 | + </el-table-column> | ||
| 130 | + </el-table> | ||
| 131 | + | ||
| 132 | + <el-pagination | ||
| 133 | + :current-page.sync="page.current" | ||
| 134 | + :page-sizes="[10, 20, 30, 50]" | ||
| 135 | + :page-size="page.size" | ||
| 136 | + :total="page.total" | ||
| 137 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 138 | + @size-change="handleSizeChange" | ||
| 139 | + @current-change="handleCurrentChange" | ||
| 140 | + /> | ||
| 141 | + </el-card> | ||
| 142 | + </div> | ||
| 143 | +</template> | ||
| 144 | + | ||
| 145 | +<script> | ||
| 146 | +import { listWorkDeduction } from '@/api/oa/workDeductionApi' | ||
| 147 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 148 | + | ||
| 149 | +export default { | ||
| 150 | + name: 'WorkDeductionList', | ||
| 151 | + data() { | ||
| 152 | + return { | ||
| 153 | + loading: false, | ||
| 154 | + searchForm: { | ||
| 155 | + staffNameLike: '', | ||
| 156 | + deductionPersonNameLike: '', | ||
| 157 | + communityId: '' | ||
| 158 | + }, | ||
| 159 | + tableData: [], | ||
| 160 | + page: { | ||
| 161 | + current: 1, | ||
| 162 | + size: 10, | ||
| 163 | + total: 0 | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + }, | ||
| 167 | + created() { | ||
| 168 | + this.searchForm.communityId = getCommunityId() | ||
| 169 | + this.getList() | ||
| 170 | + }, | ||
| 171 | + methods: { | ||
| 172 | + async getList() { | ||
| 173 | + try { | ||
| 174 | + this.loading = true | ||
| 175 | + const params = { | ||
| 176 | + page: this.page.current, | ||
| 177 | + row: this.page.size, | ||
| 178 | + ...this.searchForm | ||
| 179 | + } | ||
| 180 | + const { data, total } = await listWorkDeduction(params) | ||
| 181 | + this.tableData = data | ||
| 182 | + this.page.total = total | ||
| 183 | + } catch (error) { | ||
| 184 | + this.$message.error(this.$t('workDeduction.fetchError')) | ||
| 185 | + } finally { | ||
| 186 | + this.loading = false | ||
| 187 | + } | ||
| 188 | + }, | ||
| 189 | + handleSearch() { | ||
| 190 | + this.page.current = 1 | ||
| 191 | + this.getList() | ||
| 192 | + }, | ||
| 193 | + handleDetail(row) { | ||
| 194 | + this.$router.push({ | ||
| 195 | + path: '/views/oa/workDetail', | ||
| 196 | + query: { workId: row.workId } | ||
| 197 | + }) | ||
| 198 | + }, | ||
| 199 | + handleSizeChange(val) { | ||
| 200 | + this.page.size = val | ||
| 201 | + this.getList() | ||
| 202 | + }, | ||
| 203 | + handleCurrentChange(val) { | ||
| 204 | + this.page.current = val | ||
| 205 | + this.getList() | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | +} | ||
| 209 | +</script> | ||
| 210 | + | ||
| 211 | +<style lang="scss" scoped> | ||
| 212 | +.work-deduction-container { | ||
| 213 | + padding: 20px; | ||
| 214 | + | ||
| 215 | + .search-wrapper { | ||
| 216 | + margin-bottom: 20px; | ||
| 217 | + | ||
| 218 | + .el-row { | ||
| 219 | + margin-bottom: 20px; | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + .list-wrapper { | ||
| 224 | + .el-pagination { | ||
| 225 | + margin-top: 20px; | ||
| 226 | + text-align: right; | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | +} | ||
| 230 | +</style> | ||
| 0 | \ No newline at end of file | 231 | \ No newline at end of file |
src/views/oa/workPoolLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + workPool: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + workName: 'Work Order Name', | ||
| 7 | + createUser: 'Creator', | ||
| 8 | + staffName: 'Processor', | ||
| 9 | + startTime: 'Start Time', | ||
| 10 | + endTime: 'End Time' | ||
| 11 | + }, | ||
| 12 | + list: { | ||
| 13 | + title: 'Work Order Pool' | ||
| 14 | + }, | ||
| 15 | + table: { | ||
| 16 | + id: 'ID', | ||
| 17 | + workName: 'Work Name', | ||
| 18 | + typeName: 'Type Name', | ||
| 19 | + workCycle: 'Cycle Type', | ||
| 20 | + once: 'One-time', | ||
| 21 | + cycle: 'Periodic', | ||
| 22 | + createUser: 'Creator', | ||
| 23 | + staffName: 'Processor', | ||
| 24 | + timeRange: 'Time Range', | ||
| 25 | + status: 'Status', | ||
| 26 | + createTime: 'Create Time', | ||
| 27 | + finishTime: 'Finish Time', | ||
| 28 | + timeout: 'Timeout' | ||
| 29 | + }, | ||
| 30 | + state: { | ||
| 31 | + all: 'All', | ||
| 32 | + pending: 'Pending', | ||
| 33 | + completed: 'Completed', | ||
| 34 | + timeout: 'Timeout Work Orders' | ||
| 35 | + }, | ||
| 36 | + fetchError: 'Failed to fetch work orders' | ||
| 37 | + } | ||
| 38 | + }, | ||
| 39 | + zh: { | ||
| 40 | + workPool: { | ||
| 41 | + search: { | ||
| 42 | + title: '查询条件', | ||
| 43 | + workName: '请输入工单名称', | ||
| 44 | + createUser: '请输入发起人', | ||
| 45 | + staffName: '请输入处理人', | ||
| 46 | + startTime: '请输入开始时间', | ||
| 47 | + endTime: '请输入结束时间' | ||
| 48 | + }, | ||
| 49 | + list: { | ||
| 50 | + title: '工作单池' | ||
| 51 | + }, | ||
| 52 | + table: { | ||
| 53 | + id: '编号', | ||
| 54 | + workName: '工单名称', | ||
| 55 | + typeName: '类型名称', | ||
| 56 | + workCycle: '标识', | ||
| 57 | + once: '一次性工单', | ||
| 58 | + cycle: '周期性工单', | ||
| 59 | + createUser: '发起人', | ||
| 60 | + staffName: '处理人', | ||
| 61 | + timeRange: '时间段', | ||
| 62 | + status: '状态', | ||
| 63 | + createTime: '创建时间', | ||
| 64 | + finishTime: '完成时间', | ||
| 65 | + timeout: '超时' | ||
| 66 | + }, | ||
| 67 | + state: { | ||
| 68 | + all: '全部', | ||
| 69 | + pending: '待处理', | ||
| 70 | + completed: '处理完成', | ||
| 71 | + timeout: '超时工作单' | ||
| 72 | + }, | ||
| 73 | + fetchError: '获取工作单列表失败' | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | +} | ||
| 0 | \ No newline at end of file | 77 | \ No newline at end of file |
src/views/oa/workPoolList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="work-pool-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <div class="state-sidebar"> | ||
| 6 | + <ul class="state-list"> | ||
| 7 | + <li | ||
| 8 | + v-for="(item, index) in workPoolInfo.states" | ||
| 9 | + :key="index" | ||
| 10 | + class="state-item" | ||
| 11 | + :class="{ 'active-state': workPoolInfo.conditions.state === item.state }" | ||
| 12 | + @click="swatchWorkState(item)" | ||
| 13 | + > | ||
| 14 | + {{ item.name }} | ||
| 15 | + </li> | ||
| 16 | + </ul> | ||
| 17 | + </div> | ||
| 18 | + </el-col> | ||
| 19 | + <el-col :span="20"> | ||
| 20 | + <el-card class="search-card"> | ||
| 21 | + <div slot="header" class="flex justify-between"> | ||
| 22 | + <span>{{ $t('workPool.search.title') }}</span> | ||
| 23 | + </div> | ||
| 24 | + <el-row :gutter="20"> | ||
| 25 | + <el-col :span="4"> | ||
| 26 | + <el-input | ||
| 27 | + v-model.trim="workPoolInfo.conditions.workNameLike" | ||
| 28 | + :placeholder="$t('workPool.search.workName')" | ||
| 29 | + clearable | ||
| 30 | + /> | ||
| 31 | + </el-col> | ||
| 32 | + <el-col :span="4"> | ||
| 33 | + <el-input | ||
| 34 | + v-model.trim="workPoolInfo.conditions.createUserNameLike" | ||
| 35 | + :placeholder="$t('workPool.search.createUser')" | ||
| 36 | + clearable | ||
| 37 | + /> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="4"> | ||
| 40 | + <el-input | ||
| 41 | + v-model.trim="workPoolInfo.conditions.staffNameLike" | ||
| 42 | + :placeholder="$t('workPool.search.staffName')" | ||
| 43 | + clearable | ||
| 44 | + /> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="4"> | ||
| 47 | + <el-date-picker | ||
| 48 | + v-model="workPoolInfo.conditions.queryStartTime" | ||
| 49 | + type="datetime" | ||
| 50 | + :placeholder="$t('workPool.search.startTime')" | ||
| 51 | + style="width: 100%" | ||
| 52 | + /> | ||
| 53 | + </el-col> | ||
| 54 | + <el-col :span="4"> | ||
| 55 | + <el-date-picker | ||
| 56 | + v-model="workPoolInfo.conditions.queryEndTime" | ||
| 57 | + type="datetime" | ||
| 58 | + :placeholder="$t('workPool.search.endTime')" | ||
| 59 | + style="width: 100%" | ||
| 60 | + /> | ||
| 61 | + </el-col> | ||
| 62 | + <el-col :span="4"> | ||
| 63 | + <el-button type="primary" @click="_queryWorkPoolMethod"> | ||
| 64 | + {{ $t('common.search') }} | ||
| 65 | + </el-button> | ||
| 66 | + <el-button @click="_resetWorkPoolMethod"> | ||
| 67 | + {{ $t('common.reset') }} | ||
| 68 | + </el-button> | ||
| 69 | + </el-col> | ||
| 70 | + </el-row> | ||
| 71 | + </el-card> | ||
| 72 | + | ||
| 73 | + <el-card class="work-list-card"> | ||
| 74 | + <div slot="header" class="flex justify-between"> | ||
| 75 | + <span>{{ $t('workPool.list.title') }}</span> | ||
| 76 | + </div> | ||
| 77 | + <el-table | ||
| 78 | + :data="workPoolInfo.works" | ||
| 79 | + border | ||
| 80 | + style="width: 100%" | ||
| 81 | + v-loading="loading" | ||
| 82 | + > | ||
| 83 | + <el-table-column | ||
| 84 | + prop="workId" | ||
| 85 | + :label="$t('workPool.table.id')" | ||
| 86 | + width="80" | ||
| 87 | + align="center" | ||
| 88 | + /> | ||
| 89 | + <el-table-column | ||
| 90 | + prop="workName" | ||
| 91 | + :label="$t('workPool.table.workName')" | ||
| 92 | + align="center" | ||
| 93 | + /> | ||
| 94 | + <el-table-column | ||
| 95 | + prop="typeName" | ||
| 96 | + :label="$t('workPool.table.typeName')" | ||
| 97 | + align="center" | ||
| 98 | + /> | ||
| 99 | + <el-table-column | ||
| 100 | + prop="workCycle" | ||
| 101 | + :label="$t('workPool.table.workCycle')" | ||
| 102 | + align="center" | ||
| 103 | + > | ||
| 104 | + <template slot-scope="scope"> | ||
| 105 | + {{ scope.row.workCycle === '1001' ? $t('workPool.table.once') : $t('workPool.table.cycle') }} | ||
| 106 | + </template> | ||
| 107 | + </el-table-column> | ||
| 108 | + <el-table-column | ||
| 109 | + prop="createUserName" | ||
| 110 | + :label="$t('workPool.table.createUser')" | ||
| 111 | + align="center" | ||
| 112 | + /> | ||
| 113 | + <el-table-column | ||
| 114 | + prop="staffName" | ||
| 115 | + :label="$t('workPool.table.staffName')" | ||
| 116 | + align="center" | ||
| 117 | + > | ||
| 118 | + <template slot-scope="scope"> | ||
| 119 | + {{ scope.row.staffName || '-' }} | ||
| 120 | + </template> | ||
| 121 | + </el-table-column> | ||
| 122 | + <el-table-column | ||
| 123 | + :label="$t('workPool.table.timeRange')" | ||
| 124 | + align="center" | ||
| 125 | + > | ||
| 126 | + <template slot-scope="scope"> | ||
| 127 | + <div>{{ scope.row.startTime }}</div> | ||
| 128 | + <div>{{ scope.row.endTime }}</div> | ||
| 129 | + </template> | ||
| 130 | + </el-table-column> | ||
| 131 | + <el-table-column | ||
| 132 | + :label="$t('workPool.table.status')" | ||
| 133 | + align="center" | ||
| 134 | + > | ||
| 135 | + <template slot-scope="scope"> | ||
| 136 | + {{ scope.row.stateName }} | ||
| 137 | + <span v-if="scope.row.state === 'C' && scope.row.taskTimeout === 'Y'"> | ||
| 138 | + ({{ $t('workPool.table.timeout') }}) | ||
| 139 | + </span> | ||
| 140 | + </template> | ||
| 141 | + </el-table-column> | ||
| 142 | + <el-table-column | ||
| 143 | + prop="createTime" | ||
| 144 | + :label="$t('workPool.table.createTime')" | ||
| 145 | + align="center" | ||
| 146 | + /> | ||
| 147 | + <el-table-column | ||
| 148 | + prop="finishTime" | ||
| 149 | + :label="$t('workPool.table.finishTime')" | ||
| 150 | + align="center" | ||
| 151 | + > | ||
| 152 | + <template slot-scope="scope"> | ||
| 153 | + {{ scope.row.finishTime || '-' }} | ||
| 154 | + </template> | ||
| 155 | + </el-table-column> | ||
| 156 | + <el-table-column | ||
| 157 | + :label="$t('common.operation')" | ||
| 158 | + width="120" | ||
| 159 | + align="center" | ||
| 160 | + > | ||
| 161 | + <template slot-scope="scope"> | ||
| 162 | + <el-button | ||
| 163 | + size="mini" | ||
| 164 | + type="primary" | ||
| 165 | + @click="_toWorkDetailPage(scope.row)" | ||
| 166 | + > | ||
| 167 | + {{ $t('common.detail') }} | ||
| 168 | + </el-button> | ||
| 169 | + </template> | ||
| 170 | + </el-table-column> | ||
| 171 | + </el-table> | ||
| 172 | + | ||
| 173 | + <el-pagination | ||
| 174 | + :current-page.sync="pagination.current" | ||
| 175 | + :page-sizes="[10, 20, 30, 50]" | ||
| 176 | + :page-size="pagination.size" | ||
| 177 | + :total="pagination.total" | ||
| 178 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 179 | + @size-change="handleSizeChange" | ||
| 180 | + @current-change="handleCurrentChange" | ||
| 181 | + /> | ||
| 182 | + </el-card> | ||
| 183 | + </el-col> | ||
| 184 | + </el-row> | ||
| 185 | + </div> | ||
| 186 | +</template> | ||
| 187 | + | ||
| 188 | +<script> | ||
| 189 | +import { listWorkTask } from '@/api/oa/workPoolApi' | ||
| 190 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 191 | + | ||
| 192 | +export default { | ||
| 193 | + name: 'WorkPoolList', | ||
| 194 | + data() { | ||
| 195 | + return { | ||
| 196 | + loading: false, | ||
| 197 | + workPoolInfo: { | ||
| 198 | + works: [], | ||
| 199 | + states: [ | ||
| 200 | + { name: this.$t('workPool.state.all'), state: '' }, | ||
| 201 | + { name: this.$t('workPool.state.pending'), state: 'W' }, | ||
| 202 | + { name: this.$t('workPool.state.completed'), state: 'C' }, | ||
| 203 | + { name: this.$t('workPool.state.timeout'), state: 'timeout' } | ||
| 204 | + ], | ||
| 205 | + conditions: { | ||
| 206 | + state: '', | ||
| 207 | + workNameLike: '', | ||
| 208 | + createUserNameLike: '', | ||
| 209 | + staffNameLike: '', | ||
| 210 | + queryStartTime: '', | ||
| 211 | + queryEndTime: '', | ||
| 212 | + page: 1, | ||
| 213 | + row: 10, | ||
| 214 | + communityId: '' | ||
| 215 | + } | ||
| 216 | + }, | ||
| 217 | + pagination: { | ||
| 218 | + current: 1, | ||
| 219 | + size: 10, | ||
| 220 | + total: 0 | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + created() { | ||
| 225 | + this.workPoolInfo.conditions.communityId = getCommunityId() | ||
| 226 | + this._listWorkPools() | ||
| 227 | + }, | ||
| 228 | + methods: { | ||
| 229 | + async _listWorkPools() { | ||
| 230 | + try { | ||
| 231 | + this.loading = true | ||
| 232 | + const params = { ...this.workPoolInfo.conditions } | ||
| 233 | + if (params.state === 'timeout') { | ||
| 234 | + params.state = 'C' | ||
| 235 | + params.taskTimeout = 'Y' | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + const { data, total } = await listWorkTask(params) | ||
| 239 | + this.workPoolInfo.works = data | ||
| 240 | + this.pagination.total = total | ||
| 241 | + } catch (error) { | ||
| 242 | + this.$message.error(this.$t('workPool.fetchError')) | ||
| 243 | + } finally { | ||
| 244 | + this.loading = false | ||
| 245 | + } | ||
| 246 | + }, | ||
| 247 | + _queryWorkPoolMethod() { | ||
| 248 | + this.pagination.current = 1 | ||
| 249 | + this.workPoolInfo.conditions.page = 1 | ||
| 250 | + this._listWorkPools() | ||
| 251 | + }, | ||
| 252 | + _resetWorkPoolMethod() { | ||
| 253 | + this.workPoolInfo.conditions = { | ||
| 254 | + ...this.workPoolInfo.conditions, | ||
| 255 | + workNameLike: '', | ||
| 256 | + createUserNameLike: '', | ||
| 257 | + staffNameLike: '', | ||
| 258 | + queryStartTime: '', | ||
| 259 | + queryEndTime: '', | ||
| 260 | + state: '' | ||
| 261 | + } | ||
| 262 | + this._queryWorkPoolMethod() | ||
| 263 | + }, | ||
| 264 | + swatchWorkState(state) { | ||
| 265 | + this.workPoolInfo.conditions.state = state.state | ||
| 266 | + this._queryWorkPoolMethod() | ||
| 267 | + }, | ||
| 268 | + _toWorkDetailPage(work) { | ||
| 269 | + this.$router.push(`/views/oa/workDetail?workId=${work.workId}`) | ||
| 270 | + }, | ||
| 271 | + handleSizeChange(val) { | ||
| 272 | + this.pagination.size = val | ||
| 273 | + this.workPoolInfo.conditions.row = val | ||
| 274 | + this._listWorkPools() | ||
| 275 | + }, | ||
| 276 | + handleCurrentChange(val) { | ||
| 277 | + this.pagination.current = val | ||
| 278 | + this.workPoolInfo.conditions.page = val | ||
| 279 | + this._listWorkPools() | ||
| 280 | + } | ||
| 281 | + } | ||
| 282 | +} | ||
| 283 | +</script> | ||
| 284 | + | ||
| 285 | +<style lang="scss" scoped> | ||
| 286 | +.work-pool-container { | ||
| 287 | + padding: 20px; | ||
| 288 | + | ||
| 289 | + .state-sidebar { | ||
| 290 | + background: #fff; | ||
| 291 | + border-radius: 4px; | ||
| 292 | + padding: 10px 0; | ||
| 293 | + | ||
| 294 | + .state-list { | ||
| 295 | + list-style: none; | ||
| 296 | + padding: 0; | ||
| 297 | + margin: 0; | ||
| 298 | + | ||
| 299 | + .state-item { | ||
| 300 | + padding: 10px 15px; | ||
| 301 | + cursor: pointer; | ||
| 302 | + text-align: center; | ||
| 303 | + transition: all 0.3s; | ||
| 304 | + | ||
| 305 | + &:hover { | ||
| 306 | + background-color: #f5f7fa; | ||
| 307 | + } | ||
| 308 | + | ||
| 309 | + &.active-state { | ||
| 310 | + background-color: #409eff; | ||
| 311 | + color: #fff; | ||
| 312 | + } | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + .search-card { | ||
| 318 | + margin-bottom: 20px; | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + .el-pagination { | ||
| 322 | + margin-top: 20px; | ||
| 323 | + text-align: right; | ||
| 324 | + } | ||
| 325 | +} | ||
| 326 | +</style> | ||
| 0 | \ No newline at end of file | 327 | \ No newline at end of file |