fix
This commit is contained in:
parent
a399336d3d
commit
4e1bef2888
@ -54,6 +54,15 @@ export default {
|
|||||||
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledBy',
|
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledBy',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
},
|
},
|
||||||
|
GET_ENGINE_TABLE_DETAIL_FOR_FILLED_BY_HISTORY: {
|
||||||
|
url: '/custom/engineParamDetailPojo/selectParamListAndModelForFilledByHistory',
|
||||||
|
method: 'get'
|
||||||
|
},
|
||||||
|
// 责任人分发填写人时获取参数树(传参与 GET_ENGINE_TABLE_DETAIL 相同,userID 为责任人 ID)
|
||||||
|
GET_ENGINE_TABLE_DETAIL_FOR_RESPONSIBLE_PERSON: {
|
||||||
|
url: '/custom/engineParamDetailPojo/selectParamListAndModelForResponsiblePerson',
|
||||||
|
method: 'get'
|
||||||
|
},
|
||||||
GET_NEW_MODEL_VERSION: {
|
GET_NEW_MODEL_VERSION: {
|
||||||
url: '/custom/dataEntryEngineModel/synchronizeParams',
|
url: '/custom/dataEntryEngineModel/synchronizeParams',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
|||||||
@ -16,8 +16,10 @@
|
|||||||
<el-form-item label="子系统:" prop="subsystem">
|
<el-form-item label="子系统:" prop="subsystem">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.subsystem"
|
v-model="formData.subsystem"
|
||||||
placeholder="请选择子系统"
|
:placeholder="dispatchType === 'update_param' ? '请选择子系统(可多选)' : '请选择子系统'"
|
||||||
clearable
|
clearable
|
||||||
|
:multiple="dispatchType === 'update_param'"
|
||||||
|
collapse-tags
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="handleSubsystemChange"
|
@change="handleSubsystemChange"
|
||||||
>
|
>
|
||||||
@ -31,7 +33,7 @@
|
|||||||
clearable
|
clearable
|
||||||
multiple
|
multiple
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="!formData.subsystem"
|
:disabled="!hasSelectedSubsystem"
|
||||||
@change="handlePartsNameChange"
|
@change="handlePartsNameChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -42,20 +44,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门:" prop="department">
|
<el-form-item v-if="dispatchType !== 'update_param'" label="部门:" prop="department">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.department"
|
v-model="formData.department"
|
||||||
placeholder="请选择部门"
|
placeholder="请选择部门"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="
|
:disabled="!formData.subsystem"
|
||||||
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
|
||||||
@ -88,7 +83,7 @@
|
|||||||
"
|
"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
clearable
|
clearable
|
||||||
:disabled="!formData.department"
|
:disabled="dispatchType !== 'update_param' && !formData.department"
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
:remote-method="handleRemoteSearch"
|
:remote-method="handleRemoteSearch"
|
||||||
@ -125,6 +120,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
|
|
||||||
|
const WHOLE_ENGINE_PARAMS_LEGACY_KEYS = ['整车参数', '发动机基本信息']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BatchModifyResponsibleModal',
|
name: 'BatchModifyResponsibleModal',
|
||||||
props: {
|
props: {
|
||||||
@ -151,6 +149,21 @@ export default {
|
|||||||
currentVersionId: {
|
currentVersionId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
// 由父组件 engineDetail 传入,解析部门 departmentId(含中轻/中重动力平台映射)
|
||||||
|
resolveDepartmentId: {
|
||||||
|
type: Function,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 左侧参数树第一级(项目名称),用于匹配责任人/填写人
|
||||||
|
projectPartsName: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 左侧参数树展示的子系统名称列表
|
||||||
|
treeSubsystemNames: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -174,6 +187,7 @@ export default {
|
|||||||
availablePartsNames: [], // 根据子系统筛选出的零部件名称列表(仅用于批量修改填写人)
|
availablePartsNames: [], // 根据子系统筛选出的零部件名称列表(仅用于批量修改填写人)
|
||||||
availableDepartments: [], // 根据子系统筛选出的部门列表
|
availableDepartments: [], // 根据子系统筛选出的部门列表
|
||||||
allManagerData: [], // 所有责任人数据(用于查找现责任人和部门)
|
allManagerData: [], // 所有责任人数据(用于查找现责任人和部门)
|
||||||
|
allFillerData: [], // 所有填写人数据(用于查找现填写人)
|
||||||
departmentTreeData: [], // 部门树数据(用于根据部门名称查找部门ID)
|
departmentTreeData: [], // 部门树数据(用于根据部门名称查找部门ID)
|
||||||
userOptions: [], // 人员选项列表
|
userOptions: [], // 人员选项列表
|
||||||
userLoading: false // 人员搜索loading状态
|
userLoading: false // 人员搜索loading状态
|
||||||
@ -183,9 +197,16 @@ export default {
|
|||||||
modalTitle() {
|
modalTitle() {
|
||||||
return this.dispatchType === 'update_param' ? '批量修改填写人' : '批量修改责任人'
|
return this.dispatchType === 'update_param' ? '批量修改填写人' : '批量修改责任人'
|
||||||
},
|
},
|
||||||
|
hasSelectedSubsystem() {
|
||||||
|
if (this.dispatchType === 'update_param') {
|
||||||
|
return (
|
||||||
|
Array.isArray(this.formData.subsystem) && this.formData.subsystem.length > 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return !!this.formData.subsystem
|
||||||
|
},
|
||||||
formRules() {
|
formRules() {
|
||||||
const rules = {
|
const rules = {
|
||||||
subsystem: [{ required: true, message: '请选择子系统', trigger: 'change' }],
|
|
||||||
userId: [
|
userId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -194,10 +215,16 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// 添加部门验证(两种模式都需要)
|
|
||||||
rules.department = [{ required: true, message: '请选择部门', trigger: 'change' }]
|
|
||||||
// 如果是批量修改填写人,添加零部件名称验证
|
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
|
rules.subsystem = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'array',
|
||||||
|
min: 1,
|
||||||
|
message: '请至少选择一个子系统',
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
|
]
|
||||||
rules.partsName = [
|
rules.partsName = [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -207,6 +234,9 @@ export default {
|
|||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
} else {
|
||||||
|
rules.subsystem = [{ required: true, message: '请选择子系统', trigger: 'change' }]
|
||||||
|
rules.department = [{ required: true, message: '请选择部门', trigger: 'change' }]
|
||||||
}
|
}
|
||||||
return rules
|
return rules
|
||||||
}
|
}
|
||||||
@ -228,10 +258,26 @@ export default {
|
|||||||
// 否则显示全部
|
// 否则显示全部
|
||||||
return normalizedDept
|
return normalizedDept
|
||||||
},
|
},
|
||||||
|
getEmptySubsystemValue() {
|
||||||
|
return this.dispatchType === 'update_param' ? [] : ''
|
||||||
|
},
|
||||||
|
getSelectedSubsystems() {
|
||||||
|
if (this.dispatchType === 'update_param') {
|
||||||
|
return Array.isArray(this.formData.subsystem) ? this.formData.subsystem : []
|
||||||
|
}
|
||||||
|
return this.formData.subsystem ? [this.formData.subsystem] : []
|
||||||
|
},
|
||||||
|
isParamSubsystemMatched(paramSubsystemName, selectedSubsystems) {
|
||||||
|
const subsystems = selectedSubsystems || this.getSelectedSubsystems()
|
||||||
|
if (!subsystems.length) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return subsystems.some((name) => this.isSubsystemNameMatch(paramSubsystemName, name))
|
||||||
|
},
|
||||||
showModal() {
|
showModal() {
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.formData = {
|
this.formData = {
|
||||||
subsystem: '',
|
subsystem: this.getEmptySubsystemValue(),
|
||||||
partsName: [],
|
partsName: [],
|
||||||
department: '',
|
department: '',
|
||||||
currentResponsibleId: '',
|
currentResponsibleId: '',
|
||||||
@ -264,7 +310,7 @@ export default {
|
|||||||
closeModal() {
|
closeModal() {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.formData = {
|
this.formData = {
|
||||||
subsystem: '',
|
subsystem: this.getEmptySubsystemValue(),
|
||||||
partsName: [],
|
partsName: [],
|
||||||
department: '',
|
department: '',
|
||||||
currentResponsibleId: '',
|
currentResponsibleId: '',
|
||||||
@ -289,25 +335,65 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
.asyncThen((resp) => {
|
.asyncThen((resp) => {
|
||||||
if (resp && resp.data) {
|
const apiList = resp && resp.data ? resp.data : []
|
||||||
this.subsystemList = resp.data
|
this.filterSubsystemListByTree(apiList)
|
||||||
} else {
|
|
||||||
this.subsystemList = []
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.asyncErrorCatch((err) => {
|
.asyncErrorCatch((err) => {
|
||||||
console.error('加载子系统列表失败:', err)
|
console.error('加载子系统列表失败:', err)
|
||||||
this.subsystemList = []
|
this.subsystemList = []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 子系统名称是否匹配(兼容整车参数/发动机基本信息)
|
||||||
|
isSubsystemNameMatch(nameA, nameB) {
|
||||||
|
if (!nameA || !nameB) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (nameA === nameB) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
WHOLE_ENGINE_PARAMS_LEGACY_KEYS.includes(nameA) &&
|
||||||
|
WHOLE_ENGINE_PARAMS_LEGACY_KEYS.includes(nameB)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 根据左侧树展示的子系统,从接口返回的列表中删减
|
||||||
|
filterSubsystemListByTree(apiList) {
|
||||||
|
const list = Array.isArray(apiList) ? apiList : []
|
||||||
|
const treeNames = (this.treeSubsystemNames || []).filter(Boolean)
|
||||||
|
if (!treeNames.length) {
|
||||||
|
this.subsystemList = list
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const filtered = []
|
||||||
|
list.forEach((apiName) => {
|
||||||
|
const matchedTreeName = treeNames.find((treeName) =>
|
||||||
|
this.isSubsystemNameMatch(apiName, treeName)
|
||||||
|
)
|
||||||
|
if (matchedTreeName && !filtered.includes(matchedTreeName)) {
|
||||||
|
filtered.push(matchedTreeName)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.subsystemList = filtered
|
||||||
|
},
|
||||||
|
// 是否匹配当前项目名称(partsName)
|
||||||
|
isProjectPartsNameMatch(item) {
|
||||||
|
if (!this.projectPartsName || !item) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return (item.partsName || '') === this.projectPartsName
|
||||||
|
},
|
||||||
// 加载所有责任人数据(用于查找现责任人和部门)
|
// 加载所有责任人数据(用于查找现责任人和部门)
|
||||||
loadAllManagerData() {
|
loadAllManagerData() {
|
||||||
|
const params = {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 9999 // 获取所有数据
|
||||||
|
}
|
||||||
|
if (this.projectPartsName) {
|
||||||
|
params.partsName = this.projectPartsName
|
||||||
|
}
|
||||||
const request = {
|
const request = {
|
||||||
...api.GET_MANAGER_DATA,
|
...api.GET_MANAGER_DATA,
|
||||||
params: {
|
params,
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 9999 // 获取所有数据
|
|
||||||
},
|
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
}
|
}
|
||||||
this.$request(request)
|
this.$request(request)
|
||||||
@ -323,8 +409,35 @@ export default {
|
|||||||
this.allManagerData = []
|
this.allManagerData = []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 加载所有填写人数据(用于查找现填写人)
|
||||||
|
loadAllFillerData() {
|
||||||
|
const params = {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 9999
|
||||||
|
}
|
||||||
|
if (this.projectPartsName) {
|
||||||
|
params.partsName = this.projectPartsName
|
||||||
|
}
|
||||||
|
const request = {
|
||||||
|
...api.GET_FILLER_DATA,
|
||||||
|
params,
|
||||||
|
disableSuccessMsg: true
|
||||||
|
}
|
||||||
|
this.$request(request)
|
||||||
|
.asyncThen((resp) => {
|
||||||
|
if (resp && resp.data) {
|
||||||
|
this.allFillerData = resp.data.result || []
|
||||||
|
} else {
|
||||||
|
this.allFillerData = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.asyncErrorCatch((err) => {
|
||||||
|
console.error('加载填写人数据失败:', err)
|
||||||
|
this.allFillerData = []
|
||||||
|
})
|
||||||
|
},
|
||||||
// 处理子系统选择变化
|
// 处理子系统选择变化
|
||||||
handleSubsystemChange(subsystem) {
|
handleSubsystemChange() {
|
||||||
// 清空零部件名称、部门和现责任人/现填写人
|
// 清空零部件名称、部门和现责任人/现填写人
|
||||||
this.formData.partsName = []
|
this.formData.partsName = []
|
||||||
this.formData.department = ''
|
this.formData.department = ''
|
||||||
@ -339,113 +452,54 @@ export default {
|
|||||||
this.availablePartsNames = []
|
this.availablePartsNames = []
|
||||||
this.availableDepartments = []
|
this.availableDepartments = []
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
// 根据子系统筛选零部件名称和部门列表
|
|
||||||
if (subsystem) {
|
|
||||||
const currentVersionData = this.versionData[this.currentVersionId] || {}
|
|
||||||
const partsNameSet = new Set()
|
|
||||||
const departmentSet = new Set()
|
|
||||||
|
|
||||||
// 遍历所有零部件名称(partsName)
|
const selectedSubsystems = this.getSelectedSubsystems()
|
||||||
Object.keys(currentVersionData).forEach((partsName) => {
|
if (!selectedSubsystems.length) {
|
||||||
const params = currentVersionData[partsName] || []
|
|
||||||
// 遍历该零部件下的所有参数
|
|
||||||
params.forEach((param) => {
|
|
||||||
// 检查参数是否属于选中的子系统
|
|
||||||
if (param.subsystemName === subsystem) {
|
|
||||||
// 如果是批量修改填写人,收集零部件名称(包括 /)
|
|
||||||
if (this.dispatchType === 'update_param') {
|
|
||||||
const paramPartsName = param.partsName || partsName
|
|
||||||
if (paramPartsName) {
|
|
||||||
partsNameSet.add(paramPartsName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 收集部门名称(两种模式都需要)
|
|
||||||
if (param.department) {
|
|
||||||
departmentSet.add(param.department)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// 如果是批量修改填写人,设置零部件名称列表(添加 / 作为默认项)
|
|
||||||
if (this.dispatchType === 'update_param') {
|
|
||||||
const partsNamesArray = Array.from(partsNameSet).sort()
|
|
||||||
// 如果 / 不在列表中,添加到开头
|
|
||||||
if (!partsNamesArray.includes('/')) {
|
|
||||||
partsNamesArray.unshift('/')
|
|
||||||
}
|
|
||||||
this.availablePartsNames = partsNamesArray
|
|
||||||
// 对于批量修改填写人,部门列表应该在选择了零部件名称之后才筛选
|
|
||||||
this.availableDepartments = []
|
|
||||||
} else {
|
|
||||||
// 批量修改责任人:设置部门列表(转换为数组格式)
|
|
||||||
this.availableDepartments = Array.from(departmentSet).map((dept) => ({
|
|
||||||
department: dept
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.availablePartsNames = []
|
this.availablePartsNames = []
|
||||||
this.availableDepartments = []
|
this.availableDepartments = []
|
||||||
}
|
|
||||||
},
|
|
||||||
// 处理零部件名称选择变化(仅用于批量修改填写人)
|
|
||||||
handlePartsNameChange(partsNames) {
|
|
||||||
// partsNames 现在是数组
|
|
||||||
// 清空部门、现填写人和新填写人
|
|
||||||
this.formData.department = ''
|
|
||||||
this.formData.currentFillerId = ''
|
|
||||||
this.formData.currentFillerName = ''
|
|
||||||
this.formData.userId = ''
|
|
||||||
this.formData.userNumber = ''
|
|
||||||
this.formData.username = ''
|
|
||||||
this.availableDepartments = []
|
|
||||||
this.userOptions = []
|
|
||||||
// 根据子系统和零部件名称筛选部门列表
|
|
||||||
if (
|
|
||||||
partsNames &&
|
|
||||||
Array.isArray(partsNames) &&
|
|
||||||
partsNames.length > 0 &&
|
|
||||||
this.formData.subsystem
|
|
||||||
) {
|
|
||||||
this.filterDepartmentsByPartsName()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 根据子系统和零部件名称筛选部门列表(仅用于批量修改填写人)
|
|
||||||
filterDepartmentsByPartsName() {
|
|
||||||
if (
|
|
||||||
!this.formData.subsystem ||
|
|
||||||
!this.formData.partsName ||
|
|
||||||
!Array.isArray(this.formData.partsName) ||
|
|
||||||
this.formData.partsName.length === 0
|
|
||||||
) {
|
|
||||||
this.availableDepartments = []
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentVersionData = this.versionData[this.currentVersionId] || {}
|
const currentVersionData = this.versionData[this.currentVersionId] || {}
|
||||||
|
const partsNameSet = new Set()
|
||||||
const departmentSet = new Set()
|
const departmentSet = new Set()
|
||||||
|
|
||||||
// 遍历所有零部件名称(partsName)
|
Object.keys(currentVersionData).forEach((partsName) => {
|
||||||
Object.keys(currentVersionData).forEach((dataPartsName) => {
|
const params = currentVersionData[partsName] || []
|
||||||
const params = currentVersionData[dataPartsName] || []
|
|
||||||
// 遍历该零部件下的所有参数
|
|
||||||
params.forEach((param) => {
|
params.forEach((param) => {
|
||||||
// 检查参数是否属于选中的子系统和任意一个选中的零部件名称
|
if (!this.isParamSubsystemMatched(param.subsystemName, selectedSubsystems)) {
|
||||||
const paramPartsName = param.partsName || dataPartsName
|
return
|
||||||
if (
|
}
|
||||||
param.subsystemName === this.formData.subsystem &&
|
if (this.dispatchType === 'update_param') {
|
||||||
this.formData.partsName.includes(paramPartsName) &&
|
const paramPartsName = param.partsName || partsName
|
||||||
param.department
|
if (paramPartsName) {
|
||||||
) {
|
partsNameSet.add(paramPartsName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (param.department) {
|
||||||
departmentSet.add(param.department)
|
departmentSet.add(param.department)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// 转换为数组格式
|
if (this.dispatchType === 'update_param') {
|
||||||
this.availableDepartments = Array.from(departmentSet).map((dept) => ({
|
const partsNamesArray = Array.from(partsNameSet).sort()
|
||||||
department: dept
|
if (!partsNamesArray.includes('/')) {
|
||||||
}))
|
partsNamesArray.unshift('/')
|
||||||
|
}
|
||||||
|
this.availablePartsNames = partsNamesArray
|
||||||
|
} else {
|
||||||
|
this.availableDepartments = Array.from(departmentSet).map((dept) => ({
|
||||||
|
department: dept
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 处理零部件名称选择变化(仅用于批量修改填写人)
|
||||||
|
handlePartsNameChange() {
|
||||||
|
this.formData.userId = ''
|
||||||
|
this.formData.userNumber = ''
|
||||||
|
this.formData.username = ''
|
||||||
|
this.userOptions = []
|
||||||
},
|
},
|
||||||
// 处理部门选择变化
|
// 处理部门选择变化
|
||||||
handleDepartmentChange(department) {
|
handleDepartmentChange(department) {
|
||||||
@ -457,7 +511,6 @@ export default {
|
|||||||
this.formData.userNumber = ''
|
this.formData.userNumber = ''
|
||||||
this.formData.username = ''
|
this.formData.username = ''
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
// 如果是批量修改填写人,不需要查找现填写人
|
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -466,7 +519,13 @@ export default {
|
|||||||
const matchedItem = this.allManagerData.find((item) => {
|
const matchedItem = this.allManagerData.find((item) => {
|
||||||
// 检查子系统是否匹配
|
// 检查子系统是否匹配
|
||||||
const itemSubsystems = item.subsystem ? item.subsystem.split(',') : []
|
const itemSubsystems = item.subsystem ? item.subsystem.split(',') : []
|
||||||
return itemSubsystems.includes(this.formData.subsystem) && item.department === department
|
return (
|
||||||
|
itemSubsystems.some((name) =>
|
||||||
|
this.isSubsystemNameMatch(name.trim(), this.formData.subsystem)
|
||||||
|
) &&
|
||||||
|
item.department === department &&
|
||||||
|
this.isProjectPartsNameMatch(item)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
if (matchedItem) {
|
if (matchedItem) {
|
||||||
// 找到现责任人
|
// 找到现责任人
|
||||||
@ -483,8 +542,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 远程搜索责任人/填写人
|
// 远程搜索责任人/填写人
|
||||||
handleRemoteSearch(query) {
|
handleRemoteSearch(query) {
|
||||||
// 两种模式都需要检查部门
|
if (this.dispatchType !== 'update_param' && !this.formData.department) {
|
||||||
if (!this.formData.department) {
|
|
||||||
this.userOptions = []
|
this.userOptions = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -584,15 +642,6 @@ export default {
|
|||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// 验证必填字段
|
|
||||||
if (!this.formData.subsystem) {
|
|
||||||
this.$message.warning('请选择子系统')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.formData.department) {
|
|
||||||
this.$message.warning('请选择部门')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.formData.userId) {
|
if (!this.formData.userId) {
|
||||||
const fieldName = this.dispatchType === 'update_param' ? '人员' : '责任人'
|
const fieldName = this.dispatchType === 'update_param' ? '人员' : '责任人'
|
||||||
this.$message.warning(`请选择${fieldName}`)
|
this.$message.warning(`请选择${fieldName}`)
|
||||||
@ -601,7 +650,11 @@ export default {
|
|||||||
|
|
||||||
// 如果是批量修改填写人,不调用接口,直接触发确认事件
|
// 如果是批量修改填写人,不调用接口,直接触发确认事件
|
||||||
if (this.dispatchType === 'update_param') {
|
if (this.dispatchType === 'update_param') {
|
||||||
// 验证零部件名称
|
const selectedSubsystems = this.getSelectedSubsystems()
|
||||||
|
if (!selectedSubsystems.length) {
|
||||||
|
this.$message.warning('请至少选择一个子系统')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
!this.formData.partsName ||
|
!this.formData.partsName ||
|
||||||
!Array.isArray(this.formData.partsName) ||
|
!Array.isArray(this.formData.partsName) ||
|
||||||
@ -610,14 +663,11 @@ export default {
|
|||||||
this.$message.warning('请至少选择一个零部件名称')
|
this.$message.warning('请至少选择一个零部件名称')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 确保所有必要参数都有值
|
|
||||||
// 如果 userNumber 为空,使用 userId 作为 userNumber(降级处理)
|
|
||||||
const confirmData = {
|
const confirmData = {
|
||||||
subsystem: this.formData.subsystem,
|
subsystem: selectedSubsystems,
|
||||||
partsName: this.formData.partsName, // 现在是数组
|
partsName: this.formData.partsName,
|
||||||
department: this.formData.department,
|
userId: this.formData.userId,
|
||||||
userId: this.formData.userId, // 确保传递userId
|
userNumber: this.formData.userNumber || this.formData.userId,
|
||||||
userNumber: this.formData.userNumber || this.formData.userId, // 如果没有 userNumber,使用 userId
|
|
||||||
username: this.formData.username || ''
|
username: this.formData.username || ''
|
||||||
}
|
}
|
||||||
console.log('批量修改填写人 - 提交数据:', confirmData)
|
console.log('批量修改填写人 - 提交数据:', confirmData)
|
||||||
@ -658,6 +708,7 @@ export default {
|
|||||||
departmentId: this.getDepartmentIdByDepartment(this.formData.department),
|
departmentId: this.getDepartmentIdByDepartment(this.formData.department),
|
||||||
department: this.formData.department,
|
department: this.formData.department,
|
||||||
subsystem: this.formData.subsystem,
|
subsystem: this.formData.subsystem,
|
||||||
|
partsName: this.projectPartsName || '',
|
||||||
userId: this.formData.userId, // 使用 userNumber
|
userId: this.formData.userId, // 使用 userNumber
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
},
|
},
|
||||||
@ -697,6 +748,7 @@ export default {
|
|||||||
departmentId: this.getDepartmentIdByDepartment(this.formData.department),
|
departmentId: this.getDepartmentIdByDepartment(this.formData.department),
|
||||||
department: this.formData.department,
|
department: this.formData.department,
|
||||||
subsystem: this.formData.subsystem,
|
subsystem: this.formData.subsystem,
|
||||||
|
partsName: this.projectPartsName || '',
|
||||||
userId: this.formData.userId
|
userId: this.formData.userId
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
@ -764,6 +816,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 根据部门名称获取部门ID(从部门树中查找)
|
// 根据部门名称获取部门ID(从部门树中查找)
|
||||||
getDepartmentIdByDepartment(department) {
|
getDepartmentIdByDepartment(department) {
|
||||||
|
if (typeof this.resolveDepartmentId === 'function') {
|
||||||
|
const resolvedId = this.resolveDepartmentId(department)
|
||||||
|
if (resolvedId) {
|
||||||
|
return resolvedId
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!department || !this.departmentTreeData || this.departmentTreeData.length === 0) {
|
if (!department || !this.departmentTreeData || this.departmentTreeData.length === 0) {
|
||||||
// 如果部门树没有加载,尝试从 allManagerData 中查找
|
// 如果部门树没有加载,尝试从 allManagerData 中查找
|
||||||
if (this.allManagerData && this.allManagerData.length > 0) {
|
if (this.allManagerData && this.allManagerData.length > 0) {
|
||||||
|
|||||||
@ -463,7 +463,7 @@ export default {
|
|||||||
-webkit-box-flex: 1;
|
-webkit-box-flex: 1;
|
||||||
-ms-flex: 1;
|
-ms-flex: 1;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 12px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -37,6 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="subsystem" label="子系统" align="center" />
|
<el-table-column prop="subsystem" label="子系统" align="center" />
|
||||||
|
<el-table-column prop="partsName" label="状态代号" align="center" />
|
||||||
<el-table-column prop="username" label="责任人" width="250" align="center" />
|
<el-table-column prop="username" label="责任人" width="250" align="center" />
|
||||||
<el-table-column v-if="hasEditPermission()" label="操作" width="200" align="center">
|
<el-table-column v-if="hasEditPermission()" label="操作" width="200" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -115,6 +116,15 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="项目名称:" prop="partsName">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.partsName"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
clearable
|
||||||
|
maxlength="100"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="责任部门:" prop="department">
|
<el-form-item label="责任部门:" prop="department">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.selectDeptName"
|
v-model="formData.selectDeptName"
|
||||||
@ -267,6 +277,7 @@ export default {
|
|||||||
formData: {
|
formData: {
|
||||||
department: '', // 级联选择器绑定的部门ID
|
department: '', // 级联选择器绑定的部门ID
|
||||||
subsystem: '', // 子系统
|
subsystem: '', // 子系统
|
||||||
|
partsName: '', // 项目名称
|
||||||
responsible: '', // 责任人用户ID(用于提交)
|
responsible: '', // 责任人用户ID(用于提交)
|
||||||
responsibleName: '', // 责任人姓名(用于自动完成显示)
|
responsibleName: '', // 责任人姓名(用于自动完成显示)
|
||||||
selectDeptId: '', // 选中的部门ID(用于搜索责任人)
|
selectDeptId: '', // 选中的部门ID(用于搜索责任人)
|
||||||
@ -278,6 +289,7 @@ export default {
|
|||||||
formRules: {
|
formRules: {
|
||||||
department: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
|
department: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
|
||||||
subsystem: [{ required: true, message: '请输入子系统', trigger: 'blur' }],
|
subsystem: [{ required: true, message: '请输入子系统', trigger: 'blur' }],
|
||||||
|
partsName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
||||||
responsible: [{ required: true, message: '请选择责任人', trigger: 'change' }]
|
responsible: [{ required: true, message: '请选择责任人', trigger: 'change' }]
|
||||||
},
|
},
|
||||||
subsystemList: [],
|
subsystemList: [],
|
||||||
@ -570,6 +582,7 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: '',
|
department: '',
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
|
partsName: '',
|
||||||
responsible: '',
|
responsible: '',
|
||||||
responsibleName: '',
|
responsibleName: '',
|
||||||
selectDeptId: '',
|
selectDeptId: '',
|
||||||
@ -606,6 +619,7 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: row.departmentId || '', // 级联选择器需要部门ID
|
department: row.departmentId || '', // 级联选择器需要部门ID
|
||||||
subsystem: row.subsystem || '', // 子系统
|
subsystem: row.subsystem || '', // 子系统
|
||||||
|
partsName: row.partsName || '', // 项目名称
|
||||||
responsible: row.userNumber || row.userId || '', // 责任人 userNumber(用于 el-select 的 value)
|
responsible: row.userNumber || row.userId || '', // 责任人 userNumber(用于 el-select 的 value)
|
||||||
responsibleName: row.username || '', // 责任人姓名(用于显示)
|
responsibleName: row.username || '', // 责任人姓名(用于显示)
|
||||||
selectDeptId: row.departmentId || '', // 选中的部门ID(用于搜索责任人)
|
selectDeptId: row.departmentId || '', // 选中的部门ID(用于搜索责任人)
|
||||||
@ -627,6 +641,7 @@ export default {
|
|||||||
this.formData = {
|
this.formData = {
|
||||||
department: '',
|
department: '',
|
||||||
subsystem: '',
|
subsystem: '',
|
||||||
|
partsName: '',
|
||||||
responsible: '',
|
responsible: '',
|
||||||
responsibleName: '',
|
responsibleName: '',
|
||||||
selectDeptId: '',
|
selectDeptId: '',
|
||||||
@ -661,6 +676,7 @@ export default {
|
|||||||
subsystem: Array.isArray(this.formData.subsystem)
|
subsystem: Array.isArray(this.formData.subsystem)
|
||||||
? this.formData.subsystem.join(',')
|
? this.formData.subsystem.join(',')
|
||||||
: this.formData.subsystem,
|
: this.formData.subsystem,
|
||||||
|
partsName: this.formData.partsName || '',
|
||||||
userId: this.formData.userId || this.formData.responsible
|
userId: this.formData.userId || this.formData.responsible
|
||||||
},
|
},
|
||||||
disableSuccessMsg: true
|
disableSuccessMsg: true
|
||||||
@ -691,6 +707,7 @@ export default {
|
|||||||
subsystem: Array.isArray(this.formData.subsystem)
|
subsystem: Array.isArray(this.formData.subsystem)
|
||||||
? this.formData.subsystem.join(',')
|
? this.formData.subsystem.join(',')
|
||||||
: this.formData.subsystem,
|
: this.formData.subsystem,
|
||||||
|
partsName: this.formData.partsName || '',
|
||||||
userId: this.formData.responsible,
|
userId: this.formData.responsible,
|
||||||
rowId: this.formData.rowId
|
rowId: this.formData.rowId
|
||||||
},
|
},
|
||||||
@ -1330,7 +1347,7 @@ export default {
|
|||||||
-webkit-box-flex: 1;
|
-webkit-box-flex: 1;
|
||||||
-ms-flex: 1;
|
-ms-flex: 1;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 12px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -208,7 +208,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handleAddModelDialogClose">取消</el-button>
|
<el-button @click="handleAddModelDialogClose">取消</el-button>
|
||||||
<el-button type="primary" @click="handleConfirmAddModel">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="loadingModelDetail"
|
||||||
|
@click="handleConfirmAddModel"
|
||||||
|
>
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
@ -312,6 +316,10 @@ import api from '@/api'
|
|||||||
import { getUserId } from '@/utils'
|
import { getUserId } from '@/utils'
|
||||||
import '@/assets/scss/apaas-custom-hello.css'
|
import '@/assets/scss/apaas-custom-hello.css'
|
||||||
|
|
||||||
|
/** 整车参数展示名称(接口可能仍返回「整车参数」) */
|
||||||
|
const WHOLE_ENGINE_PARAMS_NAME = '发动机基本信息'
|
||||||
|
const WHOLE_ENGINE_PARAMS_LEGACY_KEYS = ['整车参数', WHOLE_ENGINE_PARAMS_NAME]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModelQuery',
|
name: 'ModelQuery',
|
||||||
data() {
|
data() {
|
||||||
@ -926,7 +934,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果是"整车参数"子系统,且是特定的参数,直接从机型原始数据中获取
|
// 如果是"整车参数"子系统,且是特定的参数,直接从机型原始数据中获取
|
||||||
if (param.subsystemName === '整车参数') {
|
if (this.isWholeEngineSubsystemName(param.subsystemName)) {
|
||||||
const paramNameToFieldMap = {
|
const paramNameToFieldMap = {
|
||||||
产品型号: 'modelName',
|
产品型号: 'modelName',
|
||||||
状态代号: 'productNumber',
|
状态代号: 'productNumber',
|
||||||
@ -1074,6 +1082,10 @@ export default {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
this.loadingModelDetail = true
|
this.loadingModelDetail = true
|
||||||
|
const minLoadingMs = 1500
|
||||||
|
const minLoadingPromise = new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, minLoadingMs)
|
||||||
|
})
|
||||||
// 获取当前选中的树节点对应的 subsystemTypes
|
// 获取当前选中的树节点对应的 subsystemTypes
|
||||||
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
||||||
// 批量加载选中机型的详情
|
// 批量加载选中机型的详情
|
||||||
@ -1098,7 +1110,7 @@ export default {
|
|||||||
return this.loadModelDetail(modelId, model, parameterVersion, subsystemTypes)
|
return this.loadModelDetail(modelId, model, parameterVersion, subsystemTypes)
|
||||||
})
|
})
|
||||||
|
|
||||||
Promise.all(loadPromises)
|
Promise.all([Promise.all(loadPromises), minLoadingPromise])
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// this.$message.success('添加机型成功')
|
// this.$message.success('添加机型成功')
|
||||||
this.handleAddModelDialogClose()
|
this.handleAddModelDialogClose()
|
||||||
@ -1530,7 +1542,7 @@ export default {
|
|||||||
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
const { subsystemTypes } = this.getSelectedSubsystemsAndTypes()
|
||||||
// 过滤掉"整车参数"子系统,不包含在下载数据中
|
// 过滤掉"整车参数"子系统,不包含在下载数据中
|
||||||
const filteredSubsystemTypes = subsystemTypes.filter(
|
const filteredSubsystemTypes = subsystemTypes.filter(
|
||||||
(item) => !item.startsWith('整车参数-')
|
(item) => !this.isWholeEngineSubsystemPrefix(item)
|
||||||
)
|
)
|
||||||
|
|
||||||
// 构建参数ID数组,和"更新常用"中的parameters一样,但不包含整车参数
|
// 构建参数ID数组,和"更新常用"中的parameters一样,但不包含整车参数
|
||||||
@ -1539,7 +1551,7 @@ export default {
|
|||||||
if (saveData && saveData.subsystems && saveData.subsystems.length > 0) {
|
if (saveData && saveData.subsystems && saveData.subsystems.length > 0) {
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -1659,7 +1671,7 @@ export default {
|
|||||||
|
|
||||||
if (isGlobal) {
|
if (isGlobal) {
|
||||||
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统
|
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统
|
||||||
targetSubsystemName = '整车参数'
|
targetSubsystemName = WHOLE_ENGINE_PARAMS_NAME
|
||||||
if (!subsystemPartsMap.has(targetSubsystemName)) {
|
if (!subsystemPartsMap.has(targetSubsystemName)) {
|
||||||
subsystemPartsMap.set(targetSubsystemName, new Set())
|
subsystemPartsMap.set(targetSubsystemName, new Set())
|
||||||
}
|
}
|
||||||
@ -1833,7 +1845,7 @@ export default {
|
|||||||
// 检查是否是 isGlobal 为 1 的参数(属于"整车参数"子系统)
|
// 检查是否是 isGlobal 为 1 的参数(属于"整车参数"子系统)
|
||||||
const isGlobal = p.isGlobal === 1 || p.isGlobal === '1'
|
const isGlobal = p.isGlobal === 1 || p.isGlobal === '1'
|
||||||
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统,否则属于原子系统
|
// 如果 isGlobal 为 1,该参数属于"整车参数"子系统,否则属于原子系统
|
||||||
const targetSubsystemName = isGlobal ? '整车参数' : subsystemName
|
const targetSubsystemName = isGlobal ? WHOLE_ENGINE_PARAMS_NAME : subsystemName
|
||||||
|
|
||||||
// 优先使用 parameterId,如果没有则使用 parameterName
|
// 优先使用 parameterId,如果没有则使用 parameterName
|
||||||
const key = p.parameterId || p.parameterName
|
const key = p.parameterId || p.parameterName
|
||||||
@ -2067,7 +2079,7 @@ export default {
|
|||||||
let parameters = []
|
let parameters = []
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -2162,7 +2174,7 @@ export default {
|
|||||||
let parameters = []
|
let parameters = []
|
||||||
saveData.subsystems.forEach((item) => {
|
saveData.subsystems.forEach((item) => {
|
||||||
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
// 如果子系统是"整车参数",isGlobal为1,否则为0
|
||||||
const isGlobal = item.subsystem === '整车参数' ? 1 : 0
|
const isGlobal = this.isWholeEngineSubsystemName(item.subsystem) ? 1 : 0
|
||||||
item.parameters.forEach((param) => {
|
item.parameters.forEach((param) => {
|
||||||
parameters.push({
|
parameters.push({
|
||||||
parameterId: param.parameterId,
|
parameterId: param.parameterId,
|
||||||
@ -2580,13 +2592,30 @@ export default {
|
|||||||
})
|
})
|
||||||
return keys
|
return keys
|
||||||
},
|
},
|
||||||
// 根据接口返回的"整车参数"参数数据构建树结构
|
isWholeEngineSubsystemName(name) {
|
||||||
|
return WHOLE_ENGINE_PARAMS_LEGACY_KEYS.includes(name)
|
||||||
|
},
|
||||||
|
isWholeEngineSubsystemPrefix(item) {
|
||||||
|
if (!item || typeof item !== 'string') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return WHOLE_ENGINE_PARAMS_LEGACY_KEYS.some((key) => item.startsWith(`${key}-`))
|
||||||
|
},
|
||||||
|
getWholeEngineParametersList() {
|
||||||
|
for (let i = 0; i < WHOLE_ENGINE_PARAMS_LEGACY_KEYS.length; i++) {
|
||||||
|
const key = WHOLE_ENGINE_PARAMS_LEGACY_KEYS[i]
|
||||||
|
if (this.allParametersData[key]) {
|
||||||
|
return this.allParametersData[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
// 根据接口返回的发动机基本信息参数数据构建树结构
|
||||||
buildWholeEngineParamsNode() {
|
buildWholeEngineParamsNode() {
|
||||||
const subsystemName = '整车参数'
|
const subsystemName = WHOLE_ENGINE_PARAMS_NAME
|
||||||
const parentId = 'parent-whole-engine-params'
|
const parentId = 'parent-whole-engine-params'
|
||||||
|
|
||||||
// 从 allParametersData 中获取"整车参数"的参数列表
|
const parameters = this.getWholeEngineParametersList()
|
||||||
const parameters = this.allParametersData[subsystemName] || []
|
|
||||||
|
|
||||||
// 提取所有的partsName并去重(过滤掉'/'和空值)
|
// 提取所有的partsName并去重(过滤掉'/'和空值)
|
||||||
const partsNameSet = new Set()
|
const partsNameSet = new Set()
|
||||||
|
|||||||
@ -73,6 +73,7 @@
|
|||||||
:dispatch-type="dispatchType"
|
:dispatch-type="dispatchType"
|
||||||
:responsible-person-id="responsiblePersonId"
|
:responsible-person-id="responsiblePersonId"
|
||||||
:filled-by="filledBy"
|
:filled-by="filledBy"
|
||||||
|
:from-done="true"
|
||||||
:hide-operations="true"
|
:hide-operations="true"
|
||||||
class="engine-detail-wrapper"
|
class="engine-detail-wrapper"
|
||||||
@back="handleBackFromDetail"
|
@back="handleBackFromDetail"
|
||||||
|
|||||||
@ -109,16 +109,19 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
<!-- <span v-if="row.distributeStatus != '部分分发' && hasEngineDataEditPermission() && row.versionNumber === 1" class="link-separator"></span> -->
|
<span
|
||||||
<!-- <a
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
||||||
v-if="row.distributeStatus != '部分分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
class="link-separator"
|
||||||
|
></span>
|
||||||
|
<a
|
||||||
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
style="margin-left: 5px;"
|
style="margin-left: 5px;"
|
||||||
@click.stop="handleRowEdit(row)"
|
@click.stop="handleRowEdit(row)"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</a> -->
|
</a>
|
||||||
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
||||||
<a
|
<a
|
||||||
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
||||||
@ -362,7 +365,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '160',
|
width: '200',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -782,6 +785,9 @@ export default {
|
|||||||
this.$refs.addEngineModelModal.showModal('竞品')
|
this.$refs.addEngineModelModal.showModal('竞品')
|
||||||
},
|
},
|
||||||
handleRowEdit(row) {
|
handleRowEdit(row) {
|
||||||
|
if (row.distributeStatus !== '未分发') {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$refs.addEngineModelModal.showModalForEdit('竞品', row)
|
this.$refs.addEngineModelModal.showModalForEdit('竞品', row)
|
||||||
},
|
},
|
||||||
handleAddSuccess() {
|
handleAddSuccess() {
|
||||||
|
|||||||
@ -213,6 +213,9 @@
|
|||||||
multiple
|
multiple
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
collapse-tags
|
||||||
|
:max-collapse-tags="3"
|
||||||
placeholder="请输入人员姓名进行搜索"
|
placeholder="请输入人员姓名进行搜索"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
clearable
|
clearable
|
||||||
@ -1769,18 +1772,18 @@ export default {
|
|||||||
)
|
)
|
||||||
// 去重:使用 Map 确保每个 userId 只出现一次
|
// 去重:使用 Map 确保每个 userId 只出现一次
|
||||||
const optionsMap = new Map()
|
const optionsMap = new Map()
|
||||||
// 先添加已选择的选项
|
// 先添加搜索结果,保证匹配项显示在下拉框最前面
|
||||||
selectedOptions.forEach((opt) => {
|
|
||||||
if (opt.userId) {
|
|
||||||
optionsMap.set(opt.userId, opt)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 再添加新的搜索结果
|
|
||||||
filteredUsers.forEach((user) => {
|
filteredUsers.forEach((user) => {
|
||||||
if (user.userId && !optionsMap.has(user.userId)) {
|
if (user.userId && !optionsMap.has(user.userId)) {
|
||||||
optionsMap.set(user.userId, user)
|
optionsMap.set(user.userId, user)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 再添加已选择的选项(用于标签反显)
|
||||||
|
selectedOptions.forEach((opt) => {
|
||||||
|
if (opt.userId && !optionsMap.has(opt.userId)) {
|
||||||
|
optionsMap.set(opt.userId, opt)
|
||||||
|
}
|
||||||
|
})
|
||||||
this.personOptions = Array.from(optionsMap.values())
|
this.personOptions = Array.from(optionsMap.values())
|
||||||
this.personSearchLoading = false
|
this.personSearchLoading = false
|
||||||
this.currentPersonRequest = null
|
this.currentPersonRequest = null
|
||||||
@ -2443,6 +2446,33 @@ export default {
|
|||||||
|
|
||||||
// 人员选择下拉框样式(参考 modelDetail.vue)
|
// 人员选择下拉框样式(参考 modelDetail.vue)
|
||||||
::v-deep .person-select {
|
::v-deep .person-select {
|
||||||
|
.el-select__input {
|
||||||
|
display: inline-block !important;
|
||||||
|
visibility: visible !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 80px !important;
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select__tags {
|
||||||
|
max-width: calc(100% - 30px);
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tag {
|
||||||
|
max-width: 90px;
|
||||||
|
|
||||||
|
.el-select__tags-text {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.el-select-dropdown__item {
|
.el-select-dropdown__item {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
justify-content: space-between !important;
|
justify-content: space-between !important;
|
||||||
|
|||||||
@ -109,16 +109,19 @@
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
<!-- <span v-if="row.distributeStatus != '部分分发' && hasEngineDataEditPermission() && row.versionNumber === 1" class="link-separator"></span> -->
|
<span
|
||||||
<!-- <a
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
||||||
v-if="row.distributeStatus != '部分分发' && hasEngineDataEditPermission() && row.versionNumber === 1"
|
class="link-separator"
|
||||||
|
></span>
|
||||||
|
<a
|
||||||
|
v-if="row.distributeStatus === '未分发' && hasEngineDataEditPermission()"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="el-link el-link--primary"
|
class="el-link el-link--primary"
|
||||||
style="margin-left: 5px;"
|
style="margin-left: 5px;"
|
||||||
@click.stop="handleRowEdit(row)"
|
@click.stop="handleRowEdit(row)"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</a> -->
|
</a>
|
||||||
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
<span v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') &&hasEngineDataEditPermission()" class="link-separator"></span>
|
||||||
<a
|
<a
|
||||||
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
v-if=" (row.distributeStatus === '未分发' || row.distributeStatus === '部分分发') && hasEngineDataEditPermission()"
|
||||||
@ -364,7 +367,7 @@ export default {
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
customSlot: 'options',
|
customSlot: 'options',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '160',
|
width: '200',
|
||||||
fixed: 'right'
|
fixed: 'right'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -784,6 +787,9 @@ export default {
|
|||||||
this.$refs.addEngineModelModal.showModal('玉柴')
|
this.$refs.addEngineModelModal.showModal('玉柴')
|
||||||
},
|
},
|
||||||
handleRowEdit(row) {
|
handleRowEdit(row) {
|
||||||
|
if (row.distributeStatus !== '未分发') {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$refs.addEngineModelModal.showModalForEdit('玉柴', row)
|
this.$refs.addEngineModelModal.showModalForEdit('玉柴', row)
|
||||||
},
|
},
|
||||||
handleAddSuccess() {
|
handleAddSuccess() {
|
||||||
|
|||||||
@ -451,6 +451,7 @@ export default {
|
|||||||
// 如果是"填写发动机参数值",打开非分发模式(查看模式)
|
// 如果是"填写发动机参数值",打开非分发模式(查看模式)
|
||||||
// 如果是"管理员分发责任人",打开分发模式且是分发填写人(显示填写人列,调用UPDATE_PARAM接口)
|
// 如果是"管理员分发责任人",打开分发模式且是分发填写人(显示填写人列,调用UPDATE_PARAM接口)
|
||||||
// 其他情况打开分发模式且是分发责任人
|
// 其他情况打开分发模式且是分发责任人
|
||||||
|
// currentNode / ownerId / currentProcessor 会随 row 传入 engineDetail,用于「编制 + 当前处理人为本人」时选择 selectParamListAndModelForFilledBy
|
||||||
this.currentEngineDetail = { ...row, id: row.modelId, todoId: row.id }
|
this.currentEngineDetail = { ...row, id: row.modelId, todoId: row.id }
|
||||||
this.todoId = row.id
|
this.todoId = row.id
|
||||||
// 填写发动机参数值:非分发模式(只读),传递 filledBy
|
// 填写发动机参数值:非分发模式(只读),传递 filledBy
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user