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
fdf2eab8
Commit
fdf2eab8
authored
Dec 30, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
9c552251
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
936 additions
and
206 deletions
+936
-206
authRoutes.js
config/authRoutes.js
+6
-0
proxy.js
config/proxy.js
+1
-1
mtable.jsx
src/components/AutoTable/mtable.jsx
+11
-7
index.jsx
src/components/DrawerPro/index.jsx
+9
-2
index.jsx
src/components/InitForm/index.jsx
+2
-1
columns.js
src/pages/spare/edgestore/columns.js
+43
-41
index.jsx
src/pages/spare/edgestore/index.jsx
+144
-154
columns.js
src/pages/spare/outstore/columns.js
+42
-0
columns.js
src/pages/spare/requisition/columns.js
+450
-0
index.jsx
src/pages/spare/requisition/index.jsx
+228
-0
No files found.
config/authRoutes.js
View file @
fdf2eab8
...
@@ -200,6 +200,12 @@ export default [
...
@@ -200,6 +200,12 @@ export default [
"path"
:
"/spare/setting"
,
"path"
:
"/spare/setting"
,
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./spare/setting"
"component"
:
"./spare/setting"
},
{
"name"
:
"备件领用"
,
"path"
:
"/spare/requisition"
,
"icon"
:
""
,
"component"
:
"./spare/requisition"
}
}
]
]
}
}
...
...
config/proxy.js
View file @
fdf2eab8
...
@@ -13,7 +13,7 @@ export default {
...
@@ -13,7 +13,7 @@ export default {
dev
:
{
dev
:
{
[
defaultSetting
.
proxypath
]:
{
[
defaultSetting
.
proxypath
]:
{
// 要代理的地址
// 要代理的地址
target
:
'http://192.168.40.64:2800
1
'
,
//jf哥
target
:
'http://192.168.40.64:2800
0
'
,
//jf哥
// target: 'http://192.168.40.203:8000', //dj哥
// target: 'http://192.168.40.203:8000', //dj哥
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
...
...
src/components/AutoTable/mtable.jsx
View file @
fdf2eab8
...
@@ -403,13 +403,17 @@ const Mtable = (props) => {
...
@@ -403,13 +403,17 @@ const Mtable = (props) => {
}
}
:
{}
:
{}
}
}
pagination=
{
{
pagination=
{
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
pagination
showQuickJumper
:
true
,
?
{
showSizeChanger
:
true
,
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
showQuickJumper
:
true
,
defaultPageSize
:
pageSize
||
15
,
showSizeChanger
:
true
,
}
}
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
defaultPageSize
:
pageSize
||
15
,
}
:
false
}
search=
{
{
search=
{
{
filterType
:
'light'
,
//轻量模式
filterType
:
'light'
,
//轻量模式
}
}
}
}
...
...
src/components/DrawerPro/index.jsx
View file @
fdf2eab8
...
@@ -26,12 +26,19 @@ function DrawerPro(props) {
...
@@ -26,12 +26,19 @@ function DrawerPro(props) {
destroyOnClose=
{
true
}
destroyOnClose=
{
true
}
{
...
props
}
{
...
props
}
>
>
{
props
.
val
==
'only'
&&
props
.
children
}
{
props
.
val
==
'only'
?
(
{
props
.
val
==
'only'
?
null
:
props
.
val
==
'detail'
?
(
props
.
children
)
:
props
.
val
==
'detail'
?
(
<
DetailPro
{
...
detailprops
}
/>
<
DetailPro
{
...
detailprops
}
/>
)
:
props
.
val
==
'detailaddon'
?
(
<
div
>
<
DetailPro
{
...
detailprops
}
/>
{
props
?.
children
}
</
div
>
)
:
(
)
:
(
<
InitForm
{
...
newProps
}
/>
<
InitForm
{
...
newProps
}
/>
)
}
)
}
{
pushSettingFlag
?
(
{
pushSettingFlag
?
(
<
a
<
a
id=
"pushSettingBtn"
id=
"pushSettingBtn"
...
...
src/components/InitForm/index.jsx
View file @
fdf2eab8
...
@@ -102,13 +102,14 @@ function InitForm(props) {
...
@@ -102,13 +102,14 @@ function InitForm(props) {
//console.log(changedValues, allValues);
//console.log(changedValues, allValues);
},
},
val
,
val
,
style
=
{},
}
=
props
;
}
=
props
;
let
proformRef
=
useRef
();
let
proformRef
=
useRef
();
proformRef
=
formRef
??
proformRef
;
proformRef
=
formRef
??
proformRef
;
return
(
return
(
<
ProForm
<
ProForm
style=
{
{
overflow
:
'hidden'
}
}
style=
{
{
overflow
:
'hidden'
,
...
style
}
}
formRef=
{
proformRef
}
formRef=
{
proformRef
}
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
formKey=
{
formKey
??
parseInt
(
Math
.
random
()
*
1000000
)
}
formKey=
{
formKey
??
parseInt
(
Math
.
random
()
*
1000000
)
}
...
...
src/pages/spare/edgestore/columns.js
View file @
fdf2eab8
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
{
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
"columns"
:
[
"columns"
:
[
{
{
"title"
:
"
维修单号
"
,
"title"
:
"
线边库名称
"
,
"dataIndex"
:
"
repairOrderNo
"
,
"dataIndex"
:
"
stockName
"
,
"key"
:
"
repairOrderNo
"
"key"
:
"
stockName
"
},
},
{
{
"title"
:
"
设备编
号"
,
"title"
:
"
备件料
号"
,
"dataIndex"
:
"
equipmen
tNo"
,
"dataIndex"
:
"
sparePar
tNo"
,
"key"
:
"
equipmen
tNo"
"key"
:
"
sparePar
tNo"
},
},
{
{
"title"
:
"
设备
名称"
,
"title"
:
"
备件
名称"
,
"dataIndex"
:
"
equipmen
tName"
,
"dataIndex"
:
"
sparePar
tName"
,
"key"
:
"
equipmen
tName"
"key"
:
"
sparePar
tName"
},
},
{
{
"title"
:
"
故障描述
"
,
"title"
:
"
供应商编号
"
,
"dataIndex"
:
"
faultDescription
"
,
"dataIndex"
:
"
supplierNo
"
,
"key"
:
"
faultDescription
"
"key"
:
"
supplierNo
"
},
},
{
{
"title"
:
"
报修人员
"
,
"title"
:
"
供应商名称
"
,
"dataIndex"
:
"
repairUs
erName"
,
"dataIndex"
:
"
suppli
erName"
,
"key"
:
"
repairUs
erName"
"key"
:
"
suppli
erName"
},
},
{
{
"title"
:
"
报修时间
"
,
"title"
:
"
持有数量
"
,
"dataIndex"
:
"
repairTime
"
,
"dataIndex"
:
"
actualStock
"
,
"key"
:
"
repairTimeList
"
,
"key"
:
"
actualStock
"
,
"
valueType"
:
"dateTimeRange"
"
hideInSearch"
:
true
},
},
{
{
"title"
:
"报修单号"
,
"title"
:
"可用数量"
,
"dataIndex"
:
"repairNo"
,
"dataIndex"
:
"usedStock"
,
"key"
:
"repairNo"
"key"
:
"usedStock"
,
"hideInSearch"
:
true
},
},
{
{
"title"
:
"工单状态"
,
"title"
:
"库存单位"
,
"dataIndex"
:
"statusName"
,
"dataIndex"
:
"unit"
,
"key"
:
"statusName"
"key"
:
"unit"
,
"hideInSearch"
:
true
}
}
]
],
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/sparepart/lineStock/queryList"
,
"delete"
:
""
,
"detail"
:
""
}
};
};
}
}
export
default
getcolumns
;
export
default
getcolumns
;
\ No newline at end of file
\ No newline at end of file
src/pages/spare/edgestore/index.jsx
View file @
fdf2eab8
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'
;
function
Edgestore
(
props
)
{
function
Edgestore
(
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
(()
=>
{
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
return
pathconf
;
},
[]);
},
[]);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
false
,
}));
}));
}
}
},
},
});
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
type
:
'link'
,
type
:
'link'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
open
:
true
,
item
:
row
,
item
:
row
,
title
:
'详情'
,
title
:
'详情'
,
val
:
'detail'
,
val
:
'detail'
,
title
:
'详细信息'
,
title
:
'详细信息'
,
}));
}));
},
},
}
}
}
}
>
>
详情
详情
</
PremButton
>
</
PremButton
>
);
);
};
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
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=
" 线边库存"
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
)
=>
{
<
DrawerPro
return
(
fields=
{
columns
}
<
PremButton
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
pop=
{
{
formRef=
{
formRef
}
title
:
'是否删除?'
,
placement=
"right"
okText
:
'确认'
,
detailpath=
{
pathconfig
?.
detail
||
null
}
cancelText
:
'取消'
,
detailData=
{
drawer
?.
item
}
onConfirm
:
()
=>
{
defaultFormValue=
{
drawer
?.
item
}
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
onClose=
{
()
=>
{
},
setdrawer
((
s
)
=>
({
}
}
...
s
,
btn=
{
{
open
:
false
,
size
:
'small'
,
}));
type
:
'danger'
,
}
}
}
}
{
...
drawer
}
>
onFinish=
{
(
vals
)
=>
{
删除
if
(
drawer
?.
val
==
'add'
)
{
</
PremButton
>
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
);
}
else
if
(
drawer
?.
val
==
'edit'
)
{
};
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
const
columns
=
useMemo
(()
=>
{
}
}
let
defcolumn
=
getcolumns
(
setdrawer
)?.
columns
;
/>
return
defcolumn
.
concat
({
</
div
>
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
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
Edgestore
;
export
default
Edgestore
;
\ No newline at end of file
src/pages/spare/outstore/columns.js
View file @
fdf2eab8
import
AutoTable
from
'@/components/AutoTable/mtable'
;
import
AutoTable
from
'@/components/AutoTable/mtable'
;
function
ExtraTable
({
dataSource
})
{
return
(
<
div
style
=
{{
padding
:
'4px 4px 4px 36px'
}}
>
<
AutoTable
dataSource
=
{
dataSource
}
pagination
=
{
false
}
resizeable
=
{
false
}
columns
=
{[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
width
:
200
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
width
:
200
},
{
title
:
'库存数量'
,
dataIndex
:
'actualStock'
,
key
:
'actualStock'
,
hideInSearch
:
true
,
width
:
200
,
},
{
title
:
'下架数量'
,
dataIndex
:
'operateNum'
,
key
:
'operateNum'
,
hideInSearch
:
true
},
]}
/
>
<
/div
>
);
}
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
const
columns
=
[
const
columns
=
[
{
{
...
@@ -7,12 +31,14 @@ function getcolumns(setdrawer) {
...
@@ -7,12 +31,14 @@ function getcolumns(setdrawer) {
dataIndex
:
'sparePartNo'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
key
:
'sparePartNo'
,
editable
:
false
,
editable
:
false
,
width
:
235
,
},
},
{
{
title
:
'备件名称'
,
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
key
:
'sparePartName'
,
editable
:
false
,
editable
:
false
,
width
:
200
,
},
},
{
{
title
:
'可用库存'
,
title
:
'可用库存'
,
...
@@ -20,6 +46,7 @@ function getcolumns(setdrawer) {
...
@@ -20,6 +46,7 @@ function getcolumns(setdrawer) {
key
:
'usedStock'
,
key
:
'usedStock'
,
editable
:
false
,
editable
:
false
,
hideInSearch
:
true
,
hideInSearch
:
true
,
width
:
200
,
},
},
{
{
title
:
'出库数量'
,
title
:
'出库数量'
,
...
@@ -30,6 +57,7 @@ function getcolumns(setdrawer) {
...
@@ -30,6 +57,7 @@ function getcolumns(setdrawer) {
fieldProps
:
{
fieldProps
:
{
precision
:
3
,
precision
:
3
,
},
},
width
:
200
,
},
},
{
{
title
:
'库存单位'
,
title
:
'库存单位'
,
...
@@ -167,6 +195,7 @@ function getcolumns(setdrawer) {
...
@@ -167,6 +195,7 @@ function getcolumns(setdrawer) {
path
:
'/sparepart/spareStock/queryByOperate'
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInTable
:
true
,
rowName
:
'sparePartName'
,
render
:
(
text
,
row
)
=>
{
render
:
(
text
,
row
)
=>
{
return
(
return
(
<
AutoTable
<
AutoTable
...
@@ -175,6 +204,12 @@ function getcolumns(setdrawer) {
...
@@ -175,6 +204,12 @@ function getcolumns(setdrawer) {
hideInSearch
:
true
,
hideInSearch
:
true
,
}))}
}))}
dataSource
=
{
row
?.
taskSpareList
}
dataSource
=
{
row
?.
taskSpareList
}
resizeable
=
{
false
}
expandable
=
{{
expandedRowRender
:
(
record
)
=>
(
<
ExtraTable
dataSource
=
{
record
?.
taskSpareSupplierList
??
[]}
/
>
),
}}
/
>
/
>
);
);
},
},
...
@@ -330,6 +365,7 @@ function getcolumns(setdrawer) {
...
@@ -330,6 +365,7 @@ function getcolumns(setdrawer) {
path
:
'/sparepart/spareStock/queryByOperate'
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInTable
:
true
,
rowName
:
'sparePartName'
,
render
:
(
text
,
row
)
=>
{
render
:
(
text
,
row
)
=>
{
return
(
return
(
<
AutoTable
<
AutoTable
...
@@ -337,7 +373,13 @@ function getcolumns(setdrawer) {
...
@@ -337,7 +373,13 @@ function getcolumns(setdrawer) {
...
it
,
...
it
,
hideInSearch
:
true
,
hideInSearch
:
true
,
}))}
}))}
resizeable
=
{
false
}
dataSource
=
{
row
?.
taskSpareList
}
dataSource
=
{
row
?.
taskSpareList
}
expandable
=
{{
expandedRowRender
:
(
record
)
=>
(
<
ExtraTable
dataSource
=
{
record
?.
taskSpareSupplierList
??
[]}
/
>
),
}}
/
>
/
>
);
);
},
},
...
...
src/pages/spare/requisition/columns.js
0 → 100644
View file @
fdf2eab8
import
AutoTable
from
'@/components/AutoTable/mtable'
;
function
getcolumns
(
type
)
{
const
columns
=
[
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
editable
:
false
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
editable
:
false
,
},
{
title
:
'可用库存'
,
dataIndex
:
'usedStock'
,
key
:
'usedStock'
,
editable
:
false
,
hideInSearch
:
true
,
},
{
title
:
'申请数量'
,
dataIndex
:
'operateNum'
,
key
:
'operateNum'
,
hideInSearch
:
true
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
3
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'库存单位'
,
dataIndex
:
'unit'
,
editable
:
false
,
hideInSearch
:
true
,
},
];
return
[
{
tab
:
'未完成'
,
key
:
'1'
,
columns
:
[
{
title
:
'领用单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'申请原因'
,
dataIndex
:
'applyReasonName'
,
key
:
'applyReason'
,
valueType
:
'select'
,
options
:
[
{
label
:
'备库领用'
,
value
:
1
,
},
{
label
:
'维修领用'
,
value
:
2
,
},
{
label
:
'保养领用'
,
value
:
3
,
},
{
label
:
'点检领用'
,
value
:
4
,
},
],
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getUserShopSelection'
,
params
:
{},
},
hideInForm
:
type
==
1
,
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
createTime
}
<
/span>
;
},
hideInForm
:
true
,
},
{
title
:
'出库单号'
,
dataIndex
:
'outWarehouseTaskNo'
,
key
:
'outWarehouseTaskNo'
,
hideInForm
:
true
,
},
{
dataIndex
:
'remark'
,
valueType
:
'textarea'
,
title
:
'备注'
,
key
:
'remark'
,
colProps
:
{
span
:
24
,
},
hideInTable
:
true
,
hideInSearch
:
true
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
hideInForm
:
true
,
valueType
:
'select'
,
options
:
[
{
label
:
'待审批'
,
value
:
1
,
},
{
label
:
'出库中'
,
value
:
2
,
},
],
},
{
title
:
'备件信息'
,
dataIndex
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
},
{
title
:
'备件'
,
dataIndex
:
'detailsList'
,
key
:
'detailsList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInTable
:
true
,
rowName
:
'sparePartName'
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
detailsList
}
/
>
);
},
},
{
title
:
'审批信息'
,
dataIndex
:
'cdetails'
,
key
:
'cdetails'
,
valueType
:
'split'
,
hideInForm
:
true
,
},
{
title
:
'审批人'
,
dataIndex
:
'approvalUserName'
,
key
:
'approvalUserName'
,
hideInTable
:
true
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'审批时间'
,
dataIndex
:
'approvalTime'
,
key
:
'approvalTime'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'审批结果'
,
dataIndex
:
'approvalResultName'
,
key
:
'approvalResultName'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'审批备注'
,
dataIndex
:
'approvalRemark'
,
key
:
'approvalRemark'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
'/sparepart/spareApplyTask/save'
,
edit
:
''
,
list
:
'/sparepart/spareApplyTask/queryNoComplete'
,
delete
:
'/sparepart/spareApplyTask/deleteById'
,
detail
:
'/sparepart/spareApplyTask/queryDetails'
,
},
},
{
tab
:
'已完成'
,
key
:
'2'
,
columns
:
[
{
title
:
'领用单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'申请原因'
,
dataIndex
:
'applyReasonName'
,
key
:
'applyReason'
,
valueType
:
'select'
,
options
:
[
{
label
:
'备库领用'
,
value
:
1
,
},
{
label
:
'维修领用'
,
value
:
2
,
},
{
label
:
'保养领用'
,
value
:
3
,
},
{
label
:
'点检领用'
,
value
:
4
,
},
],
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getUserShopSelection'
,
params
:
{},
},
hideInForm
:
type
==
1
,
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
createTime
}
<
/span>
;
},
hideInForm
:
true
,
},
{
title
:
'完成时间'
,
dataIndex
:
'completeTime'
,
key
:
'completeTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
completeTime
}
<
/span>
;
},
hideInForm
:
true
,
},
{
title
:
'出库单号'
,
dataIndex
:
'outWarehouseTaskNo'
,
key
:
'outWarehouseTaskNo'
,
hideInForm
:
true
,
},
{
dataIndex
:
'remark'
,
valueType
:
'textarea'
,
title
:
'备注'
,
key
:
'remark'
,
colProps
:
{
span
:
24
,
},
hideInTable
:
true
,
hideInSearch
:
true
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
hideInForm
:
true
,
valueType
:
'select'
,
options
:
[
{
label
:
'已驳回'
,
value
:
3
,
},
{
label
:
'处理失败 '
,
value
:
4
,
},
{
label
:
'已完成'
,
value
:
5
,
},
],
},
{
title
:
'备件信息'
,
dataIndex
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
hideInForm
:
true
,
},
{
title
:
'备件'
,
dataIndex
:
'detailsList'
,
key
:
'detailsList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInTable
:
true
,
rowName
:
'sparePartName'
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
detailsList
}
/
>
);
},
},
{
title
:
'审批信息'
,
dataIndex
:
'cdetails'
,
key
:
'cdetails'
,
valueType
:
'split'
,
},
{
title
:
'审批人'
,
dataIndex
:
'approvalUserName'
,
key
:
'approvalUserName'
,
hideInTable
:
true
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'审批时间'
,
dataIndex
:
'approvalTime'
,
key
:
'approvalTime'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'审批结果'
,
dataIndex
:
'approvalResultName'
,
key
:
'approvalResultName'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'审批备注'
,
dataIndex
:
'approvalRemark'
,
key
:
'approvalRemark'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
true
,
add
:
'/sparepart/spareApplyTask/save'
,
edit
:
''
,
list
:
'/sparepart/spareApplyTask/queryYesComplete'
,
delete
:
''
,
detail
:
'/sparepart/spareApplyTask/queryDetails'
,
},
},
];
}
export
default
getcolumns
;
src/pages/spare/requisition/index.jsx
0 → 100644
View file @
fdf2eab8
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'
;
import
{
message
,
Divider
}
from
'antd'
;
function
Requisition
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
message
.
success
(
'操作成功'
);
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'
,
disabled
:
row
.
status
==
2
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'审批'
,
val
:
'detailaddon'
,
addon
:
(
<>
<
InitForm
style=
{
{
background
:
'#f0f0f0'
,
padding
:
12
,
borderTop
:
'#1890ff solid 1px'
}
}
fields=
{
[
{
title
:
'审批结果'
,
dataIndex
:
'approvalResult'
,
key
:
'approvalResult'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'radio'
,
options
:
[
{
label
:
'通过'
,
value
:
'1'
},
{
label
:
'不通过'
,
value
:
'2'
},
],
},
{
title
:
'审批备注'
,
dataIndex
:
'approvalRemark'
,
key
:
'approvalRemark'
,
valueType
:
'textarea'
,
colProps
:
{
span
:
24
},
},
]
}
onFinish=
{
(
vals
)
=>
{
run
({
url
:
'/sparepart/spareApplyTask/approval'
,
params
:
{
...
vals
,
id
:
row
?.
id
},
});
}
}
/>
</>
),
}));
},
}
}
>
审批
</
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
(
drawer
?.
type
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
drawer
?.
type
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[
activeTabKey
,
drawer
?.
type
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"备件领用"
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
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/base/pmBaseBusinessData/querySpareStockType'
,
params
:
{},
});
let
type
=
res
?.
data
?.
data
?.
type
;
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
type
,
}));
},
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
<
DrawerPro
fields=
{
columns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
defaultFormValue=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
const
detailsList
=
vals
?.
detailsList
?.
map
?.((
it
,
i
)
=>
{
return
{
spareStockId
:
it
?.
id
,
operateNum
:
it
?.
operateNum
,
};
});
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
,
detailsList
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
,
detailsList
},
});
}
}
}
>
{
drawer
?.
addon
}
</
DrawerPro
>
</
div
>
);
}
export
default
Requisition
;
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