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
729e1d5e
Commit
729e1d5e
authored
Jan 18, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detail
parent
fc3688a2
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1839 additions
and
435 deletions
+1839
-435
mtable.jsx
src/components/AutoTable/mtable.jsx
+2
-1
detailnode.jsx
src/components/DetailNode/detailnode.jsx
+35
-0
index.jsx
src/components/DetailNode/index.jsx
+76
-0
index.jsx
src/components/InitForm/Diyrule/index.jsx
+4
-3
index.jsx
src/pages/device/supplier/index.jsx
+1
-1
columns.js
src/pages/maintain/orders/columns.js
+117
-57
index.jsx
src/pages/maintain/orders/index.jsx
+231
-152
columns.js
src/pages/maintain/plan/columns.js
+2
-2
index.jsx
src/pages/maintain/plan/index.jsx
+1
-1
columns.js
src/pages/maintain/workOrder/columns.js
+464
-58
detailColumns.js
src/pages/maintain/workOrder/detailColumns.js
+227
-0
index.jsx
src/pages/maintain/workOrder/index.jsx
+678
-144
index.jsx
src/pages/system/rules/index.jsx
+1
-16
No files found.
src/components/AutoTable/mtable.jsx
View file @
729e1d5e
...
@@ -26,6 +26,7 @@ let handlEmptyChild = (tree = []) => {
...
@@ -26,6 +26,7 @@ let handlEmptyChild = (tree = []) => {
const
Mtable
=
(
props
)
=>
{
const
Mtable
=
(
props
)
=>
{
const
{
const
{
headerTitle
,
actionRef
,
//表格动作
actionRef
,
//表格动作
formRef
,
//表单Ref
formRef
,
//表单Ref
rowKey
,
// key
rowKey
,
// key
...
@@ -42,7 +43,7 @@ const Mtable = (props) => {
...
@@ -42,7 +43,7 @@ const Mtable = (props) => {
resizeable
=
false
,
resizeable
=
false
,
dataSource
,
dataSource
,
}
=
props
;
}
=
props
;
console
.
log
(
dataSource
);
const
actionRefs
=
actionRef
??
useRef
(),
const
actionRefs
=
actionRef
??
useRef
(),
formRefs
=
formRef
??
useRef
(),
formRefs
=
formRef
??
useRef
(),
ifspagination
=
pagination
==
'false'
||
pagination
===
false
,
ifspagination
=
pagination
==
'false'
||
pagination
===
false
,
...
...
src/components/DetailNode/detailnode.jsx
0 → 100644
View file @
729e1d5e
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
{
Divider
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
const
DetailNode
=
(
props
)
=>
{
const
{
data
,
index
,
columns
,
hasTable
=
false
,
operationType
}
=
props
;
console
.
log
(
props
);
return
(
<>
<
div
className=
"fault-detail"
>
<
div
style=
{
{
flex
:
1
,
display
:
'flex'
,
flexDirection
:
'row'
}
}
>
<
div
className=
"fault-index"
>
{
Number
(
index
)
+
1
}
</
div
>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'column'
}
}
>
<
label
style=
{
{
width
:
'80px'
,
fontSize
:
18
,
fontWeight
:
600
}
}
>
{
data
?.
operationTypeName
}
</
label
>
<
span
>
{
data
?.
updateUserName
}
</
span
>
<
span
>
{
data
?.
updateTime
}
</
span
>
</
div
>
</
div
>
<
div
style=
{
{
flex
:
6
}
}
>
<
div
>
<
h2
className=
"page-title"
style=
{
{
marginBottom
:
16
}
}
>
{
operationType
==
0
?
'基础信息'
:
data
?.
operationTypeName
}
</
h2
>
</
div
>
<
ProDescriptions
dataSource=
{
data
}
columns=
{
columns
}
/>
{
hasTable
?
props
.
children
:
null
}
<
Divider
/>
</
div
>
</
div
>
</>
);
};
export
default
DetailNode
;
src/components/DetailNode/index.jsx
0 → 100644
View file @
729e1d5e
/* eslint-disable react/jsx-key */
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
Divider
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
DetailNode
from
'./detailnode'
;
import
AutoTable
from
'../AutoTable/mtable'
;
const
Detail
=
(
props
)
=>
{
console
.
log
(
props
);
const
{
path
,
params
,
titleColumns
,
detailKey
,
columns
}
=
props
;
let
[
firstcolumns
,
...
mescolumns
]
=
titleColumns
;
// columns?.forEach((it) => {
// if (it?.valueType == 'table') {
// tableColumns.push(it);
// } else {
// detailColumns.push(it);
// }
// });
const
detailData
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
path
,
params
});
return
res
?.
data
?.
dataList
;
});
console
.
log
(
columns
);
return
(
<>
<
h2
style=
{
{
fontWeight
:
700
,
marginBottom
:
16
}
}
>
{
firstcolumns
?.
title
}
:
{
detailData
?.
data
?.[
0
]?.[
firstcolumns
?.
dataIndex
]
||
'--'
}
</
h2
>
<
ProDescriptions
columns=
{
mescolumns
}
dataSource=
{
detailData
?.
data
?.[
0
]
}
/>
<
Divider
/>
<
div
>
{
detailData
?.
data
?.
map
((
it
,
index
)
=>
{
console
.
log
(
it
);
const
detailColumns
=
[],
tableColumns
=
[];
columns
[
it
?.
operationType
]?.
forEach
((
it
)
=>
{
if
(
it
?.
valueType
==
'table'
)
{
tableColumns
.
push
(
it
);
}
else
{
detailColumns
.
push
(
it
);
}
});
return
(
<
DetailNode
key=
{
it
?.
id
}
data=
{
it
}
index=
{
index
}
operationType=
{
it
?.
operationType
}
columns=
{
detailColumns
}
hasTable=
{
true
}
>
{
tableColumns
?.
map
((
t
)
=>
{
return
(
<
div
style=
{
{
marginTop
:
8
,
marginBottom
:
8
}
}
>
<
b
>
{
t
?.
title
}
</
b
>
<
AutoTable
dataSource=
{
it
[
t
?.
key
]
}
columns=
{
t
?.
columns
}
style=
{
{
marginTop
:
8
}
}
/>
</
div
>
);
})
}
</
DetailNode
>
);
})
}
</
div
>
</>
);
};
export
default
Detail
;
src/components/InitForm/Diyrule/index.jsx
View file @
729e1d5e
...
@@ -25,7 +25,7 @@ let Diyrule = (props) => {
...
@@ -25,7 +25,7 @@ let Diyrule = (props) => {
defval
?.
other
||
{
defval
?.
other
||
{
noRuleCode
:
''
,
noRuleCode
:
''
,
sort
:
null
,
sort
:
null
,
formatType
:
3
,
formatType
:
null
,
increaseList
:
[],
increaseList
:
[],
}
}
);
);
...
@@ -34,7 +34,7 @@ let Diyrule = (props) => {
...
@@ -34,7 +34,7 @@ let Diyrule = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
onChange
(
defval
);
onChange
(
defval
);
});
});
console
.
log
(
'other.sort :'
,
other
?.
sort
);
let
{
data
,
loading
}
=
useRequest
(()
=>
{
let
{
data
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
:
'/base/bmNoRule/querySelect'
,
params
:
{}
});
return
doFetch
({
url
:
'/base/bmNoRule/querySelect'
,
params
:
{}
});
});
});
...
@@ -520,9 +520,10 @@ let Diyrule = (props) => {
...
@@ -520,9 +520,10 @@ let Diyrule = (props) => {
value=
{
other
?.
sort
}
value=
{
other
?.
sort
}
options=
{
Array
.
apply
(
null
,
{
length
:
value
?
value
.
length
:
0
}).
map
((
it
,
i
)
=>
({
options=
{
Array
.
apply
(
null
,
{
length
:
value
?
value
.
length
:
0
}).
map
((
it
,
i
)
=>
({
label
:
`第${i + 1}个`
,
label
:
`第${i + 1}个`
,
value
:
i
+
2
,
value
:
i
+
1
,
}))
}
}))
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
console
.
log
(
'改变的val'
,
val
);
onChange
({
onChange
({
value
:
value
,
value
:
value
,
other
:
{
other
:
{
...
...
src/pages/device/supplier/index.jsx
View file @
729e1d5e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 202
2-12-19 14:18:44
* @Last Modified time: 202
3-01-18 15:25:43
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
...
src/pages/maintain/orders/columns.js
View file @
729e1d5e
import
dayjs
from
'dayjs'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
{
return
{
"pathconfig"
:
{
columns
:
[
"enableadd"
:
false
,
{
"enableedit"
:
false
,
title
:
'保养单号'
,
"enabledelete"
:
false
,
dataIndex
:
'taskNo'
,
"enabledetail"
:
false
,
key
:
'taskNo'
,
"add"
:
""
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
"edit"
:
""
,
return
(
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
<
a
"delete"
:
""
,
onClick
=
{()
=>
{
"detail"
:
""
setdrawer
((
s
)
=>
({
},
...
s
,
"columns"
:
[
open
:
true
,
{
val
:
'only'
,
"title"
:
"维修单号"
,
title
:
'详细信息'
,
"dataIndex"
:
"repairOrderNo"
,
item
:
row
,
"key"
:
"repairOrderNo"
}));
},
}}
{
>
"title"
:
"设备编号"
,
{
row
?.
maintainNo
}
"dataIndex"
:
"equipmentNo"
,
<
/a
>
"key"
:
"equipmentNo"
);
},
},
{
},
"title"
:
"设备名称"
,
{
"dataIndex"
:
"equipmentName"
,
title
:
'设备编号'
,
"key"
:
"equipmentName"
dataIndex
:
'equipmentNo'
,
},
key
:
'equipmentNo'
,
{
},
"title"
:
"故障描述"
,
{
"dataIndex"
:
"faultDescription"
,
title
:
'设备名称'
,
"key"
:
"faultDescription"
dataIndex
:
'equipmentName'
,
},
key
:
'equipmentName'
,
{
},
"title"
:
"报修人员"
,
{
"dataIndex"
:
"repairUserName"
,
title
:
'保养类型'
,
"key"
:
"repairUserName"
dataIndex
:
'maintainTypeName'
,
},
key
:
'maintainType'
,
{
valueType
:
'select'
,
"title"
:
"报修时间"
,
mode
:
'radio'
,
"dataIndex"
:
"repairTime"
,
options
:
[
"key"
:
"repairTimeList"
,
{
"valueType"
:
"dateTimeRange"
label
:
'自主保养'
,
},
value
:
'1'
,
{
},
"title"
:
"报修单号"
,
{
"dataIndex"
:
"repairNo"
,
label
:
'专业保养'
,
"key"
:
"repairNo"
value
:
'2'
,
},
},
{
],
"title"
:
"工单状态"
,
},
"dataIndex"
:
"statusName"
,
{
"key"
:
"statusName"
title
:
'保养频次'
,
}
dataIndex
:
'maintainFrequencyName'
,
]
key
:
'maintainFrequency'
,
};
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'周'
,
value
:
'0'
,
},
{
label
:
'月度'
,
value
:
'1'
,
},
{
label
:
'季度'
,
value
:
'2'
,
},
{
label
:
'半年'
,
value
:
'3'
,
},
{
label
:
'一年'
,
value
:
'4'
,
},
],
},
{
title
:
'保养截至日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDateList'
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
span
style
=
{{
color
:
`
${
dayjs
(
row
.
planMaintainDate
).
valueOf
()
<
dayjs
().
format
(
'YYYY-MM-DD'
).
valueOf
()
?
'#f50'
:
'rgba(0, 0, 0, 0.85)'
}
`
,
}}
>
{
row
.
planMaintainDate
}
<
/span
>
);
},
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/maintain/umMaintainTask/queryReceivingList'
,
delete
:
''
,
detail
:
''
,
},
};
}
}
export
default
getcolumns
;
export
default
getcolumns
;
\ No newline at end of file
src/pages/maintain/orders/index.jsx
View file @
729e1d5e
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
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
DetailNode
from
'@/components/DetailNode'
;
import
getDetailColumns
from
'../workOrder/detailColumns'
;
function
Orders
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
function
Orders
(
props
)
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
actionRef
=
useRef
(),
return
(
formRef
=
useRef
();
<
PremButton
const
[
drawer
,
setdrawer
]
=
useState
({
btn=
{
{
open
:
false
,
size
:
'small'
,
});
type
:
'link'
,
const
pathconfig
=
useMemo
(()
=>
{
onClick
:
()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
setdrawer
((
s
)
=>
({
return
pathconf
;
...
s
,
},
[]);
open
:
true
,
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
item
:
row
,
manual
:
true
,
title
:
'详情'
,
onSuccess
:
(
res
,
params
)
=>
{
val
:
'detail'
,
if
(
res
?.
code
==
'0000'
)
{
title
:
'详细信息'
,
actionRef
?.
current
?.
reload
();
}));
setdrawer
((
s
)
=>
({
},
...
s
,
}
}
open
:
false
,
>
}));
详情
}
</
PremButton
>
},
);
};
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
>
);
};
const
order
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否接单?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
await
runAsync
({
url
:
'/maintain/umMaintainTask/orderReceiving'
,
params
:
{
id
:
row
?.
id
},
});
},
}
}
btn=
{
{
size
:
'small'
,
}
}
>
接单
</
PremButton
>
);
};
const
close
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否关单?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
await
runAsync
({
url
:
'/maintain/umMaintainTask/customsDeclaration'
,
params
:
{
id
:
row
?.
id
},
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
关单
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
order
(
text
,
row
,
_
,
action
),
close
(
text
,
row
,
_
,
action
)],
});
});
},
[]);
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
DetailLine
=
()
=>
{
return
(
return
(
<
PremButton
<>
btn=
{
{
<
DetailNode
size
:
'small'
,
path=
"/maintain/umMaintainTaskOperation/queryDetailList"
type
:
'link'
,
params=
{
{
maintainTaskId
:
drawer
?.
item
?.
id
}
}
onClick
:
()
=>
{
titleColumns=
{
[
setdrawer
((
s
)
=>
({
{
...
s
,
title
:
'保养单号'
,
open
:
true
,
dataIndex
:
'taskNo'
,
item
:
row
,
key
:
'taskNo'
,
title
:
'详情'
,
},
val
:
'detail'
,
{
title
:
'详细信息'
,
title
:
'创建时间'
,
}));
dataIndex
:
'createTime'
,
key
:
'createTime'
,
},
{
title
:
'工单状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatusName'
,
},
},
}
}
{
>
title
:
'保养计划单号'
,
详情
dataIndex
:
'maintainNo'
,
</
PremButton
>
key
:
'maintainNo'
,
);
},
};
]
}
detailKey=
"maintainTaskItemList"
columns=
{
getDetailColumns
}
/>
</>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
PremButton
<
AutoTable
btn=
{
{
pagetitle=
{
<
h3
className=
"page-title"
>
保养接单
</
h3
>
}
size
:
'small'
,
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
open
:
true
,
item
:
row
,
item
:
null
,
title
:
'
编辑
'
,
title
:
'
新增
'
,
val
:
'
edit
'
,
val
:
'
add
'
,
}));
}));
},
},
}
}
},
>
}
}
编辑
/>
</
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
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"保养接单"
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
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'
,
}));
},
},
}
}
/>
<
DrawerPro
<
DrawerPro
fields=
{
columns
}
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
formRef=
{
formRef
}
placement=
"right"
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
false
,
}));
}));
}
}
}
}
{
...
drawer
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
}
}
}
/>
>
</
div
>
{
drawer
?.
val
==
'only'
?
<
DetailLine
/>
:
null
}
);
</
DrawerPro
>
}
</
div
>
);
}
export
default
Orders
;
export
default
Orders
;
\ No newline at end of file
src/pages/maintain/plan/columns.js
View file @
729e1d5e
...
@@ -385,7 +385,7 @@ function getcolumns(setdrawer) {
...
@@ -385,7 +385,7 @@ function getcolumns(setdrawer) {
add
:
'/maintain/umMaintainPlan/save'
,
add
:
'/maintain/umMaintainPlan/save'
,
edit
:
'/maintain/umMaintainPlan/save'
,
edit
:
'/maintain/umMaintainPlan/save'
,
list
:
'/maintain/umMaintainPlan/queryList'
,
list
:
'/maintain/umMaintainPlan/queryList'
,
delete
:
'/maintain/umMaintainPlan/
enableDeactivate
'
,
delete
:
'/maintain/umMaintainPlan/
deleteById
'
,
detail
:
'/maintain/umMaintainPlan/queryById'
,
detail
:
'/maintain/umMaintainPlan/queryById'
,
},
},
},
},
...
@@ -564,7 +564,7 @@ function getcolumns(setdrawer) {
...
@@ -564,7 +564,7 @@ function getcolumns(setdrawer) {
add
:
'/maintain/umMaintainPlan/save'
,
add
:
'/maintain/umMaintainPlan/save'
,
edit
:
'/maintain/umMaintainPlan/save'
,
edit
:
'/maintain/umMaintainPlan/save'
,
list
:
'/maintain/umMaintainPlan/queryList'
,
list
:
'/maintain/umMaintainPlan/queryList'
,
delete
:
'/maintain/umMaintainPlan/
enableDeactivate
'
,
delete
:
'/maintain/umMaintainPlan/
deleteById
'
,
detail
:
'/maintain/umMaintainPlan/queryById'
,
detail
:
'/maintain/umMaintainPlan/queryById'
,
},
},
},
},
...
...
src/pages/maintain/plan/index.jsx
View file @
729e1d5e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2023-01-16 15:35:00
* @Date: 2023-01-16 15:35:00
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-1
7 11:35:36
* @Last Modified time: 2023-01-1
8 15:20:30
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
...
src/pages/maintain/workOrder/columns.js
View file @
729e1d5e
function
getcolumns
(
setdrawer
)
{
import
dayjs
from
'dayjs'
;
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"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"
:
"dateTimeRange"
},
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
]
};
function
getcolumns
(
setdrawer
)
{
return
[
{
tab
:
'我的待办'
,
key
:
'1'
,
columns
:
[
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
val
:
'only'
,
title
:
'详细信息'
,
item
:
row
,
}));
}}
>
{
row
?.
maintainNo
}
<
/a
>
);
},
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainType'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'自主保养'
,
value
:
'1'
,
},
{
label
:
'专业保养'
,
value
:
'2'
,
},
],
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'周'
,
value
:
'0'
,
},
{
label
:
'月度'
,
value
:
'1'
,
},
{
label
:
'季度'
,
value
:
'2'
,
},
{
label
:
'半年'
,
value
:
'3'
,
},
{
label
:
'一年'
,
value
:
'4'
,
},
],
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDateList'
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
span
style
=
{{
color
:
`
${
dayjs
(
row
.
planMaintainDate
).
valueOf
()
<
dayjs
().
format
(
'YYYY-MM-DD'
).
valueOf
()
?
'#f50'
:
'rgba(0, 0, 0, 0.85)'
}
`
,
}}
>
{
row
.
planMaintainDate
}
<
/span
>
);
},
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTimeList'
,
valueType
:
'dateRange'
,
},
{
title
:
'保养人员'
,
dataIndex
:
'maintainUserName'
,
key
:
'maintainUserName'
,
},
{
title
:
'状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatus'
,
valueType
:
'select'
,
fieldProps
:
{
dropdownMatchSelectWidth
:
100
,
},
mode
:
'radio'
,
options
:
[
{
label
:
'待接单'
,
value
:
'1'
,
},
{
label
:
'保养中'
,
value
:
'2'
,
},
{
label
:
'待验证'
,
value
:
'5'
,
},
],
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/maintain/umMaintainTask/queryMyDealwithList'
,
delete
:
''
,
detail
:
''
,
},
},
{
tab
:
'未完成'
,
key
:
'2'
,
columns
:
[
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
val
:
'only'
,
title
:
'详细信息'
,
item
:
row
,
}));
}}
>
{
row
?.
maintainNo
}
<
/a
>
);
},
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainType'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'自主保养'
,
value
:
'1'
,
},
{
label
:
'专业保养'
,
value
:
'2'
,
},
],
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'周'
,
value
:
'0'
,
},
{
label
:
'月度'
,
value
:
'1'
,
},
{
label
:
'季度'
,
value
:
'2'
,
},
{
label
:
'半年'
,
value
:
'3'
,
},
{
label
:
'一年'
,
value
:
'4'
,
},
],
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDateList'
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
span
style
=
{{
color
:
`
${
dayjs
(
row
.
planMaintainDate
).
valueOf
()
<
dayjs
().
format
(
'YYYY-MM-DD'
).
valueOf
()
?
'#f50'
:
'rgba(0, 0, 0, 0.85)'
}
`
,
}}
>
{
row
.
planMaintainDate
}
<
/span
>
);
},
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTimeList'
,
valueType
:
'dateRange'
,
},
{
title
:
'保养人员'
,
dataIndex
:
'maintainUserName'
,
key
:
'maintainUserName'
,
},
{
title
:
'状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatus'
,
fieldProps
:
{
dropdownMatchSelectWidth
:
100
,
},
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'待接单'
,
value
:
'1'
,
},
{
label
:
'保养中'
,
value
:
'2'
,
},
{
label
:
'待验证'
,
value
:
'5'
,
},
],
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/maintain/umMaintainTask/queryList'
,
delete
:
''
,
detail
:
''
,
},
},
{
tab
:
'已完成'
,
key
:
'3'
,
columns
:
[
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
val
:
'only'
,
title
:
'详细信息'
,
item
:
row
,
}));
}}
>
{
row
?.
maintainNo
}
<
/a
>
);
},
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainType'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'自主保养'
,
value
:
'1'
,
},
{
label
:
'专业保养'
,
value
:
'2'
,
},
],
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'周'
,
value
:
'0'
,
},
{
label
:
'月度'
,
value
:
'1'
,
},
{
label
:
'季度'
,
value
:
'2'
,
},
{
label
:
'半年'
,
value
:
'3'
,
},
{
label
:
'一年'
,
value
:
'4'
,
},
],
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDateList'
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
span
style
=
{{
color
:
`
${
dayjs
(
row
.
planMaintainDate
).
valueOf
()
<
dayjs
().
format
(
'YYYY-MM-DD'
).
valueOf
()
?
'#f50'
:
'rgba(0, 0, 0, 0.85)'
}
`
,
}}
>
{
row
.
planMaintainDate
}
<
/span
>
);
},
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTimeList'
,
valueType
:
'dateRange'
,
},
{
dataIndex
:
'customsTime'
,
valueType
:
'dateRange'
,
title
:
'关单时间'
,
key
:
'customsTimeList'
,
},
{
title
:
'保养人员'
,
dataIndex
:
'maintainUserName'
,
key
:
'maintainUserName'
,
},
{
title
:
'状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatus'
,
fieldProps
:
{
dropdownMatchSelectWidth
:
100
,
},
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'待接单'
,
value
:
'1'
,
},
{
label
:
'保养中'
,
value
:
'2'
,
},
{
label
:
'待验证'
,
value
:
'5'
,
},
],
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/maintain/umMaintainTaskHis/queryList'
,
delete
:
''
,
detail
:
''
,
},
},
];
}
}
export
default
getcolumns
;
export
default
getcolumns
;
\ No newline at end of file
src/pages/maintain/workOrder/detailColumns.js
0 → 100644
View file @
729e1d5e
import
dayjs
from
'dayjs'
;
const
getcolumns
=
{
0
:
[
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'设备型号'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainType'
,
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDateList'
,
},
{
title
:
'保养项目'
,
key
:
'maintainTaskItemList'
,
valueType
:
'table'
,
dataIndex
:
'maintainTaskItemList'
,
columns
:
[
{
title
:
'保养项目'
,
dataIndex
:
'maintainItemName'
,
key
:
'maintainItemName'
,
},
{
title
:
'部位'
,
dataIndex
:
'maintainPosition'
,
key
:
'maintainPosition'
,
},
{
title
:
'保养方法'
,
dataIndex
:
'maintainMethod'
,
key
:
'maintainMethod'
,
},
],
},
],
1
:
[
{
title
:
'保养人员'
,
dataIndex
:
'maintainUserName'
,
key
:
'maintainUserName'
,
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTime'
,
},
],
2
:
[
{
title
:
'关单人员'
,
dataIndex
:
'customsUserName'
,
key
:
'customsUserName'
,
},
{
title
:
'强制关单时间'
,
dataIndex
:
'offSingleDate'
,
key
:
'offSingleDate'
,
},
],
3
:
[
{
title
:
'完成保养时间'
,
dataIndex
:
'maintainEndTime'
,
key
:
'maintainEndTime'
,
},
{
title
:
'保养项目'
,
key
:
'maintainTaskItemList'
,
valueType
:
'table'
,
dataIndex
:
'maintainTaskItemList'
,
columns
:
[
{
title
:
'保养项目'
,
dataIndex
:
'maintainItemName'
,
key
:
'maintainItemName'
,
},
{
title
:
'部位'
,
dataIndex
:
'maintainPosition'
,
key
:
'maintainPosition'
,
},
{
title
:
'保养方法'
,
dataIndex
:
'maintainMethod'
,
key
:
'maintainMethod'
,
},
{
title
:
'结果'
,
dataIndex
:
'judgeResultName'
,
key
:
'judgeResultName'
,
},
{
title
:
'下限值'
,
dataIndex
:
'lowerLimit'
,
key
:
'lowerLimit'
,
},
{
title
:
'上限值'
,
dataIndex
:
'upperLimit'
,
key
:
'upperLimit'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
},
],
},
{
title
:
'非寿命件消耗'
,
key
:
'maintainTaskItemList'
,
valueType
:
'table'
,
dataIndex
:
'maintainTaskItemList'
,
columns
:
[
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
},
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
},
{
title
:
'消耗数量'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
},
],
},
{
title
:
'寿命件更换'
,
key
:
'maintainTaskItemList'
,
valueType
:
'table'
,
dataIndex
:
'maintainTaskItemList'
,
columns
:
[
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
},
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
},
{
title
:
'安装部位'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
},
{
title
:
'更换数量'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
},
],
},
],
4
:
[
{
title
:
'验证人员'
,
dataIndex
:
'reviewerName'
,
key
:
'reviewerName'
,
},
{
title
:
'验证时间'
,
dataIndex
:
'reviewerName'
,
key
:
'reviewerName'
,
},
{
title
:
'验证结果'
,
dataIndex
:
'reviewerName'
,
key
:
'reviewerName'
,
},
{
title
:
'备注'
,
dataIndex
:
'reviewerName'
,
key
:
'reviewerName'
,
},
],
};
export
default
getcolumns
;
src/pages/maintain/workOrder/index.jsx
View file @
729e1d5e
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
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
AutoTables
from
'@/components/AutoTable/mtable'
;
import
{
Radio
,
InputNumber
,
Input
,
Divider
}
from
'antd'
;
import
InitForm
from
'@/components/InitForm'
;
import
getDetailColumns
from
'./detailColumns'
;
import
DetailNode
from
'@/components/DetailNode'
;
function
WorkOrder
(
props
)
{
function
WorkOrder
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
open
:
false
,
});
}),
const
pathconfig
=
useMemo
(()
=>
{
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
return
(
manual
:
true
,
<
PremButton
onSuccess
:
(
res
,
params
)
=>
{
btn=
{
{
if
(
res
?.
code
==
'0000'
)
{
size
:
'small'
,
actionRef
?.
current
?.
reload
();
type
:
'link'
,
setdrawer
((
s
)
=>
({
onClick
:
()
=>
{
...
s
,
setdrawer
((
s
)
=>
({
open
:
false
,
...
s
,
}));
open
:
true
,
}
item
:
row
,
},
title
:
'详情'
,
});
val
:
'detail'
,
title
:
'详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
onClick
:
()
=>
{
type
:
'link'
,
setdrawer
((
s
)
=>
({
onClick
:
()
=>
{
...
s
,
setdrawer
((
s
)
=>
({
open
:
true
,
...
s
,
item
:
row
,
open
:
true
,
title
:
'编辑'
,
item
:
row
,
val
:
'edit'
,
title
:
'详情'
,
}));
val
:
'detail'
,
},
title
:
'详细信息'
,
}
}
}));
>
},
编辑
}
}
</
PremButton
>
>
);
详情
};
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
const
detailaddonColumns
=
useMemo
(()
=>
{
return
(
if
(
activeTabKey
==
1
)
{
<
PremButton
if
(
drawer
?.
type
==
'yz'
)
{
pop=
{
{
const
columnsc
=
[
title
:
'是否删除?'
,
{
okText
:
'确认'
,
title
:
'保养项目'
,
cancelText
:
'取消'
,
dataIndex
:
'maintainItemName'
,
onConfirm
:
()
=>
{
key
:
'maintainItemName'
,
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
hideInForm
:
true
,
},
{
title
:
'部位'
,
dataIndex
:
'maintainPosition'
,
key
:
'maintainPosition'
,
hideInForm
:
true
,
},
{
title
:
'保养方法'
,
dataIndex
:
'maintainMethod'
,
key
:
'maintainMethod'
,
hideInForm
:
true
,
},
{
title
:
'结果'
,
dataIndex
:
'judgeResultName'
,
key
:
'judgeResultName'
,
hideInForm
:
true
,
},
{
title
:
'下限值'
,
dataIndex
:
'lowerLimit'
,
key
:
'lowerLimit'
,
hideInForm
:
true
,
},
{
title
:
'上限值'
,
dataIndex
:
'upperLimit'
,
key
:
'upperLimit'
,
hideInForm
:
true
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
hideInForm
:
true
,
},
];
return
[
{
title
:
'工单信息'
,
valueType
:
'split'
,
},
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainTypeName'
,
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDate'
,
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTime'
,
},
{
title
:
'完成保养时间'
,
dataIndex
:
'maintainEndTime'
,
key
:
'maintainEndTime'
,
},
{
title
:
'保养项目'
,
valueType
:
'split'
,
},
{
dataIndex
:
'itemList'
,
key
:
'itemList'
,
valueType
:
'formList'
,
columns
,
span
:
3
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
AutoTables
columns=
{
columnsc
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))
}
dataSource=
{
drawer
?.
item
?.
maintainTaskItemList
}
/>
);
},
},
}
}
},
btn=
{
{
];
size
:
'small'
,
}
else
if
(
drawer
?.
type
==
'wcby'
)
{
type
:
'danger'
,
const
columnsc
=
[
}
}
{
>
title
:
'保养项目'
,
删除
dataIndex
:
'maintainItemName'
,
</
PremButton
>
key
:
'maintainItemName'
,
);
hideInForm
:
true
,
};
},
{
title
:
'部位'
,
dataIndex
:
'maintainPosition'
,
key
:
'maintainPosition'
,
hideInForm
:
true
,
},
{
title
:
'保养方法'
,
dataIndex
:
'maintainMethod'
,
key
:
'maintainMethod'
,
hideInForm
:
true
,
},
{
title
:
'结果'
,
dataIndex
:
'result'
,
key
:
'result'
,
hideInForm
:
true
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
row
.
judgeType
==
1
?
(
<
Radio
.
Group
onChange=
{
(
e
)
=>
{
row
.
result
=
e
.
target
.
value
;
}
}
>
<
Radio
value=
{
1
}
>
正常
</
Radio
>
<
Radio
value=
{
2
}
>
异常
</
Radio
>
</
Radio
.
Group
>
)
:
(
<
InputNumber
onChange=
{
(
value
)
=>
{
row
.
result
=
value
;
}
}
/>
);
},
},
{
title
:
'下限值'
,
dataIndex
:
'lowerLimit'
,
key
:
'lowerLimit'
,
hideInForm
:
true
,
},
{
title
:
'上限值'
,
dataIndex
:
'upperLimit'
,
key
:
'upperLimit'
,
hideInForm
:
true
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
hideInForm
:
true
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
Input
onChange=
{
(
e
)
=>
{
row
.
remark
=
e
.
target
.
value
;
}
}
/>
);
},
},
];
return
[
{
title
:
'工单信息'
,
valueType
:
'split'
,
},
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
},
{
title
:
'工单状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatusName'
,
},
{
title
:
'保养计划单号'
,
dataIndex
:
'maintainNo'
,
key
:
'maintainNo'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelName'
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainTypeName'
,
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
},
{
title
:
'保养截止日期'
,
dataIndex
:
'planMaintainDate'
,
key
:
'planMaintainDate'
,
},
{
title
:
'接单时间'
,
dataIndex
:
'maintainStartTime'
,
key
:
'maintainStartTime'
,
span
:
2
,
},
{
title
:
'保养项目'
,
valueType
:
'split'
,
},
{
dataIndex
:
'itemList'
,
key
:
'itemList'
,
valueType
:
'formList'
,
columns
,
span
:
3
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
AutoTables
columns=
{
columnsc
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))
}
dataSource=
{
drawer
?.
item
?.
maintainTaskItemList
}
/>
);
},
},
];
}
}
},
[
drawer
?.
item
,
activeTabKey
]);
const
columns
=
useMemo
(()
=>
{
const
order
=
(
text
,
row
,
_
,
action
)
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
return
(
return
defcolumn
.
concat
({
<
PremButton
title
:
'操作'
,
pop=
{
{
valueType
:
'option'
,
title
:
'是否接单?'
,
width
:
150
,
okText
:
'确认'
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
cancelText
:
'取消'
,
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
onConfirm
:
async
()
=>
{
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
await
runAsync
({
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
url
:
'/maintain/umMaintainTask/orderReceiving'
,
],
params
:
{
id
:
row
?.
id
},
});
});
},
[]);
},
}
}
btn=
{
{
size
:
'small'
,
}
}
>
接单
</
PremButton
>
);
};
const
close
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否关单?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
await
runAsync
({
url
:
'/maintain/umMaintainTask/customsDeclaration'
,
params
:
{
id
:
row
?.
id
},
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
关单
</
PremButton
>
);
};
const
finish
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
doFetch
({
url
:
'/maintain/umMaintainTask/queryById'
,
params
:
{
id
:
row
.
id
},
}).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
'0000'
)
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
{
...
res
.
data
?.
data
,
id
:
row
.
id
,
},
title
:
'完成保养'
,
val
:
'detailaddon'
,
type
:
'wcby'
,
}));
}
});
},
}
}
>
完成保养
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
PremButton
<
AutoTable
pop=
{
{
pagetitle=
"保养工单"
title
:
'是否删除?'
,
columns=
{
columns
}
okText
:
'确认'
,
actionRef=
{
actionRef
}
cancelText
:
'取消'
,
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
onConfirm
:
()
=>
{
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
resizeable=
{
true
}
},
addconfig=
{
{
}
}
// access: 'sysDepartment_save',
btn=
{
{
btn
:
{
size
:
'small'
,
disabled
:
false
,
type
:
'danger'
,
onClick
:
()
=>
{
}
}
>
删除
</
PremButton
>
);
};
const
verify
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
doFetch
({
url
:
'/maintain/umMaintainTask/queryById'
,
params
:
{
id
:
row
.
id
},
}).
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
'0000'
)
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
open
:
true
,
item
:
null
,
item
:
{
title
:
'新增'
,
...
res
.
data
?.
data
,
val
:
'add'
,
id
:
row
.
id
,
},
title
:
'验证'
,
val
:
'detailaddon'
,
type
:
'yz'
,
}));
}));
},
}
},
});
}
}
},
/>
}
}
>
验证
</
PremButton
>
);
};
<
DrawerPro
const
columns
=
useMemo
(()
=>
{
fields=
{
columns
}
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
formRef=
{
formRef
}
return
activeTabKey
==
1
placement=
"right"
?
defcolumn
.
concat
({
detailpath=
{
pathconfig
?.
detail
||
null
}
title
:
'操作'
,
detailData=
{
drawer
?.
item
}
valueType
:
'option'
,
defaultFormValue=
{
drawer
?.
item
}
width
:
150
,
onClose=
{
()
=>
{
render
:
(
text
,
row
,
_
,
action
)
=>
[
setdrawer
((
s
)
=>
({
order
(
text
,
row
,
_
,
action
),
...
s
,
close
(
text
,
row
,
_
,
action
),
open
:
false
,
finish
(
text
,
row
,
_
,
action
),
}));
verify
(
text
,
row
,
_
,
action
),
],
})
:
defcolumn
;
},
[
activeTabKey
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
const
seletType
=
{
wcby
:
(
<
div
>
<
PremButton
btn=
{
{
type
:
'primary'
,
loading
,
onClick
:
()
=>
{
let
maintainTaskItemList
=
drawer
?.
item
?.
item
?.
map
((
it
)
=>
{
if
(
it
.
judgeType
==
1
)
{
return
{
id
:
it
.
id
,
remark
:
it
.
remark
,
judgeResultType
:
it
.
result
,
};
}
else
{
return
{
id
:
it
.
id
,
remark
:
it
.
remark
,
qualitativeJudgeResult
:
it
.
result
,
};
}
});
run
({
url
:
'/maintain/umMaintainTask/finishMaintainTask'
,
params
:
{
id
:
drawer
?.
item
?.
id
,
maintainTaskItemList
},
});
},
}
}
}
}
{
...
drawer
}
>
提交
</
PremButton
>
</
div
>
),
yz
:
(
<
div
>
<
Divider
/>
<
InitForm
fields=
{
[
{
title
:
'验证结果'
,
valueType
:
'select'
,
dataIndex
:
'approveStatus'
,
key
:
'approveStatus'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
options
:
[
{
value
:
'1'
,
label
:
'通过'
,
},
{
value
:
'2'
,
label
:
'不通过'
,
},
],
},
{
title
:
'备注'
,
valueType
:
'textarea'
,
dataIndex
:
'approveContent'
,
key
:
'approveContent'
,
},
]
}
onFinish=
{
(
vals
)
=>
{
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
url
:
'/maintain/umMaintainTask/verification'
,
}
else
if
(
drawer
?.
val
==
'edit'
)
{
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
},
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
});
}
}
}
}
}
/>
/>
</
div
>
</
div
>
),
};
const
DetailLine
=
()
=>
{
return
(
<>
<
DetailNode
path=
"/maintain/umMaintainTaskOperation/queryDetailList"
params=
{
{
maintainTaskId
:
drawer
?.
item
?.
id
}
}
titleColumns=
{
activeTabKey
==
3
?
[
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
},
{
title
:
'工单状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatusName'
,
},
{
title
:
'保养计划单号'
,
dataIndex
:
'maintainNo'
,
key
:
'maintainNo'
,
},
{
title
:
'关单时间'
,
dataIndex
:
'customsTime'
,
key
:
'customsTime'
,
},
]
:
[
{
title
:
'保养单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
},
{
title
:
'工单状态'
,
dataIndex
:
'taskStatusName'
,
key
:
'taskStatusName'
,
},
{
title
:
'保养计划单号'
,
dataIndex
:
'maintainNo'
,
key
:
'maintainNo'
,
},
]
}
detailKey=
"maintainTaskItemList"
columns=
{
getDetailColumns
}
/>
</>
);
);
}
};
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
保养工单
</
h3
>
}
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
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=
{
detailaddonColumns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
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
}
});
}
}
}
>
{
drawer
?.
val
==
'only'
?
(
<
DetailLine
/>
)
:
drawer
?.
val
==
'detailaddon'
?
(
seletType
[
drawer
?.
type
]
)
:
null
}
</
DrawerPro
>
</
div
>
);
}
export
default
WorkOrder
;
export
default
WorkOrder
;
\ No newline at end of file
src/pages/system/rules/index.jsx
View file @
729e1d5e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-1
1 19:37:17
* @Last Modified time: 2023-01-1
7 09:30:00
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -182,21 +182,6 @@ function Rules(props) {
...
@@ -182,21 +182,6 @@ function Rules(props) {
onFinish
:
async
(
vals
)
=>
{
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
'新增:'
,
vals
);
console
.
log
(
'新增:'
,
vals
);
let
params
=
{
...
vals
};
let
params
=
{
...
vals
};
//console.log('vals:', vals);
// for (let i in vals)
{
// if (i == 'nrList')
{
// let reshow =
{
// value: vals[i].filter((it) => it.noRuleCode != 'increasing_order'),
// other: vals[i].filter((it) => it.noRuleCode == 'increasing_order')[0] ||
{},
//
};
// reshow.other.increaseList = reshow.other.increaseList.maps((it) =>
{
// return reshow.value.filter((item) => item.sort == it)[0].id;
//
});
// reshow.other.sort =
// reshow.other.sort == 1 ? reshow.other.sort : reshow.other.sort - 1;
// //console.log('reshow', reshow);
//
}
//
}
params
.
nrList
=
[];
params
.
nrList
=
[];
params
.
nrList
=
params
.
nrList
.
concat
(
vals
?.
nrList
.
value
);
params
.
nrList
=
params
.
nrList
.
concat
(
vals
?.
nrList
.
value
);
if
(
vals
?.
nrList
.
other
.
sort
)
{
if
(
vals
?.
nrList
.
other
.
sort
)
{
...
...
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