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
bc369fa4
Commit
bc369fa4
authored
May 07, 2025
by
Mr.Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对应关系国内国际
parent
e40256f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
113 deletions
+91
-113
index.vue
...n/relationshipManagement/domesticRegulationPart/index.vue
+66
-100
index.vue
...ationshipManagement/internationalRegulationPart/index.vue
+25
-13
No files found.
src/views/controlPlan/relationshipManagement/domesticRegulationPart/index.vue
View file @
bc369fa4
...
@@ -319,7 +319,7 @@
...
@@ -319,7 +319,7 @@
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"partList"
:data=
"part
Details
List"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
...
@@ -334,7 +334,11 @@
...
@@ -334,7 +334,11 @@
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"partName"
>
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"criticalPartNameCn"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
partName
}}
</div>
<div>
{{
cn
.
partName
}}
</div>
...
@@ -342,7 +346,7 @@
...
@@ -342,7 +346,7 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"来源"
align=
"center"
prop=
""
>
<el-table-column
label=
"来源"
align=
"center"
prop=
"
certificationBody
"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
source
}}
</div>
<div>
{{
cn
.
source
}}
</div>
...
@@ -357,6 +361,19 @@
...
@@ -357,6 +361,19 @@
<div>
{{
en
.
operation
}}
</div>
<div>
{{
en
.
operation
}}
</div>
</div>
</div>
</
template
>
</
template
>
<
template
#
default=
"scope"
>
<!-- 手动来源:显示可点击按钮 -->
<el-button
v-if=
"scope.row.certificationBody === '手动'"
link
style=
"color: #df5454"
@
click=
"handleDelete(scope.row)"
>
移除
</el-button>
<!-- 同步来源:显示不可点击的占位符 -->
<span
v-else
>
--
</span>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-drawer>
</el-drawer>
...
@@ -365,6 +382,7 @@
...
@@ -365,6 +382,7 @@
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"addRelationList"
:data=
"addRelationList"
:row-key=
"getRowKey"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
...
@@ -440,6 +458,13 @@ const multiple = ref(true)
...
@@ -440,6 +458,13 @@ const multiple = ref(true)
const
total
=
ref
(
0
)
const
total
=
ref
(
0
)
const
title
=
ref
(
''
)
const
title
=
ref
(
''
)
const
unrelatedCount
=
ref
(
0
)
const
unrelatedCount
=
ref
(
0
)
const
addPartsList
=
ref
([])
// 存储选中行的数据
const
selectedRows
=
ref
([])
// 定义行唯一标识(根据实际字段调整)
// 在 setup() 或 script setup 中定义响应式变量
const
currentStandardNo
=
ref
(
''
)
const
getRowKey
=
(
row
)
=>
row
.
id
// 假设每行有唯一id字段
const
queryForm
=
reactive
({
const
queryForm
=
reactive
({
standardNo
:
''
,
standardNo
:
''
,
criticalPartNameCn
:
''
,
criticalPartNameCn
:
''
,
...
@@ -507,12 +532,11 @@ function openDialogForNotRelation() {
...
@@ -507,12 +532,11 @@ function openDialogForNotRelation() {
title
.
value
=
'待关联法规的CQC关键零部件'
title
.
value
=
'待关联法规的CQC关键零部件'
getSelectNoRelateLawPart
()
getSelectNoRelateLawPart
()
}
}
/**查看没有关联的零件*/
/**查看没有关联
法规
的零件*/
function
getSelectNoRelatePart
()
{
function
getSelectNoRelate
Law
Part
()
{
loading
.
value
=
true
loading
.
value
=
true
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
console
.
log
(
'456'
,
response
)
noRelateCQCList
.
value
=
response
addRelationList
.
value
=
response
// 确保使用正确的响应数据结构
// 确保使用正确的响应数据结构
total
.
value
=
response
.
length
total
.
value
=
response
.
length
loading
.
value
=
false
loading
.
value
=
false
...
@@ -521,11 +545,12 @@ function getSelectNoRelatePart() {
...
@@ -521,11 +545,12 @@ function getSelectNoRelatePart() {
updateUnrelatedCount
(
total
.
value
)
updateUnrelatedCount
(
total
.
value
)
})
})
}
}
/**查看没有关联法规的零件*/
function
getSelectNoRelateLawPart
()
{
/**查看没有关联的零件*/
function
getSelectNoRelatePart
()
{
loading
.
value
=
true
loading
.
value
=
true
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
noRelateCQC
List
.
value
=
response
addRelation
List
.
value
=
response
// 确保使用正确的响应数据结构
// 确保使用正确的响应数据结构
total
.
value
=
response
.
length
total
.
value
=
response
.
length
loading
.
value
=
false
loading
.
value
=
false
...
@@ -545,83 +570,13 @@ function cancel() {
...
@@ -545,83 +570,13 @@ function cancel() {
reset
()
reset
()
}
}
function
colseDialogOpen3
()
{
function
colseDialogOpen3
()
{
open3
.
value
=
false
open3
.
value
=
reset
()
}
// 表单重置
function
reset
()
{
form
.
value
=
{
id
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
remark
:
null
,
delFlag
:
null
,
partId
:
null
,
standardNumber
:
null
,
}
proxy
.
resetForm
(
'partRef'
)
}
/** 搜索按钮操作 */
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
getList
()
/* getSelectNoRelatePart()
handleRelationLaw()
getSelectNoRelateLawPart()*/
}
function
handleQuery1
()
{
//queryParams.value.pageNum = 1
getSelectNoRelateLawPart
()
}
/** 重置按钮操作 */
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
showPartDialog
(
row
)
{
open2
.
value
=
true
// 打开对话框
this
.
title
=
`查看对应零件(
${
row
.
standardNumber
}
,共
${
row
.
partCount
}
个零件)`
// 设置对话框标题
handleQuerys
()
}
const
handleQuerys
=
async
()
=>
{
try
{
loading
.
value
=
true
// 构造请求参数(过滤空字符串)
const
requestParams
=
{
...
queryForm
,
// 如果认证类型为空则发送 undefined(根据后端需求选择是否添加)
certificationBody
:
queryForm
.
certificationBody
||
undefined
,
}
// 使用你的封装请求方法
const
{
data
}
=
await
partDetails
(
requestParams
)
partList
.
value
=
data
}
catch
(
error
)
{
console
.
error
(
`查询失败:
${
error
.
message
||
error
}
`
)
}
finally
{
loading
.
value
=
false
}
}
}
/*查看零件详情*/
/*查看零件详情*/
function
getPartDetail
(
row
)
{
function
getPartDetail
(
row
)
{
// 2. 发起请求
// 2. 发起请求
loading
.
value
=
true
loading
.
value
=
true
console
.
log
(
'row'
,
row
)
partDetails
({
standardNo
:
currentStandardNo
.
value
})
partDetails
(
queryForm
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
total
.
value
=
partDetailsList
.
value
.
length
total
.
value
=
partDetailsList
.
value
.
length
...
@@ -646,7 +601,7 @@ function handleRelationLaw() {
...
@@ -646,7 +601,7 @@ function handleRelationLaw() {
loading
.
value
=
true
loading
.
value
=
true
selectCanRelateLaw
(
queryParams
)
selectCanRelateLaw
(
queryParams
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
console
.
log
(
'8767837837'
,
response
)
//
console.log('8767837837', response)
lawList
.
value
=
response
.
rows
lawList
.
value
=
response
.
rows
total
.
value
=
lawList
.
value
.
length
total
.
value
=
lawList
.
value
.
length
})
})
...
@@ -680,12 +635,38 @@ function handleUpdate(row) {
...
@@ -680,12 +635,38 @@ function handleUpdate(row) {
title
.
value
=
'修改国际法规与关键件中间'
title
.
value
=
'修改国际法规与关键件中间'
})
})
}
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
proxy
.
$modal
.
confirm
(
'是否确认删除编号为"'
+
_ids
+
'"的数据项?'
)
.
then
(
function
()
{
return
delPart
(
_ids
)
})
.
then
(()
=>
{
getList
()
proxy
.
$modal
.
msgSuccess
(
'删除成功'
)
})
.
catch
(()
=>
{})
}
function
addRelations
()
{
function
addRelations
()
{
addBatchRelation
(
queryParams1
).
then
((
response
)
=>
{
if
(
selectedRows
.
value
.
length
===
0
)
{
proxy
.
$modal
.
msgWarning
(
'请至少选择一条数据'
)
return
}
// 提取需要的字段组成请求参数
const
requestData
=
selectedRows
.
value
.
map
((
row
)
=>
({
partName
:
row
.
criticalPartNameCn
,
standardNo
:
currentStandardNo
.
value
,
}))
addBatchRelation
(
requestData
).
then
((
response
)
=>
{
proxy
.
$modal
.
msgSuccess
(
'新增成功'
)
proxy
.
$modal
.
msgSuccess
(
'新增成功'
)
open3
.
value
=
false
open3
.
value
=
false
getList
()
getPartDetail
()
selectedRows
.
value
=
[]
// 清空选中状态
})
})
}
}
...
@@ -710,21 +691,6 @@ function submitForm() {
...
@@ -710,21 +691,6 @@ function submitForm() {
})
})
}
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
proxy
.
$modal
.
confirm
(
'是否确认删除国际法规与关键件中间编号为"'
+
_ids
+
'"的数据项?'
)
.
then
(
function
()
{
return
delPart
(
_ids
)
})
.
then
(()
=>
{
getList
()
proxy
.
$modal
.
msgSuccess
(
'删除成功'
)
})
.
catch
(()
=>
{})
}
/** 导出按钮操作 */
/** 导出按钮操作 */
function
handleExport
()
{
function
handleExport
()
{
proxy
.
download
(
proxy
.
download
(
...
...
src/views/controlPlan/relationshipManagement/internationalRegulationPart/index.vue
View file @
bc369fa4
...
@@ -187,6 +187,7 @@
...
@@ -187,6 +187,7 @@
</el-row>
</el-row>
</el-form>
</el-form>
<el-table
<el-table
:key=
"drawerPartKey"
v-loading=
"loading"
v-loading=
"loading"
:data=
"drawerPartList"
:data=
"drawerPartList"
border
border
...
@@ -334,7 +335,7 @@
...
@@ -334,7 +335,7 @@
</el-dialog>
</el-dialog>
<!-- 查看对应零件 -->
<!-- 查看对应零件 -->
<el-drawer
v-model=
"open2"
:title=
"title"
append-to-body
>
<el-drawer
v-model=
"open2"
:title=
"title"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"70px"
>
<el-form
ref=
"partRef"
:model=
"form"
label-width=
"70px"
>
<el-row>
<el-row>
<el-form-item
label=
"零件名称"
prop=
"partName"
>
<el-form-item
label=
"零件名称"
prop=
"partName"
>
<el-input
v-model=
"form.partName"
placeholder=
"请输入"
/>
<el-input
v-model=
"form.partName"
placeholder=
"请输入"
/>
...
@@ -346,15 +347,12 @@
...
@@ -346,15 +347,12 @@
<el-button
class=
"btn-B"
@
click=
"resetQuery"
<el-button
class=
"btn-B"
@
click=
"resetQuery"
>
{{ cn.reset }}/{{ en.reset }}
</el-button
>
{{ cn.reset }}/{{ en.reset }}
</el-button
>
>
<el-button
class=
"btn-C"
@
click=
"handleAdd"
>
{{ cn.addParts }}/{{ en.addParts }}
</el-button
>
</el-form-item>
</el-form-item>
</el-row>
</el-row>
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"partList"
:data=
"part
Details
List"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
...
@@ -369,7 +367,11 @@
...
@@ -369,7 +367,11 @@
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"partName"
>
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"criticalPartNameCn"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
partName
}}
</div>
<div>
{{
cn
.
partName
}}
</div>
...
@@ -390,6 +392,13 @@
...
@@ -390,6 +392,13 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<pagination
v-show=
"total > 0"
v-model:page=
"queryParams.pageNum"
v-model:limit=
"queryParams.pageSize"
:total=
"total"
@
pagination=
"listAll"
/>
</el-drawer>
</el-drawer>
</div>
</div>
</template>
</template>
...
@@ -429,6 +438,8 @@ const single = ref(true)
...
@@ -429,6 +438,8 @@ const single = ref(true)
const
multiple
=
ref
(
true
)
const
multiple
=
ref
(
true
)
const
total
=
ref
(
0
)
const
total
=
ref
(
0
)
const
title
=
ref
(
''
)
const
title
=
ref
(
''
)
const
partDetailsList
=
ref
([])
const
currentRow
=
ref
(
null
)
// 存储当前行的数据
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{},
form
:
{},
...
@@ -501,15 +512,16 @@ function reset() {
...
@@ -501,15 +512,16 @@ function reset() {
/*查看零件详情抽屉*/
/*查看零件详情抽屉*/
function
showPartDialog
(
row
)
{
function
showPartDialog
(
row
)
{
//currentRow.value = row // 保存当前行
open2
.
value
=
true
// 打开对话框
open2
.
value
=
true
// 打开对话框
this
.
title
=
`查看对应零件(
${
row
.
standardNumber
}
,共
${
row
.
partCount
}
个零件)`
// 设置对话框标题
this
.
title
=
`查看对应零件(
${
row
.
standardNumber
}
,共
${
row
.
partCount
}
个零件)`
// 设置对话框标题
getPartDetail
()
getPartDetail
(
row
)
}
}
function
getPartDetail
(
row
)
{
function
getPartDetail
(
row
)
{
// 2. 发起请求
// 2. 发起请求
loading
.
value
=
true
loading
.
value
=
true
console
.
log
(
'row'
,
row
)
console
.
log
(
'row'
,
row
)
partDetails
({})
partDetails
({
standardNo
:
row
.
standardNumber
})
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
total
.
value
=
partDetailsList
.
value
.
length
total
.
value
=
partDetailsList
.
value
.
length
...
@@ -556,8 +568,9 @@ function openDialogOpen1(row) {
...
@@ -556,8 +568,9 @@ function openDialogOpen1(row) {
// 维护类型描述抽屉
// 维护类型描述抽屉
function
handleMaintain
(
row
)
{
function
handleMaintain
(
row
)
{
reset
()
reset
()
const
_id
=
row
.
id
||
ids
.
value
const
{
id
,
standardName
}
=
row
list
(
_id
).
then
((
response
)
=>
{
const
_id
=
id
||
ids
.
value
list
(
_id
,
standardName
).
then
((
response
)
=>
{
drawerPartList
.
value
=
response
drawerPartList
.
value
=
response
title
.
value
=
'维护类型描述'
title
.
value
=
'维护类型描述'
open
.
value
=
true
open
.
value
=
true
...
@@ -622,8 +635,7 @@ const handleMoveUp = async (row) => {
...
@@ -622,8 +635,7 @@ const handleMoveUp = async (row) => {
try
{
try
{
await
moveUp
(
row
.
id
)
await
moveUp
(
row
.
id
)
proxy
.
$modal
.
msgSuccess
(
'上移成功'
)
proxy
.
$modal
.
msgSuccess
(
'上移成功'
)
// 刷新数据
await
listAll
()
await
list
()
}
catch
(
error
)
{
}
catch
(
error
)
{
proxy
.
$modal
.
msgError
(
proxy
.
$modal
.
msgError
(
`上移失败:
${
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
`上移失败:
${
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
...
@@ -636,7 +648,7 @@ const handleMoveDown = async (row) => {
...
@@ -636,7 +648,7 @@ const handleMoveDown = async (row) => {
await moveDown(row.id)
await moveDown(row.id)
proxy.$modal.msgSuccess('下移成功')
proxy.$modal.msgSuccess('下移成功')
// 刷新数据
// 刷新数据
await list()
await list
All
()
} catch (error) {
} catch (error) {
proxy.$modal.msgError(
proxy.$modal.msgError(
`
下移失败
:
$
{
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
`
下移失败
:
$
{
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
...
...
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