Browse Source

三方确认

master
han\hanst 1 month ago
parent
commit
a94dc4953e
  1. 7
      src/api/erf/erf.js
  2. 52
      src/views/modules/erf/components/expTriConfirm.vue
  3. 42
      src/views/modules/erf/expApplyList.vue
  4. 1047
      src/views/modules/erf/triConfirm.vue

7
src/api/erf/erf.js

@ -60,10 +60,15 @@ export const getPendingApplyList = data => createAPI(`/erf/expApply/getPendingAp
// =====================================================
/**
* 查询三方确认列表
* 查询三方确认列表按申请单号
*/
export const getTriConfirmList = data => createAPI(`/erf/triConfirm/getTriConfirmList`, 'post', data)
/**
* 查询登录人待确认的工序列表
*/
export const getPendingTriConfirmList = data => createAPI(`/erf/triConfirm/getPendingTriConfirmList`, 'post', data)
/**
* 三方确认操作
*/

52
src/views/modules/erf/components/expTriConfirm.vue

@ -44,13 +44,12 @@
align="center"
header-align="center">
<template slot-scope="scope">
<span v-if="scope.row.prodApproverName" style="color: #67C23A;">
{{ scope.row.prodApproverName }}
<span v-if="scope.row.prodConfirmed" style="color: #67C23A;">
{{ scope.row.prodApproverName }}
</span>
<span v-else-if="canConfirmProcess(scope.row)" style="color: #E6A23C;">
待确认
<span v-else >
{{ scope.row.prodApproverName }}
</span>
<span v-else style="color: #909399;">-</span>
</template>
</el-table-column>
@ -61,13 +60,12 @@
align="center"
header-align="center">
<template slot-scope="scope">
<span v-if="scope.row.qaApproverName" style="color: #67C23A;">
{{ scope.row.qaApproverName }}
<span v-if="scope.row.qaConfirmed" style="color: #67C23A;">
{{ scope.row.qaApproverName }}
</span>
<span v-else-if="canConfirmProcess(scope.row)" style="color: #E6A23C;">
待确认
<span v-else >
{{ scope.row.qaApproverName }}
</span>
<span v-else style="color: #909399;">-</span>
</template>
</el-table-column>
@ -78,13 +76,12 @@
align="center"
header-align="center">
<template slot-scope="scope">
<span v-if="scope.row.techApproverName" style="color: #67C23A;">
{{ scope.row.techApproverName }}
<span v-if="scope.row.techConfirmed" style="color: #67C23A;">
{{ scope.row.techApproverName }}
</span>
<span v-else-if="canConfirmProcess(scope.row)" style="color: #E6A23C;">
待确认
<span v-else>
{{ scope.row.techApproverName }}
</span>
<span v-else style="color: #909399;">-</span>
</template>
</el-table-column>
@ -95,7 +92,7 @@
align="center"
header-align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.confirmStatus === 'CONFIRMED'" type="success" size="small">
<el-tag v-if="scope.row.confirmStatus === '已确认'" type="success" size="small">
已完成
</el-tag>
<el-tag v-else-if="canConfirmProcess(scope.row)" type="warning" size="small">
@ -321,7 +318,14 @@
<el-table-column
prop="userName"
label="姓名"
label="用户账号"
align="center"
header-align="center">
</el-table-column>
<el-table-column
prop="userDisplay"
label="用户名"
align="center"
header-align="center">
</el-table-column>
@ -484,8 +488,14 @@ export default {
watch: {
applyNo: {
immediate: true,
handler(val) {
if (val) {
handler(val, oldVal) {
// applyNo
if (val && val !== oldVal) {
console.log('📋 applyNo 变化,重新加载工序列表:', oldVal, '->', val)
this.loadProcessList()
} else if (val && !oldVal) {
//
console.log('📋 首次加载工序列表:', val)
this.loadProcessList()
}
}
@ -581,7 +591,7 @@ export default {
* 规则第一道工序直接可确认其他工序需要上一道完成
*/
canConfirmProcess(row) {
if (row.confirmStatus === 'CONFIRMED') {
if (row.confirmStatus === '已确认') {
return false //
}
@ -593,7 +603,7 @@ export default {
const previousProcess = this.processList.find(p => p.processSeq === row.processSeq - 1)
//
return previousProcess && previousProcess.confirmStatus === 'CONFIRMED'
return previousProcess && previousProcess.confirmStatus === '已确认'
},
/**

42
src/views/modules/erf/expApplyList.vue

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

1047
src/views/modules/erf/triConfirm.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save