Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
0d299f54
Commit
0d299f54
authored
Jun 17, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdfad
parent
6d380451
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
470 additions
and
266 deletions
+470
-266
app.jsx
src/app.jsx
+3
-3
index.jsx
src/components/AutoTable/index.jsx
+4
-0
index.jsx
src/components/Deletecheck/index.jsx
+1
-1
index.jsx
src/components/TagView/Tags/index.jsx
+1
-1
index.jsx
src/components/TreeRender/index.jsx
+198
-0
Index.jsx
src/pages/craft/Materiel/Index.jsx
+236
-224
index.jsx
src/pages/platform/Provide/index.jsx
+9
-19
device.js
src/services/device.js
+18
-18
No files found.
src/app.jsx
View file @
0d299f54
...
@@ -58,8 +58,8 @@ export async function getInitialState() {
...
@@ -58,8 +58,8 @@ export async function getInitialState() {
fetchUserInfo
,
fetchUserInfo
,
settings
:
defaultSettings
,
settings
:
defaultSettings
,
getmenuData
,
getmenuData
,
collapsed
:
false
collapsed
:
false
,
tagList
:
[]
};
};
}
// ProLayout 支持的api https://procomponents.ant.design/components/layout
}
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export
const
layout
=
async
(
props
)
=>
{
export
const
layout
=
async
(
props
)
=>
{
...
@@ -67,7 +67,7 @@ export const layout = async (props) => {
...
@@ -67,7 +67,7 @@ export const layout = async (props) => {
let
token
=
localStorage
.
getItem
(
"TOKEN_MES"
);
let
token
=
localStorage
.
getItem
(
"TOKEN_MES"
);
return
{
return
{
headerContentRender
:
()
=>
<
RightContent
/>,
headerContentRender
:
()
=>
<
RightContent
/>,
rightContentRender
:
()
=>
null
,
rightContentRender
:
()
=>
null
,
disableContentMargin
:
false
,
disableContentMargin
:
false
,
waterMarkProps
:
{
waterMarkProps
:
{
content
:
initialState
?.
currentUser
?.
name
,
content
:
initialState
?.
currentUser
?.
name
,
...
...
src/components/AutoTable/index.jsx
View file @
0d299f54
...
@@ -21,6 +21,8 @@ export default (props) => {
...
@@ -21,6 +21,8 @@ export default (props) => {
</
div
>
</
div
>
)
:
props
.
withCard
===
false
?
(
)
:
props
.
withCard
===
false
?
(
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
<
Mtable
{
...
props
}
/>
...
@@ -39,6 +41,8 @@ export default (props) => {
...
@@ -39,6 +41,8 @@ export default (props) => {
onTabChange=
{
props
.
onTabChange
}
onTabChange=
{
props
.
onTabChange
}
>
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
<
Mtable
{
...
props
}
/>
...
...
src/components/Deletecheck/index.jsx
View file @
0d299f54
...
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
...
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import
{
Button
,
Popconfirm
}
from
'antd'
;
import
{
Button
,
Popconfirm
}
from
'antd'
;
const
Deletecheck
=
props
=>
{
const
Deletecheck
=
props
=>
{
const
{
name
,
type
,
text
,
clickfn
,
pop
,
btnType
}
=
props
;
const
{
name
,
type
,
text
,
clickfn
,
pop
,
btnType
}
=
props
;
//点击删除按钮,若需要调取接口进行校验,需要传btnType,且值为deleteCheck
//点击删除按钮,若需要调取接口进行校验,需要传btnType,且值为deleteCheck
const
[
title
,
ct
]
=
useState
(
btnType
==
"deleteCheck"
?
""
:
pop
?.
title
),
const
[
title
,
ct
]
=
useState
(
btnType
==
"deleteCheck"
?
""
:
pop
?.
title
),
...
...
src/components/TagView/Tags/index.jsx
View file @
0d299f54
...
@@ -60,7 +60,7 @@ const Tags = ({
...
@@ -60,7 +60,7 @@ const Tags = ({
return
(
return
(
<
div
className=
{
styles
.
tags_wrapper
}
ref=
{
tagListRef
}
>
<
div
className=
{
styles
.
tags_wrapper
}
ref=
{
tagListRef
}
>
<
Scrollbars
autoHide
autoHideTimeout=
{
1000
}
autoHideDuration=
{
200
}
>
<
Scrollbars
autoHide
autoHideTimeout=
{
1000
}
autoHideDuration=
{
200
}
>
{
tagList
.
map
((
item
,
i
)
=>
(
{
tagList
?.
map
?.
((
item
,
i
)
=>
(
<
div
<
div
key=
{
item
.
path
}
key=
{
item
.
path
}
className=
{
className=
{
...
...
src/components/TreeRender/index.jsx
0 → 100644
View file @
0d299f54
import
React
,
{
useState
,
useMemo
}
from
'react'
;
import
{
Tree
,
Input
,
Card
,
Tooltip
,
Divider
}
from
'antd'
;
import
{
MinusSquareOutlined
,
FormOutlined
,
PlusSquareOutlined
}
from
'@ant-design/icons'
;
import
getPrem
from
'@/utils/getPrem'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
let
{
Search
}
=
Input
;
function
TreeRender
({
url
,
deleteurl
,
saveurl
,
onselected
})
{
const
[
search
,
setsearch
]
=
useState
(
""
);
const
{
data
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
{
title
:
search
}
})
});
const
treeData
=
useMemo
(()
=>
{
return
data
?.
data
?.
dataList
??
[]
},
[
data
]);
const
loop
=
data
=>
data
.
map
(
item
=>
{
const
index
=
item
.
title
.
indexOf
(
search
);
const
beforeStr
=
item
.
title
.
substr
(
0
,
index
);
const
afterStr
=
item
.
title
.
substr
(
index
+
search
.
length
);
const
title
=
index
>
-
1
?
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
68
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
beforeStr
}
<
span
style=
{
{
color
:
'#f50'
}
}
>
{
search
}
</
span
>
{
afterStr
}
</
span
>
</
Tooltip
>
)
:
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
68
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
item
.
title
}
</
span
>
</
Tooltip
>
);
const
actiontitle
=
(
<
div
style=
{
{
display
:
"flex"
,
alignItems
:
"center"
}
}
>
{
title
}
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
<
Tooltip
title=
"编辑"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>,
closable
:
true
,
title
:
"修改电表结构名称"
,
content
:
<
div
>
<
Input
placeholder=
{
item
.
title
}
allowClear
onChange=
{
(
e
)
=>
{
_it
.
setState
({
savetitle
:
e
.
target
.
value
})
}
}
></
Input
>
</
div
>,
okText
:
"修改"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_it
.
state
.
savetitle
)
{
ammeterTreeSave
({
electricityMeterTypeName
:
_it
.
state
.
savetitle
,
id
:
item
.
key
,
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
_it
.
resetData
()
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
})
}
}
}
>
<
FormOutlined
style=
{
{
color
:
"#1890ff"
}
}
/>
</
Tooltip
>
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
<
Tooltip
title=
"新增"
>
<
PlusSquareOutlined
disabled=
{
!
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
)
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>,
closable
:
true
,
title
:
"新增子结构"
,
content
:
<
div
>
<
div
style=
{
{
marginBottom
:
15
,
color
:
"#f50"
,
fontSize
:
16
}
}
>
当前结构:
{
item
.
title
}
</
div
>
<
Input
placeholder=
"子结构"
allowClear
onChange=
{
(
e
)
=>
{
_it
.
setState
({
savetitle
:
e
.
target
.
value
})
}
}
></
Input
>
</
div
>,
okText
:
"新增"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_it
.
state
.
savetitle
)
{
ammeterTreeSave
({
electricityMeterTypeName
:
_it
.
state
.
savetitle
,
parentId
:
item
.
key
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
_it
.
resetData
()
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
})
}
}
}
style=
{
{
color
:
`${getPrem("enElectricityMeterType_save", "ifs") ? "green" : ""}`
}
}
/></
Tooltip
>
{
(
!
item
.
children
||
item
.
children
.
length
==
0
)
&&
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
}
{
(
!
item
.
children
||
item
.
children
.
length
==
0
)
&&
<
Popconfirm
placement=
'bottom'
title=
"是否删除该电表结构?"
okText=
"删除"
cancelText=
"取消"
onConfirm=
{
()
=>
{
ammeterTreeDelete
({
id
:
item
.
key
}).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
this
.
resetData
()
}
})
}
}
disabled=
{
!
getPrem
(
"enElectricityMeterType_deleteById"
,
"ifs"
)
}
>
<
Tooltip
title=
"删除"
>
<
MinusSquareOutlined
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
()
}
}
style=
{
{
color
:
"red"
}
}
/>
</
Tooltip
>
</
Popconfirm
>
}
</
div
>
)
// 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=
{
actiontitle
}
>
{
item
.
children
&&
loop
(
item
.
children
)
}
</
TreeNode
>
);
});
return
(
<
div
>
<
Search
style=
{
{
margin
:
'16px 0 8px 0'
}
}
placeholder=
"搜索电表结构"
onChange=
{
setsearch
}
/>
<
Tree
onSelect=
{
(
selectedKeys
,
e
)
=>
{
onselected
?.(
selectedKeys
)
}
}
autoExpandParent=
{
true
}
>
{
loop
(
treeData
?
treeData
:
[])
}
</
Tree
>
</
div
>
);
}
export
default
TreeRender
;
\ No newline at end of file
src/pages/craft/Materiel/Index.jsx
View file @
0d299f54
...
@@ -12,21 +12,23 @@ import InitForm from "@/components/InitForm";
...
@@ -12,21 +12,23 @@ import InitForm from "@/components/InitForm";
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
Coltext
from
"@/components/Coltext"
;
import
Coltext
from
"@/components/Coltext"
;
import
RenderItemType
from
"@/components/RenderItemType"
;
import
RenderItemType
from
"@/components/RenderItemType"
;
import
TreeRender
from
'@/components/TreeRender'
const
initState
=
{
const
initState
=
{
vs
:
false
,
vs
:
false
,
fields
:
{},
fields
:
{},
iftype
:
{},
iftype
:
{},
curitem
:
{},
curitem
:
{},
detail
:
{
detail
:
{
dataSource
:
{},
dataSource
:
{},
totalCard
:
[],
totalCard
:
[],
},
visible
:
false
,
specificFileds
:
{},
defaultSpecificFileds
:
[],
commonFields
:
{},
defaultCommonFields
:
[],
},
},
visible
:
false
,
specificFileds
:
{},
defaultSpecificFileds
:
[],
commonFields
:
{},
defaultCommonFields
:
[],
},
otherBasic
=
{
otherBasic
=
{
materieCode
:
"物料编号"
,
materieCode
:
"物料编号"
,
materieName
:
"物料名称"
,
materieName
:
"物料名称"
,
...
@@ -150,15 +152,15 @@ const Materiel = (props) => {
...
@@ -150,15 +152,15 @@ const Materiel = (props) => {
ChildRef
?.
onRefresh
();
ChildRef
?.
onRefresh
();
}
}
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
manual
:
true
,
formatResult
:
(
res
)
=>
res
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
if
(
result
.
code
==
"0000"
)
{
reload
();
reload
();
dispatch
({
type
:
"close"
});
dispatch
({
type
:
"close"
});
}
}
},
},
}),
}),
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
{
{
vs
,
vs
,
...
@@ -326,9 +328,9 @@ const Materiel = (props) => {
...
@@ -326,9 +328,9 @@ const Materiel = (props) => {
let
all
=
async
()
=>
{
let
all
=
async
()
=>
{
let
common
=
await
doFetch
({
let
common
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterieChar/queryCommonList"
,
url
:
"/ngic-workmanship/pmMaterieChar/queryCommonList"
,
params
:
{
id
:
record
.
id
},
params
:
{
id
:
record
.
id
},
}),
}),
other
=
await
doFetch
({
other
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterieChar/queryListBykey"
,
url
:
"/ngic-workmanship/pmMaterieChar/queryListBykey"
,
params
:
{
params
:
{
...
@@ -344,9 +346,9 @@ const Materiel = (props) => {
...
@@ -344,9 +346,9 @@ const Materiel = (props) => {
};
};
all
().
then
((
res
)
=>
{
all
().
then
((
res
)
=>
{
let
commonDataFields
=
formatFieds
(
let
commonDataFields
=
formatFieds
(
res
?.
commonData
,
res
?.
commonData
,
"common"
"common"
)?.
obj
,
)?.
obj
,
otherDataFields
=
formatFieds
(
res
?.
otherData
,
"other"
)?.
obj
,
otherDataFields
=
formatFieds
(
res
?.
otherData
,
"other"
)?.
obj
,
newCommonData
=
formatFieds
(
res
?.
commonData
,
"common"
)?.
data
,
newCommonData
=
formatFieds
(
res
?.
commonData
,
"common"
)?.
data
,
newOtherData
=
formatFieds
(
res
?.
otherData
,
"other"
)?.
data
;
newOtherData
=
formatFieds
(
res
?.
otherData
,
"other"
)?.
data
;
...
@@ -364,208 +366,208 @@ const Materiel = (props) => {
...
@@ -364,208 +366,208 @@ const Materiel = (props) => {
});
});
}),
}),
ifs
&&
ifs
&&
getPrem
(
"sysDepartment_save"
,
action
,
"编辑物料BOM"
,
()
=>
{
getPrem
(
"sysDepartment_save"
,
action
,
"编辑物料BOM"
,
()
=>
{
let
all
=
async
()
=>
{
let
all
=
async
()
=>
{
let
mark
=
await
doFetch
({
let
mark
=
await
doFetch
({
url
:
"/ngic-base-business/bmSpecialSet/queryByMark"
,
url
:
"/ngic-base-business/bmSpecialSet/queryByMark"
,
params
:
{
mark
:
"materiel_bom"
},
params
:
{
mark
:
"materiel_bom"
},
}),
}),
bom
=
await
doFetch
({
bom
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterieBom/queryByMaterieParentId"
,
url
:
"/ngic-workmanship/pmMaterieBom/queryByMaterieParentId"
,
params
:
{
materieParentId
:
record
.
id
},
params
:
{
materieParentId
:
record
.
id
},
});
});
return
{
return
{
markKey
:
mark
?.
data
?.
value
,
markKey
:
mark
?.
data
?.
value
,
bomData
:
bom
?.
data
?.
dataList
,
bomData
:
bom
?.
data
?.
dataList
,
};
};
};
all
().
then
((
res
)
=>
{
};
const
{
markKey
,
bomData
}
=
res
;
all
().
then
((
res
)
=>
{
let
fields
=
{
const
{
markKey
,
bomData
}
=
res
;
materieBomList
:
{
let
fields
=
{
value
:
JSON
.
parse
(
JSON
.
stringify
(
bomData
)),
materieBomList
:
{
title
:
"BOM信息"
,
value
:
JSON
.
parse
(
JSON
.
stringify
(
bomData
)),
type
:
"table"
,
title
:
"BOM信息"
,
col
:
{
span
:
14
},
type
:
"table"
,
name
:
[
"materieBomList"
],
col
:
{
span
:
14
},
required
:
false
,
name
:
[
"materieBomList"
],
columns
:
[
required
:
false
,
{
columns
:
[
title
:
"物料编号"
,
{
dataIndex
:
"materieCode"
,
title
:
"物料编号"
,
key
:
"materieCode"
,
dataIndex
:
"materieCode"
,
search
:
false
,
key
:
"materieCode"
,
ellipsis
:
true
,
search
:
false
,
editable
:
false
,
ellipsis
:
true
,
},
editable
:
false
,
{
},
title
:
"物料名称"
,
{
dataIndex
:
"materieName"
,
title
:
"物料名称"
,
key
:
"materieName"
,
dataIndex
:
"materieName"
,
search
:
false
,
key
:
"materieName"
,
ellipsis
:
true
,
search
:
false
,
editable
:
false
,
ellipsis
:
true
,
editable
:
false
,
},
{
title
:
"生产单位(主)"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
ellipsis
:
true
,
editable
:
false
,
},
{
title
:
"物料类别"
,
dataIndex
:
"materieTypeName"
,
key
:
"materieTypeName"
,
search
:
false
,
ellipsis
:
true
,
editable
:
false
,
},
{
title
:
"台份量"
,
dataIndex
:
"numberUnits"
,
key
:
"numberUnits"
,
editable
:
true
,
renderFormItem
:
(
item
,
{
fieldProps
,
formItemProps
},
form
)
=>
{
return
(
<
RenderItemType
{
...
fieldProps
}
type=
{
"inputnumber"
}
rowKey=
{
item
.
entry
.
rowKey
}
/>
);
},
},
{
width
:
100
,
title
:
"生产单位(主)"
,
formItemProps
:
(
form
,
config
)
=>
{
dataIndex
:
"productionUnitName"
,
return
{
key
:
"productionUnitName"
,
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
search
:
false
,
};
ellipsis
:
true
,
editable
:
false
,
},
},
{
},
title
:
"物料类别"
,
{
dataIndex
:
"materieTypeName"
,
title
:
"产出工序"
,
key
:
"materieTypeName"
,
dataIndex
:
"workingProduceId"
,
search
:
false
,
key
:
"workingProduceId"
,
ellipsis
:
true
,
valueType
:
"select"
,
editable
:
false
,
width
:
150
,
formItemProps
:
(
form
,
config
)
=>
{
return
{
rules
:
markKey
==
2
||
config
.
entry
.
materieType
==
1
?
[]
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
renderFormItem
:
(
item
,
{
fieldProps
},
form
)
=>
{
title
:
"台份量"
,
if
(
item
.
entry
.
materieType
==
1
||
markKey
==
2
)
{
dataIndex
:
"numberUnits"
,
return
<></>;
key
:
"numberUnits"
,
}
else
{
editable
:
true
,
renderFormItem
:
(
item
,
{
fieldProps
,
formItemProps
},
form
)
=>
{
return
(
return
(
<
RenderItemType
<
RenderItemType
{
...
fieldProps
}
{
...
fieldProps
}
type=
{
"inputnumber"
}
type=
{
"select"
}
selectarr=
{
item
.
entry
.
workingProduceList
??
[]
}
rowKey=
{
item
.
entry
.
rowKey
}
rowKey=
{
item
.
entry
.
rowKey
}
/>
/>
);
);
},
}
width
:
100
,
formItemProps
:
(
form
,
config
)
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
"产出工序"
,
dataIndex
:
"workingProduceId"
,
key
:
"workingProduceId"
,
valueType
:
"select"
,
width
:
150
,
formItemProps
:
(
form
,
config
)
=>
{
return
{
rules
:
markKey
==
2
||
config
.
entry
.
materieType
==
1
?
[]
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
renderFormItem
:
(
item
,
{
fieldProps
},
form
)
=>
{
if
(
item
.
entry
.
materieType
==
1
||
markKey
==
2
)
{
return
<></>;
}
else
{
return
(
<
RenderItemType
{
...
fieldProps
}
type=
{
"select"
}
selectarr=
{
item
.
entry
.
workingProduceList
??
[]
}
rowKey=
{
item
.
entry
.
rowKey
}
/>
);
}
},
},
{
title
:
"投料工序"
,
dataIndex
:
"workingFeedingId"
,
key
:
"workingFeedingId"
,
valueType
:
"select"
,
width
:
150
,
formItemProps
:
(
form
,
config
)
=>
{
return
{
rules
:
markKey
==
2
?
[]
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
renderFormItem
:
(
item
,
{
fieldProps
},
form
)
=>
{
if
(
markKey
==
2
)
{
return
<></>;
}
else
{
return
(
<
RenderItemType
{
...
fieldProps
}
type=
{
"select"
}
selectarr=
{
item
.
entry
.
workingFeedingList
??
[]
}
rowKey=
{
item
.
entry
.
rowKey
}
/>
);
}
},
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key=
"delete"
>
删除
</
a
>,
],
},
],
rowKey
:
"rowKey"
,
recordCreatorProps
:
"false"
,
},
materieList
:
{
value
:
[],
type
:
"checktable"
,
title
:
"物料信息"
,
name
:
[
"materieList"
],
required
:
false
,
columns
:
[
{
title
:
"物料编号"
,
dataIndex
:
"materieCode"
,
key
:
"materieCode"
,
},
{
title
:
"物料名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
},
{
title
:
"生产单位(主)"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
},
},
{
},
title
:
"物料类别"
,
{
dataIndex
:
"materieTypeName"
,
title
:
"投料工序"
,
key
:
"materieTypeName"
,
dataIndex
:
"workingFeedingId"
,
search
:
false
,
key
:
"workingFeedingId"
,
valueType
:
"select"
,
width
:
150
,
formItemProps
:
(
form
,
config
)
=>
{
return
{
rules
:
markKey
==
2
?
[]
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
renderFormItem
:
(
item
,
{
fieldProps
},
form
)
=>
{
title
:
"描述"
,
if
(
markKey
==
2
)
{
dataIndex
:
"remark"
,
return
<></>;
key
:
"remark"
,
}
else
{
search
:
false
,
return
(
<
RenderItemType
{
...
fieldProps
}
type=
{
"select"
}
selectarr=
{
item
.
entry
.
workingFeedingList
??
[]
}
rowKey=
{
item
.
entry
.
rowKey
}
/>
);
}
},
},
],
},
editable
:
true
,
{
path
:
"/ngic-workmanship/pmMaterie/queryBomById"
,
title
:
"操作"
,
extraparams
:
{
id
:
record
.
id
},
valueType
:
"option"
,
rowKey
:
"id"
,
width
:
70
,
rowName
:
"materieName"
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
tabletype
:
"checkbox"
,
<
a
key=
"delete"
>
删除
</
a
>,
pageSize
:
10
,
],
col
:
{
span
:
10
},
},
},
],
};
rowKey
:
"rowKey"
,
dispatch
({
type
:
"bom"
,
fields
,
curitem
:
record
,
markKey
});
recordCreatorProps
:
"false"
,
});
},
}),
materieList
:
{
value
:
[],
type
:
"checktable"
,
title
:
"物料信息"
,
name
:
[
"materieList"
],
required
:
false
,
columns
:
[
{
title
:
"物料编号"
,
dataIndex
:
"materieCode"
,
key
:
"materieCode"
,
},
{
title
:
"物料名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
},
{
title
:
"生产单位(主)"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
},
{
title
:
"物料类别"
,
dataIndex
:
"materieTypeName"
,
key
:
"materieTypeName"
,
search
:
false
,
},
{
title
:
"描述"
,
dataIndex
:
"remark"
,
key
:
"remark"
,
search
:
false
,
},
],
editable
:
true
,
path
:
"/ngic-workmanship/pmMaterie/queryBomById"
,
extraparams
:
{
id
:
record
.
id
},
rowKey
:
"id"
,
rowName
:
"materieName"
,
tabletype
:
"checkbox"
,
pageSize
:
10
,
col
:
{
span
:
10
},
},
};
dispatch
({
type
:
"bom"
,
fields
,
curitem
:
record
,
markKey
});
});
}),
getPrem
(
"sysDepartment_deleteById"
,
action
,
"删除"
,
null
,
{
getPrem
(
"sysDepartment_deleteById"
,
action
,
"删除"
,
null
,
{
title
:
"确认删除该物料?"
,
title
:
"确认删除该物料?"
,
onConfirm
:
()
=>
{
onConfirm
:
()
=>
{
...
@@ -638,9 +640,9 @@ const Materiel = (props) => {
...
@@ -638,9 +640,9 @@ const Materiel = (props) => {
url
=
"/ngic-workmanship/pmMaterie/save"
;
url
=
"/ngic-workmanship/pmMaterie/save"
;
run
({
url
,
params
});
run
({
url
,
params
});
})
})
.
catch
((
error
)
=>
{});
.
catch
((
error
)
=>
{
});
})
})
.
catch
((
error
)
=>
{});
.
catch
((
error
)
=>
{
});
}
else
{
}
else
{
url
=
"/ngic-workmanship/pmMaterie/saveMaterieBom"
;
url
=
"/ngic-workmanship/pmMaterie/saveMaterieBom"
;
let
firstValues
=
formRef
?.
getFieldsValue
();
let
firstValues
=
formRef
?.
getFieldsValue
();
...
@@ -727,8 +729,8 @@ const Materiel = (props) => {
...
@@ -727,8 +729,8 @@ const Materiel = (props) => {
item
?.
fieldRealValue
==
0
||
item
?.
fieldRealValue
item
?.
fieldRealValue
==
0
||
item
?.
fieldRealValue
?
item
?.
fieldRealValue
?
item
?.
fieldRealValue
:
item
.
fieldChar
==
4
:
item
.
fieldChar
==
4
?
[]
?
[]
:
""
,
:
""
,
title
:
item
.
fieldName
,
title
:
item
.
fieldName
,
name
:
[
fieldsKey
],
name
:
[
fieldsKey
],
required
:
false
,
required
:
false
,
...
@@ -752,7 +754,17 @@ const Materiel = (props) => {
...
@@ -752,7 +754,17 @@ const Materiel = (props) => {
path=
"/ngic-workmanship/pmMaterie/queryList"
path=
"/ngic-workmanship/pmMaterie/queryList"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
></
AutoTable
>
>
<
TreeRender
url=
"/ngic-workmanship/pmMaterieType/queryTreeList"
deleteurl=
"/ngic-workmanship/pmMaterieType/deleteById"
saveurl=
"/ngic-workmanship/materieType/save"
onselected=
{
(
vals
)
=>
{
console
.
log
(
vals
);
}
}
/>
</
AutoTable
>
<
Drawer
<
Drawer
title=
{
iftype
.
title
}
title=
{
iftype
.
title
}
visible=
{
vs
}
visible=
{
vs
}
...
@@ -839,7 +851,7 @@ const Materiel = (props) => {
...
@@ -839,7 +851,7 @@ const Materiel = (props) => {
<
InitForm
<
InitForm
formRef=
{
formRef
}
formRef=
{
formRef
}
fields=
{
fields
}
fields=
{
fields
}
onChange=
{
(
changedValues
,
allValues
)
=>
{}
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
}
}
actions=
{
()
=>
{
actions=
{
()
=>
{
return
null
;
return
null
;
}
}
}
}
...
@@ -908,7 +920,7 @@ const Materiel = (props) => {
...
@@ -908,7 +920,7 @@ const Materiel = (props) => {
<
InitForm
<
InitForm
formRef=
{
formRefs
}
formRef=
{
formRefs
}
fields=
{
specificFileds
}
fields=
{
specificFileds
}
onChange=
{
(
changedValues
,
allValues
)
=>
{}
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
}
}
actions=
{
()
=>
{
actions=
{
()
=>
{
return
null
;
return
null
;
}
}
}
}
...
...
src/pages/platform/Provide/index.jsx
View file @
0d299f54
...
@@ -157,7 +157,7 @@ const Deviceprovide = (props) => {
...
@@ -157,7 +157,7 @@ const Deviceprovide = (props) => {
return
<
Popconfirm
return
<
Popconfirm
title=
"是否开启或关闭供应商?"
title=
"是否开启或关闭供应商?"
onConfirm=
{
()
=>
{
onConfirm=
{
()
=>
{
run
({
url
:
"/
qj/ngic-equipment-asset/equipment
Supplier/update/status"
,
params
:
{
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
}
})
run
({
url
:
"/
ngic-auth/sys
Supplier/update/status"
,
params
:
{
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
}
})
}
}
}
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
@@ -182,6 +182,7 @@ const Deviceprovide = (props) => {
...
@@ -182,6 +182,7 @@ const Deviceprovide = (props) => {
formatResult
:
(
res
)
=>
res
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
if
(
result
.
code
==
"0000"
)
{
message
.
success
(
"操作成功!"
)
reload
();
reload
();
dispatch
({
type
:
"close"
})
dispatch
({
type
:
"close"
})
}
}
...
@@ -200,23 +201,12 @@ const Deviceprovide = (props) => {
...
@@ -200,23 +201,12 @@ const Deviceprovide = (props) => {
}
}
})
})
}),
}),
<
Deletecheck
getPrem
(
"equipmentSupplier_deleteById"
,
action
,
'删除'
,
null
,{
name=
{
"equipmentSupplier_deleteById"
}
title
:
"确认删除该供应商?"
,
type=
{
action
}
onConfirm
:
()
=>
{
text=
"删除"
run
({
url
:
"/ngic-auth/sysSupplier/deleteById"
,
params
:
{
id
:
record
.
id
}
})
clickfn=
{
()
=>
{
return
deleteProvideCheck
({
id
:
record
.
id
,
deleteCheck
:
true
})
}
}
pop=
{
{
title
:
"确认删除该供应商?"
,
onConfirm
:
()
=>
{
run
({
url
:
"/qj/ngic-equipment-asset/equipmentSupplier/deleteById"
,
params
:
{
id
:
record
.
id
}
})
}
}
}
}
btnType=
"deleteCheck"
})
/>
];
];
};
};
let
saveData
=
(
values
,
fn
)
=>
{
let
saveData
=
(
values
,
fn
)
=>
{
...
@@ -231,7 +221,7 @@ const Deviceprovide = (props) => {
...
@@ -231,7 +221,7 @@ const Deviceprovide = (props) => {
...
newfields
,
...
newfields
,
supplierUserList
supplierUserList
}
}
run
({
url
:
"/
qj/ngic-equipment-asset/equipment
Supplier/save"
,
params
:
{
...
params
,
...
difrid
}
})
run
({
url
:
"/
ngic-auth/sys
Supplier/save"
,
params
:
{
...
params
,
...
difrid
}
})
};
};
let
extrarender
=
([
let
extrarender
=
([
<
Button
disabled=
{
!
getPrem
(
"equipmentSupplier_save"
,
"ifs"
)
}
type=
"primary"
onClick=
{
()
=>
{
<
Button
disabled=
{
!
getPrem
(
"equipmentSupplier_save"
,
"ifs"
)
}
type=
"primary"
onClick=
{
()
=>
{
...
@@ -249,7 +239,7 @@ const Deviceprovide = (props) => {
...
@@ -249,7 +239,7 @@ const Deviceprovide = (props) => {
pagetitle=
{
props
.
route
.
name
}
//页面标题
pagetitle=
{
props
.
route
.
name
}
//页面标题
pageextra=
{
extrarender
}
//页面操作 新增or批量删除
pageextra=
{
extrarender
}
//页面操作 新增or批量删除
columns=
{
columns
}
columns=
{
columns
}
path=
"/
qj/ngic-equipment-asset/equipment
Supplier/queryList"
path=
"/
ngic-auth/sys
Supplier/queryList"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
onRef=
{
node
=>
ChildRef
=
node
}
onRef=
{
node
=>
ChildRef
=
node
}
></
AutoTable
>
></
AutoTable
>
...
...
src/services/device.js
View file @
0d299f54
...
@@ -2,7 +2,7 @@ import request from '@/utils/request';
...
@@ -2,7 +2,7 @@ import request from '@/utils/request';
//设备型号下拉框
//设备型号下拉框
export
async
function
equipmentModelList
(
params
)
{
export
async
function
equipmentModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -10,91 +10,91 @@ export async function equipmentModelList(params) {
...
@@ -10,91 +10,91 @@ export async function equipmentModelList(params) {
//设备型号--(保养标准页面)下拉框
//设备型号--(保养标准页面)下拉框
export
async
function
equipmentMaintainModelList
(
params
)
{
export
async
function
equipmentMaintainModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection/maintainStandard'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection/maintainStandard'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备型号--(点检标准页面)下拉框
//设备型号--(点检标准页面)下拉框
export
async
function
equipmentCheckModelList
(
params
)
{
export
async
function
equipmentCheckModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection/checkStandard'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection/checkStandard'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据设备型号id查询是寿命件的备件
//根据设备型号id查询是寿命件的备件
export
async
function
lifespareSelect
(
params
)
{
export
async
function
lifespareSelect
(
params
)
{
return
request
(
`/
qj
/ngic-equipment-asset/equipmentModelSpare/liveparts/selectionbox/byEquipmentModelId`
,
{
return
request
(
`/
wms
/ngic-equipment-asset/equipmentModelSpare/liveparts/selectionbox/byEquipmentModelId`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
data
:
params
});
});
}
}
//备件下拉框
//备件下拉框
export
async
function
mdmSpareList
(
params
)
{
export
async
function
mdmSpareList
(
params
)
{
return
request
(
`/
qj
/ngic-spare-parts/mdmSpareParts/mdmSpareList`
,
{
return
request
(
`/
wms
/ngic-spare-parts/mdmSpareParts/mdmSpareList`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
data
:
params
});
});
}
}
//设备供应商详情
//设备供应商详情
export
async
function
deviceprovideDetail
(
params
)
{
export
async
function
deviceprovideDetail
(
params
)
{
return
request
(
'/
qj/ngic-equipment-asset/equipment
Supplier/query/detail'
,
{
return
request
(
'/
wms/ngic-auth/sys
Supplier/query/detail'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//供应商下拉框
//供应商下拉框
export
async
function
equipmentSupplierList
(
params
)
{
export
async
function
equipmentSupplierList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentSupplier/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentSupplier/query/selection'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备供应商删除前校验
//设备供应商删除前校验
export
async
function
deleteProvideCheck
(
params
)
{
export
async
function
deleteProvideCheck
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentSupplier/deleteById'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentSupplier/deleteById'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备信息
//设备信息
export
async
function
equipmentDetail
(
params
)
{
export
async
function
equipmentDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/queryDetail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/queryDetail'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//查询父设备id和子设备id,添加子设备时使用
//查询父设备id和子设备id,添加子设备时使用
export
async
function
equipmentChildren
(
params
)
{
export
async
function
equipmentChildren
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/queryChildren'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/queryChildren'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//履历详情
//履历详情
export
async
function
equipmentLogDetail
(
params
)
{
export
async
function
equipmentLogDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentLog/query/detail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentLog/query/detail'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备类型树查询
//设备类型树查询
export
async
function
deviceTypequeryTreeList
(
params
)
{
export
async
function
deviceTypequeryTreeList
(
params
)
{
return
request
(
`/
qj
/ngic-equipment-asset/equipmentType/queryTreeList`
,
{
return
request
(
`/
wms
/ngic-equipment-asset/equipmentType/queryTreeList`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备详情
//设备详情
export
async
function
equipmentAllDetail
(
params
)
{
export
async
function
equipmentAllDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/query/all/detail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/query/all/detail'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//设备型号详情
//设备型号详情
export
async
function
equipmentModelDetails
(
params
)
{
export
async
function
equipmentModelDetails
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModelSpare/queryById'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModelSpare/queryById'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -102,14 +102,14 @@ export async function equipmentModelDetails(params) {
...
@@ -102,14 +102,14 @@ export async function equipmentModelDetails(params) {
//设备下拉框
//设备下拉框
export
async
function
equipmentList
(
params
)
{
export
async
function
equipmentList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/query/selection'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//IOT设备下拉框
//IOT设备下拉框
export
async
function
equipmentIotRelationList
(
params
)
{
export
async
function
equipmentIotRelationList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentIotRelation/query/device/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentIotRelation/query/device/selection'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -117,7 +117,7 @@ export async function equipmentIotRelationList(params) {
...
@@ -117,7 +117,7 @@ export async function equipmentIotRelationList(params) {
//设备下拉框(过滤已报修)
//设备下拉框(过滤已报修)
export
async
function
canApplyRepair
(
params
)
{
export
async
function
canApplyRepair
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-repair/omEquipmentApplyRepair/canApplyRepair/equipmens/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-repair/omEquipmentApplyRepair/canApplyRepair/equipmens/selection'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -125,7 +125,7 @@ export async function canApplyRepair(params) {
...
@@ -125,7 +125,7 @@ export async function canApplyRepair(params) {
//关联备件
//关联备件
export
async
function
equipmentModelSpareImport
(
params
)
{
export
async
function
equipmentModelSpareImport
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModelSpare/importExcel'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModelSpare/importExcel'
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
type
:
"form"
type
:
"form"
...
...
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