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
c8415ccc
Commit
c8415ccc
authored
May 07, 2025
by
Mr.Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
国内国际关键零部件
parent
97e91406
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
667 additions
and
263 deletions
+667
-263
baseLawPartCertificateMiddle.js
src/api/RelationManagement/baseLawPartCertificateMiddle.js
+42
-0
baseLawPartRelation.js
src/api/RelationManagement/baseLawPartRelation.js
+78
-0
en.json
...elationshipManagement/internationalRegulationPart/en.json
+1
-1
index.vue
...n/relationshipManagement/domesticRegulationPart/index.vue
+297
-136
index.vue
...ationshipManagement/internationalRegulationPart/index.vue
+249
-126
No files found.
src/api/RelationManagement/baseLawPartCertificateMiddle.js
0 → 100644
View file @
c8415ccc
import
request
from
'@/utils/request'
export
function
list
(
query
)
{
return
request
({
url
:
'/control/lawPartMiddle/list'
,
method
:
'get'
,
data
:
query
,
})
}
export
function
moveUp
(
id
)
{
return
request
({
url
:
`/control/lawPartMiddle/up/
${
id
}
`
,
method
:
'put'
,
})
}
export
function
moveDown
(
id
)
{
return
request
({
url
:
`/control/lawPartMiddle/down/
${
id
}
`
,
method
:
'put'
,
})
}
export
function
addMiddle
(
data
)
{
return
request
({
url
:
'/control/lawPartMiddle'
,
method
:
'post'
,
data
:
data
,
})
}
export
function
updateMiddle
(
data
)
{
return
request
({
url
:
'/control/lawPartMiddle'
,
method
:
'put'
,
data
:
data
,
})
}
// 删除国际法规与关键件对应数据维护类型描述
export
function
delMiddle
(
id
)
{
return
request
({
url
:
'/control/lawPartMiddle/'
+
id
,
method
:
'delete'
,
})
}
src/api/RelationManagement/baseLawPartRelation.js
0 → 100644
View file @
c8415ccc
import
request
from
'@/utils/request'
/**国内分页查询*/
export
function
listRelation
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/chinaList'
,
method
:
'post'
,
data
:
query
,
})
}
/**国际分页查询*/
export
function
listInternationalRelation
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/internatList'
,
method
:
'post'
,
data
:
query
,
})
}
/**查询零件详情*/
export
function
partDetails
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/partDetails'
,
method
:
'post'
,
data
:
query
,
})
}
// 新增法规与关键件对应数据管理
export
function
addRelation
(
data
)
{
return
request
({
url
:
'/control/lawPartRelation/add'
,
method
:
'post'
,
data
:
data
,
})
}
// 修改法规与关键件对应数据管理
export
function
updateRelation
(
data
)
{
return
request
({
url
:
'/control/relation'
,
method
:
'put'
,
data
:
data
,
})
}
/** 批量添加对应关系*/
export
function
addBatchRelation
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/add'
,
method
:
'post'
,
data
:
query
,
})
}
/** 移除对应关系 */
export
function
delRelation
(
id
)
{
return
request
({
url
:
'/control/lawPartRelation/del/'
+
id
,
method
:
'delete'
,
})
}
/**查询没有关联的零部件 */
export
function
selectNoRelatePart
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/selectNo'
,
method
:
'post'
,
data
:
query
,
})
}
/** 查询可以关联的法规*/
export
function
selectCanRelateLaw
(
query
)
{
return
request
({
url
:
'/control/lawPartRelation/law'
,
method
:
'post'
,
data
:
[
query
],
})
}
src/locales/controlPlan/relationshipManagement/internationalRegulationPart/en.json
View file @
c8415ccc
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"order"
:
"order"
,
"order"
:
"order"
,
"createTime"
:
"Create Time"
,
"createTime"
:
"Create Time"
,
"updateTime"
:
"Update Time"
,
"updateTime"
:
"Update Time"
,
"operation"
:
"
o
peration"
,
"operation"
:
"
O
peration"
,
"add"
:
"add"
,
"add"
:
"add"
,
"handleUpdate"
:
"Edit"
,
"handleUpdate"
:
"Edit"
,
"handleDelete"
:
"Delete"
,
"handleDelete"
:
"Delete"
,
...
...
src/views/controlPlan/relationshipManagement/domesticRegulationPart/index.vue
View file @
c8415ccc
...
@@ -22,16 +22,13 @@
...
@@ -22,16 +22,13 @@
prop="standardNumber"
prop="standardNumber"
>
>
<el-input
<el-input
v-model=
"queryParams.standardN
umber
"
v-model=
"queryParams.standardN
ame
"
:placeholder=
"`$
{cn.pleaseEnter}/${en.pleaseEnter}`"
:placeholder=
"`$
{cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
clearable
@keyup.enter="handleQuery"
@keyup.enter="handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
:label=
"`$
{cn.partName}/${en.partName}`" prop="partName">
:label=
"`$
{cn.partName}/${en.partName}`"
prop="standardNumber"
>
<el-input
<el-input
v-model=
"queryParams.partName"
v-model=
"queryParams.partName"
:placeholder=
"`$
{cn.pleaseChoose}/${en.pleaseChoose}`"
:placeholder=
"`$
{cn.pleaseChoose}/${en.pleaseChoose}`"
...
@@ -48,7 +45,16 @@
...
@@ -48,7 +45,16 @@
>
>
</el-form-item>
</el-form-item>
<el-form-item
@
click=
"openDialogForNotRelation"
>
<el-form-item
@
click=
"openDialogForNotRelation"
>
共5个未关联法规的CQC关键零部件
共
<span
:style=
"
{
textDecoration: unrelatedCount > 0 ? 'underline' : 'none',
cursor: unrelatedCount > 0 ? 'pointer' : 'default',
}"
>
{{
unrelatedCount
}}
</span>
个未关联法规的CQC关键零部件
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -98,7 +104,7 @@
...
@@ -98,7 +104,7 @@
</el-table-column>
</el-table-column>
<!-- 对应零件列保持不变 -->
<!-- 对应零件列保持不变 -->
<el-table-column
prop=
"
correspondingParts
"
align=
"center"
>
<el-table-column
prop=
"
partCount
"
align=
"center"
>
<
template
#
header
>
<
template
#
header
>
<div
<div
style=
"display: flex; flex-direction: column; align-items: center"
style=
"display: flex; flex-direction: column; align-items: center"
...
@@ -107,6 +113,18 @@
...
@@ -107,6 +113,18 @@
<div>
{{
en
.
correspondingParts
}}
</div>
<div>
{{
en
.
correspondingParts
}}
</div>
</div>
</div>
</
template
>
</
template
>
<
template
#
default=
"scope"
>
<span
:style=
"
{
color: scope.row.partCount > 0 ? '#0154fB' : '#DF5454',
textDecoration: scope.row.partCount > 0 ? 'underline' : 'none',
cursor: scope.row.partCount > 0 ? 'pointer' : 'default',
}"
@click="scope.row.partCount > 0 ? showPartDialog(scope.row) : null"
>
共
{{
scope
.
row
.
partCount
}}
个
</span>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -118,70 +136,77 @@
...
@@ -118,70 +136,77 @@
@
pagination=
"getList"
@
pagination=
"getList"
/>
/>
</div>
</div>
<!--待关联法规的CQC关键零部件-->
<!-- 待关联法规的CQC关键零部件对话框 -->
<el-drawer
v-model=
"open1"
:title=
"title"
append-to-body
>
<el-dialog
v-model=
"open1"
:title=
"title"
width=
"1000px"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
label-width=
"80px"
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-row>
<el-form-item
label=
"零件名称"
prop=
"partName"
>
<el-form-item
label=
"零件名称"
prop=
"criticalPartNameCn"
>
<el-input
v-model=
"form.partName"
placeholder=
"请输入"
/>
<el-input
v-model=
"queryParams.criticalPartNameCn"
placeholder=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"来源"
prop=
"partId"
>
<el-form-item
label=
"来源"
prop=
"certificationBody"
>
<el-input
v-model=
"form.partId"
placeholder=
"请选择"
/>
<el-select
v-model=
"queryParams.certificationBody"
:placeholder=
"`${cn.pleaseChoose}/${en.pleaseChoose}`"
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-form-item>
<el-form-item>
<el-button
style=
"width: 110px"
class=
"btn-A"
@
click=
"handleQuery"
<el-button
class=
"btn-A"
@
click=
"handleQuery1"
>
>
{{ cn.search }}/{{ en.search }}
</el-button
{{ cn.search }}/{{ en.search }}
>
</el-button
>
<el-button
style=
"width: 110px"
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-form-item>
</el-form-item>
</el-row>
</el-row>
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"
part
List"
:data=
"
noRelateCQC
List"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
label=
"序号"
align=
"center"
width=
"150"
fixed=
"left"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<
template
#
header
>
<el-table-column
label=
"序号"
align=
"center"
width=
"80"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
serialNumber
}}
</div>
<div>
{{
en
.
serialNumber
}}
</div>
</div>
</
template
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"standardName"
>
<el-table-column
<
template
#
header
>
prop=
"criticalPartNameCn"
<div
style=
"display: flex; flex-direction: column"
>
label=
"零件名称"
<div>
{{
cn
.
standardName
}}
</div>
align=
"center"
<div>
{{
en
.
standardName
}}
</div>
/>
</div>
<el-table-column
prop=
"certificationBody"
label=
"来源"
align=
"center"
/>
</
template
>
<el-table-column
label=
"操作"
align=
"center"
>
</el-table-column>
<
template
#
default=
"scope"
>
<el-table-column
label=
"来源"
align=
"center"
prop=
"source"
>
<!-- 手动来源:显示可点击按钮 -->
<
template
#
header
>
<el-button
<div
style=
"display: flex; flex-direction: column"
>
v-if=
"scope.row.certificationBody === '手动'"
<div>
{{
cn
.
source
}}
</div>
link
<div>
{{
en
.
source
}}
</div>
style=
"color: #0154fb"
</div>
@
click=
"handleRelation(scope.row)"
</
template
>
>
</el-table-column>
关联法规
<el-table-column
label=
"操作"
align=
"center"
prop=
"operation"
>
</el-button>
<
template
#
header
>
<!-- 同步来源:显示不可点击的占位符 -->
<div
style=
"display: flex; flex-direction: column"
>
<span
v-else
>
--
</span>
<div>
{{
cn
.
operation
}}
</div>
<div>
{{
en
.
operation
}}
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-d
ialog
>
</el-d
rawer
>
<!--
关联法规对话框
-->
<!--
添加法规
-->
<el-dialog
v-model=
"open"
:title=
"title"
width=
"1000px"
append-to-body
>
<el-dialog
v-model=
"open"
:title=
"title"
width=
"1000px"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-row>
...
@@ -206,7 +231,7 @@
...
@@ -206,7 +231,7 @@
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"
part
List"
:data=
"
law
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"
/>
...
@@ -238,26 +263,46 @@
...
@@ -238,26 +263,46 @@
</
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=
"selectCanRelateLaw"
/>
<
template
#
footer
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"
submitForm
"
<el-button
class=
"btn-B"
@
click=
"
cancelRelationLaw
"
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
>
<el-button
class=
"btn-A"
@
click=
"
cancel
"
<el-button
class=
"btn-A"
@
click=
"
addRelations
"
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
>
</div>
</div>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
<!-- 对应零件对话框 -->
<el-dialog
v-model=
"open2"
:title=
"title"
width=
"1000px"
append-to-body
>
<!-- 查看对应零件 -->
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-drawer
v-model=
"open2"
:title=
"title"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
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=
"请输入"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"来源"
prop=
"partId"
>
<el-form-item
label=
"来源"
prop=
"certificationBody"
>
<el-input
v-model=
"form.partId"
placeholder=
"请选择"
/>
<el-select
v-model=
"queryParams.certificationBody"
:placeholder=
"`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in parts_source"
:key=
"dict.value"
:label=
"dict.value"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
class=
"btn-A"
@
click=
"handleQuery"
<el-button
class=
"btn-A"
@
click=
"handleQuery"
...
@@ -314,22 +359,12 @@
...
@@ -314,22 +359,12 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<
template
#
footer
>
</el-drawer>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"submitForm"
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
<el-button
class=
"btn-A"
@
click=
"cancel"
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
</div>
</
template
>
</el-dialog>
<!-- 添加零件对话框 -->
<!-- 添加零件对话框 -->
<el-dialog
v-model=
"open3"
:title=
"title"
width=
"800px"
append-to-body
>
<el-dialog
v-model=
"open3"
:title=
"title"
width=
"800px"
append-to-body
>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"
part
List"
:data=
"
addRelation
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"
/>
...
@@ -344,7 +379,11 @@
...
@@ -344,7 +379,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>
...
@@ -355,10 +394,10 @@
...
@@ -355,10 +394,10 @@
</el-table>
</el-table>
<
template
#
footer
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"
submitForm
"
<el-button
class=
"btn-B"
@
click=
"
colseDialogOpen3
"
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
>
<el-button
class=
"btn-A"
@
click=
"
cancel
"
<el-button
class=
"btn-A"
@
click=
"
addRelations
"
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
>
</div>
</div>
...
@@ -367,24 +406,32 @@
...
@@ -367,24 +406,32 @@
</template>
</template>
<
script
setup
name=
"Part"
>
<
script
setup
name=
"Part"
>
/*import {
import
{
listPart,
listRelation
,
getPart,
selectNoRelatePart
,
delPart,
partDetails
,
addPart,
addBatchRelation
,
updatePart,
selectCanRelateLaw
,
} from '@/api/control/part'*/
addRelation
,
updateRelation
,
delRelation
,
}
from
'@/api/RelationManagement/baseLawPartRelation'
import
cn
from
'@/locales/controlPlan/relationshipManagement/domesticRegulationPart/cn.json'
import
cn
from
'@/locales/controlPlan/relationshipManagement/domesticRegulationPart/cn.json'
import
en
from
'@/locales/controlPlan/relationshipManagement/domesticRegulationPart/en.json'
import
en
from
'@/locales/controlPlan/relationshipManagement/domesticRegulationPart/en.json'
const
{
proxy
}
=
getCurrentInstance
()
const
{
proxy
}
=
getCurrentInstance
()
const
{
parts_source
}
=
proxy
.
useDict
(
'parts_source'
)
//const partList = ref([])
const
partList
=
ref
([])
const
addRelationList
=
ref
([])
const
noRelateCQCList
=
ref
([])
const
partDetailsList
=
ref
([])
const
lawList
=
ref
([])
const
open
=
ref
(
false
)
const
open
=
ref
(
false
)
const
open1
=
ref
(
false
)
const
open1
=
ref
(
false
)
const
open2
=
ref
(
false
)
const
open2
=
ref
(
false
)
const
open3
=
ref
(
tru
e
)
const
open3
=
ref
(
fals
e
)
const
loading
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
showSearch
=
ref
(
true
)
const
showSearch
=
ref
(
true
)
const
ids
=
ref
([])
const
ids
=
ref
([])
...
@@ -392,15 +439,42 @@ const single = ref(true)
...
@@ -392,15 +439,42 @@ 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
unrelatedCount
=
ref
(
0
)
const
queryForm
=
reactive
({
standardNo
:
''
,
criticalPartNameCn
:
''
,
certificationBody
:
''
,
})
const
queryParams1
=
[
{
pageNum
:
1
,
pageSize
:
10
,
id
:
null
,
partId
:
null
,
partName
:
null
,
standardNo
:
null
,
standardName
:
null
,
standardNumber
:
null
,
criticalPartNameCn
:
null
,
criticalPartNameEn
:
null
,
certificationBody
:
null
,
},
]
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{},
form
:
{},
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
id
:
null
,
partId
:
null
,
partId
:
null
,
partName
:
null
,
partName
:
null
,
standardNo
:
null
,
standardName
:
null
,
standardNumber
:
null
,
standardNumber
:
null
,
criticalPartNameCn
:
null
,
criticalPartNameEn
:
null
,
certificationBody
:
null
,
},
},
rules
:
{
rules
:
{
createTime
:
[
createTime
:
[
...
@@ -411,66 +485,69 @@ const data = reactive({
...
@@ -411,66 +485,69 @@ const data = reactive({
{
required
:
true
,
message
:
'更新时间不能为空'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'更新时间不能为空'
,
trigger
:
'blur'
},
],
],
/* partId: [{ required: true, message: '零件表ID不能为空', trigger: 'blur' }],*/
/* partId: [{ required: true, message: '零件表ID不能为空', trigger: 'blur' }],*/
standardNumber
:
[
{
required
:
true
,
message
:
'标准编号不能为空'
,
trigger
:
'blur'
},
],
},
},
})
})
const
partList
=
ref
([
// 这是添加的假数据
{
standardNumber
:
'GB 7258-2017'
,
standardName
:
'机动车运行安全技术条件'
,
source
:
'手动'
,
correspondingParts
:
'共18个'
,
operation
:
'关联法规'
,
},
{
standardNumber
:
'GB/T 35012-2014'
,
standardName
:
'汽车禁用物质'
,
source
:
'同步'
,
correspondingParts
:
'共0个'
,
operation
:
'关联法规'
,
},
{
standardNumber
:
'xxxxxxxxxx'
,
standardName
:
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
,
correspondingParts
:
'共5个'
,
source
:
'同步'
,
operation
:
'--'
,
},
])
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
)
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
)
/** 查询国
际法规与关键件中间列表
*/
/** 查询国
内法规与关键件
*/
function
getList
()
{
function
getList
()
{
loading
.
value
=
false
loading
.
value
=
true
/* listPart(queryParams.value).then((response) => {
listRelation
(
queryParams
.
value
).
then
((
response
)
=>
{
//console.log('789', response)
partList
.
value
=
response
.
rows
partList
.
value
=
response
.
rows
total
.
value
=
response
.
total
total
.
value
=
response
.
total
loading
.
value
=
false
loading
.
value
=
false
})*/
})
listPart
(
queryParams
.
value
).
then
((
response
)
=>
{
}
// 在真实数据前添加一条假数据
partList
.
value
=
[
/**查看没有关联法规的cqc零件抽屉*/
{
function
openDialogForNotRelation
()
{
standardNumber
:
'TEST-001'
,
open1
.
value
=
true
partId
:
'PART-001'
,
title
.
value
=
'待关联法规的CQC关键零部件'
partName
:
'测试零件'
,
getSelectNoRelateLawPart
()
},
}
...
response
.
rows
,
/**查看没有关联的零件*/
]
function
getSelectNoRelatePart
()
{
total
.
value
=
response
.
total
+
1
// 总数加1
loading
.
value
=
true
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
console
.
log
(
'456'
,
response
)
addRelationList
.
value
=
response
// 确保使用正确的响应数据结构
total
.
value
=
response
.
length
loading
.
value
=
false
loading
.
value
=
false
// 将总数传递到模板中
updateUnrelatedCount
(
total
.
value
)
})
})
}
}
/**查看没有关联法规的零件*/
function
getSelectNoRelateLawPart
()
{
loading
.
value
=
true
selectNoRelatePart
(
queryParams
).
then
((
response
)
=>
{
noRelateCQCList
.
value
=
response
// 确保使用正确的响应数据结构
total
.
value
=
response
.
length
loading
.
value
=
false
// 将总数传递到模板中
updateUnrelatedCount
(
total
.
value
)
})
}
function
updateUnrelatedCount
(
count
)
{
unrelatedCount
.
value
=
count
}
// 取消按钮
// 取消按钮
function
cancel
()
{
function
cancel
()
{
open
.
value
=
false
open
.
value
=
false
reset
()
reset
()
}
}
function
colseDialogOpen3
()
{
open3
.
value
=
false
reset
()
}
// 表单重置
// 表单重置
function
reset
()
{
function
reset
()
{
...
@@ -492,14 +569,19 @@ function reset() {
...
@@ -492,14 +569,19 @@ function reset() {
function
handleQuery
()
{
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
queryParams
.
value
.
pageNum
=
1
getList
()
getList
()
/* getSelectNoRelatePart()
handleRelationLaw()
getSelectNoRelateLawPart()*/
}
function
handleQuery1
()
{
//queryParams.value.pageNum = 1
getSelectNoRelateLawPart
()
}
}
/** 重置按钮操作 */
/** 重置按钮操作 */
function
resetQuery
()
{
function
resetQuery
()
{
proxy
.
resetForm
(
'queryRef'
)
proxy
.
resetForm
(
'queryRef'
)
handleQuery
()
handleQuery
()
}
}
// 多选框选中数据
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
((
item
)
=>
item
.
id
)
ids
.
value
=
selection
.
map
((
item
)
=>
item
.
id
)
...
@@ -507,11 +589,85 @@ function handleSelectionChange(selection) {
...
@@ -507,11 +589,85 @@ function handleSelectionChange(selection) {
multiple
.
value
=
!
selection
.
length
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
)
{
// 2. 发起请求
loading
.
value
=
true
console
.
log
(
'row'
,
row
)
partDetails
(
queryForm
)
.
then
((
response
)
=>
{
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
total
.
value
=
partDetailsList
.
value
.
length
})
.
catch
((
error
)
=>
{
console
.
error
(
'请求失败:'
,
error
)
})
.
finally
(()
=>
{
loading
.
value
=
false
})
}
/*选择要关联的法规弹框*/
function
handleRelation
()
{
open
.
value
=
true
title
.
value
=
'选择要关联的法规'
handleRelationLaw
()
}
/*查询所有关联法规*/
function
handleRelationLaw
()
{
loading
.
value
=
true
selectCanRelateLaw
(
queryParams
)
.
then
((
response
)
=>
{
console
.
log
(
'8767837837'
,
response
)
lawList
.
value
=
response
.
rows
total
.
value
=
lawList
.
value
.
length
})
.
catch
((
error
)
=>
{
console
.
error
(
'获取法规列表失败:'
,
error
)
lawList
.
value
=
[]
total
.
value
=
0
})
.
finally
(()
=>
{
loading
.
value
=
false
})
}
function
cancelRelationLaw
()
{
open
.
value
=
false
}
/** 新增按钮操作 */
/** 新增按钮操作 */
function
handleAdd
()
{
function
handleAdd
()
{
reset
()
reset
()
open
.
value
=
true
open3
.
value
=
true
title
.
value
=
'添加国际法规与关键件中间'
title
.
value
=
'选择手动新增的零件'
getSelectNoRelatePart
()
}
}
/** 修改按钮操作 */
/** 修改按钮操作 */
...
@@ -525,6 +681,14 @@ function handleUpdate(row) {
...
@@ -525,6 +681,14 @@ function handleUpdate(row) {
})
})
}
}
function
addRelations
()
{
addBatchRelation
(
queryParams1
).
then
((
response
)
=>
{
proxy
.
$modal
.
msgSuccess
(
'新增成功'
)
open3
.
value
=
false
getList
()
})
}
/** 提交按钮 */
/** 提交按钮 */
function
submitForm
()
{
function
submitForm
()
{
proxy
.
$refs
[
'partRef'
].
validate
((
valid
)
=>
{
proxy
.
$refs
[
'partRef'
].
validate
((
valid
)
=>
{
...
@@ -571,10 +735,7 @@ function handleExport() {
...
@@ -571,10 +735,7 @@ function handleExport() {
`part_
${
new
Date
().
getTime
()}
.xlsx`
,
`part_
${
new
Date
().
getTime
()}
.xlsx`
,
)
)
}
}
function
openDialogForNotRelation
()
{
open1
.
value
=
true
title
.
value
=
'查看对应零件'
}
/*getList()*/
getList
()
getSelectNoRelatePart
()
</
script
>
</
script
>
src/views/controlPlan/relationshipManagement/internationalRegulationPart/index.vue
View file @
c8415ccc
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
prop="standardName"
prop="standardName"
>
>
<el-input
<el-input
v-model=
"queryParams.standardN
umberId
"
v-model=
"queryParams.standardN
ame
"
:placeholder=
"`$
{cn.pleaseEnter}/${en.pleaseEnter}`"
:placeholder=
"`$
{cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
clearable
@keyup.enter="handleQuery"
@keyup.enter="handleQuery"
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
prop="standardNumberId"
prop="standardNumberId"
>
>
<el-input
<el-input
v-model=
"queryParams.
standardNumberId
"
v-model=
"queryParams.
applicableMarket
"
:placeholder=
"`$
{cn.applicableMarket}/${en.applicableMarket}`"
:placeholder=
"`$
{cn.applicableMarket}/${en.applicableMarket}`"
clearable
clearable
@keyup.enter="handleQuery"
@keyup.enter="handleQuery"
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"标准编号"
align=
"center"
prop=
"standardNumber
Id
"
>
<el-table-column
label=
"标准编号"
align=
"center"
prop=
"standardNumber"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
standardNumber
}}
</div>
<div>
{{
cn
.
standardNumber
}}
</div>
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"标准名称"
align=
"center"
prop=
"
partId
"
>
<el-table-column
label=
"标准名称"
align=
"center"
prop=
"
standardName
"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
standardName
}}
</div>
<div>
{{
cn
.
standardName
}}
</div>
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"适用市场"
align=
"center"
prop=
"
partId
"
>
<el-table-column
label=
"适用市场"
align=
"center"
prop=
"
applicableMarket
"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
applicableMarket
}}
</div>
<div>
{{
cn
.
applicableMarket
}}
</div>
...
@@ -101,15 +101,31 @@
...
@@ -101,15 +101,31 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"对应零件"
align=
"center"
prop=
"part
Id
"
>
<el-table-column
label=
"对应零件"
align=
"center"
prop=
"part
Count
"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
correspondingParts
}}
</div>
<div>
{{
cn
.
correspondingParts
}}
</div>
<div>
{{
en
.
correspondingParts
}}
</div>
<div>
{{
en
.
correspondingParts
}}
</div>
</div>
</div>
</
template
>
</
template
>
<
template
#
default=
"scope"
>
<span
:style=
"
{
color: scope.row.partCount > 0 ? '#0154fB' : '#DF5454',
textDecoration: scope.row.partCount > 0 ? 'underline' : 'none',
cursor: scope.row.partCount > 0 ? 'pointer' : 'default',
}"
@click="scope.row.partCount > 0 ? showPartDialog(scope.row) : null"
>
共
{{
scope
.
row
.
partCount
}}
个
</span>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"保证计划书责任部门"
align=
"center"
prop=
"partId"
>
<el-table-column
label=
"保证计划书责任部门"
align=
"center"
prop=
"department"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
responsibleDepartmentForTheGuaranteePlan
}}
</div>
<div>
{{
cn
.
responsibleDepartmentForTheGuaranteePlan
}}
</div>
...
@@ -119,11 +135,25 @@
...
@@ -119,11 +135,25 @@
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"操作"
label=
"操作"
fixed=
"right"
align=
"center"
align=
"center"
class-name=
"small-padding fixed-width
"
fixed=
"right
"
width=
"33
0"
min-width=
"15
0"
>
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
operation
}}
</div>
<div>
{{
en
.
operation
}}
</div>
</div>
</
template
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
style=
"color: #0154fb"
@
click=
"handleMaintain(scope.row)"
>
维护类型描述
</el-button
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -137,14 +167,10 @@
...
@@ -137,14 +167,10 @@
<!-- 维护类型描述抽屉 -->
<!-- 维护类型描述抽屉 -->
<el-drawer
v-model=
"open"
:title=
"title"
width=
"800px"
append-to-body
>
<el-drawer
v-model=
"open"
:title=
"title"
width=
"800px"
append-to-body
>
<el-form
ref=
"
part
Ref"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"
middle
Ref"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-row>
<el-form-item
label=
"项目"
prop=
"remark"
>
<el-form-item
label=
"项目"
prop=
"project"
>
<el-input
<el-input
placeholder=
"请输入"
style=
"width: 150px"
/>
v-model=
"form.remark"
placeholder=
"请输入"
style=
"width: 150px"
/>
</el-form-item>
</el-form-item>
<el-button
<el-button
style=
"margin-left: 10px; width: 110px"
style=
"margin-left: 10px; width: 110px"
...
@@ -162,7 +188,7 @@
...
@@ -162,7 +188,7 @@
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"
p
artList"
:data=
"
drawerP
artList"
border
border
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
...
@@ -177,11 +203,7 @@
...
@@ -177,11 +203,7 @@
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"类型描述"
align=
"center"
prop=
"typeDescription"
>
label=
"类型描述"
align=
"center"
prop=
"standardNumberId"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
typeDescription
}}
</div>
<div>
{{
cn
.
typeDescription
}}
</div>
...
@@ -189,7 +211,11 @@
...
@@ -189,7 +211,11 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"二级类型描述"
align=
"center"
prop=
"partId"
>
<el-table-column
label=
"二级类型描述"
align=
"center"
prop=
"secondaryTypeDescription"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
secondaryTypeDescription
}}
</div>
<div>
{{
cn
.
secondaryTypeDescription
}}
</div>
...
@@ -197,7 +223,7 @@
...
@@ -197,7 +223,7 @@
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"责任部门"
align=
"center"
prop=
"
partId
"
>
<el-table-column
label=
"责任部门"
align=
"center"
prop=
"
department
"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
<div>
{{
cn
.
responsibleDepartment
}}
</div>
<div>
{{
cn
.
responsibleDepartment
}}
</div>
...
@@ -208,7 +234,6 @@
...
@@ -208,7 +234,6 @@
<el-table-column
<el-table-column
label=
"操作"
label=
"操作"
fixed=
"right"
fixed=
"right"
align=
"center"
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
width=
"200"
width=
"200"
>
>
...
@@ -223,7 +248,7 @@
...
@@ -223,7 +248,7 @@
link
link
type=
"primary"
type=
"primary"
style=
"color: #0154fb"
style=
"color: #0154fb"
@
click=
"handle
Update
(scope.row)"
@
click=
"handle
Edit
(scope.row)"
>
编辑
</el-button
>
编辑
</el-button
>
>
<el-button
<el-button
...
@@ -234,51 +259,105 @@
...
@@ -234,51 +259,105 @@
>
删除
</el-button
>
删除
</el-button
>
>
<el-button
<el-button
v-if=
"scope.$index !== 0"
link
link
type=
"primary"
type=
"primary"
style=
"color: #0154fb"
style=
"color: #0154fb"
@
click=
"handle
Update
(scope.row)"
@
click=
"handle
MoveUp
(scope.row)"
>
上移
</el-button
>
上移
</el-button
>
>
<el-button
<el-button
v-if=
"scope.$index !== drawerPartList.length - 1"
link
link
type=
"primary"
type=
"primary"
style=
"color: #0154fb"
style=
"color: #0154fb"
@
click=
"handle
Update
(scope.row)"
@
click=
"handle
MoveDown
(scope.row)"
>
下移
</el-button
>
下移
</el-button
>
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-drawer>
</el-drawer>
<!-- 维护类型描述抽屉 -->
<!-- 新增类型描述 -->
<el-drawer
v-model=
"open1"
:title=
"title"
width=
"800px"
append-to-body
>
<el-dialog
v-model=
"open1"
:title=
"title"
width=
"500px"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"middleRef"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-row>
<el-form-item
label=
"类型描述"
prop=
"typeDescription"
>
<el-form-item
label=
"零件名称"
prop=
"partName"
>
<el-select
:key=
"form.id"
v-model=
"form.typeDescription"
:placeholder=
"`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in type_description"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"二级类型描述"
prop=
"secondaryTypeDescription"
>
<el-input
<el-input
v-model=
"form.remark
"
v-model=
"form.secondaryTypeDescription
"
placeholder=
"请输入"
placeholder=
"请输入"
style=
"width: 15
0px"
style=
"width: 20
0px"
/>
/>
</el-form-item>
</el-form-item>
<el-button
<el-form-item
label=
"责任部门"
prop=
"department"
>
style=
"margin-left: 10px; width: 110px"
<el-select
class=
"btn-A"
:key=
"form.id"
@
click=
"handleQuery"
v-model=
"form.department"
:placeholder=
"`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable
style=
"width: 200px"
>
<el-option
v-for=
"dict in responsible_department"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
class=
"btn-B"
@
click=
"colseDialogOpen1"
>
{{
cn
.
cancel
}}
/
{{
en
.
cancel
}}
</el-button
>
<el-button
class=
"btn-A"
@
click=
"submitForm"
>
{{
cn
.
submitForm
}}
/
{{
en
.
submitForm
}}
</el-button
>
</div>
</
template
>
</el-dialog>
<!-- 查看对应零件 -->
<el-drawer
v-model=
"open2"
:title=
"title"
append-to-body
>
<el-form
ref=
"partRef"
:model=
"form"
:rules=
"rules"
label-width=
"70px"
>
<el-row>
<el-form-item
label=
"零件名称"
prop=
"partName"
>
<el-input
v-model=
"form.partName"
placeholder=
"请输入"
/>
</el-form-item>
<el-form-item>
<el-button
class=
"btn-A"
@
click=
"handleQuery"
>
{{ cn.search }}/{{ en.search }}
</el-button
>
{{ cn.search }}/{{ en.search }}
</el-button
>
>
<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-row>
</el-row>
</el-form>
</el-form>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"partList"
:data=
"partList"
border
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"序号"
align=
"center"
width=
"150"
fixed=
"left"
>
<el-table-column
label=
"序号"
align=
"center"
width=
"150"
fixed=
"left"
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
...
@@ -290,11 +369,7 @@
...
@@ -290,11 +369,7 @@
{{
scope
.
$index
+
1
}}
{{
scope
.
$index
+
1
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"零件名称"
align=
"center"
prop=
"partName"
>
label=
"零件名称"
align=
"center"
prop=
"standardNumberId"
>
<
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>
...
@@ -305,7 +380,7 @@
...
@@ -305,7 +380,7 @@
<el-table-column
<el-table-column
label=
"零件名称英文"
label=
"零件名称英文"
align=
"center"
align=
"center"
prop=
"
standardNumberId
"
prop=
"
criticalPartNameEn
"
>
>
<
template
#
header
>
<
template
#
header
>
<div
style=
"display: flex; flex-direction: column"
>
<div
style=
"display: flex; flex-direction: column"
>
...
@@ -315,28 +390,38 @@
...
@@ -315,28 +390,38 @@
</
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=
"getList"
/>
</el-drawer>
</el-drawer>
</div>
</div>
</template>
</template>
<
script
setup
name=
"Part"
>
<
script
setup
name=
"Part"
>
/*import { listPart, getPart, delPart, addPart, updatePart } from "@/api/control/part";*/
import
{
listInternationalRelation
,
partDetails
,
}
from
'@/api/RelationManagement/baseLawPartRelation'
import
{
list
,
moveUp
,
moveDown
,
addMiddle
,
updateMiddle
,
delMiddle
,
}
from
'@/api/RelationManagement/baseLawPartCertificateMiddle'
const
{
proxy
}
=
getCurrentInstance
()
const
{
type_description
,
responsible_department
}
=
proxy
.
useDict
(
'type_description'
,
'responsible_department'
,
)
import
cn
from
'@/locales/controlPlan/relationshipManagement/internationalRegulationPart/cn.json'
import
cn
from
'@/locales/controlPlan/relationshipManagement/internationalRegulationPart/cn.json'
import
en
from
'@/locales/controlPlan/relationshipManagement/internationalRegulationPart/en.json'
import
en
from
'@/locales/controlPlan/relationshipManagement/internationalRegulationPart/en.json'
const
{
proxy
}
=
getCurrentInstance
()
const
partList
=
ref
([])
const
sortList
=
ref
([])
//const partList = ref([])
// 在setup中声明独立的数据变量
const
drawerPartList
=
ref
([])
const
open
=
ref
(
false
)
const
open
=
ref
(
false
)
const
open1
=
ref
(
true
)
const
open1
=
ref
(
false
)
const
open2
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
showSearch
=
ref
(
true
)
const
showSearch
=
ref
(
true
)
const
ids
=
ref
([])
const
ids
=
ref
([])
...
@@ -352,6 +437,10 @@ const data = reactive({
...
@@ -352,6 +437,10 @@ const data = reactive({
pageSize
:
10
,
pageSize
:
10
,
partId
:
null
,
partId
:
null
,
standardNumberId
:
null
,
standardNumberId
:
null
,
typeDescription
:
null
,
secondaryTypeDescription
:
null
,
department
:
null
,
sort
:
null
,
},
},
rules
:
{
rules
:
{
createTime
:
[
createTime
:
[
...
@@ -367,53 +456,23 @@ const data = reactive({
...
@@ -367,53 +456,23 @@ const data = reactive({
],
],
},
},
})
})
const
partList
=
ref
([
// 这是添加的假数据
{
standardNumber
:
'GB 7258-2017'
,
standardName
:
'机动车运行安全技术条件'
,
applicableMarket
:
'中国'
,
plan
:
'GB 7258-2017'
,
source
:
'手动'
,
correspondingParts
:
'共18个'
,
operation
:
'--'
,
},
{
standardNumber
:
'GB/T 35012-2014'
,
standardName
:
'汽车禁用物质'
,
source
:
'同步'
,
correspondingParts
:
'共0个'
,
operation
:
'--'
,
},
{
standardNumber
:
'xxxxxxxxxx'
,
standardName
:
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
,
correspondingParts
:
'共5个'
,
source
:
'同步'
,
operation
:
'--'
,
},
])
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
)
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
)
/** 查询国际法规与关键件中间列表 */
function
getList
()
{
function
getList
()
{
loading
.
value
=
true
loading
.
value
=
true
/* listPart
(queryParams.value).then((response) => {
listInternationalRelation
(
queryParams
.
value
).
then
((
response
)
=>
{
partList
.
value
=
response
.
rows
partList
.
value
=
response
.
rows
total
.
value
=
response
.
total
total
.
value
=
response
.
total
loading
.
value
=
false
loading
.
value
=
false
})*/
})
listPart
(
queryParams
.
value
).
then
((
response
)
=>
{
}
// 在真实数据前添加一条假数据
partList
.
value
=
[
function
listAll
()
{
{
loading
.
value
=
true
standardNumber
:
'TEST-001'
,
list
(
queryParams
.
value
).
then
((
response
)
=>
{
partId
:
'PART-001'
,
drawerPartList
.
value
=
response
partName
:
'测试零件'
,
console
.
log
(
'------------------'
,
response
)
},
total
.
value
=
response
.
total
...
response
.
rows
,
]
total
.
value
=
response
.
total
+
1
// 总数加1
loading
.
value
=
false
loading
.
value
=
false
})
})
}
}
...
@@ -437,7 +496,30 @@ function reset() {
...
@@ -437,7 +496,30 @@ function reset() {
partId
:
null
,
partId
:
null
,
standardNumberId
:
null
,
standardNumberId
:
null
,
}
}
proxy
.
resetForm
(
'partRef'
)
proxy
.
resetForm
(
'middleRef'
)
}
/*查看零件详情抽屉*/
function
showPartDialog
(
row
)
{
open2
.
value
=
true
// 打开对话框
this
.
title
=
`查看对应零件(
${
row
.
standardNumber
}
,共
${
row
.
partCount
}
个零件)`
// 设置对话框标题
getPartDetail
()
}
function
getPartDetail
(
row
)
{
// 2. 发起请求
loading
.
value
=
true
console
.
log
(
'row'
,
row
)
partDetails
({})
.
then
((
response
)
=>
{
partDetailsList
.
value
=
response
.
data
||
response
// 兼容不同API结构
total
.
value
=
partDetailsList
.
value
.
length
})
.
catch
((
error
)
=>
{
console
.
error
(
'请求失败:'
,
error
)
})
.
finally
(()
=>
{
loading
.
value
=
false
})
}
}
/** 搜索按钮操作 */
/** 搜索按钮操作 */
...
@@ -448,7 +530,7 @@ function handleQuery() {
...
@@ -448,7 +530,7 @@ function handleQuery() {
/** 重置按钮操作 */
/** 重置按钮操作 */
function
resetQuery
()
{
function
resetQuery
()
{
proxy
.
resetForm
(
'
query
Ref'
)
proxy
.
resetForm
(
'
middle
Ref'
)
handleQuery
()
handleQuery
()
}
}
...
@@ -462,36 +544,47 @@ function handleSelectionChange(selection) {
...
@@ -462,36 +544,47 @@ function handleSelectionChange(selection) {
/** 新增按钮操作 */
/** 新增按钮操作 */
function
handleAdd
()
{
function
handleAdd
()
{
reset
()
reset
()
open
.
value
=
true
open
1
.
value
=
true
title
.
value
=
'
添加国际法规与关键件中间
'
title
.
value
=
'
新增类型描述
'
}
}
/** 修改按钮操作 */
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
function
openDialogOpen1
(
row
)
{
open1
.
value
=
true
handleUpdate
(
row
)
}
// 维护类型描述抽屉
function
handleMaintain
(
row
)
{
reset
()
reset
()
const
_id
=
row
.
id
||
ids
.
value
const
_id
=
row
.
id
||
ids
.
value
getPart
(
_id
).
then
((
response
)
=>
{
list
(
_id
).
then
((
response
)
=>
{
form
.
value
=
response
.
data
drawerPartList
.
value
=
response
title
.
value
=
'维护类型描述'
open
.
value
=
true
open
.
value
=
true
title
.
value
=
'修改国际法规与关键件中间'
})
})
}
}
// 编辑对话框
function
handleEdit
(
row
)
{
reset
()
form
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
// 直接使用当前行数据
title
.
value
=
'编辑/Edit'
open1
.
value
=
true
}
/** 提交按钮 */
/** 提交按钮 */
function
submitForm
()
{
function
submitForm
()
{
proxy
.
$refs
[
'
part
Ref'
].
validate
((
valid
)
=>
{
proxy
.
$refs
[
'
middle
Ref'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
if
(
form
.
value
.
id
!=
null
)
{
update
Part
(
form
.
value
).
then
((
response
)
=>
{
update
Middle
(
form
.
value
).
then
((
response
)
=>
{
proxy
.
$modal
.
msgSuccess
(
'修改成功'
)
proxy
.
$modal
.
msgSuccess
(
'修改成功'
)
open
.
value
=
false
open
1
.
value
=
false
getList
()
listAll
()
})
})
}
else
{
}
else
{
add
Part
(
form
.
value
).
then
((
response
)
=>
{
add
Middle
(
form
.
value
).
then
((
response
)
=>
{
proxy
.
$modal
.
msgSuccess
(
'新增成功'
)
proxy
.
$modal
.
msgSuccess
(
'新增成功'
)
open
.
value
=
false
open
1
.
value
=
false
getList
()
listAll
()
})
})
}
}
}
}
...
@@ -504,10 +597,10 @@ function handleDelete(row) {
...
@@ -504,10 +597,10 @@ function handleDelete(row) {
proxy
.
$modal
proxy
.
$modal
.
confirm
(
'是否确认删除国际法规与关键件中间编号为"'
+
_ids
+
'"的数据项?'
)
.
confirm
(
'是否确认删除国际法规与关键件中间编号为"'
+
_ids
+
'"的数据项?'
)
.
then
(
function
()
{
.
then
(
function
()
{
return
del
Part
(
_ids
)
return
del
Middle
(
_ids
)
})
})
.
then
(()
=>
{
.
then
(()
=>
{
getList
()
listAll
()
proxy
.
$modal
.
msgSuccess
(
'删除成功'
)
proxy
.
$modal
.
msgSuccess
(
'删除成功'
)
})
})
.
catch
(()
=>
{})
.
catch
(()
=>
{})
...
@@ -523,6 +616,36 @@ function handleExport() {
...
@@ -523,6 +616,36 @@ function handleExport() {
`part_
${
new
Date
().
getTime
()}
.xlsx`
,
`part_
${
new
Date
().
getTime
()}
.xlsx`
,
)
)
}
}
/** 修改按钮操作 */
//getList();
const
handleMoveUp
=
async
(
row
)
=>
{
console
.
log
()
try
{
await
moveUp
(
row
.
id
)
proxy
.
$modal
.
msgSuccess
(
'上移成功'
)
// 刷新数据
await
list
()
}
catch
(
error
)
{
proxy
.
$modal
.
msgError
(
`上移失败:
${
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
)
}
}
// 下移操作
const handleMoveDown = async (row) => {
try {
await moveDown(row.id)
proxy.$modal.msgSuccess('下移成功')
// 刷新数据
await list()
} catch (error) {
proxy.$modal.msgError(
`
下移失败
:
$
{
error
.
response
?.
data
?.
message
||
error
.
message
}
`,
)
}
}
function colseDialogOpen1() {
open1.value = false
}
getList()
listAll()
</
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