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
c03fdab0
Commit
c03fdab0
authored
Dec 28, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
f548e09d
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1859 additions
and
933 deletions
+1859
-933
proxy.js
config/proxy.js
+1
-1
index.jsx
src/components/AutoTable/index.jsx
+36
-22
mtable.jsx
src/components/AutoTable/mtable.jsx
+12
-12
index.jsx
src/components/DetailPro/index.jsx
+7
-0
index.jsx
src/components/InitForm/EditTable/index.jsx
+7
-1
FormItems.jsx
src/components/InitForm/FormItems.jsx
+1
-1
index.jsx
src/components/InitForm/index.jsx
+18
-2
index.jsx
src/components/TreeRender/index.jsx
+15
-19
global.less
src/global.less
+17
-15
columns.js
src/pages/spare/instore/columns.js
+424
-57
index.jsx
src/pages/spare/instore/index.jsx
+179
-152
columns.js
src/pages/spare/outstore/columns.js
+396
-57
index.jsx
src/pages/spare/outstore/index.jsx
+353
-145
columns.js
src/pages/spare/record/columns.js
+75
-41
index.jsx
src/pages/spare/record/index.jsx
+144
-154
columns.js
src/pages/spare/setting/columns.js
+55
-29
index.jsx
src/pages/spare/setting/index.jsx
+15
-3
columns.js
src/pages/spare/stock/columns.js
+48
-57
index.jsx
src/pages/spare/stock/index.jsx
+56
-165
No files found.
config/proxy.js
View file @
c03fdab0
...
...
@@ -13,7 +13,7 @@ export default {
dev
:
{
[
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哥
changeOrigin
:
true
,
},
...
...
src/components/AutoTable/index.jsx
View file @
c03fdab0
...
...
@@ -12,6 +12,8 @@ function isString(obj) {
}
export
default
(
props
)
=>
{
let
{
childposition
}
=
props
;
childposition
=
childposition
??
'left'
;
const
actionbtn
=
{
add
:
<
PremButton
{
...
props
?
.
addconfig
}
>
新增
</
PremButton
>,
export
:
(
...
...
@@ -58,14 +60,20 @@ export default (props) => {
children
:
(
<>
<
div
style=
{
{
display
:
'flex'
,
width
:
'100%'
}
}
>
{
(
props
.
childposition
==
'left'
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
,
paddingLeft
:
`${props.childposition == 'left' ? '15px' : '0'}`
}
}
>
{
props
.
childposition
==
'top'
&&
props
.
children
}
{
(
childposition
==
'left'
||
!
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
,
paddingLeft
:
`${childposition == 'left' && props.children ? '15px' : '0'}`
,
}
}
>
{
childposition
==
'top'
&&
props
.
children
}
<
Mtable
{
...
props
}
activeTabKey=
{
null
}
/>
</
div
>
{
(
props
.
childposition
==
'right'
||
!
props
.
childposition
)
&&
props
.
children
}
{
(
childposition
==
'right'
||
!
childposition
)
&&
props
.
children
}
</
div
>
{
props
.
childposition
==
'bottom'
&&
props
.
children
}
{
childposition
==
'bottom'
&&
props
.
children
}
</>
),
};
...
...
@@ -77,14 +85,14 @@ export default (props) => {
{
props
.
withCard
===
false
?
(
<>
<
div
style=
{
{
display
:
'flex'
,
width
:
'100%'
}
}
>
{
(
props
.
childposition
==
'left'
||
!
props
.
childposition
)
&&
props
.
children
}
{
(
childposition
==
'left'
||
!
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
'100%'
}
}
>
{
props
.
childposition
==
'top'
&&
props
.
children
}
{
childposition
==
'top'
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
</
div
>
{
(
props
.
childposition
==
'right'
||
!
props
.
childposition
)
&&
props
.
children
}
{
(
childposition
==
'right'
||
!
childposition
)
&&
props
.
children
}
</
div
>
{
props
.
childposition
==
'bottom'
&&
props
.
children
}
{
childposition
==
'bottom'
&&
props
.
children
}
</>
)
:
!
props
.
nocardtab
?
(
<
Card
...
...
@@ -97,24 +105,30 @@ export default (props) => {
onTabChange=
{
props
.
onTabChange
}
>
<
div
style=
{
{
display
:
'flex'
,
width
:
'100%'
}
}
>
{
(
props
.
childposition
==
'left'
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
,
paddingLeft
:
`${props.childposition == 'left' ? '15px' : '0'}`
}
}
>
{
props
.
childposition
==
'top'
&&
props
.
children
}
{
(
childposition
==
'left'
||
!
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
,
paddingLeft
:
`${childposition == 'left' && props.children ? '15px' : '0'}`
,
}
}
>
{
childposition
==
'top'
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
</
div
>
{
(
props
.
childposition
==
'right'
||
!
props
.
childposition
)
&&
props
.
children
}
{
(
childposition
==
'right'
||
!
childposition
)
&&
props
.
children
}
</
div
>
{
props
.
childposition
==
'bottom'
&&
props
.
children
}
{
childposition
==
'bottom'
&&
props
.
children
}
</
Card
>
)
:
(
<
div
className=
"tabsTable"
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
padding
:
'16px 20px 0'
}
}
>
<
div
style=
{
{
fontSize
:
16
,
fontWeight
:
500
}
}
>
{
props
.
pagetitle
}
</
div
>
<
div
className=
"center"
>
{
renderextra
()
}
</
div
>
</
div
>
<
Tabs
items=
{
items
}
onChange=
{
props
.
onTabChange
}
activeTabKey=
{
props
.
activeTabKey
}
/>
</
div
>
)
}
<
div
className=
"tabsTable"
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
padding
:
'16px 20px 0'
}
}
>
<
div
style=
{
{
fontSize
:
16
,
fontWeight
:
500
}
}
>
{
props
.
pagetitle
}
</
div
>
<
div
className=
"center"
>
{
renderextra
()
}
</
div
>
</
div
>
<
Tabs
items=
{
items
}
onChange=
{
props
.
onTabChange
}
activeTabKey=
{
props
.
activeTabKey
}
/>
</
div
>
)
}
</
div
>
);
};
src/components/AutoTable/mtable.jsx
View file @
c03fdab0
...
...
@@ -40,6 +40,7 @@ const Mtable = (props) => {
refreshDep
,
//依赖刷新 (已废弃)
getDefaultSelected
,
//存在默认选中向上返回选中值
resizeable
=
true
,
dataSource
,
}
=
props
;
const
actionRefs
=
actionRef
??
useRef
(),
...
...
@@ -345,10 +346,14 @@ const Mtable = (props) => {
},
}
:
{};
const
datas
=
dataSource
?
{
dataSource
,
toolBarRender
:
false
}
:
{
request
};
return
(
<
ProTable
{
...
props
}
{
...
components
}
{
...
datas
}
size=
{
size
}
onSubmit=
{
(
params
)
=>
{
////console.log(params, 'onSubmit');
...
...
@@ -379,7 +384,6 @@ const Mtable = (props) => {
formRef=
{
formRefs
}
rowKey=
{
rowKey
??
'id'
}
//表格每行数据的key
dateFormatter=
"string"
request=
{
request
}
scroll=
{
x
?
{
...
...
@@ -387,17 +391,13 @@ const Mtable = (props) => {
}
:
{}
}
pagination=
{
ifspagination
?
false
:
{
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
defaultPageSize
:
pageSize
||
15
,
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
defaultPageSize
:
pageSize
||
15
,
}
}
search=
{
{
filterType
:
'light'
,
//轻量模式
}
}
...
...
src/components/DetailPro/index.jsx
View file @
c03fdab0
...
...
@@ -44,6 +44,13 @@ function DetailPro(props) {
}
??
{},
};
}
setcuritem
({
...(
res
?.
data
?.
data
??
{}),
});
return
{
success
:
res
?.
code
==
'0000'
,
data
:
{
...(
res
?.
data
?.
data
??
{})
},
};
},
};
}
...
...
src/components/InitForm/EditTable/index.jsx
View file @
c03fdab0
...
...
@@ -19,6 +19,7 @@ const EditTable = (props) => {
x
,
//横向滚动
refreshDep
,
//依赖刷新 (已废弃)
getDefaultSelected
,
//存在默认选中向上返回选中值
dataSource
,
}
=
props
;
const
actionRefs
=
actionRef
??
useRef
(),
...
...
@@ -28,7 +29,12 @@ const EditTable = (props) => {
//调用接口
const
request
=
async
(
params
,
sort
,
filter
)
=>
{
if
(
!
path
)
return
;
if
(
!
path
)
return
{
data
:
dataSource
??
[],
success
:
true
,
total
:
dataSource
?.
length
??
0
,
};
let
newparams
=
{
...
params
,
...
extraparams
,
//父组件传参
...
...
src/components/InitForm/FormItems.jsx
View file @
c03fdab0
...
...
@@ -1510,7 +1510,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
}
/>
);
console.log(value);
const Todo = (
<EditTable
actionRef={actionRef}
...
...
src/components/InitForm/index.jsx
View file @
c03fdab0
...
...
@@ -126,20 +126,36 @@ function InitForm(props) {
res
?.
data
?.
data
[
extendField
]?.
forEach
?.((
it
)
=>
{
obj
[
it
?.
fieldId
]
=
it
?.
fieldRealValue
;
});
console
.
log
(
'dddddd'
,
{
console
.
log
({
...
obj
,
...
defaultFormValue
,
...(
res
?.
data
?.
data
??
{}),
});
return
{
...
obj
,
...
defaultFormValue
,
...(
res
?.
data
?.
data
??
{}),
...
relationSupplierList
,
};
}
//反填参数 格式化
const
relationSupplierList
=
res
?.
data
?.
data
?.
relationSupplierList
?
{
relationSupplierList
:
res
?.
data
?.
data
?.
relationSupplierList
?.
map
?.((
it
,
i
)
=>
{
return
{
...
it
,
id
:
it
?.
supplierId
,
};
}),
}
:
{};
return
{
...(
res
?.
data
?.
data
??
{}),
...
defaultFormValue
,
...(
res
?.
data
?.
data
??
{}),
...
relationSupplierList
,
};
}
else
{
console
.
log
({
...
...
src/components/TreeRender/index.jsx
View file @
c03fdab0
...
...
@@ -41,7 +41,17 @@ const getParentKey = (key, tree) => {
/> */
}
function
TreeRender
({
url
,
deleteurl
,
saveurl
,
onselected
,
params
,
noaction
,
maxWidth
,
style
})
{
function
TreeRender
({
url
,
deleteurl
,
saveurl
,
onselected
,
params
,
noaction
,
maxWidth
,
style
,
submitKey
,
})
{
const
[
search
,
setsearch
]
=
useState
(
''
);
const
[
savetitle
,
setsavetitle
]
=
useState
(
null
);
const
[
modal
,
setModal
]
=
useState
({
...
...
@@ -80,8 +90,8 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
let
res
=
data
?.
data
?.
dataList
??
[];
return
[
{
title
:
'
设备树
'
,
key
:
'
00000000
'
,
title
:
'
全部类型
'
,
key
:
''
,
children
:
res
,
},
];
...
...
@@ -275,20 +285,6 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
);
}
// if (item.children) {
// return (
// <TreeNode key={item.key} title={actiontitle}>
// {loop(item.children)}
// </TreeNode>
// );
// }
// return <TreeNode key={item.key} title={title} />;
// return (
// <TreeNode key={item.key} title={noaction ? title : actiontitle}>
// {item.children && loop(item.children)}
// </TreeNode>
// );
if
(
item
.
children
)
{
return
{
title
:
noaction
?
title
:
actiontitle
,
...
...
@@ -341,7 +337,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
doFetch
({
url
:
saveurl
,
params
:
{
materieTypeName
:
savetitle
,
[
submitKey
]
:
savetitle
,
id
:
modal
.
key
,
},
}).
then
((
res
)
=>
{
...
...
@@ -366,7 +362,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
doFetch
({
url
:
saveurl
,
params
:
{
materieTypeName
:
savetitle
,
[
submitKey
]
:
savetitle
,
parentId
:
modal
.
key
,
},
}).
then
((
res
)
=>
{
...
...
src/global.less
View file @
c03fdab0
...
...
@@ -58,14 +58,13 @@ ol {
width: 100%;
overflow-x: auto;
&-thead>tr,
&-tbody>tr {
>th,
>td {
&-thead > tr,
&-tbody > tr {
> th,
> td {
white-space: pre;
>span {
>
span {
display: block;
}
}
...
...
@@ -314,7 +313,7 @@ ol {
}
.lightblue {
>td:first-child {
>
td:first-child {
position: relative;
&::before {
...
...
@@ -336,14 +335,14 @@ ol {
width: 100%;
padding-left: 0 !important;
>span:first-child {
>
span:first-child {
flex: 1;
>span:first-child {
>
span:first-child {
display: none !important;
}
>.ant-spin-nested-loading {
>
.ant-spin-nested-loading {
width: 100%;
}
}
...
...
@@ -387,9 +386,12 @@ ol {
.container,
.diycard {
width: 100%;
height: 100%;
}
.ant-pro-table {
width: 100%;
}
.ant-drawer-wrapper-body {
.diycard {
height: unset;
...
...
@@ -397,7 +399,7 @@ ol {
}
.runtime-keep-alive-layout {
>div {
>
div {
height: 100% !important;
}
}
...
...
@@ -445,7 +447,7 @@ ol {
min-height: 100% !important;
overflow: hidden !important;
>div {
>
div {
height: 100%;
min-height: calc(100vh - 96px);
}
...
...
@@ -457,12 +459,12 @@ ol {
// 横向滚动条
.scrollHoriz {
>div {
>
div {
display: flex !important;
flex-wrap: nowrap !important;
align-items: center !important;
>div {
>
div {
flex-shrink: 0 !important;
}
}
...
...
src/pages/spare/instore/columns.js
View file @
c03fdab0
import
AutoTable
from
'@/components/AutoTable/mtable'
;
function
getcolumns
(
setdrawer
)
{
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"
}
]
};
const
columns
=
[
{
title
:
'备件料号/名称'
,
dataIndex
:
'sparePartId'
,
key
:
'sparePartId'
,
editable
:
false
,
hideInSearch
:
true
,
colProps
:
{
span
:
6
,
},
valueType
:
'select'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
options
:
{
path
:
'/sparepart/sparePart/queryAllSelect'
,
params
:
{},
},
},
{
title
:
'供应商编号/名称'
,
dataIndex
:
'supplierId'
,
key
:
'supplierId'
,
editable
:
false
,
hideInSearch
:
true
,
colProps
:
{
span
:
6
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
valueType
:
'select'
,
options
:
{
path
:
'/sparepart/sparePartSupplier/queryOnSelect'
,
params
:
{},
},
},
{
title
:
'入库数量'
,
dataIndex
:
'operateNum'
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
0
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
hideInSearch
:
true
,
colProps
:
{
span
:
6
,
},
},
{
title
:
'库存单位'
,
dataIndex
:
'unit'
,
key
:
'unit'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
fieldProps
:
{
disabled
:
true
,
},
hideInSearch
:
true
,
editable
:
false
,
colProps
:
{
span
:
6
,
},
},
];
return
[
{
tab
:
'未完成'
,
key
:
'1'
,
columns
:
[
{
title
:
'入库单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'入库类型'
,
dataIndex
:
'inTypeName'
,
key
:
'inType'
,
valueType
:
'select'
,
options
:
[
{
label
:
'采购入库'
,
value
:
'1'
,
},
{
label
:
'生产入库'
,
value
:
'2'
,
},
{
label
:
'其他入库'
,
value
:
'3'
,
},
],
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
valueType
:
'textarea'
,
hideInSearch
:
true
,
},
{
title
:
'创建人'
,
dataIndex
:
'createUserName'
,
key
:
'createUserId'
,
hideInForm
:
true
,
valueType
:
'select'
,
fieldProps
:
{
showSearch
:
true
,
},
options
:
{
path
:
'/auth/sysUser/selection'
,
params
:
{},
},
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
createTime
}
<
/span>
;
},
},
{
title
:
'备件信息'
,
dataIndex
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
},
{
title
:
'备件'
,
dataIndex
:
'detailsList'
,
key
:
'detailsList'
,
valueType
:
'formList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/sparePart/queryList'
,
hideInSearch
:
true
,
hideInTable
:
true
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
detailsList
}
/
>
);
},
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
'/sparepart/inWarehouseTask/save'
,
edit
:
'/sparepart/inWarehouseTask/save'
,
list
:
'/sparepart/inWarehouseTask/queryNoComplete'
,
delete
:
''
,
detail
:
'/sparepart/inWarehouseTask/queryDetails'
,
},
},
{
tab
:
'已完成'
,
key
:
'2'
,
columns
:
[
{
title
:
'入库单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'入库类型'
,
dataIndex
:
'inTypeName'
,
key
:
'inType'
,
valueType
:
'select'
,
options
:
[
{
label
:
'采购入库'
,
value
:
'1'
,
},
{
label
:
'生产入库'
,
value
:
'2'
,
},
{
label
:
'其他入库'
,
value
:
'3'
,
},
],
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInForm
:
true
,
hideInSearch
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
valueType
:
'textarea'
,
hideInSearch
:
true
,
},
{
title
:
'创建人'
,
dataIndex
:
'createUserName'
,
key
:
'createUserId'
,
hideInForm
:
true
,
valueType
:
'select'
,
fieldProps
:
{
showSearch
:
true
,
},
options
:
{
path
:
'/auth/sysUser/selection'
,
params
:
{},
},
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
createTime
}
<
/span>
;
},
},
{
title
:
'完成时间'
,
dataIndex
:
'completeTime'
,
key
:
'completeTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
completeTime
}
<
/span>
;
},
},
{
title
:
'备件信息'
,
dataIndex
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
},
{
title
:
'备件'
,
dataIndex
:
'detailsList'
,
key
:
'detailsList'
,
valueType
:
'formList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/sparePart/queryList'
,
hideInSearch
:
true
,
hideInTable
:
true
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
detailsList
}
/
>
);
},
},
{
dataIndex
:
'splias'
,
valueType
:
'split'
,
title
:
'入库/关单信息'
,
key
:
'splisa'
,
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
hideInForm
:
true
,
valueType
:
'select'
,
width
:
120
,
options
:
[
{
label
:
'已入库'
,
value
:
2
},
{
label
:
'已关单'
,
value
:
3
},
],
},
{
title
:
'操作人'
,
dataIndex
:
'operateUserName'
,
key
:
'operateUserName'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
key
:
'operateTime'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
true
,
add
:
'/sparepart/inWarehouseTask/save'
,
edit
:
'/sparepart/inWarehouseTask/save'
,
list
:
'/sparepart/inWarehouseTask/queryYesComplete'
,
delete
:
''
,
detail
:
'/sparepart/inWarehouseTask/queryDetails'
,
},
},
];
}
export
default
getcolumns
;
\ No newline at end of file
export
default
getcolumns
;
src/pages/spare/instore/index.jsx
View file @
c03fdab0
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
{
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
Instore
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
function
Instore
(
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'
)
{
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
pop=
{
{
title
:
'是否入库?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
'/sparepart/inWarehouseTask/inWarehouse'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
}
}
>
入库
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否关单?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
'/sparepart/inWarehouseTask/shut'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
关单
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
setdrawer
).
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
),
],
});
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
,
}));
}
},
});
},
[
activeTabKey
]);
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
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
const
{
data
}
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/sparepart/sparePart/queryAllSelect'
,
params
:
{}
});
return
res
?.
data
?.
dataList
;
});
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
console
.
log
(
data
);
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
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'
编辑
'
,
val
:
'
edit
'
,
item
:
null
,
title
:
'
新增
'
,
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'
,
}));
},
},
}
}
/>
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
<
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
>
);
}
<
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
)
=>
{
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
}
});
}
}
}
onValuesChange=
{
(
curval
,
allval
)
=>
{
if
(
Object
.
keys
(
curval
)[
0
]
==
'detailsList'
)
{
formRef
.
current
.
setFieldsValue
({
detailsList
:
allval
.
detailsList
?.
map
((
it
)
=>
{
if
(
it
.
sparePartId
)
{
it
.
unit
=
data
?.
filter
?.((
item
)
=>
{
return
item
.
value
==
it
.
sparePartId
;
})?.[
0
]?.
unit
;
}
return
it
;
}),
});
}
}
}
/>
</
div
>
);
}
export
default
Instore
;
\ No newline at end of file
export
default
Instore
;
src/pages/spare/outstore/columns.js
View file @
c03fdab0
import
AutoTable
from
'@/components/AutoTable/mtable'
;
function
getcolumns
(
setdrawer
)
{
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"
}
]
};
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
,
},
},
{
title
:
'库存单位'
,
dataIndex
:
'unit'
,
editable
:
false
,
hideInSearch
:
true
,
},
];
return
[
{
tab
:
'未完成'
,
key
:
'1'
,
columns
:
[
{
title
:
'出库单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'出库类型'
,
dataIndex
:
'outTypeName'
,
key
:
'outType'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
valueType
:
'select'
,
options
:
[
{
label
:
'销售出库'
,
value
:
'1'
,
},
{
label
:
'报废出库'
,
value
:
'2'
,
},
{
label
:
'其它出库'
,
value
:
'3'
,
},
{
label
:
'备件申领出库'
,
value
:
'4'
,
},
],
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseName'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInSearch
:
true
,
hideInForm
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
colProps
:
{
span
:
24
,
},
hideInSearch
:
true
,
valueType
:
'textarea'
,
},
{
title
:
'创建人'
,
dataIndex
:
'createUserName'
,
key
:
'createUserId'
,
hideInForm
:
true
,
valueType
:
'select'
,
fieldProps
:
{
showSearch
:
true
,
},
options
:
{
path
:
'/auth/sysUser/selection'
,
params
:
{},
},
hideInForm
:
true
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTimeList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
,
render
:
(
text
,
row
)
=>
{
return
<
span
>
{
row
?.
createTime
}
<
/span>
;
},
hideInForm
:
true
,
},
{
title
:
'备件信息'
,
dataIndex
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
},
{
title
:
'备件'
,
dataIndex
:
'taskSpareList'
,
key
:
'taskSpareList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInTable
:
true
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
taskSpareList
}
/
>
);
},
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
'/sparepart/outWarehouseTask/save'
,
edit
:
''
,
list
:
'/sparepart/outWarehouseTask/queryNoComplete'
,
delete
:
''
,
detail
:
'/sparepart/outWarehouseTask/queryDetails'
,
},
},
{
tab
:
'已完成'
,
key
:
'2'
,
columns
:
[
{
title
:
'出库单号'
,
dataIndex
:
'taskNo'
,
key
:
'taskNo'
,
},
{
title
:
'出库类型'
,
dataIndex
:
'outTypeName'
,
key
:
'outType'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
valueType
:
'select'
,
options
:
[
{
label
:
'销售出库'
,
value
:
'1'
,
},
{
label
:
'报废出库'
,
value
:
'2'
,
},
{
label
:
'其它出库'
,
value
:
'3'
,
},
{
label
:
'备件申领出库'
,
value
:
'4'
,
},
],
},
{
title
:
'入库仓库'
,
dataIndex
:
'inWarehouseName'
,
key
:
'inWarehouseName'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'出库仓库'
,
dataIndex
:
'outWarehouseName'
,
key
:
'outWarehouseName'
,
hideInForm
:
true
,
},
{
title
:
'备件种类'
,
dataIndex
:
'spareTypeNum'
,
key
:
'spareTypeNum'
,
hideInSearch
:
true
,
hideInForm
:
true
,
},
{
title
:
'相关单号'
,
dataIndex
:
'relationNo'
,
key
:
'relationNo'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
colProps
:
{
span
:
24
,
},
hideInSearch
:
true
,
valueType
:
'textarea'
,
},
{
title
:
'创建人'
,
dataIndex
:
'createUserName'
,
key
:
'createUserId'
,
hideInForm
:
true
,
valueType
:
'select'
,
fieldProps
:
{
showSearch
:
true
,
},
options
:
{
path
:
'/auth/sysUser/selection'
,
params
:
{},
},
hideInForm
:
true
,
},
{
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
:
'details'
,
key
:
'details'
,
valueType
:
'split'
,
},
{
title
:
'备件'
,
dataIndex
:
'taskSpareList'
,
key
:
'taskSpareList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
columns
,
span
:
12
,
path
:
'/sparepart/spareStock/queryByOperate'
,
hideInSearch
:
true
,
hideInTable
:
true
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
taskSpareList
}
/
>
);
},
},
{
dataIndex
:
'splias'
,
valueType
:
'split'
,
title
:
'出库/关单信息'
,
key
:
'splisa'
,
},
{
dataIndex
:
'statusName'
,
valueType
:
'select'
,
title
:
'状态'
,
key
:
'status'
,
options
:
[
{
label
:
'已出库'
,
value
:
2
,
},
{
label
:
'已关单'
,
value
:
3
,
},
],
hideInForm
:
true
,
},
{
title
:
'操作人'
,
dataIndex
:
'operateUserName'
,
key
:
'operateUserName'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
{
title
:
'操作时间'
,
dataIndex
:
'operateTime'
,
key
:
'operateTime'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInForm
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
true
,
add
:
'/sparepart/outWarehouseTask/save'
,
edit
:
''
,
list
:
'/sparepart/outWarehouseTask/queryYesComplete'
,
delete
:
''
,
detail
:
'/sparepart/outWarehouseTask/queryDetails'
,
},
},
];
}
export
default
getcolumns
;
\ No newline at end of file
export
default
getcolumns
;
src/pages/spare/outstore/index.jsx
View file @
c03fdab0
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
{
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
DetailPro
from
'@/components/DetailPro'
;
import
EditTable
from
'@/components/InitForm/EditTable'
;
import
{
Button
}
from
'antd'
;
function
Outstore
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
function
Outstore
(
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
,
}));
}
},
});
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
[
value
,
setvalue
]
=
useState
([]);
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
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
:
()
=>
{
doFetch
({
url
:
'/sparepart/outWarehouseTask/queryByBeforeOut'
,
params
:
{
id
:
row
?.
id
},
}).
then
((
res
)
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'
详情
'
,
val
:
'
detail
'
,
title
:
'详细信息'
,
title
:
'
出库
'
,
val
:
'
only
'
,
submitdata
:
res
?.
data
?.
data
?.
taskSpareList
??
[]
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
});
},
}
}
>
出库
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否关单?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
'/sparepart/outWarehouseTask/shut'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
关单
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
setdrawer
).
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
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
console
.
log
(
value
);
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
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'
编辑
'
,
val
:
'
edit
'
,
item
:
null
,
title
:
'
新增
'
,
val
:
'
add
'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
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
>
);
};
<
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
taskSpareList
=
vals
?.
taskSpareList
?.
map
?.((
it
,
i
)
=>
{
return
{
spareStockId
:
it
?.
id
,
operateNum
:
it
?.
operateNum
,
};
});
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
,
taskSpareList
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
,
taskSpareList
},
});
}
}
}
>
{
drawer
?.
val
==
'only'
&&
(
<
div
>
<
DetailPro
detailpath=
{
pathconfig
?.
detail
||
null
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
fields=
{
columns
?.
filter
(
(
it
)
=>
!
[
'details'
,
'taskSpareList'
].
includes
(
it
?.
key
)
&&
it
.
valueType
!=
'option'
,
)
}
/>
<
AutoTable
columns=
{
[
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
},
{
title
:
'库存单位'
,
dataIndex
:
'unit'
,
key
:
'unit'
,
},
{
title
:
'出库数量'
,
dataIndex
:
'operateNum'
,
key
:
'operateNum'
,
},
{
title
:
'未下架数量'
,
dataIndex
:
'outNum'
,
key
:
'outNum'
,
},
]
}
pagetitle=
"备件信息"
dataSource=
{
drawer
?.
submitdata
}
expandable=
{
{
expandedRowRender
:
(
record
)
=>
{
return
(
<
div
style=
{
{
padding
:
'4px 4px 4px 36px'
,
backgroundColor
:
'#cccccc'
}
}
>
<
EditTable
resizeable=
{
false
}
alwaysShowAlert=
{
false
}
tableAlertRender=
{
false
}
tableAlertOptionRender=
{
false
}
columns=
{
[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
editable
:
false
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
editable
:
false
,
},
{
title
:
'库存数量'
,
dataIndex
:
'actualStock'
,
key
:
'actualStock'
,
editable
:
false
,
},
{
title
:
'下架数量'
,
dataIndex
:
'operateNum'
,
key
:
'operateNum'
,
valueType
:
'digit'
,
fieldProps
:
{
precision
:
3
,
},
},
]
}
dataSource=
{
record
?.
spareSupplierStockList
??
[]
}
rowSelection=
{
{
columnWidth
:
44
,
preserveSelectedRowKeys
:
true
,
selectedRowKeys
:
value
&&
value
?.
filter
?.((
it
)
=>
it
?.
id
==
record
.
id
)[
0
]
?.
taskSpareSupplierList
?.
map
?.((
it
)
=>
it
?.
spareSupplierStockId
),
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
const
curval
=
value
?.
filter
?.((
it
)
=>
it
?.
id
==
record
.
id
)[
0
]
?.
taskSpareSupplierList
??
[];
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
),
],
});
},
[]);
const
rowkeylist
=
curval
?
curval
?.
map
((
it
)
=>
it
?.
spareSupplierStockId
)
:
[];
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'
,
}));
},
},
}
}
/>
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
if
(
rowkeylist
.
includes
(
its
?.
id
))
{
return
curval
.
filter
(
(
it
)
=>
it
?.
spareSupplierStockId
==
its
?.
id
,
)[
0
];
}
else
{
return
{
spareSupplierStockId
:
its
.
id
,
operateNum
:
its
.
operateNum
,
};
}
});
console
.
log
(
newValue
);
let
nvalue
=
value
?
[...
value
]
:
[];
if
(
value
&&
value
.
some
((
it
)
=>
it
.
id
==
record
?.
id
))
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
if
(
it
.
id
==
record
.
id
)
{
it
.
taskSpareSupplierList
=
newValue
;
}
return
it
;
});
}
else
{
nvalue
.
push
({
id
:
record
.
id
,
taskSpareSupplierList
:
newValue
,
});
}
<
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
>
);
}
setvalue
(
nvalue
);
},
}
}
editable=
{
{
onValuesChange
:
(
rower
,
recordList
)
=>
{
const
curval
=
value
?.
filter
?.((
it
)
=>
it
?.
id
==
record
.
id
)[
0
]
?.
taskSpareSupplierList
??
[];
const
newValue
=
curval
?.
map
((
its
)
=>
{
if
(
its
?.
spareSupplierStockId
==
rower
?.
id
)
{
return
{
spareSupplierStockId
:
rower
.
id
,
operateNum
:
rower
.
operateNum
,
};
}
else
{
return
its
;
}
});
console
.
log
(
newValue
);
let
nvalue
=
value
?
[...
value
]
:
[];
if
(
value
&&
value
.
some
((
it
)
=>
it
.
id
==
record
?.
id
))
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
if
(
it
.
id
==
record
.
id
)
{
it
.
taskSpareSupplierList
=
newValue
;
}
return
it
;
});
}
else
{
nvalue
.
push
({
id
:
record
.
id
,
taskSpareSupplierList
:
newValue
,
});
}
setvalue
(
nvalue
);
},
}
}
/>
</
div
>
);
},
}
}
/>
<
Button
style=
{
{
marginTop
:
12
}
}
type=
"primary"
onClick=
{
()
=>
{
run
({
url
:
'/sparepart/outWarehouseTask/OutWarehouse'
,
params
:
{
id
:
drawer
?.
item
?.
id
,
taskSpareList
:
value
},
});
}
}
>
出库
</
Button
>
</
div
>
)
}
</
DrawerPro
>
</
div
>
);
}
export
default
Outstore
;
\ No newline at end of file
export
default
Outstore
;
src/pages/spare/record/columns.js
View file @
c03fdab0
function
getcolumns
(
setdrawer
)
{
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
return
{
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
"title"
:
"操作时间"
,
"dataIndex"
:
"operateTime"
,
"key"
:
"operateTimeList"
,
"valueType"
:
"dateRange"
},
{
"title"
:
"操作人"
,
"dataIndex"
:
"operateUserName"
,
"key"
:
"operateUserId"
,
"valueType"
:
"select"
,
"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"
:
"
equipmentNo
"
,
"key"
:
"
equipmentNo
"
"title"
:
"
供应商名称
"
,
"dataIndex"
:
"
supplierName
"
,
"key"
:
"
supplierName
"
},
{
"title"
:
"
设备名称
"
,
"dataIndex"
:
"
equipmentName
"
,
"key"
:
"
equipmentName
"
"title"
:
"
库存单位
"
,
"dataIndex"
:
"
unit
"
,
"key"
:
"
unit
"
},
{
"title"
:
"
故障描述
"
,
"dataIndex"
:
"
faultDescription
"
,
"key"
:
"
faultDescription
"
"title"
:
"
入库仓库
"
,
"dataIndex"
:
"
inWarehouseName
"
,
"key"
:
"
inWarehouseName
"
},
{
"title"
:
"
报修人员
"
,
"dataIndex"
:
"
repairUser
Name"
,
"key"
:
"
repairUser
Name"
"title"
:
"
出库仓库
"
,
"dataIndex"
:
"
outWarehouse
Name"
,
"key"
:
"
outWarehouse
Name"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTime"
,
"key"
:
"repairTimeList"
,
"valueType"
:
"dateTimeRange"
"title"
:
"出入库类型"
,
"dataIndex"
:
"operateTypeName"
,
"key"
:
"operateTypeName"
},
{
"title"
:
"
报修单号
"
,
"dataIndex"
:
"
repairNo
"
,
"key"
:
"
repairNo
"
"title"
:
"
操作后的备件库存
"
,
"dataIndex"
:
"
actualStock
"
,
"key"
:
"
actualStock
"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
"title"
:
"操作数量"
,
"dataIndex"
:
"operateNum"
,
"key"
:
"operateNum"
},
{
"title"
:
"相关单号"
,
"dataIndex"
:
"relationNo"
,
"key"
:
"relationNo"
}
]
],
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/sparepart/spareStockAccess/queryList"
,
"delete"
:
""
,
"detail"
:
""
}
};
}
export
default
getcolumns
;
\ No newline at end of file
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/spare/record/index.jsx
View file @
c03fdab0
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
{
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
)
{
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
,
}));
}
},
});
function
Record
(
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
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'
,
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=
"出入库记录"
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
:
row
,
title
:
'
编辑
'
,
val
:
'
edit
'
,
item
:
null
,
title
:
'
新增
'
,
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
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
>
);
}
<
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
;
\ No newline at end of file
export
default
Record
;
src/pages/spare/setting/columns.js
View file @
c03fdab0
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
:
'qualityGuarantee'
,
valueType
:
'digit'
,
precision
:
2
,
fieldProps
:
{
precision
:
2
,
},
hideInSearch
:
true
,
},
{
title
:
'价值'
,
dataIndex
:
'value'
,
valueType
:
'money'
,
hideInSearch
:
true
,
},
];
return
{
columns
:
[
{
...
...
@@ -44,18 +77,21 @@ function getcolumns(setdrawer) {
path
:
'/sparepart/sparePartType/queryTreeList'
,
params
:
{},
},
hideInSearch
:
true
,
},
{
title
:
'库存上限'
,
dataIndex
:
'stockUpper'
,
key
:
'stockUpper'
,
valueType
:
'digit'
,
hideInSearch
:
true
,
},
{
title
:
'库存下限'
,
dataIndex
:
'stockLower'
,
key
:
'stockLower'
,
valueType
:
'digit'
,
hideInSearch
:
true
,
},
{
title
:
'库存单位'
,
...
...
@@ -69,6 +105,7 @@ function getcolumns(setdrawer) {
},
],
},
hideInSearch
:
true
,
},
{
title
:
'是否寿命件'
,
...
...
@@ -85,6 +122,8 @@ function getcolumns(setdrawer) {
value
:
2
,
},
],
hideInSearch
:
true
,
hideInTable
:
true
,
},
{
title
:
'供应商信息'
,
...
...
@@ -93,43 +132,30 @@ function getcolumns(setdrawer) {
valueType
:
'split'
,
},
{
title
:
'
选择
供应商'
,
title
:
'供应商'
,
dataIndex
:
'relationSupplierList'
,
key
:
'relationSupplierList'
,
valueType
:
'formSelectList'
,
colProps
:
{
span
:
24
,
},
columns
:
[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
editable
:
false
,
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
editable
:
false
,
},
{
title
:
'保质期(天)'
,
dataIndex
:
'qualityGuarantee'
,
valueType
:
'digit'
,
precision
:
2
,
fieldProps
:
{
precision
:
2
,
},
},
{
title
:
'价值'
,
dataIndex
:
'value'
,
valueType
:
'money'
,
},
],
columns
,
span
:
12
,
path
:
'/sparepart/sparePartSupplier/queryList'
,
params
:
{
status
:
1
},
hideInSearch
:
true
,
hideInTable
:
true
,
render
:
(
text
,
row
)
=>
{
return
(
<
AutoTable
columns
=
{
columns
?.
map
((
it
)
=>
({
...
it
,
hideInSearch
:
true
,
}))}
dataSource
=
{
row
?.
relationSupplierList
}
/
>
);
},
},
],
pathconfig
:
{
...
...
src/pages/spare/setting/index.jsx
View file @
c03fdab0
...
...
@@ -7,6 +7,7 @@ import getcolumns from './columns';
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
import
TreeRender
from
'@/components/TreeRender'
;
function
Setting
(
props
)
{
const
actionRef
=
useRef
(),
...
...
@@ -18,6 +19,7 @@ function Setting(props) {
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
const
[
sparePartTypeId
,
setsparePartTypeId
]
=
useState
();
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
...
...
@@ -135,7 +137,18 @@ function Setting(props) {
},
},
}
}
/>
extraparams=
{
{
sparePartTypeId
}
}
>
<
TreeRender
url=
"/sparepart/sparePartType/queryTreeList"
deleteurl=
"/sparepart/sparePartType/deleteById"
saveurl=
"/sparepart/sparePartType/save"
submitKey=
"sparePartTypeName"
onselected=
{
(
vals
)
=>
{
setsparePartTypeId
(
vals
[
0
]
??
''
);
}
}
/>
</
AutoTable
>
<
DrawerPro
fields=
{
columns
}
...
...
@@ -143,8 +156,7 @@ function Setting(props) {
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
defaultFormValue=
{
{
sparePartTypeId
}
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
...
...
src/pages/spare/stock/columns.js
View file @
c03fdab0
function
getcolumns
(
setdrawer
)
{
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"
}
]
};
columns
:
[
{
title
:
'备件料号'
,
dataIndex
:
'sparePartNo'
,
key
:
'sparePartNo'
,
},
{
title
:
'备件名称'
,
dataIndex
:
'sparePartName'
,
key
:
'sparePartName'
,
},
{
title
:
'备件类型'
,
dataIndex
:
'sparePartTypeName'
,
key
:
'sparePartTypeName'
,
},
{
title
:
'库存单位'
,
dataIndex
:
'unit'
,
key
:
'unit'
,
hideInSearch
:
true
,
},
{
title
:
'库存数量'
,
dataIndex
:
'actualStock'
,
key
:
'actualStock'
,
hideInSearch
:
true
,
},
{
title
:
'可用库存'
,
dataIndex
:
'usedStock'
,
key
:
'usedStock'
,
hideInSearch
:
true
,
},
],
pathconfig
:
{
enableadd
:
false
,
enableedit
:
false
,
enabledelete
:
false
,
enabledetail
:
false
,
add
:
''
,
edit
:
''
,
list
:
'/sparepart/spareStock/queryList'
,
delete
:
''
,
detail
:
''
,
},
};
}
export
default
getcolumns
;
\ No newline at end of file
export
default
getcolumns
;
src/pages/spare/stock/index.jsx
View file @
c03fdab0
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
Stock
(
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=
" 备件库存"
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
Stock
;
\ No newline at end of file
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
AutoTables
from
'@/components/AutoTable/mtable'
;
function
ExtraTable
({
spareStockId
})
{
return
(
<
div
style=
{
{
padding
:
'4px 4px 4px 36px'
,
backgroundColor
:
'#cccccc'
}
}
>
<
AutoTables
path=
{
'/sparepart/spareSupplierStock/queryBySpareStockId'
}
extraparams=
{
{
spareStockId
:
spareStockId
}
}
pagination=
{
false
}
resizeable=
{
false
}
columns=
{
[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
},
{
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
},
{
title
:
'库存数量'
,
dataIndex
:
'actualStock'
,
key
:
'actualStock'
,
hideInSearch
:
true
},
]
}
/>
</
div
>
);
}
function
Stock
(
props
)
{
const
actionRef
=
useRef
();
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
()?.
pathconfig
??
{};
return
pathconf
;
},
[]);
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
()?.
columns
;
return
defcolumn
;
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"备件库存"
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
resizeable=
{
false
}
expandable=
{
{
expandedRowRender
:
(
record
)
=>
<
ExtraTable
spareStockId=
{
record
?.
id
}
/>,
}
}
/>
</
div
>
);
}
export
default
Stock
;
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