|
|
@@ -38,12 +38,20 @@
|
|
|
@keyup.enter.native="queryData" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="opsUserName">
|
|
|
- <el-input
|
|
|
+ <el-select
|
|
|
v-model="queryForm.opsUserName"
|
|
|
clearable
|
|
|
+ filterable
|
|
|
+ :loading="opsUserLoading"
|
|
|
placeholder="处理人"
|
|
|
size="small"
|
|
|
- @keyup.enter.native="queryData" />
|
|
|
+ style="width: 140px">
|
|
|
+ <el-option
|
|
|
+ v-for="user in opsUserOptions"
|
|
|
+ :key="user.userId || user.user_id || user.id"
|
|
|
+ :label="user.nickName || user.nick_name || user.userName || user.user_name"
|
|
|
+ :value="user.nickName || user.nick_name || user.userName || user.user_name" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="dateRange">
|
|
|
<el-date-picker
|
|
|
@@ -77,6 +85,9 @@
|
|
|
@click="toggleSidebarFilters">
|
|
|
<i class="el-icon-search" />
|
|
|
</button>
|
|
|
+ <button class="sidebar-action-btn" title="查看全部项目" type="button" @click="handleViewAllProjects">
|
|
|
+ <i class="el-icon-menu" />
|
|
|
+ </button>
|
|
|
</div>
|
|
|
<div class="sidebar-actions">
|
|
|
<button
|
|
|
@@ -99,6 +110,21 @@
|
|
|
prefix-icon="el-icon-search"
|
|
|
size="small"
|
|
|
@input="onProjectSearchDebounced" />
|
|
|
+ <el-select
|
|
|
+ v-model="opsManagerUserId"
|
|
|
+ class="project-search"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :loading="opsManagerLoading"
|
|
|
+ placeholder="运维负责人"
|
|
|
+ size="small"
|
|
|
+ @change="handleOpsManagerFilterChange">
|
|
|
+ <el-option
|
|
|
+ v-for="user in opsManagerOptions"
|
|
|
+ :key="user.userId || user.user_id || user.id"
|
|
|
+ :label="user.nickName || user.nick_name || user.userName || user.user_name"
|
|
|
+ :value="user.userId || user.user_id || user.id" />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<div ref="projectList" class="project-list">
|
|
|
<div
|
|
|
@@ -248,6 +274,54 @@
|
|
|
:mode="'view'"
|
|
|
:read-only="true"
|
|
|
:visible.sync="detailVisible" />
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ title="全部项目列表"
|
|
|
+ top="3vh"
|
|
|
+ :visible.sync="projectListDialogVisible"
|
|
|
+ width="1000px">
|
|
|
+ <div class="project-list-dialog-body">
|
|
|
+ <el-table v-loading="projectListDialogLoading" border :data="allProjects" max-height="65vh">
|
|
|
+ <el-table-column align="center" label="序号" type="index" width="60" />
|
|
|
+ <el-table-column align="center" label="合同编号" min-width="130" prop="contractNo" show-overflow-tooltip />
|
|
|
+ <el-table-column align="center" label="项目名称" min-width="150" prop="projectName" show-overflow-tooltip />
|
|
|
+ <el-table-column align="center" label="产品线" min-width="100" show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ getProductLineLabel(row.productLine) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="项目状态" min-width="90" show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ selectDictLabel(projectStatusOptions, row.projectStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="运维负责人" min-width="110" show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">{{ row.attribute3 || '-' }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="销售负责人"
|
|
|
+ min-width="100"
|
|
|
+ prop="salesUserName"
|
|
|
+ show-overflow-tooltip />
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="交付负责人"
|
|
|
+ min-width="100"
|
|
|
+ prop="deliveryUserName"
|
|
|
+ show-overflow-tooltip />
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ v-if="projectListDialogTotal > 20"
|
|
|
+ background
|
|
|
+ :current-page.sync="projectListDialogPage"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :page-size="20"
|
|
|
+ :total="projectListDialogTotal"
|
|
|
+ @current-change="fetchAllProjects" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -257,6 +331,7 @@
|
|
|
import debounce from 'lodash/debounce'
|
|
|
import deliveryProjectApi from '@/api/devops/deliveryProject'
|
|
|
import operationEventApi from '@/api/operation/operationEvent'
|
|
|
+ import userApi from '@/api/system/user'
|
|
|
import dictApi from '@/api/system/dict'
|
|
|
import OperationDetail from '@/views/devops/operation/components/OperationDetail'
|
|
|
|
|
|
@@ -290,6 +365,16 @@
|
|
|
projectHasMore: true,
|
|
|
sidebarCollapsed: false,
|
|
|
showSidebarFilters: true,
|
|
|
+ opsUserOptions: [],
|
|
|
+ opsUserLoading: false,
|
|
|
+ opsManagerUserId: '',
|
|
|
+ opsManagerOptions: [],
|
|
|
+ opsManagerLoading: false,
|
|
|
+ projectListDialogVisible: false,
|
|
|
+ projectListDialogLoading: false,
|
|
|
+ allProjects: [],
|
|
|
+ projectListDialogTotal: 0,
|
|
|
+ projectListDialogPage: 1,
|
|
|
queryForm: {
|
|
|
scopeType: 'my',
|
|
|
includeClosed: false,
|
|
|
@@ -319,6 +404,8 @@
|
|
|
this.projectHasMore = true
|
|
|
this.fetchProjects()
|
|
|
}, 300)
|
|
|
+ this.fetchOpsUsers()
|
|
|
+ this.fetchOpsManagerUsers()
|
|
|
},
|
|
|
activated() {
|
|
|
if (this.hasLoaded) {
|
|
|
@@ -454,6 +541,10 @@
|
|
|
params.keyWords = keyword
|
|
|
}
|
|
|
|
|
|
+ if (this.opsManagerUserId) {
|
|
|
+ params.opsManagerUserId = parseInt(this.opsManagerUserId)
|
|
|
+ }
|
|
|
+
|
|
|
const res = await deliveryProjectApi.getList(params)
|
|
|
const list = (res.data && res.data.list ? res.data.list : [])
|
|
|
.map(this.normalizeProject)
|
|
|
@@ -557,6 +648,11 @@
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
}
|
|
|
+ this.opsManagerUserId = ''
|
|
|
+ this.projectPageNum = 1
|
|
|
+ this.projects = []
|
|
|
+ this.projectHasMore = true
|
|
|
+ this.fetchProjects()
|
|
|
this.fetchData()
|
|
|
},
|
|
|
toggleSidebar() {
|
|
|
@@ -635,6 +731,71 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ async fetchOpsUsers() {
|
|
|
+ this.opsUserLoading = true
|
|
|
+ try {
|
|
|
+ const res = await userApi.getUsersByRoleKeys(['OperationsEngineer'], [])
|
|
|
+ const list = res.data?.list || res.data || []
|
|
|
+ this.opsUserOptions = Array.isArray(list) ? list : []
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取处理人列表失败:', error)
|
|
|
+ this.opsUserOptions = []
|
|
|
+ } finally {
|
|
|
+ this.opsUserLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async fetchOpsManagerUsers() {
|
|
|
+ this.opsManagerLoading = true
|
|
|
+ try {
|
|
|
+ const res = await userApi.getUsersByRoleKeys(['OperationsEngineer'], [])
|
|
|
+ const list = res.data?.list || res.data || []
|
|
|
+ this.opsManagerOptions = Array.isArray(list) ? list : []
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取运维负责人列表失败:', error)
|
|
|
+ this.opsManagerOptions = []
|
|
|
+ } finally {
|
|
|
+ this.opsManagerLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleOpsManagerFilterChange() {
|
|
|
+ this.projectPageNum = 1
|
|
|
+ this.projects = []
|
|
|
+ this.projectHasMore = true
|
|
|
+ this.fetchProjects()
|
|
|
+ },
|
|
|
+ async handleViewAllProjects() {
|
|
|
+ this.projectListDialogVisible = true
|
|
|
+ this.projectListDialogPage = 1
|
|
|
+ await this.fetchAllProjects()
|
|
|
+ },
|
|
|
+ async fetchAllProjects() {
|
|
|
+ this.projectListDialogLoading = true
|
|
|
+ try {
|
|
|
+ const params = {
|
|
|
+ pageNum: this.projectListDialogPage,
|
|
|
+ pageSize: 20,
|
|
|
+ productLine: '10,20,30,40,50,60',
|
|
|
+ sortField: 'contract_no',
|
|
|
+ sortOrder: 'desc',
|
|
|
+ projectStatus: '50',
|
|
|
+ }
|
|
|
+ const keyword = this.projectSearch.trim()
|
|
|
+ if (keyword) {
|
|
|
+ params.keyWords = keyword
|
|
|
+ }
|
|
|
+ if (this.opsManagerUserId) {
|
|
|
+ params.opsManagerUserId = parseInt(this.opsManagerUserId)
|
|
|
+ }
|
|
|
+ const res = await deliveryProjectApi.getList(params)
|
|
|
+ this.allProjects = res.data?.list || []
|
|
|
+ this.projectListDialogTotal = res.data?.total || 0
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取全部项目列表失败:', error)
|
|
|
+ this.allProjects = []
|
|
|
+ } finally {
|
|
|
+ this.projectListDialogLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|