feat:修改bug
This commit is contained in:
parent
662ea9a8ec
commit
280546c410
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ yarn-error.log*
|
|||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
node_modules.zip
|
node_modules.zip
|
||||||
|
apaas-custom-mydemo.zip
|
||||||
|
|||||||
Binary file not shown.
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
@ -34,29 +34,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail-content">
|
<div class="detail-content">
|
||||||
<!-- <section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
基础信息
|
基础信息
|
||||||
</div>
|
</div>
|
||||||
<div class="info-grid">
|
<div class="info-grid">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">模板名称</span>
|
<span class="label">流程主题</span>
|
||||||
<span class="value">{{ progressDetail.modelName || '--' }}</span>
|
<span class="value">{{ progressDetail.modelName || '--' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">申请人</span>
|
<span class="label">模板名称</span>
|
||||||
<span class="value">{{ progressDetail.applicant || '--' }}</span>
|
<span class="value">{{ progressDetail.applicant || '--' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">所属部门</span>
|
<span class="label">版本</span>
|
||||||
<span class="value">{{ progressDetail.department || '--' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">提交时间</span>
|
|
||||||
<span class="value">{{ progressDetail.submitTime || '--' }}</span>
|
<span class="value">{{ progressDetail.submitTime || '--' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section> -->
|
</section>
|
||||||
|
|
||||||
<section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
|
|||||||
@ -39,6 +39,7 @@
|
|||||||
v-model="formData.partsName"
|
v-model="formData.partsName"
|
||||||
placeholder="请选择零部件名称"
|
placeholder="请选择零部件名称"
|
||||||
clearable
|
clearable
|
||||||
|
multiple
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="!formData.subsystem"
|
:disabled="!formData.subsystem"
|
||||||
@change="handlePartsNameChange"
|
@change="handlePartsNameChange"
|
||||||
@ -57,7 +58,7 @@
|
|||||||
placeholder="请选择部门"
|
placeholder="请选择部门"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="dispatchType === 'update_param' ? (!formData.subsystem || !formData.partsName) : !formData.subsystem"
|
:disabled="dispatchType === 'update_param' ? (!formData.subsystem || !formData.partsName || !Array.isArray(formData.partsName) || formData.partsName.length === 0) : !formData.subsystem"
|
||||||
@change="handleDepartmentChange"
|
@change="handleDepartmentChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -151,7 +152,7 @@ export default {
|
|||||||
submitting: false,
|
submitting: false,
|
||||||
formData: {
|
formData: {
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
partsName: '', // 零部件名称(仅用于批量修改填写人)
|
partsName: [], // 零部件名称(仅用于批量修改填写人,多选)
|
||||||
department: '',
|
department: '',
|
||||||
currentResponsibleId: '', // 现责任人的ID(用于判断是新增还是修改)
|
currentResponsibleId: '', // 现责任人的ID(用于判断是新增还是修改)
|
||||||
currentResponsibleName: '', // 现责任人名称(只读显示)
|
currentResponsibleName: '', // 现责任人名称(只读显示)
|
||||||
@ -191,7 +192,13 @@ export default {
|
|||||||
// 如果是批量修改填写人,添加零部件名称验证
|
// 如果是批量修改填写人,添加零部件名称验证
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
rules.partsName = [
|
rules.partsName = [
|
||||||
{ required: true, message: '请选择零部件名称', trigger: 'change' }
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'array',
|
||||||
|
min: 1,
|
||||||
|
message: '请至少选择一个零部件名称',
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
return rules
|
return rules
|
||||||
@ -218,7 +225,7 @@ export default {
|
|||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.formData = {
|
this.formData = {
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
partsName: '',
|
partsName: [],
|
||||||
department: '',
|
department: '',
|
||||||
currentResponsibleId: '',
|
currentResponsibleId: '',
|
||||||
currentResponsibleName: '',
|
currentResponsibleName: '',
|
||||||
@ -251,7 +258,7 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
this.formData = {
|
this.formData = {
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
partsName: '',
|
partsName: [],
|
||||||
department: '',
|
department: '',
|
||||||
currentResponsibleId: '',
|
currentResponsibleId: '',
|
||||||
currentResponsibleName: '',
|
currentResponsibleName: '',
|
||||||
@ -312,7 +319,7 @@ export default {
|
|||||||
// 处理子系统选择变化
|
// 处理子系统选择变化
|
||||||
handleSubsystemChange(subsystem) {
|
handleSubsystemChange(subsystem) {
|
||||||
// 清空零部件名称、部门和现责任人/现填写人
|
// 清空零部件名称、部门和现责任人/现填写人
|
||||||
this.formData.partsName = ''
|
this.formData.partsName = []
|
||||||
this.formData.department = ''
|
this.formData.department = ''
|
||||||
this.formData.currentResponsibleId = ''
|
this.formData.currentResponsibleId = ''
|
||||||
this.formData.currentResponsibleName = ''
|
this.formData.currentResponsibleName = ''
|
||||||
@ -375,7 +382,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 处理零部件名称选择变化(仅用于批量修改填写人)
|
// 处理零部件名称选择变化(仅用于批量修改填写人)
|
||||||
handlePartsNameChange(partsName) {
|
handlePartsNameChange(partsNames) {
|
||||||
|
// partsNames 现在是数组
|
||||||
// 清空部门、现填写人和新填写人
|
// 清空部门、现填写人和新填写人
|
||||||
this.formData.department = ''
|
this.formData.department = ''
|
||||||
this.formData.currentFillerId = ''
|
this.formData.currentFillerId = ''
|
||||||
@ -386,13 +394,13 @@ export default {
|
|||||||
this.availableDepartments = []
|
this.availableDepartments = []
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
// 根据子系统和零部件名称筛选部门列表
|
// 根据子系统和零部件名称筛选部门列表
|
||||||
if (partsName && this.formData.subsystem) {
|
if (partsNames && Array.isArray(partsNames) && partsNames.length > 0 && this.formData.subsystem) {
|
||||||
this.filterDepartmentsByPartsName()
|
this.filterDepartmentsByPartsName()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 根据子系统和零部件名称筛选部门列表(仅用于批量修改填写人)
|
// 根据子系统和零部件名称筛选部门列表(仅用于批量修改填写人)
|
||||||
filterDepartmentsByPartsName() {
|
filterDepartmentsByPartsName() {
|
||||||
if (!this.formData.subsystem || !this.formData.partsName) {
|
if (!this.formData.subsystem || !this.formData.partsName || !Array.isArray(this.formData.partsName) || this.formData.partsName.length === 0) {
|
||||||
this.availableDepartments = []
|
this.availableDepartments = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -405,11 +413,11 @@ export default {
|
|||||||
const params = currentVersionData[dataPartsName] || []
|
const params = currentVersionData[dataPartsName] || []
|
||||||
// 遍历该零部件下的所有参数
|
// 遍历该零部件下的所有参数
|
||||||
params.forEach((param) => {
|
params.forEach((param) => {
|
||||||
// 检查参数是否属于选中的子系统和零部件名称
|
// 检查参数是否属于选中的子系统和任意一个选中的零部件名称
|
||||||
const paramPartsName = param.partsName || dataPartsName
|
const paramPartsName = param.partsName || dataPartsName
|
||||||
if (
|
if (
|
||||||
param.subsystemName === this.formData.subsystem &&
|
param.subsystemName === this.formData.subsystem &&
|
||||||
paramPartsName === this.formData.partsName &&
|
this.formData.partsName.includes(paramPartsName) &&
|
||||||
param.department
|
param.department
|
||||||
) {
|
) {
|
||||||
departmentSet.add(param.department)
|
departmentSet.add(param.department)
|
||||||
@ -576,15 +584,15 @@ export default {
|
|||||||
// 如果是批量修改填写人,不调用接口,直接触发确认事件
|
// 如果是批量修改填写人,不调用接口,直接触发确认事件
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
// 验证零部件名称
|
// 验证零部件名称
|
||||||
if (!this.formData.partsName) {
|
if (!this.formData.partsName || !Array.isArray(this.formData.partsName) || this.formData.partsName.length === 0) {
|
||||||
this.$message.warning('请选择零部件名称')
|
this.$message.warning('请至少选择一个零部件名称')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 确保所有必要参数都有值
|
// 确保所有必要参数都有值
|
||||||
// 如果 userNumber 为空,使用 userId 作为 userNumber(降级处理)
|
// 如果 userNumber 为空,使用 userId 作为 userNumber(降级处理)
|
||||||
const confirmData = {
|
const confirmData = {
|
||||||
subsystem: this.formData.subsystem,
|
subsystem: this.formData.subsystem,
|
||||||
partsName: this.formData.partsName,
|
partsName: this.formData.partsName, // 现在是数组
|
||||||
department: this.formData.department,
|
department: this.formData.department,
|
||||||
userId: this.formData.userId, // 确保传递userId
|
userId: this.formData.userId, // 确保传递userId
|
||||||
userNumber: this.formData.userNumber || this.formData.userId, // 如果没有 userNumber,使用 userId
|
userNumber: this.formData.userNumber || this.formData.userId, // 如果没有 userNumber,使用 userId
|
||||||
|
|||||||
@ -18,16 +18,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div v-if="detail.statusDescription === '审核中'" class="header-right">
|
||||||
<el-button size="small" @click="handleReject">
|
<el-button size="small" @click="handleReject">
|
||||||
退回
|
退回
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="small" @click="handleSubmit">
|
<el-button v-if="detail.statusDescription === '审核中'" type="primary" size="small" @click="handleSubmit">
|
||||||
提交
|
提交
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail-content">
|
<div class="detail-content">
|
||||||
|
<section class="block-section">
|
||||||
|
<div class="section-title">
|
||||||
|
基础信息
|
||||||
|
</div>
|
||||||
|
<div class="info-grid">
|
||||||
|
<div class="info-item">
|
||||||
|
<span class="label">流程主题</span>
|
||||||
|
<span class="value">{{ progressDetail.modelName || '--' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-item">
|
||||||
|
<span class="label">机型名称</span>
|
||||||
|
<span class="value">{{ progressDetail.applicant || '--' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-item">
|
||||||
|
<span class="label">版本</span>
|
||||||
|
<span class="value">{{ progressDetail.submitTime || '--' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section class="block-section">
|
<section class="block-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
审批内容
|
审批内容
|
||||||
@ -271,35 +290,32 @@ export default {
|
|||||||
|
|
||||||
// 使用 activitiRecordDTOS 数据构建审批流程节点
|
// 使用 activitiRecordDTOS 数据构建审批流程节点
|
||||||
if (this.activitiRecordDTOS && this.activitiRecordDTOS.length > 0) {
|
if (this.activitiRecordDTOS && this.activitiRecordDTOS.length > 0) {
|
||||||
// 如果状态描述是"已通过",则最后一项也是完成状态
|
this.activitiRecordDTOS.forEach((record) => {
|
||||||
const isPassed = this.detail && this.detail.statusDescription === '已通过'
|
// 根据每一项的 operate 字段设置状态
|
||||||
const isWithdrawn = this.detail && this.detail.statusDescription === '已撤回'
|
// REJECT -> 红色(拒绝)
|
||||||
const isReject = this.detail && this.detail.statusDescription === '驳回'
|
// APPROVING -> 黄色(审批中)
|
||||||
this.activitiRecordDTOS.forEach((record, index) => {
|
// PASS -> 绿色(通过)
|
||||||
const isLast = index === this.activitiRecordDTOS.length - 1
|
let result = 'APPROVING' // 默认状态为审批中
|
||||||
// 最后一项的状态判断:
|
let status = 'APPROVING'
|
||||||
// 1. 如果整体状态是"已撤回"或"驳回",最后一项显示为"驳回"(红色)
|
|
||||||
// 2. 如果整体状态是"已通过",最后一项显示为"通过"
|
if (record.operate) {
|
||||||
// 3. 其他情况,最后一项显示为"审批中"
|
const operate = String(record.operate).toUpperCase()
|
||||||
let result = 'PASS'
|
if (operate === 'REJECT') {
|
||||||
let status = 'PASS'
|
|
||||||
if (isLast) {
|
|
||||||
if (isWithdrawn || isReject) {
|
|
||||||
result = 'REJECT'
|
result = 'REJECT'
|
||||||
status = 'REJECT'
|
status = 'REJECT'
|
||||||
} else if (isPassed) {
|
} else if (operate === 'APPROVING') {
|
||||||
result = 'PASS'
|
|
||||||
status = 'PASS'
|
|
||||||
} else {
|
|
||||||
result = 'APPROVING'
|
result = 'APPROVING'
|
||||||
status = 'APPROVING'
|
status = 'APPROVING'
|
||||||
|
} else if (operate === 'PASS') {
|
||||||
|
result = 'PASS'
|
||||||
|
status = 'PASS'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes.push({
|
nodes.push({
|
||||||
title: record.node || '审批节点',
|
title: record.node || '审批节点',
|
||||||
userName: record.approverPersons || '--',
|
userName: record.approverPersons || '--',
|
||||||
time: record.approvalTime || record.handleTime || record.createTime || '',
|
operateTime: record.approvalTime || record.handleTime || record.createTime || '',
|
||||||
result: result,
|
result: result,
|
||||||
status: status,
|
status: status,
|
||||||
opinion: record.common || record.comment || record.opinion || null
|
opinion: record.common || record.comment || record.opinion || null
|
||||||
@ -423,7 +439,7 @@ export default {
|
|||||||
setStatusText(result) {
|
setStatusText(result) {
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
PASS: '通过',
|
PASS: '通过',
|
||||||
REJECT: '驳回',
|
REJECT: '拒绝',
|
||||||
REFUSE: '驳回',
|
REFUSE: '驳回',
|
||||||
APPROVE: '批准',
|
APPROVE: '批准',
|
||||||
APPROVING: '审批中',
|
APPROVING: '审批中',
|
||||||
|
|||||||
@ -1452,7 +1452,8 @@ 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)
|
||||||
if (!subsystem || !partsName || !department || !userId) {
|
// partsName 现在是数组
|
||||||
|
if (!subsystem || !partsName || !Array.isArray(partsName) || partsName.length === 0 || !department || !userId) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: '缺少必要参数'
|
message: '缺少必要参数'
|
||||||
@ -1480,11 +1481,12 @@ export default {
|
|||||||
// 获取参数的零部件名称(优先使用param.partsName,否则使用dataPartsName)
|
// 获取参数的零部件名称(优先使用param.partsName,否则使用dataPartsName)
|
||||||
const paramPartsName = param.partsName || dataPartsName
|
const paramPartsName = param.partsName || dataPartsName
|
||||||
|
|
||||||
// 检查参数是否匹配子系统、零部件名称和部门
|
// 检查参数是否匹配子系统、零部件名称(数组)和部门
|
||||||
// 当 partsName 为 '/' 时,匹配所有子系统为选中子系统且 partsName 为 '/' 的参数
|
// 当 partsName 数组中包含 '/' 时,匹配所有子系统为选中子系统且 partsName 为 '/' 的参数
|
||||||
|
// 当 partsName 数组中包含其他值时,匹配对应的零部件名称
|
||||||
if (
|
if (
|
||||||
param.subsystemName === subsystem &&
|
param.subsystemName === subsystem &&
|
||||||
paramPartsName === partsName &&
|
partsName.includes(paramPartsName) &&
|
||||||
param.department === department
|
param.department === department
|
||||||
) {
|
) {
|
||||||
// 更新填写人信息
|
// 更新填写人信息
|
||||||
|
|||||||
@ -438,7 +438,9 @@
|
|||||||
:on-remove="handleImportFileRemove"
|
:on-remove="handleImportFileRemove"
|
||||||
>
|
>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text"> 将文件拖到此处,或<em>点击上传</em> </div>
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或<em>点击上传</em>
|
||||||
|
</div>
|
||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
仅支持Excel或CSV模板文件
|
仅支持Excel或CSV模板文件
|
||||||
</div>
|
</div>
|
||||||
@ -730,10 +732,10 @@ export default {
|
|||||||
pageConfig: this.isMaintainMode
|
pageConfig: this.isMaintainMode
|
||||||
? { hidden: true }
|
? { hidden: true }
|
||||||
: {
|
: {
|
||||||
currentPage: this.pagination.currentPage,
|
currentPage: this.pagination.currentPage,
|
||||||
pageSize: this.pagination.pageSize,
|
pageSize: this.pagination.pageSize,
|
||||||
total: this.pagination.total
|
total: this.pagination.total
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paramModalTitle() {
|
paramModalTitle() {
|
||||||
@ -1256,6 +1258,22 @@ export default {
|
|||||||
}
|
}
|
||||||
return findPath(this.departmentList, departmentId) || ''
|
return findPath(this.departmentList, departmentId) || ''
|
||||||
},
|
},
|
||||||
|
// 格式化部门显示:只显示最后一个节点
|
||||||
|
formatDepartmentDisplay(department) {
|
||||||
|
if (!department) {
|
||||||
|
return '平台部'
|
||||||
|
}
|
||||||
|
// 将 · 替换为 -
|
||||||
|
const normalizedDept = department.replace(/·/g, '-')
|
||||||
|
// 按 - 分割
|
||||||
|
const parts = normalizedDept.split('-').filter(part => part.trim() !== '')
|
||||||
|
// 只显示最后一个节点
|
||||||
|
if (parts.length > 0) {
|
||||||
|
return parts[parts.length - 1]
|
||||||
|
}
|
||||||
|
// 否则显示全部
|
||||||
|
return normalizedDept
|
||||||
|
},
|
||||||
handleBack() {
|
handleBack() {
|
||||||
// 如果在审批模式下,取消审批而不是返回
|
// 如果在审批模式下,取消审批而不是返回
|
||||||
if (this.isApprovalMode) {
|
if (this.isApprovalMode) {
|
||||||
@ -1385,7 +1403,7 @@ export default {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const templateId = this.internalTemplateId || this.templateId
|
const templateId = this.getDetailTemplateId()
|
||||||
if (!templateId) {
|
if (!templateId) {
|
||||||
this.$message.error('缺少模板ID,无法导入')
|
this.$message.error('缺少模板ID,无法导入')
|
||||||
return
|
return
|
||||||
@ -1451,7 +1469,7 @@ export default {
|
|||||||
this.importDialogVisible = false
|
this.importDialogVisible = false
|
||||||
},
|
},
|
||||||
handleDownloadTemplate() {
|
handleDownloadTemplate() {
|
||||||
const templateRowId = this.templateId
|
const templateRowId = this.getDetailTemplateId()
|
||||||
if (!templateRowId) {
|
if (!templateRowId) {
|
||||||
console.log('未找到模板ID,无法下载')
|
console.log('未找到模板ID,无法下载')
|
||||||
return
|
return
|
||||||
@ -1568,10 +1586,9 @@ export default {
|
|||||||
item.number ||
|
item.number ||
|
||||||
(this.pagination.currentPage - 1) * this.pagination.pageSize + index + 1
|
(this.pagination.currentPage - 1) * this.pagination.pageSize + index + 1
|
||||||
}
|
}
|
||||||
// 如果接口返回的 department 字段存在,使用接口返回的值
|
// 如果接口返回的 department 字段存在,格式化显示(只显示最后一节)
|
||||||
// 否则保持原有逻辑(将 · 替换为 -)
|
|
||||||
if (item.department) {
|
if (item.department) {
|
||||||
processedItem.department = item.department.replace(/·/g, '-')
|
processedItem.department = this.formatDepartmentDisplay(item.department)
|
||||||
}
|
}
|
||||||
return processedItem
|
return processedItem
|
||||||
})
|
})
|
||||||
@ -1679,7 +1696,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleApprovalFormSubmit() {
|
handleApprovalFormSubmit() {
|
||||||
// 获取模板ID
|
// 获取模板ID
|
||||||
const templateRowId = this.internalTemplateId || this.templateId
|
const templateRowId = this.getDetailTemplateId()
|
||||||
if (!templateRowId) {
|
if (!templateRowId) {
|
||||||
this.$message.error('缺少模板ID,无法发起审批')
|
this.$message.error('缺少模板ID,无法发起审批')
|
||||||
return
|
return
|
||||||
@ -1923,7 +1940,7 @@ export default {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const templateRowId = this.internalTemplateId || this.templateId
|
const templateRowId = this.getDetailTemplateId()
|
||||||
if (!templateRowId) {
|
if (!templateRowId) {
|
||||||
console.log('缺少模板ID,无法提交')
|
console.log('缺少模板ID,无法提交')
|
||||||
return
|
return
|
||||||
@ -1957,23 +1974,23 @@ export default {
|
|||||||
this.isMaintainMode = false
|
this.isMaintainMode = false
|
||||||
this.originalTableData = []
|
this.originalTableData = []
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
this.internalTemplateId = res.data.templateRowId
|
const newTemplateId = res.data && (res.data.templateId || res.data.templateRowId)
|
||||||
|
this.setDetailTemplateId(newTemplateId)
|
||||||
this.internalTemplateVersion = res.data.version
|
this.internalTemplateVersion = res.data.version
|
||||||
this.templateVersion = res.data.version
|
this.templateVersion = res.data.version
|
||||||
this.templateId = res.data.templateRowId
|
|
||||||
console.log(this.templateId, res.data.templateRowId)
|
console.log(this.templateId, res.data.templateRowId)
|
||||||
if (!this.versionList.some((v) => v.version === res.data.version)) {
|
if (!this.versionList.some((v) => v.version === res.data.version)) {
|
||||||
this.versionList.push({
|
this.versionList.push({
|
||||||
version: res.data.version,
|
version: res.data.version,
|
||||||
status: 'DRAFT',
|
status: 'DRAFT',
|
||||||
rowId: res.data.templateRowId,
|
rowId: newTemplateId,
|
||||||
id: res.data.templateId
|
id: newTemplateId
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const versionItem = this.versionList.find((v) => v.version === res.data.version)
|
const versionItem = this.versionList.find((v) => v.version === res.data.version)
|
||||||
versionItem.status = 'DRAFT'
|
versionItem.status = 'DRAFT'
|
||||||
versionItem.rowId = res.data.templateRowId
|
versionItem.rowId = newTemplateId
|
||||||
versionItem.id = res.data.templateId
|
versionItem.id = newTemplateId
|
||||||
}
|
}
|
||||||
this.loadData()
|
this.loadData()
|
||||||
})
|
})
|
||||||
@ -2155,7 +2172,7 @@ export default {
|
|||||||
operation: 'update'
|
operation: 'update'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.paramModalVisible = false
|
this.paramModalVisible = false
|
||||||
console.log(this.paramModalMode === 'add' ? '已添加到表格' : '已更新表格数据')
|
console.log(this.paramModalMode === 'add' ? '已添加到表格' : '已更新表格数据')
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -2247,7 +2264,7 @@ export default {
|
|||||||
loadTemplateInfo() {
|
loadTemplateInfo() {
|
||||||
// 根据模板ID加载模板信息
|
// 根据模板ID加载模板信息
|
||||||
// 这里可以根据实际需求从API获取模板详情
|
// 这里可以根据实际需求从API获取模板详情
|
||||||
const id = this.internalTemplateId || this.templateId
|
const id = this.getDetailTemplateId()
|
||||||
if (id) {
|
if (id) {
|
||||||
// TODO: 调用API获取模板详情
|
// TODO: 调用API获取模板详情
|
||||||
// this.$request(...).then(res => {
|
// this.$request(...).then(res => {
|
||||||
@ -2258,7 +2275,7 @@ export default {
|
|||||||
loadLatestVersion() {
|
loadLatestVersion() {
|
||||||
// 加载最新版本信息
|
// 加载最新版本信息
|
||||||
// 如果没有传入版本,尝试从模板信息中获取最新版本
|
// 如果没有传入版本,尝试从模板信息中获取最新版本
|
||||||
const id = this.internalTemplateId || this.templateId
|
const id = this.getDetailTemplateId()
|
||||||
if (id && !this.internalTemplateVersion) {
|
if (id && !this.internalTemplateVersion) {
|
||||||
// TODO: 调用API获取最新版本
|
// TODO: 调用API获取最新版本
|
||||||
// this.$request(...).then(res => {
|
// this.$request(...).then(res => {
|
||||||
@ -2275,7 +2292,7 @@ export default {
|
|||||||
},
|
},
|
||||||
loadAllData() {
|
loadAllData() {
|
||||||
// 加载所有数据(不分页),用于维护模式
|
// 加载所有数据(不分页),用于维护模式
|
||||||
const templateId = this.internalTemplateId || this.templateId
|
const templateId = this.getDetailTemplateId()
|
||||||
if (!templateId) {
|
if (!templateId) {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.$set(this.pagination, 'total', 0)
|
this.$set(this.pagination, 'total', 0)
|
||||||
@ -2313,7 +2330,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
parameterType: item.parameterType || item.type || '',
|
parameterType: item.parameterType || item.type || '',
|
||||||
number: item.number || index + 1
|
number: item.number || index + 1,
|
||||||
|
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
// 使用 Vue.set 确保响应式更新,使用计算好的 totalNumber
|
||||||
@ -2333,11 +2351,23 @@ export default {
|
|||||||
// 获取版本的唯一标识
|
// 获取版本的唯一标识
|
||||||
return version.version || version.name || version.rowId || ''
|
return version.version || version.name || version.rowId || ''
|
||||||
},
|
},
|
||||||
|
// 统一获取当前详情使用的 templateId(优先内部保存的最新值)
|
||||||
|
getDetailTemplateId() {
|
||||||
|
return this.internalTemplateId || this.templateId || ''
|
||||||
|
},
|
||||||
|
// 统一更新当前详情使用的 templateId,确保后续接口都使用最新值
|
||||||
|
setDetailTemplateId(newTemplateId) {
|
||||||
|
if (!newTemplateId) return
|
||||||
|
this.internalTemplateId = newTemplateId
|
||||||
|
this.templateId = newTemplateId
|
||||||
|
},
|
||||||
handleVersionChange(versionName) {
|
handleVersionChange(versionName) {
|
||||||
// 版本切换时,更新内部版本值并重新加载数据
|
// 版本切换时,更新内部版本值并重新加载数据
|
||||||
this.internalTemplateVersion = versionName
|
this.internalTemplateVersion = versionName
|
||||||
this.changeId = this.versionList.find((v) => v.version === versionName)?.id || ''
|
this.changeId = this.versionList.find((v) => v.version === versionName)?.id || ''
|
||||||
this.internalTemplateId = this.versionList.find((v) => v.version === versionName)?.rowId || ''
|
const versionItem = this.versionList.find((v) => v.version === versionName)
|
||||||
|
const newTemplateId = (versionItem && (versionItem.id || versionItem.rowId)) || ''
|
||||||
|
this.setDetailTemplateId(newTemplateId)
|
||||||
// 重置分页到第一页
|
// 重置分页到第一页
|
||||||
this.$set(this.pagination, 'currentPage', 1)
|
this.$set(this.pagination, 'currentPage', 1)
|
||||||
// 重新加载数据(使用新的版本号)
|
// 重新加载数据(使用新的版本号)
|
||||||
@ -2371,7 +2401,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
const templateId = this.internalTemplateId || this.templateId
|
const templateId = this.getDetailTemplateId()
|
||||||
if (!templateId) {
|
if (!templateId) {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.$set(this.pagination, 'total', 0)
|
this.$set(this.pagination, 'total', 0)
|
||||||
@ -2412,7 +2442,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
parameterType: item.parameterType || item.type || '',
|
parameterType: item.parameterType || item.type || '',
|
||||||
number: item.number || startIndex + index + 1
|
number: item.number || startIndex + index + 1,
|
||||||
|
department: item.department ? this.formatDepartmentDisplay(item.department) : (item.department || '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 从接口返回的数据中获取状态(优先从 resp.data 中获取,其次从 result 中获取)
|
// 从接口返回的数据中获取状态(优先从 resp.data 中获取,其次从 result 中获取)
|
||||||
|
|||||||
@ -104,8 +104,8 @@
|
|||||||
<span v-else-if="row[colConfig.prop] === '已通过'" class="status-tag status-approved"
|
<span v-else-if="row[colConfig.prop] === '已通过'" class="status-tag status-approved"
|
||||||
>已通过</span
|
>已通过</span
|
||||||
>
|
>
|
||||||
<span v-else-if="row[colConfig.prop] === '已撤回'" class="status-tag status-withdrawn"
|
<span v-else-if="row[colConfig.prop] === '已拒绝'" class="status-tag status-withdrawn"
|
||||||
>已撤回</span
|
>已拒绝</span
|
||||||
>
|
>
|
||||||
<span v-else class="status-tag status-default">{{ row[colConfig.prop] }}</span>
|
<span v-else class="status-tag status-default">{{ row[colConfig.prop] }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -508,7 +508,10 @@ export default {
|
|||||||
// 通过API获取审批详情
|
// 通过API获取审批详情
|
||||||
const flowId = row.flowId || row.id
|
const flowId = row.flowId || row.id
|
||||||
if (!flowId) {
|
if (!flowId) {
|
||||||
this.$message.error('缺少审批ID,无法查看详情')
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '缺少审批ID,无法查看详情'
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.showEngineCheck = true
|
this.showEngineCheck = true
|
||||||
@ -566,12 +569,11 @@ export default {
|
|||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
console.log('审批提交成功')
|
console.log('审批提交成功')
|
||||||
|
this.loadData()
|
||||||
this.approvalDialogVisible = false
|
this.approvalDialogVisible = false
|
||||||
this.currentApprovalRow = null
|
this.currentApprovalRow = null
|
||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
// 重新加载数据
|
// 重新加载数据
|
||||||
this.loadData()
|
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('审批提交失败:', err)
|
console.error('审批提交失败:', err)
|
||||||
@ -617,7 +619,7 @@ export default {
|
|||||||
page: this.pagination.currentPage,
|
page: this.pagination.currentPage,
|
||||||
size: this.pagination.pageSize,
|
size: this.pagination.pageSize,
|
||||||
ycOrOth: '竞品',
|
ycOrOth: '竞品',
|
||||||
userID: getUserId(),
|
// userID: getUserId(),
|
||||||
...this.searchPanelValue
|
...this.searchPanelValue
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
@ -774,8 +776,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.status-withdrawn {
|
&.status-withdrawn {
|
||||||
background: #f5f7fa;
|
background: #f56c6c;
|
||||||
color: #606266;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
竞品发动机数据
|
竞品发动机数据
|
||||||
</div>
|
</div>
|
||||||
<div class="operation">
|
<div class="operation">
|
||||||
|
<el-button type="primary" @click="handleDownloadTemplate">下载模板</el-button>
|
||||||
<el-button class="import-button" @click="handleImport">
|
<el-button class="import-button" @click="handleImport">
|
||||||
导入机型
|
导入机型
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -23,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="searched-field">
|
<div class="searched-field">
|
||||||
<span class="fielded-label">状态代号</span>
|
<span class="fielded-label">状态代号</span>
|
||||||
<el-input v-model="searchPanelValue.statusCode" placeholder="请输入" />
|
<el-input v-model="searchPanelValue.productNumber" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div class="searched-field">
|
<div class="searched-field">
|
||||||
<span class="fielded-label">板块</span>
|
<span class="fielded-label">板块</span>
|
||||||
@ -184,6 +185,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
<el-button @click="handleImportDialogClose">取消</el-button>
|
<el-button @click="handleImportDialogClose">取消</el-button>
|
||||||
<el-button type="primary" :loading="importing" @click="handleImportConfirm">
|
<el-button type="primary" :loading="importing" @click="handleImportConfirm">
|
||||||
开始导入
|
开始导入
|
||||||
@ -235,7 +237,8 @@ export default {
|
|||||||
importDialogVisible: false,
|
importDialogVisible: false,
|
||||||
importing: false,
|
importing: false,
|
||||||
selectedImportFile: null,
|
selectedImportFile: null,
|
||||||
importFileList: []
|
importFileList: [],
|
||||||
|
downloadingTemplate: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -512,7 +515,6 @@ export default {
|
|||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
console.log('导入成功:', resp)
|
console.log('导入成功:', resp)
|
||||||
loadingInstance.close()
|
loadingInstance.close()
|
||||||
|
|
||||||
// 导入成功后刷新列表
|
// 导入成功后刷新列表
|
||||||
this.handleImportDialogClose()
|
this.handleImportDialogClose()
|
||||||
this.loadData()
|
this.loadData()
|
||||||
@ -530,6 +532,89 @@ export default {
|
|||||||
this.importing = false
|
this.importing = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleDownloadTemplate() {
|
||||||
|
if (this.downloadingTemplate) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { url, method = 'get', headers = {} } = api.DOWNLOAD_ENGINE_DEMO || {}
|
||||||
|
const requestConfig = {
|
||||||
|
url,
|
||||||
|
method,
|
||||||
|
params: {},
|
||||||
|
responseType: 'blob',
|
||||||
|
headers
|
||||||
|
}
|
||||||
|
if (!requestConfig.url) {
|
||||||
|
console.log('未配置下载地址')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((requestConfig.method || '').toLowerCase() === 'post') {
|
||||||
|
requestConfig.data = requestConfig.params
|
||||||
|
delete requestConfig.params
|
||||||
|
}
|
||||||
|
const defaultFilename = '机型导入模板.xlsx'
|
||||||
|
this.downloadingTemplate = true
|
||||||
|
this.$axios(requestConfig)
|
||||||
|
.then((response) => {
|
||||||
|
const blobData = response.data
|
||||||
|
if (!blobData) {
|
||||||
|
console.log('下载失败,文件内容为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const contentType =
|
||||||
|
response.headers &&
|
||||||
|
(response.headers['content-type'] || response.headers['Content-Type'])
|
||||||
|
if (contentType && contentType.includes('application/json')) {
|
||||||
|
try {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.onload = () => {
|
||||||
|
console.log(`下载失败: ${reader.result}`)
|
||||||
|
}
|
||||||
|
reader.readAsText(blobData)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('解析下载失败响应异常:', err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const disposition =
|
||||||
|
response.headers &&
|
||||||
|
(response.headers['content-disposition'] || response.headers['Content-Disposition'])
|
||||||
|
let filename = defaultFilename
|
||||||
|
if (disposition) {
|
||||||
|
const filenameMatch = /filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i.exec(
|
||||||
|
disposition
|
||||||
|
)
|
||||||
|
const matchedName = filenameMatch ? filenameMatch[1] || filenameMatch[2] : ''
|
||||||
|
if (matchedName) {
|
||||||
|
try {
|
||||||
|
filename = decodeURIComponent(matchedName)
|
||||||
|
} catch (err) {
|
||||||
|
filename = matchedName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const downloadUrl = window.URL.createObjectURL(blobData)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = downloadUrl
|
||||||
|
link.download = filename
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
window.URL.revokeObjectURL(downloadUrl)
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '下载成功'
|
||||||
|
})
|
||||||
|
console.log('下载开始,请查看浏览器下载列表')
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error('下载失败:', err)
|
||||||
|
this.$message.error('下载失败,请稍后重试')
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.downloadingTemplate = false
|
||||||
|
})
|
||||||
|
},
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "竞品"
|
// 从 selfEnginedata.vue 跳转,设置 ycOrOth 为 "竞品"
|
||||||
this.$refs.addEngineModelModal.showModal('竞品')
|
this.$refs.addEngineModelModal.showModal('竞品')
|
||||||
|
|||||||
@ -898,32 +898,99 @@ export default {
|
|||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
if (resp && resp.data) {
|
||||||
// 处理返回的数据,转换为选项格式
|
// 处理返回的数据格式:{ "部门": [], "人员": ["李亚松-yc90117847"] }
|
||||||
let result = []
|
const responseData = resp.data
|
||||||
if (Array.isArray(resp.data)) {
|
const deptArray = responseData['部门'] || responseData.department || []
|
||||||
result = resp.data
|
const personArray = responseData['人员'] || responseData.person || []
|
||||||
} else if (resp.data.result && Array.isArray(resp.data.result)) {
|
|
||||||
result = resp.data.result
|
// 处理人员数组:格式为 ["userName-userId"]
|
||||||
} else if (resp.data.data && Array.isArray(resp.data.data)) {
|
if (personArray && personArray.length > 0) {
|
||||||
result = resp.data.data
|
const personOptions = []
|
||||||
|
const personUserNumbers = []
|
||||||
|
|
||||||
|
personArray.forEach((personStr) => {
|
||||||
|
if (typeof personStr === 'string' && personStr.includes('-')) {
|
||||||
|
// 拆分格式:userName-userId
|
||||||
|
const parts = personStr.split('-')
|
||||||
|
if (parts.length >= 2) {
|
||||||
|
// 最后一部分是 userId,前面所有部分组合是 userName
|
||||||
|
const userId = parts[parts.length - 1]
|
||||||
|
const userName = parts.slice(0, -1).join('-')
|
||||||
|
|
||||||
|
personOptions.push({
|
||||||
|
userId: userId,
|
||||||
|
username: userName,
|
||||||
|
userNumber: userId // userNumber 使用 userId
|
||||||
|
})
|
||||||
|
personUserNumbers.push(userId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.personOptions = personOptions
|
||||||
|
this.personConfigFormData.person = personUserNumbers
|
||||||
|
// 如果有人员数据,默认选择配置人员模式
|
||||||
|
this.personConfigFormData.configType = 'person'
|
||||||
|
} else {
|
||||||
|
this.personOptions = []
|
||||||
|
this.personConfigFormData.person = []
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理部门数组:格式为 ["deptName-deptId"]
|
||||||
|
if (deptArray && deptArray.length > 0) {
|
||||||
|
const deptIds = []
|
||||||
|
const deptPaths = []
|
||||||
|
|
||||||
|
deptArray.forEach((deptStr) => {
|
||||||
|
if (typeof deptStr === 'string' && deptStr.includes('-')) {
|
||||||
|
// 拆分格式:deptName-deptId
|
||||||
|
const parts = deptStr.split('-')
|
||||||
|
if (parts.length >= 2) {
|
||||||
|
// 最后一部分是 deptId,前面所有部分组合是 deptName
|
||||||
|
const deptId = parts[parts.length - 1]
|
||||||
|
// deptName 暂时保留,可能用于日志或调试
|
||||||
|
// const deptName = parts.slice(0, -1).join('-')
|
||||||
|
|
||||||
|
// 查找部门在部门树中的路径
|
||||||
|
const deptPath = this.findDepartmentPath(deptId)
|
||||||
|
if (deptPath && deptPath.length > 0) {
|
||||||
|
deptPaths.push(deptPath)
|
||||||
|
deptIds.push(deptId)
|
||||||
|
} else {
|
||||||
|
// 如果找不到路径,直接使用 deptId
|
||||||
|
deptIds.push(deptId)
|
||||||
|
// 尝试构建一个简单的路径(可能需要根据实际情况调整)
|
||||||
|
deptPaths.push([deptId])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (deptIds.length > 0) {
|
||||||
|
this.personConfigFormData.selectDeptIds = deptIds
|
||||||
|
this.personConfigFormData.department = deptPaths
|
||||||
|
// 如果只有部门数据,选择配置部门模式
|
||||||
|
if (!personArray || personArray.length === 0) {
|
||||||
|
this.personConfigFormData.configType = 'department'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.personConfigFormData.selectDeptIds = []
|
||||||
|
this.personConfigFormData.department = []
|
||||||
}
|
}
|
||||||
// 转换为选项格式:{userId: user.userId, username: user.username, userNumber: user.userNumber}
|
|
||||||
this.personOptions = result.map((user) => ({
|
|
||||||
userId: user.userId || user.id,
|
|
||||||
username: user.username || user.name,
|
|
||||||
userNumber: user.userNumber || user.userId || user.id
|
|
||||||
}))
|
|
||||||
// 设置已选择的人员 userNumber 数组
|
|
||||||
this.personConfigFormData.person = this.personOptions.map(opt => opt.userNumber)
|
|
||||||
} else {
|
} else {
|
||||||
this.personOptions = []
|
this.personOptions = []
|
||||||
this.personConfigFormData.person = []
|
this.personConfigFormData.person = []
|
||||||
|
this.personConfigFormData.selectDeptIds = []
|
||||||
|
this.personConfigFormData.department = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('加载人员列表失败:', err)
|
console.error('加载人员列表失败:', err)
|
||||||
this.personOptions = []
|
this.personOptions = []
|
||||||
this.personConfigFormData.person = []
|
this.personConfigFormData.person = []
|
||||||
|
this.personConfigFormData.selectDeptIds = []
|
||||||
|
this.personConfigFormData.department = []
|
||||||
})
|
})
|
||||||
this.personConfigDialogVisible = true
|
this.personConfigDialogVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@ -1179,6 +1246,33 @@ export default {
|
|||||||
const path = findNodePath(this.departmentList, deptId)
|
const path = findNodePath(this.departmentList, deptId)
|
||||||
return path ? path.join('-') : ''
|
return path ? path.join('-') : ''
|
||||||
},
|
},
|
||||||
|
// 根据部门id查找部门在树中的ID路径(用于级联选择器)
|
||||||
|
findDepartmentPath(deptId) {
|
||||||
|
if (!deptId || !this.departmentList || this.departmentList.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 递归查找部门节点及其ID路径
|
||||||
|
const findNodeIdPath = (nodes, targetId, path = []) => {
|
||||||
|
for (const node of nodes) {
|
||||||
|
const currentPath = [...path, node.id]
|
||||||
|
|
||||||
|
if (node.id === targetId) {
|
||||||
|
return currentPath
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
const found = findNodeIdPath(node.children, targetId, currentPath)
|
||||||
|
if (found) {
|
||||||
|
return found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return findNodeIdPath(this.departmentList, deptId)
|
||||||
|
},
|
||||||
// 人员配置提交
|
// 人员配置提交
|
||||||
handlePersonConfigSubmit() {
|
handlePersonConfigSubmit() {
|
||||||
this.$refs.personConfigForm.validate((valid) => {
|
this.$refs.personConfigForm.validate((valid) => {
|
||||||
|
|||||||
@ -153,13 +153,13 @@
|
|||||||
>查看</a
|
>查看</a
|
||||||
>
|
>
|
||||||
<span style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<!-- <a
|
<a
|
||||||
v-if="false"
|
v-if="false"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
>修改</a
|
>修改</a
|
||||||
> -->
|
>
|
||||||
<span style="width: 6px; display: inline-block"></span>
|
<span style="width: 6px; display: inline-block"></span>
|
||||||
<a
|
<a
|
||||||
v-if="row.status === 'APPROVING'"
|
v-if="row.status === 'APPROVING'"
|
||||||
|
|||||||
@ -229,7 +229,7 @@ export default {
|
|||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
minWidth: '120'
|
minWidth: '120'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: 'applicant',
|
prop: 'applicant',
|
||||||
label: '申请人',
|
label: '申请人',
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
玉柴发动机数据
|
玉柴发动机数据
|
||||||
</div>
|
</div>
|
||||||
<div class="operation">
|
<div class="operation">
|
||||||
|
<el-button type="primary" @click="handleDownloadTemplate">下载模板</el-button>
|
||||||
<el-button class="import-button" @click="handleImport">
|
<el-button class="import-button" @click="handleImport">
|
||||||
导入机型
|
导入机型
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -184,7 +185,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleDownloadTemplate">下载模板</el-button>
|
|
||||||
<el-button @click="handleImportDialogClose">取消</el-button>
|
<el-button @click="handleImportDialogClose">取消</el-button>
|
||||||
<el-button type="primary" :loading="importing" @click="handleImportConfirm">
|
<el-button type="primary" :loading="importing" @click="handleImportConfirm">
|
||||||
开始导入
|
开始导入
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user