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
c12534a8
Commit
c12534a8
authored
Apr 25, 2025
by
lwy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CCAP内容维护页面
parent
f2ec6ab5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
717 additions
and
138 deletions
+717
-138
maintainContent.js
src/api/RelationManagement/maintainContent.js
+1
-0
relation.js
src/api/RelationManagement/relation.js
+9
-0
newAnnouncementVersion.vue
...carConsistency/filingParameter/newAnnouncementVersion.vue
+0
-36
CCAPMaintainContent.vue
...nshipManagement/CCAPCriticalParts/CCAPMaintainContent.vue
+539
-6
index.vue
...olPlan/relationshipManagement/CCAPCriticalParts/index.vue
+11
-20
index.vue
...rolPlan/relationshipManagement/CQCCriticalParts/index.vue
+156
-75
index.vue
src/views/system/user/index.vue
+1
-1
No files found.
src/api/RelationManagement/maintainContent.js
0 → 100644
View file @
c12534a8
import
request
from
'@/utils/request'
src/api/
CCAPCriticalParts
/relation.js
→
src/api/
RelationManagement
/relation.js
View file @
c12534a8
...
...
@@ -9,6 +9,15 @@ export function listRelation(query) {
})
}
// 查询关键零部件和事业部关系列表
export
function
getPartsList
(
query
)
{
return
request
({
url
:
'/control/partsBusinessRelation/partsList'
,
method
:
'get'
,
params
:
query
})
}
//获取事业部下拉列表
export
function
listbusinessUnit
(
query
)
{
return
request
({
...
...
src/views/carConsistency/filingParameter/newAnnouncementVersion.vue
View file @
c12534a8
...
...
@@ -213,43 +213,7 @@
@
pagination=
"getList"
/>
<!-- 添加事业部·复制新增的 对话框-->
<el-dialog
top=
"30"
v-model=
"tableDialogVisible"
:title=
"tableDialogTitle"
width=
"500"
>
<div
style=
"width: 70%;margin-left: 15%;padding: 20px 0"
>
<el-form
:model=
"tableDialogForm"
ref=
"dialogForm2"
>
<el-form-item
:rules=
"[
{ required: true, message: '请选择事业部', trigger: 'blur' }
]"
label=
"事业部:"
prop=
"businessId"
>
<el-select
v-model=
"tableDialogForm.businessId"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"dict in businessListExclude"
:label=
"dict.businessUnitName"
:value=
"dict.id"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"dialog2Cancel"
>
取消
</el-button>
<el-button
class=
"btn-A"
type=
"primary"
@
click=
"dialog2Sure"
>
确定
</el-button>
</div>
</
template
>
</el-dialog>
</template>
...
...
src/views/controlPlan/relationshipManagement/CCAPCriticalParts/CCAPMaintainContent.vue
View file @
c12534a8
<
script
setup
>
<
template
>
<div
class=
"app-container"
>
<div
style=
"margin-bottom: 20px;margin-right: 16px"
>
<el-button
link
@
click=
"back"
style=
"font-size: 16px;"
>
<el-icon>
<ArrowLeft/>
</el-icon>
返回
</el-button>
<span
style=
"margin-right:16px"
>
事业部:
{{
divisionName
||
'--'
}}
</span>
<!-- 主列表传 等接口-->
<span
>
更新人:
{{
updateName
||
'--'
}}
</span>
</div>
</
script
>
<!-- 搜索栏 -->
<el-form
:model=
"queryParams"
ref=
"queryRef"
:inline=
"true"
v-show=
"showSearch"
>
<el-form-item
label=
"零部件一级名称"
prop=
"partLevelOneName"
>
<el-select
v-model=
"queryParams.partLevelOneName"
placeholder=
"请选择"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"item in partLevelOneName"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"零部件二级名称"
prop=
"partLevelTwoName"
>
<el-input
v-model=
"queryParams.partLevelTwoName"
placeholder=
"请输入"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"零件类型"
prop=
"partType"
>
<el-select
v-model=
"queryParams.partType"
placeholder=
"请选择"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in parts_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"专业部门"
prop=
"professionalDepartment"
>
<el-input
v-model=
"queryParams.professionalDepartment"
placeholder=
"请输入"
clearable
style=
"width: 200px"
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"3C认证标志:"
prop=
"cccCertificationMark"
>
<el-select
v-model=
"queryParams.cccCertificationMark"
placeholder=
"请选择"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in ccc_certification_mark"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"总表项目-型号"
prop=
"totalTableProjectModel"
>
<el-input
v-model=
"queryParams.totalTableProjectModel"
placeholder=
"请输入"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"总表项目-生产厂"
prop=
"totalTableProjectManufacturerName"
>
<el-input
v-model=
"queryParams.totalTableProjectManufacturerName"
placeholder=
"请输入"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"总表项目-证书编号"
prop=
"totalTableProjectCertificateNumber"
>
<el-input
v-model=
"queryParams.totalTableProjectCertificateNumber"
placeholder=
"请输入"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"P8后批量生产单位"
prop=
"p8PostMassProductionUnit"
>
<el-select
v-model=
"queryParams.p8PostMassProductionUnit"
placeholder=
"请选择"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in p8_post_mass_production_unit"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"来源"
prop=
"source"
>
<el-select
v-model=
"queryParams.source"
placeholder=
"请选择"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in parts_source"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
class=
"btn-A"
icon=
"Search"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
class=
"btn-B"
icon=
"Refresh"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<el-button
style=
"border: 1px solid #0154fb;color: #0154fb;float: right;margin-bottom: 24px;"
plain
@
click=
"handleAdd"
v-hasPermi=
"['control:config:add']"
>
新增零件
</el-button>
</el-form
>
<
template
>
<p>
CCAP内容维护
</p>
<!--表格内容-->
<el-table
v-loading=
"loading"
:data=
"partsList"
@
selection-change=
"handleSelectionChange"
:span-method=
"objectSpanMethod"
border
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"75"
>
</el-table-column>
<el-table-column
label=
"零部件一级名称"
align=
"center"
prop=
"partLevelOneName"
>
</el-table-column>
<el-table-column
label=
"零部件二级名称"
align=
"center"
prop=
"partLevelTwoName"
>
</el-table-column>
<el-table-column
label=
"零件类型"
align=
"center"
prop=
"partType"
>
</el-table-column>
<el-table-column
label=
"专业部门"
align=
"center"
prop=
"professionalDepartment"
>
</el-table-column>
<el-table-column
label=
"3C认证标志"
align=
"center"
prop=
"cccCertificationMark"
>
</el-table-column>
<el-table-column
label=
"总表项目-型号规格"
align=
"center"
prop=
"totalTableProjectModel"
>
</el-table-column>
<el-table-column
label=
"总表项目-生产厂"
align=
"center"
prop=
"totalTableProjectManufacturerName"
>
</el-table-column>
<el-table-column
label=
"总表项目-证书编号"
align=
"center"
prop=
"totalTableProjectCertificateNumber"
>
</el-table-column>
<el-table-column
label=
"P8后批量生产单位"
align=
"center"
prop=
"p8PostMassProductionUnit"
>
</el-table-column>
<el-table-column
label=
"排序"
align=
"center"
prop=
"sort"
>
</el-table-column>
<el-table-column
label=
"来源"
align=
"center"
prop=
"source"
>
<template
#
default=
"scope"
>
<dict-tag
:options=
"parts_source"
:value=
"scope.row.source"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
class-name=
"small-padding fixed-width"
>
<
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
type=
"danger"
@
click=
"handleDelete(scope.row)"
v-show=
"scope.row.source === '1'"
>
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 添加或修改抽屉-->
<el-drawer
v-model=
"open"
size=
"800px"
direction=
"rtl"
:title=
"title"
>
<
template
#
default
>
<el-form
ref=
"detailRef"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-form-item
label=
"零件一级名称:"
prop=
"partLevelOneName"
filterable
allow-create
v-show=
"isDefault === '1'"
>
<el-select
v-model=
"form.partLevelOneName"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-option
v-for=
"dict in partLevelOneNameOptions"
:key=
"dict"
:label=
"dict"
:value=
"dict"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"零件二级名称:"
prop=
"partLevelTwoName"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.partLevelTwoName"
placeholder=
"请输入"
/>
</el-form-item>
<el-form-item
label=
"零件类型:"
prop=
"partType"
v-show=
"isDefault === '1'"
>
<el-select
v-model=
"form.partType"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"dict in parts_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"专业部门:"
prop=
"professionalDepartment"
filterable
>
<el-select
v-model=
"form.professionalDepartment"
placeholder=
"请选择或输入"
filterable
allow-create
>
<el-option
v-for=
"dict in departmentOptions"
:key=
"dict"
:label=
"dict"
:value=
"dict"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"3C认证标志:"
prop=
"cccCertificationMark"
filterable
v-show=
"isDefault === '1'"
>
<el-select
v-model=
"form.cccCertificationMark"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in ccc_certification_mark"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"总表项目-型号规格:"
prop=
"totalTableProjectModel"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.totalTableProjectModel"
placeholder=
"请输入"
/>
</el-form-item>
<el-form-item
label=
"总表项目-生产厂:"
prop=
"totalTableProjectManufacturerName"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.totalTableProjectManufacturerName"
placeholder=
"请输入"
/>
</el-form-item>
<el-form-item
label=
"总表项目-证书编号:"
prop=
"totalTableProjectCertificateNumber"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.totalTableProjectCertificateNumber"
placeholder=
"请输入"
/>
</el-form-item>
<el-form-item
label=
"p8后端批量生产单位"
prop=
"p8PostProductionUnit"
>
<el-select
v-model=
"form.p8PostProductionUnit"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in p8_post_mass_production_unit"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"sort"
v-show=
"isDefault === '1'"
>
<el-input
v-model=
"form.sort"
type=
"number"
/>
</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=
"submitForm"
>
提交
</el-button>
</div>
</
template
>
</el-drawer>
</div>
</template>
<
style
scoped
lang=
"scss"
>
<
script
setup
name=
"Config"
>
import
{
getPartsList
,
listRelation
,
deleteById
,
listbusinessUnit
,
copyAdd
,
addBusinessUnit
}
from
"@/api/RelationManagement/relation.js"
;
import
{
useRoute
}
from
'vue-router'
;
import
cn
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/cn.json"
;
import
en
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/en.json"
;
import
{
ArrowLeft
}
from
"@element-plus/icons-vue"
;
const
route
=
useRoute
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
parts_type
,
parts_source
,
ccc_certification_mark
,
p8_post_mass_production_unit
}
=
proxy
.
useDict
(
'parts_type'
,
'parts_source'
,
'ccc_certification_mark'
,
'p8_post_mass_production_unit'
)
const
partsList
=
ref
([]);
const
open
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
multiple
=
ref
(
true
);
const
total
=
ref
(
0
);
const
title
=
ref
(
""
);
const
divisionName
=
ref
(
null
);
const
updateName
=
ref
(
null
);
const
isDefault
=
ref
(
null
);
const
data
=
reactive
({
form
:
{},
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
partLevelOneName
:
null
,
partLevelTwoName
:
null
,
partType
:
null
,
professionalDepartment
:
null
,
cccCertificationMark
:
null
,
totalTableProjectModel
:
null
,
totalTableProjectManufacturerName
:
null
,
totalTableProjectCertificateNumber
:
null
,
p8PostMassProductionUnit
:
null
,
source
:
null
,
certificationBody
:
route
.
query
.
certificationBody
,
businessRelationId
:
route
.
query
.
businessRelationId
,
businessId
:
null
},
rules
:
{
partLevelOneName
:
[
{
required
:
true
,
message
:
"零部件一级名称不能为空"
,
trigger
:
"blur"
}
],
partLevelTwoName
:
[
{
required
:
true
,
message
:
"零部件二级名称不能为空"
,
trigger
:
"blur"
}
],
partType
:
[
{
required
:
true
,
message
:
"零件类型不能为空"
,
trigger
:
"blur"
}
],
professionalDepartment
:
[
{
required
:
true
,
message
:
"专业部门不能为空"
,
trigger
:
"blur"
}
],
cccCertificationMark
:
[
{
required
:
true
,
message
:
"3C认证标志不能为空"
,
trigger
:
"blur"
}
],
totalTableProjectModel
:
[
{
required
:
true
,
message
:
"总表项目-型号规格不能为空"
,
trigger
:
"blur"
}
],
totalTableProjectManufacturerName
:
[
{
required
:
true
,
message
:
"总表项目-生产厂不能为空"
,
trigger
:
"blur"
}
],
totalTableProjectCertificateNumber
:
[
{
required
:
true
,
message
:
"总表项目-证书编号不能为空"
,
trigger
:
"blur"
}
],
sort
:
[
{
required
:
true
,
message
:
"排序不能为空"
,
trigger
:
"blur"
}
],
}
});
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
);
/** 查询关键零部件下事业部特殊配置列表 */
function
getList
()
{
loading
.
value
=
true
;
const
queryDivisionName
=
proxy
.
$route
.
query
.
divisionName
;
divisionName
.
value
=
Array
.
isArray
(
queryDivisionName
)
?
queryDivisionName
.
join
(
'、'
)
:
queryDivisionName
.
replace
(
/
[
"
\[\]]
/g
,
''
).
split
(
','
).
join
(
'、'
);
updateName
.
value
=
proxy
.
$route
.
query
.
updateName
isDefault
.
value
=
proxy
.
$route
.
query
.
isDefault
getPartsList
(
queryParams
.
value
).
then
(
response
=>
{
partsList
.
value
=
response
.
data
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
// 新增:预处理合并信息
const
spanCache
=
{};
partsList
.
value
.
forEach
((
item
,
index
)
=>
{
const
name
=
item
.
partLevelOneName
;
if
(
!
spanCache
[
name
])
{
// 首次出现:记录起始索引和总出现次数
spanCache
[
name
]
=
{
start
:
index
,
count
:
1
};
}
else
{
spanCache
[
name
].
count
++
;
}
});
// 将缓存挂载到组件实例方便调用
proxy
.
$mergeSpanCache
=
spanCache
;
});
}
// 合并单元格的方法
function
objectSpanMethod
({
row
,
rowIndex
,
columnIndex
})
{
if
(
columnIndex
!==
1
)
return
{
rowspan
:
1
,
colspan
:
1
};
const
name
=
row
.
partLevelOneName
;
const
spanCache
=
proxy
.
$mergeSpanCache
;
if
(
!
spanCache
[
name
])
return
{
rowspan
:
1
,
colspan
:
1
};
const
{
start
,
count
}
=
spanCache
[
name
];
</
style
>
// 非起始行:隐藏
if
(
rowIndex
!==
start
)
return
{
rowspan
:
0
,
colspan
:
0
};
// 起始行:设置合并行数
return
{
rowspan
:
count
,
colspan
:
1
};
}
// 取消按钮
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
// 表单重置
function
reset
()
{
form
.
value
=
{
id
:
null
,
partLevelOneName
:
null
,
partLevelTwoName
:
null
,
partType
:
null
,
professionalDepartment
:
null
,
cccCertificationMark
:
null
,
totalTableProjectModel
:
null
,
totalTableProjectManufacturerName
:
null
,
totalTableProjectCertificateNumber
:
null
,
p8PostMassProductionUnit
:
null
,
source
:
null
,
certificationBody
:
route
.
query
.
certificationBody
,
businessRelationId
:
route
.
query
.
businessRelationId
,
businessId
:
null
};
proxy
.
resetForm
(
"configRef"
);
}
// 返回CCAP关键零部件管理
function
back
()
{
proxy
.
$router
.
push
({
path
:
'/control/relationshipManagement/RelationManagement'
})
}
// 最近更新人
const
latestUpdateByName
=
computed
(()
=>
latestRecord
.
value
?.
updateByName
||
""
);
// 最新更新时间的记录
const
latestRecord
=
computed
(()
=>
{
if
(
!
partsList
.
value
||
partsList
.
value
.
length
===
0
)
return
null
;
return
partsList
.
value
.
reduce
((
latest
,
current
)
=>
{
return
new
Date
(
current
.
updateTime
)
>
new
Date
(
latest
.
updateTime
)
?
current
:
latest
;
},
partsList
.
value
[
0
]);
});
/** 搜索按钮操作 */
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
;
getList
();
}
/** 重置按钮操作 */
function
resetQuery
()
{
proxy
.
resetForm
(
"queryRef"
);
handleQuery
();
}
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
single
.
value
=
selection
.
length
!=
1
;
multiple
.
value
=
!
selection
.
length
;
}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"新增零件"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
_id
=
row
.
id
||
ids
.
value
getPartsList
(
_id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"编辑零件"
;
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"configRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateConfig
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addConfig
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'是否确认删除关键零部件下事业部特殊配置编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
delConfig
(
_ids
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}
/** 导出按钮操作 */
function
handleExport
()
{
proxy
.
download
(
'control/config/export'
,
{
...
queryParams
.
value
},
`config_
${
new
Date
().
getTime
()}
.xlsx`
)
}
getList
();
</
script
>
src/views/controlPlan/relationshipManagement/CCAPCriticalParts/index.vue
View file @
c12534a8
...
...
@@ -191,7 +191,7 @@ import {
listbusinessUnit
,
copyAdd
,
addBusinessUnit
}
from
"@/api/
CCAPCriticalParts
/relation.js"
;
}
from
"@/api/
RelationManagement
/relation.js"
;
import
{
getAllBusinessUnitName
}
from
"@/api/system/basicdata/businessunit.js"
;
import
cn
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/cn.json"
;
import
en
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/en.json"
;
...
...
@@ -200,6 +200,7 @@ import { useRouter } from 'vue-router';
import
{
ElMessage
}
from
"element-plus"
;
const
{
proxy
}
=
getCurrentInstance
();
// 对话框
const
tableDialogVisible
=
ref
(
false
)
...
...
@@ -210,7 +211,6 @@ const tableDialogForm = ref({
id
:
null
,
//类型(0-复制新增,1-添加事业部)
type
:
null
,
//认证机构(0-CCAP,1-CQC)
certificationBody
:
"CCAP"
,
//事业部id,
divisionId
:
null
,
...
...
@@ -348,20 +348,19 @@ function handleBusinessSelect(selectedId) {
}
// 维护模板内容
function
handleMaintainContentView
(
row
)
{
proxy
.
$router
.
push
({
path
:
'CCAPMaintainContent'
path
:
'/control/relationshipManagement/CCAPMaintainContent'
,
query
:
{
businessRelationId
:
row
.
id
,
certificationBody
:
row
.
certificationBody
,
divisionName
:
row
.
divisionName
,
updateName
:
row
.
updateName
,
isDefault
:
row
.
isDefault
}
})}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"添加关键零部件和事业部关系"
;
}
//复制新增按钮
function
handleCopyAdd
(
row
){
...
...
@@ -486,15 +485,7 @@ const handleDelete = (row) => {
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}
/*function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除?').then(function() {
return deleteById(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}*/
onMounted
(()
=>
{
getBusinessUnitList
()
...
...
src/views/controlPlan/relationshipManagement/CQCCriticalParts/index.vue
View file @
c12534a8
...
...
@@ -22,7 +22,7 @@
</el-form-item>
</el-form>
<!--表格内容-->
<!--表格内容-->
<el-table
:data=
"relationList"
border
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"75"
>
<template
#
header
>
...
...
@@ -81,7 +81,7 @@
</div>
</
template
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"handleMaintainContentView(scope.row)"
>
<el-button
link
style=
"color: rgb(0,0,255)"
type=
"primary"
@
click=
"handleMaintainContentView(scope.row)"
>
<div>
<div>
{{
cn
.
MaintainContent
}}
</div>
<div>
{{
en
.
MaintainContent
}}
</div>
...
...
@@ -128,14 +128,16 @@
<el-form
:model=
"tableDialogForm"
ref=
"dialogRef2"
>
<el-form-item
:rules=
"[
{ required: true, message: '请选择事业部', trigger: 'blur' }
]"
label=
"事业部:"
prop=
"
business
Id"
>
]"
label=
"事业部:"
prop=
"
division
Id"
>
<el-select
v-model=
"tableDialogForm.
business
Id"
v-model=
"tableDialogForm.
division
Id"
placeholder=
"请选择"
clearable
@
change=
"handleBusinessSelect"
>
<el-option
v-for=
"dict in businessListExclude"
:key=
"dict.id"
:label=
"dict.businessUnitName"
:value=
"dict.id"
/>
...
...
@@ -147,8 +149,8 @@
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"dialog
2
Cancel"
>
取消
</el-button>
<el-button
class=
"btn-A"
type=
"primary"
@
click=
"dialog
2
Sure"
>
<el-button
class=
"btn-B"
@
click=
"dialogCancel"
>
取消
</el-button>
<el-button
class=
"btn-A"
type=
"primary"
@
click=
"dialogSure"
>
确定
</el-button>
</div>
...
...
@@ -156,7 +158,29 @@
</el-dialog>
<!-- 添加或修改关键零部件和事业部关系对话框 -->
<el-dialog
:title=
"title"
v-model=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"relationRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"认证机构"
prop=
"certificationBody"
>
<el-input
v-model=
"form.certificationBody"
placeholder=
"请输入认证机构"
/>
</el-form-item>
<el-form-item
label=
"是否通用"
prop=
"isDefault"
>
<el-input
v-model=
"form.isDefault"
placeholder=
"请输入是否通用"
/>
</el-form-item>
<el-form-item
label=
"逻辑删除"
prop=
"delFlag"
>
<el-input
v-model=
"form.delFlag"
placeholder=
"请输入逻辑删除"
/>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</
template
>
</el-dialog>
</div>
</template>
...
...
@@ -167,14 +191,15 @@ import {
listbusinessUnit
,
copyAdd
,
addBusinessUnit
}
from
"@/api/
CCAPCriticalParts
/relation.js"
;
}
from
"@/api/
RelationManagement
/relation.js"
;
import
{
getAllBusinessUnitName
}
from
"@/api/system/basicdata/businessunit.js"
;
import
cn
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/cn.json"
;
import
en
from
"@/locales/controlPlan/relationshipManagement/CCAPCriticalParts/en.json"
;
import
{
ref
}
from
"vue"
;
import
{
useRouter
}
from
'vue-router'
;
import
{
ElMessage
}
from
"element-plus"
;
//const queryRef = ref(null);
const
{
proxy
}
=
getCurrentInstance
();
// 对话框
const
tableDialogVisible
=
ref
(
false
)
...
...
@@ -182,14 +207,20 @@ const tableDialogVisible = ref(false)
const
tableDialogTitle
=
ref
(
''
)
//下拉框内容
const
tableDialogForm
=
ref
({
//当前行id
id
:
null
,
id
:
null
,
//类型(0-复制新增,1-添加事业部)
type
:
null
,
certificationBody
:
"CQC"
,
//事业部id,
businessId
:
null
divisionId
:
null
,
divisionName
:
null
})
//复制新增,事业部输入内容
const
dialogRef2
=
ref
(
null
)
//所有事业部
const
businessListExclude
=
ref
([])
const
router
=
useRouter
();
const
relationList
=
ref
([]);
const
open
=
ref
(
false
);
...
...
@@ -204,10 +235,12 @@ const businessUnitOptions = ref([])
const
data
=
reactive
({
form
:
{
id
:
null
,
divisionId
:
''
,
businessUnitName
:
''
,
},
queryParams
:
{
id
:
null
,
pageNum
:
1
,
pageSize
:
10
,
divisionId
:
null
,
...
...
@@ -219,7 +252,7 @@ const data = reactive({
},
rules
:
{
divisionId
:
[
{
required
:
fals
e
,
message
:
"事业部id不能为空"
,
trigger
:
"blur"
}
{
required
:
tru
e
,
message
:
"事业部id不能为空"
,
trigger
:
"blur"
}
],
divisionName
:
[
{
required
:
true
,
message
:
"事业部名称不能为空"
,
trigger
:
"blur"
}
...
...
@@ -301,10 +334,25 @@ const getBusinessUnitList = async () => {
}
};
// 监听选择事件 --下拉框
function
handleBusinessSelect
(
selectedId
)
{
const
selectedUnit
=
businessListExclude
.
value
.
find
(
item
=>
item
.
id
===
selectedId
);
if
(
selectedUnit
)
{
tableDialogForm
.
value
.
divisionId
=
selectedId
;
// 事业部ID
tableDialogForm
.
value
.
divisionName
=
selectedUnit
.
businessUnitName
;
}
else
{
tableDialogForm
.
value
.
divisionId
=
null
;
tableDialogForm
.
value
.
divisionName
=
null
;
}
}
// 维护模板内容
function
handleMaintainContentView
(
row
)
{
proxy
.
$router
.
push
({
path
:
'C
CAP
MaintainContent'
path
:
'C
QC
MaintainContent'
})}
/** 新增按钮操作 */
...
...
@@ -314,98 +362,131 @@ function handleAdd() {
title
.
value
=
"添加关键零部件和事业部关系"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
_id
=
row
.
id
||
ids
.
value
getRelation
(
_id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"修改关键零部件和事业部关系"
;
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"relationRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateRelation
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addRelation
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
//复制新增
//复制新增按钮
function
handleCopyAdd
(
row
){
tableDialogTitle
.
value
=
'复制新增'
tableDialogVisible
.
value
=
true
tableDialogForm
.
value
.
id
=
row
.
id
//接口
// getCopyAddBusinessList()
//传参
tableDialogForm
.
value
=
{
type
:
0
,
certificationBody
:
"CQC"
,
divisionId
:
null
,
// 需要用户选择
divisionName
:
null
}
// 调用接口时添加 type 和 certificationBody 参数
listbusinessUnit
({
type
:
tableDialogForm
.
value
.
type
,
// 从表单获取
certificationBody
:
tableDialogForm
.
value
.
certificationBody
// 从表单获取
}).
then
(
res
=>
{
businessListExclude
.
value
=
res
.
data
||
[];
}).
catch
(()
=>
{
businessListExclude
.
value
=
[];
});
}
//添加事业部
//添加事业部
按钮
function
handleAddDivision
(
row
){
tableDialogTitle
.
value
=
'添加事业部'
tableDialogVisible
.
value
=
true
tableDialogForm
.
value
.
id
=
row
.
id
//接口
//getBusinessList();
//传参
tableDialogForm
.
value
=
{
id
:
row
.
id
,
type
:
1
,
certificationBody
:
"CQC"
,
divisionId
:
null
,
// 需要用户选择
divisionName
:
null
}
// 调用接口时添加 type 和 certificationBody 参数
listbusinessUnit
({
type
:
tableDialogForm
.
value
.
type
,
// 从表单获取
certificationBody
:
tableDialogForm
.
value
.
certificationBody
// 从表单获取
}).
then
(
res
=>
{
businessListExclude
.
value
=
res
.
data
||
[];
console
.
log
(
"businessListExclude:"
,
businessListExclude
.
value
);
// 调试
}).
catch
(()
=>
{
businessListExclude
.
value
=
[];
});
}
//添加事业部等对话框的取消
function
dialog
2
Cancel
(){
function
dialogCancel
(){
tableDialogForm
.
value
=
{}
tableDialogVisible
.
value
=
false
tableDialogForm
.
value
.
id
=
null
//
getList()
getList
()
}
//添加事业部
等
对话框确定按钮
function
dialog
2
Sure
(){
//添加事业部
和复制新增
对话框确定按钮
function
dialogSure
(){
dialogRef2
.
value
.
validate
((
v
)
=>
{
if
(
v
){
console
.
log
(
tableDialogForm
.
value
)
/*接口出来再改*/
/*if(tableDialogTitle.value === "添加事业部"){
addBusinessUnit(tableDialogForm.value).then(res=>{
if(res.code === 200){
ElMessage.success("添加成功")
dialog2Cancel()
if
(
tableDialogTitle
.
value
===
'添加事业部'
){
console
.
log
(
"添加事业部"
)
const
params
=
{
id
:
tableDialogForm
.
value
.
id
,
divisionId
:
[
tableDialogForm
.
value
.
divisionId
],
divisionName
:
[
tableDialogForm
.
value
.
divisionName
],
certificationBody
:
tableDialogForm
.
value
.
certificationBody
};
console
.
log
(
'传递给 添加事业部 的参数:'
,
params
);
addBusinessUnit
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
"添加事业部成功"
);
dialogCancel
();
// 关闭对话框
getList
();
// 刷新列表数据
}
else
{
// 处理非 200 状态码的情况
ElMessage
.
error
(
`添加事业部失败,错误码:
${
res
.
code
}
`
);
console
.
error
(
"响应数据:"
,
res
);
}
})
}).
catch
(
error
=>
{
// 处理网络请求错误
ElMessage
.
error
(
"复制失败,请检查网络或联系管理员"
);
console
.
error
(
"网络请求错误:"
,
error
);
});
}
else
{
//复制新增
coypAddCcapManager(tableDialogForm.value).then(res=>{
if(res.code === 200){
ElMessage.success("复制成功")
dialog2Cancel()
}
})
}*/
const
params
=
{
divisionId
:
[
tableDialogForm
.
value
.
divisionId
],
divisionName
:
[
tableDialogForm
.
value
.
divisionName
],
certificationBody
:
tableDialogForm
.
value
.
certificationBody
};
console
.
log
(
'传递给 copyAdd 的参数:'
,
params
);
copyAdd
(
params
)
.
then
(
res
=>
{
console
.
log
(
"传参数据:"
,
params
);
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
"复制新增成功"
);
dialogCancel
();
// 关闭对话框
getList
();
// 刷新列表数据
}
else
{
// 处理非 200 状态码的情况
ElMessage
.
error
(
`复制新增失败,错误码:
${
res
.
code
}
`
);
console
.
error
(
"响应数据:"
,
res
);
}
})
.
catch
(
error
=>
{
// 处理网络请求错误
ElMessage
.
error
(
"复制失败,请检查网络或联系管理员"
);
console
.
error
(
"网络请求错误:"
,
error
);
});
}
}
})
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'是否确认删除关键零部件和事业部关系编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
del
Relation
(
_ids
);
const
handleDelete
=
(
row
)
=>
{
proxy
.
$modal
.
confirm
(
'是否确认删除事业部为"'
+
Object
.
values
(
row
.
divisionName
).
join
(
'、'
)
+
'"的数据项?'
).
then
(
function
()
{
console
.
log
(
"删除的行数据:"
,
row
.
id
)
return
del
eteById
(
row
.
id
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}
onMounted
(()
=>
{
getBusinessUnitList
()
})
...
...
src/views/system/user/index.vue
View file @
c12534a8
...
...
@@ -644,7 +644,7 @@ function openFactoryDialog(row) {
// 监听选中的工厂变化,更新表单数据
watch
(
selectedFactories
,
(
newVal
)
=>
{
form
.
value
.
factoryName
=
JSON
.
stringify
(
newVal
);
// 存储为 JSON 字符串
form
.
value
.
factoryName
s
=
JSON
.
stringify
(
newVal
);
// 存储为 JSON 字符串
},
{
deep
:
true
});
...
...
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