fix:修改发起审批问题
This commit is contained in:
parent
280546c410
commit
b5f9ca5594
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -275,6 +275,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 流程主题 -->
|
||||||
|
<div class="approval-process-title">
|
||||||
|
<div class="description-label">
|
||||||
|
流程主题 <span class="required-mark">*</span>
|
||||||
|
</div>
|
||||||
|
<el-input
|
||||||
|
v-model="approvalFormData.processTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 说明 -->
|
<!-- 说明 -->
|
||||||
<div class="approval-description">
|
<div class="approval-description">
|
||||||
<div class="description-label">
|
<div class="description-label">
|
||||||
@ -449,6 +462,7 @@ export default {
|
|||||||
engineDetailInfo: null, // 机型详情信息(包含 modelName 和 projectNumber)
|
engineDetailInfo: null, // 机型详情信息(包含 modelName 和 projectNumber)
|
||||||
wholeEngineParamsRawData: [], // 存储"整车参数"的原始第三级数据(数组格式)
|
wholeEngineParamsRawData: [], // 存储"整车参数"的原始第三级数据(数组格式)
|
||||||
approvalFormData: {
|
approvalFormData: {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
},
|
},
|
||||||
approvalSubmitting: false, // 审批提交loading状态
|
approvalSubmitting: false, // 审批提交loading状态
|
||||||
@ -2604,6 +2618,7 @@ export default {
|
|||||||
this.isApprovalMode = true
|
this.isApprovalMode = true
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.approvalFormData = {
|
this.approvalFormData = {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
}
|
}
|
||||||
// 重置变更数据
|
// 重置变更数据
|
||||||
@ -2683,6 +2698,7 @@ export default {
|
|||||||
this.isApprovalMode = false
|
this.isApprovalMode = false
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.approvalFormData = {
|
this.approvalFormData = {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
}
|
}
|
||||||
// 重置变更数据
|
// 重置变更数据
|
||||||
@ -2733,6 +2749,13 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 流程主题校验
|
||||||
|
const processTitle = (this.approvalFormData.processTitle || '').trim()
|
||||||
|
if (!processTitle) {
|
||||||
|
this.$message.warning('请填写流程主题')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 构建 paramList:从当前版本数据中提取所有参数
|
// 构建 paramList:从当前版本数据中提取所有参数
|
||||||
const paramList = []
|
const paramList = []
|
||||||
const currentData = this.versionData[this.currentVersionId] || {}
|
const currentData = this.versionData[this.currentVersionId] || {}
|
||||||
@ -2779,6 +2802,7 @@ export default {
|
|||||||
modelId: this.detail.id,
|
modelId: this.detail.id,
|
||||||
paramList: paramList,
|
paramList: paramList,
|
||||||
comment: this.approvalFormData.description,
|
comment: this.approvalFormData.description,
|
||||||
|
processTitle: processTitle,
|
||||||
nodeList: nodeList,
|
nodeList: nodeList,
|
||||||
userId: getUserId()
|
userId: getUserId()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,6 +185,8 @@
|
|||||||
</x-vxe-table>
|
</x-vxe-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 流程主题 -->
|
||||||
|
|
||||||
<!-- 说明 -->
|
<!-- 说明 -->
|
||||||
<div class="approval-description">
|
<div class="approval-description">
|
||||||
<div class="description-label">
|
<div class="description-label">
|
||||||
@ -196,6 +198,15 @@
|
|||||||
:rows="2"
|
:rows="2"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
|
<div class="description-label">
|
||||||
|
流程主题 <span class="required-mark">*</span>
|
||||||
|
</div>
|
||||||
|
<el-input
|
||||||
|
v-model="approvalFormData.processTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 审批环节 -->
|
<!-- 审批环节 -->
|
||||||
@ -537,6 +548,7 @@ export default {
|
|||||||
importFileList: [],
|
importFileList: [],
|
||||||
selectedImportFile: null,
|
selectedImportFile: null,
|
||||||
approvalFormData: {
|
approvalFormData: {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
},
|
},
|
||||||
approvalSubmitting: false, // 审批提交loading状态
|
approvalSubmitting: false, // 审批提交loading状态
|
||||||
@ -591,18 +603,21 @@ export default {
|
|||||||
return this.versionList || []
|
return this.versionList || []
|
||||||
},
|
},
|
||||||
shouldShowButtonsNew() {
|
shouldShowButtonsNew() {
|
||||||
const status = this.currentStatus || (this.detail && this.detail.status) || ''
|
// 根据 GET_MODEL_DETAIL 接口返回的 status 控制发起审批按钮
|
||||||
|
const status = this.currentStatus || ''
|
||||||
return status === 'DRAFT' && this.isLatestVersion
|
return status === 'DRAFT' && this.isLatestVersion
|
||||||
},
|
},
|
||||||
// 检查是否应该显示按钮(发起审批、导入)
|
// 检查是否应该显示按钮(维护参数、导入)
|
||||||
shouldShowButtons() {
|
shouldShowButtons() {
|
||||||
// 检查状态是否为 DRAFT 或 COMPLETED,且当前版本是最新版本
|
// 根据 GET_MODEL_DETAIL 接口返回的 status 控制维护参数和导入按钮
|
||||||
const status = this.currentStatus || (this.detail && this.detail.status) || ''
|
// 检查状态是否为 DRAFT 或 COMPLETE,且当前版本是最新版本
|
||||||
|
const status = this.currentStatus || ''
|
||||||
return (status === 'DRAFT' || status === 'COMPLETE') && this.isLatestVersion
|
return (status === 'DRAFT' || status === 'COMPLETE') && this.isLatestVersion
|
||||||
},
|
},
|
||||||
// 检查是否应该显示维护参数按钮(在 DRAFT 或 COMPLETED 状态下都显示,且当前版本是最新版本)
|
// 检查是否应该显示维护参数按钮(在 DRAFT 或 COMPLETE 状态下都显示,且当前版本是最新版本)
|
||||||
shouldShowMaintainButton() {
|
shouldShowMaintainButton() {
|
||||||
const status = this.currentStatus || (this.detail && this.detail.status) || ''
|
// 根据 GET_MODEL_DETAIL 接口返回的 status 控制维护参数按钮
|
||||||
|
const status = this.currentStatus || ''
|
||||||
const baseCondition = (status === 'DRAFT' || status === 'COMPLETE') && this.isLatestVersion
|
const baseCondition = (status === 'DRAFT' || status === 'COMPLETE') && this.isLatestVersion
|
||||||
if (!baseCondition) {
|
if (!baseCondition) {
|
||||||
return false
|
return false
|
||||||
@ -1601,6 +1616,7 @@ export default {
|
|||||||
this.isApprovalMode = true
|
this.isApprovalMode = true
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.approvalFormData = {
|
this.approvalFormData = {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
}
|
}
|
||||||
// 重置审批环节
|
// 重置审批环节
|
||||||
@ -1660,6 +1676,7 @@ export default {
|
|||||||
this.originalPaginationForApproval = null
|
this.originalPaginationForApproval = null
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.approvalFormData = {
|
this.approvalFormData = {
|
||||||
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
}
|
}
|
||||||
// 重置审批环节
|
// 重置审批环节
|
||||||
@ -1701,6 +1718,11 @@ export default {
|
|||||||
this.$message.error('缺少模板ID,无法发起审批')
|
this.$message.error('缺少模板ID,无法发起审批')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const processTitle = (this.approvalFormData.processTitle || '').trim()
|
||||||
|
if (!processTitle) {
|
||||||
|
this.$message.warning('请填写流程主题')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const submitData = {
|
const submitData = {
|
||||||
templateRowId: templateRowId,
|
templateRowId: templateRowId,
|
||||||
@ -1708,6 +1730,7 @@ export default {
|
|||||||
reviewUsers: this.approvalWorkflowSteps[1].handlers,
|
reviewUsers: this.approvalWorkflowSteps[1].handlers,
|
||||||
countersignUsers: this.approvalWorkflowSteps[2].handlers,
|
countersignUsers: this.approvalWorkflowSteps[2].handlers,
|
||||||
approveUsers: this.approvalWorkflowSteps[3].handlers,
|
approveUsers: this.approvalWorkflowSteps[3].handlers,
|
||||||
|
processTitle: processTitle,
|
||||||
createBy: getUserId(),
|
createBy: getUserId(),
|
||||||
userId: getUserId()
|
userId: getUserId()
|
||||||
}
|
}
|
||||||
@ -2334,6 +2357,10 @@ export default {
|
|||||||
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 从接口返回的数据中获取状态(优先从 resp.data 中获取,其次从 result 中获取)
|
||||||
|
const statusFromData = resp && resp.data ? (resp.data.status || resp.data.state || '') : ''
|
||||||
|
const statusFromResult = result && result.length > 0 ? (result[0].status || result[0].state || '') : ''
|
||||||
|
this.currentStatus = statusFromData || statusFromResult || ''
|
||||||
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
||||||
this.$set(this.pagination, 'total', totalNumber)
|
this.$set(this.pagination, 'total', totalNumber)
|
||||||
})
|
})
|
||||||
@ -2446,10 +2473,12 @@ export default {
|
|||||||
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 从接口返回的数据中获取状态(优先从 resp.data 中获取,其次从 result 中获取)
|
// 从 GET_MODEL_DETAIL 接口返回的数据中获取状态(优先从 resp.data 中获取,其次从 result 中获取)
|
||||||
const statusFromData = resp && resp.data ? (resp.data.status || resp.data.state || '') : ''
|
const statusFromData = resp && resp.data ? (resp.data.status || resp.data.state || '') : ''
|
||||||
const statusFromResult = result && result.length > 0 ? (result[0].status || result[0].state || '') : ''
|
const statusFromResult = result && result.length > 0 ? (result[0].status || result[0].state || '') : ''
|
||||||
|
// 更新 currentStatus,用于控制维护参数和发起审批按钮的显示
|
||||||
this.currentStatus = statusFromData || statusFromResult || ''
|
this.currentStatus = statusFromData || statusFromResult || ''
|
||||||
|
console.log('从 GET_MODEL_DETAIL 接口获取到的状态:', this.currentStatus)
|
||||||
|
|
||||||
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
||||||
this.$set(this.pagination, 'total', totalNumber)
|
this.$set(this.pagination, 'total', totalNumber)
|
||||||
|
|||||||
@ -190,24 +190,20 @@
|
|||||||
<!-- 配置部门模式 -->
|
<!-- 配置部门模式 -->
|
||||||
<template v-if="personConfigFormData.configType === 'department'">
|
<template v-if="personConfigFormData.configType === 'department'">
|
||||||
<el-form-item label="责任部门:" prop="department">
|
<el-form-item label="责任部门:" prop="department">
|
||||||
<el-cascader
|
<el-input
|
||||||
ref="departmentCascader"
|
v-model="selectedDepartmentName"
|
||||||
v-model="personConfigFormData.department"
|
placeholder="请选择责任部门"
|
||||||
:options="departmentList"
|
readonly
|
||||||
:props="{
|
|
||||||
multiple: true,
|
|
||||||
checkStrictly: true,
|
|
||||||
value: 'id',
|
|
||||||
label: 'name',
|
|
||||||
children: 'children',
|
|
||||||
emitPath: true
|
|
||||||
}"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择责任部门(可多选)"
|
|
||||||
clearable
|
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="handlePersonDepartmentChange"
|
@click.native="handleOpenDepartmentDialog"
|
||||||
/>
|
>
|
||||||
|
<i
|
||||||
|
slot="suffix"
|
||||||
|
class="el-input__icon el-icon-search"
|
||||||
|
style="cursor: pointer;"
|
||||||
|
@click.stop="handleOpenDepartmentDialog"
|
||||||
|
></i>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<!-- 配置人员模式 -->
|
<!-- 配置人员模式 -->
|
||||||
@ -263,6 +259,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 部门选择弹窗(与 managerData 一致) -->
|
||||||
|
<el-dialog
|
||||||
|
title="选择责任部门"
|
||||||
|
:visible.sync="departmentDialogVisible"
|
||||||
|
width="500px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
@close="handleDepartmentDialogClose"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="departmentTreeFilterText"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入部门名称进行搜索"
|
||||||
|
clearable
|
||||||
|
class="department-tree-search"
|
||||||
|
>
|
||||||
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||||
|
</el-input>
|
||||||
|
<el-tree
|
||||||
|
ref="departmentTree"
|
||||||
|
:data="departmentList"
|
||||||
|
:props="{ children: 'children', label: 'name' }"
|
||||||
|
node-key="id"
|
||||||
|
:filter-node-method="filterDepartmentNode"
|
||||||
|
highlight-current
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
class="department-tree"
|
||||||
|
@node-click="handleDepartmentNodeClick"
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleDepartmentDialogClose">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" :disabled="!selectedDepartmentId" @click="handleDepartmentDialogConfirm">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 新增/编辑角色对话框 -->
|
<!-- 新增/编辑角色对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="addRoleMode === 'add' ? '新增角色' : '编辑角色'"
|
:title="addRoleMode === 'add' ? '新增角色' : '编辑角色'"
|
||||||
@ -377,6 +412,12 @@ export default {
|
|||||||
},
|
},
|
||||||
personOptions: [], // 人员选项列表
|
personOptions: [], // 人员选项列表
|
||||||
personSearchLoading: false, // 人员搜索loading状态
|
personSearchLoading: false, // 人员搜索loading状态
|
||||||
|
// 部门选择弹窗(比照 managerData)
|
||||||
|
departmentDialogVisible: false,
|
||||||
|
departmentTreeFilterText: '',
|
||||||
|
selectedDepartmentId: '',
|
||||||
|
selectedDepartmentName: '',
|
||||||
|
selectedDepartmentNode: null,
|
||||||
personConfigFormRules: {
|
personConfigFormRules: {
|
||||||
department: [
|
department: [
|
||||||
{
|
{
|
||||||
@ -464,6 +505,48 @@ export default {
|
|||||||
console.error('获取用户自身角色失败:', err)
|
console.error('获取用户自身角色失败:', err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 打开部门选择弹窗(与 managerData 逻辑一致)
|
||||||
|
handleOpenDepartmentDialog() {
|
||||||
|
// 如果已有选中,保持高亮
|
||||||
|
if (this.selectedDepartmentId && this.$refs.departmentTree) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.departmentTree.setCurrentKey(this.selectedDepartmentId)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.departmentTreeFilterText = ''
|
||||||
|
this.departmentDialogVisible = true
|
||||||
|
},
|
||||||
|
handleDepartmentDialogClose() {
|
||||||
|
this.departmentDialogVisible = false
|
||||||
|
this.departmentTreeFilterText = ''
|
||||||
|
// 关闭时保持当前选择
|
||||||
|
},
|
||||||
|
handleDepartmentNodeClick(data) {
|
||||||
|
this.selectedDepartmentId = data.id
|
||||||
|
this.selectedDepartmentName = this.getDepartmentPathName(data.id) || data.name
|
||||||
|
this.selectedDepartmentNode = data
|
||||||
|
},
|
||||||
|
handleDepartmentDialogConfirm() {
|
||||||
|
if (!this.selectedDepartmentId) {
|
||||||
|
this.$message.warning('请选择责任部门')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.personConfigFormData.selectDeptIds = [this.selectedDepartmentId]
|
||||||
|
this.personConfigFormData.department = this.selectedDepartmentId
|
||||||
|
this.personConfigFormData.selectDeptId = this.selectedDepartmentId
|
||||||
|
this.personConfigFormData.selectDeptName = this.selectedDepartmentName
|
||||||
|
this.departmentDialogVisible = false
|
||||||
|
// 清除表单验证
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.personConfigForm) {
|
||||||
|
this.$refs.personConfigForm.clearValidate('department')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
filterDepartmentNode(value, data) {
|
||||||
|
if (!value) return true
|
||||||
|
return (data.name || '').toLowerCase().includes(value.toLowerCase())
|
||||||
|
},
|
||||||
// 验证权限
|
// 验证权限
|
||||||
validatePermissions(rule, value, callback) {
|
validatePermissions(rule, value, callback) {
|
||||||
// 检查是否有零部件节点被选中
|
// 检查是否有零部件节点被选中
|
||||||
@ -938,37 +1021,30 @@ export default {
|
|||||||
|
|
||||||
// 处理部门数组:格式为 ["deptName-deptId"]
|
// 处理部门数组:格式为 ["deptName-deptId"]
|
||||||
if (deptArray && deptArray.length > 0) {
|
if (deptArray && deptArray.length > 0) {
|
||||||
|
// 采用单选部门逻辑(与 managerData 保持一致)
|
||||||
const deptIds = []
|
const deptIds = []
|
||||||
const deptPaths = []
|
let deptNameFromData = ''
|
||||||
|
|
||||||
deptArray.forEach((deptStr) => {
|
deptArray.forEach((deptStr) => {
|
||||||
if (typeof deptStr === 'string' && deptStr.includes('-')) {
|
if (typeof deptStr === 'string' && deptStr.includes('-')) {
|
||||||
// 拆分格式:deptName-deptId
|
// 拆分格式:deptName-deptId
|
||||||
const parts = deptStr.split('-')
|
const parts = deptStr.split('-')
|
||||||
if (parts.length >= 2) {
|
if (parts.length >= 2) {
|
||||||
// 最后一部分是 deptId,前面所有部分组合是 deptName
|
|
||||||
const deptId = parts[parts.length - 1]
|
const deptId = parts[parts.length - 1]
|
||||||
// deptName 暂时保留,可能用于日志或调试
|
deptNameFromData = parts.slice(0, -1).join('-')
|
||||||
// const deptName = parts.slice(0, -1).join('-')
|
deptIds.push(deptId)
|
||||||
|
|
||||||
// 查找部门在部门树中的路径
|
|
||||||
const deptPath = this.findDepartmentPath(deptId)
|
|
||||||
if (deptPath && deptPath.length > 0) {
|
|
||||||
deptPaths.push(deptPath)
|
|
||||||
deptIds.push(deptId)
|
|
||||||
} else {
|
|
||||||
// 如果找不到路径,直接使用 deptId
|
|
||||||
deptIds.push(deptId)
|
|
||||||
// 尝试构建一个简单的路径(可能需要根据实际情况调整)
|
|
||||||
deptPaths.push([deptId])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (deptIds.length > 0) {
|
if (deptIds.length > 0) {
|
||||||
this.personConfigFormData.selectDeptIds = deptIds
|
const deptId = deptIds[0]
|
||||||
this.personConfigFormData.department = deptPaths
|
this.personConfigFormData.selectDeptIds = [deptId]
|
||||||
|
this.selectedDepartmentId = deptId
|
||||||
|
// 优先用树路径名称
|
||||||
|
const pathName = this.getDepartmentPathName(deptId)
|
||||||
|
this.selectedDepartmentName = pathName || deptNameFromData
|
||||||
|
this.personConfigFormData.department = deptId
|
||||||
// 如果只有部门数据,选择配置部门模式
|
// 如果只有部门数据,选择配置部门模式
|
||||||
if (!personArray || personArray.length === 0) {
|
if (!personArray || personArray.length === 0) {
|
||||||
this.personConfigFormData.configType = 'department'
|
this.personConfigFormData.configType = 'department'
|
||||||
@ -976,13 +1052,17 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.personConfigFormData.selectDeptIds = []
|
this.personConfigFormData.selectDeptIds = []
|
||||||
this.personConfigFormData.department = []
|
this.personConfigFormData.department = ''
|
||||||
|
this.selectedDepartmentId = ''
|
||||||
|
this.selectedDepartmentName = ''
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.personOptions = []
|
this.personOptions = []
|
||||||
this.personConfigFormData.person = []
|
this.personConfigFormData.person = []
|
||||||
this.personConfigFormData.selectDeptIds = []
|
this.personConfigFormData.selectDeptIds = []
|
||||||
this.personConfigFormData.department = []
|
this.personConfigFormData.department = ''
|
||||||
|
this.selectedDepartmentId = ''
|
||||||
|
this.selectedDepartmentName = ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
@ -1068,48 +1148,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 处理部门选择变化
|
// 处理部门选择变化
|
||||||
handlePersonDepartmentChange(value) {
|
handlePersonDepartmentChange(value) {
|
||||||
if (this.personConfigFormData.configType === 'department') {
|
// 已使用树形弹窗选择部门,此方法不再使用
|
||||||
// 配置部门模式:value 是数组,每个元素是级联路径数组(多选)
|
|
||||||
// 例如:[[id1, id2], [id3, id4]] 表示选中了两个部门
|
|
||||||
if (value && Array.isArray(value) && value.length > 0) {
|
|
||||||
// 提取所有选中部门的最后一级ID,存入数组
|
|
||||||
this.personConfigFormData.selectDeptIds = value.map(path => {
|
|
||||||
// path 是级联路径数组,取最后一级作为部门ID
|
|
||||||
if (Array.isArray(path) && path.length > 0) {
|
|
||||||
return path[path.length - 1]
|
|
||||||
}
|
|
||||||
// 如果 path 不是数组,可能是直接的ID
|
|
||||||
return path
|
|
||||||
}).filter(id => id) // 过滤掉空值
|
|
||||||
} else {
|
|
||||||
this.personConfigFormData.selectDeptIds = []
|
|
||||||
}
|
|
||||||
console.log('配置部门模式 - 选中的部门值:', value)
|
|
||||||
console.log('配置部门模式 - 选中的部门ID数组:', this.personConfigFormData.selectDeptIds)
|
|
||||||
// 触发表单验证
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.personConfigForm) {
|
|
||||||
this.$refs.personConfigForm.validateField('department')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 配置人员模式:value 是单个级联路径数组(单选)
|
|
||||||
if (value && Array.isArray(value) && value.length > 0) {
|
|
||||||
// 获取最后一级的id
|
|
||||||
this.personConfigFormData.selectDeptId = value[value.length - 1]
|
|
||||||
// 查找部门路径名称
|
|
||||||
this.personConfigFormData.selectDeptName = this.getDepartmentPathName(this.personConfigFormData.selectDeptId)
|
|
||||||
// 清空人员选择
|
|
||||||
this.personConfigFormData.person = []
|
|
||||||
this.personOptions = []
|
|
||||||
} else {
|
|
||||||
// 清空时重置
|
|
||||||
this.personConfigFormData.selectDeptId = ''
|
|
||||||
this.personConfigFormData.selectDeptName = ''
|
|
||||||
this.personConfigFormData.person = []
|
|
||||||
this.personOptions = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 远程搜索人员(用于 el-select)
|
// 远程搜索人员(用于 el-select)
|
||||||
queryPersonByDepartment(queryString) {
|
queryPersonByDepartment(queryString) {
|
||||||
@ -1285,17 +1324,11 @@ export default {
|
|||||||
if (this.personConfigFormData.configType === 'department') {
|
if (this.personConfigFormData.configType === 'department') {
|
||||||
// 配置部门模式:传部门ID数组
|
// 配置部门模式:传部门ID数组
|
||||||
isDept = 1
|
isDept = 1
|
||||||
// 优先使用 selectDeptIds,如果没有则从 department 中提取
|
// 使用单选的部门ID(与 managerData 逻辑一致)
|
||||||
if (this.personConfigFormData.selectDeptIds && this.personConfigFormData.selectDeptIds.length > 0) {
|
if (this.selectedDepartmentId) {
|
||||||
|
userOrDeptId = [this.selectedDepartmentId]
|
||||||
|
} else if (this.personConfigFormData.selectDeptIds && this.personConfigFormData.selectDeptIds.length > 0) {
|
||||||
userOrDeptId = this.personConfigFormData.selectDeptIds
|
userOrDeptId = this.personConfigFormData.selectDeptIds
|
||||||
} else if (this.personConfigFormData.department && Array.isArray(this.personConfigFormData.department) && this.personConfigFormData.department.length > 0) {
|
|
||||||
// 如果 selectDeptIds 为空,从 department 中提取
|
|
||||||
userOrDeptId = this.personConfigFormData.department.map(path => {
|
|
||||||
if (Array.isArray(path) && path.length > 0) {
|
|
||||||
return path[path.length - 1]
|
|
||||||
}
|
|
||||||
return path
|
|
||||||
}).filter(id => id)
|
|
||||||
} else {
|
} else {
|
||||||
userOrDeptId = []
|
userOrDeptId = []
|
||||||
}
|
}
|
||||||
@ -1366,6 +1399,9 @@ export default {
|
|||||||
roleId: '',
|
roleId: '',
|
||||||
roleName: ''
|
roleName: ''
|
||||||
}
|
}
|
||||||
|
this.selectedDepartmentId = ''
|
||||||
|
this.selectedDepartmentName = ''
|
||||||
|
this.selectedDepartmentNode = null
|
||||||
this.personOptions = []
|
this.personOptions = []
|
||||||
// 清除定时器和请求
|
// 清除定时器和请求
|
||||||
if (this.personSearchTimer) {
|
if (this.personSearchTimer) {
|
||||||
|
|||||||
@ -84,7 +84,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<el-button type="primary" @click="handleCreate">新增</el-button>
|
<el-button type="primary" @click="handleCreate">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
<!-- <el-button @click="handleDownloadTemplate">下载模板</el-button> -->
|
<!-- <el-button @click="handleDownloadTemplate">下载模板</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="page-data-list">
|
<div class="page-data-list">
|
||||||
@ -111,7 +113,9 @@
|
|||||||
v-for="(colConfig, index) in tableConfig.colConfigs"
|
v-for="(colConfig, index) in tableConfig.colConfigs"
|
||||||
v-slot:[colConfig.customHeadSlot]="{ column }"
|
v-slot:[colConfig.customHeadSlot]="{ column }"
|
||||||
>
|
>
|
||||||
<div v-if="colConfig.customHeadSlot" :key="index"> {{ column }} {{ colConfig }} </div>
|
<div v-if="colConfig.customHeadSlot" :key="index">
|
||||||
|
{{ column }} {{ colConfig }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template
|
<template
|
||||||
@ -122,52 +126,60 @@
|
|||||||
<span
|
<span
|
||||||
v-if="row[colConfig.prop] === 'APPROVING'"
|
v-if="row[colConfig.prop] === 'APPROVING'"
|
||||||
style="background: #E6A23C; padding: 4px 8px; color: white; border-radius: 20px;"
|
style="background: #E6A23C; padding: 4px 8px; color: white; border-radius: 20px;"
|
||||||
>审核中</span
|
|
||||||
>
|
>
|
||||||
|
审核中
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else-if="row[colConfig.prop] === 'COMPLETE'"
|
v-else-if="row[colConfig.prop] === 'COMPLETE'"
|
||||||
style="background: #67C23A; padding: 4px 8px; color: white; border-radius: 20px;"
|
style="background: #67C23A; padding: 4px 8px; color: white; border-radius: 20px;"
|
||||||
>已完成</span
|
|
||||||
>
|
>
|
||||||
|
已完成
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else-if="row[colConfig.prop] === 'DRAFT'"
|
v-else-if="row[colConfig.prop] === 'DRAFT'"
|
||||||
style="background: #909399; padding: 4px 8px; color: white; border-radius: 20px;"
|
style="background: #909399; padding: 4px 8px; color: white; border-radius: 20px;"
|
||||||
>草稿</span
|
|
||||||
>
|
>
|
||||||
|
草稿
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else-if="row[colConfig.prop] === 'REJECTED'"
|
v-else-if="row[colConfig.prop] === 'REJECTED'"
|
||||||
style="background: #F56C6C; padding: 4px 8px; color: white; border-radius: 20px;"
|
style="background: #F56C6C; padding: 4px 8px; color: white; border-radius: 20px;"
|
||||||
>已拒绝</span
|
|
||||||
>
|
>
|
||||||
|
已拒绝
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
style="background: #909399; padding: 4px 8px; color: white; border-radius: 20px;"
|
style="background: #909399; padding: 4px 8px; color: white; border-radius: 20px;"
|
||||||
>-</span
|
|
||||||
>
|
>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleRowView(row)"
|
@click.stop="handleRowView(row)"
|
||||||
>查看</a
|
|
||||||
>
|
>
|
||||||
|
查看
|
||||||
|
</a>
|
||||||
<span style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<a
|
<a
|
||||||
v-if="false"
|
v-if="false"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
>修改</a
|
|
||||||
>
|
>
|
||||||
|
修改
|
||||||
|
</a>
|
||||||
<span style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.status === 'APPROVING'"
|
v-if="row.status === 'APPROVING'"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleApprove(row)"
|
@click.stop="handleApprove(row)"
|
||||||
>审批</a
|
|
||||||
>
|
>
|
||||||
|
审批
|
||||||
|
</a>
|
||||||
<span
|
<span
|
||||||
v-if="row.status === 'APPROVING'"
|
v-if="row.status === 'APPROVING'"
|
||||||
style="width: 6px; display: inline-block"
|
style="width: 6px; display: inline-block"
|
||||||
@ -177,8 +189,9 @@
|
|||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleLaunch(row)"
|
@click.stop="handleLaunch(row)"
|
||||||
>发起</a
|
|
||||||
>
|
>
|
||||||
|
发起
|
||||||
|
</a>
|
||||||
<span
|
<span
|
||||||
v-if="!row.status || row.status === '' || row.status === 'DRAFT'"
|
v-if="!row.status || row.status === '' || row.status === 'DRAFT'"
|
||||||
style="width: 6px; display: inline-block"
|
style="width: 6px; display: inline-block"
|
||||||
@ -188,8 +201,9 @@
|
|||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleRestart(row)"
|
@click.stop="handleRestart(row)"
|
||||||
>重新发起</a
|
|
||||||
>
|
>
|
||||||
|
重新发起
|
||||||
|
</a>
|
||||||
<span
|
<span
|
||||||
v-if="row.status === 'REJECTED'"
|
v-if="row.status === 'REJECTED'"
|
||||||
style="width: 6px; display: inline-block"
|
style="width: 6px; display: inline-block"
|
||||||
@ -199,8 +213,9 @@
|
|||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleDownload(row)"
|
@click.stop="handleDownload(row)"
|
||||||
>下载</a
|
|
||||||
>
|
>
|
||||||
|
下载
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -344,8 +359,12 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleDialogClose">取消</el-button>
|
<el-button @click="handleDialogClose">
|
||||||
<el-button type="primary" @click="handleSubmit">确定</el-button>
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="handleSubmit">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@ -359,6 +378,18 @@
|
|||||||
@close="handleLaunchDialogClose"
|
@close="handleLaunchDialogClose"
|
||||||
>
|
>
|
||||||
<div class="dialog-body-wrapper">
|
<div class="dialog-body-wrapper">
|
||||||
|
<div class="approval-process-title">
|
||||||
|
<div class="description-label">
|
||||||
|
流程主题 <span class="required-mark">*</span>
|
||||||
|
</div>
|
||||||
|
<el-input
|
||||||
|
v-model="launchProcessTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="approval-workflow">
|
<div class="approval-workflow">
|
||||||
<div class="workflow-title">
|
<div class="workflow-title">
|
||||||
审批环节
|
审批环节
|
||||||
@ -414,8 +445,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleLaunchDialogClose">取消</el-button>
|
<el-button @click="handleLaunchDialogClose">
|
||||||
<el-button type="primary" :loading="launching" @click="handleLaunchSubmit">确定</el-button>
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" :loading="launching" @click="handleLaunchSubmit">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@ -503,6 +538,7 @@ export default {
|
|||||||
currentEditRow: null, // 当前要修改的行数据
|
currentEditRow: null, // 当前要修改的行数据
|
||||||
launchDialogVisible: false, // 发起弹窗显示状态
|
launchDialogVisible: false, // 发起弹窗显示状态
|
||||||
currentLaunchRow: null, // 当前要发起的行数据
|
currentLaunchRow: null, // 当前要发起的行数据
|
||||||
|
launchProcessTitle: '',
|
||||||
launchWorkflowSteps: [
|
launchWorkflowSteps: [
|
||||||
{
|
{
|
||||||
name: '校对',
|
name: '校对',
|
||||||
@ -717,6 +753,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleLaunch(row) {
|
handleLaunch(row) {
|
||||||
this.currentLaunchRow = row
|
this.currentLaunchRow = row
|
||||||
|
this.launchProcessTitle = row.title || ''
|
||||||
// 重置审批环节
|
// 重置审批环节
|
||||||
this.launchWorkflowSteps = [
|
this.launchWorkflowSteps = [
|
||||||
{
|
{
|
||||||
@ -746,6 +783,7 @@ export default {
|
|||||||
handleLaunchDialogClose() {
|
handleLaunchDialogClose() {
|
||||||
this.launchDialogVisible = false
|
this.launchDialogVisible = false
|
||||||
this.currentLaunchRow = null
|
this.currentLaunchRow = null
|
||||||
|
this.launchProcessTitle = ''
|
||||||
// 重置审批环节
|
// 重置审批环节
|
||||||
this.launchWorkflowSteps = [
|
this.launchWorkflowSteps = [
|
||||||
{
|
{
|
||||||
@ -787,6 +825,13 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 流程主题必填
|
||||||
|
const processTitle = (this.launchProcessTitle || '').trim()
|
||||||
|
if (!processTitle) {
|
||||||
|
this.$message.warning('请填写流程主题')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const reportId = this.currentLaunchRow.reportId || this.currentLaunchRow.id
|
const reportId = this.currentLaunchRow.reportId || this.currentLaunchRow.id
|
||||||
if (!reportId) {
|
if (!reportId) {
|
||||||
this.$message.error('缺少报告ID')
|
this.$message.error('缺少报告ID')
|
||||||
@ -797,6 +842,7 @@ export default {
|
|||||||
const submitData = {
|
const submitData = {
|
||||||
reportId: reportId,
|
reportId: reportId,
|
||||||
userId: getUserId(),
|
userId: getUserId(),
|
||||||
|
processTitle: processTitle,
|
||||||
proofreadUsers: this.launchWorkflowSteps[0].handlers,
|
proofreadUsers: this.launchWorkflowSteps[0].handlers,
|
||||||
reviewUsers: this.launchWorkflowSteps[1].handlers,
|
reviewUsers: this.launchWorkflowSteps[1].handlers,
|
||||||
countersignUsers: [],
|
countersignUsers: [],
|
||||||
|
|||||||
@ -165,12 +165,12 @@ export default {
|
|||||||
},
|
},
|
||||||
handleRowView(row) {
|
handleRowView(row) {
|
||||||
// 根据流程主题判断打开哪种页面
|
// 根据流程主题判断打开哪种页面
|
||||||
const processTitle = row.processTitle || ''
|
const dataType = row.dataType || ''
|
||||||
const isFillParameterMode = processTitle === '数据维护'
|
const isFillParameterMode = dataType === '数据维护'
|
||||||
const isResponsibleDispatchMode = processTitle === '任务分解'
|
const isResponsibleDispatchMode = dataType === '任务分解'
|
||||||
const isInApprovalMode = processTitle === '数据审批'
|
const isInApprovalMode = dataType === '数据审批'
|
||||||
const isModelCheck = processTitle === '模板审核'
|
const isModelCheck = dataType === '模板审核'
|
||||||
const isReportCheck = processTitle === '对标报告审核'
|
const isReportCheck = dataType === '对标报告审核'
|
||||||
|
|
||||||
// 设置引擎型号信息
|
// 设置引擎型号信息
|
||||||
this.currentModel = row.modelName || row.productFullName || ''
|
this.currentModel = row.modelName || row.productFullName || ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user