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
be8eed64
Commit
be8eed64
authored
Jul 21, 2023
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
a4479aff
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
716 additions
and
625 deletions
+716
-625
index.jsx
src/components/InitForm/index.jsx
+11
-4
Welcome.jsx
src/pages/Welcome.jsx
+2
-2
fields.js
src/pages/craft/Materiel/fields.js
+96
-93
index.jsx
src/pages/craft/Materiel/index.jsx
+25
-69
Index.jsx
src/pages/schedule/Shiftgroup/Index.jsx
+4
-4
index.jsx
src/pages/system/Area/index.jsx
+2
-2
fields.js
src/pages/system/Reservoir/fields.js
+121
-169
index.jsx
src/pages/system/Reservoir/index.jsx
+451
-279
index.jsx
src/pages/system/Store/index.jsx
+1
-0
detailTotalCard.js
src/utils/detailTotalCard.js
+3
-3
No files found.
src/components/InitForm/index.jsx
View file @
be8eed64
...
@@ -17,6 +17,7 @@ import {
...
@@ -17,6 +17,7 @@ import {
Cascader
,
Cascader
,
ConfigProvider
,
ConfigProvider
,
Rate
,
Rate
,
Divider
,
}
from
"antd"
;
}
from
"antd"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
...
@@ -141,7 +142,6 @@ let InitForm = ({
...
@@ -141,7 +142,6 @@ let InitForm = ({
[
ind
,
cind
]
=
useState
(
0
);
[
ind
,
cind
]
=
useState
(
0
);
form
=
formRef
?
formRef
:
form
;
form
=
formRef
?
formRef
:
form
;
useEffect
(()
=>
{
useEffect
(()
=>
{
let
Doms
=
[],
let
Doms
=
[],
klink
=
{},
klink
=
{},
...
@@ -378,7 +378,7 @@ let InitForm = ({
...
@@ -378,7 +378,7 @@ let InitForm = ({
);
);
let
getOptions
=
async
(
options
,
item
)
=>
{
let
getOptions
=
async
(
options
,
item
)
=>
{
let
curkey
=
item
.
name
[
0
];
let
curkey
=
item
?
.
name
[
0
];
if
(
Array
.
isArray
(
options
))
{
if
(
Array
.
isArray
(
options
))
{
if
(
JSON
.
stringify
(
optiondom
[
curkey
])
!==
JSON
.
stringify
(
options
))
{
if
(
JSON
.
stringify
(
optiondom
[
curkey
])
!==
JSON
.
stringify
(
options
))
{
cdom
((
optiondom
)
=>
{
cdom
((
optiondom
)
=>
{
...
@@ -627,8 +627,9 @@ let InitForm = ({
...
@@ -627,8 +627,9 @@ let InitForm = ({
},
},
item
.
name
[
0
].
indexOf
(
"phone"
)
!=
-
1
item
.
name
[
0
].
indexOf
(
"phone"
)
!=
-
1
?
{
?
{
pattern
:
/^
(((\d
{3,4}-
)?[
0-9
]
{7,8}
)
|
(
1
(
3|4|5|6|7|8|9
)\d
{9}
))
$/
,
pattern
:
message
:
item
.
title
+
"格式不正确"
,
/^
(((\d
{3,4}-
)?[
0-9
]
{7,8}
)
|
(
1
(
3|4|5|6|7|8|9
)\d
{9}
))
$/
,
message
:
item
.
title
+
"格式不正确"
,
}
}
:
item
.
name
[
0
].
indexOf
(
"mail"
)
!=
-
1
:
item
.
name
[
0
].
indexOf
(
"mail"
)
!=
-
1
?
{
?
{
...
@@ -1244,6 +1245,12 @@ let InitForm = ({
...
@@ -1244,6 +1245,12 @@ let InitForm = ({
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
)
:
null
;
)
:
null
;
}
else
if
(
item
.
type
==
"split"
)
{
return
!
extraprops
.
hides
?
(
<
Col
key=
{
i
}
{
...
getCol
(
item
.
col
)}
>
<
Divider
orientation=
"left"
style=
{
{
fontWeight
:
600
,
fontSize
:
14
}
}
>
{
item
.
title
}
</
Divider
>
</
Col
>
)
:
null
;
}
}
})
}
})
}
{
bottomNode
&&
<
Col
span=
{
24
}
>
{
bottomNode
}
</
Col
>
}
{
bottomNode
&&
<
Col
span=
{
24
}
>
{
bottomNode
}
</
Col
>
}
...
...
src/pages/Welcome.jsx
View file @
be8eed64
...
@@ -85,8 +85,8 @@ function Table({ route }) {
...
@@ -85,8 +85,8 @@ function Table({ route }) {
},
},
{
{
"title": "角色",
"title": "角色",
"dataIndex": "roleName
s
",
"dataIndex": "roleName",
"key": "roleName
s
"
"key": "roleName"
},
},
{
{
"title": "直属领导",
"title": "直属领导",
...
...
src/pages/craft/Materiel/fields.js
View file @
be8eed64
...
@@ -8,10 +8,16 @@ import {
...
@@ -8,10 +8,16 @@ import {
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
export
default
{
export
default
{
jbsx
:
{
title
:
"基本属性"
,
type
:
"split"
,
col
:
{
span
:
24
},
name
:
[
"jbsx"
],
},
materieCode
:
{
materieCode
:
{
value
:
null
,
value
:
null
,
type
:
"input"
,
type
:
"input"
,
title
:
"物料编
号
"
,
title
:
"物料编
码
"
,
name
:
[
"materieCode"
],
name
:
[
"materieCode"
],
required
:
true
,
required
:
true
,
},
},
...
@@ -25,12 +31,16 @@ export default {
...
@@ -25,12 +31,16 @@ export default {
materieTypeId
:
{
materieTypeId
:
{
value
:
null
,
value
:
null
,
type
:
"treeselect"
,
type
:
"treeselect"
,
title
:
"物料类
别
"
,
title
:
"物料类
型
"
,
name
:
[
"materieTypeId"
],
name
:
[
"materieTypeId"
],
required
:
true
,
required
:
true
,
options
:
{
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/pmMaterieType/queryTreeList"
,
params
}),
database
:
(
params
)
=>
params
:
{}
doFetch
({
url
:
"/ngic-workmanship/pmMaterieType/queryTreeList"
,
params
,
}),
params
:
{},
},
},
},
},
materieControl
:
{
materieControl
:
{
...
@@ -40,24 +50,75 @@ export default {
...
@@ -40,24 +50,75 @@ export default {
name
:
[
"materieControl"
],
name
:
[
"materieControl"
],
required
:
true
,
required
:
true
,
options
:
{
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieControlSelect"
,
params
}),
database
:
(
params
)
=>
params
:
{}
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieControlSelect"
,
params
,
}),
params
:
{},
},
},
specificationModel
:
{
value
:
null
,
type
:
"input"
,
title
:
"规格型号"
,
name
:
[
"specificationModel"
],
required
:
true
,
},
issueType
:
{
type
:
"select"
,
title
:
"发料类型"
,
name
:
[
"issueType"
],
required
:
true
,
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieTypeSelect"
,
params
,
}),
params
:
{},
},
},
scsx
:
{
title
:
"生产属性"
,
type
:
"split"
,
col
:
{
span
:
24
},
name
:
[
"scsx"
],
},
ironLoss
:
{
value
:
null
,
type
:
"inputnumber"
,
title
:
"铁损"
,
name
:
[
"ironLoss"
],
required
:
false
,
},
},
sheetThickness
:
{
value
:
null
,
type
:
"inputnumber"
,
title
:
"片厚"
,
name
:
[
"sheetThickness"
],
required
:
false
,
},
},
inventoryMin
:
{
unilateralThickness
:
{
value
:
null
,
value
:
null
,
type
:
"inputnumber"
,
type
:
"inputnumber"
,
title
:
"
库存下限
"
,
title
:
"
宽度
"
,
name
:
[
"
inventoryMin
"
],
name
:
[
"
unilateralThickness
"
],
required
:
false
,
required
:
false
,
},
},
inventoryMax
:
{
shopSign
:
{
value
:
null
,
value
:
null
,
type
:
"inputnumber"
,
type
:
"inputnumber"
,
title
:
"
库存上限
"
,
title
:
"
牌号
"
,
name
:
[
"
inventoryMax
"
],
name
:
[
"
shopSign
"
],
required
:
false
,
required
:
false
,
},
},
cksx
:
{
title
:
"仓库属性"
,
type
:
"split"
,
name
:
[
"cksx"
],
col
:
{
span
:
24
},
},
productionUnit
:
{
productionUnit
:
{
value
:
null
,
value
:
null
,
type
:
"select"
,
type
:
"select"
,
...
@@ -65,94 +126,36 @@ export default {
...
@@ -65,94 +126,36 @@ export default {
name
:
[
"productionUnit"
],
name
:
[
"productionUnit"
],
required
:
true
,
required
:
true
,
options
:
{
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieUnitSelect"
,
params
}),
database
:
(
params
)
=>
params
:
{}
doFetch
({
},
url
:
"/ngic-base-business/sysDic/queryMaterieUnitSelect"
,
params
,
}),
params
:
{},
},
},
qualityGuaranteePeriod
:
{
value
:
null
,
type
:
"inputnumber"
,
title
:
"保质期"
,
name
:
[
"qualityGuaranteePeriod"
],
required
:
false
,
},
},
qualityGuaranteePeriodUnit
:
{
storeId
:
{
value
:
null
,
value
:
null
,
type
:
"select"
,
type
:
"select"
,
title
:
"
保质期单位
"
,
title
:
"
默认仓库
"
,
name
:
[
"
qualityGuaranteePeriodUnit
"
],
name
:
[
"
storeId
"
],
required
:
false
,
required
:
false
,
options
:
[
options
:
{
{
database
:
(
params
)
=>
label
:
"天"
,
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBoxAll"
,
params
})
,
value
:
1
,
params
:
{}
,
},
},
{
label
:
"月"
,
value
:
2
,
},
},
{
storeAreaId
:
{
label
:
"年"
,
value
:
null
,
value
:
3
,
type
:
"select"
,
}
title
:
"默认库区"
,
],
name
:
[
"storeAreaId"
],
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-auth/sysStoreArea/selection"
,
params
}),
params
:
{},
},
},
issueType
:
{
value
:
1
,
type
:
"radio"
,
title
:
"发料类型"
,
name
:
[
"issueType"
],
required
:
true
,
options
:
[
{
label
:
"散发"
,
value
:
1
,
},
{
label
:
"整发"
,
value
:
2
,
}
],
},
materieProductUnitList
:
{
value
:
[],
title
:
"转换单位"
,
type
:
"table"
,
col
:
{
span
:
24
},
name
:
[
"materieProductUnitList"
],
required
:
false
,
required
:
false
,
columns
:
[
{
title
:
"辅助单位"
,
dataIndex
:
"productionUnit"
,
key
:
"productionUnit"
,
search
:
false
,
valueType
:
"select"
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieUnitSelect"
,
params
:{}})
return
res
?.
data
?.
dataList
},
},
{
title
:
"转换比 库存单位=辅助单位*转换比”"
,
dataIndex
:
"conversionRate"
,
key
:
"conversionRate"
,
search
:
false
,
valueType
:
"digit"
,
width
:
200
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{
}}
>
删除
<
/a>
,
],
},
],
rowKey
:
"id"
,
},
},
};
};
src/pages/craft/Materiel/index.jsx
View file @
be8eed64
...
@@ -167,7 +167,7 @@ const Materiel = (props) => {
...
@@ -167,7 +167,7 @@ const Materiel = (props) => {
}
=
state
,
}
=
state
,
columns
=
[
columns
=
[
{
{
title
:
"物料编
号
"
,
title
:
"物料编
码
"
,
dataIndex
:
"materieCode"
,
dataIndex
:
"materieCode"
,
key
:
"materieCode"
,
key
:
"materieCode"
,
},
},
...
@@ -228,7 +228,7 @@ const Materiel = (props) => {
...
@@ -228,7 +228,7 @@ const Materiel = (props) => {
search
:
false
,
search
:
false
,
},
},
{
{
title
:
"
物料管控
"
,
title
:
"
管控方式
"
,
dataIndex
:
"materieControlName"
,
dataIndex
:
"materieControlName"
,
key
:
"materieControlName"
,
key
:
"materieControlName"
,
options
:
{
options
:
{
...
@@ -244,43 +244,32 @@ const Materiel = (props) => {
...
@@ -244,43 +244,32 @@ const Materiel = (props) => {
},
},
},
},
{
{
title
:
"保质期"
,
title
:
"铁损"
,
dataIndex
:
"qualityGuaranteePeriod"
,
dataIndex
:
"ironLoss"
,
key
:
"qualityGuaranteePeriod"
,
key
:
"ironLoss"
,
search
:
false
,
valueType
:
"digit"
,
render
:
(
text
,
row
)
=>
{
return
(
(
row
.
qualityGuaranteePeriod
??
""
)
+
" - "
+
(
row
.
qualityGuaranteePeriodUnitName
??
""
)
);
},
},
{
title
:
"片厚"
,
dataIndex
:
"sheetThickness"
,
valueType
:
"digit"
,
key
:
"sheetThickness"
,
},
},
{
{
title
:
"库存上限"
,
title
:
"宽度"
,
dataIndex
:
"inventoryMax"
,
dataIndex
:
"unilateralThickness"
,
key
:
"inventoryMax"
,
key
:
"unilateralThickness"
,
search
:
false
,
},
},
{
{
title
:
"库存下限"
,
title
:
"牌号"
,
dataIndex
:
"inventoryMin"
,
dataIndex
:
"shopSign"
,
key
:
"inventoryMin"
,
key
:
"shopSign"
,
search
:
false
,
},
},
{
{
title
:
"库存单位"
,
title
:
"默认库区"
,
dataIndex
:
"productionUnitName"
,
dataIndex
:
"storeAreaName"
,
key
:
"productionUnit"
,
key
:
"storeAreaName"
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieUnitSelect"
,
}),
params
:
{},
},
valueType
:
"select"
,
},
},
{
{
...
@@ -305,7 +294,7 @@ const Materiel = (props) => {
...
@@ -305,7 +294,7 @@ const Materiel = (props) => {
return
[
return
[
getPrem
(
"sysDepartment_save"
,
action
,
"修改"
,
()
=>
{
getPrem
(
"sysDepartment_save"
,
action
,
"修改"
,
()
=>
{
doFetch
({
doFetch
({
url
:
"/ngic-workmanship/pmMaterie/query
Update
ById"
,
url
:
"/ngic-workmanship/pmMaterie/queryById"
,
params
:
{
id
:
record
.
id
},
params
:
{
id
:
record
.
id
},
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
if
(
res
.
code
==
"0000"
)
{
if
(
res
.
code
==
"0000"
)
{
...
@@ -386,27 +375,6 @@ const Materiel = (props) => {
...
@@ -386,27 +375,6 @@ const Materiel = (props) => {
.
validateFields
()
.
validateFields
()
.
then
((
secondFields
)
=>
{
.
then
((
secondFields
)
=>
{
let
secondFieldsKeys
=
Object
.
keys
(
secondFields
);
let
secondFieldsKeys
=
Object
.
keys
(
secondFields
);
let
materieCharList
=
defaultSpecificFileds
.
map
((
it
)
=>
{
if
(
secondFieldsKeys
.
indexOf
(
it
.
fieldsKey
)
!=
-
1
)
{
it
.
fieldRealValue
=
secondFields
[
it
.
fieldsKey
];
}
const
el
=
{
fieldType
:
it
.
fieldType
,
fieldTypeName
:
it
.
fieldTypeName
,
fieldCondName
:
it
.
fieldCondName
,
fieldCondKey
:
it
.
fieldCondKey
,
optCondName
:
it
.
optCondName
,
optCondKey
:
it
.
optCondKey
,
fieldId
:
it
.
fieldId
,
fieldName
:
it
.
fieldName
,
fieldChar
:
it
.
fieldChar
,
fieldCharName
:
it
.
fieldCharName
,
fieldCharValue
:
it
.
fieldCharValue
,
fieldRealValue
:
it
.
fieldRealValue
,
valueList
:
it
.
valueList
,
};
return
el
;
});
let
materieProductUnitList
=
let
materieProductUnitList
=
firstValues
?.
materieProductUnitList
?.
map
((
it
)
=>
{
firstValues
?.
materieProductUnitList
?.
map
((
it
)
=>
{
return
{
return
{
...
@@ -417,7 +385,6 @@ const Materiel = (props) => {
...
@@ -417,7 +385,6 @@ const Materiel = (props) => {
params
=
{
params
=
{
...
firstValues
,
...
firstValues
,
materieCharList
,
...
difrid
,
...
difrid
,
materieProductUnitList
,
materieProductUnitList
,
};
};
...
@@ -473,9 +440,9 @@ const Materiel = (props) => {
...
@@ -473,9 +440,9 @@ const Materiel = (props) => {
)
{
)
{
defaultFields
[
i
].
required
=
false
;
defaultFields
[
i
].
required
=
false
;
}
}
if
(
i
==
"issueType"
)
{
//
if (i == "issueType")
{
defaultFields
[
i
].
value
=
1
;
//
defaultFields[i].value = 1;
}
//
}
if
(
i
==
"materieTypeId"
)
{
if
(
i
==
"materieTypeId"
)
{
defaultFields
[
i
].
value
=
defaultFields
[
i
].
value
=
materieTypeId
==
"00000000"
?
null
:
materieTypeId
;
materieTypeId
==
"00000000"
?
null
:
materieTypeId
;
...
@@ -587,17 +554,6 @@ const Materiel = (props) => {
...
@@ -587,17 +554,6 @@ const Materiel = (props) => {
return
null
;
return
null
;
}
}
}
}
></
InitForm
>
></
InitForm
>
<
div
style=
{
{
fontSize
:
16
,
fontWeight
:
"bold"
,
marginBottom
:
15
}
}
>
特定属性
</
div
>
<
InitForm
formRef=
{
formRefs
}
fields=
{
specificFileds
}
onChange=
{
(
changedValues
,
allValues
)
=>
{}
}
actions=
{
()
=>
{
return
null
;
}
}
></
InitForm
>
</>
</>
}
}
<
Button
<
Button
...
...
src/pages/schedule/Shiftgroup/Index.jsx
View file @
be8eed64
...
@@ -192,8 +192,8 @@ const Shiftgroup = (props) => {
...
@@ -192,8 +192,8 @@ const Shiftgroup = (props) => {
},
},
{
{
title
:
"角色"
,
title
:
"角色"
,
dataIndex
:
"roleName
s
"
,
dataIndex
:
"roleName"
,
key
:
"roleName
s
"
,
key
:
"roleName"
,
search
:
false
,
search
:
false
,
},
},
],
],
...
@@ -236,8 +236,8 @@ const Shiftgroup = (props) => {
...
@@ -236,8 +236,8 @@ const Shiftgroup = (props) => {
},
},
{
{
title
:
"角色"
,
title
:
"角色"
,
dataIndex
:
"roleName
s
"
,
dataIndex
:
"roleName"
,
key
:
"roleName
s
"
,
key
:
"roleName"
,
search
:
false
,
search
:
false
,
},
},
{
{
...
...
src/pages/system/Area/index.jsx
View file @
be8eed64
...
@@ -34,7 +34,7 @@ function reducer(state, action) {
...
@@ -34,7 +34,7 @@ function reducer(state, action) {
...
state
,
...
state
,
vs
:
true
,
vs
:
true
,
iftype
:
{
iftype
:
{
title
:
"新增
仓库
"
,
title
:
"新增
库区
"
,
val
:
type
,
val
:
type
,
},
},
fields
:
{
...
action
.
fields
},
fields
:
{
...
action
.
fields
},
...
@@ -45,7 +45,7 @@ function reducer(state, action) {
...
@@ -45,7 +45,7 @@ function reducer(state, action) {
...
state
,
...
state
,
vs
:
true
,
vs
:
true
,
iftype
:
{
iftype
:
{
title
:
"编辑
仓库
"
,
title
:
"编辑
库区
"
,
val
:
type
,
val
:
type
,
},
},
fields
:
{
...
action
.
fields
},
fields
:
{
...
action
.
fields
},
...
...
src/pages/system/Reservoir/fields.js
View file @
be8eed64
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
factorySelect
}
from
"@/services/system"
;
export
default
{
export
default
{
"customerNo"
:
{
storePositionCode
:
{
"value"
:
null
,
value
:
null
,
"type"
:
"input"
,
type
:
"input"
,
"title"
:
"仓位编码"
,
title
:
"库位编码"
,
"name"
:
[
name
:
[
"storePositionCode"
],
"customerNo"
required
:
true
,
],
"required"
:
false
},
"customerName"
:
{
"value"
:
null
,
"type"
:
"input"
,
"title"
:
"仓位名称"
,
"name"
:
[
"customerName"
],
"required"
:
true
},
"officialWebsite"
:
{
"value"
:
null
,
"type"
:
"input"
,
"title"
:
"所属仓库"
,
"name"
:
[
"officialWebsite"
],
"required"
:
false
},
"telephone"
:
{
"value"
:
null
,
"type"
:
"input"
,
"title"
:
"所属库区"
,
"name"
:
[
"telephone"
],
"required"
:
false
},
"email"
:
{
"value"
:
null
,
"type"
:
"input"
,
"title"
:
"排"
,
"name"
:
[
"email"
],
"required"
:
false
},
"address"
:
{
"value"
:
null
,
"type"
:
"input"
,
"title"
:
"列"
,
"name"
:
[
"address"
],
"required"
:
false
},
"score"
:
{
"value"
:
null
,
"type"
:
"rate"
,
"title"
:
"层"
,
"name"
:
[
"score"
],
"required"
:
false
,
allowHalf
:
true
,
},
},
"status"
:
{
storePositionName
:
{
"value"
:
1
,
value
:
null
,
"type"
:
"select"
,
type
:
"input"
,
"title"
:
"启停状态"
,
title
:
"库位名称"
,
"name"
:
[
name
:
[
"storePositionName"
],
"status"
required
:
true
,
],
"required"
:
true
,
options
:
[
{
label
:
"启用"
,
value
:
1
},
},
{
factoryId
:
{
label
:
"停用"
,
value
:
null
,
value
:
0
type
:
"select"
,
title
:
"所属工厂"
,
name
:
[
"factoryId"
],
required
:
true
,
options
:
{
database
:
factorySelect
,
params
:
{},
},
},
]
linked
:
true
,
},
},
"remark"
:
{
storeId
:
{
"value"
:
null
,
value
:
null
,
"type"
:
"textarea"
,
type
:
"select"
,
"title"
:
"备注"
,
title
:
"所属仓库"
,
"name"
:
[
name
:
[
"storeId"
],
"remark"
required
:
true
,
],
linked
:
true
,
"required"
:
false
,
belinked
:
{
col
:
{
span
:
24
}
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{}
}),
params
:
{
factoryId
:
"linked"
,
},
},
},
"customerUserList"
:
{
},
"value"
:
null
,
},
"editable"
:
true
,
storeAreaId
:
{
"type"
:
"table"
,
value
:
null
,
"title"
:
"联系人"
,
type
:
"select"
,
"name"
:
[
title
:
"所属库区"
,
"customerUserList"
name
:
[
"storeAreaId"
],
],
"required"
:
false
,
"columns"
:
[
{
"title"
:
"联系人姓名"
,
"dataIndex"
:
"userName"
,
"key"
:
"userName"
,
"search"
:
false
,
"valueType"
:
"input"
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
required
:
true
,
message
:
'此项为必填项'
,
belinked
:
{
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStoreArea/selection"
,
params
:
{}
}),
params
:
{
storeId
:
"linked"
,
},
},
],
}
},
},
},
linked
:
true
,
},
status
:
{
value
:
1
,
type
:
"select"
,
name
:
[
"status"
],
title
:
"库位状态"
,
required
:
true
,
options
:
[
{
{
"title"
:
"联系电话"
,
label
:
"启用"
,
"dataIndex"
:
"telephone"
,
value
:
1
,
"key"
:
"telephone"
,
},
"search"
:
false
,
"valueType"
:
"input"
,
formItemProps
:
{
rules
:
[
{
{
required
:
false
,
label
:
"停用"
,
pattern
:
/^
(((\d{3,4}
-
)?[
0-9
]{7,8})
|
(
1
(
3|4|5|6|7|8|9
)\d{9}))
$/
,
value
:
2
,
message
:
'手机号格式不正确'
},
},
],
],
}
},
},
{
wzpz
:
{
"title"
:
"邮箱"
,
type
:
"split"
,
"dataIndex"
:
"email"
,
title
:
"位置配置"
,
"key"
:
"email"
,
name
:
[
"wzpz"
],
"search"
:
false
,
col
:
{
span
:
24
},
"valueType"
:
"input"
,
},
formItemProps
:
{
row
:
{
rules
:
[
value
:
null
,
{
type
:
"input"
,
title
:
"排"
,
name
:
[
"row"
],
required
:
false
,
required
:
false
,
pattern
:
/^
[
a-z0-9A-Z
]
+
[
- | a-z0-9A-Z . _
]
+@
([
a-z0-9A-Z
]
+
(
-
[
a-z0-9A-Z
]
+
)?\.)
+
[
a-z
]{2,}
$/
,
message
:
'邮箱格式不正确'
},
},
],
line
:
{
}
value
:
null
,
type
:
"input"
,
title
:
"列"
,
name
:
[
"line"
],
required
:
false
,
},
},
{
level
:
{
"title"
:
"职位"
,
value
:
null
,
"dataIndex"
:
"title"
,
type
:
"input"
,
"key"
:
"title"
,
title
:
"层"
,
"search"
:
false
,
name
:
[
"level"
],
"valueType"
:
"input"
required
:
false
,
allowHalf
:
true
,
},
},
{
roadway
:
{
title
:
'操作'
,
value
:
null
,
valueType
:
'option'
,
type
:
"input"
,
render
:
()
=>
{
title
:
"巷道"
,
return
null
;
name
:
[
"roadway"
],
required
:
false
,
allowHalf
:
true
,
},
},
remark
:
{
value
:
null
,
type
:
"textarea"
,
title
:
"备注"
,
name
:
[
"remark"
],
required
:
false
,
col
:
{
span
:
24
},
},
},
],
};
"editable"
:
true
,
"rowKey"
:
"id"
,
"rowName"
:
""
,
"dataSource"
:
[],
col
:
{
span
:
24
}
}
}
\ No newline at end of file
src/pages/system/Reservoir/index.jsx
View file @
be8eed64
import
React
,
{
useState
,
useRef
,
useReducer
}
from
"react"
;
import
React
,
{
useState
,
useRef
,
useReducer
}
from
"react"
;
import
{
import
{
Button
,
Tooltip
,
Row
,
Divider
,
Drawer
,
Form
,
message
}
from
"antd"
;
Modal
,
Button
,
Drawer
,
Tooltip
,
Popconfirm
,
message
,
Switch
,
Layout
,
}
from
"antd"
;
import
AutoTable
from
"@/components/AutoTable"
;
import
AutoTable
from
"@/components/AutoTable"
;
import
getPrem
from
"@/utils/getPrem"
;
//权限判断fn
import
getPrem
from
"@/utils/getPrem"
;
//权限判断fn
import
InitForm
from
"@/components/InitForm"
;
import
{
useRequest
}
from
"umi"
;
import
{
useRequest
}
from
"umi"
;
import
defaultFields
from
"./fields"
;
import
defaultFields
from
"./fields"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
deviceprovideDetail
,
deleteProvideCheck
}
from
"@/services/device"
;
import
{
usercusDetails
}
from
"@/utils/detailTotalCard"
;
import
Details
from
"@/components/Details"
;
import
Details
from
"@/components/Details"
;
import
{
useAsyncEffect
}
from
"ahooks"
;
import
{
materielDetail
}
from
"@/utils/detailTotalCard"
;
import
tempfields
from
"@/utils/tempfields"
;
import
InitForm
from
"@/components/InitForm"
;
import
moment
from
"moment"
;
import
TreeRender
from
"@/components/TreeRender"
;
import
TreeRender
from
"@/components/TreeRender"
;
import
{
useEffect
}
from
"react"
;
const
{
Sider
,
Content
}
=
Layout
;
const
initState
=
{
const
initState
=
{
vs
:
false
,
vs
:
false
,
fields
:
{},
fields
:
{},
iftype
:
{},
iftype
:
{},
details
:
{
curitem
:
{},
detail
:
{
dataSource
:
{},
dataSource
:
{},
totalCard
:
[],
totalCard
:
[],
},
},
visible
:
false
,
visible
:
false
,
};
specificFileds
:
{},
commonFields
:
{},
defaultCommonFields
:
[],
},
otherBasic
=
{
materieCode
:
"物料编号"
,
materieName
:
"物料名称"
,
materieTypeName
:
"物料类型"
,
productionUnitName
:
"生产单位(主)"
,
processLineName
:
"工艺路线"
,
};
function
reducer
(
state
,
action
)
{
function
reducer
(
state
,
action
)
{
let
{
type
}
=
action
,
let
{
type
}
=
action
,
newState
=
{};
newState
=
{};
...
@@ -43,10 +42,12 @@ function reducer(state, action) {
...
@@ -43,10 +42,12 @@ function reducer(state, action) {
...
state
,
...
state
,
vs
:
true
,
vs
:
true
,
iftype
:
{
iftype
:
{
title
:
"新增
客户
"
,
title
:
"新增
仓位
"
,
val
:
type
,
val
:
type
,
},
},
fields
:
{
...
action
.
fields
},
fields
:
{
...
action
.
fields
},
commonFields
:
action
.
commonFields
,
specificFileds
:
action
.
specificFileds
,
};
};
break
;
break
;
case
"edit"
:
case
"edit"
:
...
@@ -54,361 +55,532 @@ function reducer(state, action) {
...
@@ -54,361 +55,532 @@ function reducer(state, action) {
...
state
,
...
state
,
vs
:
true
,
vs
:
true
,
iftype
:
{
iftype
:
{
title
:
"编辑
客户
"
,
title
:
"编辑
库位
"
,
val
:
type
,
val
:
type
,
},
},
fields
:
{
...
action
.
fields
},
fields
:
{
...
action
.
fields
},
curitem
:
action
.
curitem
,
commonFields
:
action
.
commonFields
,
specificFileds
:
action
.
specificFileds
,
defaultCommonFields
:
action
.
defaultCommonFields
,
};
};
break
;
break
;
case
"cdetails"
:
case
"bom"
:
let
n
=
1
,
newState
=
{
dataSource
=
action
.
dataSource
;
...
state
,
let
special
=
action
?.
dataSource
?.
customerCharList
?.
map
?.((
it
)
=>
{
vs
:
true
,
n
++
;
iftype
:
{
let
key
=
n
.
toString
();
title
:
"编辑物料BOM"
,
dataSource
[
key
]
=
it
?.
fieldRealValue
;
val
:
type
,
return
{
title
:
it
?.
fieldName
,
key
:
key
,
};
});
let
extraspecial
=
[
{
cardTitle
:
"特殊属性"
,
itemData
:
special
,
},
},
];
fields
:
{
...
action
.
fields
},
curitem
:
action
.
curitem
,
markKey
:
action
.
markKey
,
};
break
;
case
"see"
:
newState
=
{
newState
=
{
...
state
,
...
state
,
detail
s
:
{
detail
:
{
dataSource
:
action
.
dataSource
,
dataSource
:
action
.
dataSource
,
totalCard
:
[...
usercusDetails
,
...
extraspecial
]
,
totalCard
:
action
.
totalCard
,
},
},
visible
:
true
,
visible
:
true
,
};
};
break
;
break
;
case
"changeSpecificFileds"
:
newState
=
{
...
state
,
specificFileds
:
action
.
specificFileds
,
};
break
;
case
"changeFields"
:
newState
=
{
...
state
,
fields
:
action
.
fields
,
};
break
;
case
"changeCommonFields"
:
newState
=
{
...
state
,
commonFields
:
action
.
commonFields
,
};
break
;
case
"changeDefaultCommonFields"
:
newState
=
{
...
state
,
defaultCommonFields
:
action
.
defaultCommonFields
,
};
break
;
case
"close"
:
case
"close"
:
newState
=
{
newState
=
{
vs
:
false
,
vs
:
false
,
fields
:
{},
fields
:
{},
iftype
:
{},
iftype
:
{},
details
:
{
curitem
:
{},
detail
:
{
dataSource
:
{},
dataSource
:
{},
totalCard
:
[],
totalCard
:
[],
},
},
visible
:
false
,
visible
:
false
,
specificFileds
:
{},
};
};
break
;
break
;
}
}
return
newState
;
return
newState
;
}
}
const
Reservoir
=
(
props
)
=>
{
const
Materiel
=
(
props
)
=>
{
let
actionRef
=
useRef
(),
let
actionRef
=
useRef
(),
ChildRef
=
null
;
ChildRef
=
null
,
[
formRef
]
=
Form
.
useForm
(),
[
formRefs
]
=
Form
.
useForm
();
const
[
materieTypeId
,
setmaterieTypeId
]
=
useState
();
const
[
defaultSpecificFileds
,
setdefaultSpecificFileds
]
=
useState
();
function
reload
()
{
function
reload
()
{
actionRef
?.
current
?.
reload
();
actionRef
?.
current
?.
reload
();
ChildRef
?.
onRefresh
();
ChildRef
?.
onRefresh
();
}
}
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
{
vs
,
fields
,
iftype
,
details
,
visible
}
=
state
,
manual
:
true
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
reload
();
dispatch
({
type
:
"close"
});
}
},
}),
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
{
vs
,
fields
,
iftype
,
curitem
,
detail
,
visible
,
specificFileds
,
commonFields
,
defaultCommonFields
,
markKey
,
}
=
state
,
columns
=
[
columns
=
[
{
{
title
:
"
客户编号
"
,
title
:
"
库位编码
"
,
dataIndex
:
"
customerNo
"
,
dataIndex
:
"
storePositionCode
"
,
key
:
"
customerNo
"
,
key
:
"
storePositionCode
"
,
},
},
{
{
title
:
"客户名称"
,
title
:
"库位名称"
,
dataIndex
:
"customerName"
,
dataIndex
:
"storePositionName"
,
key
:
"customerName"
,
key
:
"storePositionName"
,
render
:
(
_
,
row
)
=>
{
// render: (_, row) => {
return
(
// return (
<
div
// <Tooltip title={row.materieName}>
style=
{
{
// <a
padding
:
"3px 0"
,
// className="table-cell"
overflow
:
"hidden"
,
// onClick={() => {
whiteSpace
:
"nowrap"
,
// doFetch({
textOverflow
:
"ellipsis"
,
// url: "/ngic-workmanship/pmMaterie/queryDetailById",
}
}
// params: { id: row.id },
>
// }).then((res) => {
<
Tooltip
title=
{
row
.
customerName
}
>
// if (res.code == "0000") {
<
a
// let dataSource = res?.data?.data ?? {},
onClick=
{
()
=>
{
// specials = res?.data?.data?.materieCharList ?? [];
doFetch
({
// let newData = formatFieds(specials, "special")?.data;
url
:
"/ngic-auth/sysCustomer/query/detail"
,
params
:
{
id
:
row
.
id
},
// let newSpecialData = newData.map((it) => {
}).
then
((
res
)
=>
{
// dataSource[it.fieldsKey] = it.fieldRealValue;
let
data
=
res
?.
data
?.
data
||
{};
// return {
dispatch
({
type
:
"cdetails"
,
dataSource
:
data
});
// title: it.fieldName,
});
// key: it.fieldsKey,
}
}
// };
>
// });
{
row
.
customerName
}
// let itemCol = [
</
a
>
// {
</
Tooltip
>
// cardTitle: "特殊属性",
</
div
>
// itemData: newSpecialData,
);
// },
},
// ];
// dataSource.newqualityGuaranteePeriod =
// dataSource.qualityGuaranteePeriod == 0 ||
// dataSource.qualityGuaranteePeriod
// ? dataSource.qualityGuaranteePeriod +
// dataSource.qualityGuaranteePeriodUnitName
// : null;
// let totalCard = materielDetail.concat(itemCol);
// dispatch({ type: "see", dataSource, totalCard });
// }
// });
// }}
// >
// {row.materieName}
// </a>
// </Tooltip>
// );
// },
},
},
{
{
title
:
"
联系电话
"
,
title
:
"
所属仓库
"
,
dataIndex
:
"
telephon
e"
,
dataIndex
:
"
storeNam
e"
,
key
:
"
telephon
e"
,
key
:
"
storeNam
e"
,
},
},
{
{
title
:
"邮箱"
,
title
:
"所属库区"
,
dataIndex
:
"email"
,
dataIndex
:
"storeAreaName"
,
key
:
"email"
,
key
:
"storeAreaName"
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-base-business/sysDic/queryMaterieControlSelect"
,
}),
params
:
{},
},
valueType
:
"select"
,
formItemProps
:
{
name
:
"materieControl"
,
},
},
{
title
:
"地址"
,
dataIndex
:
"address"
,
key
:
"address"
,
search
:
false
,
},
},
{
{
title
:
"
备注
"
,
title
:
"
排
"
,
dataIndex
:
"r
emark
"
,
dataIndex
:
"r
ow
"
,
key
:
"r
emark
"
,
key
:
"r
ow
"
,
search
:
false
,
valueType
:
"digit"
,
},
},
{
{
title
:
"评分"
,
title
:
"列"
,
dataIndex
:
"score"
,
dataIndex
:
"line"
,
key
:
"score"
,
key
:
"line"
,
render
:
(
_
,
row
)
=>
{
valueType
:
"digit"
,
return
<
div
>
{
row
.
score
}
星
</
div
>;
},
},
{
title
:
"层"
,
dataIndex
:
"level"
,
key
:
"level"
,
valueType
:
"digit"
,
},
},
{
{
title
:
"状态"
,
title
:
"状态"
,
dataIndex
:
"status"
,
dataIndex
:
"status"
,
key
:
"status"
,
key
:
"status"
,
valueType
:
"select"
,
render
:
(
_
,
row
)
=>
<
span
>
{
row
?.
status
==
"1"
?
"启用"
:
"禁用"
}
</
span
>,
options
:
[
{
label
:
"启用"
,
value
:
1
,
},
},
{
{
label
:
"关闭"
,
title
:
"更新人"
,
value
:
0
,
dataIndex
:
"updateUserName"
,
},
key
:
"updateUserName"
,
],
render
:
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
Popconfirm
title=
"是否开启或关闭客户?"
onConfirm=
{
()
=>
{
run
({
url
:
"/ngic-auth/sysCustomer/update/status"
,
params
:
{
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
},
});
}
}
onCancel=
{
()
=>
{}
}
okText=
"确定"
cancelText=
"取消"
disabled=
{
!
getPrem
(
"equipmentCustomer_updatestatus"
,
"ifs"
)
}
>
<
Switch
checked=
{
row
.
status
==
1
?
true
:
false
}
checkedChildren=
"开启"
unCheckedChildren=
"关闭"
defaultChecked=
{
false
}
/>
</
Popconfirm
>
);
},
},
{
title
:
"更新时间"
,
dataIndex
:
"updateTime"
,
key
:
"updateTime"
,
},
},
{
{
title
:
"操作"
,
title
:
"操作"
,
dataIndex
:
"option_dataindex"
,
key
:
"option_dataindex"
,
valueType
:
"option"
,
valueType
:
"option"
,
width
:
1
5
0
,
width
:
1
6
0
,
render
:
(
text
,
row
,
_
,
action
)
=>
extraAction
(
text
,
row
,
_
,
action
),
render
:
(
text
,
row
,
_
,
action
)
=>
extraAction
(
text
,
row
,
_
,
action
),
},
},
],
];
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
useEffect
(()
=>
{
manual
:
true
,
doFetch
({
formatResult
:
(
res
)
=>
res
,
url
:
"/ngic-workmanship/pmMaterieChar/queryCommonList"
,
onSuccess
:
(
result
,
params
)
=>
{
params
:
{},
if
(
result
.
code
==
"0000"
)
{
}).
then
((
res
)
=>
{
message
.
success
(
"操作成功!"
);
setdefaultSpecificFileds
(
res
?.
data
?.
dataList
);
reload
();
dispatch
({
type
:
"close"
});
}
},
});
});
const
[
extrafields
,
setextrafields
]
=
useState
({});
},
[]);
const
[
subdata
,
setsubdata
]
=
useState
([]);
const
[
curitem
,
setcuritem
]
=
useState
({});
function
extraAction
(
text
,
record
,
_
,
action
)
{
function
extraAction
(
text
,
record
,
_
,
action
)
{
return
[
return
[
getPrem
(
"equipmentCustomer_save"
,
action
,
"修改"
,
async
()
=>
{
getPrem
(
"sysDepartment_save"
,
action
,
"修改"
,
()
=>
{
await
setcuritem
({
doFetch
({
...
record
,
url
:
"/ngic-auth/sysStorePosition/queryById"
,
key
:
"edit"
,
params
:
{
id
:
record
.
id
},
}).
then
((
res
)
=>
{
if
(
res
.
code
==
"0000"
)
{
let
data
=
res
?.
data
?.
data
??
{};
console
.
log
(
data
);
let
newArr
=
data
?.
materieProductUnitList
?.
map
((
it
)
=>
{
return
{
productionUnit
:
it
.
productionUnit
,
productionUnitType
:
it
.
productionUnitType
,
id
:
it
.
id
,
};
})
??
[];
for
(
let
i
in
defaultFields
)
{
defaultFields
[
i
].
value
=
data
[
i
];
// if (i == "unitList") {
// defaultFields[i].value = [
// {
// id: moment().valueOf(),
// productionUnit: data?.productionUnit,
// productionUnitType: data?.productionUnitType,
// },
// ...newArr,
// ];
// }
}
console
.
log
(
defaultFields
);
let
all
=
async
()
=>
{
let
common
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterieChar/queryCommonList"
,
params
:
{
id
:
record
.
id
},
});
return
{
commonData
:
common
?.
data
?.
dataList
,
};
};
all
().
then
((
res
)
=>
{
let
commonDataFields
=
formatFieds
(
res
?.
commonData
,
"common"
)?.
obj
,
newCommonData
=
formatFieds
(
res
?.
commonData
,
"common"
)?.
data
;
console
.
log
(
defaultFields
);
dispatch
({
type
:
"edit"
,
fields
:
defaultFields
,
curitem
:
record
,
commonFields
:
commonDataFields
,
specificFileds
:
{
...
commonDataFields
},
defaultCommonFields
:
newCommonData
,
});
setdefaultSpecificFileds
([...
newCommonData
]);
});
}
});
});
}),
}),
getPrem
(
"
equipmentCustomer
_deleteById"
,
action
,
"删除"
,
null
,
{
getPrem
(
"
sysDepartment
_deleteById"
,
action
,
"删除"
,
null
,
{
title
:
"确认删除该
客户
?"
,
title
:
"确认删除该
库位
?"
,
onConfirm
:
()
=>
{
onConfirm
:
()
=>
{
run
({
run
({
url
:
"/ngic-
auth/sysCustomer
/deleteById"
,
url
:
"/ngic-
workmanship/pmMaterie
/deleteById"
,
params
:
{
id
:
record
.
id
},
params
:
{
id
:
record
.
id
},
});
});
},
},
}),
}),
];
];
}
}
let
saveData
=
()
=>
{
let
saveData
=
(
values
,
fn
)
=>
{
let
newfields
=
JSON
.
parse
(
JSON
.
stringify
(
values
));
//新增&修改
//新增&修改
let
difrid
=
iftype
.
val
==
"edit"
?
{
id
:
curitem
.
id
}
:
{};
let
difrid
=
iftype
.
val
!=
"add"
?
{
id
:
curitem
.
id
}
:
{},
let
customerUserList
=
newfields
?.
customerUserList
?.
map
((
it
)
=>
{
params
,
delete
it
.
id
;
url
;
return
it
;
if
(
iftype
.
val
!=
"bom"
)
{
});
formRef
let
customerCharList
=
subdata
.
map
((
it
,
i
)
=>
{
.
validateFields
()
let
key
=
"field"
+
i
.
toString
();
.
then
((
firstValues
)
=>
{
it
.
fieldRealValue
=
values
[
key
];
formRefs
delete
newfields
[
key
];
.
validateFields
()
return
it
;
.
then
((
secondFields
)
=>
{
let
secondFieldsKeys
=
Object
.
keys
(
secondFields
);
let
materieProductUnitList
=
firstValues
?.
materieProductUnitList
?.
map
((
it
)
=>
{
return
{
productionUnit
:
it
.
productionUnit
,
conversionRate
:
it
.
conversionRate
,
};
});
});
let
params
=
{
...
newfields
,
params
=
{
customerUserList
,
...
firstValues
,
customerCharList
,
...
difrid
,
factoryId
:
materieTypeId
,
materieProductUnitList
,
};
url
=
"/ngic-auth/sysStorePosition/save"
;
run
({
url
,
params
});
})
.
catch
((
error
)
=>
{});
})
.
catch
((
error
)
=>
{});
}
else
{
url
=
"/ngic-workmanship/pmMaterie/saveMaterieBom"
;
let
firstValues
=
formRef
?.
getFieldsValue
();
let
materieBomList
=
firstValues
?.
materieBomList
?.
map
((
it
,
i
)
=>
{
return
{
materieId
:
it
.
id
,
materieName
:
it
.
materieName
,
materieCode
:
it
.
materieCode
,
materieType
:
it
.
materieType
,
numberUnits
:
it
.
numberUnits
,
workingProduceId
:
it
.
workingProduceId
,
workingFeedingId
:
it
.
workingFeedingId
,
rowKey
:
String
(
i
),
productionUnitName
:
it
.
productionUnitName
,
};
};
run
({
url
:
"/ngic-auth/sysCustomer/save"
,
params
:
{
...
params
,
...
difrid
},
});
});
params
=
{
materieBomList
,
...
difrid
,
};
run
({
url
,
params
});
}
};
};
let
extrarender
=
[
let
extrarender
=
[
<
Button
<
Button
disabled=
{
!
getPrem
(
"
equipmentCustomer
_save"
,
"ifs"
)
}
disabled=
{
!
getPrem
(
"
sysDepartment
_save"
,
"ifs"
)
}
type=
"primary"
type=
"primary"
onClick=
{
async
()
=>
{
onClick=
{
()
=>
{
let
result
=
await
tempfields
(
doFetch
({
"/ngic-auth/sysCustomerChar/queryCommonList"
,
url
:
"/ngic-workmanship/pmMaterieChar/queryCommonList"
,
{}
params
:
{},
);
}).
then
((
res
)
=>
{
if
(
res
.
code
==
"0000"
)
{
let
data
=
res
?.
data
?.
dataList
,
otherFields
=
formatFieds
(
data
,
"common"
)?.
obj
,
newData
=
formatFieds
(
data
,
"common"
)?.
data
;
for
(
let
i
in
defaultFields
)
{
for
(
let
i
in
defaultFields
)
{
defaultFields
[
i
].
value
=
null
;
defaultFields
[
i
].
value
=
null
;
if
(
i
==
"customerUserList"
)
{
defaultFields
[
i
].
disabled
=
false
;
defaultFields
[
i
].
value
=
[];
if
(
i
==
"serialNumberRuleId"
||
i
==
"labelTemplateId"
||
i
==
"processLineId"
)
{
defaultFields
[
i
].
required
=
false
;
}
}
if
(
i
==
"status"
)
{
// if (i == "issueType")
{
defaultFields
[
i
].
value
=
1
;
// defaultFields[i].value = 1;
//
}
if
(
i
==
"materieTypeId"
)
{
defaultFields
[
i
].
value
=
materieTypeId
==
"00000000"
?
null
:
materieTypeId
;
}
}
}
}
for
(
let
i
in
extrafields
)
{
extrafields
[
i
].
value
=
null
;
if
(
extrafields
[
i
][
"multiple"
]
==
true
)
{
extrafields
[
i
].
value
=
[];
}
}
dispatch
({
dispatch
({
type
:
"add"
,
type
:
"add"
,
fields
:
{
...
defaultFields
,
...
result
?.
fields
},
fields
:
defaultFields
,
commonFields
:
otherFields
,
specificFileds
:
otherFields
,
});
dispatch
({
type
:
"changeDefaultCommonFields"
,
defaultCommonFields
:
newData
,
});
}
});
});
}
}
}
}
>
>
新增
新增
</
Button
>,
</
Button
>,
];
];
function
formatFieds
(
data
,
type
)
{
useAsyncEffect
(
async
()
=>
{
let
obj
=
{};
let
result
=
await
tempfields
(
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
"/ngic-auth/sysCustomerChar/queryCommonList"
,
let
item
=
data
[
i
],
{
id
:
curitem
.
id
}
fieldsKey
=
type
+
"field"
+
i
;
);
item
[
"fieldsKey"
]
=
fieldsKey
;
await
setextrafields
(
result
?.
fields
);
if
(
item
.
fieldChar
==
1
)
{
await
setsubdata
(
result
?.
data
);
obj
[
fieldsKey
]
=
{
if
(
curitem
.
key
==
"edit"
)
{
value
:
item
?.
fieldRealValue
??
""
,
doFetch
({
title
:
item
.
fieldName
,
url
:
"/ngic-auth/sysCustomer/query/detail"
,
name
:
[
fieldsKey
],
params
:
{
id
:
curitem
.
id
},
required
:
false
,
}).
then
((
res
)
=>
{
type
:
"input"
,
if
(
res
.
code
==
"0000"
)
{
};
let
data
=
res
?.
data
?.
data
||
{};
}
else
{
for
(
let
i
in
defaultFields
)
{
obj
[
fieldsKey
]
=
{
defaultFields
[
i
].
value
=
data
[
i
];
value
:
item
?.
fieldRealValue
==
0
||
item
?.
fieldRealValue
?
item
?.
fieldRealValue
:
item
.
fieldChar
==
4
?
[]
:
""
,
title
:
item
.
fieldName
,
name
:
[
fieldsKey
],
required
:
false
,
type
:
item
.
fieldChar
==
3
?
"radio"
:
"select"
,
options
:
item
.
valueList
,
multiple
:
item
.
fieldChar
==
4
?
true
:
false
,
};
}
}
dispatch
({
type
:
"edit"
,
fields
:
{
...
defaultFields
,
...
result
?.
fields
},
});
}
}
});
return
{
obj
,
data
,
};
}
}
},
[
curitem
]);
const
[
collapsed
,
setCollapsed
]
=
useState
(
false
);
return
(
return
(
<
div
>
<
div
>
<
Layout
style=
{
{
minHeight
:
"100%"
,
}
}
>
<
Sider
theme=
"light"
collapsible
collapsed=
{
collapsed
}
onCollapse=
{
(
value
)
=>
setCollapsed
(
value
)
}
>
{
/* <TreeRender /> */
}
123
</
Sider
>
<
Content
>
<
AutoTable
<
AutoTable
pagetitle=
{
props
.
route
.
name
}
//页面标题
pagetitle=
{
props
.
route
.
name
}
//页面标题
pageextra=
{
extrarender
}
//页面操作 新增or批量删除
pageextra=
{
extrarender
}
//页面操作 新增or批量删除
columns=
{
columns
}
columns=
{
columns
}
path=
"/ngic-auth/sysCustomer
/queryList"
path=
"/ngic-auth/sysStorePosition
/queryList"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
></
AutoTable
>
childposition=
"left"
</
Content
>
extraparams=
{
{
factoryId
:
materieTypeId
}
}
</
Layout
>
x=
{
600
}
>
<
Modal
<
div
maskClosable=
{
false
}
style=
{
{
width
:
260
,
flexShrink
:
0
,
marginTop
:
-
4
,
borderRight
:
"1px solid #f0f0f0"
,
paddingRight
:
12
,
marginRight
:
12
,
}
}
>
<
TreeRender
url=
"/ngic-auth/sysFactory/queryFactoryStoreTree"
deleteurl=
"/ngic-auth/sysFactory/deleteById"
saveurl=
"/ngic-auth/sysFactory/save"
onselected=
{
(
vals
)
=>
{
setmaterieTypeId
(
vals
[
0
]
??
""
);
}
}
/>
</
div
>
</
AutoTable
>
<
Drawer
title=
{
iftype
.
title
}
title=
{
iftype
.
title
}
visible=
{
vs
}
visible=
{
vs
}
onC
ancel
=
{
()
=>
dispatch
({
type
:
"close"
})
}
onC
lose
=
{
()
=>
dispatch
({
type
:
"close"
})
}
footer=
{
false
}
footer=
{
false
}
destroyOnClose=
{
true
}
destroyOnClose=
{
true
}
width=
{
1000
}
getContainer=
{
false
}
style=
{
{
position
:
"absolute"
}
}
width=
{
"100%"
}
>
>
<
InitForm
<
InitForm
formRef=
{
formRef
}
fields=
{
fields
}
fields=
{
fields
}
submitData=
{
(
values
)
=>
{
onChange=
{
(
changedValues
,
allValues
)
=>
{}
}
saveData
(
values
);
actions=
{
()
=>
{
return
null
;
}
}
}
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
//联动操作
}
}
submitting=
{
loading
||
!
vs
}
></
InitForm
>
></
InitForm
>
</
Modal
>
<
Button
style=
{
{
width
:
"100%"
}
}
type=
"primary"
size=
"large"
loading=
{
loading
||
!
vs
}
onClick=
{
()
=>
saveData
()
}
>
提交
</
Button
>
</
Drawer
>
<
Details
<
Details
title=
"客户详情"
title=
"物料详情"
closable=
{
true
}
visible=
{
visible
}
visible=
{
visible
}
onClose=
{
()
=>
dispatch
({
type
:
"close"
})
}
onClose=
{
()
=>
dispatch
({
type
:
"close"
})
}
footer=
{
false
}
destroyOnClose=
{
true
}
destroyOnClose=
{
true
}
afterVisibleChange=
{
(
v
)
=>
{}
}
width=
{
"100%"
}
width=
"100%"
{
...
detail
}
className=
"drawerDetails"
{
...
details
}
></
Details
>
></
Details
>
</
div
>
</
div
>
);
);
};
};
export
default
Reservoir
;
export
default
Materiel
;
src/pages/system/Store/index.jsx
View file @
be8eed64
...
@@ -136,6 +136,7 @@ const Store = (props) => {
...
@@ -136,6 +136,7 @@ const Store = (props) => {
for
(
let
i
in
defaultFields
)
{
for
(
let
i
in
defaultFields
)
{
defaultFields
[
i
].
value
=
record
[
i
];
defaultFields
[
i
].
value
=
record
[
i
];
}
}
console
.
log
(
defaultFields
);
dispatch
({
type
:
"edit"
,
fields
:
defaultFields
,
curitem
:
record
});
dispatch
({
type
:
"edit"
,
fields
:
defaultFields
,
curitem
:
record
});
}),
}),
getPrem
(
"sysDepartment_deleteById"
,
action
,
"删除"
,
null
,
{
getPrem
(
"sysDepartment_deleteById"
,
action
,
"删除"
,
null
,
{
...
...
src/utils/detailTotalCard.js
View file @
be8eed64
...
@@ -241,7 +241,7 @@ const userDetails = [
...
@@ -241,7 +241,7 @@ const userDetails = [
},
},
{
{
title
:
"角色"
,
title
:
"角色"
,
key
:
"roleName
s
"
,
key
:
"roleName"
,
},
},
{
{
title
:
"直属领导"
,
title
:
"直属领导"
,
...
@@ -835,8 +835,8 @@ const shiftgroupDetail = [
...
@@ -835,8 +835,8 @@ const shiftgroupDetail = [
},
},
{
{
title
:
"角色"
,
title
:
"角色"
,
dataIndex
:
"roleName
s
"
,
dataIndex
:
"roleName"
,
key
:
"roleName
s
"
,
key
:
"roleName"
,
search
:
false
,
search
:
false
,
},
},
{
{
...
...
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