fix:修改

This commit is contained in:
大黑 2026-01-04 14:50:33 +08:00
parent 78937e0ada
commit c37ce897f2
17 changed files with 1513 additions and 969 deletions

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

View File

@ -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) {

View File

@ -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) => {

View File

@ -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 {

View File

@ -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(() => {

View File

@ -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;

View File

@ -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

View File

@ -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) => {

View File

@ -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

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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())

View File

@ -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

View File

@ -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) => {