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
711de023
Commit
711de023
authored
Feb 16, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
寿命件标准和台账
parent
059d7fee
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1328 additions
and
279 deletions
+1328
-279
authRoutes.js
config/authRoutes.js
+298
-273
index.jsx
src/components/TagView/index.jsx
+0
-3
index.jsx
src/pages/device/account/index.jsx
+1
-1
columns.js
src/pages/lifeparts/count/columns.js
+182
-0
index.jsx
src/pages/lifeparts/count/index.jsx
+173
-0
columns.js
src/pages/lifeparts/criterion/columns.js
+151
-0
index.jsx
src/pages/lifeparts/criterion/index.jsx
+189
-0
columns.js
src/pages/lifeparts/warning/columns.js
+168
-0
index.jsx
src/pages/lifeparts/warning/index.jsx
+165
-0
index.jsx
src/pages/maintain/plan/index.jsx
+1
-1
request.js
src/utils/request.js
+0
-1
No files found.
config/authRoutes.js
View file @
711de023
export
default
[
{
path
:
'/welcome'
,
name
:
'首页'
,
icon
:
'smile'
,
component
:
'./Welcome'
,
"path"
:
"/welcome"
,
"name"
:
"首页"
,
"icon"
:
"smile"
,
"component"
:
"./Welcome"
},
{
name
:
'基础设置'
,
icon
:
'setting'
,
path
:
'/setting'
,
routes
:
[
"name"
:
"基础设置"
,
"icon"
:
"setting"
,
"path"
:
"/setting"
,
"routes"
:
[
{
name
:
'用户管理'
,
path
:
'/setting/users'
,
component
:
'./setting/users'
,
"name"
:
"用户管理"
,
"path"
:
"/setting/users"
,
"component"
:
"./setting/users"
},
{
name
:
'角色管理'
,
path
:
'/setting/role'
,
component
:
'./setting/role'
,
"name"
:
"角色管理"
,
"path"
:
"/setting/role"
,
"component"
:
"./setting/role"
},
{
name
:
'组织管理'
,
path
:
'/setting/organization'
,
component
:
'./setting/organization'
,
"name"
:
"组织管理"
,
"path"
:
"/setting/organization"
,
"component"
:
"./setting/organization"
},
{
name
:
'工厂管理'
,
path
:
'/setting/factory'
,
component
:
'./setting/factory'
,
"name"
:
"工厂管理"
,
"path"
:
"/setting/factory"
,
"component"
:
"./setting/factory"
},
{
name
:
'车间管理'
,
path
:
'/setting/workshop'
,
component
:
'./setting/workshop'
,
"name"
:
"车间管理"
,
"path"
:
"/setting/workshop"
,
"component"
:
"./setting/workshop"
},
{
name
:
'工段管理'
,
path
:
'/setting/section'
,
component
:
'./setting/section'
,
"name"
:
"工段管理"
,
"path"
:
"/setting/section"
,
"component"
:
"./setting/section"
},
{
name
:
'产线管理'
,
path
:
'/setting/production'
,
component
:
'./setting/production'
,
},
],
"name"
:
"产线管理"
,
"path"
:
"/setting/production"
,
"component"
:
"./setting/production"
}
]
},
{
name
:
'设备管理'
,
icon
:
'bulb'
,
path
:
'/device'
,
routes
:
[
"name"
:
"设备管理"
,
"icon"
:
"bulb"
,
"path"
:
"/device"
,
"routes"
:
[
{
name
:
'设备台账'
,
path
:
'/device/account'
,
component
:
'./device/account'
,
"name"
:
"设备台账"
,
"path"
:
"/device/account"
,
"component"
:
"./device/account"
},
{
name
:
'设备类型'
,
path
:
'/device/type'
,
component
:
'./device/type'
,
"name"
:
"设备类型"
,
"path"
:
"/device/type"
,
"component"
:
"./device/type"
},
{
name
:
'设备型号'
,
path
:
'/device/model'
,
component
:
'./device/model'
,
"name"
:
"设备型号"
,
"path"
:
"/device/model"
,
"component"
:
"./device/model"
},
{
name
:
'设备供应商'
,
path
:
'/device/supplier'
,
component
:
'./device/supplier'
,
},
],
"name"
:
"设备供应商"
,
"path"
:
"/device/supplier"
,
"component"
:
"./device/supplier"
}
]
},
{
name
:
'维修管理'
,
path
:
'/repair'
,
icon
:
'tool'
,
routes
:
[
"name"
:
"维修管理"
,
"path"
:
"/repair"
,
"icon"
:
"tool"
,
"routes"
:
[
{
name
:
'接单平台'
,
path
:
'/repair/platform'
,
icon
:
''
,
component
:
'./repair/platform'
,
"name"
:
"接单平台"
,
"path"
:
"/repair/platform"
,
"icon"
:
""
,
"component"
:
"./repair/platform"
},
{
name
:
'故障报修'
,
path
:
'/repair/failure'
,
icon
:
''
,
component
:
'./repair/failure'
,
"name"
:
"故障报修"
,
"path"
:
"/repair/failure"
,
"icon"
:
""
,
"component"
:
"./repair/failure"
},
{
name
:
'维修工单'
,
path
:
'/repair/order'
,
icon
:
''
,
component
:
'./repair/order'
,
"name"
:
"维修工单"
,
"path"
:
"/repair/order"
,
"icon"
:
""
,
"component"
:
"./repair/order"
},
{
name
:
'追踪工单'
,
path
:
'/repair/track'
,
icon
:
''
,
component
:
'./repair/track'
,
"name"
:
"追踪工单"
,
"path"
:
"/repair/track"
,
"icon"
:
""
,
"component"
:
"./repair/track"
},
{
name
:
'外协工单'
,
path
:
'/repair/outsourcing'
,
icon
:
''
,
component
:
'./repair/outsourcing'
,
"name"
:
"外协工单"
,
"path"
:
"/repair/outsourcing"
,
"icon"
:
""
,
"component"
:
"./repair/outsourcing"
},
{
name
:
'故障设置'
,
path
:
'/repair/fault'
,
icon
:
''
,
component
:
'./repair/fault'
,
},
],
"name"
:
"故障设置"
,
"path"
:
"/repair/fault"
,
"icon"
:
""
,
"component"
:
"./repair/fault"
}
]
},
{
name
:
'系统管理'
,
path
:
'/system'
,
icon
:
'desktop'
,
routes
:
[
"name"
:
"系统管理"
,
"path"
:
"/system"
,
"icon"
:
"desktop"
,
"routes"
:
[
{
name
:
'数据字典'
,
path
:
'/system/dictionary'
,
icon
:
''
,
component
:
'./system/dictionary'
,
"name"
:
"数据字典"
,
"path"
:
"/system/dictionary"
,
"icon"
:
""
,
"component"
:
"./system/dictionary"
},
{
name
:
'扩展字段'
,
path
:
'/system/field'
,
icon
:
''
,
component
:
'./system/field'
,
"name"
:
"扩展字段"
,
"path"
:
"/system/field"
,
"icon"
:
""
,
"component"
:
"./system/field"
},
{
name
:
'编号规则'
,
path
:
'/system/rules'
,
icon
:
''
,
component
:
'./system/rules'
,
"name"
:
"编号规则"
,
"path"
:
"/system/rules"
,
"icon"
:
""
,
"component"
:
"./system/rules"
},
{
name
:
'推送配置'
,
path
:
'/system/pushsetting'
,
icon
:
''
,
component
:
'./system/pushsetting'
,
},
],
"name"
:
"推送配置"
,
"path"
:
"/system/pushsetting"
,
"icon"
:
""
,
"component"
:
"./system/pushsetting"
}
]
},
{
name
:
'备件管理'
,
path
:
'/spare'
,
icon
:
'sliders'
,
routes
:
[
"name"
:
"备件管理"
,
"path"
:
"/spare"
,
"icon"
:
"sliders"
,
"routes"
:
[
{
name
:
' 备件库存'
,
path
:
'/spare/stock'
,
icon
:
''
,
component
:
'./spare/stock'
,
"name"
:
" 备件库存"
,
"path"
:
"/spare/stock"
,
"icon"
:
""
,
"component"
:
"./spare/stock"
},
{
name
:
'入库管理'
,
path
:
'/spare/instore'
,
icon
:
''
,
component
:
'./spare/instore'
,
"name"
:
"入库管理"
,
"path"
:
"/spare/instore"
,
"icon"
:
""
,
"component"
:
"./spare/instore"
},
{
name
:
'出库管理'
,
path
:
'/spare/outstore'
,
icon
:
''
,
component
:
'./spare/outstore'
,
"name"
:
"出库管理"
,
"path"
:
"/spare/outstore"
,
"icon"
:
""
,
"component"
:
"./spare/outstore"
},
{
name
:
'出入库记录'
,
path
:
'/spare/record'
,
icon
:
''
,
component
:
'./spare/record'
,
"name"
:
"出入库记录"
,
"path"
:
"/spare/record"
,
"icon"
:
""
,
"component"
:
"./spare/record"
},
{
name
:
'备件领用'
,
path
:
'/spare/requisition'
,
icon
:
''
,
component
:
'./spare/requisition'
,
"name"
:
"备件领用"
,
"path"
:
"/spare/requisition"
,
"icon"
:
""
,
"component"
:
"./spare/requisition"
},
{
name
:
'备件回冲'
,
path
:
'/spare/spareback'
,
icon
:
''
,
component
:
'./spare/spareback'
,
"name"
:
"备件回冲"
,
"path"
:
"/spare/spareback"
,
"icon"
:
""
,
"component"
:
"./spare/spareback"
},
{
name
:
' 线边库存'
,
path
:
'/spare/edgestore'
,
icon
:
''
,
component
:
'./spare/edgestore'
,
"name"
:
" 线边库存"
,
"path"
:
"/spare/edgestore"
,
"icon"
:
""
,
"component"
:
"./spare/edgestore"
},
{
name
:
'备件供应商'
,
path
:
'/spare/supplier'
,
icon
:
''
,
component
:
'./spare/supplier'
,
"name"
:
"备件供应商"
,
"path"
:
"/spare/supplier"
,
"icon"
:
""
,
"component"
:
"./spare/supplier"
},
{
name
:
' 备件设置'
,
path
:
'/spare/setting'
,
icon
:
''
,
component
:
'./spare/setting'
,
},
],
"name"
:
" 备件设置"
,
"path"
:
"/spare/setting"
,
"icon"
:
""
,
"component"
:
"./spare/setting"
}
]
},
{
name
:
'点检管理'
,
path
:
'/check'
,
icon
:
'check-circle'
,
routes
:
[
"name"
:
"点检管理"
,
"path"
:
"/check"
,
"icon"
:
"check-circle"
,
"routes"
:
[
{
name
:
' 点检标准'
,
path
:
'/check/standard'
,
icon
:
''
,
component
:
'./check/standard'
,
"name"
:
" 点检标准"
,
"path"
:
"/check/standard"
,
"icon"
:
""
,
"component"
:
"./check/standard"
},
{
name
:
'点检计划'
,
path
:
'/check/plan'
,
icon
:
''
,
component
:
'./check/plan'
,
"name"
:
"点检计划"
,
"path"
:
"/check/plan"
,
"icon"
:
""
,
"component"
:
"./check/plan"
},
{
name
:
'点检接单'
,
path
:
'/check/order'
,
icon
:
''
,
component
:
'./check/order'
,
"name"
:
"点检接单"
,
"path"
:
"/check/order"
,
"icon"
:
""
,
"component"
:
"./check/order"
},
{
name
:
'点检工单'
,
path
:
'/check/task'
,
icon
:
''
,
component
:
'./check/task'
,
},
],
"name"
:
"点检工单"
,
"path"
:
"/check/task"
,
"icon"
:
""
,
"component"
:
"./check/task"
}
]
},
{
name
:
'保养管理'
,
path
:
'/maintain'
,
icon
:
'dashboard'
,
routes
:
[
"name"
:
"保养管理"
,
"path"
:
"/maintain"
,
"icon"
:
"dashboard"
,
"routes"
:
[
{
name
:
'保养接单'
,
path
:
'/maintain/orders'
,
icon
:
''
,
component
:
'./maintain/orders'
,
"name"
:
"保养接单"
,
"path"
:
"/maintain/orders"
,
"icon"
:
""
,
"component"
:
"./maintain/orders"
},
{
name
:
'保养工单'
,
path
:
'/maintain/workOrder'
,
icon
:
''
,
component
:
'./maintain/workOrder'
,
"name"
:
"保养工单"
,
"path"
:
"/maintain/workOrder"
,
"icon"
:
""
,
"component"
:
"./maintain/workOrder"
},
{
name
:
' 保养标准'
,
path
:
'/maintain/criterion'
,
icon
:
''
,
component
:
'./maintain/criterion'
,
"name"
:
" 保养标准"
,
"path"
:
"/maintain/criterion"
,
"icon"
:
""
,
"component"
:
"./maintain/criterion"
},
{
name
:
'保养计划'
,
path
:
'/maintain/plan'
,
icon
:
''
,
component
:
'./maintain/plan'
,
"name"
:
"保养计划"
,
"path"
:
"/maintain/plan"
,
"icon"
:
""
,
"component"
:
"./maintain/plan"
}
]
},
],
{
"name"
:
"寿命件管理"
,
"path"
:
"/lifeparts"
,
"icon"
:
"control"
,
"routes"
:
[
{
"name"
:
"寿命件台账"
,
"path"
:
"/lifeparts/count"
,
"icon"
:
""
,
"component"
:
"./lifeparts/count"
},
{
"name"
:
"寿命件预警"
,
"path"
:
"/lifeparts/warning"
,
"icon"
:
""
,
"component"
:
"./lifeparts/warning"
},
{
"name"
:
"寿命件标准"
,
"path"
:
"/lifeparts/criterion"
,
"icon"
:
""
,
"component"
:
"./lifeparts/criterion"
}
]
}
];
\ No newline at end of file
src/components/TagView/index.jsx
View file @
711de023
...
...
@@ -14,7 +14,6 @@ function treeForeach(tree, func) {
}
const
TagView
=
({
children
,
home
})
=>
{
console
.
log
(
children
,
home
);
const
[
tagList
,
setTagList
]
=
useState
([]);
const
[
currentPath
,
setCurrentPath
]
=
useState
();
...
...
@@ -64,7 +63,6 @@ const TagView = ({ children, home }) => {
}
// 判断是否已打开过该页面
let
hasOpen
=
false
;
console
.
log
(
'routeContext'
,
routeContext
,
'tagList'
,
tagList
);
if
(
currentMenu
.
path
)
{
const
tagsCopy
=
tagList
.
map
((
item
)
=>
{
if
(
currentMenu
?.
path
===
item
.
path
)
{
...
...
@@ -140,7 +138,6 @@ const TagView = ({ children, home }) => {
setrefresh
(
true
);
};
console
.
log
(
tagList
);
return
(
<>
<
RouteContext
.
Consumer
>
...
...
src/pages/device/account/index.jsx
View file @
711de023
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-1
5 10:50:14
* @Last Modified time: 2023-02-1
6 17:23:15
*/
import
*
as
React
from
'react'
;
...
...
src/pages/lifeparts/count/columns.js
0 → 100644
View file @
711de023
import
dayjs
from
'dayjs'
;
function
getcolumns
(
setdrawer
)
{
const
disabledDateOfDay
=
(
current
)
=>
{
// Can not select days before today and today
return
current
&&
current
<
dayjs
().
endOf
(
'day'
);
};
return
{
columns
:
[
{
dataIndex
:
'equipmentNo'
,
valueType
:
'input'
,
title
:
'设备编号'
,
key
:
'equipmentNo'
,
hideInForm
:
true
,
},
{
dataIndex
:
'equipmentName'
,
valueType
:
'input'
,
title
:
'设备名称'
,
key
:
'equipmentName'
,
hideInForm
:
true
,
},
{
dataIndex
:
'installPosition'
,
valueType
:
'input'
,
title
:
'安装部位'
,
key
:
'installPosition'
,
hideInForm
:
true
,
},
{
dataIndex
:
'sparePartNo'
,
valueType
:
'input'
,
title
:
'备件料号'
,
key
:
'sparePartNo'
,
hideInForm
:
true
,
},
{
dataIndex
:
'sparePartName'
,
valueType
:
'input'
,
title
:
'备件名称'
,
key
:
'sparePartName'
,
hideInForm
:
true
,
},
{
dataIndex
:
'supplierNo'
,
valueType
:
'input'
,
title
:
'供应商编号'
,
key
:
'supplierNo'
,
hideInForm
:
true
,
},
{
dataIndex
:
'supplierName'
,
valueType
:
'input'
,
title
:
'供应商名称'
,
key
:
'supplierName'
,
hideInForm
:
true
,
},
{
dataIndex
:
'equipmentId'
,
valueType
:
'select'
,
title
:
'选择设备'
,
key
:
'equipmentId'
,
hideInDescriptions
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
mode
:
'radio'
,
options
:
{
path
:
'/asset/equipment/selection/user/shop'
,
params
:
{},
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
dataIndex
:
'lifePieceStandardId'
,
valueType
:
'select'
,
title
:
'选择部位-寿命件'
,
key
:
'lifePieceStandardId'
,
hideInDescriptions
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
mode
:
'radio'
,
options
:
{
path
:
'/sparepart/lifePieceStandard/querySelectByEquipmentId'
,
linkParams
:
{
equipmentId
:
''
},
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
dataIndex
:
'supplierId'
,
valueType
:
'select'
,
title
:
'选择供应商'
,
key
:
'supplierId'
,
hideInDescriptions
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
mode
:
'radio'
,
options
:
{
path
:
'/sparepart/sparePartSupplier/queryOnSelect'
,
params
:
{},
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
dataIndex
:
'installNum'
,
valueType
:
'digit'
,
searchValueType
:
'input'
,
title
:
'安装数量'
,
key
:
'installNum'
,
hideInDescriptions
:
true
,
hideInSearch
:
false
,
hideInTable
:
false
,
fieldProps
:
{
precision
:
0
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
dataIndex
:
'nextReplaceDate'
,
title
:
'下次更换日期'
,
valueType
:
'date'
,
key
:
'nextReplaceDateList'
,
fieldProps
:
{
disabledDate
:
disabledDateOfDay
,
},
searchValueType
:
'dateRange'
,
hideInSearch
:
false
,
hideInTable
:
false
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
false
,
add
:
'/sparepart/lifePieceAccount/initialization'
,
edit
:
'/sparepart/lifePieceAccount/initialization'
,
list
:
'/sparepart/lifePieceAccount/queryWarning'
,
delete
:
'/sparepart/lifePieceAccount/deleteById'
,
detail
:
''
,
},
};
}
export
default
getcolumns
;
src/pages/lifeparts/count/index.jsx
0 → 100644
View file @
711de023
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'
;
import
InitForm
from
'@/components/InitForm'
;
function
Warning
(
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
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
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
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'detailaddon'
,
}));
},
}
}
>
更换
</
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=
{
<
h3
className=
"page-title"
>
寿命件台账
</
h3
>
}
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
addconfig=
{
{
// access: 'sysDepartment_save',
name
:
'初始化寿命件'
,
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
/>
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
const
params
=
{
...
vals
};
params
.
nextReplaceDate
=
params
.
nextReplaceDateList
;
delete
params
.
nextReplaceDateList
;
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
>
<
InitForm
/>
</
DrawerPro
>
</
div
>
);
}
export
default
Warning
;
src/pages/lifeparts/criterion/columns.js
0 → 100644
View file @
711de023
import
AutoTable
from
'@/components/AutoTable/mtable'
;
function
getcolumns
(
setdrawer
)
{
const
columns
=
[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
editable
:
false
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
editable
:
false
,
},
{
title
:
'更换周期(天)'
,
dataIndex
:
'replaceCycle'
,
key
:
'replaceCycle'
,
hideInSearch
:
true
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
0
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
];
return
{
columns
:
[
{
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelId'
,
colProps
:
{
span
:
8
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
valueType
:
'select'
,
mode
:
'radio'
,
fieldProps
:
{
showSearch
:
true
,
dropdownMatchSelectWidth
:
100
,
},
options
:
{
path
:
'/asset/equipmentModel/query/selection'
,
params
:
{},
},
},
{
title
:
'安装部位'
,
dataIndex
:
'installPosition'
,
colProps
:
{
span
:
8
,
},
key
:
'installPosition'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
dataIndex
:
'sparePartId'
,
valueType
:
'select'
,
title
:
'选择寿命件'
,
colProps
:
{
span
:
8
,
},
key
:
'sparePartId'
,
hideInDescriptions
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
options
:
{
path
:
'/sparepart/sparePart/queryLifeSelect'
,
params
:
{},
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
hideInForm
:
true
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
span
:
3
,
hideInForm
:
true
,
},
{
title
:
'备件更换周期'
,
dataIndex
:
'supplierList'
,
key
:
'supplierList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
span
:
3
,
columns
,
hideInSearch
:
true
,
hideInTable
:
true
,
path
:
'/sparepart/sparePartSupplier/queryList'
,
params
:
{
status
:
1
},
rowName
:
'supplierList'
,
render
:
(
text
,
row
)
=>
{
console
.
log
(
row
);
return
<
AutoTable
columns
=
{
columns
}
dataSource
=
{
row
?.
supplierList
}
/>
;
},
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
'/sparepart/lifePieceStandard/save'
,
edit
:
'/sparepart/lifePieceStandard/save'
,
list
:
'/sparepart/lifePieceStandard/queryList'
,
delete
:
'/sparepart/lifePieceStandard/deleteById'
,
detail
:
'/sparepart/lifePieceStandard/queryDetails'
,
},
};
}
export
default
getcolumns
;
src/pages/lifeparts/criterion/index.jsx
0 → 100644
View file @
711de023
/* 寿命件标准
* @Author: Li Hanlin
* @Date: 2023-02-16 10:36:53
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-16 13:57:46
*/
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'
;
import
{
message
}
from
'antd'
;
function
Criterion
(
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
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
message
.
success
(
'操作成功!'
,
1
);
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
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
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
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=
{
<
h3
className=
"page-title"
>
寿命件标准
</
h3
>
}
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
addconfig=
{
{
name
:
'新增标准'
,
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
/>
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
// detailData={drawer?.item}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
const
params
=
{
...
vals
};
params
.
supplierList
=
params
?.
supplierList
?.
map
((
it
)
=>
{
return
{
supplierId
:
it
?.
id
,
replaceCycle
:
it
?.
replaceCycle
,
};
});
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
const
params
=
{
...
vals
};
params
.
supplierList
=
params
?.
supplierList
?.
map
((
it
)
=>
{
return
{
supplierId
:
it
?.
id
,
replaceCycle
:
it
?.
replaceCycle
,
};
});
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
params
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
</
div
>
);
}
export
default
Criterion
;
src/pages/lifeparts/warning/columns.js
0 → 100644
View file @
711de023
function
getcolumns
(
setdrawer
)
{
return
{
"columns"
:
[
{
"dataIndex"
:
"equipmentNo"
,
"valueType"
:
"input"
,
"title"
:
"设备编号"
,
"key"
:
"equipmentNo"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"equipmentName"
,
"valueType"
:
"input"
,
"title"
:
"设备名称"
,
"key"
:
"equipmentName"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"installPosition"
,
"valueType"
:
"input"
,
"title"
:
"安装部位"
,
"key"
:
"installPosition"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"sparePartNo"
,
"valueType"
:
"input"
,
"title"
:
"备件料号"
,
"key"
:
"sparePartNo"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"sparePartName"
,
"valueType"
:
"input"
,
"title"
:
"备件名称"
,
"key"
:
"sparePartName"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"supplierNo"
,
"valueType"
:
"input"
,
"title"
:
"供应商编号"
,
"key"
:
"supplierNo"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"supplierName"
,
"valueType"
:
"input"
,
"title"
:
"供应商名称"
,
"key"
:
"supplierName"
,
"hideInForm"
:
true
},
{
"dataIndex"
:
"equipmentId"
,
"valueType"
:
"select"
,
"title"
:
"选择设备"
,
"key"
:
"equipmentId"
,
"hideInDescriptions"
:
true
,
"hideInSearch"
:
true
,
"hideInTable"
:
true
,
"mode"
:
"radio"
,
"options"
:
{
"path"
:
"/asset/equipment/selection/user/shop"
,
"params"
:
{}
},
"formItemProps"
:
{
"rules"
:
[
{
"required"
:
true
,
"message"
:
"此项为必填项"
}
]
}
},
{
"dataIndex"
:
"lifePieceStandardId"
,
"valueType"
:
"select"
,
"title"
:
"选择部位-寿命件"
,
"key"
:
"lifePieceStandardId"
,
"hideInDescriptions"
:
true
,
"hideInSearch"
:
true
,
"hideInTable"
:
true
,
"mode"
:
"radio"
,
"options"
:
{
"path"
:
"/sparepart/lifePieceStandard/querySelectByEquipmentId"
,
"linkParams"
:
{}
},
"formItemProps"
:
{
"rules"
:
[
{
"required"
:
true
,
"message"
:
"此项为必填项"
}
]
}
},
{
"dataIndex"
:
"supplierId"
,
"valueType"
:
"select"
,
"title"
:
"选择供应商"
,
"key"
:
"supplierId"
,
"hideInDescriptions"
:
true
,
"hideInSearch"
:
true
,
"hideInTable"
:
true
,
"mode"
:
"radio"
,
"options"
:
{
"path"
:
"/sparepart/sparePartSupplier/queryOnSelect"
,
"params"
:
{}
},
"formItemProps"
:
{
"rules"
:
[
{
"required"
:
true
,
"message"
:
"此项为必填项"
}
]
}
},
{
"dataIndex"
:
"installNum"
,
"valueType"
:
"digit"
,
"title"
:
"安装数量"
,
"key"
:
"installNum"
,
"hideInDescriptions"
:
true
,
"hideInSearch"
:
false
,
"hideInTable"
:
false
,
"formItemProps"
:
{
"rules"
:
[
{
"required"
:
true
,
"message"
:
"此项为必填项"
}
]
}
},
{
"dataIndex"
:
"nextReplaceDate"
,
"valueType"
:
"date"
,
"title"
:
"下次更换日期"
,
"key"
:
"nextReplaceDateList"
,
"hideInDescriptions"
:
true
,
"hideInSearch"
:
false
,
"hideInTable"
:
false
,
"formItemProps"
:
{
"rules"
:
[
{
"required"
:
true
,
"message"
:
"此项为必填项"
}
]
}
}
],
"pathconfig"
:
{
"enableadd"
:
true
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
"/sparepart/lifePieceAccount/initialization"
,
"edit"
:
""
,
"list"
:
"/sparepart/lifePieceAccount/queryWarning"
,
"delete"
:
""
,
"detail"
:
""
}
};
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/lifeparts/warning/index.jsx
0 → 100644
View file @
711de023
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
Warning
(
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
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
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
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
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=
{
<
h3
className=
"page-title"
>
寿命件预警
</
h3
>
}
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
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
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
}
});
}
}
}
/>
</
div
>
);
}
export
default
Warning
;
src/pages/maintain/plan/index.jsx
View file @
711de023
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2023-01-16 15:35:00
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-
09 19:53:33
* @Last Modified time: 2023-02-
16 17:45:48
*/
import
*
as
React
from
'react'
;
...
...
src/utils/request.js
View file @
711de023
...
...
@@ -27,7 +27,6 @@ const codeMessage = {
/* 异常处理程序*/
const
errorHandler
=
(
error
)
=>
{
console
.
log
(
error
);
const
{
response
}
=
error
;
if
(
response
&&
response
.
status
)
{
const
errorText
=
codeMessage
[
response
.
status
]
||
response
.
statusText
;
...
...
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