Browse Source

技术负责人默认是试验单的试验负责人

master
han\hanst 1 week ago
parent
commit
9331a8d1b3
  1. 6
      src/views/modules/erf/components/expApplyForm.vue
  2. 61
      src/views/modules/erf/components/expTriConfirm.vue
  3. 16
      src/views/modules/erf/expApplyList.vue

6
src/views/modules/erf/components/expApplyForm.vue

@ -276,6 +276,7 @@ export default {
productType: '',
quantityReq: '',
expectedFinishDate: '',
projectLeaderId: this.$store.state.user.id,
projectLeaderName: this.$store.state.user.name,
projectLeader: this.$store.state.user.userDisplay,
pjmLeaderUserId: null,
@ -335,7 +336,9 @@ export default {
this.loadBuList()
if (this.applyData && this.applyData.applyNo) {
this.saveHeaderData = {
...this.saveHeaderData,
...this.applyData,
projectLeaderId: this.applyData.projectLeaderId || null,
originalApplyNo: this.applyData.applyNo
}
this.isEdit = true
@ -466,6 +469,9 @@ export default {
*/
getBaseData(val) {
if (this.tagNo === 103) {
const leaderIdRaw = val.user_id !== undefined ? val.user_id : val.userId
const leaderId = Number(leaderIdRaw)
this.saveHeaderData.projectLeaderId = Number.isFinite(leaderId) ? leaderId : null
this.saveHeaderData.projectLeaderName = val.username
this.saveHeaderData.projectLeader = val.user_display
}

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

@ -523,6 +523,18 @@ export default {
experimentType: {
type: String,
default: ''
},
projectLeaderId: {
type: [Number, String],
default: null
},
projectLeader: {
type: String,
default: ''
},
projectLeaderName: {
type: String,
default: ''
}
},
@ -722,6 +734,31 @@ export default {
return previousProcess && previousProcess.confirmStatus === '已确认'
},
/**
* 规范化用户ID必须是数字
*/
normalizeUserId(value) {
if (value === null || value === undefined || value === '') {
return null
}
const id = Number(value)
return Number.isFinite(id) ? id : null
},
/**
* 默认技术负责人姓名试验负责人姓名
*/
getDefaultTechApproverName() {
return (this.projectLeader || '').trim()
},
/**
* 默认技术负责人ID试验负责人ID
*/
getDefaultTechApproverUserId() {
return this.normalizeUserId(this.projectLeaderId)
},
/**
* 打开新增弹框
*/
@ -734,8 +771,8 @@ export default {
prodApproverUserId: null,
qaApproverName: '',
qaApproverUserId: null,
techApproverName: '',
techApproverUserId: null,
techApproverName: this.getDefaultTechApproverName(),
techApproverUserId: this.getDefaultTechApproverUserId(),
remark: ''
}
this.processDialogVisible = true
@ -818,8 +855,8 @@ export default {
prodApproverUserId: matchResult.template.prodApproverUserId,
qaApproverName: matchResult.template.qaApproverName,
qaApproverUserId: matchResult.template.qaApproverUserId,
techApproverName: matchResult.template.techApproverName,
techApproverUserId: matchResult.template.techApproverUserId,
techApproverName: matchResult.template.techApproverName || this.getDefaultTechApproverName(),
techApproverUserId: this.normalizeUserId(matchResult.template.techApproverUserId) || this.getDefaultTechApproverUserId(),
remark: matchResult.template.remark || ''
}
}
@ -831,8 +868,8 @@ export default {
prodApproverUserId: null,
qaApproverName: '',
qaApproverUserId: null,
techApproverName: '',
techApproverUserId: null,
techApproverName: this.getDefaultTechApproverName(),
techApproverUserId: this.getDefaultTechApproverUserId(),
remark: ''
}
})
@ -978,8 +1015,8 @@ export default {
prodApproverUserId: row.prodApproverUserId || null,
qaApproverName: row.qaApproverName || '',
qaApproverUserId: row.qaApproverUserId || null,
techApproverName: row.techApproverName || '',
techApproverUserId: row.techApproverUserId || null,
techApproverName: row.techApproverName || this.getDefaultTechApproverName(),
techApproverUserId: this.normalizeUserId(row.techApproverUserId) || this.getDefaultTechApproverUserId(),
remark: row.remark || ''
}
this.processDialogVisible = true
@ -1048,8 +1085,8 @@ export default {
prodApproverUserId: row.prodApproverUserId || null,
qaApproverName: row.qaApproverName || '',
qaApproverUserId: row.qaApproverUserId || null,
techApproverName: row.techApproverName || '',
techApproverUserId: row.techApproverUserId || null,
techApproverName: row.techApproverName || this.getDefaultTechApproverName(),
techApproverUserId: this.normalizeUserId(row.techApproverUserId) || this.getDefaultTechApproverUserId(),
remark: row.remark || ''
}
this.processDialogVisible = true
@ -1094,8 +1131,8 @@ export default {
this.processForm.prodApproverUserId = row.prodApproverUserId || null
this.processForm.qaApproverName = row.qaApproverName || ''
this.processForm.qaApproverUserId = row.qaApproverUserId || null
this.processForm.techApproverName = row.techApproverName || ''
this.processForm.techApproverUserId = row.techApproverUserId || null
this.processForm.techApproverName = row.techApproverName || this.getDefaultTechApproverName()
this.processForm.techApproverUserId = this.normalizeUserId(row.techApproverUserId) || this.getDefaultTechApproverUserId()
this.processForm.remark = row.remark || ''
this.templateDialogVisible = false

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

@ -135,18 +135,13 @@
<el-table-column
label="操作"
width="100"
width="110"
align="center"
header-align="center">
<template slot-scope="scope">
<a v-if="scope.row.status === '草稿' || scope.row.status === '已驳回'"
@click="editApply(scope.row)">修改</a>
<a
v-if="scope.row.status === '草稿' || scope.row.status === '已驳回'"
@click="submitApply(scope.row)">{{ scope.row.status === '已驳回' ? '重新下达' : '下达' }}</a>
<a
v-if="showSampleConfirmBtn(scope.row)"
@click="openSampleConfirm(scope.row)">样品确认</a>
<a v-if="scope.row.status === '草稿' || scope.row.status === '已驳回'" @click="editApply(scope.row)">修改</a>
<a v-if="scope.row.status === '草稿' || scope.row.status === '已驳回'" @click="submitApply(scope.row)">{{ scope.row.status === '已驳回' ? '重新下达' : '下达' }}</a>
<a v-if="showSampleConfirmBtn(scope.row)" @click="openSampleConfirm(scope.row)">样品确认</a>
</template>
</el-table-column>
<el-table-column
@ -314,6 +309,9 @@
:apply-no="currentRow.applyNo"
:bu-no="currentRow.buNo"
:experiment-type="currentRow.experimentType"
:project-leader-id="currentRow.projectLeaderId"
:project-leader="currentRow.projectLeader"
:project-leader-name="currentRow.projectLeaderName"
:height="detailHeight">
</exp-tri-confirm>
<div v-else class="empty-tip">

Loading…
Cancel
Save