Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qr-consistency-vue3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
qr-consistency-vue3
Commits
e5ca786c
Commit
e5ca786c
authored
Apr 27, 2025
by
lwy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CCAP通用和事业部内容维护页面
parent
556f4d24
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
335 additions
and
81 deletions
+335
-81
maintainContent.js
src/api/RelationManagement/maintainContent.js
+71
-0
CCAPMaintainContent.vue
...nshipManagement/CCAPCriticalParts/CCAPMaintainContent.vue
+264
-81
No files found.
src/api/RelationManagement/maintainContent.js
View file @
e5ca786c
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
//添加零部件
export
function
addParts
(
data
)
{
return
request
({
url
:
'/control/partsRelation/add'
,
method
:
'post'
,
data
:
data
})
}
//获取零部件一级名称下拉列表
export
function
listPartLevelOneName
()
{
return
request
({
url
:
'/control/partsRelation/partLevelOneNameList'
,
method
:
'get'
})
}
//获取专业部门下拉列表
export
function
listProfessionalDepartment
(
businessRelationId
)
{
return
request
({
url
:
'/control/specialConfig/professionalDepartmentList'
,
method
:
'get'
,
params
:
{
businessRelationId
}
})
}
//删除关键零部件
export
function
deleteCriticalPart
(
partNameId
,
partsRelationId
,
specialConfigId
)
{
return
request
({
url
:
'/control/partsRelation/delete'
,
method
:
'get'
,
params
:
{
partNameId
,
partsRelationId
,
specialConfigId
}
});
}
//获取零部件详情
export
function
getPartsDetail
(
partNameId
,
businessRelationId
)
{
return
request
({
url
:
'/control/partsRelation/getDetail'
,
method
:
'get'
,
params
:
{
partNameId
,
businessRelationId
}
})
}
//编辑零部件
export
function
editParts
(
data
)
{
return
request
({
url
:
'/control/partsRelation/update'
,
method
:
'put'
,
data
:
data
})
}
//批量编辑和编辑--事业部
export
function
batchUpdateSpecialConfig
(
data
)
{
return
request
({
url
:
'/control/specialConfig/update'
,
method
:
'put'
,
data
:
data
})
}
src/views/controlPlan/relationshipManagement/CCAPCriticalParts/CCAPMaintainContent.vue
View file @
e5ca786c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<el-button
<el-button
link
link
@
click=
"back"
@
click=
"back"
style=
"font-size: 16px;"
style=
"font-size: 16px;
margin-right: 16px
"
>
>
<el-icon>
<el-icon>
<ArrowLeft/>
<ArrowLeft/>
...
@@ -12,8 +12,9 @@
...
@@ -12,8 +12,9 @@
返回
返回
</el-button>
</el-button>
<span
style=
"margin-right:16px"
>
事业部:
{{
divisionName
||
'--'
}}
</span>
<span
style=
"margin-right:16px"
>
事业部:
{{
divisionName
||
'--'
}}
</span>
<!-- 主列表传 等接口-->
<!-- 在模板中使用安全表达式 -->
<span
>
更新人:
{{
updateName
||
'--'
}}
</span>
<span>
更新人:
{{
(
updateName
.
value
||
route
.
query
.
updateName
)
||
'--'
}}
</span>
</div>
</div>
<!-- 搜索栏 -->
<!-- 搜索栏 -->
...
@@ -26,7 +27,7 @@
...
@@ -26,7 +27,7 @@
style=
"width: 200px"
style=
"width: 200px"
>
>
<el-option
<el-option
v-for=
"item in partLevelOneName"
v-for=
"item in partLevelOneName
Options
"
:key=
"item.value"
:key=
"item.value"
:label=
"item.label"
:label=
"item.label"
:value=
"item.value"
:value=
"item.value"
...
@@ -49,7 +50,7 @@
...
@@ -49,7 +50,7 @@
style=
"width: 200px"
style=
"width: 200px"
>
>
<el-option
<el-option
v-for=
"dict in part
s
_type"
v-for=
"dict in part_type"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -112,7 +113,7 @@
...
@@ -112,7 +113,7 @@
style=
"width: 200px"
style=
"width: 200px"
>
>
<el-option
<el-option
v-for=
"dict in p8_post_
mass_
production_unit"
v-for=
"dict in p8_post_production_unit"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -141,9 +142,17 @@
...
@@ -141,9 +142,17 @@
<el-button
<el-button
style=
"border: 1px solid #0154fb;color: #0154fb;float: right;margin-bottom: 24px;"
style=
"border: 1px solid #0154fb;color: #0154fb;float: right;margin-bottom: 24px;"
plain
plain
v-show=
"isDefault === '1'"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['control:config:add']"
v-hasPermi=
"['control:config:add']"
>
新增零件
</el-button>
>
新增零件
</el-button>
<el-button
style=
"border: 1px solid #0154fb;color: #0154fb;float: right;margin-bottom: 24px;"
plain
v-show=
"isDefault === '0'"
@
click=
"bulkEdit"
v-hasPermi=
"['control:config:add']"
>
批量编辑
</el-button>
</el-form
>
</el-form
>
...
@@ -151,9 +160,16 @@
...
@@ -151,9 +160,16 @@
<!--表格内容-->
<!--表格内容-->
<el-table
v-loading=
"loading"
<el-table
v-loading=
"loading"
:data=
"partsList"
:data=
"partsList"
@
selection-change=
"handleSelectionChange"
:span-method=
"objectSpanMethod"
:span-method=
"objectSpanMethod"
@
selection-change=
"handleSelectionChange"
border
>
border
>
<!-- :span-method="objectSpanMethod"-->
<el-table-column
v-if=
"isDefault === '0'"
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"75"
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"75"
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"零部件一级名称"
align=
"center"
prop=
"partLevelOneName"
>
<el-table-column
label=
"零部件一级名称"
align=
"center"
prop=
"partLevelOneName"
>
...
@@ -181,32 +197,67 @@
...
@@ -181,32 +197,67 @@
<dict-tag
:options=
"parts_source"
:value=
"scope.row.source"
/>
<dict-tag
:options=
"parts_source"
:value=
"scope.row.source"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
link
style=
"color: rgb(0,0,255)"
type=
"primary"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['control:config:edit']"
>
编辑
</el-button>
<el-button
link
style=
"color: rgb(0,0,255)"
type=
"primary"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['control:config:edit']"
>
编辑
</el-button>
<el-button
link
type=
"danger"
@
click=
"handleDelete(scope.row)"
v-show=
"scope.row.source === '1'"
>
<el-button
link
type=
"danger"
@
click=
"handleDelete(scope.row)"
v-show=
"scope.row.source === '1'"
>
删除
</el-button>
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 批量编辑抽屉 -->
<el-drawer
v-model=
"openBulk"
size=
"800px"
direction=
"rtl"
:title=
"title"
>
<
template
#
default
>
<el-form
ref=
"partsRef"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-form-item
label=
"专业部门:"
prop=
"professionalDepartment"
filterable
>
<el-select
v-model=
"form.professionalDepartment"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-option
v-for=
"dict in professionalDepartmentOptions"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"p8后端批量生产单位"
prop=
"p8PostMassProductionUnit"
>
<el-select
v-model=
"form.p8PostMassProductionUnit"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in p8_post_production_unit"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
</
template
>
<
template
#
footer
>
<div
style=
"flex: auto"
>
<el-button
class=
"btn-A"
@
click=
"cancel"
>
取消
</el-button>
<el-button
class=
"btn-B"
@
click=
"submitBulkForm"
>
提交
</el-button>
</div>
</
template
>
</el-drawer>
<!-- 添加或修改抽屉-->
<!-- 通用和事业部添加或修改抽屉-->
<el-drawer
v-model=
"open"
size=
"800px"
direction=
"rtl"
:title=
"title"
>
<el-drawer
v-model=
"open"
size=
"800px"
direction=
"rtl"
:title=
"title"
>
<
template
#
default
>
<
template
#
default
>
<el-form
ref=
"
detail
Ref"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-form
ref=
"
parts
Ref"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-form-item
label=
"零件一级名称:"
prop=
"partLevelOneName"
filterable
allow-create
v-show=
"isDefault === '1'"
>
<el-form-item
label=
"零件一级名称:"
prop=
"partLevelOneName"
filterable
allow-create
v-show=
"isDefault === '1'"
>
<el-select
v-model=
"form.partLevelOneName"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-select
v-model=
"form.partLevelOneName"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-option
<el-option
v-for=
"dict in partLevelOneNameOptions"
v-for=
"dict in partLevelOneNameOptions"
:key=
"dict"
:key=
"dict
.value
"
:label=
"dict"
:label=
"dict
.label
"
:value=
"dict"
:value=
"dict
.value
"
></el-option>
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"零件二级名称:"
prop=
"partLevelTwoName"
v-show=
"isDefault === '1'"
>
<el-form-item
label=
"零件二级名称:"
prop=
"partLevelTwoName"
v-show=
"isDefault === '1'
"
>
<el-input
v-model=
"form.partLevelTwoName"
placeholder=
"请输入"
/>
<el-input
:disabled=
"title === '编辑零件'"
v-model=
"form.partLevelTwoName"
placeholder=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"零件类型:"
prop=
"partType"
v-show=
"isDefault === '1'"
>
<el-form-item
label=
"零件类型:"
prop=
"partType"
v-show=
"isDefault === '1'"
>
<el-select
<el-select
...
@@ -215,7 +266,7 @@
...
@@ -215,7 +266,7 @@
clearable
clearable
>
>
<el-option
<el-option
v-for=
"dict in part
s
_type"
v-for=
"dict in part_type"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -225,10 +276,10 @@
...
@@ -225,10 +276,10 @@
<el-form-item
label=
"专业部门:"
prop=
"professionalDepartment"
filterable
>
<el-form-item
label=
"专业部门:"
prop=
"professionalDepartment"
filterable
>
<el-select
v-model=
"form.professionalDepartment"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-select
v-model=
"form.professionalDepartment"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-option
<el-option
v-for=
"dict in
d
epartmentOptions"
v-for=
"dict in
professionalD
epartmentOptions"
:key=
"dict"
:key=
"dict
.value
"
:label=
"dict"
:label=
"dict
.label
"
:value=
"dict"
:value=
"dict
.value
"
></el-option>
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -245,16 +296,16 @@
...
@@ -245,16 +296,16 @@
<el-form-item
label=
"总表项目-型号规格:"
prop=
"totalTableProjectModel"
v-show=
"isDefault === '1'"
>
<el-form-item
label=
"总表项目-型号规格:"
prop=
"totalTableProjectModel"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.totalTableProjectModel"
placeholder=
"请输入"
/>
<el-input
v-model=
"form.totalTableProjectModel"
placeholder=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"总表项目-生产厂:"
prop=
"totalTableProjectManufacturerName"
v-show=
"isDefault
=== '1'"
>
<el-form-item
label=
"总表项目-生产厂:"
prop=
"totalTableProjectManufacturerName"
v-show=
"isDefault=== '1'"
>
<el-input
v-model=
"form.totalTableProjectManufacturerName"
placeholder=
"请输入"
/>
<el-input
v-model=
"form.totalTableProjectManufacturerName"
placeholder=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"总表项目-证书编号:"
prop=
"totalTableProjectCertificateNumber"
v-show=
"isDefault === '1'"
>
<el-form-item
label=
"总表项目-证书编号:"
prop=
"totalTableProjectCertificateNumber"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.totalTableProjectCertificateNumber"
placeholder=
"请输入"
/>
<el-input
v-model=
"form.totalTableProjectCertificateNumber"
placeholder=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"p8后端批量生产单位"
prop=
"p8PostProductionUnit"
>
<el-form-item
label=
"p8后端批量生产单位"
prop=
"p8Post
Mass
ProductionUnit"
>
<el-select
v-model=
"form.p8PostProductionUnit"
placeholder=
"请选择"
>
<el-select
v-model=
"form.p8Post
Mass
ProductionUnit"
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"dict in p8_post_
mass_
production_unit"
v-for=
"dict in p8_post_production_unit"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -277,31 +328,30 @@
...
@@ -277,31 +328,30 @@
</template>
</template>
<
script
setup
name=
"Config"
>
<
script
setup
name=
"Config"
>
import
{
import
{
getPartsList
}
from
"@/api/RelationManagement/relation.js"
;
getPartsList
,
listRelation
,
deleteById
,
listbusinessUnit
,
copyAdd
,
addBusinessUnit
}
from
"@/api/RelationManagement/relation.js"
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
addParts
,
listPartLevelOneName
,
deleteCriticalPart
,
getPartsDetail
,
editParts
,
listProfessionalDepartment
,
batchUpdateSpecialConfig
}
from
"@/api/RelationManagement/maintainContent.js"
;
import
cn
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/cn.json"
;
import
cn
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/cn.json"
;
import
en
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/en.json"
;
import
en
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/en.json"
;
import
{
ArrowLeft
}
from
"@element-plus/icons-vue"
;
import
{
ArrowLeft
}
from
"@element-plus/icons-vue"
;
import
{
ref
}
from
"vue"
;
import
useUserStore
from
"@/store/modules/user.js"
;
// 新增导入
const
route
=
useRoute
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
part
s_type
,
parts_source
,
ccc_certification_mark
,
p8_post_mass
_production_unit
}
=
proxy
.
useDict
(
const
{
part
_type
,
parts_source
,
ccc_certification_mark
,
p8_post
_production_unit
}
=
proxy
.
useDict
(
'part
s
_type'
,
'part_type'
,
'parts_source'
,
'parts_source'
,
'ccc_certification_mark'
,
'ccc_certification_mark'
,
'p8_post_
mass_
production_unit'
'p8_post_production_unit'
)
)
const
partsList
=
ref
([]);
const
partsList
=
ref
([]);
const
open
=
ref
(
false
);
const
open
=
ref
(
false
);
const
openBulk
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
loading
=
ref
(
true
);
const
partsRef
=
ref
(
null
);
const
showSearch
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
ids
=
ref
([]);
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
single
=
ref
(
true
);
...
@@ -309,9 +359,18 @@ const multiple = ref(true);
...
@@ -309,9 +359,18 @@ const multiple = ref(true);
const
total
=
ref
(
0
);
const
total
=
ref
(
0
);
const
title
=
ref
(
""
);
const
title
=
ref
(
""
);
const
professionalDepartmentOptions
=
ref
([])
const
partLevelOneNameOptions
=
ref
([])
const
divisionName
=
ref
(
null
);
const
divisionName
=
ref
(
null
);
const
updateName
=
ref
(
null
);
const
updateName
=
ref
(
route
.
query
.
updateName
||
'--'
);
const
isDefault
=
ref
(
null
);
//是否通用(0-否,1-是)
const
isDefault
=
ref
(
route
.
query
.
isDefault
);
const
userStore
=
useUserStore
();
// 获取 Store 实例
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{},
form
:
{},
...
@@ -369,40 +428,48 @@ const { queryParams, form, rules } = toRefs(data);
...
@@ -369,40 +428,48 @@ const { queryParams, form, rules } = toRefs(data);
function
getList
()
{
function
getList
()
{
loading
.
value
=
true
;
loading
.
value
=
true
;
const
queryDivisionName
=
proxy
.
$
route
.
query
.
divisionName
;
const
queryDivisionName
=
route
.
query
.
divisionName
;
divisionName
.
value
=
Array
.
isArray
(
queryDivisionName
)
divisionName
.
value
=
Array
.
isArray
(
queryDivisionName
)
?
queryDivisionName
.
join
(
'、'
)
?
queryDivisionName
.
join
(
'、'
)
:
queryDivisionName
.
replace
(
/
[
"
\[\]]
/g
,
''
).
split
(
','
).
join
(
'、'
);
:
queryDivisionName
.
replace
(
/
[
"
\[\]]
/g
,
''
).
split
(
','
).
join
(
'、'
);
updateName
.
value
=
proxy
.
$route
.
query
.
updateName
updateName
.
value
=
route
.
query
.
updateName
||
'--'
;
isDefault
.
value
=
proxy
.
$
route
.
query
.
isDefault
isDefault
.
value
=
route
.
query
.
isDefault
getPartsList
(
queryParams
.
value
).
then
(
response
=>
{
getPartsList
(
queryParams
.
value
).
then
(
response
=>
{
partsList
.
value
=
response
.
data
;
partsList
.
value
=
response
.
data
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
// 新增:预处理合并信息
// **获取partsList后按零部件一级名称字段和排序字段排序**
partsList
.
value
.
sort
((
a
,
b
)
=>
{
// 1.按 partLevelOneName 排序(升序)
const
nameCompare
=
a
.
partLevelOneName
.
localeCompare
(
b
.
partLevelOneName
);
if
(
nameCompare
!==
0
)
return
nameCompare
;
// 2.同一级名称下,按 sort 字段升序排列(数值比较)
return
(
a
.
sort
||
0
)
-
(
b
.
sort
||
0
);
// 处理 sort 为空的情况
});
// 预处理合并信息(必须在排序后执行)
const
spanCache
=
{};
const
spanCache
=
{};
partsList
.
value
.
forEach
((
item
,
index
)
=>
{
partsList
.
value
.
forEach
((
item
,
index
)
=>
{
const
name
=
item
.
partLevelOneName
;
const
name
=
item
.
partLevelOneName
;
if
(
!
spanCache
[
name
])
{
if
(
!
spanCache
[
name
])
{
// 首次出现:记录起始索引和总出现次数
spanCache
[
name
]
=
{
start
:
index
,
count
:
1
};
spanCache
[
name
]
=
{
start
:
index
,
count
:
1
};
}
else
{
}
else
{
spanCache
[
name
].
count
++
;
spanCache
[
name
].
count
++
;
}
}
});
});
// 将缓存挂载到组件实例方便调用
proxy
.
$mergeSpanCache
=
spanCache
;
proxy
.
$mergeSpanCache
=
spanCache
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
});
});
}
}
// 合并单元格的方法
// 合并单元格的方法
function
objectSpanMethod
({
row
,
rowIndex
,
columnIndex
})
{
function
objectSpanMethod
({
row
,
rowIndex
,
columnIndex
})
{
if
(
columnIndex
!==
1
)
return
{
rowspan
:
1
,
colspan
:
1
};
//判断是否通用
const
targetColumn
=
isDefault
.
value
===
'0'
?
2
:
1
;
if
(
columnIndex
!==
targetColumn
)
return
{
rowspan
:
1
,
colspan
:
1
};
const
name
=
row
.
partLevelOneName
;
const
name
=
row
.
partLevelOneName
;
const
spanCache
=
proxy
.
$mergeSpanCache
;
const
spanCache
=
proxy
.
$mergeSpanCache
;
...
@@ -410,12 +477,9 @@ function objectSpanMethod({ row, rowIndex, columnIndex }) {
...
@@ -410,12 +477,9 @@ function objectSpanMethod({ row, rowIndex, columnIndex }) {
if
(
!
spanCache
[
name
])
return
{
rowspan
:
1
,
colspan
:
1
};
if
(
!
spanCache
[
name
])
return
{
rowspan
:
1
,
colspan
:
1
};
const
{
start
,
count
}
=
spanCache
[
name
];
const
{
start
,
count
}
=
spanCache
[
name
];
return
rowIndex
===
start
// 非起始行:隐藏
?
{
rowspan
:
count
,
colspan
:
1
}
if
(
rowIndex
!==
start
)
return
{
rowspan
:
0
,
colspan
:
0
};
:
{
rowspan
:
0
,
colspan
:
0
};
// 起始行:设置合并行数
return
{
rowspan
:
count
,
colspan
:
1
};
}
}
...
@@ -437,18 +501,20 @@ function reset() {
...
@@ -437,18 +501,20 @@ function reset() {
totalTableProjectModel
:
null
,
totalTableProjectModel
:
null
,
totalTableProjectManufacturerName
:
null
,
totalTableProjectManufacturerName
:
null
,
totalTableProjectCertificateNumber
:
null
,
totalTableProjectCertificateNumber
:
null
,
p8PostMassProductionUnit
:
null
,
p8PostMassProductionUnit
:
'制造'
,
source
:
null
,
source
:
null
,
certificationBody
:
route
.
query
.
certificationBody
,
certificationBody
:
route
.
query
.
certificationBody
,
businessRelationId
:
route
.
query
.
businessRelationId
,
businessRelationId
:
route
.
query
.
businessRelationId
,
businessId
:
null
businessId
:
null
};
};
proxy
.
resetForm
(
"
config
Ref"
);
proxy
.
resetForm
(
"
parts
Ref"
);
}
}
// 返回CCAP关键零部件管理
// 返回CCAP关键零部件管理
function
back
()
{
function
back
()
{
proxy
.
$router
.
push
({
path
:
'/control/relationshipManagement/RelationManagement'
})
router
.
push
({
path
:
'/control/relationshipManagement/CCAPCriticalParts'
})
}
}
// 最近更新人
// 最近更新人
...
@@ -461,6 +527,37 @@ const latestRecord = computed(() => {
...
@@ -461,6 +527,37 @@ const latestRecord = computed(() => {
},
partsList
.
value
[
0
]);
},
partsList
.
value
[
0
]);
});
});
// 获取零部件一级名称的方法
const
getPartLevelOneNameList
=
async
()
=>
{
try
{
const
res
=
await
listPartLevelOneName
();
partLevelOneNameOptions
.
value
=
res
.
data
.
map
(
item
=>
({
value
:
item
,
label
:
item
}));
}
catch
(
error
)
{
console
.
error
(
'获取零部件一级名称失败:'
,
error
);
partLevelOneNameOptions
.
value
=
[];
}
};
//获取专业部门
const
getProfessionalDepartmentList
=
async
()
=>
{
try
{
const
businessRelationId
=
route
.
query
.
businessRelationId
;
// 从路由参数获取
const
res
=
await
listProfessionalDepartment
(
businessRelationId
);
// 将接口返回数据转为 { value, label } 格式
professionalDepartmentOptions
.
value
=
res
.
data
.
map
(
item
=>
({
value
:
item
,
label
:
item
}));
}
catch
(
error
)
{
console
.
error
(
'获取专业部门失败:'
,
error
);
professionalDepartmentOptions
.
value
=
[];
}
};
/** 搜索按钮操作 */
/** 搜索按钮操作 */
function
handleQuery
()
{
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
;
queryParams
.
value
.
pageNum
=
1
;
...
@@ -475,9 +572,12 @@ function resetQuery() {
...
@@ -475,9 +572,12 @@ function resetQuery() {
// 多选框选中数据
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
// 判断是否通用(0-否,1-是)
single
.
value
=
selection
.
length
!=
1
;
if
(
isDefault
.
value
===
'0'
)
{
multiple
.
value
=
!
selection
.
length
;
ids
.
value
=
selection
.
map
(
item
=>
item
.
partNameId
);
single
.
value
=
selection
.
length
!==
1
;
multiple
.
value
=
selection
.
length
!==
0
;
}
}
}
/** 新增按钮操作 */
/** 新增按钮操作 */
...
@@ -485,32 +585,90 @@ function handleAdd() {
...
@@ -485,32 +585,90 @@ function handleAdd() {
reset
();
reset
();
open
.
value
=
true
;
open
.
value
=
true
;
title
.
value
=
"新增零件"
;
title
.
value
=
"新增零件"
;
// 确保默认值生效(防止重置覆盖)
form
.
value
.
p8PostMassProductionUnit
=
'制造'
;
}
/** 批量按钮操作 */
function
bulkEdit
()
{
reset
();
openBulk
.
value
=
true
;
title
.
value
=
"批量编辑"
;
// 收集选中的 IDs
if
(
ids
.
value
.
length
===
0
)
{
proxy
.
$modal
.
msgWarning
(
"请先选择需要批量编辑的记录"
);
return
;
}
// 确保默认值生效(防止重置覆盖)
form
.
value
.
p8PostMassProductionUnit
=
'制造'
;
form
.
value
.
ids
=
ids
.
value
;
// 将选中的 IDs 存入表单
console
.
log
(
"ids:"
,
ids
.
value
)
}
}
/** 修改按钮操作 */
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
function
handleUpdate
(
row
)
{
reset
();
reset
();
const
_id
=
row
.
id
||
ids
.
value
open
.
value
=
true
;
// 打开抽屉
getPartsList
(
_id
).
then
(
response
=>
{
//判断是否默认 1默认 0非默认
if
(
isDefault
.
value
===
'1'
){
title
.
value
=
"编辑零件"
;
}
else
{
// 确保默认值生效(防止重置覆盖)
form
.
value
.
p8PostMassProductionUnit
=
'制造'
;
title
.
value
=
"编辑"
;
}
// 从当前行数据中提取参数
const
{
partNameId
}
=
row
;
const
businessRelationId
=
route
.
query
.
businessRelationId
;
// 从路由参数获取
getPartsDetail
(
partNameId
,
businessRelationId
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
form
.
value
=
response
.
data
;
console
.
log
(
"partsList数据结构:"
,
partsList
.
value
);
// 检查数据中的字段名
open
.
value
=
true
;
open
.
value
=
true
;
//判断是否默认 1默认 0非默认
if
(
isDefault
.
value
===
'1'
){
title
.
value
=
"编辑零件"
;
title
.
value
=
"编辑零件"
;
}
else
{
title
.
value
=
"编辑"
;
}
}).
catch
(
error
=>
{
proxy
.
$modal
.
msgError
(
"获取详情失败:"
+
error
.
message
);
});
});
}
}
/** 提交按钮 */
/** 提交按钮 */
function
submitForm
()
{
function
submitForm
()
{
p
roxy
.
$refs
[
"configRef"
]
.
validate
(
valid
=>
{
p
artsRef
.
value
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
if
(
isDefault
.
value
===
'1'
){
updateConfig
(
form
.
value
).
then
(
response
=>
{
if
(
form
.
value
.
partNameId
!=
null
)
{
//编辑--通用
editParts
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
updateName
.
value
=
userStore
.
name
;
open
.
value
=
false
;
open
.
value
=
false
;
getList
();
getList
();
});
});
}
else
{
}
else
if
(
form
.
value
.
id
==
null
)
{
addConfig
(
form
.
value
).
then
(
response
=>
{
addParts
(
form
.
value
).
then
(
response
=>
{
//新增--通用
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
updateName
.
value
=
userStore
.
name
;
open
.
value
=
false
;
getList
();
});
}
}
else
if
(
isDefault
.
value
===
'0'
){
//编辑--事业部
const
data
=
{
ids
:
[
form
.
value
.
partNameId
],
professionalDepartment
:
form
.
value
.
professionalDepartment
,
p8PostMassProductionUnit
:
form
.
value
.
p8PostMassProductionUnit
||
'制造'
,
businessRelationId
:
route
.
query
.
businessRelationId
};
batchUpdateSpecialConfig
(
data
).
then
(()
=>
{
proxy
.
$modal
.
msgSuccess
(
"批量更新成功"
);
open
.
value
=
false
;
open
.
value
=
false
;
getList
();
getList
();
});
});
...
@@ -519,20 +677,35 @@ function submitForm() {
...
@@ -519,20 +677,35 @@ function submitForm() {
});
});
}
}
//批量编辑提交按钮
function
submitBulkForm
(){
const
data
=
{
ids
:
form
.
value
.
ids
||
ids
.
value
,
// 确保 IDs 存在
professionalDepartment
:
form
.
value
.
professionalDepartment
,
p8PostMassProductionUnit
:
form
.
value
.
p8PostMassProductionUnit
||
'制造'
,
businessRelationId
:
route
.
query
.
businessRelationId
};
batchUpdateSpecialConfig
(
data
).
then
(()
=>
{
proxy
.
$modal
.
msgSuccess
(
"批量更新成功"
);
openBulk
.
value
=
false
;
getList
();
});
}
/** 删除按钮操作 */
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
const
{
partNameId
,
partsRelationId
,
specialConfigId
}
=
row
;
proxy
.
$modal
.
confirm
(
'是否确认删除关键零部件下事业部特殊配置编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
delConfig
(
_ids
);
proxy
.
$modal
.
confirm
(
'确定要删除该记录吗?'
).
then
(()
=>
{
return
deleteCriticalPart
(
partNameId
,
partsRelationId
,
specialConfigId
);
}).
then
(()
=>
{
}).
then
(()
=>
{
// 成功回调
getList
();
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
}
}
/** 导出按钮操作 */
/** 导出按钮操作 */
function
handleExport
()
{
function
handleExport
()
{
proxy
.
download
(
'control/config/export'
,
{
proxy
.
download
(
'control/config/export'
,
{
...
@@ -540,5 +713,15 @@ function handleExport() {
...
@@ -540,5 +713,15 @@ function handleExport() {
},
`config_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`config_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
onMounted
(()
=>
{
// 加载用户信息
userStore
.
getInfo
();
updateName
.
value
=
route
.
query
.
updateName
||
'--'
;
getPartLevelOneNameList
();
getProfessionalDepartmentList
();
});
getList
();
getList
();
</
script
>
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment