fix:修改
This commit is contained in:
parent
78937e0ada
commit
c37ce897f2
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
@ -359,7 +359,8 @@ export default {
|
|||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
const request = {
|
const request = {
|
||||||
...api.HANDLE_APPROVAL,
|
...api.HANDLE_APPROVAL,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
@ -367,11 +368,19 @@ export default {
|
|||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
this.handleApprovalDialogClose()
|
this.handleApprovalDialogClose()
|
||||||
this.loadData() // 重新加载数据
|
this.loadData() // 重新加载数据
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '审批提交成功'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
console.error('审批提交失败:', err)
|
console.error('审批提交失败:', err)
|
||||||
this.handleApprovalDialogClose()
|
this.handleApprovalDialogClose()
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '审批提交失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
canRecall(row) {
|
canRecall(row) {
|
||||||
@ -388,17 +397,26 @@ export default {
|
|||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
const request = {
|
const request = {
|
||||||
...api.RETURN_APPROVAL,
|
...api.RETURN_APPROVAL,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
this.loadData() // 重新加载数据
|
this.loadData() // 重新加载数据
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '审批提交成功'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
console.error('审批提交失败:', err)
|
console.error('审批提交失败:', err)
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '审批提交失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
currentChange(currentPage) {
|
currentChange(currentPage) {
|
||||||
|
|||||||
@ -616,12 +616,17 @@ export default {
|
|||||||
subsystem: this.formData.subsystem,
|
subsystem: this.formData.subsystem,
|
||||||
userId: this.formData.userId, // 使用 userNumber
|
userId: this.formData.userId, // 使用 userNumber
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '修改成功'
|
||||||
|
})
|
||||||
// 触发父组件刷新责任人列表
|
// 触发父组件刷新责任人列表
|
||||||
this.$emit('refresh-responsible-persons')
|
this.$emit('refresh-responsible-persons')
|
||||||
this.$emit('confirm', {
|
this.$emit('confirm', {
|
||||||
@ -634,7 +639,10 @@ export default {
|
|||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('修改失败:', err)
|
console.error('修改失败:', err)
|
||||||
this.$message.error('修改失败,请重试')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '修改失败,请重试'
|
||||||
|
})
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -646,7 +654,8 @@ export default {
|
|||||||
department: this.formData.department,
|
department: this.formData.department,
|
||||||
subsystem: this.formData.subsystem,
|
subsystem: this.formData.subsystem,
|
||||||
userId: this.formData.userId
|
userId: this.formData.userId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
{{ dispatchType === 'update_param' ? '批量修改填写人' : '批量修改责任人' }}
|
{{ dispatchType === 'update_param' ? '批量修改填写人' : '批量修改责任人' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button size="small" @click="handleSave">保存</el-button> -->
|
<!-- <el-button size="small" @click="handleSave">保存</el-button> -->
|
||||||
<el-button type="primary" size="small" @click="handleConfirmDispatch">确认分发</el-button>
|
<el-button type="primary" size="small" :loading="dispatchLoading" @click="handleConfirmDispatch">确认分发</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-select
|
<el-select
|
||||||
@ -55,13 +55,8 @@
|
|||||||
@change="handleFileChange"
|
@change="handleFileChange"
|
||||||
/>
|
/>
|
||||||
<template v-if="!isEditMode && !isJustCheckMode">
|
<template v-if="!isEditMode && !isJustCheckMode">
|
||||||
<el-button size="small" @click="handleEdit"
|
<el-button size="small" @click="handleEdit">编辑</el-button>
|
||||||
>编辑</el-button
|
<el-button type="primary" size="small" @click="handleInitiateApproval"
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="handleInitiateApproval"
|
|
||||||
>发起审批</el-button
|
>发起审批</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@ -223,7 +218,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 填写人列:只在非分发模式下显示,只读 -->
|
<!-- 填写人列:只在非分发模式下显示,只读 -->
|
||||||
<div v-if="!isDispatchMode && !isEditMode" class="cell">
|
<div v-if="!isDispatchMode && !isEditMode" class="cell">
|
||||||
<span>{{ row.filledBy || '-' }}</span>
|
<span>{{ row.filledBy || '-' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -264,8 +259,12 @@
|
|||||||
>
|
>
|
||||||
<td class="col-engine-model-name">{{ item.engineModelName || '-' }}</td>
|
<td class="col-engine-model-name">{{ item.engineModelName || '-' }}</td>
|
||||||
<td class="col-subsystem-name">{{ item.subsystemName || '-' }}</td>
|
<td class="col-subsystem-name">{{ item.subsystemName || '-' }}</td>
|
||||||
<td class="col-parameter-type">{{ (item.partsName === '/' ? item.subsystemName : item.partsName) || '-' }}</td>
|
<td class="col-parameter-type">{{
|
||||||
<td class="col-parts-name">{{ (item.partsName === '/' ? item.subsystemName : item.partsName) || '-' }}</td>
|
(item.partsName === '/' ? item.subsystemName : item.partsName) || '-'
|
||||||
|
}}</td>
|
||||||
|
<td class="col-parts-name">{{
|
||||||
|
(item.partsName === '/' ? item.subsystemName : item.partsName) || '-'
|
||||||
|
}}</td>
|
||||||
<td class="col-parameter-name">{{ item.parameterName || '-' }}</td>
|
<td class="col-parameter-name">{{ item.parameterName || '-' }}</td>
|
||||||
<td class="col-parameter-value">{{ item.parameterValue || '-' }}</td>
|
<td class="col-parameter-value">{{ item.parameterValue || '-' }}</td>
|
||||||
<td class="col-common">{{ item.changeComment || '-' }}</td>
|
<td class="col-common">{{ item.changeComment || '-' }}</td>
|
||||||
@ -276,7 +275,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 流程主题 -->
|
<!-- 流程主题 -->
|
||||||
|
|
||||||
|
|
||||||
<!-- 说明 -->
|
<!-- 说明 -->
|
||||||
<div class="approval-description">
|
<div class="approval-description">
|
||||||
@ -297,16 +295,14 @@
|
|||||||
审批环节
|
审批环节
|
||||||
</div>
|
</div>
|
||||||
<div class="approval-process-title">
|
<div class="approval-process-title">
|
||||||
<div class="description-label">
|
<div class="description-label workflow-title-label"> 流程主题 <span class="required-mark">*</span> </div>
|
||||||
流程主题 <span class="required-mark">*</span>
|
<el-input
|
||||||
|
v-model="approvalFormData.processTitle"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入流程主题"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-input
|
|
||||||
v-model="approvalFormData.processTitle"
|
|
||||||
maxlength="100"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请输入流程主题"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="workflow-table">
|
<div class="workflow-table">
|
||||||
<table class="workflow-table-content">
|
<table class="workflow-table-content">
|
||||||
<thead>
|
<thead>
|
||||||
@ -470,6 +466,7 @@ export default {
|
|||||||
processTitle: '',
|
processTitle: '',
|
||||||
description: ''
|
description: ''
|
||||||
},
|
},
|
||||||
|
dispatchLoading: false, // 分发loading状态
|
||||||
approvalSubmitting: false, // 审批提交loading状态
|
approvalSubmitting: false, // 审批提交loading状态
|
||||||
approvalChangeData: [], // 审批变更数据
|
approvalChangeData: [], // 审批变更数据
|
||||||
approvalWorkflowSteps: [
|
approvalWorkflowSteps: [
|
||||||
@ -525,7 +522,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有选中的节点是"整车参数"
|
// 检查是否有选中的节点是"整车参数"
|
||||||
return this.checkedKeys.some(nodeId => {
|
return this.checkedKeys.some((nodeId) => {
|
||||||
const nodeInfo = this.nodeMap[nodeId]
|
const nodeInfo = this.nodeMap[nodeId]
|
||||||
return nodeInfo && nodeInfo.isWholeEngineParams && nodeInfo.label === '整车参数'
|
return nodeInfo && nodeInfo.isWholeEngineParams && nodeInfo.label === '整车参数'
|
||||||
})
|
})
|
||||||
@ -561,7 +558,7 @@ export default {
|
|||||||
})
|
})
|
||||||
// 返回按参数类型分组的格式,与其他子系统参数保持一致
|
// 返回按参数类型分组的格式,与其他子系统参数保持一致
|
||||||
return {
|
return {
|
||||||
'整车参数': params
|
整车参数: params
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -622,7 +619,8 @@ export default {
|
|||||||
...api.GET_ENGINE_VERSIONS,
|
...api.GET_ENGINE_VERSIONS,
|
||||||
params: {
|
params: {
|
||||||
modelId: this.currentEngineModelID
|
modelId: this.currentEngineModelID
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
@ -1124,13 +1122,21 @@ export default {
|
|||||||
if (node.children && Array.isArray(node.children)) {
|
if (node.children && Array.isArray(node.children)) {
|
||||||
return node.children.some((child) => {
|
return node.children.some((child) => {
|
||||||
const childNodeInfo = this.nodeMap[child.id]
|
const childNodeInfo = this.nodeMap[child.id]
|
||||||
if (childNodeInfo && childNodeInfo.parentLabel !== null && childNodeInfo.isParent === false) {
|
if (
|
||||||
|
childNodeInfo &&
|
||||||
|
childNodeInfo.parentLabel !== null &&
|
||||||
|
childNodeInfo.isParent === false
|
||||||
|
) {
|
||||||
// 三级节点
|
// 三级节点
|
||||||
const childLabel = (child.label || '').toLowerCase()
|
const childLabel = (child.label || '').toLowerCase()
|
||||||
if (childLabel.includes(searchValue)) {
|
if (childLabel.includes(searchValue)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
} else if (childNodeInfo && childNodeInfo.parentLabel !== null && childNodeInfo.isParent === true) {
|
} else if (
|
||||||
|
childNodeInfo &&
|
||||||
|
childNodeInfo.parentLabel !== null &&
|
||||||
|
childNodeInfo.isParent === true
|
||||||
|
) {
|
||||||
// 二级节点,递归检查其子节点
|
// 二级节点,递归检查其子节点
|
||||||
return hasMatchingChild(child)
|
return hasMatchingChild(child)
|
||||||
}
|
}
|
||||||
@ -1159,9 +1165,7 @@ export default {
|
|||||||
// 只允许拖动第二级子系统节点(不是整车参数,不是第一级,不是第三级)
|
// 只允许拖动第二级子系统节点(不是整车参数,不是第一级,不是第三级)
|
||||||
// 第二级节点的特征:isParent 为 true,且不是整车参数
|
// 第二级节点的特征:isParent 为 true,且不是整车参数
|
||||||
return (
|
return (
|
||||||
nodeInfo.isParent &&
|
nodeInfo.isParent && !nodeInfo.isWholeEngineParams && nodeInfo.parentLabel !== null // 有父节点,说明是第二级
|
||||||
!nodeInfo.isWholeEngineParams &&
|
|
||||||
nodeInfo.parentLabel !== null // 有父节点,说明是第二级
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
// 判断节点是否允许放置
|
// 判断节点是否允许放置
|
||||||
@ -1196,7 +1200,11 @@ export default {
|
|||||||
// 处理节点拖拽完成
|
// 处理节点拖拽完成
|
||||||
handleNodeDrop(draggingNode, dropNode, dropType, ev) {
|
handleNodeDrop(draggingNode, dropNode, dropType, ev) {
|
||||||
// 找到第一级节点(根节点)
|
// 找到第一级节点(根节点)
|
||||||
const rootNode = this.treeData.find((node) => node.id === draggingNode.data.id || this.nodeMap[draggingNode.data.id]?.parentLabel === node.label)
|
const rootNode = this.treeData.find(
|
||||||
|
(node) =>
|
||||||
|
node.id === draggingNode.data.id ||
|
||||||
|
this.nodeMap[draggingNode.data.id]?.parentLabel === node.label
|
||||||
|
)
|
||||||
if (!rootNode) {
|
if (!rootNode) {
|
||||||
// 如果找不到,使用第一个第一级节点
|
// 如果找不到,使用第一个第一级节点
|
||||||
if (this.treeData.length > 0) {
|
if (this.treeData.length > 0) {
|
||||||
@ -1263,7 +1271,7 @@ export default {
|
|||||||
// 如果选中了"整车参数",且没有选中任何其他非整车参数的节点,则不显示子系统参数
|
// 如果选中了"整车参数",且没有选中任何其他非整车参数的节点,则不显示子系统参数
|
||||||
if (this.isWholeEngineParamsSelected) {
|
if (this.isWholeEngineParamsSelected) {
|
||||||
// 检查是否有选中任何非整车参数的节点(不管是父节点还是子节点)
|
// 检查是否有选中任何非整车参数的节点(不管是父节点还是子节点)
|
||||||
const hasNonWholeEngineParamsNode = this.checkedKeys.some(nodeId => {
|
const hasNonWholeEngineParamsNode = this.checkedKeys.some((nodeId) => {
|
||||||
const nodeInfo = this.nodeMap[nodeId]
|
const nodeInfo = this.nodeMap[nodeId]
|
||||||
return nodeInfo && !nodeInfo.isWholeEngineParams
|
return nodeInfo && !nodeInfo.isWholeEngineParams
|
||||||
})
|
})
|
||||||
@ -1422,7 +1430,8 @@ export default {
|
|||||||
const request = {
|
const request = {
|
||||||
...config,
|
...config,
|
||||||
url: requestUrl,
|
url: requestUrl,
|
||||||
params: this.changeData
|
params: this.changeData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
@ -1436,7 +1445,10 @@ export default {
|
|||||||
|
|
||||||
// 重新加载数据
|
// 重新加载数据
|
||||||
this.loadEngineDetail()
|
this.loadEngineDetail()
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '保存成功'
|
||||||
|
})
|
||||||
// 恢复树节点状态
|
// 恢复树节点状态
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.checkedKeys = savedCheckedKeys
|
this.checkedKeys = savedCheckedKeys
|
||||||
@ -1451,6 +1463,10 @@ export default {
|
|||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('保存失败:', err)
|
console.error('保存失败:', err)
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '保存失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCancelEdit() {
|
handleCancelEdit() {
|
||||||
@ -1475,9 +1491,25 @@ export default {
|
|||||||
// 如果是批量修改填写人,直接更新页面数据
|
// 如果是批量修改填写人,直接更新页面数据
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
const { subsystem, partsName, department, userId, userNumber, username } = change
|
const { subsystem, partsName, department, userId, userNumber, username } = change
|
||||||
console.log(change, 'change', subsystem, partsName, department, userId, userNumber, username)
|
console.log(
|
||||||
|
change,
|
||||||
|
'change',
|
||||||
|
subsystem,
|
||||||
|
partsName,
|
||||||
|
department,
|
||||||
|
userId,
|
||||||
|
userNumber,
|
||||||
|
username
|
||||||
|
)
|
||||||
// partsName 现在是数组
|
// partsName 现在是数组
|
||||||
if (!subsystem || !partsName || !Array.isArray(partsName) || partsName.length === 0 || !department || !userId) {
|
if (
|
||||||
|
!subsystem ||
|
||||||
|
!partsName ||
|
||||||
|
!Array.isArray(partsName) ||
|
||||||
|
partsName.length === 0 ||
|
||||||
|
!department ||
|
||||||
|
!userId
|
||||||
|
) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '缺少必要参数'
|
message: '缺少必要参数'
|
||||||
@ -1527,7 +1559,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// 检查是否已存在该填写人选项
|
// 检查是否已存在该填写人选项
|
||||||
const existingOption = this.fillerUserOptions[rowId].find(
|
const existingOption = this.fillerUserOptions[rowId].find(
|
||||||
opt => opt.userId === userId || opt.userNumber === userNumber
|
(opt) => opt.userId === userId || opt.userNumber === userNumber
|
||||||
)
|
)
|
||||||
if (!existingOption) {
|
if (!existingOption) {
|
||||||
// 如果不存在,添加到选项中
|
// 如果不存在,添加到选项中
|
||||||
@ -1574,6 +1606,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleConfirmDispatch() {
|
handleConfirmDispatch() {
|
||||||
|
this.dispatchLoading = true
|
||||||
const dispatchData = []
|
const dispatchData = []
|
||||||
const currentData = this.versionData[this.currentVersionId] || {}
|
const currentData = this.versionData[this.currentVersionId] || {}
|
||||||
const isUpdateParamMode = this.dispatchType === 'update_param'
|
const isUpdateParamMode = this.dispatchType === 'update_param'
|
||||||
@ -1670,16 +1703,21 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
message: '分发成功'
|
message: '分发成功'
|
||||||
})
|
})
|
||||||
|
this.dispatchLoading = false
|
||||||
// 返回路由上一级
|
// 返回路由上一级
|
||||||
this.handleBack()
|
this.handleBack()
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('分发失败:', err)
|
console.error('分发失败:', err)
|
||||||
|
this.dispatchLoading = false
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: err.message || '分发失败'
|
message: err.message || '分发失败'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.dispatchLoading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 加载机型详情信息
|
// 加载机型详情信息
|
||||||
loadEngineDetailInfo() {
|
loadEngineDetailInfo() {
|
||||||
@ -1737,7 +1775,9 @@ export default {
|
|||||||
const firstLevelKeys = this.getFirstLevelNodeKeys(this.treeData)
|
const firstLevelKeys = this.getFirstLevelNodeKeys(this.treeData)
|
||||||
const secondLevelKeys = this.getSecondLevelNodeKeys(this.treeData)
|
const secondLevelKeys = this.getSecondLevelNodeKeys(this.treeData)
|
||||||
// 合并一级和二级节点的keys
|
// 合并一级和二级节点的keys
|
||||||
const defaultExpandedKeysForFirstLoad = [...new Set([...firstLevelKeys, ...secondLevelKeys])]
|
const defaultExpandedKeysForFirstLoad = [
|
||||||
|
...new Set([...firstLevelKeys, ...secondLevelKeys])
|
||||||
|
]
|
||||||
// 只有在首次加载(expandedKeys 为空)时才设置默认展开状态
|
// 只有在首次加载(expandedKeys 为空)时才设置默认展开状态
|
||||||
// 如果已经有展开状态(用户手动展开/收起了节点),保持当前状态不变
|
// 如果已经有展开状态(用户手动展开/收起了节点),保持当前状态不变
|
||||||
const isFirstLoad = this.expandedKeys.length === 0
|
const isFirstLoad = this.expandedKeys.length === 0
|
||||||
@ -1924,7 +1964,7 @@ export default {
|
|||||||
isWholeEngineParams: true // 标记为整机参数节点
|
isWholeEngineParams: true // 标记为整机参数节点
|
||||||
}
|
}
|
||||||
// 更新原有节点的 parentLabel
|
// 更新原有节点的 parentLabel
|
||||||
originalTreeData.forEach(node => {
|
originalTreeData.forEach((node) => {
|
||||||
const originalParentId = node.id
|
const originalParentId = node.id
|
||||||
if (this.nodeMap[originalParentId]) {
|
if (this.nodeMap[originalParentId]) {
|
||||||
this.nodeMap[originalParentId].parentLabel = rootLabel
|
this.nodeMap[originalParentId].parentLabel = rootLabel
|
||||||
@ -1938,7 +1978,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 更新子节点的 parentLabel
|
// 更新子节点的 parentLabel
|
||||||
updateChildrenParentLabel(children, parentLabel) {
|
updateChildrenParentLabel(children, parentLabel) {
|
||||||
children.forEach(child => {
|
children.forEach((child) => {
|
||||||
if (this.nodeMap[child.id]) {
|
if (this.nodeMap[child.id]) {
|
||||||
this.nodeMap[child.id].parentLabel = parentLabel
|
this.nodeMap[child.id].parentLabel = parentLabel
|
||||||
}
|
}
|
||||||
@ -2125,7 +2165,10 @@ export default {
|
|||||||
const nodeInfo = this.nodeMap[node.id]
|
const nodeInfo = this.nodeMap[node.id]
|
||||||
if (nodeInfo) {
|
if (nodeInfo) {
|
||||||
// 如果是一级节点或二级节点,则展开
|
// 如果是一级节点或二级节点,则展开
|
||||||
if (nodeInfo.parentLabel === null || (nodeInfo.parentLabel !== null && nodeInfo.isParent === true)) {
|
if (
|
||||||
|
nodeInfo.parentLabel === null ||
|
||||||
|
(nodeInfo.parentLabel !== null && nodeInfo.isParent === true)
|
||||||
|
) {
|
||||||
if (allExpandedKeys.includes(node.id) && !node.expanded) {
|
if (allExpandedKeys.includes(node.id) && !node.expanded) {
|
||||||
node.expand()
|
node.expand()
|
||||||
}
|
}
|
||||||
@ -2556,7 +2599,7 @@ export default {
|
|||||||
let subsystemMatch = false
|
let subsystemMatch = false
|
||||||
if (subsystemName && person.subsystem) {
|
if (subsystemName && person.subsystem) {
|
||||||
// 如果责任人的 subsystem 是逗号分隔的字符串,检查是否包含参数的子系统
|
// 如果责任人的 subsystem 是逗号分隔的字符串,检查是否包含参数的子系统
|
||||||
const personSubsystems = person.subsystem.split(',').map(s => s.trim())
|
const personSubsystems = person.subsystem.split(',').map((s) => s.trim())
|
||||||
subsystemMatch = personSubsystems.includes(subsystemName)
|
subsystemMatch = personSubsystems.includes(subsystemName)
|
||||||
} else if (!subsystemName && !person.subsystem) {
|
} else if (!subsystemName && !person.subsystem) {
|
||||||
// 如果都没有子系统,也算匹配
|
// 如果都没有子系统,也算匹配
|
||||||
@ -2572,7 +2615,9 @@ export default {
|
|||||||
// 参数的部门要包括在责任人的部门中(即责任人的部门是参数的部门的父路径或相同路径)
|
// 参数的部门要包括在责任人的部门中(即责任人的部门是参数的部门的父路径或相同路径)
|
||||||
// 例如:参数部门 "A-B-C",责任人部门 "A-B-C-D" 或 "A-B-C" 都匹配
|
// 例如:参数部门 "A-B-C",责任人部门 "A-B-C-D" 或 "A-B-C" 都匹配
|
||||||
// 但责任人部门 "A-B" 不匹配
|
// 但责任人部门 "A-B" 不匹配
|
||||||
departmentMatch = normalizedPersonDept === normalizedParamDept || normalizedPersonDept.startsWith(normalizedParamDept + '-')
|
departmentMatch =
|
||||||
|
normalizedPersonDept === normalizedParamDept ||
|
||||||
|
normalizedPersonDept.startsWith(normalizedParamDept + '-')
|
||||||
} else if (!department && !person.department) {
|
} else if (!department && !person.department) {
|
||||||
// 如果都没有部门,也算匹配
|
// 如果都没有部门,也算匹配
|
||||||
departmentMatch = true
|
departmentMatch = true
|
||||||
@ -2610,11 +2655,7 @@ export default {
|
|||||||
|
|
||||||
if (existingIndex >= 0) {
|
if (existingIndex >= 0) {
|
||||||
// 如果已存在,使用 Vue.set 更新数据
|
// 如果已存在,使用 Vue.set 更新数据
|
||||||
this.$set(
|
this.$set(this.versionData[this.currentVersionId][groupKey], existingIndex, paramData)
|
||||||
this.versionData[this.currentVersionId][groupKey],
|
|
||||||
existingIndex,
|
|
||||||
paramData
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
// 如果不存在,添加新数据
|
// 如果不存在,添加新数据
|
||||||
this.versionData[this.currentVersionId][groupKey].push(paramData)
|
this.versionData[this.currentVersionId][groupKey].push(paramData)
|
||||||
@ -2821,13 +2862,18 @@ export default {
|
|||||||
// 调用发起审批接口
|
// 调用发起审批接口
|
||||||
const request = {
|
const request = {
|
||||||
...api.START_ENGINE_CHECK,
|
...api.START_ENGINE_CHECK,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log('审批提交成功')
|
console.log('审批提交成功')
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '审批提交成功'
|
||||||
|
})
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
this.isApprovalMode = false
|
this.isApprovalMode = false
|
||||||
this.handleBack()
|
this.handleBack()
|
||||||
@ -2835,6 +2881,13 @@ export default {
|
|||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('审批提交失败:', err)
|
console.error('审批提交失败:', err)
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '审批提交失败'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.approvalSubmitting = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleRemoteSearch(query, stepIndex) {
|
handleRemoteSearch(query, stepIndex) {
|
||||||
@ -2936,7 +2989,7 @@ export default {
|
|||||||
// 将 · 替换为 -
|
// 将 · 替换为 -
|
||||||
const normalizedDept = department.replace(/·/g, '-')
|
const normalizedDept = department.replace(/·/g, '-')
|
||||||
// 按 - 分割
|
// 按 - 分割
|
||||||
const parts = normalizedDept.split('-').filter(part => part.trim() !== '')
|
const parts = normalizedDept.split('-').filter((part) => part.trim() !== '')
|
||||||
// 只显示最后一个节点
|
// 只显示最后一个节点
|
||||||
if (parts.length > 0) {
|
if (parts.length > 0) {
|
||||||
return parts[parts.length - 1]
|
return parts[parts.length - 1]
|
||||||
@ -3031,6 +3084,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page-approval-content {
|
.page-approval-content {
|
||||||
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
@ -3382,8 +3436,14 @@ export default {
|
|||||||
.description-label {
|
.description-label {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
.workflow-title-label {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval-workflow {
|
.approval-workflow {
|
||||||
|
|||||||
@ -608,7 +608,8 @@ export default {
|
|||||||
partsName: partsName,
|
partsName: partsName,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
@ -847,17 +848,24 @@ export default {
|
|||||||
...api.DELETE_MANAGER_DATA,
|
...api.DELETE_MANAGER_DATA,
|
||||||
params: {
|
params: {
|
||||||
rowId: row.rowId
|
rowId: row.rowId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
// this.$message.success('删除成功')
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功'
|
||||||
|
})
|
||||||
// 刷新列表数据
|
// 刷新列表数据
|
||||||
this.loadFillerData()
|
this.loadFillerData()
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('删除失败:', err)
|
console.error('删除失败:', err)
|
||||||
this.$message.error('删除失败')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '删除失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|||||||
@ -501,10 +501,25 @@ export default {
|
|||||||
department: this.formData.selectDeptName,
|
department: this.formData.selectDeptName,
|
||||||
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
||||||
userId: this.formData.userId || this.formData.responsible
|
userId: this.formData.userId || this.formData.responsible
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
this.loadManagerData()
|
.asyncThen((resp) => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '新增成功'
|
||||||
|
})
|
||||||
|
this.handleDialogClose()
|
||||||
|
this.loadManagerData()
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('新增失败:', err)
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '新增失败'
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
// 修改
|
// 修改
|
||||||
const request = {
|
const request = {
|
||||||
@ -515,18 +530,25 @@ export default {
|
|||||||
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
subsystem: Array.isArray(this.formData.subsystem) ? this.formData.subsystem.join(',') : this.formData.subsystem,
|
||||||
userId: this.formData.responsible,
|
userId: this.formData.responsible,
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
// this.$message.success('修改成功')
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '修改成功'
|
||||||
|
})
|
||||||
this.handleDialogClose()
|
this.handleDialogClose()
|
||||||
// 刷新列表数据
|
// 刷新列表数据
|
||||||
this.loadManagerData()
|
this.loadManagerData()
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('修改失败:', err)
|
console.error('修改失败:', err)
|
||||||
this.$message.error('修改失败')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '修改失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.handleDialogClose()
|
this.handleDialogClose()
|
||||||
@ -752,7 +774,8 @@ export default {
|
|||||||
...api.DELETE_MANAGER_DATA,
|
...api.DELETE_MANAGER_DATA,
|
||||||
params: {
|
params: {
|
||||||
rowId: row.rowId
|
rowId: row.rowId
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
@ -822,6 +845,7 @@ export default {
|
|||||||
|
|
||||||
.header-section {
|
.header-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
|
|||||||
@ -1587,19 +1587,26 @@ export default {
|
|||||||
this.savingFavorite = true
|
this.savingFavorite = true
|
||||||
const request = {
|
const request = {
|
||||||
...api.ADD_USER_COMMONLY_USED,
|
...api.ADD_USER_COMMONLY_USED,
|
||||||
params: requestData
|
params: requestData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
// this.$message.success('新增常用成功')
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '新增常用成功'
|
||||||
|
})
|
||||||
this.handleAddFavoriteDialogClose()
|
this.handleAddFavoriteDialogClose()
|
||||||
// 重新加载常用列表
|
// 重新加载常用列表
|
||||||
this.loadFavoritesList()
|
this.loadFavoritesList()
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('新增常用失败:', err)
|
console.error('新增常用失败:', err)
|
||||||
this.$message.error(err.message || '新增常用失败')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '新增常用失败'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.savingFavorite = false
|
this.savingFavorite = false
|
||||||
|
|||||||
@ -575,22 +575,6 @@ export default {
|
|||||||
this.currentDetail = {}
|
this.currentDetail = {}
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
demoGetPerson() {
|
|
||||||
const request = {
|
|
||||||
...api.GET_ALLUSERS,
|
|
||||||
disableSuccessMsg: true,
|
|
||||||
params: {
|
|
||||||
name: '李'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$request(request)
|
|
||||||
.asyncThen((resp) => {
|
|
||||||
console.log(resp, 'resp')
|
|
||||||
})
|
|
||||||
.asyncErrorCatch((err) => {
|
|
||||||
console.error('获取人员失败:', err)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleRowVersion(row) {
|
handleRowVersion(row) {
|
||||||
this.$refs.versionModal.showModal(row)
|
this.$refs.versionModal.showModal(row)
|
||||||
},
|
},
|
||||||
@ -859,7 +843,8 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
@ -944,7 +929,8 @@ export default {
|
|||||||
// 添加新模板到表格
|
// 添加新模板到表格
|
||||||
const request = {
|
const request = {
|
||||||
...api.ADD_MODEL,
|
...api.ADD_MODEL,
|
||||||
params: formData
|
params: formData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
|
|||||||
@ -1941,14 +1941,18 @@ export default {
|
|||||||
// 调用发起审批接口
|
// 调用发起审批接口
|
||||||
const request = {
|
const request = {
|
||||||
...api.START_APPROVAL,
|
...api.START_APPROVAL,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log('审批提交成功')
|
console.log('审批提交成功')
|
||||||
// this.$message.success('审批提交成功')
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '审批提交成功'
|
||||||
|
})
|
||||||
this.isApprovalMode = false
|
this.isApprovalMode = false
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
// 清空保存的审批模式前的数据(因为审批已提交,不需要还原)
|
// 清空保存的审批模式前的数据(因为审批已提交,不需要还原)
|
||||||
@ -1958,7 +1962,10 @@ export default {
|
|||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('审批提交失败:', err)
|
console.error('审批提交失败:', err)
|
||||||
this.$message.error('审批提交失败,请重试')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '审批提交失败,请重试'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
|
|||||||
@ -562,7 +562,8 @@ export default {
|
|||||||
// 调用审批接口
|
// 调用审批接口
|
||||||
const request = {
|
const request = {
|
||||||
...api.HANDLE_ENGINE_CHECK,
|
...api.HANDLE_ENGINE_CHECK,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
@ -600,7 +601,8 @@ export default {
|
|||||||
...api.RETURN_ENGINE_CHECK,
|
...api.RETURN_ENGINE_CHECK,
|
||||||
params: {
|
params: {
|
||||||
approvalId: row.id
|
approvalId: row.id
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
|
|||||||
@ -1304,11 +1304,16 @@ export default {
|
|||||||
roleName: this.addRoleFormData.roleName,
|
roleName: this.addRoleFormData.roleName,
|
||||||
roleCode: this.addRoleFormData.roleCode,
|
roleCode: this.addRoleFormData.roleCode,
|
||||||
roleDescription: this.addRoleFormData.roleDescription
|
roleDescription: this.addRoleFormData.roleDescription
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
this.handleAddRoleDialogClose()
|
this.handleAddRoleDialogClose()
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: isEdit ? '编辑角色成功' : '新增角色成功'
|
||||||
|
})
|
||||||
this.loadPermissionData()
|
this.loadPermissionData()
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
|
|||||||
@ -84,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<el-button type="primary" @click="handleCreate">
|
<el-button v-if="hasReportEditPermission()" type="primary" @click="handleCreate">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button @click="handleDownloadTemplate">下载模板</el-button> -->
|
<!-- <el-button @click="handleDownloadTemplate">下载模板</el-button> -->
|
||||||
@ -164,7 +164,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<span style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.status === 'DRAFT'"
|
v-if="row.status === 'DRAFT' && hasReportEditPermission()"
|
||||||
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)"
|
||||||
@ -197,7 +197,7 @@
|
|||||||
style="width: 6px; display: inline-block"
|
style="width: 6px; display: inline-block"
|
||||||
></span>
|
></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.status === 'REJECTED'"
|
v-if="row.status === 'REJECTED' && hasReportEditPermission()"
|
||||||
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)"
|
||||||
@ -675,9 +675,84 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.loadUserSelfRole()
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 检查是否是管理员(isAdmin === 1)
|
||||||
|
isAdmin() {
|
||||||
|
try {
|
||||||
|
const permissionDataStr = localStorage.getItem('user_self_role')
|
||||||
|
if (!permissionDataStr) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const permissionData = JSON.parse(permissionDataStr)
|
||||||
|
if (!Array.isArray(permissionData)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 检查是否有 isAdmin === 1 的记录
|
||||||
|
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
|
||||||
|
} catch (err) {
|
||||||
|
console.error('检查管理员权限失败:', err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 检查是否有报告的编辑权限
|
||||||
|
hasReportEditPermission() {
|
||||||
|
// 如果是管理员,拥有全部权限
|
||||||
|
if (this.isAdmin()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const permissionDataStr = localStorage.getItem('user_self_role')
|
||||||
|
if (!permissionDataStr) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const permissionData = JSON.parse(permissionDataStr)
|
||||||
|
if (!Array.isArray(permissionData)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 检查是否有 permissionPath 为 "报告" 且 parameterPer 是编辑的权限
|
||||||
|
// parameterPer 可能是数字 2 或字符串 "编辑" 或 "2"
|
||||||
|
return permissionData.some((perm) => {
|
||||||
|
const permissionPath = perm.permissionPath || ''
|
||||||
|
const parameterPer = perm.parameterPer
|
||||||
|
return (
|
||||||
|
permissionPath === '报告' &&
|
||||||
|
(parameterPer === 2 ||
|
||||||
|
parameterPer === '2' ||
|
||||||
|
parameterPer === '编辑')
|
||||||
|
)
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.error('检查报告编辑权限失败:', err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 加载用户自身角色权限
|
||||||
|
loadUserSelfRole() {
|
||||||
|
const request = {
|
||||||
|
...api.GET_USER_SELF_ROLE,
|
||||||
|
params: {
|
||||||
|
userOrDepID: getUserId()
|
||||||
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
|
}
|
||||||
|
this.$request(request)
|
||||||
|
.asyncThen((resp) => {
|
||||||
|
if (resp && resp.data) {
|
||||||
|
// 将权限数据存储到 localStorage
|
||||||
|
try {
|
||||||
|
localStorage.setItem('user_self_role', JSON.stringify(resp.data))
|
||||||
|
} catch (err) {
|
||||||
|
console.error('存储权限数据到 localStorage 失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('获取用户自身角色失败:', err)
|
||||||
|
})
|
||||||
|
},
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.dialogMode = 'create'
|
this.dialogMode = 'create'
|
||||||
this.currentRestartRow = null
|
this.currentRestartRow = null
|
||||||
@ -817,9 +892,9 @@ export default {
|
|||||||
if (requiredStepsWithoutHandlers.length > 0) {
|
if (requiredStepsWithoutHandlers.length > 0) {
|
||||||
const stepNames = requiredStepsWithoutHandlers.map((step) => step.name).join('、')
|
const stepNames = requiredStepsWithoutHandlers.map((step) => step.name).join('、')
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: `请为必填环节"${stepNames}"选择处理人`
|
message: `请为必填环节"${stepNames}"选择处理人`
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1053,8 +1128,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const file = this.selectedFile
|
const file = this.selectedFile
|
||||||
console.log(file,2222);
|
console.log(file, 2222)
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', file)
|
formData.append('file', file)
|
||||||
formData.append('createBy', getUserId())
|
formData.append('createBy', getUserId())
|
||||||
|
|||||||
@ -1300,7 +1300,8 @@ export default {
|
|||||||
...this.editFormData,
|
...this.editFormData,
|
||||||
createBy: getUserId(),
|
createBy: getUserId(),
|
||||||
userId: getUserId()
|
userId: getUserId()
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saving = true
|
this.saving = true
|
||||||
|
|||||||
@ -562,7 +562,8 @@ export default {
|
|||||||
// 调用审批接口
|
// 调用审批接口
|
||||||
const request = {
|
const request = {
|
||||||
...api.HANDLE_ENGINE_CHECK,
|
...api.HANDLE_ENGINE_CHECK,
|
||||||
params: submitData
|
params: submitData,
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.approvalSubmitting = true
|
this.approvalSubmitting = true
|
||||||
@ -600,7 +601,8 @@ export default {
|
|||||||
...api.RETURN_ENGINE_CHECK,
|
...api.RETURN_ENGINE_CHECK,
|
||||||
params: {
|
params: {
|
||||||
approvalId: row.id
|
approvalId: row.id
|
||||||
}
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user