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
e27a667c
Commit
e27a667c
authored
Dec 06, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12061947
parent
bd57fd24
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
292 additions
and
44 deletions
+292
-44
index.jsx
src/components/Addform/index.jsx
+0
-0
index.jsx
src/pages/repair/failure/index.jsx
+2
-2
index.jsx
src/pages/repair/outsourcing/index.jsx
+288
-33
index.jsx
src/pages/repair/platform/index.jsx
+1
-1
columns.js
src/pages/setting/users/columns.js
+1
-8
No files found.
src/
pages/repair/failure/Addform
.jsx
→
src/
components/Addform/index
.jsx
View file @
e27a667c
File moved
src/pages/repair/failure/index.jsx
View file @
e27a667c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-0
5 09:10
:05
* @Last Modified time: 2022-12-0
6 16:52
:05
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -13,7 +13,7 @@ import PremButton from '@/components/PremButton';
...
@@ -13,7 +13,7 @@ import PremButton from '@/components/PremButton';
import
getcolumns
from
'./columns'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
Addform
from
'
.
/Addform'
;
import
Addform
from
'
@/components
/Addform'
;
function
Failure
(
props
)
{
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
...
...
src/pages/repair/outsourcing/index.jsx
View file @
e27a667c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-06 1
6:05:58
* @Last Modified time: 2022-12-06 1
9:43:22
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -13,9 +13,13 @@ import PremButton from '@/components/PremButton';
...
@@ -13,9 +13,13 @@ import PremButton from '@/components/PremButton';
import
getcolumns
from
'./columns'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
Addform
from
'@/components/Addform'
;
import
{
Menu
,
Dropdown
,
Button
,
message
}
from
'antd'
;
import
InitForm
from
'@/components/InitForm'
;
function
Failure
(
props
)
{
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
containderef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
open
:
false
,
...
@@ -58,24 +62,123 @@ function Failure(props) {
...
@@ -58,24 +62,123 @@ function Failure(props) {
);
);
};
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
// 完成外协
const
CompleteOuts
=
()
=>
{
return
(
return
(
<
PremButton
<>
btn=
{
{
<
InitForm
size
:
'small'
,
fields=
{
[
onClick
:
()
=>
{
{
setdrawer
((
s
)
=>
({
title
:
'外协单位'
,
...
s
,
dataIndex
:
'otherUnitsId'
,
open
:
true
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
item
:
row
,
key
:
'otherUnitsId'
,
title
:
'编辑'
,
valueType
:
'select'
,
val
:
'edit'
,
options
:
{
}));
path
:
'/asset/equipmentSupplier/query/selection'
,
},
params
:
{},
}
}
},
>
},
编辑
{
</
PremButton
>
title
:
'故障原因'
,
dataIndex
:
'causeFailure'
,
valueType
:
'textarea'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
key
:
'causeFailure'
,
},
{
title
:
'维修内容'
,
dataIndex
:
'repairContent'
,
valueType
:
'textarea'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
key
:
'repairContent'
,
},
{
title
:
'外协时长'
,
dataIndex
:
'otherUnitsHours'
,
key
:
'otherUnitsHours'
,
// valueType: 'number',
},
{
title
:
'外协费用'
,
dataIndex
:
'otherUnitsCost'
,
key
:
'otherUnitsCost'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
valueType
:
'textarea'
,
},
]
}
onFinish=
{
async
(
vals
)
=>
{
let
params
=
{
otherUnitsFinish
:
vals
,
id
:
drawer
?.
item
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umOtherUnitsOrder/finishOtherUnits'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'成功完成外协!'
);
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
}
/>
</>
);
};
// 重新指派
const
Reassig
=
()
=>
{
return
(
<>
<
InitForm
fields=
{
[
{
title
:
'最新外协人员'
,
dataIndex
:
'causeFailure'
,
valueType
:
'textarea'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
key
:
'causeFailure'
,
},
{
title
:
'外协人员'
,
dataIndex
:
'otherUnitsAssistList'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
key
:
'otherUnitsAssistList'
,
valueType
:
'select'
,
options
:
{
path
:
'/repair/umOtherUnitsOrder/selectionAgain'
,
params
:
{
otherUnitsOrderId
:
drawer
?.
item
.
id
},
},
},
]
}
onFinish=
{
async
(
vals
)
=>
{
let
params
=
{
otherUnitsFinish
:
vals
,
id
:
drawer
?.
item
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umOtherUnitsOrder/againOtherUnits'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'重新外协成功!'
);
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
}
/>
</>
);
);
};
};
...
@@ -100,19 +203,164 @@ function Failure(props) {
...
@@ -100,19 +203,164 @@ function Failure(props) {
);
);
};
};
// 更多
const
more
=
(
text
,
row
,
_
,
action
)
=>
{
const
menu
=
(
<
Menu
items=
{
[
{
label
:
row
?.
status
==
0
||
row
?.
status
==
1
?
(
<
a
onClick=
{
async
()
=>
{
let
params
=
{
id
:
row
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umOtherUnitsOrder/orderReceiving'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'接单成功!'
);
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
}
>
接单
</
a
>
)
:
(
<
a
onClick=
{
async
()
=>
{
let
params
=
{
id
:
row
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umOtherUnitsOrder/dispatchById'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'派单成功!'
);
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
}
>
派单
</
a
>
),
key
:
'0'
,
// disabled: true,
},
{
label
:
(
<
a
onClick=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
type
:
'comouts'
,
item
:
{
id
:
row
.
id
,
},
val
:
'only'
,
title
:
'完成外协'
,
}));
}
}
>
完成外协
</
a
>
),
key
:
'1'
,
},
]
}
/>
);
return
(
<
Dropdown
overlay=
{
menu
}
trigger=
{
[
'click'
]
}
arrow=
{
true
}
getPopupContainer=
{
()
=>
containderef
.
current
}
>
<
Button
size=
"small"
>
更多
</
Button
>
</
Dropdown
>
);
};
// 未完成按钮
const
unfinishBtn
=
(
text
,
row
,
_
,
action
)
=>
{
if
(
row
?.
status
==
1
)
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
}
else
if
(
row
?.
status
==
2
)
{
return
(
<
PremButton
onClick=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
item
:
row
,
type
:
'Reassig'
,
open
:
true
,
}));
}
}
btn=
{
{
size
:
'small'
,
}
}
>
重新指派
</
PremButton
>
);
}
};
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
console
.
log
(
defcolumn
);
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defcolumn
.
concat
({
title
:
'操作'
,
if
(
activeTabKey
==
'1'
)
{
valueType
:
'option'
,
return
defcolumn
.
concat
({
width
:
150
,
title
:
'操作'
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
valueType
:
'option'
,
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
width
:
150
,
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
render
:
(
text
,
row
,
_
,
action
)
=>
{
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
return
[
more
(
text
,
row
,
_
,
action
)];
],
},
});
});
}
else
if
(
activeTabKey
==
'2'
)
{
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
[
unfinishBtn
(
text
,
row
,
_
,
action
)];
},
});
}
else
if
(
activeTabKey
==
'3'
)
{
return
defcolumn
;
}
},
[
activeTabKey
]);
},
[
activeTabKey
]);
const
pathconfig
=
useMemo
(()
=>
{
const
pathconfig
=
useMemo
(()
=>
{
...
@@ -123,20 +371,24 @@ function Failure(props) {
...
@@ -123,20 +371,24 @@ function Failure(props) {
const
selectType
=
(
type
)
=>
{
const
selectType
=
(
type
)
=>
{
switch
(
type
)
{
switch
(
type
)
{
case
'add'
:
case
'add'
:
return
;
return
<
Addform
/>;
case
'comouts'
:
return
<
CompleteOuts
/>;
case
'Reassig'
:
return
<
Reassig
/>;
default
:
default
:
break
;
break
;
}
}
};
};
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
div
style=
{
{
position
:
'relative'
}
}
ref=
{
containderef
}
>
<
AutoTable
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
外协工单
</
h3
>
}
pagetitle=
{
<
h3
className=
"page-title"
>
外协工单
</
h3
>
}
columns=
{
columns
}
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
addconfig=
{
{
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
btn
:
{
btn
:
{
...
@@ -146,8 +398,10 @@ function Failure(props) {
...
@@ -146,8 +398,10 @@ function Failure(props) {
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
open
:
true
,
item
:
null
,
item
:
{
title
:
'新增'
,
isShutdown
:
1
,
},
title
:
'新建外协工单'
,
val
:
'only'
,
val
:
'only'
,
type
:
'add'
,
type
:
'add'
,
}));
}));
...
@@ -172,6 +426,7 @@ function Failure(props) {
...
@@ -172,6 +426,7 @@ function Failure(props) {
onClose=
{
()
=>
{
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
false
,
}));
}));
}
}
}
}
...
...
src/pages/repair/platform/index.jsx
View file @
e27a667c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-12-05 10:13:42
* @Date: 2022-12-05 10:13:42
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-0
5 17:32:09
* @Last Modified time: 2022-12-0
6 16:41:48
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
...
src/pages/setting/users/columns.js
View file @
e27a667c
...
@@ -424,14 +424,7 @@ function getcolumns(setdrawer) {
...
@@ -424,14 +424,7 @@ function getcolumns(setdrawer) {
fieldProps
:
{
fieldProps
:
{
limit
:
2
,
limit
:
2
,
},
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
render
:
(
text
,
row
)
=>
{
render
:
(
text
,
row
)
=>
{
if
(
row
?.
pictureUrl
==
null
)
{
if
(
row
?.
pictureUrl
==
null
)
{
return
'暂无图片'
;
return
'暂无图片'
;
...
...
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