feat:同步参数
This commit is contained in:
parent
d002e3ff8c
commit
8636778f9d
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
@ -44,6 +44,10 @@ export default {
|
|||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModel',
|
url: '/custom/engineParamDetailPojo/selectParamListAndModel',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
|
GET_NEW_MODEL_VERSION: {
|
||||||
|
url: '/custom/dataEntryEngineModel/synchronizeParams',
|
||||||
|
method: 'get'
|
||||||
|
},
|
||||||
CONTINUE_DATA_APPROVAL: {
|
CONTINUE_DATA_APPROVAL: {
|
||||||
url: '/custom/activiti/continueApproval',
|
url: '/custom/activiti/continueApproval',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
|||||||
@ -25,12 +25,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="!isApprovalMode && !hideOperations" class="operation">
|
<div v-if="!isApprovalMode && !hideOperations" class="operation">
|
||||||
<template v-if="isDispatchMode">
|
<template v-if="isDispatchMode">
|
||||||
<el-button v-if="shouldShowRejectButton" size="small" :loading="rejecting" @click="handleReject">拒绝</el-button>
|
<el-button
|
||||||
|
v-if="shouldShowRejectButton"
|
||||||
|
size="small"
|
||||||
|
:loading="rejecting"
|
||||||
|
@click="handleReject"
|
||||||
|
>拒绝</el-button
|
||||||
|
>
|
||||||
<el-button size="small" @click="handleBatchModifyResponsible">
|
<el-button size="small" @click="handleBatchModifyResponsible">
|
||||||
{{ 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" :loading="dispatchLoading" @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
|
||||||
@ -41,6 +53,9 @@
|
|||||||
>
|
>
|
||||||
<el-option v-for="ver in versions" :key="ver.id" :label="ver.label" :value="ver.id" />
|
<el-option v-for="ver in versions" :key="ver.id" :label="ver.label" :value="ver.id" />
|
||||||
</el-select> -->
|
</el-select> -->
|
||||||
|
<el-button size="small" @click="handleSyncVersion">
|
||||||
|
同步参数版本
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!isEditMode && !isJustCheckMode"
|
v-if="!isEditMode && !isJustCheckMode"
|
||||||
size="small"
|
size="small"
|
||||||
@ -64,9 +79,22 @@
|
|||||||
@change="handleFileChange"
|
@change="handleFileChange"
|
||||||
/>
|
/>
|
||||||
<template v-if="!isEditMode && !isJustCheckMode">
|
<template v-if="!isEditMode && !isJustCheckMode">
|
||||||
<el-button v-if="hasAnyEditPermission()" size="small" @click="handleEdit">编辑</el-button>
|
<el-button v-if="hasAnyEditPermission()" size="small" @click="handleEdit"
|
||||||
<el-button v-if="shouldShowRejectButton && !shouldShowResendButton" size="small" :loading="rejecting" @click="handleReject">拒绝</el-button>
|
>编辑</el-button
|
||||||
<el-button v-if="shouldShowResendButton" size="small" :loading="resending" @click="handleResend">
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="shouldShowRejectButton && !shouldShowResendButton"
|
||||||
|
size="small"
|
||||||
|
:loading="rejecting"
|
||||||
|
@click="handleReject"
|
||||||
|
>拒绝</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="shouldShowResendButton"
|
||||||
|
size="small"
|
||||||
|
:loading="resending"
|
||||||
|
@click="handleResend"
|
||||||
|
>
|
||||||
直送
|
直送
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="small" @click="handleInitiateApproval">
|
<el-button type="primary" size="small" @click="handleInitiateApproval">
|
||||||
@ -161,13 +189,28 @@
|
|||||||
<div class="section" v-if="shouldShowSection(sectionKey)" :key="sectionKey">
|
<div class="section" v-if="shouldShowSection(sectionKey)" :key="sectionKey">
|
||||||
<div class="section-title">{{ formatSectionTitle(sectionKey, sectionData) }}</div>
|
<div class="section-title">{{ formatSectionTitle(sectionKey, sectionData) }}</div>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="grid-header" :class="{ 'edit-mode': isEditMode && !isDispatchMode, 'dispatch-mode': isDispatchMode && dispatchType !== 'update_param', 'dispatch-filler-mode': isDispatchMode && dispatchType === 'update_param' }">
|
<div
|
||||||
|
class="grid-header"
|
||||||
|
:class="{
|
||||||
|
'edit-mode': isEditMode && !isDispatchMode,
|
||||||
|
'dispatch-mode': isDispatchMode && dispatchType !== 'update_param',
|
||||||
|
'dispatch-filler-mode': isDispatchMode && dispatchType === 'update_param'
|
||||||
|
}"
|
||||||
|
>
|
||||||
<div class="cell header-cell">参数名称</div>
|
<div class="cell header-cell">参数名称</div>
|
||||||
<div class="cell header-cell">单位</div>
|
<div class="cell header-cell">单位</div>
|
||||||
<div class="cell header-cell">参数值</div>
|
<div class="cell header-cell">参数值</div>
|
||||||
<div class="cell header-cell" v-if="!isEditMode || isDispatchMode">填写部门</div>
|
<div class="cell header-cell" v-if="!isEditMode || isDispatchMode">填写部门</div>
|
||||||
<div class="cell header-cell" v-if="isDispatchMode && dispatchType !== 'update_param'">分发状态</div>
|
<div
|
||||||
<div class="cell header-cell" v-if="isDispatchMode && dispatchType === 'update_param'">分发状态</div>
|
class="cell header-cell"
|
||||||
|
v-if="isDispatchMode && dispatchType !== 'update_param'"
|
||||||
|
>分发状态</div
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="cell header-cell"
|
||||||
|
v-if="isDispatchMode && dispatchType === 'update_param'"
|
||||||
|
>分发状态</div
|
||||||
|
>
|
||||||
<div class="cell header-cell" v-if="!isEditMode || isDispatchMode">
|
<div class="cell header-cell" v-if="!isEditMode || isDispatchMode">
|
||||||
{{
|
{{
|
||||||
isDispatchMode && dispatchType === 'update_param'
|
isDispatchMode && dispatchType === 'update_param'
|
||||||
@ -182,7 +225,11 @@
|
|||||||
class="grid-row"
|
class="grid-row"
|
||||||
v-for="(row, idx) in sectionData"
|
v-for="(row, idx) in sectionData"
|
||||||
:key="sectionKey + '-' + idx"
|
:key="sectionKey + '-' + idx"
|
||||||
:class="{ 'edit-mode': isEditMode && !isDispatchMode, 'dispatch-mode': isDispatchMode && dispatchType !== 'update_param', 'dispatch-filler-mode': isDispatchMode && dispatchType === 'update_param' }"
|
:class="{
|
||||||
|
'edit-mode': isEditMode && !isDispatchMode,
|
||||||
|
'dispatch-mode': isDispatchMode && dispatchType !== 'update_param',
|
||||||
|
'dispatch-filler-mode': isDispatchMode && dispatchType === 'update_param'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<div class="cell">{{ row.parameterName }}</div>
|
<div class="cell">{{ row.parameterName }}</div>
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
@ -196,7 +243,9 @@
|
|||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
class="param-input"
|
class="param-input"
|
||||||
/>
|
/>
|
||||||
<span v-else-if="!isEditMode && !isDispatchMode && filledBy">{{ row.minorVersion || row.parameterValue || '/' }}</span>
|
<span v-else-if="!isEditMode && !isDispatchMode && filledBy">{{
|
||||||
|
row.minorVersion || row.parameterValue || '/'
|
||||||
|
}}</span>
|
||||||
<span v-else>{{ row.parameterValue || '/' }}</span>
|
<span v-else>{{ row.parameterValue || '/' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!isEditMode || isDispatchMode" class="cell">
|
<div v-if="!isEditMode || isDispatchMode" class="cell">
|
||||||
@ -220,7 +269,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 填写人列:分发模式下且是 update_param 类型时显示,已分发的显示名称,未分发的可编辑 -->
|
<!-- 填写人列:分发模式下且是 update_param 类型时显示,已分发的显示名称,未分发的可编辑 -->
|
||||||
<div v-if="isDispatchMode && dispatchType === 'update_param'" class="cell">
|
<div v-if="isDispatchMode && dispatchType === 'update_param'" class="cell">
|
||||||
<span v-if="row.isDistributedFilled === 1">{{ row.filledByName || row.filledBy || '-' }}</span>
|
<span v-if="row.isDistributedFilled === 1">{{
|
||||||
|
row.filledByName || row.filledBy || '-'
|
||||||
|
}}</span>
|
||||||
<el-select
|
<el-select
|
||||||
v-else
|
v-else
|
||||||
v-model="row.filledByUserId"
|
v-model="row.filledByUserId"
|
||||||
@ -608,7 +659,13 @@ export default {
|
|||||||
// 判断是否允许切换版本(只有从列表查看按钮进入的可以切换版本)
|
// 判断是否允许切换版本(只有从列表查看按钮进入的可以切换版本)
|
||||||
canSwitchVersion() {
|
canSwitchVersion() {
|
||||||
// 从列表查看按钮进入的条件:不是隐藏操作模式、不是分发模式、不是从待办进入、没有填写人、不是编辑模式
|
// 从列表查看按钮进入的条件:不是隐藏操作模式、不是分发模式、不是从待办进入、没有填写人、不是编辑模式
|
||||||
return !this.hideOperations && !this.isDispatchMode && !this.fromTodo && !this.filledBy && !this.isEditMode
|
return (
|
||||||
|
!this.hideOperations &&
|
||||||
|
!this.isDispatchMode &&
|
||||||
|
!this.fromTodo &&
|
||||||
|
!this.filledBy &&
|
||||||
|
!this.isEditMode
|
||||||
|
)
|
||||||
},
|
},
|
||||||
// 判断是否是查看模式(justCheck)
|
// 判断是否是查看模式(justCheck)
|
||||||
isJustCheckMode() {
|
isJustCheckMode() {
|
||||||
@ -667,7 +724,8 @@ export default {
|
|||||||
contentName: this.progressDetailData.contentName || '',
|
contentName: this.progressDetailData.contentName || '',
|
||||||
templateVersion: this.progressDetailData.templateVersion || '',
|
templateVersion: this.progressDetailData.templateVersion || '',
|
||||||
explanation: this.progressDetailData.explanation || '',
|
explanation: this.progressDetailData.explanation || '',
|
||||||
description: this.progressDetailData.explanation || this.progressDetailData.description || ''
|
description:
|
||||||
|
this.progressDetailData.explanation || this.progressDetailData.description || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@ -682,15 +740,15 @@ export default {
|
|||||||
currentNode() {
|
currentNode() {
|
||||||
if (this.flowNodes && this.flowNodes.length > 0) {
|
if (this.flowNodes && this.flowNodes.length > 0) {
|
||||||
// 找到第一个"待审批"或"审批中"的节点
|
// 找到第一个"待审批"或"审批中"的节点
|
||||||
const approvingNode = this.flowNodes.find((node) =>
|
const approvingNode = this.flowNodes.find(
|
||||||
node.result === '待审批' || node.result === 'APPROVING'
|
(node) => node.result === '待审批' || node.result === 'APPROVING'
|
||||||
)
|
)
|
||||||
if (approvingNode) {
|
if (approvingNode) {
|
||||||
return approvingNode.node || '--'
|
return approvingNode.node || '--'
|
||||||
}
|
}
|
||||||
// 如果都已完成,返回最后一个节点
|
// 如果都已完成,返回最后一个节点
|
||||||
const lastNode = this.flowNodes[this.flowNodes.length - 1]
|
const lastNode = this.flowNodes[this.flowNodes.length - 1]
|
||||||
return lastNode ? (lastNode.node || '--') : '--'
|
return lastNode ? lastNode.node || '--' : '--'
|
||||||
}
|
}
|
||||||
return '--'
|
return '--'
|
||||||
},
|
},
|
||||||
@ -698,8 +756,8 @@ export default {
|
|||||||
currentProcessor() {
|
currentProcessor() {
|
||||||
if (this.flowNodes && this.flowNodes.length > 0) {
|
if (this.flowNodes && this.flowNodes.length > 0) {
|
||||||
// 找到第一个"待审批"或"审批中"的节点
|
// 找到第一个"待审批"或"审批中"的节点
|
||||||
const approvingNode = this.flowNodes.find((node) =>
|
const approvingNode = this.flowNodes.find(
|
||||||
node.result === '待审批' || node.result === 'APPROVING'
|
(node) => node.result === '待审批' || node.result === 'APPROVING'
|
||||||
)
|
)
|
||||||
if (approvingNode) {
|
if (approvingNode) {
|
||||||
// 优先使用待处理人,如果没有则使用已处理人
|
// 优先使用待处理人,如果没有则使用已处理人
|
||||||
@ -723,11 +781,11 @@ export default {
|
|||||||
if (!this.todoId) {
|
if (!this.todoId) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否存在已分发的数据
|
// 检查是否存在已分发的数据
|
||||||
const currentData = this.versionData[this.currentVersionId] || {}
|
const currentData = this.versionData[this.currentVersionId] || {}
|
||||||
let hasDistributedData = false
|
let hasDistributedData = false
|
||||||
|
|
||||||
// 遍历所有数据,检查是否有已分发的项
|
// 遍历所有数据,检查是否有已分发的项
|
||||||
Object.keys(currentData).forEach((partsName) => {
|
Object.keys(currentData).forEach((partsName) => {
|
||||||
const params = currentData[partsName] || []
|
const params = currentData[partsName] || []
|
||||||
@ -753,12 +811,12 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 如果存在已分发的数据,不显示拒绝按钮
|
// 如果存在已分发的数据,不显示拒绝按钮
|
||||||
if (hasDistributedData) {
|
if (hasDistributedData) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分发模式下显示拒绝按钮
|
// 分发模式下显示拒绝按钮
|
||||||
if (this.isDispatchMode) {
|
if (this.isDispatchMode) {
|
||||||
return true
|
return true
|
||||||
@ -880,13 +938,7 @@ export default {
|
|||||||
// 加载版本列表
|
// 加载版本列表
|
||||||
this.getversions()
|
this.getversions()
|
||||||
// 加载树数据
|
// 加载树数据
|
||||||
this.loadTreeData()
|
|
||||||
// 检查是否可以直送(如果是从待办页面进入且有 flowId,或者 detail 中有 flowId)
|
|
||||||
const flowId = this.detail?.flowId || this.flowId
|
|
||||||
if (flowId) {
|
|
||||||
console.log('flowId', flowId)
|
|
||||||
this.canResendApproval()
|
|
||||||
}
|
|
||||||
// this.loadEngineDetailInfo()
|
// this.loadEngineDetailInfo()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -912,7 +964,7 @@ export default {
|
|||||||
// 将数字数组转换为对象数组,按降序排列(大的版本号在前)
|
// 将数字数组转换为对象数组,按降序排列(大的版本号在前)
|
||||||
this.versions = versionArray
|
this.versions = versionArray
|
||||||
.sort((a, b) => b - a) // 降序排列
|
.sort((a, b) => b - a) // 降序排列
|
||||||
.map(versionNum => ({
|
.map((versionNum) => ({
|
||||||
id: versionNum,
|
id: versionNum,
|
||||||
label: `V${versionNum}`
|
label: `V${versionNum}`
|
||||||
}))
|
}))
|
||||||
@ -920,10 +972,18 @@ export default {
|
|||||||
// 如果已经是对象数组,直接使用
|
// 如果已经是对象数组,直接使用
|
||||||
this.versions = versionArray
|
this.versions = versionArray
|
||||||
}
|
}
|
||||||
// 如果版本列表不为空且当前版本ID为空,设置第一个版本为当前版本
|
// 如果版本列表不为空且当前版本ID为空,设置第一个版本为当前版本
|
||||||
if (this.versions.length > 0 && !this.currentVersionId) {
|
if (this.versions.length > 0 && !this.currentVersionId) {
|
||||||
this.currentVersionId = this.versions[0].id
|
this.currentVersionId = this.versions[0].id
|
||||||
}
|
}
|
||||||
|
this.loadTreeData()
|
||||||
|
// 检查是否可以直送(如果是从待办页面进入且有 flowId,或者 detail 中有 flowId)
|
||||||
|
const flowId = this.detail?.flowId || this.flowId
|
||||||
|
if (flowId) {
|
||||||
|
console.log('flowId', flowId)
|
||||||
|
this.canResendApproval()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
@ -1485,7 +1545,8 @@ export default {
|
|||||||
}
|
}
|
||||||
// 切换版本后重新加载详情数据
|
// 切换版本后重新加载详情数据
|
||||||
if (this.checkedKeys && this.checkedKeys.length > 0) {
|
if (this.checkedKeys && this.checkedKeys.length > 0) {
|
||||||
this.loadEngineDetail()
|
this.loadTreeData()
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onVersionStatusChange(row, idx, section) {
|
onVersionStatusChange(row, idx, section) {
|
||||||
@ -1626,6 +1687,25 @@ export default {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
handleSyncVersion() {
|
||||||
|
const request = {
|
||||||
|
...api.GET_NEW_MODEL_VERSION,
|
||||||
|
params: {
|
||||||
|
modelId: this.engineModelID,
|
||||||
|
userId: getUserId()
|
||||||
|
},
|
||||||
|
disableSuccessMsg: true
|
||||||
|
}
|
||||||
|
this.$request(request)
|
||||||
|
.asyncThen((resp) => {
|
||||||
|
if (resp && resp.data) {
|
||||||
|
console.log('同步参数版本成功:', resp.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('同步参数版本失败:', err)
|
||||||
|
})
|
||||||
|
},
|
||||||
// 处理节点拖拽完成
|
// 处理节点拖拽完成
|
||||||
handleNodeDrop(draggingNode, dropNode, dropType, ev) {
|
handleNodeDrop(draggingNode, dropNode, dropType, ev) {
|
||||||
// 找到第一级节点(根节点)
|
// 找到第一级节点(根节点)
|
||||||
@ -2175,7 +2255,8 @@ export default {
|
|||||||
const request = {
|
const request = {
|
||||||
...api.GET_ENGINE_TABLE_DETAIL,
|
...api.GET_ENGINE_TABLE_DETAIL,
|
||||||
params: {
|
params: {
|
||||||
modelID: this.detail.id
|
modelID: this.detail.id,
|
||||||
|
parameterVersion: this.currentVersionId || 1 // 默认版本为1
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -2202,7 +2283,8 @@ export default {
|
|||||||
const request = {
|
const request = {
|
||||||
...api.GET_ENGINE_TABLE_DETAIL,
|
...api.GET_ENGINE_TABLE_DETAIL,
|
||||||
params: {
|
params: {
|
||||||
modelID: this.detail.id
|
modelID: this.detail.id,
|
||||||
|
parameterVersion: this.currentVersionId || 1 // 默认版本为1
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
@ -3325,7 +3407,9 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.fillResendApprovalData(resendData)
|
this.fillResendApprovalData(resendData)
|
||||||
// 保存原始数据,用于后续比较是否有变更
|
// 保存原始数据,用于后续比较是否有变更
|
||||||
this.originalApprovalWorkflowSteps = JSON.parse(JSON.stringify(this.approvalWorkflowSteps))
|
this.originalApprovalWorkflowSteps = JSON.parse(
|
||||||
|
JSON.stringify(this.approvalWorkflowSteps)
|
||||||
|
)
|
||||||
this.originalProcessTitle = this.approvalFormData.processTitle || ''
|
this.originalProcessTitle = this.approvalFormData.processTitle || ''
|
||||||
// 在填充数据后再重置标志
|
// 在填充数据后再重置标志
|
||||||
this.isResendMode = false
|
this.isResendMode = false
|
||||||
@ -3616,10 +3700,11 @@ export default {
|
|||||||
|
|
||||||
// 如果接口返回了流程主题和说明,填充到表单
|
// 如果接口返回了流程主题和说明,填充到表单
|
||||||
// 优先从 data.data 中获取,其次从 data 中获取
|
// 优先从 data.data 中获取,其次从 data 中获取
|
||||||
const dataSource = (data && data.data) ? data.data : data
|
const dataSource = data && data.data ? data.data : data
|
||||||
if (dataSource && !Array.isArray(dataSource)) {
|
if (dataSource && !Array.isArray(dataSource)) {
|
||||||
if (dataSource.progressTitle || dataSource.processTitle) {
|
if (dataSource.progressTitle || dataSource.processTitle) {
|
||||||
this.approvalFormData.processTitle = dataSource.progressTitle || dataSource.processTitle || ''
|
this.approvalFormData.processTitle =
|
||||||
|
dataSource.progressTitle || dataSource.processTitle || ''
|
||||||
} else {
|
} else {
|
||||||
// 如果接口没有返回流程主题,使用默认值
|
// 如果接口没有返回流程主题,使用默认值
|
||||||
const productModel = this.detail?.modelName || '产品型号'
|
const productModel = this.detail?.modelName || '产品型号'
|
||||||
@ -3646,7 +3731,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 找到对应的审批环节
|
// 找到对应的审批环节
|
||||||
const step = this.approvalWorkflowSteps.find(s => s.name === nodeName)
|
const step = this.approvalWorkflowSteps.find((s) => s.name === nodeName)
|
||||||
if (!step) {
|
if (!step) {
|
||||||
console.warn('未找到匹配的审批环节:', nodeName)
|
console.warn('未找到匹配的审批环节:', nodeName)
|
||||||
return
|
return
|
||||||
@ -3661,28 +3746,36 @@ export default {
|
|||||||
|
|
||||||
// 从 assignees 中提取人员信息
|
// 从 assignees 中提取人员信息
|
||||||
// 根据返回的数据结构,assignees 中的对象有 id、username、userNumber、account 等字段
|
// 根据返回的数据结构,assignees 中的对象有 id、username、userNumber、account 等字段
|
||||||
const handlerInfos = assignees.map(assignee => {
|
const handlerInfos = assignees
|
||||||
// 使用 id 作为 userId(因为返回数据中使用的是 id 字段)
|
.map((assignee) => {
|
||||||
const userId = assignee.id || assignee.userId || ''
|
// 使用 id 作为 userId(因为返回数据中使用的是 id 字段)
|
||||||
return {
|
const userId = assignee.id || assignee.userId || ''
|
||||||
userId: userId,
|
return {
|
||||||
username: assignee.username || assignee.userName || '',
|
userId: userId,
|
||||||
userNumber: assignee.userNumber || assignee.account || userId
|
username: assignee.username || assignee.userName || '',
|
||||||
}
|
userNumber: assignee.userNumber || assignee.account || userId
|
||||||
}).filter(item => item.userId) // 过滤掉没有 userId 的项
|
}
|
||||||
|
})
|
||||||
|
.filter((item) => item.userId) // 过滤掉没有 userId 的项
|
||||||
|
|
||||||
console.log('处理后的 handlerInfos:', handlerInfos)
|
console.log('处理后的 handlerInfos:', handlerInfos)
|
||||||
|
|
||||||
// 如果有处理人信息,设置到 handlers 中(handlers 存储 userId 数组)
|
// 如果有处理人信息,设置到 handlers 中(handlers 存储 userId 数组)
|
||||||
if (handlerInfos.length > 0) {
|
if (handlerInfos.length > 0) {
|
||||||
// 使用 Vue.set 确保响应式更新
|
// 使用 Vue.set 确保响应式更新
|
||||||
this.$set(step, 'handlers', handlerInfos.map(h => h.userId).filter(Boolean))
|
this.$set(step, 'handlers', handlerInfos.map((h) => h.userId).filter(Boolean))
|
||||||
// 设置 options,确保已选择的人员信息在选项中(用于下拉框显示)
|
// 设置 options,确保已选择的人员信息在选项中(用于下拉框显示)
|
||||||
this.$set(step, 'options', handlerInfos.map(h => ({
|
this.$set(
|
||||||
userId: h.userId,
|
step,
|
||||||
username: h.username || '',
|
'options',
|
||||||
userNumber: h.userNumber || ''
|
handlerInfos
|
||||||
})).filter(opt => opt.userId))
|
.map((h) => ({
|
||||||
|
userId: h.userId,
|
||||||
|
username: h.username || '',
|
||||||
|
userNumber: h.userNumber || ''
|
||||||
|
}))
|
||||||
|
.filter((opt) => opt.userId)
|
||||||
|
)
|
||||||
console.log('更新后的 step:', step)
|
console.log('更新后的 step:', step)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -3784,8 +3877,10 @@ export default {
|
|||||||
for (let i = 0; i < originalNodeList.length; i++) {
|
for (let i = 0; i < originalNodeList.length; i++) {
|
||||||
const original = originalNodeList[i]
|
const original = originalNodeList[i]
|
||||||
const current = currentNodeList[i]
|
const current = currentNodeList[i]
|
||||||
if (original.nodeName !== current.nodeName ||
|
if (
|
||||||
JSON.stringify(original.assignees) !== JSON.stringify(current.assignees)) {
|
original.nodeName !== current.nodeName ||
|
||||||
|
JSON.stringify(original.assignees) !== JSON.stringify(current.assignees)
|
||||||
|
) {
|
||||||
hasChanged = true
|
hasChanged = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -4749,7 +4844,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:deep(.el-tree-node__content){
|
:deep(.el-tree-node__content) {
|
||||||
padding-left: 10px !important;
|
padding-left: 10px !important;
|
||||||
}
|
}
|
||||||
::v-deep .el-button {
|
::v-deep .el-button {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<template v-if="!showEngineDetail">
|
<template v-if="!showEngineDetail">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
竞品发动机数据
|
玉柴发动机数据
|
||||||
</div>
|
</div>
|
||||||
<div class="operation">
|
<div class="operation">
|
||||||
<el-button v-if="hasEngineDataEditPermission()" type="primary" @click="handleDownloadTemplate">下载模板</el-button>
|
<el-button v-if="hasEngineDataEditPermission()" type="primary" @click="handleDownloadTemplate">下载模板</el-button>
|
||||||
@ -108,9 +108,9 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
<span v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()" class="link-separator"></span>
|
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()"
|
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
style="margin-left: 5px;"
|
style="margin-left: 5px;"
|
||||||
@ -118,7 +118,7 @@
|
|||||||
>
|
>
|
||||||
分发
|
分发
|
||||||
</a>
|
</a>
|
||||||
<span v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1" class="link-separator"></span>
|
<span class="link-separator" v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -376,7 +376,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 检查是否有竞品发动机数据的编辑权限
|
// 检查是否有玉柴发动机数据的编辑权限
|
||||||
hasEngineDataEditPermission() {
|
hasEngineDataEditPermission() {
|
||||||
// 如果是管理员,拥有全部权限
|
// 如果是管理员,拥有全部权限
|
||||||
if (this.isAdmin()) {
|
if (this.isAdmin()) {
|
||||||
@ -391,14 +391,14 @@ export default {
|
|||||||
if (!Array.isArray(permissionData)) {
|
if (!Array.isArray(permissionData)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 检查是否有 permissionPath 为 "竞品发动机数据" 且 parameterPer 是编辑的权限
|
// 检查是否有 permissionPath 为 "玉柴发动机数据" 且 parameterPer 是编辑的权限
|
||||||
return permissionData.some((perm) => {
|
return permissionData.some((perm) => {
|
||||||
const permissionPath = perm.permissionPath || ''
|
const permissionPath = perm.permissionPath || ''
|
||||||
const parameterPer = perm.parameterPer || ''
|
const parameterPer = perm.parameterPer || ''
|
||||||
return permissionPath === '竞品发动机数据' && parameterPer === '编辑'
|
return permissionPath === '玉柴发动机数据' && parameterPer === '编辑'
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('检查竞品发动机数据编辑权限失败:', err)
|
console.error('检查玉柴发动机数据编辑权限失败:', err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -911,7 +911,4 @@ export default {
|
|||||||
width: 4px;
|
width: 4px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
::v-deep .el-button {
|
|
||||||
line-height: 0.85 !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user