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
281248ef
Commit
281248ef
authored
Jun 20, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
0d299f54
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
196 additions
and
386 deletions
+196
-386
proxy.js
config/proxy.js
+1
-1
index.jsx
src/components/Tableform/index.jsx
+9
-6
index.jsx
src/components/TreeRender/index.jsx
+117
-79
Index.jsx
src/pages/craft/Materiel/Index.jsx
+69
-300
No files found.
config/proxy.js
View file @
281248ef
...
...
@@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/wms/"
:
{
// 要代理的地址
target
:
"http://192.168.40.
134
:18040/"
,
//39:18040 23/wms/ //60 翔
target
:
"http://192.168.40.
212
:18040/"
,
//39:18040 23/wms/ //60 翔
changeOrigin
:
true
,
pathRewrite
:
{
"^/wms"
:
""
,
...
...
src/components/Tableform/index.jsx
View file @
281248ef
...
...
@@ -7,7 +7,7 @@ export default (props) => {
const
screens
=
useBreakpoint
();
return
(
<
div
>
<
div
className=
"diycard"
>
{
screens
.
xs
?
(
<
div
style=
{
{
display
:
"flex"
,
flexDirection
:
"column"
,
height
:
"100%"
}
}
...
...
@@ -20,12 +20,13 @@ export default (props) => {
</
div
>
</
div
>
)
:
props
.
withCard
===
false
?
(
<
div
style=
{
{
display
:
"flex"
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
</
div
>
{
(
props
.
childposition
==
"right"
||
!
props
.
childposition
)
&&
props
.
children
}
</
div
>
...
...
@@ -39,8 +40,10 @@ export default (props) => {
tabList=
{
props
.
tabList
}
onTabChange=
{
props
.
onTabChange
}
>
<
div
style=
{
{
display
:
"flex"
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
</
div
>
...
...
src/components/TreeRender/index.jsx
View file @
281248ef
import
React
,
{
useState
,
useMemo
}
from
'react'
;
import
{
Tree
,
Input
,
Card
,
Tooltip
,
Divider
}
from
'antd'
;
import
{
MinusSquareOutlined
,
FormOutlined
,
PlusSquareOutlined
}
from
'@ant-design/icons'
;
import
React
,
{
useState
,
useMemo
,
useRef
,
createContext
}
from
'react'
;
import
{
Tree
,
Input
,
Popconfirm
,
Tooltip
,
Divider
,
Modal
,
message
}
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
;
const
ReachableContext
=
createContext
(
null
);
let
{
Search
}
=
Input
,
{
TreeNode
}
=
Tree
;
function
TreeRender
({
url
,
deleteurl
,
saveurl
,
onselected
})
{
const
[
search
,
setsearch
]
=
useState
(
""
);
const
{
data
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
{
title
:
search
}
})
const
[
savetitle
,
setsavetitle
]
=
useState
(
null
);
const
[
modal
,
setModal
]
=
useState
({
visible
:
false
});
const
{
data
,
loading
,
refresh
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
{
title
:
search
}
})
},{
refreshDeps
:[
search
]
});
const
ref1
=
useRef
(),
ref2
=
useRef
();
const
treeData
=
useMemo
(()
=>
{
return
data
?.
data
?.
dataList
??
[]
},
[
data
]);
...
...
@@ -25,7 +35,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
const
title
=
index
>
-
1
?
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
6
8
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
8
8
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
beforeStr
}
<
span
style=
{
{
color
:
'#f50'
}
}
>
{
search
}
</
span
>
{
afterStr
}
...
...
@@ -33,7 +43,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
</
Tooltip
>
)
:
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
6
8
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
item
.
title
}
</
span
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
8
8
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
item
.
title
}
</
span
>
</
Tooltip
>
);
...
...
@@ -43,43 +53,16 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
<
Tooltip
title=
"编辑"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
setsavetitle
(
null
)
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>
,
setModal
({
visible
:
true
,
closable
:
true
,
title
:
"修改电表结构名称"
,
content
:
<
div
>
<
Input
placeholder=
{
item
.
title
}
allowClear
onChange=
{
(
e
)
=>
{
_it
.
setState
({
savetitle
:
e
.
target
.
value
})
}
}
></
Input
>
</
div
>,
title
:
"修改节点名称"
,
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
()
}
})
}
placeholder
:
item
.
title
,
key
:
item
.
key
})
}
}
}
>
...
...
@@ -91,46 +74,18 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
disabled=
{
!
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
)
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
setsavetitle
(
null
)
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>
,
setModal
({
visible
:
true
,
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
()
}
})
}
placeholder
:
item
.
title
,
key
:
item
.
key
})
}
}
}
style=
{
{
color
:
`${getPrem("enElectricityMeterType_save", "ifs") ? "green" : ""}`
}
}
/></
Tooltip
>
...
...
@@ -142,13 +97,14 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
(
!
item
.
children
||
item
.
children
.
length
==
0
)
&&
<
Popconfirm
placement=
'bottom'
title=
"是否删除该
电表结构
?"
title=
"是否删除该
节点
?"
okText=
"删除"
cancelText=
"取消"
onConfirm=
{
()
=>
{
ammeterTreeDelete
({
id
:
item
.
key
}).
then
(
res
=>
{
doFetch
({
url
:
deleteurl
,
params
:
{
id
:
item
.
key
}
}).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
this
.
resetData
()
message
.
success
(
"操作成功"
)
refresh
();
}
})
}
}
...
...
@@ -178,9 +134,91 @@ function TreeRender({ url, deleteurl, saveurl, onselected }) {
</
TreeNode
>
);
});
return
(
<
div
>
<
Search
style=
{
{
margin
:
'16px 0 8px 0'
}
}
placeholder=
"搜索电表结构"
onChange=
{
setsearch
}
/>
<
Modal
{
...
modal
}
onCancel=
{
()
=>
{
setModal
(
s
=>
({
...
s
,
visible
:
false
}))
}
}
onOk=
{
()
=>
{
if
(
modal
.
okText
==
"修改"
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
savetitle
)
{
console
.
log
(
ref1
.
current
);
doFetch
({
url
:
saveurl
,
params
:
{
materieTypeName
:
savetitle
,
id
:
modal
.
key
,
}
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
message
.
success
(
"操作成功"
)
refresh
()
setModal
({
visible
:
false
})
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
savetitle
)
{
doFetch
({
url
:
saveurl
,
params
:
{
materieTypeName
:
savetitle
,
parentId
:
modal
.
key
,
}
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
message
.
success
(
"操作成功"
)
refresh
()
setModal
({
visible
:
false
})
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
}
}
>
{
modal
.
okText
==
"修改"
?
<
div
>
<
Input
placeholder=
{
modal
.
placeholder
}
allowClear
value=
{
savetitle
}
onChange=
{
(
e
)
=>
{
setsavetitle
(
e
.
target
.
value
)
}
}
></
Input
>
</
div
>
:
<
div
>
<
div
style=
{
{
marginBottom
:
15
,
color
:
"#f50"
,
fontSize
:
16
}
}
>
当前结构:
{
modal
.
placeholder
}
</
div
>
<
Input
placeholder=
"子结构"
allowClear
onChange=
{
(
e
)
=>
{
setsavetitle
(
e
.
target
.
value
)
}
}
></
Input
>
</
div
>
}
</
Modal
>
<
Search
value=
{
search
}
style=
{
{
margin
:
'16px 0 8px 0'
}
}
placeholder=
"搜索"
onChange=
{
(
e
)
=>
{
setsearch
(
e
.
target
.
value
)
}
}
/>
<
Tree
onSelect=
{
(
selectedKeys
,
e
)
=>
{
...
...
src/pages/craft/Materiel/Index.jsx
View file @
281248ef
import
React
,
{
use
Effect
,
useRef
,
useReducer
}
from
"react"
;
import
React
,
{
use
State
,
useRef
,
useReducer
}
from
"react"
;
import
{
Button
,
Tooltip
,
Row
,
Divider
,
Drawer
,
Form
,
message
}
from
"antd"
;
import
AutoTable
from
"@/components/
AutoTable
"
;
import
AutoTable
from
"@/components/
Tableform
"
;
import
getPrem
from
"@/utils/getPrem"
;
//权限判断fn
import
{
useRequest
}
from
"umi"
;
import
defaultFields
from
"./fields"
;
...
...
@@ -13,6 +13,7 @@ import moment from "moment";
import
Coltext
from
"@/components/Coltext"
;
import
RenderItemType
from
"@/components/RenderItemType"
;
import
TreeRender
from
'@/components/TreeRender'
import
{
set
}
from
"lodash"
;
const
initState
=
{
vs
:
false
,
...
...
@@ -32,7 +33,7 @@ const initState = {
otherBasic
=
{
materieCode
:
"物料编号"
,
materieName
:
"物料名称"
,
materieTypeName
:
"物料类
别
"
,
materieTypeName
:
"物料类
型
"
,
productionUnitName
:
"生产单位(主)"
,
processLineName
:
"工艺路线"
,
};
...
...
@@ -147,6 +148,7 @@ const Materiel = (props) => {
ChildRef
=
null
,
[
formRef
]
=
Form
.
useForm
(),
[
formRefs
]
=
Form
.
useForm
();
const
[
materieTypeId
,
setmaterieTypeId
]
=
useState
();
function
reload
()
{
actionRef
?.
current
?.
reload
();
ChildRef
?.
onRefresh
();
...
...
@@ -226,64 +228,69 @@ const Materiel = (props) => {
},
},
{
title
:
"生产单位(主)"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
},
{
title
:
"物料类别"
,
title
:
"物料类型"
,
dataIndex
:
"materieTypeName"
,
key
:
"materieTypeName"
,
options
:
[
{
label
:
"自制件"
,
value
:
0
,
},
{
label
:
"采购件"
,
value
:
1
,
},
{
label
:
"虚拟件"
,
value
:
2
,
},
],
valueType
:
"select"
,
formItemProps
:
{
name
:
"materieType"
,
},
search
:
false
},
{
title
:
"物料管控"
,
dataIndex
:
"materialControlName"
,
key
:
"materialControlName"
,
options
:
[
{
label
:
"单品管控"
,
value
:
0
,
},
{
label
:
"批次管控"
,
value
:
1
,
},
],
dataIndex
:
"materieControlName"
,
key
:
"materieControlName"
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieControlSelect"
}),
params
:
{}
},
valueType
:
"select"
,
formItemProps
:
{
name
:
"materi
al
Control"
,
name
:
"materi
e
Control"
,
},
search
:
false
,
},
{
title
:
"工艺线路"
,
dataIndex
:
"processLineName"
,
key
:
"processLineName"
,
search
:
false
,
},
{
title
:
"保质期"
,
dataIndex
:
"qualityGuaranteePeriod"
,
key
:
"qualityGuaranteePeriod"
,
search
:
false
,
render
:(
text
,
row
)
=>
{
return
row
.
qualityGuaranteePeriod
+
" "
+
row
.
qualityGuaranteePeriodUnitName
}
},
{
title
:
"
描述
"
,
dataIndex
:
"
remark
"
,
key
:
"
remark
"
,
title
:
"
最大库存
"
,
dataIndex
:
"
inventoryMax
"
,
key
:
"
inventoryMax
"
,
search
:
false
,
},
{
title
:
"最小库存"
,
dataIndex
:
"inventoryMin"
,
key
:
"inventoryMin"
,
search
:
false
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieUnitSelect"
}),
params
:
{}
},
valueType
:
"select"
,
formItemProps
:
{
name
:
"productionUnit"
,
},
},
{
title
:
"操作"
,
dataIndex
:
"option_dataindex"
,
...
...
@@ -294,7 +301,6 @@ const Materiel = (props) => {
},
];
function
extraAction
(
text
,
record
,
_
,
action
)
{
let
ifs
=
record
.
materieType
!=
1
;
return
[
getPrem
(
"sysDepartment_save"
,
action
,
"修改"
,
()
=>
{
doFetch
({
...
...
@@ -335,7 +341,7 @@ const Materiel = (props) => {
url
:
"/ngic-workmanship/pmMaterieChar/queryListBykey"
,
params
:
{
id
:
record
.
id
,
materi
alControl
:
record
.
material
Control
,
materi
eControl
:
record
.
materie
Control
,
},
});
...
...
@@ -365,209 +371,6 @@ const Materiel = (props) => {
}
});
}),
ifs
&&
getPrem
(
"sysDepartment_save"
,
action
,
"编辑物料BOM"
,
()
=>
{
let
all
=
async
()
=>
{
let
mark
=
await
doFetch
({
url
:
"/ngic-base-business/bmSpecialSet/queryByMark"
,
params
:
{
mark
:
"materiel_bom"
},
}),
bom
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterieBom/queryByMaterieParentId"
,
params
:
{
materieParentId
:
record
.
id
},
});
return
{
markKey
:
mark
?.
data
?.
value
,
bomData
:
bom
?.
data
?.
dataList
,
};
};
all
().
then
((
res
)
=>
{
const
{
markKey
,
bomData
}
=
res
;
let
fields
=
{
materieBomList
:
{
value
:
JSON
.
parse
(
JSON
.
stringify
(
bomData
)),
title
:
"BOM信息"
,
type
:
"table"
,
col
:
{
span
:
14
},
name
:
[
"materieBomList"
],
required
:
false
,
columns
:
[
{
title
:
"物料编号"
,
dataIndex
:
"materieCode"
,
key
:
"materieCode"
,
search
:
false
,
ellipsis
:
true
,
editable
:
false
,
},
{
title
:
"物料名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
search
:
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
,
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"
,
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
,
{
title
:
"确认删除该物料?"
,
onConfirm
:
()
=>
{
...
...
@@ -669,7 +472,6 @@ const Materiel = (props) => {
let
extrarender
=
[
<
Button
disabled=
{
!
getPrem
(
"sysDepartment_save"
,
"ifs"
)
}
style=
{
{
marginRight
:
15
}
}
type=
"primary"
onClick=
{
()
=>
{
doFetch
({
...
...
@@ -684,7 +486,7 @@ const Materiel = (props) => {
defaultFields
[
i
].
value
=
null
;
defaultFields
[
i
].
disabled
=
false
;
if
(
i
==
"materi
al
Control"
||
i
==
"materi
e
Control"
||
i
==
"serialNumberRuleId"
||
i
==
"labelTemplateId"
||
i
==
"processLineId"
...
...
@@ -754,15 +556,20 @@ const Materiel = (props) => {
path=
"/ngic-workmanship/pmMaterie/queryList"
actionRef=
{
actionRef
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
childposition=
"left"
extraparams=
{
{
materieTypeId
:
materieTypeId
}
}
>
<
TreeRender
url=
"/ngic-workmanship/pmMaterieType/queryTreeList"
deleteurl=
"/ngic-workmanship/pmMaterieType/deleteById"
saveurl=
"/ngic-workmanship/materieType/save"
onselected=
{
(
vals
)
=>
{
console
.
log
(
vals
);
}
}
/>
<
div
style=
{
{
width
:
260
,
flexShrink
:
0
,
marginTop
:
-
4
,
borderRight
:
"1px solid #f0f0f0"
,
paddingRight
:
12
,
marginRight
:
12
}
}
>
<
TreeRender
url=
"/ngic-workmanship/pmMaterieType/queryTreeList"
deleteurl=
"/ngic-workmanship/pmMaterieType/deleteById"
saveurl=
"/ngic-workmanship/pmMaterieType/save"
onselected=
{
(
vals
)
=>
{
setmaterieTypeId
(
vals
[
0
]
??
''
)
}
}
/>
</
div
>
</
AutoTable
>
<
Drawer
...
...
@@ -806,44 +613,6 @@ const Materiel = (props) => {
materieBomList
:
[...
newDatas
],
materieList
:
[],
});
// let newFields = JSON.parse(JSON.stringify(fields));
// for (let i in newFields)
{
// if (i == "materieBomList")
{
// newFields[i].columns[4].renderFormItem = (item,
{
fieldProps
,
formItemProps
},
form
)
=>
{
// return <RenderItemType
{...
fieldProps
}
type
=
{
'inputnumber'
}
rowKey
=
{
item
.
entry
.
rowKey
}
/>
;
//
};
// newFields[i].columns[5].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
}
// />
//
}
//
};
// newFields[i].columns[6].renderFormItem = (item,
{
fieldProps
},
form
)
=>
{
// if (markKey == 2)
{
// return (
// <></>
// );
//
}
else
{
// return <RenderItemType
//
{...
fieldProps
}
// type=
{
'select'
}
// selectarr=
{
item
.
entry
.
workingFeedingList
??
[]}
// rowKey=
{
item
.
entry
.
rowKey
}
// />
//
}
//
};
// newFields[i].value = [...newDatas]
//
}
//
}
// dispatch(
{
type
:
"changeFields"
,
fields
:
{
...
newFields
}
});
}
}
>
添加至Bom信息
...
...
@@ -864,11 +633,11 @@ const Materiel = (props) => {
fields=
{
fields
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
for
(
let
i
in
changedValues
)
{
if
(
i
==
"materi
al
Control"
)
{
if
(
i
==
"materi
e
Control"
)
{
doFetch
({
url
:
"/ngic-workmanship/pmMaterieChar/queryListBykey"
,
params
:
{
materi
al
Control
:
changedValues
[
i
],
materi
e
Control
:
changedValues
[
i
],
id
:
iftype
.
val
==
"edit"
?
curitem
.
id
:
""
,
},
}).
then
((
res
)
=>
{
...
...
@@ -893,7 +662,7 @@ const Materiel = (props) => {
if
(
i
==
"materieType"
)
{
for
(
let
j
in
fields
)
{
if
(
j
==
"materi
al
Control"
||
j
==
"materi
e
Control"
||
j
==
"serialNumberRuleId"
||
j
==
"processLineId"
||
j
==
"labelTemplateId"
...
...
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