feat:年前最后一版

This commit is contained in:
大黑 2026-02-24 08:50:46 +08:00
parent d7e9e51ebf
commit fd5ae6a55e
10 changed files with 2301 additions and 818 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

@ -23,7 +23,7 @@ export default {
}, },
// 导入引擎 // 导入引擎
IMPORT_ENGINE_MODEL: { IMPORT_ENGINE_MODEL: {
url: '/custom/dataEntryEngineModel/import', url: '/custom/engineParamDetailPojo/excelImport',
method: 'post' method: 'post'
}, },
// 获取参数列表 // 获取参数列表
@ -56,6 +56,10 @@ export default {
url: '/custom/activiti/updateNode', url: '/custom/activiti/updateNode',
method: 'post' method: 'post'
}, },
EDIT_DATA_DEPT: {
url: '/custom/engineParamDetailPojo/updateDept',
method: 'post'
},
REJECT_TODO_TASK: { REJECT_TODO_TASK: {
url: '/custom/todoTaskPojo/rejectTodo', url: '/custom/todoTaskPojo/rejectTodo',
method: 'post' method: 'post'

View File

@ -3148,6 +3148,8 @@ export default {
xAxisValueItem = model.burnType || '' xAxisValueItem = model.burnType || ''
} else if (xAxisValue === 'engineCapacity') { } else if (xAxisValue === 'engineCapacity') {
xAxisValueItem = model.engineCapacity || '' xAxisValueItem = model.engineCapacity || ''
} else if (xAxisValue === 'productNumber') {
xAxisValueItem = model.productNumber || ''
} }
if (xAxisValueItem) { if (xAxisValueItem) {

View File

@ -416,7 +416,7 @@ export default {
returnableNodes: [], returnableNodes: [],
selectedReturnNode: '', selectedReturnNode: '',
returnSubmitting: false, returnSubmitting: false,
returnOpinion: '', // 退使 returnOpinion: '拒绝', // 退使
isEditingProcessTitle: false, // isEditingProcessTitle: false, //
editingProcessTitle: '' // editingProcessTitle: '' //
} }
@ -989,20 +989,25 @@ export default {
this.returnableNodes = ['编制'] this.returnableNodes = ['编制']
}) })
this.selectedReturnNode = '' this.selectedReturnNode = ''
this.returnOpinion = '' this.returnOpinion = '拒绝'
this.returnNodeDialogVisible = true this.returnNodeDialogVisible = true
}, },
// 退 // 退
handleReturnNodeDialogClose() { handleReturnNodeDialogClose() {
this.returnNodeDialogVisible = false this.returnNodeDialogVisible = false
this.selectedReturnNode = '' this.selectedReturnNode = ''
this.returnOpinion = '' this.returnOpinion = '拒绝'
}, },
// 退 // 退
handleReturnNodeChange() { handleReturnNodeChange() {
// "" // ""
if (this.selectedReturnNode !== '编制') { if (this.selectedReturnNode !== '编制') {
this.returnOpinion = '' this.returnOpinion = ''
} else {
// """"
if (!this.returnOpinion) {
this.returnOpinion = '拒绝'
}
} }
}, },
// 退 // 退

View File

@ -15,7 +15,7 @@
<el-select <el-select
v-model="currentVersionId" v-model="currentVersionId"
size="small" size="small"
:disabled="!canSwitchVersion || isEditMode" :disabled="!canSwitchVersion || isEditMode || isEditDeptMode"
style="width: 120px;" style="width: 120px;"
@change="onVersionChange" @change="onVersionChange"
> >
@ -53,24 +53,27 @@
> >
<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" v-if="hasAnyEditPermission() && detail &&( detail.distributeStatus === '已完成' || detail.distributeStatus === '未分发')" @click="handleSyncVersion"> <el-button size="small" v-if="!isEditDeptMode && hasAnyEditPermission() && detail &&( detail.distributeStatus === '已完成' || detail.distributeStatus === '未分发')" @click="handleSyncVersion">
同步参数版本 同步参数版本
</el-button> </el-button>
<el-button size="small" v-if="!isEditDeptMode && hasAnyEditPermission() && detail &&( detail.distributeStatus === '已完成' || detail.distributeStatus === '未分发')" @click="handleEditDept">
编辑部门
</el-button>
<el-button <el-button
v-if="hasAnyEditPermission() && detail && detail.distributeStatus === '已完成'" v-if="!isEditMode && !isEditDeptMode && hasAnyEditPermission() && detail && detail.distributeStatus === '已完成'"
size="small" size="small"
@click="handleEdit"> @click="handleEdit">
编辑 编辑
</el-button> </el-button>
<el-button <el-button
v-if="!isEditMode && !isJustCheckMode" v-if="!isEditMode && !isEditDeptMode && !isJustCheckMode"
size="small" size="small"
style="margin-left: 12px;" style="margin-left: 12px;"
@click="handleExportTemplate" @click="handleExportTemplate"
>下载导入模板</el-button >下载导入模板</el-button
> >
<el-button <el-button
v-if="!isEditMode && !isJustCheckMode" v-if="!isEditMode && !isEditDeptMode && !isJustCheckMode"
size="small" size="small"
:disabled="importing" :disabled="importing"
:loading="importing" :loading="importing"
@ -84,7 +87,7 @@
accept=".xlsx,.xls" accept=".xlsx,.xls"
@change="handleFileChange" @change="handleFileChange"
/> />
<template v-if="!isEditMode && !isJustCheckMode"> <template v-if="!isEditMode && !isEditDeptMode && !isJustCheckMode && (!detail || detail.distributeStatus !== '已完成')">
<el-button v-if="hasAnyEditPermission()" size="small" @click="handleEdit" <el-button v-if="hasAnyEditPermission()" size="small" @click="handleEdit"
>编辑</el-button >编辑</el-button
> >
@ -108,7 +111,7 @@
</el-button> </el-button>
</template> </template>
<!-- 查看模式下如果状态是已完成显示编辑按钮或发起审批按钮 --> <!-- 查看模式下如果状态是已完成显示编辑按钮或发起审批按钮 -->
<template v-if="!isEditMode && detail && detail.distributeStatus === '已完成'"> <template v-if="!isEditMode && !isEditDeptMode && detail && detail.distributeStatus === '已完成'">
<el-button <el-button
v-if="hasSavedInCheckMode" v-if="hasSavedInCheckMode"
@ -122,6 +125,11 @@
<el-button size="small" @click="handleSaveEdit">保存编辑</el-button> <el-button size="small" @click="handleSaveEdit">保存编辑</el-button>
<el-button size="small" @click="handleCancelEdit">取消</el-button> <el-button size="small" @click="handleCancelEdit">取消</el-button>
</template> </template>
<template v-else-if="isEditDeptMode">
<el-button size="small" @click="handleBatchModifyDept">批量修改</el-button>
<el-button size="small" @click="handleSaveDeptEdit">保存编辑</el-button>
<el-button size="small" @click="handleCancelDeptEdit">取消</el-button>
</template>
</template> </template>
</div> </div>
</div> </div>
@ -267,7 +275,24 @@
<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">
<span>{{ formatDepartmentDisplay(row.department) }}</span> <span v-if="!isEditDeptMode">{{ formatDepartmentDisplay(row.department) }}</span>
<el-select
v-else-if="isEditDeptMode"
v-model="row.department"
size="small"
placeholder="请选择部门"
class="dept-select"
clearable
filterable
:filter-method="handleDeptRemoteSearch"
>
<el-option
v-for="dept in filteredDeptOptions"
:key="dept.id"
:value="dept.name"
:label="dept.name"
/>
</el-select>
</div> </div>
<!-- 分发状态列只在分发责任人模式下显示 --> <!-- 分发状态列只在分发责任人模式下显示 -->
<div v-if="isDispatchMode && dispatchType !== 'update_param'" class="cell"> <div v-if="isDispatchMode && dispatchType !== 'update_param'" class="cell">
@ -510,6 +535,77 @@
@confirm="handleBatchModifyConfirm" @confirm="handleBatchModifyConfirm"
@refresh-responsible-persons="loadResponsiblePersons" @refresh-responsible-persons="loadResponsiblePersons"
/> />
<!-- 批量修改部门弹窗 -->
<el-dialog
title="批量修改部门"
:visible.sync="batchModifyDeptDialogVisible"
width="600px"
append-to-body
@close="handleBatchModifyDeptDialogClose"
>
<el-form
ref="batchModifyDeptForm"
:model="batchModifyDeptFormData"
:rules="batchModifyDeptFormRules"
label-width="120px"
>
<el-form-item label="子系统:" prop="subsystem">
<el-select
v-model="batchModifyDeptFormData.subsystem"
placeholder="请选择子系统"
clearable
style="width: 100%"
@change="handleBatchModifyDeptSubsystemChange"
>
<el-option
v-for="item in batchModifyDeptSubsystemList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="零部件名称:" prop="partsName">
<el-select
v-model="batchModifyDeptFormData.partsName"
placeholder="请选择零部件名称"
clearable
multiple
style="width: 100%"
:disabled="!batchModifyDeptFormData.subsystem"
>
<el-option
v-for="item in batchModifyDeptPartsNameList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="部门:" prop="department">
<el-select
v-model="batchModifyDeptFormData.department"
placeholder="请选择部门"
clearable
filterable
style="width: 100%"
:filter-method="handleBatchModifyDeptRemoteSearch"
>
<el-option
v-for="dept in filteredBatchModifyDeptOptions"
:key="dept.id"
:value="dept.name"
:label="dept.name"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleBatchModifyDeptDialogClose">取消</el-button>
<el-button type="primary" :loading="batchModifyDeptSubmitting" @click="handleBatchModifyDeptConfirm">确定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -585,10 +681,26 @@ export default {
data() { data() {
return { return {
isEditMode: false, isEditMode: false,
isEditDeptMode: false, //
originalData: null, // originalData: null, //
originalDeptData: null, //
dispatchOriginalData: null, // dispatchOriginalData: null, //
savedCheckedKeys: [], // savedCheckedKeys: [], //
savedDefaultExpandedKeys: [], // savedDefaultExpandedKeys: [], //
departmentList: [], //
deptLoading: false, // loading
deptSearchText: '', //
//
batchModifyDeptDialogVisible: false, //
batchModifyDeptSubmitting: false, // loading
batchModifyDeptFormData: {
subsystem: '',
partsName: [],
department: ''
},
batchModifyDeptSubsystemList: [], //
batchModifyDeptPartsNameList: [], //
batchModifyDeptSearchText: '', //
currentVersionId: '', currentVersionId: '',
hasVersionChanged: false, // hasVersionChanged: false, //
treeFilterText: '', treeFilterText: '',
@ -675,15 +787,56 @@ export default {
const version = this.versions.find((v) => v.id === this.currentVersionId) const version = this.versions.find((v) => v.id === this.currentVersionId)
return version ? version.label : 'V1' return version ? version.label : 'V1'
}, },
//
filteredDeptOptions() {
if (!this.deptSearchText || this.deptSearchText.trim() === '') {
return this.departmentList
}
const searchText = this.deptSearchText.toLowerCase()
return this.departmentList.filter((dept) => {
return dept.name && dept.name.toLowerCase().includes(searchText)
})
},
//
filteredBatchModifyDeptOptions() {
if (!this.batchModifyDeptSearchText || this.batchModifyDeptSearchText.trim() === '') {
return this.departmentList
}
const searchText = this.batchModifyDeptSearchText.toLowerCase()
return this.departmentList.filter((dept) => {
return dept.name && dept.name.toLowerCase().includes(searchText)
})
},
//
batchModifyDeptFormRules() {
return {
subsystem: [
{ required: true, message: '请选择子系统', trigger: 'change' }
],
partsName: [
{
required: true,
type: 'array',
min: 1,
message: '请至少选择一个零部件名称',
trigger: 'change'
}
],
department: [
{ required: true, message: '请选择部门', trigger: 'change' }
]
}
},
// //
canSwitchVersion() { canSwitchVersion() {
// //
return ( return (
!this.hideOperations && !this.hideOperations &&
!this.isDispatchMode && !this.isDispatchMode &&
!this.fromTodo && !this.fromTodo &&
!this.filledBy && !this.filledBy &&
!this.isEditMode !this.isEditMode &&
!this.isEditDeptMode
) )
}, },
// justCheck // justCheck
@ -985,6 +1138,8 @@ export default {
// //
this.loadResponsiblePersons() this.loadResponsiblePersons()
this.loadFillerPersons() this.loadFillerPersons()
//
this.loadDepartmentList()
// //
this.getversions() this.getversions()
// //
@ -2124,13 +2279,325 @@ export default {
handleCancelEdit() { handleCancelEdit() {
// //
if (this.originalData) { if (this.originalData) {
//
this.versionData = JSON.parse(JSON.stringify(this.originalData)) this.versionData = JSON.parse(JSON.stringify(this.originalData))
//
this.$nextTick(() => {
this.$forceUpdate()
})
} }
this.isEditMode = false this.isEditMode = false
this.originalData = null this.originalData = null
this.changeData = [] // this.changeData = [] //
// hasSavedInCheckMode // hasSavedInCheckMode
}, },
//
handleEditDept() {
//
this.originalDeptData = JSON.parse(JSON.stringify(this.versionData))
this.isEditDeptMode = true
},
//
handleSaveDeptEdit() {
if (!this.originalDeptData) {
this.$message({
type: 'warning',
message: '没有原始数据,无法比较'
})
return
}
const currentData = this.versionData[this.currentVersionId] || {}
const originalVersionData = this.originalDeptData[this.currentVersionId] || {}
const deptChangeData = []
//
Object.keys(currentData).forEach((partsName) => {
const currentParams = currentData[partsName] || []
const originalParams = originalVersionData[partsName] || []
// 便
const originalMap = new Map()
originalParams.forEach((param) => {
const key = param.id || `${param.parameterName}_${param.subsystemName}`
originalMap.set(key, param)
})
//
currentParams.forEach((currentParam) => {
const key =
currentParam.id || `${currentParam.parameterName}_${currentParam.subsystemName}`
const originalParam = originalMap.get(key)
if (originalParam) {
// department
const currentDept = currentParam.department || ''
const originalDept = originalParam.department || ''
if (currentDept !== originalDept) {
// deptChangeData
deptChangeData.push({
paramId: currentParam.id || currentParam.parameterId,
department: currentDept
})
}
}
})
})
//
if (deptChangeData.length === 0) {
this.$message({
type: 'warning',
message: '没有部门数据被修改'
})
this.isEditDeptMode = false
this.originalDeptData = null
return
}
console.log('修改的部门数据项:', deptChangeData)
// modelId使 detail.id使 engineModelID使 currentEngineModelID
const modelId = (this.detail && this.detail.id) || this.engineModelID || this.currentEngineModelID
if (!modelId) {
this.$message({
type: 'error',
message: '缺少机型ID无法保存'
})
return
}
//
const requestParams = {
modelId: modelId,
userId: getUserId(),
list: deptChangeData
}
//
const request = {
...api.EDIT_DATA_DEPT,
params: requestParams,
disableSuccessMsg: true
}
this.$request(request)
.asyncThen((resp) => {
this.isEditDeptMode = false
this.originalDeptData = null
//
this.loadEngineDetail()
this.$message({
type: 'success',
message: '保存成功'
})
})
.asyncErrorCatch((err) => {
console.error('保存部门失败:', err)
this.$message({
type: 'error',
message: err?.message || '保存失败,请重试'
})
})
},
//
handleCancelDeptEdit() {
//
if (this.originalDeptData) {
this.versionData = JSON.parse(JSON.stringify(this.originalDeptData))
}
this.isEditDeptMode = false
this.originalDeptData = null
},
//
loadDepartmentList() {
const request = {
...api.GET_DEPT_OF_USER,
disableSuccessMsg: true
}
this.$request(request)
.asyncThen((resp) => {
// { id, name }
let result = []
if (resp && resp.data) {
result = Array.isArray(resp.data) ? resp.data : (resp.data.data || [])
}
// id name
this.departmentList = this.formatDepartmentListData(result)
})
.asyncErrorCatch((err) => {
console.error('加载部门列表失败:', err)
this.departmentList = []
})
},
//
formatDepartmentListData(data) {
if (!Array.isArray(data)) {
return []
}
//
const formatNode = (node) => {
const formatted = {
id: node.id,
name: node.name || node.label || ''
}
return formatted
}
//
const extractAllNodes = (nodes) => {
let allNodes = []
nodes.forEach((node) => {
allNodes.push(formatNode(node))
if (node.children && Array.isArray(node.children) && node.children.length > 0) {
allNodes = allNodes.concat(extractAllNodes(node.children))
}
})
return allNodes
}
return extractAllNodes(data)
},
// el-select filter-method
handleDeptRemoteSearch(query) {
this.deptSearchText = query || ''
// filteredDeptOptions deptSearchText
},
//
handleBatchModifyDept() {
//
this.batchModifyDeptFormData = {
subsystem: '',
partsName: [],
department: ''
}
this.batchModifyDeptSubsystemList = []
this.batchModifyDeptPartsNameList = []
this.batchModifyDeptSearchText = ''
//
const currentData = this.versionData[this.currentVersionId] || {}
const subsystemSet = new Set()
Object.keys(currentData).forEach((partsName) => {
const params = currentData[partsName] || []
params.forEach((param) => {
if (param.subsystemName) {
subsystemSet.add(param.subsystemName)
}
})
})
this.batchModifyDeptSubsystemList = Array.from(subsystemSet).sort()
this.batchModifyDeptDialogVisible = true
//
this.$nextTick(() => {
if (this.$refs.batchModifyDeptForm) {
this.$refs.batchModifyDeptForm.clearValidate()
}
})
},
//
handleBatchModifyDeptSubsystemChange(subsystem) {
//
this.batchModifyDeptFormData.partsName = []
this.batchModifyDeptFormData.department = ''
this.batchModifyDeptPartsNameList = []
if (!subsystem) {
return
}
//
const currentData = this.versionData[this.currentVersionId] || {}
const partsNameSet = new Set()
Object.keys(currentData).forEach((dataPartsName) => {
const params = currentData[dataPartsName] || []
params.forEach((param) => {
if (param.subsystemName === subsystem) {
const paramPartsName = param.partsName || dataPartsName
if (paramPartsName) {
partsNameSet.add(paramPartsName)
}
}
})
})
this.batchModifyDeptPartsNameList = Array.from(partsNameSet).sort()
},
//
handleBatchModifyDeptRemoteSearch(query) {
this.batchModifyDeptSearchText = query || ''
},
//
handleBatchModifyDeptDialogClose() {
this.batchModifyDeptDialogVisible = false
this.batchModifyDeptFormData = {
subsystem: '',
partsName: [],
department: ''
}
this.batchModifyDeptSubsystemList = []
this.batchModifyDeptPartsNameList = []
this.batchModifyDeptSearchText = ''
if (this.$refs.batchModifyDeptForm) {
this.$refs.batchModifyDeptForm.clearValidate()
}
},
//
handleBatchModifyDeptConfirm() {
this.$refs.batchModifyDeptForm.validate((valid) => {
if (valid) {
const { subsystem, partsName, department } = this.batchModifyDeptFormData
if (!subsystem || !partsName || !Array.isArray(partsName) || partsName.length === 0 || !department) {
this.$message({
type: 'warning',
message: '请完整填写表单信息'
})
return
}
//
const currentData = this.versionData[this.currentVersionId] || {}
let updateCount = 0
//
Object.keys(currentData).forEach((dataPartsName) => {
const params = currentData[dataPartsName] || []
params.forEach((param) => {
const paramPartsName = param.partsName || dataPartsName
//
if (
param.subsystemName === subsystem &&
partsName.includes(paramPartsName)
) {
//
this.$set(param, 'department', department)
updateCount++
}
})
})
if (updateCount > 0) {
this.$message({
type: 'success',
message: `已批量更新 ${updateCount} 个参数的部门`
})
this.handleBatchModifyDeptDialogClose()
} else {
this.$message({
type: 'warning',
message: '未找到匹配的参数'
})
}
}
})
},
handleBatchModifyResponsible() { handleBatchModifyResponsible() {
// //
this.$refs.batchModifyResponsibleModal.showModal() this.$refs.batchModifyResponsibleModal.showModal()
@ -2239,7 +2706,11 @@ export default {
if (updateCount > 0) { if (updateCount > 0) {
// this.$message.success(` ${updateCount} `) // this.$message.success(` ${updateCount} `)
} else { } else {
this.$message.warning('未找到匹配的参数') this.$message({
type: 'warning',
message: '没有参数被修改'
})
return
} }
return return
} }

View File

@ -1297,11 +1297,19 @@ export default {
this.loadManagerData() this.loadManagerData()
}) })
.catch((err) => { .catch((err) => {
let errMessage = ''
if (err && err.data && err.data.errors && Array.isArray(err.data.errors)) {
for (let error of err.data.errors) {
errMessage += error + '\n'
}
} else {
errMessage = err.message || '导入失败,请稍后重试'
}
console.error('导入失败:', err) console.error('导入失败:', err)
loadingInstance.close() loadingInstance.close()
this.$message({ this.$message({
type: 'error', type: 'error',
message: err.message || '导入失败,请稍后重试' message: errMessage || '导入失败,请稍后重试'
}) })
}) })
.finally(() => { .finally(() => {

View File

@ -578,7 +578,7 @@ export default {
returnableNodes: [], returnableNodes: [],
selectedReturnNode: '', selectedReturnNode: '',
returnSubmitting: false, returnSubmitting: false,
returnOpinion: '', // 退使 returnOpinion: '拒绝', // 退使
isEditMode: false, // isEditMode: false, //
editFormData: { editFormData: {
title: '', title: '',
@ -1087,20 +1087,25 @@ export default {
this.returnableNodes = ['编制'] this.returnableNodes = ['编制']
}) })
this.selectedReturnNode = '' this.selectedReturnNode = ''
this.returnOpinion = '' this.returnOpinion = '拒绝'
this.returnNodeDialogVisible = true this.returnNodeDialogVisible = true
}, },
// 退 // 退
handleReturnNodeDialogClose() { handleReturnNodeDialogClose() {
this.returnNodeDialogVisible = false this.returnNodeDialogVisible = false
this.selectedReturnNode = '' this.selectedReturnNode = ''
this.returnOpinion = '' this.returnOpinion = '拒绝'
}, },
// 退 // 退
handleReturnNodeChange() { handleReturnNodeChange() {
// "" // ""
if (this.selectedReturnNode !== '编制') { if (this.selectedReturnNode !== '编制') {
this.returnOpinion = '' this.returnOpinion = ''
} else {
// """"
if (!this.returnOpinion) {
this.returnOpinion = '拒绝'
}
} }
}, },
// 退 // 退