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
3fa0c1b1
Commit
3fa0c1b1
authored
Dec 30, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
d5684962
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
747 additions
and
17 deletions
+747
-17
authRoutes.js
config/authRoutes.js
+26
-17
columns.js
src/pages/spare/requisition/columns.js
+1
-0
columns.js
src/pages/spare/spareback/columns.js
+492
-0
index.jsx
src/pages/spare/spareback/index.jsx
+228
-0
No files found.
config/authRoutes.js
View file @
3fa0c1b1
...
@@ -172,23 +172,36 @@ export default [
...
@@ -172,23 +172,36 @@ export default [
"component"
:
"./spare/outstore"
"component"
:
"./spare/outstore"
},
},
{
{
"name"
:
"
个人库存
"
,
"name"
:
"
出入库记录
"
,
"path"
:
"/spare/
personalstore
"
,
"path"
:
"/spare/
record
"
,
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./spare/
personalstore
"
"component"
:
"./spare/
record
"
},
},
{
{
"name"
:
"
线边库存
"
,
"name"
:
"
备件领用
"
,
"path"
:
"/spare/
edgestore
"
,
"path"
:
"/spare/
requisition
"
,
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./spare/
edgestore
"
"component"
:
"./spare/
requisition
"
},
},
{
{
"name"
:
"
出入库记录
"
,
"name"
:
"
备件回冲
"
,
"path"
:
"/spare/
record
"
,
"path"
:
"/spare/
spareback
"
,
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./spare/
record
"
"component"
:
"./spare/
spareback
"
},
},
// {
// "name": "个人库存",
// "path": "/spare/personalstore",
// "icon": "",
// "component": "./spare/personalstore"
// },
{
"name"
:
" 线边库存"
,
"path"
:
"/spare/edgestore"
,
"icon"
:
""
,
"component"
:
"./spare/edgestore"
},
{
{
"name"
:
"备件供应商"
,
"name"
:
"备件供应商"
,
"path"
:
"/spare/supplier"
,
"path"
:
"/spare/supplier"
,
...
@@ -201,12 +214,8 @@ export default [
...
@@ -201,12 +214,8 @@ export default [
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./spare/setting"
"component"
:
"./spare/setting"
},
},
{
"name"
:
"备件领用"
,
"path"
:
"/spare/requisition"
,
"icon"
:
""
,
"component"
:
"./spare/requisition"
}
]
]
}
}
];
];
src/pages/spare/requisition/columns.js
View file @
3fa0c1b1
...
@@ -399,6 +399,7 @@ function getcolumns(type) {
...
@@ -399,6 +399,7 @@ function getcolumns(type) {
dataIndex
:
'cdetails'
,
dataIndex
:
'cdetails'
,
key
:
'cdetails'
,
key
:
'cdetails'
,
valueType
:
'split'
,
valueType
:
'split'
,
hideInForm
:
true
,
},
},
{
{
title
:
'审批人'
,
title
:
'审批人'
,
...
...
src/pages/spare/spareback/columns.js
0 → 100644
View file @
3fa0c1b1
This diff is collapsed.
Click to expand it.
src/pages/spare/spareback/index.jsx
0 → 100644
View file @
3fa0c1b1
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
Spareback
(
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/spareBackTask/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
{
lineStockId
:
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
Spareback
;
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