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
d80e190e
Commit
d80e190e
authored
Feb 20, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0220
parent
a0645d02
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
669 additions
and
329 deletions
+669
-329
authRoutes.js
config/authRoutes.js
+304
-298
index.jsx
src/pages/lifeparts/count/index.jsx
+48
-15
index.jsx
src/pages/lifeparts/warning/index.jsx
+49
-16
columns.js
src/pages/spare/userecord/columns.js
+112
-0
index.jsx
src/pages/spare/userecord/index.jsx
+156
-0
No files found.
config/authRoutes.js
View file @
d80e190e
This diff is collapsed.
Click to expand it.
src/pages/lifeparts/count/index.jsx
View file @
d80e190e
...
...
@@ -36,14 +36,14 @@ function Warning(props) {
const
columns
=
[
{
title
:
'线边库'
,
dataIndex
:
's
parePartNo
'
,
key
:
's
parePartNo
'
,
dataIndex
:
's
tockName
'
,
key
:
's
tockName
'
,
editable
:
false
,
},
{
title
:
'备件料号'
,
dataIndex
:
'sparePartN
ame
'
,
key
:
'sparePartN
ame
'
,
dataIndex
:
'sparePartN
o
'
,
key
:
'sparePartN
o
'
,
span
:
3
,
editable
:
false
,
},
...
...
@@ -56,22 +56,22 @@ function Warning(props) {
},
{
title
:
'供应商编号'
,
dataIndex
:
's
parePartName
'
,
key
:
's
parePartName
'
,
dataIndex
:
's
upplierNo
'
,
key
:
's
upplierNo
'
,
span
:
3
,
editable
:
false
,
},
{
title
:
'供应商名称'
,
dataIndex
:
's
parePart
Name'
,
key
:
's
parePart
Name'
,
dataIndex
:
's
upplier
Name'
,
key
:
's
upplier
Name'
,
span
:
3
,
editable
:
false
,
},
{
title
:
'可用数量'
,
dataIndex
:
'
sparePartName
'
,
key
:
'
sparePartName
'
,
dataIndex
:
'
usedStock
'
,
key
:
'
usedStock
'
,
search
:
false
,
span
:
3
,
editable
:
false
,
...
...
@@ -83,8 +83,12 @@ function Warning(props) {
</
div
>
),
search
:
false
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
dataIndex
:
'operateNum'
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
3
,
},
key
:
'operateNum'
,
span
:
3
,
hideInForm
:
true
,
},
...
...
@@ -109,9 +113,15 @@ function Warning(props) {
columns
,
hideInSearch
:
true
,
hideInTable
:
true
,
path
:
'/sparepart/
sparePartSupplier/queryList
'
,
params
:
{
status
:
1
},
path
:
'/sparepart/
lineStock/queryReplaceStock
'
,
params
:
{
lifePieceAccountId
:
drawer
?.
item
?.
id
},
rowName
:
'supplierList'
,
rowSelection
:
{
type
:
'checkbox'
,
getCheckboxProps
:
(
record
)
=>
({
disabled
:
record
.
isAsh
==
'1'
,
}),
},
},
];
});
...
...
@@ -248,7 +258,30 @@ function Warning(props) {
}
}
}
>
<
InitForm
fields=
{
changeColumns
}
/>
<
InitForm
fields=
{
changeColumns
}
onFinish=
{
(
vals
)
=>
{
console
.
log
(
vals
);
if
(
vals
.
supplierList
?.
length
==
0
)
{
return
message
.
warning
(
'请选择线边库存数据'
);
}
const
lineStockUseList
=
vals
?.
supplierList
?.
map
((
it
)
=>
{
return
{
lineStockId
:
it
?.
id
,
operateNum
:
it
?.
operateNum
,
};
});
for
(
let
i
of
lineStockUseList
)
{
if
(
!
i
?.
operateNum
)
{
return
message
.
warning
(
'请输入线边库存更换数量'
);
}
}
run
({
url
:
'/sparepart/lifePieceAccount/replace'
,
params
:
{
lineStockUseList
,
id
:
drawer
?.
item
?.
id
},
});
}
}
/>
</
DrawerPro
>
</
div
>
);
...
...
src/pages/lifeparts/warning/index.jsx
View file @
d80e190e
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2023-02-17 13:36:11
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-
17 13:50:04
* @Last Modified time: 2023-02-
20 13:29:45
*/
import
*
as
React
from
'react'
;
...
...
@@ -40,14 +40,14 @@ function Warning(props) {
const
columns
=
[
{
title
:
'线边库'
,
dataIndex
:
's
parePartNo
'
,
key
:
's
parePartNo
'
,
dataIndex
:
's
tockName
'
,
key
:
's
tockName
'
,
editable
:
false
,
},
{
title
:
'备件料号'
,
dataIndex
:
'sparePartN
ame
'
,
key
:
'sparePartN
ame
'
,
dataIndex
:
'sparePartN
o
'
,
key
:
'sparePartN
o
'
,
span
:
3
,
editable
:
false
,
},
...
...
@@ -60,22 +60,22 @@ function Warning(props) {
},
{
title
:
'供应商编号'
,
dataIndex
:
's
parePartName
'
,
key
:
's
parePartName
'
,
dataIndex
:
's
upplierNo
'
,
key
:
's
upplierNo
'
,
span
:
3
,
editable
:
false
,
},
{
title
:
'供应商名称'
,
dataIndex
:
's
parePart
Name'
,
key
:
's
parePart
Name'
,
dataIndex
:
's
upplier
Name'
,
key
:
's
upplier
Name'
,
span
:
3
,
editable
:
false
,
},
{
title
:
'可用数量'
,
dataIndex
:
'
sparePartName
'
,
key
:
'
sparePartName
'
,
dataIndex
:
'
usedStock
'
,
key
:
'
usedStock
'
,
search
:
false
,
span
:
3
,
editable
:
false
,
...
...
@@ -87,8 +87,12 @@ function Warning(props) {
</
div
>
),
search
:
false
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
dataIndex
:
'operateNum'
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
3
,
},
key
:
'operateNum'
,
span
:
3
,
hideInForm
:
true
,
},
...
...
@@ -113,9 +117,15 @@ function Warning(props) {
columns
,
hideInSearch
:
true
,
hideInTable
:
true
,
path
:
'/sparepart/
sparePartSupplier/queryList
'
,
params
:
{
status
:
1
},
path
:
'/sparepart/
lineStock/queryReplaceStock
'
,
params
:
{
lifePieceAccountId
:
drawer
?.
item
?.
id
},
rowName
:
'supplierList'
,
rowSelection
:
{
type
:
'checkbox'
,
getCheckboxProps
:
(
record
)
=>
({
disabled
:
record
.
isAsh
==
'1'
,
}),
},
},
];
});
...
...
@@ -243,7 +253,30 @@ function Warning(props) {
}
}
}
>
<
InitForm
fields=
{
changeColumns
}
/>
<
InitForm
fields=
{
changeColumns
}
onFinish=
{
(
vals
)
=>
{
console
.
log
(
vals
);
if
(
vals
.
supplierList
?.
length
==
0
)
{
return
message
.
warning
(
'请选择线边库存数据'
);
}
const
lineStockUseList
=
vals
?.
supplierList
?.
map
((
it
)
=>
{
return
{
lineStockId
:
it
?.
id
,
operateNum
:
it
?.
operateNum
,
};
});
for
(
let
i
of
lineStockUseList
)
{
if
(
!
i
?.
operateNum
)
{
return
message
.
warning
(
'请输入线边库存更换数量'
);
}
}
run
({
url
:
'/sparepart/lifePieceAccount/replace'
,
params
:
{
lineStockUseList
,
id
:
drawer
?.
item
?.
id
},
});
}
}
/>
</
DrawerPro
>
</
div
>
);
...
...
src/pages/spare/userecord/columns.js
0 → 100644
View file @
d80e190e
function
getcolumns
(
setdrawer
)
{
return
{
columns
:
[
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
key
:
'operateTimeList'
,
valueType
:
'dateTimeRange'
,
fieldProps
:
{
showTime
:
{
format
:
'HH:mm'
,
},
format
:
'YYYY-MM-DD HH:mm'
,
},
},
{
title
:
'操作人'
,
dataIndex
:
'operateUserName'
,
key
:
'operateUserId'
,
valueType
:
'select'
,
fieldProps
:
{
dropdownMatchSelectWidth
:
120
,
showSearch
:
true
,
},
options
:
{
path
:
'/auth/sysUser/selection'
,
params
:
{},
},
hideInSearch
:
false
,
hideInTable
:
false
,
},
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
hideInSearch
:
false
,
hideInTable
:
false
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
},
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
},
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'使用数量'
,
dataIndex
:
'operateNum'
,
key
:
'operateNum'
,
search
:
false
,
},
{
title
:
'使用类型'
,
dataIndex
:
'operateTypeName'
,
key
:
'operateType'
,
valueType
:
'select'
,
fieldProps
:
{
dropdownMatchSelectWidth
:
120
,
},
options
:
[
{
value
:
'1'
,
label
:
'寿命件更换'
,
},
{
value
:
'2'
,
label
:
'维修使用'
,
},
{
value
:
'3'
,
label
:
'保养使用'
,
},
],
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/sparepart/lineStockAccess/queryList'
,
delete
:
''
,
detail
:
''
,
},
};
}
export
default
getcolumns
;
src/pages/spare/userecord/index.jsx
0 → 100644
View file @
d80e190e
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
Record
(
props
)
{
let
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
;
},
[]);
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',
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
Record
;
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