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
f69798e6
Commit
f69798e6
authored
Dec 06, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12060928
parent
7b6fce2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
295 additions
and
116 deletions
+295
-116
index.jsx
src/pages/repair/order/index.jsx
+3
-3
columns.js
src/pages/repair/outsourcing/columns.js
+216
-95
index.jsx
src/pages/repair/outsourcing/index.jsx
+76
-18
No files found.
src/pages/repair/order/index.jsx
View file @
f69798e6
/*
故障报修
/*
维修工单
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-06 09:
04:0
6
* @Last Modified time: 2022-12-06 09:
16:4
6
*/
import
*
as
React
from
'react'
;
...
...
@@ -123,7 +123,7 @@ function Failure(props) {
const
selectType
=
(
type
)
=>
{
switch
(
type
)
{
case
'add'
:
return
<
Addform
/>
;
return
;
default
:
break
;
}
...
...
src/pages/repair/outsourcing/columns.js
View file @
f69798e6
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
tab
:
'我的待办'
,
key
:
'1'
,
columns
:
[
{
title
:
'外协单号'
,
dataIndex
:
'repairOrderNo'
,
key
:
'repairOrderNo'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'故障描述'
,
dataIndex
:
'faultDescription'
,
key
:
'faultDescription'
,
valueType
:
'textarea'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'repairTime'
,
key
:
'repairTimeList'
,
valueType
:
'dateTimeRange'
,
},
{
title
:
'创建人员'
,
dataIndex
:
'repairUserName'
,
key
:
'repairUserName'
,
},
{
title
:
'最新外协人员'
,
dataIndex
:
'newRepairUserName'
,
key
:
'newRepairUserName'
,
},
{
title
:
'来源单号'
,
dataIndex
:
'repairNo'
,
key
:
'repairNo'
,
},
{
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
:
'/repair/umFailureRepair/queryNoFinishList'
,
delete
:
'/repair/umFailureRepair/deleteById'
,
detail
:
''
,
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
tab
:
'我的待办'
,
key
:
'1'
,
columns
:
[
{
title
:
'外协单号'
,
dataIndex
:
'repairOrderNo'
,
key
:
'repairOrderNo'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'故障描述'
,
dataIndex
:
'faultDescription'
,
key
:
'faultDescription'
,
valueType
:
'textarea'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'repairTime'
,
key
:
'repairTimeList'
,
valueType
:
'dateTimeRange'
,
},
{
title
:
'创建人员'
,
dataIndex
:
'repairUserName'
,
key
:
'repairUserName'
,
},
{
title
:
'最新外协人员'
,
dataIndex
:
'newRepairUserName'
,
key
:
'newRepairUserName'
,
},
{
title
:
'来源单号'
,
dataIndex
:
'repairNo'
,
key
:
'repairNo'
,
},
{
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
:
'/repair/umFailureRepair/queryNoFinishList'
,
delete
:
'/repair/umFailureRepair/deleteById'
,
detail
:
''
,
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
tab
:
'我的待办'
,
key
:
'1'
,
columns
:
[
{
title
:
'外协单号'
,
dataIndex
:
'repairOrderNo'
,
key
:
'repairOrderNo'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'故障描述'
,
dataIndex
:
'faultDescription'
,
key
:
'faultDescription'
,
valueType
:
'textarea'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'repairTime'
,
key
:
'repairTimeList'
,
valueType
:
'dateTimeRange'
,
},
{
title
:
'创建人员'
,
dataIndex
:
'repairUserName'
,
key
:
'repairUserName'
,
},
{
title
:
'最新外协人员'
,
dataIndex
:
'newRepairUserName'
,
key
:
'newRepairUserName'
,
},
{
title
:
'来源单号'
,
dataIndex
:
'repairNo'
,
key
:
'repairNo'
,
},
{
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
:
'/repair/umFailureRepair/queryNoFinishList'
,
delete
:
'/repair/umFailureRepair/deleteById'
,
detail
:
''
,
},
},
];
}
export
default
getcolumns
;
src/pages/repair/outsourcing/index.jsx
View file @
f69798e6
/* 维修工单
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-06 09:16:55
*/
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
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Outsourcing
(
props
)
{
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
...
...
@@ -21,11 +44,11 @@ function Outsourcing(props) {
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的
详细信息'
,
title
:
'
详细信息'
,
}));
},
}
}
...
...
@@ -43,7 +66,7 @@ function Outsourcing(props) {
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
...
...
@@ -60,10 +83,11 @@ function Outsourcing(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除
该用户
?'
,
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
...
...
@@ -77,59 +101,93 @@ function Outsourcing(props) {
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
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
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
de
fpath
?.
enabledetail
&&
de
tail
(
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
]);
const
selectType
=
(
type
)
=>
{
switch
(
type
)
{
case
'add'
:
return
;
default
:
break
;
}
};
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"外协工单"
pagetitle=
{
<
h3
className=
"page-title"
>
维修工单
</
h3
>
}
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
val
:
'only'
,
type
:
'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
:
false
,
open
:
false
,
}));
}
}
{
...
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
}
});
}
}
}
>
{
selectType
(
drawer
?.
type
)
}
</
DrawerPro
>
</
div
>
);
}
export
default
Outsourcing
;
\ No newline at end of file
export
default
Failure
;
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