Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
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
wuhao
ems3.3
Commits
673a72b7
Commit
673a72b7
authored
Dec 01, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
故障报修
parent
f4b7ee19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
310 additions
and
235 deletions
+310
-235
columns.js
src/pages/repair/failure/columns.js
+148
-21
index.jsx
src/pages/repair/failure/index.jsx
+162
-214
No files found.
src/pages/repair/failure/columns.js
View file @
673a72b7
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'报修单号'
,
dataIndex
:
'repairNo'
,
key
:
'repairNo'
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
},
{
title
:
'故障描述'
,
dataIndex
:
'faultDescription'
,
key
:
'faultDescription'
},
{
title
:
'报修人'
,
dataIndex
:
'repairUserName'
,
key
:
'repairUserName'
},
{
title
:
'报修时间'
,
dataIndex
:
'repairTime'
,
key
:
'repairTimeList'
,
valueType
:
'dateRange'
},
{
title
:
'工单状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
valueType
:
'radio'
,
options
:
[
{
label
:
'待维修'
,
value
:
'1'
},
{
label
:
'维修中'
,
value
:
'2'
},
],
},
];
}
export
default
getcolumns
;
return
[
{
"tab"
:
"已完成"
,
"key"
:
"1"
,
"columns"
:
[
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"设备编号"
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
,
"valueType"
:
"textarea"
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTimeList"
,
"key"
:
"repairTimeList"
,
"valueType"
:
"dateTimeRange"
},
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"status"
,
"valueType"
:
"radio"
,
"options"
:
[
{
"label"
:
"待维修"
,
"value"
:
"1"
},
{
"label"
:
"维修中"
,
"value"
:
"2"
}
]
}
],
"pathconfig"
:
{
"enableadd"
:
true
,
"enableedit"
:
false
,
"enabledelete"
:
true
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
""
,
"delete"
:
""
,
"detail"
:
""
}
},
{
"tab"
:
"已完成"
,
"key"
:
"2"
,
"columns"
:
[
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"设备编号"
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTime"
,
"key"
:
"repairTime"
},
{
"title"
:
"关单时间"
,
"dataIndex"
:
"repairCloseTime"
,
"key"
:
"repairCloseTime"
},
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"status"
,
"valueType"
:
"radio"
,
"options"
:
[
{
"label"
:
"待维修"
,
"value"
:
"1"
},
{
"label"
:
"维修中"
,
"value"
:
"2"
}
]
}
],
"pathconfig"
:
{
"enableadd"
:
true
,
"enableedit"
:
true
,
"enabledelete"
:
true
,
"enabledetail"
:
true
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
""
,
"delete"
:
""
,
"detail"
:
""
}
}
];
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/repair/failure/index.jsx
View file @
673a72b7
/* 故障报修
* @Author: Li Hanlin
* @Date: 2022-11-25 09:18:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-01 19:49:37
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
(),
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
}),
[
activeTabKey
,
onTabChange
]
=
useState
(
'1'
);
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
urlParams
=
{
detail
:
'/repair/umFailureRepair/queryById'
,
save
:
'/repair/umFailureRepair/save'
,
remove
:
'/repair/umFailureRepair/deleteById'
,
list_unfinished
:
'/repair/umFailureRepair/queryNoFinishList'
,
list_finished
:
'/repair/umFailureRepair/queryFinishList'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
open
:
false
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
}
},
});
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
columns_add
=
[
{
title
:
'选择设备'
,
dataIndex
:
'equipmentId'
,
key
:
'equipmentId'
,
valueType
:
'select'
,
options
:
{
path
:
'/asset/equipment/selection/user/shop'
,
params
:
{}
},
},
{
title
:
'是否停机'
,
dataIndex
:
'isShutdown'
,
key
:
'isShutdown'
,
valueType
:
'radio'
,
options
:
[
{
label
:
'是'
,
value
:
1
,
},
{
label
:
'否'
,
value
:
2
,
},
],
},
{
title
:
'故障类型'
,
dataIndex
:
'faultSettingId'
,
valueType
:
'select'
,
key
:
'faultSettingId'
,
options
:
{
path
:
'/repair/umFaultSetting/selected/queryList'
,
linkParams
:
{
equipmentId
:
''
,
},
},
},
{
title
:
'故障名称'
,
dataIndex
:
'faultDetailId'
,
valueType
:
'select'
,
key
:
'faultDetailId'
,
options
:
{
path
:
'/repair/umFaultSettingDetail/selected/queryList'
,
linkParams
:
{
faultSettingId
:
''
,
},
},
},
{
title
:
'故障描述'
,
valueType
:
'textarea'
,
dataIndex
:
'faultDescription'
,
key
:
'faultDescription'
,
},
{
title
:
'故障图片'
,
dataIndex
:
'pictureId'
,
key
:
'pictureId'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
},
];
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
设备供应商
</
h3
>
}
columns=
{
columns
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
true
}
path=
{
activeTabKey
==
'1'
?
urlParams
.
list_unfinished
:
urlParams
.
list_finished
}
tabList=
{
[
{
tab
:
'未完成'
,
key
:
'1'
,
},
{
tab
:
'已完成'
,
key
:
'2'
,
},
]
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[
activeTabKey
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"故障报修"
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
<
DrawerPro
fields=
{
columns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
{
isShutdown
:
1
,
},
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增保修单成功!'
);
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
open
:
false
,
}));
},
},
}
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
onTabChange
}
/>
<
DrawerPro
fields=
{
drawer
?.
val
==
'add'
?
columns_add
:
columns
}
// detailpath="/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
}
}
{
...
drawer
}
/>
</
div
>
);
}
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
</
div
>
);
}
export
default
Failure
;
export
default
Failure
;
\ No newline at end of file
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