|
@@ -190,6 +190,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 表格字段配置
|
|
// 表格字段配置
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ { prop: 'id', label: '主键', width: 0 ,hidden: true},
|
|
|
{ prop: 'xingNengZhiBia', label: '性能指标', tags: [], width: 120 },
|
|
{ prop: 'xingNengZhiBia', label: '性能指标', tags: [], width: 120 },
|
|
|
{
|
|
{
|
|
|
prop: 'fangAnLeiXing',
|
|
prop: 'fangAnLeiXing',
|
|
@@ -241,9 +242,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 加载数据
|
|
// 加载数据
|
|
|
- loadData() {
|
|
|
|
|
|
|
+ async loadData() {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
- queryExperimental(this.getSearchFormData())
|
|
|
|
|
|
|
+ const searchparam = await this.getSearchFormData()
|
|
|
|
|
+ queryExperimental(searchparam)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
ActionUtils.handleListData(this, res.data)
|
|
ActionUtils.handleListData(this, res.data)
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -255,76 +257,48 @@ export default {
|
|
|
/**
|
|
/**
|
|
|
* 获取格式化参数
|
|
* 获取格式化参数
|
|
|
*/
|
|
*/
|
|
|
- getSearchFormData() {
|
|
|
|
|
- const searchParam = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
|
|
- searchParam['Q^xing_neng_zhi_bia^SL'] = this.searchFormData.xingNengZhiBiao
|
|
|
|
|
- searchParam['Q^shi_yan_xiang_mu_^S'] = this.searchFormData.shiYanXiangMu
|
|
|
|
|
- searchParam['Q^shi_yan_fang_fa_^S'] = this.searchFormData.shiYanFangFa
|
|
|
|
|
-
|
|
|
|
|
- const userRole = this.$store.getters.userInfo.role || []
|
|
|
|
|
- const jsfzrFlag = userRole.some(role => role.alias === 'jsfzr')
|
|
|
|
|
- const zcFlag = userRole.some(role => role.alias === 'zhsfzr')
|
|
|
|
|
- const isSystemAdmin = userRole.some(role => role.alias === 'xtgljs')
|
|
|
|
|
- // 如果用户同时拥有专业组组长和技术负责人身份,视为系统管理员
|
|
|
|
|
- const isMultiRoleAdmin = jsfzrFlag && zcFlag
|
|
|
|
|
-
|
|
|
|
|
- // 系统管理员或多身份用户 - 看到所有已编制\已审核数据,不限制部门
|
|
|
|
|
- if (isSystemAdmin || isMultiRoleAdmin) {
|
|
|
|
|
- return this.buildDefaultSearchParams(searchParam)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 技术负责人,看到已审核的数据
|
|
|
|
|
- if (jsfzrFlag) {
|
|
|
|
|
- searchParam['Q^shi_fou_guo_shen_^S'] = '已审核'
|
|
|
|
|
- return ActionUtils.formatParams(searchParam, this.pagination, this.sorts)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 专业组组长,看到自己部门已编制的数据
|
|
|
|
|
- if (zcFlag) {
|
|
|
|
|
- searchParam['Q^shi_fou_guo_shen_^S'] = '已编制'
|
|
|
|
|
|
|
+ async getSearchFormData() {
|
|
|
|
|
+ const searchParam = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
|
|
+ searchParam['Q^xing_neng_zhi_bia^SL'] = this.searchFormData.xingNengZhiBiao
|
|
|
|
|
+ searchParam['Q^shi_yan_xiang_mu_^S'] = this.searchFormData.shiYanXiangMu
|
|
|
|
|
+ searchParam['Q^shi_yan_fang_fa_^S'] = this.searchFormData.shiYanFangFa
|
|
|
|
|
|
|
|
- const positions = this.$store.getters.userInfo.positions || []
|
|
|
|
|
- if (positions.length > 0) {
|
|
|
|
|
- // 动态构建部门查询条件
|
|
|
|
|
- const departmentParams = positions.map((position, index) => ({
|
|
|
|
|
- key: 'Q^bian_zhi_bu_men_^S',
|
|
|
|
|
- value: position.id,
|
|
|
|
|
- param: `bumen${index + 1}`
|
|
|
|
|
- }))
|
|
|
|
|
-
|
|
|
|
|
- // 构建查询参数
|
|
|
|
|
- const parameters = [
|
|
|
|
|
- {
|
|
|
|
|
- parameters: [
|
|
|
|
|
- {
|
|
|
|
|
- key: 'Q^shi_fou_guo_shen_^S',
|
|
|
|
|
- value: '已编制',
|
|
|
|
|
- param: 'status'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- relation: 'OR',
|
|
|
|
|
- parameters: departmentParams
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ const userRole = this.$store.getters.userInfo.role || []
|
|
|
|
|
+ const user = this.$store.getters.userInfo.user || []
|
|
|
|
|
+ const jsfzrFlag = userRole.some(role => role.alias === 'jsfzr')
|
|
|
|
|
+ const zcFlag = userRole.some(role => role.alias === 'zhsfzr')
|
|
|
|
|
+ const isSystemAdmin = userRole.some(role => role.alias === 'xtgljs')
|
|
|
|
|
+
|
|
|
|
|
+ // 系统管理员 返回已编制/已审核数据
|
|
|
|
|
+ if (isSystemAdmin) {
|
|
|
|
|
+ return this.buildDefaultSearchParams(searchParam)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 使用 await 等待异步结果
|
|
|
|
|
+ const res = await this.$common.request('query', {
|
|
|
|
|
+ key: 'xnyzhqdb',
|
|
|
|
|
+ params: [user.id]
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- // 处理搜索栏的其他查询条件
|
|
|
|
|
- this.handleAdditionalSearchParams(searchParam, parameters)
|
|
|
|
|
|
|
+ const bizKeys = res.variables.data.map(item => item.BIZ_KEY_).join(',')
|
|
|
|
|
+ searchParam['Q^id_^SIN'] = bizKeys
|
|
|
|
|
|
|
|
- return {
|
|
|
|
|
- parameters: parameters,
|
|
|
|
|
- ...ActionUtils.formatParams(null, this.pagination, this.sorts)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return ActionUtils.formatParams(
|
|
|
|
|
+ searchParam,
|
|
|
|
|
+ this.pagination,
|
|
|
|
|
+ this.sorts
|
|
|
|
|
+ )
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取待办列表失败:', error)
|
|
|
|
|
+ // 出错时返回默认参数
|
|
|
|
|
+ return ActionUtils.formatParams(
|
|
|
|
|
+ searchParam,
|
|
|
|
|
+ this.pagination,
|
|
|
|
|
+ this.sorts
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 如果没有部门信息,直接返回基础参数
|
|
|
|
|
- return ActionUtils.formatParams(searchParam, this.pagination, this.sorts)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 其他用户 - 看到所有已编制\已审核数据,不限制部门
|
|
|
|
|
- return this.buildDefaultSearchParams(searchParam)
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
// 处理额外的搜索参数
|
|
// 处理额外的搜索参数
|
|
|
handleAdditionalSearchParams(searchParam, parameters) {
|
|
handleAdditionalSearchParams(searchParam, parameters) {
|
|
@@ -354,9 +328,9 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// 构建默认搜索参数(管理员和其他用户)
|
|
// 构建默认搜索参数(管理员和其他用户)
|
|
|
buildDefaultSearchParams(searchParam) {
|
|
buildDefaultSearchParams(searchParam) {
|
|
|
|
|
+
|
|
|
const parameters = [
|
|
const parameters = [
|
|
|
{
|
|
{
|
|
|
parameters: [
|
|
parameters: [
|
|
@@ -380,6 +354,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 处理搜索栏的查询条件
|
|
// 处理搜索栏的查询条件
|
|
|
if (Object.keys(searchParam).length) {
|
|
if (Object.keys(searchParam).length) {
|
|
|
this.handleAdditionalSearchParams(searchParam, parameters)
|
|
this.handleAdditionalSearchParams(searchParam, parameters)
|
|
@@ -390,6 +365,7 @@ export default {
|
|
|
...ActionUtils.formatParams(null, this.pagination, this.sorts)
|
|
...ActionUtils.formatParams(null, this.pagination, this.sorts)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 处理分页事件
|
|
* 处理分页事件
|
|
|
*/
|
|
*/
|