Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yindong-tongbai-automation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lichunliang
yindong-tongbai-automation
Commits
b5069032
Commit
b5069032
authored
Aug 01, 2025
by
sxl
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复bug
parent
4178a60e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
70 deletions
+149
-70
mcp.json
.roo/mcp.json
+3
-0
index.vue
src/views/inspection/patrol/patrolProject/index.vue
+101
-58
index.vue
src/views/inspection/repair/repairLog/index.vue
+9
-5
index.vue
src/views/inspection/repair/repairProject/index.vue
+36
-7
No files found.
.roo/mcp.json
0 → 100644
View file @
b5069032
{
"mcpServers"
:
{}
}
\ No newline at end of file
src/views/inspection/patrol/patrolProject/index.vue
View file @
b5069032
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"巡检日期"
prop=
"pollingData"
>
<el-form-item
label=
"设备类型"
prop=
"deviceType"
>
<el-date-picker
clearable
v-model=
"queryParams.pollingData"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择巡检日期"
></el-date-picker>
<el-select
v-model=
"queryParams.deviceType"
placeholder=
"请选择设备类型"
clearable
>
</el-form-item>
<el-option
v-for=
"item in deviceTypeList"
:key=
"item.id"
:label=
"item.typeName"
:value=
"item.id"
/>
<el-form-item
label=
"巡检人"
prop=
"inspectionUserId"
>
</el-select>
<el-input
v-model=
"queryParams.inspectionUserId"
placeholder=
"请输入巡检人"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"设备名称"
prop=
"deviceName"
>
<el-form-item
label=
"设备名称"
prop=
"deviceName"
>
<el-input
v-model=
"queryParams.deviceName"
placeholder=
"请输入设备名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
<el-input
v-model=
"queryParams.deviceName"
placeholder=
"请输入设备名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
...
@@ -14,18 +13,11 @@
...
@@ -14,18 +13,11 @@
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleAdd"
>
新增巡检单
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['inspection:task:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['inspection:task:edit']"
>
修改
</el-button
>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
...
@@ -39,13 +31,12 @@
...
@@ -39,13 +31,12 @@
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"
巡检人
"
align
=
"
center
"
prop
=
"
inspectionUserName
"
/>
<
el
-
table
-
column
label
=
"
巡检人
"
align
=
"
center
"
prop
=
"
inspectionUserName
"
/>
<
el
-
table
-
column
label
=
"
设备名称
"
align
=
"
center
"
prop
=
"
deviceName
"
/>
<
el
-
table
-
column
label
=
"
设备名称
"
align
=
"
center
"
prop
=
"
deviceName
"
/>
<
el
-
table
-
column
label
=
"
设备编号
"
align
=
"
center
"
prop
=
"
deviceNo
"
/>
<
el
-
table
-
column
label
=
"
巡检状态
"
align
=
"
center
"
prop
=
"
taskState
"
>
<
el
-
table
-
column
label
=
"
巡检状态
"
align
=
"
center
"
prop
=
"
taskState
"
>
<
template
slot
-
scope
=
"
scope
"
>
{{
scope
.
row
.
taskState
==
1
?
'
已完成
'
:
'
巡检中
'
}}
<
/template
>
<
template
slot
-
scope
=
"
scope
"
>
{{
scope
.
row
.
taskState
==
1
?
'
已完成
'
:
'
巡检中
'
}}
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"
备注
"
align
=
"
center
"
prop
=
"
remark
"
/>
<
el
-
table
-
column
label
=
"
操作
"
align
=
"
center
"
class
-
name
=
"
small-padding fixed-width
"
>
<
el
-
table
-
column
label
=
"
操作
"
align
=
"
center
"
class
-
name
=
"
small-padding fixed-width
"
>
<
template
slot
-
scope
=
"
scope
"
>
<
template
slot
-
scope
=
"
scope
"
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
@
click
=
"
handleUpdate(scope.row)
"
v
-
hasPermi
=
"
['inspection:task:edit']
"
>
修改
<
/el-button
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-delete
"
@
click
=
"
handleDelete(scope.row)
"
v
-
hasPermi
=
"
['inspection:task:remove']
"
>
删除
<
/el-button
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-delete
"
@
click
=
"
handleDelete(scope.row)
"
v
-
hasPermi
=
"
['inspection:task:remove']
"
>
删除
<
/el-button
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
...
@@ -55,43 +46,38 @@
...
@@ -55,43 +46,38 @@
<!--
添加或修改巡检任务对话框
-->
<!--
添加或修改巡检任务对话框
-->
<
el
-
dialog
:
title
=
"
title
"
:
visible
.
sync
=
"
open
"
width
=
"
500px
"
append
-
to
-
body
>
<
el
-
dialog
:
title
=
"
title
"
:
visible
.
sync
=
"
open
"
width
=
"
500px
"
append
-
to
-
body
>
<
el
-
form
ref
=
"
form
"
:
model
=
"
form
"
:
rules
=
"
rules
"
label
-
width
=
"
80px
"
>
<
el
-
form
ref
=
"
form
"
:
model
=
"
form
"
:
rules
=
"
rules
"
label
-
width
=
"
110px
"
>
<
el
-
form
-
item
label
=
"
巡检日期
"
prop
=
"
pollingData
"
>
<
el
-
form
-
item
label
=
"
设备类型
"
prop
=
"
deviceType
"
>
<
el
-
select
v
-
model
=
"
form.deviceType
"
placeholder
=
"
请选择设备类型
"
clearable
@
change
=
"
getDeviceList
"
>
<
el
-
option
v
-
for
=
"
item in deviceTypeList
"
:
key
=
"
item.id
"
:
label
=
"
item.typeName
"
:
value
=
"
item.id
"
/>
<
/el-select
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
设备名称
"
prop
=
"
deviceId
"
>
<
el
-
select
v
-
model
=
"
form.deviceId
"
placeholder
=
"
请选择设备
"
clearable
>
<
el
-
option
v
-
for
=
"
item in deviceList
"
:
key
=
"
item.id
"
:
label
=
"
item.deviceName
"
:
value
=
"
item.id
"
/>
<
/el-select
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
设备编号
"
prop
=
"
deviceNo
"
>
<
el
-
input
v
-
model
=
"
form.deviceNo
"
placeholder
=
"
自动获取设备编号
"
disabled
><
/el-input
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
巡检截止日期
"
prop
=
"
pollingData
"
>
<
el
-
date
-
picker
<
el
-
date
-
picker
clearable
clearable
v
-
model
=
"
form.pollingData
"
v
-
model
=
"
form.pollingData
"
type
=
"
date
"
type
=
"
date
"
value
-
format
=
"
yyyy-MM-dd
"
value
-
format
=
"
yyyy-MM-dd
"
placeholder
=
"
请选择巡检日期
"
placeholder
=
"
请选择巡检
截止
日期
"
:
picker
-
options
=
"
pickerOptions
"
:
picker
-
options
=
"
pickerOptions
"
><
/el-date-picker
>
><
/el-date-picker
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
巡检人
"
prop
=
"
inspectionUserId
"
>
<
el
-
form
-
item
label
=
"
部门名称
"
prop
=
"
maintainDeptId
"
>
<
el
-
select
<
treeselect
v
-
model
=
"
form.maintainDeptId
"
:
options
=
"
deptOptions
"
:
normalizer
=
"
normalizer
"
placeholder
=
"
请选择部门名称
"
@
select
=
"
deptSelect
"
/>
v
-
model
=
"
form.inspectionUserId
"
filterable
remote
reserve
-
keyword
placeholder
=
"
请输入关键词
"
:
remote
-
method
=
"
remoteMethod
"
:
loading
=
"
loading
"
>
<
el
-
option
v
-
for
=
"
item in useroptions
"
:
key
=
"
item.userId
"
:
label
=
"
item.nickName + '/' + item.nickName
"
:
value
=
"
item.userId
"
><
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
设备类型
"
prop
=
"
deviceType
"
>
<
el
-
form
-
item
label
=
"
巡检人
"
prop
=
"
inspectionUserId
"
>
<
el
-
select
v
-
model
=
"
form.deviceType
"
placeholder
=
"
请选择设备类型
"
clearable
@
change
=
"
getDeviceList
"
>
<
el
-
select
v
-
model
=
"
form.inspectionUserId
"
placeholder
=
"
请选择巡检人
"
>
<
el
-
option
v
-
for
=
"
item in deviceTypeList
"
:
key
=
"
item.id
"
:
label
=
"
item.typeName
"
:
value
=
"
item.id
"
/>
<
el
-
option
v
-
for
=
"
item in userList
"
:
key
=
"
item.userId
"
:
label
=
"
item.nickName
"
:
value
=
"
item.userId
"
>
<
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
form.deviceType
"
label
=
"
设备名称
"
prop
=
"
deviceId
"
>
<
el
-
select
v
-
model
=
"
form.deviceId
"
placeholder
=
"
请选择设备
"
clearable
>
<
el
-
option
v
-
for
=
"
item in deviceList
"
:
key
=
"
item.id
"
:
label
=
"
item.deviceName
"
:
value
=
"
item.id
"
/>
<
/el-select
>
<
/el-select
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
备注
"
prop
=
"
remark
"
>
<
el
-
input
v
-
model
=
"
form.remark
"
type
=
"
textarea
"
placeholder
=
"
请输入内容
"
/>
<
/el-form-item
>
<
/el-form
>
<
/el-form
>
<
div
slot
=
"
footer
"
class
=
"
dialog-footer
"
>
<
div
slot
=
"
footer
"
class
=
"
dialog-footer
"
>
<
el
-
button
type
=
"
primary
"
@
click
=
"
submitForm
"
>
确
定
<
/el-button
>
<
el
-
button
type
=
"
primary
"
@
click
=
"
submitForm
"
>
确
定
<
/el-button
>
...
@@ -105,7 +91,14 @@
...
@@ -105,7 +91,14 @@
import
{
listTask
,
getTask
,
delTask
,
addTask
,
updateTask
,
getInspectionUser
}
from
'
@/api/patrol/patrolProject
'
import
{
listTask
,
getTask
,
delTask
,
addTask
,
updateTask
,
getInspectionUser
}
from
'
@/api/patrol/patrolProject
'
import
{
listDevice
as
deviceTypeList
}
from
'
@/api/device/deviceType
'
import
{
listDevice
as
deviceTypeList
}
from
'
@/api/device/deviceType
'
import
{
listDevice
}
from
'
@/api/device/device
'
import
{
listDevice
}
from
'
@/api/device/device
'
import
{
listDept
}
from
'
@/api/system/dept
'
import
{
listUser
}
from
'
@/api/system/user
'
import
Treeselect
from
'
@riophae/vue-treeselect
'
import
'
@riophae/vue-treeselect/dist/vue-treeselect.css
'
export
default
{
export
default
{
components
:
{
Treeselect
,
}
,
name
:
'
Task
'
,
name
:
'
Task
'
,
data
()
{
data
()
{
return
{
return
{
...
@@ -136,14 +129,24 @@ export default {
...
@@ -136,14 +129,24 @@ export default {
deviceId
:
null
,
deviceId
:
null
,
taskState
:
null
,
taskState
:
null
,
}
,
}
,
queryParamsUser
:
{
pageNum
:
1
,
pageSize
:
100
,
userName
:
undefined
,
phonenumber
:
undefined
,
status
:
undefined
,
deptId
:
undefined
,
}
,
// 表单参数
// 表单参数
form
:
{
}
,
form
:
{
}
,
deptOptions
:
[],
userList
:
[],
// 表单校验
// 表单校验
rules
:
{
rules
:
{
pollingData
:
[
pollingData
:
[
{
{
required
:
true
,
required
:
true
,
message
:
'
巡检日期不能为空
'
,
message
:
'
巡检
截止
日期不能为空
'
,
trigger
:
'
blur
'
,
trigger
:
'
blur
'
,
}
,
}
,
],
],
...
@@ -161,6 +164,13 @@ export default {
...
@@ -161,6 +164,13 @@ export default {
trigger
:
'
blur
'
,
trigger
:
'
blur
'
,
}
,
}
,
],
],
maintainDeptId
:
[
{
required
:
true
,
message
:
'
部门名称不能为空
'
,
trigger
:
'
blur
'
,
}
,
],
deviceId
:
[
deviceId
:
[
{
{
required
:
true
,
required
:
true
,
...
@@ -199,10 +209,57 @@ export default {
...
@@ -199,10 +209,57 @@ export default {
this
.
loading
=
false
this
.
loading
=
false
}
)
}
)
}
,
}
,
/** 转换部门数据结构 */
normalizer
(
node
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
}
return
{
id
:
node
.
deptId
,
label
:
node
.
deptName
,
children
:
node
.
children
,
}
}
,
deptSelect
(
val
)
{
this
.
queryParamsUser
.
deptId
=
val
.
deptId
this
.
form
.
inspectionUserId
=
null
this
.
getUserList
()
}
,
/** 查询用户列表 */
getUserList
()
{
listUser
(
this
.
addDateRange
(
this
.
queryParamsUser
)).
then
((
response
)
=>
{
this
.
userList
=
response
.
rows
}
)
}
,
//根据设备类型查询设备列表
//根据设备类型查询设备列表
getDeviceList
()
{
getDeviceList
(
val
)
{
// 清空部门
this
.
deptOptions
=
[]
const
typeDeptIds
=
this
.
deviceTypeList
.
find
((
item
)
=>
item
.
id
===
val
).
typeDeptIds
// 如果有关联的部门ID,则进行查询
if
(
typeDeptIds
&&
typeDeptIds
.
length
>
0
)
{
// 创建所有 listDept 请求的 Promise 数组
const
deptPromises
=
typeDeptIds
.
map
((
deptId
)
=>
listDept
({
deptId
:
deptId
}
)
.
then
((
response
)
=>
{
// 处理并返回数据
return
this
.
handleTree
(
response
.
data
,
'
deptId
'
)
}
)
.
catch
((
error
)
=>
{
return
[]
// 返回空数组,避免 Promise.all 失败
}
)
)
//等待所有请求完成
Promise
.
all
(
deptPromises
)
.
then
((
deptData
)
=>
{
this
.
deptOptions
=
deptData
.
flat
()
}
)
.
catch
((
error
)
=>
{
console
.
error
(
'
获取部门数据失败:
'
,
error
)
}
)
}
this
.
form
.
deviceId
=
null
this
.
form
.
deviceId
=
null
this
.
form
.
inspectionUserId
=
null
listDevice
({
listDevice
({
deviceType
:
this
.
form
.
deviceType
,
deviceType
:
this
.
form
.
deviceType
,
}
).
then
((
response
)
=>
{
}
).
then
((
response
)
=>
{
...
@@ -270,20 +327,6 @@ export default {
...
@@ -270,20 +327,6 @@ export default {
this
.
open
=
true
this
.
open
=
true
this
.
title
=
'
添加巡检任务
'
this
.
title
=
'
添加巡检任务
'
}
,
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
id
=
row
.
id
||
this
.
ids
this
.
getDeviceList
()
getTask
(
id
).
then
((
response
)
=>
{
this
.
form
=
{
...
response
.
data
,
deviceType
:
Number
(
response
.
data
.
deviceType
),
}
this
.
open
=
true
this
.
title
=
'
修改巡检任务
'
}
)
}
,
/** 提交按钮 */
/** 提交按钮 */
submitForm
()
{
submitForm
()
{
this
.
$refs
[
'
form
'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'
form
'
].
validate
((
valid
)
=>
{
...
...
src/views/inspection/repair/repairLog/index.vue
View file @
b5069032
...
@@ -23,7 +23,11 @@
...
@@ -23,7 +23,11 @@
<el-table-column
label=
"设备名称"
align=
"center"
prop=
"deviceName"
/>
<el-table-column
label=
"设备名称"
align=
"center"
prop=
"deviceName"
/>
<el-table-column
label=
"设备编码"
align=
"center"
prop=
"deviceNo"
/>
<el-table-column
label=
"设备编码"
align=
"center"
prop=
"deviceNo"
/>
<el-table-column
label=
"巡检人"
align=
"center"
prop=
"inspectionUserName"
/>
<el-table-column
label=
"巡检人"
align=
"center"
prop=
"inspectionUserName"
/>
<el-table-column
label=
"设备故障描述"
align=
"center"
prop=
"deviceErroDetail"
/>
<el-table-column
label=
"设备故障描述"
align=
"center"
prop=
"deviceErrorDetail"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceErrorDetail
||
'
-
'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"维修单日期"
align=
"center"
prop=
"repairsDate"
width=
"180"
>
<el-table-column
label=
"维修单日期"
align=
"center"
prop=
"repairsDate"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
repairsDate
,
'
{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<span>
{{
parseTime
(
scope
.
row
.
repairsDate
,
'
{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
...
@@ -58,8 +62,8 @@
...
@@ -58,8 +62,8 @@
<
el
-
form
-
item
label
=
"
巡检人id
"
prop
=
"
inspectionUserId
"
>
<
el
-
form
-
item
label
=
"
巡检人id
"
prop
=
"
inspectionUserId
"
>
<
el
-
input
v
-
model
=
"
form.inspectionUserId
"
placeholder
=
"
请输入巡检人id
"
/>
<
el
-
input
v
-
model
=
"
form.inspectionUserId
"
placeholder
=
"
请输入巡检人id
"
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
设备故障描述
"
prop
=
"
deviceErroDetail
"
>
<
el
-
form
-
item
label
=
"
设备故障描述
"
prop
=
"
deviceErro
r
Detail
"
>
<
el
-
input
v
-
model
=
"
form.deviceErroDetail
"
placeholder
=
"
请输入设备故障描述
"
/>
<
el
-
input
v
-
model
=
"
form.deviceErro
r
Detail
"
placeholder
=
"
请输入设备故障描述
"
/>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"
维修单日期
"
prop
=
"
repairsDate
"
>
<
el
-
form
-
item
label
=
"
维修单日期
"
prop
=
"
repairsDate
"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"
form.repairsDate
"
type
=
"
date
"
value
-
format
=
"
yyyy-MM-dd
"
placeholder
=
"
请选择维修单日期
"
>
<
/el-date-picker
>
<
el
-
date
-
picker
clearable
v
-
model
=
"
form.repairsDate
"
type
=
"
date
"
value
-
format
=
"
yyyy-MM-dd
"
placeholder
=
"
请选择维修单日期
"
>
<
/el-date-picker
>
...
@@ -120,7 +124,7 @@ export default {
...
@@ -120,7 +124,7 @@ export default {
deviceNo
:
null
,
deviceNo
:
null
,
deviceName
:
null
,
deviceName
:
null
,
inspectionUserId
:
null
,
inspectionUserId
:
null
,
deviceErroDetail
:
null
,
deviceErro
r
Detail
:
null
,
repairsDate
:
null
,
repairsDate
:
null
,
maintainUserId
:
null
,
maintainUserId
:
null
,
maintainDetail
:
null
,
maintainDetail
:
null
,
...
@@ -172,7 +176,7 @@ export default {
...
@@ -172,7 +176,7 @@ export default {
deviceNo
:
null
,
deviceNo
:
null
,
deviceName
:
null
,
deviceName
:
null
,
inspectionUserId
:
null
,
inspectionUserId
:
null
,
deviceErroDetail
:
null
,
deviceErro
r
Detail
:
null
,
repairsDate
:
null
,
repairsDate
:
null
,
maintainUserId
:
null
,
maintainUserId
:
null
,
maintainDetail
:
null
,
maintainDetail
:
null
,
...
...
src/views/inspection/repair/repairProject/index.vue
View file @
b5069032
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<el-option
v-for=
"item in deviceTypeList"
:key=
"item.id"
:label=
"item.typeName"
:value=
"item.id"
>
</el-option>
<el-option
v-for=
"item in deviceTypeList"
:key=
"item.id"
:label=
"item.typeName"
:value=
"item.id"
>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
""
prop=
"deviceName"
>
<el-form-item
label=
"
设备名称
"
prop=
"deviceName"
>
<el-input
v-model=
"queryParams.deviceName"
placeholder=
"请输入设备名称"
clearable
@
keyup.enter=
"handleQuery"
/>
<el-input
v-model=
"queryParams.deviceName"
placeholder=
"请输入设备名称"
clearable
@
keyup.enter=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -241,11 +241,38 @@ export default {
...
@@ -241,11 +241,38 @@ export default {
}
,
}
,
// 设备名称
// 设备名称
getDeviceName
(
val
)
{
getDeviceName
(
val
)
{
// 清空部门
this
.
deptOptions
=
[]
const
typeDeptIds
=
this
.
deviceTypeList
.
find
((
item
)
=>
item
.
id
===
val
).
typeDeptIds
// 如果有关联的部门ID,则进行查询
if
(
typeDeptIds
&&
typeDeptIds
.
length
>
0
)
{
// 创建所有 listDept 请求的 Promise 数组
const
deptPromises
=
typeDeptIds
.
map
((
deptId
)
=>
listDept
({
deptId
:
deptId
}
)
.
then
((
response
)
=>
{
// 处理并返回数据
return
this
.
handleTree
(
response
.
data
,
'
deptId
'
)
}
)
.
catch
((
error
)
=>
{
return
[]
// 返回空数组,避免 Promise.all 失败
}
)
)
//等待所有请求完成
Promise
.
all
(
deptPromises
)
.
then
((
deptData
)
=>
{
this
.
deptOptions
=
deptData
.
flat
()
}
)
.
catch
((
error
)
=>
{
console
.
error
(
'
获取部门数据失败:
'
,
error
)
}
)
}
listDeviceName
({
deviceType
:
val
}
).
then
((
response
)
=>
{
listDeviceName
({
deviceType
:
val
}
).
then
((
response
)
=>
{
this
.
deviceNameList
=
response
.
rows
this
.
deviceNameList
=
response
.
rows
}
)
}
)
this
.
form
.
deviceName
=
null
this
.
form
.
deviceName
=
null
this
.
form
.
deviceNo
=
null
this
.
form
.
deviceNo
=
null
this
.
form
.
maintainDeptId
=
null
}
,
}
,
// 取消按钮
// 取消按钮
cancel
()
{
cancel
()
{
...
@@ -298,9 +325,9 @@ export default {
...
@@ -298,9 +325,9 @@ export default {
this
.
reset
()
this
.
reset
()
this
.
open
=
true
this
.
open
=
true
this
.
title
=
'
添加工单派遣
'
this
.
title
=
'
添加工单派遣
'
listDept
().
then
((
response
)
=>
{
//
listDept().then((response) =>
{
this
.
deptOptions
=
this
.
handleTree
(
response
.
data
,
'
deptId
'
)
//
this.deptOptions = this.handleTree(response.data, 'deptId')
}
)
//
}
)
}
,
}
,
/** 派单 */
/** 派单 */
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
...
@@ -317,9 +344,9 @@ export default {
...
@@ -317,9 +344,9 @@ export default {
// 查看
// 查看
handleView
(
row
)
{
handleView
(
row
)
{
const
id
=
row
.
id
||
this
.
ids
const
id
=
row
.
id
||
this
.
ids
listDept
().
then
((
response
)
=>
{
//
listDept().then((response) =>
{
this
.
deptOptions
=
this
.
handleTree
(
response
.
data
,
'
deptId
'
)
//
this.deptOptions = this.handleTree(response.data, 'deptId')
}
)
//
}
)
getWorkOrder
(
id
).
then
((
response
)
=>
{
getWorkOrder
(
id
).
then
((
response
)
=>
{
this
.
form
=
response
.
data
this
.
form
=
response
.
data
this
.
open
=
true
this
.
open
=
true
...
@@ -340,6 +367,7 @@ export default {
...
@@ -340,6 +367,7 @@ export default {
}
,
}
,
deptSelect
(
val
)
{
deptSelect
(
val
)
{
this
.
queryParamsUser
.
deptId
=
val
.
deptId
this
.
queryParamsUser
.
deptId
=
val
.
deptId
this
.
form
.
maintainUserId
=
null
this
.
getUserList
()
this
.
getUserList
()
}
,
}
,
/** 查询用户列表 */
/** 查询用户列表 */
...
@@ -349,6 +377,7 @@ export default {
...
@@ -349,6 +377,7 @@ export default {
}
)
}
)
}
,
}
,
getDeviceNo
(
val
)
{
getDeviceNo
(
val
)
{
this
.
form
.
_deviceName
=
val
this
.
form
.
deviceName
=
val
.
deviceName
this
.
form
.
deviceName
=
val
.
deviceName
this
.
form
.
deviceNo
=
val
.
deviceNo
this
.
form
.
deviceNo
=
val
.
deviceNo
this
.
form
.
deviceId
=
val
.
deviceId
this
.
form
.
deviceId
=
val
.
deviceId
...
...
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