|
|
|
@ -670,7 +670,7 @@ export default { |
|
|
|
// ✅ 如果是High Risk,先验证工序 |
|
|
|
if (row.experimentType === 'High Risk') { |
|
|
|
console.log('🔍 检测到High Risk申请单,开始验证工序...') |
|
|
|
|
|
|
|
|
|
|
|
// 通过API查询工序列表进行验证(不依赖子组件是否已加载) |
|
|
|
this.validateHighRiskProcessByApi(row.applyNo).then(isValid => { |
|
|
|
if (!isValid) { |
|
|
|
@ -681,7 +681,7 @@ export default { |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('✅ High Risk验证通过,继续下达流程') |
|
|
|
// 验证通过后继续下达流程 |
|
|
|
this.proceedSubmit(row) |
|
|
|
@ -698,7 +698,7 @@ export default { |
|
|
|
|
|
|
|
/** |
|
|
|
* 通过API验证High Risk工序 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param {String} applyNo 申请单号 |
|
|
|
* @return {Promise<Boolean>} 验证结果 |
|
|
|
*/ |
|
|
|
@ -709,13 +709,13 @@ export default { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const processList = data.list || [] |
|
|
|
console.log('📊 查询到工序数量:', processList.length) |
|
|
|
|
|
|
|
|
|
|
|
// 检查是否至少有一条完整的工序 |
|
|
|
const completeProcesses = processList.filter(process => { |
|
|
|
const isComplete = process.prodApproverName && |
|
|
|
process.qaApproverName && |
|
|
|
const isComplete = process.prodApproverName && |
|
|
|
process.qaApproverName && |
|
|
|
process.techApproverName |
|
|
|
|
|
|
|
|
|
|
|
if (isComplete) { |
|
|
|
console.log('✅ 完整工序:', process.processStep, { |
|
|
|
车间: process.prodApproverName, |
|
|
|
@ -723,12 +723,12 @@ export default { |
|
|
|
技术: process.techApproverName |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return isComplete |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
console.log(`📈 完整工序数量: ${completeProcesses.length}/${processList.length}`) |
|
|
|
|
|
|
|
|
|
|
|
// 至少需要一条完整的工序 |
|
|
|
resolve(completeProcesses.length > 0) |
|
|
|
} else { |
|
|
|
@ -963,9 +963,18 @@ export default { |
|
|
|
this.$refs.dataTable.setCurrentRow(row) |
|
|
|
}) |
|
|
|
|
|
|
|
// 如果当前在审批状态tab,刷新审批状态和日志 |
|
|
|
// 根据当前tab刷新对应的数据 |
|
|
|
if (this.activeName === 'approvalStatus') { |
|
|
|
// 刷新审批状态和日志 |
|
|
|
this.loadFlowStatus() |
|
|
|
} else if (this.activeName === 'triConfirm') { |
|
|
|
// 刷新三方确认数据 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.triConfirm && this.$refs.triConfirm.loadProcessList) { |
|
|
|
console.log('🔄 行切换,刷新三方确认数据') |
|
|
|
this.$refs.triConfirm.loadProcessList() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 否则自动切换到项目详情tab |
|
|
|
this.activeName = 'attachment' |
|
|
|
@ -983,6 +992,16 @@ export default { |
|
|
|
if (tab.name === 'approvalStatus' && this.currentRow.applyNo) { |
|
|
|
this.loadFlowStatus() |
|
|
|
} |
|
|
|
|
|
|
|
// 切换到三方确认tab时刷新数据 |
|
|
|
if (tab.name === 'triConfirm' && this.currentRow.applyNo) { |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.triConfirm && this.$refs.triConfirm.loadProcessList) { |
|
|
|
console.log('🔄 Tab切换,刷新三方确认数据') |
|
|
|
this.$refs.triConfirm.loadProcessList() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -1080,6 +1099,7 @@ export default { |
|
|
|
const types = { |
|
|
|
'下达': 'primary', |
|
|
|
'批准': 'success', |
|
|
|
'确认': 'success', |
|
|
|
'驳回': 'danger', |
|
|
|
'撤回': 'warning', |
|
|
|
'提醒': 'info', |
|
|
|
|