This commit is contained in:
duxuekai 2026-05-29 10:21:42 +08:00
parent a399336d3d
commit 4e1bef2888
11 changed files with 947 additions and 421 deletions

View File

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

View File

@ -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) {

View File

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

View File

@ -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;
} }
} }

View File

@ -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) => {
// ""isGlobal10 // ""isGlobal10
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) => {
// ""isGlobal10 // ""isGlobal10
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) => {
// ""isGlobal10 // ""isGlobal10
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()

View File

@ -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"

View File

@ -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() {

View File

@ -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;

View File

@ -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() {

View File

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