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
9335a317
Commit
9335a317
authored
Aug 02, 2023
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出库
parent
932cd13d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2119 additions
and
328 deletions
+2119
-328
routes.js
config/routes.js
+5
-0
index.jsx
src/components/EditTable/index.jsx
+0
-1
index.jsx
src/components/InitForm/index.jsx
+32
-2
fields.js
src/pages/Movestore/fields.js
+1095
-0
index.jsx
src/pages/Movestore/index.jsx
+537
-0
index.less
src/pages/Movestore/index.less
+10
-0
printdom.jsx
src/pages/Movestore/printdom.jsx
+209
-0
index.jsx
src/pages/outsetstore/Otheroutstore/index.jsx
+230
-324
index.jsx
src/pages/system/Reservoir/index.jsx
+1
-1
No files found.
config/routes.js
View file @
9335a317
...
...
@@ -73,6 +73,11 @@ export default [
name
:
"任务单管理"
,
component
:
"./Task"
,
},
{
path
:
"/wms/move"
,
name
:
"移库单管理"
,
component
:
"./Movestore"
,
},
{
component
:
"./404"
,
},
...
...
src/components/EditTable/index.jsx
View file @
9335a317
...
...
@@ -21,7 +21,6 @@ const EditTable = ({
update
()
}
},[
value
])
console
.
log
(
columns
[
0
]);
return
(
<
EditableProTable
...
...
src/components/InitForm/index.jsx
View file @
9335a317
...
...
@@ -144,8 +144,6 @@ let InitForm = ({
form
=
formRef
?
formRef
:
form
;
useEffect
(()
=>
{
let
Doms
=
[],
klink
=
{},
...
...
@@ -1261,6 +1259,38 @@ let InitForm = ({
</
Divider
>
</
Col
>
)
:
null
;
}
else
if
(
item
.
type
==
"Linktable"
)
{
let
extraparams
=
getTableLinked
(
item
);
//声明需要被联动
return
!
extraprops
.
hides
?
(
<
Col
key=
{
i
}
{
...
getCol
(
item
.
col
)}
>
<
Form
.
Item
style=
{
{}
}
label=
{
item
.
title
}
name=
{
item
.
name
[
0
]
}
rules=
{
[
{
required
:
item
.
required
,
message
:
`请输入${item.title}`
,
},
]
}
>
<
EditTable
columns=
{
item
.
columns
}
extraparams=
{
extraparams
}
path=
{
item
.
path
}
editable=
{
item
.
editable
}
rowKey=
{
item
.
rowKey
}
rowName=
{
item
.
rowName
}
defaultdataSource=
{
item
.
dataSource
}
pagination=
{
item
.
pagination
}
recordCreatorProps=
{
item
.
recordCreatorProps
}
value=
{
item
.
value
}
maxLength=
{
item
.
maxLength
}
linkconfig=
{
item
.
linkconfig
}
></
EditTable
>
</
Form
.
Item
>
</
Col
>
)
:
null
;
}
})
}
{
bottomNode
&&
<
Col
span=
{
24
}
>
{
bottomNode
}
</
Col
>
}
...
...
src/pages/Movestore/fields.js
0 → 100644
View file @
9335a317
import
{
factorySelect
,
shopSelectByFactory
}
from
"@/services/system"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
Button
,
Table
}
from
"antd"
;
import
EditTable
from
"@/components/EditTable"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useModel
}
from
"umi"
;
const
EditUpload
=
({
record
,
fid
,
storeId
})
=>
{
const
[
value
,
setvalue
]
=
useState
({
[
record
.
id
]:
record
.
downloadList
,
});
const
{
initialState
,
setInitialState
}
=
useModel
(
"@@initialState"
);
useEffect
(()
=>
{
if
(
!
value
)
{
return
;
}
let
newlist
=
Object
.
keys
(
value
)?.
map
?.((
it
)
=>
{
let
id
=
it
;
let
newArr
=
value
[
id
]?.
filter
((
it
)
=>
typeof
it
.
id
==
"number"
)
??
[];
return
{
id
,
downloadList
:
newArr
.
map
((
its
)
=>
{
return
{
storePositionId
:
its
?.
storePositionId
,
outstroeNum
:
its
?.
outstroeNum
,
stockNum
:
its
?.
stockNum
,
remark
:
its
?.
remark
,
materieControlNo
:
its
?.
materieControlNo
,
};
}),
};
})
??
[];
setInitialState
((
s
)
=>
{
return
{
...
s
,
submits
:
{
id
:
fid
,
materialList
:
s
.
submits
&&
s
?.
submits
?.
materialList
?
s
?.
submits
?.
materialList
?.
filter
(
(
it
)
=>
newlist
.
map
((
item
)
=>
item
.
id
).
indexOf
(
it
.
id
)
==
-
1
)
?.
concat
(
newlist
)
?.
filter
((
it
)
=>
it
.
downloadList
?.
length
>
0
)
:
[],
},
};
});
},
[
value
]);
return
(
<
EditTable
rowKey
=
"id"
maxLength
=
{
1000
}
linkconfig
=
{{
urlchangeval
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStore/queryStoreOne"
,
params
,
}),
params
:
{
storePositionId
:
"linked"
,
materieControlNo
:
"linked"
},
effectresult
:
{
supplierNo
:
"supplierNo"
,
supplierName
:
"supplierName"
,
stockNum
:
"stroeNum"
,
materieControlNo
:
"materieControlNo"
,
},
},
}}
style
=
{{
marginLeft
:
48
}}
columns
=
{[
{
title
:
"库位名称"
,
dataIndex
:
"storePositionName"
,
key
:
"storePositionId"
,
search
:
false
,
valueType
:
"select"
,
request
:
async
(
params
)
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-auth/sysStorePosition/queryByStoreId/selection"
,
params
:
{
storeId
:
params
.
storeId
},
});
return
res
?.
data
?.
dataList
;
},
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
params
:
{
storeId
:
storeId
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
"批次号/SN号"
,
dataIndex
:
"materieControlNo"
,
key
:
"materieControlNo"
,
search
:
false
,
valueType
:
"select"
,
request
:
async
(
params
)
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStore/queryPCList"
,
params
:
{
materieId
:
params
.
materieId
,
storePositionId
:
params
.
storePositionId
,
},
});
return
res
?.
data
?.
dataList
;
},
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
params
:
(
row
)
=>
{
return
{
materieId
:
record
.
materieId
,
storePositionId
:
row
.
storePositionId
,
};
},
width
:
200
,
},
{
title
:
"下架数量"
,
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
search
:
false
,
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
valueType
:
"digit"
,
},
{
title
:
"供应商编号"
,
dataIndex
:
"supplierNo"
,
key
:
"supplierNo"
,
search
:
false
,
readonly
:
true
,
},
{
title
:
"供应商名称"
,
dataIndex
:
"supplierName"
,
key
:
"supplierName"
,
search
:
false
,
readonly
:
true
,
},
{
title
:
"库存数量"
,
dataIndex
:
"stockNum"
,
key
:
"stockNum"
,
search
:
false
,
readonly
:
true
,
},
{
title
:
"备注"
,
dataIndex
:
"remark"
,
key
:
"remark"
,
search
:
false
,
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{}}
>
删除
<
/a>
,
],
},
]}
value
=
{
value
[
record
.
id
]}
onChange
=
{(
vals
)
=>
{
setvalue
((
s
)
=>
({
...
s
,
[
record
.
id
]:
vals
,
}));
}}
pagination
=
{
false
}
/
>
);
};
const
one
=
{
materieOutstoreNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"出库单号"
,
name
:
[
"materieOutstoreNo"
],
required
:
false
,
placeholder
:
"不填写系统自动生成"
,
},
storeId
:
{
value
:
null
,
type
:
"select"
,
title
:
"出库仓库"
,
name
:
[
"storeId"
],
required
:
true
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{
factoryIdList
:
[]
},
}),
params
:
{},
},
linked
:
true
,
},
businessNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"相关单号"
,
name
:
[
"businessNo"
],
required
:
false
,
},
remark
:
{
value
:
null
,
type
:
"textarea"
,
title
:
"备注"
,
name
:
[
"remark"
],
required
:
false
,
col
:
{
span
:
24
,
},
},
materialList
:
{
value
:
[],
title
:
"物料信息"
,
type
:
"table"
,
col
:
{
span
:
24
},
name
:
[
"materialList"
],
required
:
true
,
linkconfig
:
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/queryStoreOne"
,
params
,
}),
params
:
{
materieId
:
"linked"
},
effectresult
:
{
productionUnit
:
"productionUnit"
,
//key 为列表更新值 value为response 返回值
productionUnitName
:
"productionUnitName"
,
usableNum
:
"usableNum"
,
outstroeNum
:
"outstroeNum"
,
},
},
},
columns
:
[
{
title
:
(
<
span
>
物料编码
-
名称
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"materieId"
,
key
:
"materieId"
,
valueType
:
"select"
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterie/query/selectbox"
,
params
:
{},
});
return
res
?.
data
?.
dataList
;
},
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
editable
:
true
,
},
{
title
:
(
<
span
>
出库数量
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
valueType
:
"digit"
,
editable
:
true
,
},
{
title
:
"可用库存"
,
dataIndex
:
"usableNum"
,
key
:
"usableNum"
,
readonly
:
"usableNum"
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
readonly
:
"productionUnitName"
,
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{}}
>
删除
<
/a>
,
],
},
],
rowKey
:
"id"
,
},
},
two
=
{
materieOutstoreNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"出库单号"
,
name
:
[
"materieOutstoreNo"
],
required
:
false
,
placeholder
:
"不填写系统自动生成"
,
},
storeId
:
{
value
:
null
,
type
:
"select"
,
title
:
"出库仓库"
,
name
:
[
"storeId"
],
required
:
true
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{
factoryIdList
:
[]
},
}),
params
:
{},
},
},
businessNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"相关单号"
,
name
:
[
"businessNo"
],
required
:
false
,
},
remark
:
{
value
:
null
,
type
:
"textarea"
,
title
:
"备注"
,
name
:
[
"remark"
],
required
:
false
,
col
:
{
span
:
24
,
},
},
materialList
:
{
value
:
[],
title
:
"物料信息"
,
type
:
"table"
,
col
:
{
span
:
24
},
name
:
[
"materialList"
],
required
:
true
,
linkconfig
:
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/queryStoreOne"
,
params
,
}),
params
:
{
materieId
:
"linked"
},
effectresult
:
{
productionUnit
:
"productionUnit"
,
//key 为列表更新值 value为response 返回值
productionUnitName
:
"productionUnitName"
,
usableNum
:
"usableNum"
,
outstroeNum
:
"outstroeNum"
,
},
},
},
columns
:
[
{
title
:
(
<
span
>
物料编码
-
名称
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"materieId"
,
key
:
"materieId"
,
valueType
:
"select"
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterie/query/selectbox"
,
params
:
{},
});
return
res
?.
data
?.
dataList
;
},
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
(
<
span
>
出库数量
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
valueType
:
"digit"
,
},
{
title
:
"可用库存"
,
dataIndex
:
"usableNum"
,
key
:
"usableNum"
,
readonly
:
"usableNum"
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
readonly
:
"productionUnitName"
,
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{}}
>
删除
<
/a>
,
],
},
],
rowKey
:
"id"
,
},
},
three
=
{
materieOutstoreNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"出库单号"
,
name
:
[
"materieOutstoreNo"
],
required
:
false
,
placeholder
:
"不填写系统自动生成"
,
},
storeId
:
{
value
:
null
,
type
:
"select"
,
title
:
"出库仓库"
,
name
:
[
"storeId"
],
required
:
true
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{
factoryIdList
:
[]
},
}),
params
:
{},
},
},
businessNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"相关单号"
,
name
:
[
"businessNo"
],
required
:
false
,
},
remark
:
{
value
:
null
,
type
:
"textarea"
,
title
:
"备注"
,
name
:
[
"remark"
],
required
:
false
,
col
:
{
span
:
24
,
},
},
materialList
:
{
value
:
[],
title
:
"物料信息"
,
type
:
"table"
,
col
:
{
span
:
24
},
name
:
[
"materialList"
],
required
:
true
,
linkconfig
:
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/queryStoreOne"
,
params
,
}),
params
:
{
materieId
:
"linked"
},
effectresult
:
{
productionUnit
:
"productionUnit"
,
//key 为列表更新值 value为response 返回值
productionUnitName
:
"productionUnitName"
,
usableNum
:
"usableNum"
,
outstroeNum
:
"outstroeNum"
,
},
},
},
columns
:
[
{
title
:
(
<
span
>
物料编码
-
名称
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"materieId"
,
key
:
"materieId"
,
valueType
:
"select"
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterie/query/selectbox"
,
params
:
{},
});
return
res
?.
data
?.
dataList
;
},
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
(
<
span
>
出库数量
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
valueType
:
"digit"
,
},
{
title
:
"可用库存"
,
dataIndex
:
"usableNum"
,
key
:
"usableNum"
,
readonly
:
"usableNum"
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
readonly
:
"productionUnitName"
,
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{}}
>
删除
<
/a>
,
],
},
],
rowKey
:
"id"
,
},
},
four
=
{
materieOutstoreNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"出库单号"
,
name
:
[
"materieOutstoreNo"
],
required
:
false
,
placeholder
:
"不填写系统自动生成"
,
},
storeId
:
{
value
:
null
,
type
:
"select"
,
title
:
"出库仓库"
,
name
:
[
"storeId"
],
required
:
true
,
options
:
{
database
:
()
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{
factoryIdList
:
[]
},
}),
params
:
{},
},
},
businessNo
:
{
value
:
null
,
type
:
"input"
,
title
:
"相关单号"
,
name
:
[
"businessNo"
],
required
:
false
,
},
remark
:
{
value
:
null
,
type
:
"textarea"
,
title
:
"备注"
,
name
:
[
"remark"
],
required
:
false
,
col
:
{
span
:
24
,
},
},
materialList
:
{
value
:
[],
title
:
"物料信息"
,
type
:
"table"
,
col
:
{
span
:
24
},
name
:
[
"materialList"
],
required
:
true
,
linkconfig
:
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/queryStoreOne"
,
params
,
}),
params
:
{
materieId
:
"linked"
},
effectresult
:
{
productionUnit
:
"productionUnit"
,
//key 为列表更新值 value为response 返回值
productionUnitName
:
"productionUnitName"
,
usableNum
:
"usableNum"
,
outstroeNum
:
"outstroeNum"
,
},
},
},
columns
:
[
{
title
:
(
<
span
>
物料编码
-
名称
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"materieId"
,
key
:
"materieId"
,
valueType
:
"select"
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/pmMaterie/query/selectbox"
,
params
:
{},
});
return
res
?.
data
?.
dataList
;
},
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
(
<
span
>
出库数量
<
b
style
=
{{
color
:
"red"
}}
>*<
/b
>
<
/span
>
),
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
valueType
:
"digit"
,
},
{
title
:
"可用库存"
,
dataIndex
:
"usableNum"
,
key
:
"usableNum"
,
readonly
:
"usableNum"
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
readonly
:
"productionUnitName"
,
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key
=
"delete"
onClick
=
{()
=>
{}}
>
删除
<
/a>
,
],
},
],
rowKey
:
"id"
,
},
},
detail
=
(
setselected
,
dom
)
=>
({
totalCard
:
[
//物料详情
{
cardTitle
:
"基本信息"
,
itemData
:
[
{
title
:
"入库单号"
,
key
:
"materieInstoreNo"
,
},
{
title
:
"入库类型"
,
key
:
"instoreTypeName"
,
},
{
title
:
"入库仓库"
,
key
:
"storeName"
,
},
{
title
:
"相关单号"
,
key
:
"businessNo"
,
},
{
title
:
"创建人"
,
key
:
"createUserName"
,
},
{
title
:
"创建时间"
,
key
:
"createTime"
,
},
{
title
:
"状态"
,
key
:
"statusName"
,
},
{
title
:
"完成时间"
,
key
:
"finishTime"
,
},
{
title
:
"备注"
,
key
:
"remark"
,
noshow
:
"100%"
,
},
{
title
:
"工单条形码"
,
noshow
:
true
,
key
:
"qrCodeUrl"
,
type
:
"img"
,
width
:
100
,
},
],
},
{
cardTitle
:
"物料信息列表"
,
extraContent
:
""
,
itemData
:
[
{
key
:
"materialList"
,
type
:
"table"
,
col
:
{
span
:
24
},
columns
:
[
{
title
:
"物料编码 - 名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
(
row
.
materieCode
??
""
)
+
" - "
+
(
row
.
materieName
??
""
)
);
},
},
{
title
:
"供应商编号 - 名称"
,
dataIndex
:
"supplierNo"
,
key
:
"supplierNo"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
(
row
.
supplierNo
??
""
)
+
" - "
+
(
row
.
supplierName
??
""
)
);
},
},
{
title
:
"批次号/SN号"
,
dataIndex
:
"materieControlNo"
,
key
:
"materieControlNo"
,
search
:
false
,
},
{
title
:
"入库数量"
,
dataIndex
:
"instroeNum"
,
key
:
"instroeNum"
,
search
:
false
,
},
{
title
:
"未上架数量"
,
dataIndex
:
"remainderNums"
,
key
:
"remainderNums"
,
search
:
false
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
},
],
expandable
:
{
defaultExpandAllRows
:
true
,
expandedRowRender
:
(
record
)
=>
(
<
Table
style
=
{{
marginLeft
:
48
}}
columns
=
{[
{
title
:
"库位名称"
,
dataIndex
:
"storePositionName"
,
key
:
"storePositionName"
,
search
:
false
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
"上架数量"
,
dataIndex
:
"instroeNum"
,
key
:
"instroeNum"
,
search
:
false
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
]}
dataSource
=
{
record
.
uploadList
}
pagination
=
{
false
}
/
>
),
},
pagination
:
"false"
,
rowKey
:
"id"
,
rowSelection
:
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
setselected
(
selectedRows
);
},
},
},
],
},
{
cardTitle
:
"强制关单信息"
,
itemData
:
[
{
title
:
"关单人"
,
key
:
"closeUserName"
,
},
{
title
:
"关单时间"
,
key
:
"closeTime"
,
},
],
},
{
cardTitle
:
"上架明细"
,
noPrint
:
true
,
itemData
:
[
{
key
:
"materialUploadList"
,
type
:
"table"
,
col
:
{
span
:
24
},
columns
:
[
{
title
:
"物料编码 - 名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
(
row
.
materieCode
??
""
)
+
" - "
+
(
row
.
materieName
??
""
)
);
},
},
{
title
:
"供应商编号 - 名称"
,
dataIndex
:
"supplierNo"
,
key
:
"supplierNo"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
(
row
.
supplierNo
??
""
)
+
" - "
+
(
row
.
supplierName
??
""
)
);
},
},
{
title
:
"批次号/SN号"
,
dataIndex
:
"materieControlNo"
,
key
:
"materieControlNo"
,
search
:
false
,
},
{
title
:
"入库数量"
,
dataIndex
:
"instroeNum"
,
key
:
"instroeNum"
,
search
:
false
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
},
],
expandable
:
{
defaultExpandAllRows
:
true
,
expandedRowRender
:
(
record
)
=>
(
<
Table
style
=
{{
marginLeft
:
48
}}
columns
=
{[
{
title
:
"库位名称"
,
dataIndex
:
"storePositionName"
,
key
:
"storePositionName"
,
search
:
false
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
"上架数量"
,
dataIndex
:
"instroeNum"
,
key
:
"instroeNum"
,
search
:
false
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
"备注"
,
dataIndex
:
"remark"
,
key
:
"remark"
,
search
:
false
,
},
{
title
:
"操作人"
,
dataIndex
:
"uploadUserName"
,
key
:
"uploadUserName"
,
search
:
false
,
},
{
title
:
"操作时间"
,
dataIndex
:
"uploadTime"
,
key
:
"uploadTime"
,
search
:
false
,
},
]}
dataSource
=
{
record
.
uploadList
}
pagination
=
{
false
}
/
>
),
},
pagination
:
"false"
,
},
],
},
],
}),
dooutside
=
(
fid
,
storeId
)
=>
({
totalCard
:
[
//物料详情
{
cardTitle
:
"基本信息"
,
itemData
:
[
{
title
:
"出库单号"
,
key
:
"materieOutstoreNo"
,
},
{
title
:
"出库类型"
,
key
:
"outstoreTypeName"
,
},
{
title
:
"出库仓库"
,
key
:
"storeName"
,
},
{
title
:
"相关单号"
,
key
:
"businessNo"
,
},
{
title
:
"备注"
,
key
:
"remark"
,
},
{
title
:
"创建人"
,
key
:
"createUserName"
,
},
{
title
:
"创建时间"
,
key
:
"createTime"
,
},
{
title
:
"状态"
,
key
:
"statusName"
,
},
],
},
{
cardTitle
:
"物料信息列表"
,
extra
:
true
,
extrapath
:
"/ngic-workmanship/wmsMaterieOutstore/download"
,
extrakey
:
"submits"
,
//redux key
itemData
:
[
{
key
:
"materialList"
,
type
:
"table"
,
col
:
{
span
:
24
},
columns
:
[
{
title
:
"物料编码 - 名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
(
row
.
materieCode
??
""
)
+
" - "
+
(
row
.
materieName
??
""
)
);
},
},
{
title
:
"出库数量"
,
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
search
:
false
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
},
{
title
:
"未下架数量"
,
dataIndex
:
"remainderNums"
,
key
:
"remainderNums"
,
search
:
false
,
},
],
expandable
:
{
expandedRowRender
:
(
record
)
=>
(
<
EditUpload
record
=
{
record
}
fid
=
{
fid
}
storeId
=
{
storeId
}
/
>
),
},
},
],
},
],
});
export
default
{
one
,
two
,
three
,
four
,
detail
,
dooutside
,
};
src/pages/Movestore/index.jsx
0 → 100644
View file @
9335a317
import
React
,
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
{
Dropdown
,
Menu
,
Button
,
message
}
from
"antd"
;
import
AutoTable
from
"@/components/AutoTable"
;
import
defaultFields
from
"./fields"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
DrawInitForm
from
"@/components/DrawInitForm"
;
import
getPrem
from
"@/utils/getPrem"
;
//权限判断fn
import
{
useReactToPrint
}
from
"react-to-print"
;
import
{
useModel
}
from
"umi"
;
import
PrintDom
from
"./printdom"
;
import
{
PrintQrCode
}
from
"@/components/PrintCode"
;
const
keytoval
=
{
one
:
1
,
two
:
2
,
three
:
3
,
four
:
4
,
},
items
=
[
{
key
:
"one"
,
label
:
<
a
>
生产领料出库
</
a
>,
},
{
key
:
"two"
,
label
:
<
a
>
销售出库
</
a
>,
},
{
key
:
"three"
,
label
:
<
a
>
报废出库
</
a
>,
},
{
key
:
"four"
,
label
:
<
a
>
其他出库
</
a
>,
},
],
itemz
=
{
one
:
"生产领料出库"
,
two
:
"销售出库"
,
three
:
"报废出库"
,
four
:
"其他出库"
,
};
function
Outstore
(
props
)
{
const
{
initialState
,
setInitialState
}
=
useModel
(
"@@initialState"
);
const
[
activeTabKey
,
onTabChange
]
=
useState
(
"1"
);
const
[
selectKeys
,
setSelectKeys
]
=
useState
([]);
let
[
drawprops
,
setdrawprops
]
=
useState
({
title
:
""
,
visible
:
false
,
onClose
:
()
=>
{
setdrawprops
((
s
)
=>
({
...
s
,
visible
:
false
,
fields
:
{},
}));
},
fields
:
{},
width
:
1200
,
}),
actionRef
=
useRef
(),
ChildRef
=
null
,
printRef
=
useRef
(),
mutiPrintRef
=
useRef
();
//操作完成后刷新
function
reload
()
{
actionRef
.
current
.
reload
();
ChildRef
?.
onRefresh
();
message
.
success
(
"操作成功"
);
setdrawprops
((
s
)
=>
({
...
s
,
visible
:
false
,
fields
:
{},
}));
}
const
handlePrint
=
useReactToPrint
({
content
:
()
=>
printRef
.
current
.
dom
.
current
,
});
const
mutiPrint
=
useReactToPrint
({
content
:
()
=>
mutiPrintRef
.
current
.
dom
.
current
,
});
const
PrintButton
=
(
<
Button
disabled=
{
!
selectKeys
.
length
}
onClick=
{
()
=>
{
mutiPrint
();
}
}
>
打印
</
Button
>
);
useEffect
(()
=>
{
const
detail
=
defaultFields
.
detail
(
setSelectKeys
,
PrintButton
);
setdrawprops
((
s
)
=>
({
...
s
,
...
detail
,
}));
},
[
selectKeys
]);
const
columns
=
useMemo
(()
=>
{
if
(
activeTabKey
==
"1"
)
{
return
[
{
title
:
"单据编号"
,
dataIndex
:
"materieInstoreNo"
,
key
:
"materieInstoreNo"
,
render
:
(
dom
,
record
)
=>
{
return
(
<
a
onClick=
{
()
=>
{
const
detail
=
defaultFields
.
detail
(
setSelectKeys
,
PrintButton
);
setdrawprops
((
s
)
=>
({
...
s
,
visible
:
true
,
//查看详情 props
val
:
"detail"
,
title
:
`查看详情`
,
...
detail
,
totalPath
:
"/ngic-workmanship/wmsMaterieInstore/getInStoreInfoById"
,
totalParams
:
{
id
:
record
.
id
},
extra
:
(
<
Button
onClick=
{
async
()
=>
{
handlePrint
();
}
}
>
打印
</
Button
>
),
}));
}
}
>
{
dom
}
</
a
>
);
},
},
{
title
:
"操作时间"
,
dataIndex
:
"operateTime"
,
key
:
"operateTimeList"
,
width
:
300
,
valueType
:
"dateRange"
,
search
:
false
,
render
:
(
_
,
row
)
=>
{
return
<
div
>
{
row
.
operateTime
}
</
div
>;
},
},
{
title
:
"操作人"
,
dataIndex
:
"operateUserName"
,
key
:
"operateUserName"
,
},
{
title
:
"单据类型"
,
dataIndex
:
"instoreTypeName"
,
key
:
"instoreType"
,
},
{
title
:
"物料编码"
,
dataIndex
:
"materieCode"
,
key
:
"materieCode"
,
},
{
title
:
"物料名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
},
{
title
:
"批次号"
,
dataIndex
:
"materieControlNo"
,
key
:
"materieControlNo"
,
},
{
title
:
"库存数量"
,
dataIndex
:
"stockNum"
,
key
:
"stockNum"
,
search
:
false
,
},
{
title
:
"来源库位"
,
dataIndex
:
"storeName"
,
search
:
false
,
key
:
"storeId"
,
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
},
{
title
:
"目标库位"
,
dataIndex
:
"remark"
,
search
:
false
,
key
:
"remark"
,
search
:
false
,
},
{
title
:
"单据状态"
,
dataIndex
:
"statusName"
,
key
:
"status"
,
valueType
:
"select"
,
options
:
[
{
label
:
"执行中"
,
value
:
"7"
,
},
{
label
:
"待分配"
,
value
:
"5"
,
},
{
label
:
"待执行"
,
value
:
"6"
,
},
],
},
];
}
else
{
return
[
{
title
:
"入库单号"
,
dataIndex
:
"materieInstoreNo"
,
key
:
"materieInstoreNo"
,
render
:
(
dom
,
record
)
=>
{
return
(
<
a
onClick=
{
()
=>
{
const
detail
=
defaultFields
.
detail
(
setSelectKeys
,
PrintButton
);
setdrawprops
((
s
)
=>
({
...
s
,
visible
:
true
,
//查看详情 props
val
:
"detail"
,
title
:
`查看详情`
,
...
detail
,
totalPath
:
"/ngic-workmanship/wmsMaterieInstoreHis/getInStoreInfoById"
,
totalParams
:
{
id
:
record
.
id
},
extra
:
(
<
Button
onClick=
{
async
()
=>
{
handlePrint
();
}
}
>
打印
</
Button
>
),
}));
}
}
>
{
dom
}
</
a
>
);
},
},
{
title
:
"入库类型"
,
dataIndex
:
"instoreTypeName"
,
key
:
"instoreType"
,
valueType
:
"select"
,
options
:
[
{
label
:
"来料入库"
,
value
:
"2"
,
},
{
label
:
"退料入库"
,
value
:
"3"
,
},
],
},
{
title
:
"入库仓库"
,
dataIndex
:
"storeName"
,
search
:
false
,
key
:
"storeId"
,
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
},
},
{
title
:
"备注"
,
dataIndex
:
"remark"
,
key
:
"remark"
,
search
:
false
,
},
{
title
:
"创建人"
,
dataIndex
:
"createUserName"
,
key
:
"createUserName"
,
search
:
false
,
},
{
title
:
"创建时间"
,
dataIndex
:
"createTime"
,
key
:
"createTimeList"
,
search
:
false
,
valueType
:
"dateRange"
,
formItemProps
:
{
name
:
"createTimeList"
,
},
},
{
title
:
"完成时间"
,
dataIndex
:
"finishTime"
,
search
:
false
,
key
:
"finishTime"
,
valueType
:
"dateRange"
,
formItemProps
:
{
name
:
"finishTimeList"
,
},
},
{
title
:
"状态"
,
dataIndex
:
"statusName"
,
key
:
"status"
,
valueType
:
"select"
,
options
:
[
{
label
:
"已关单"
,
value
:
"4"
,
},
{
label
:
"已完成"
,
value
:
"8"
,
},
],
},
];
}
},
[
activeTabKey
]);
const
tableprops
=
{
...
props
,
// pageextra:
// activeTabKey == "1" ? (
// <Dropdown
// placement="bottomRight"
// overlay={
// <Menu
// onClick={(e) => {
// setdrawprops((s) => ({
// ...s,
// visible: true,
// title: "新增" + itemz[e.key],
// fields: defaultFields[e.key],
// outstoreType: keytoval[e.key],
// val: "add", //类型
// extra: null,
// }));
// }}
// items={items}
// />
// }
// >
// <Button type="primary">新增</Button>
// </Dropdown>
// ) : (
// "none"
// ),
tabList
:
[
{
tab
:
"未完成"
,
key
:
"1"
,
},
{
tab
:
"已完成"
,
key
:
"2"
,
},
],
activeTabKey
,
onTabChange
,
columns
,
path
:
activeTabKey
==
"1"
?
"/ngic-workmanship/wmsMaterieInstore/queryList"
:
"/ngic-workmanship/wmsMaterieInstoreHis/queryList"
,
};
return
(
<
div
>
<
div
style=
{
{
position
:
"fixed"
,
bottom
:
-
100000
}
}
>
<
PrintDom
ref=
{
printRef
}
{
...
drawprops
}
/>
</
div
>
<
div
style=
{
{
display
:
"none"
}
}
>
<
PrintQrCode
ref=
{
mutiPrintRef
}
selectedItems=
{
selectKeys
}
/>
</
div
>
<
AutoTable
{
...
tableprops
}
actionRef=
{
actionRef
}
onRef=
{
(
node
)
=>
(
ChildRef
=
node
)
}
></
AutoTable
>
<
DrawInitForm
{
...
drawprops
}
submitData=
{
async
(
value
)
=>
{
if
(
drawprops
.
val
==
"add"
)
{
let
newfileds
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
newfileds
.
materialList
=
newfileds
?.
materialList
?.
map
((
it
)
=>
{
delete
it
.
usableNum
;
delete
it
.
id
;
return
it
;
});
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieOutstore/saveOutStore"
,
params
:
{
...
newfileds
,
outstoreType
:
drawprops
.
outstoreType
},
});
if
(
res
.
code
==
"0000"
)
{
reload
();
}
}
}
}
onChange=
{
async
(
changedValues
,
allValues
)
=>
{
for
(
let
i
in
changedValues
)
{
if
(
i
==
"storeId"
)
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/selectbox/usableStock"
,
params
:
{
storeId
:
changedValues
[
"storeId"
]
},
}),
options
=
res
?.
data
?.
dataList
;
setdrawprops
((
s
)
=>
{
let
fields
=
JSON
.
parse
(
JSON
.
stringify
(
s
.
fields
));
for
(
let
i
in
fields
)
{
fields
[
i
].
value
=
allValues
[
i
];
}
fields
[
"materialList"
].
linkconfig
=
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieStockStore/queryStoreOne"
,
params
,
}),
params
:
{
materieId
:
"linked"
,
storeId
:
changedValues
[
i
]
},
effectresult
:
{
productionUnit
:
"productionUnit"
,
//key 为列表更新值 value为response 返回值
productionUnitName
:
"productionUnitName"
,
usableNum
:
"usableNum"
,
outstroeNum
:
"outstroeNum"
,
},
},
};
fields
[
"materialList"
].
columns
=
[
{
title
:
(
<
span
>
物料编码-名称
<
b
style=
{
{
color
:
"red"
}
}
>
*
</
b
>
</
span
>
),
dataIndex
:
"materieId"
,
key
:
"materieId"
,
valueType
:
"select"
,
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
options
,
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
editable
:
true
,
},
{
title
:
(
<
span
>
出库数量
<
b
style=
{
{
color
:
"red"
}
}
>
*
</
b
>
</
span
>
),
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
valueType
:
"digit"
,
fieldProps
:
{
precision
:
3
,
},
editable
:
true
,
},
{
title
:
"可用库存"
,
dataIndex
:
"usableNum"
,
key
:
"usableNum"
,
readonly
:
"usableNum"
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
readonly
:
"productionUnitName"
,
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
<
a
key=
"delete"
onClick=
{
()
=>
{}
}
>
删除
</
a
>,
],
},
];
fields
[
"materialList"
].
value
=
undefined
;
let
newfields
=
{
...
fields
,
};
return
{
...
s
,
fields
:
newfields
,
};
});
}
}
}
}
reload=
{
reload
}
/>
</
div
>
);
}
export
default
Outstore
;
src/pages/Movestore/index.less
0 → 100644
View file @
9335a317
.sitelayout {
min-height: calc(100vh - 98px) !important;
.sitelayoutbackground {
background: #fff;
}
}
.title{
margin: 0px;
}
\ No newline at end of file
src/pages/Movestore/printdom.jsx
0 → 100644
View file @
9335a317
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
React
,
{
useState
,
useImperativeHandle
,
forwardRef
,
useRef
,
}
from
"react"
;
import
{
useEffect
}
from
"react"
;
import
{
ScrollBoard
}
from
"@jiaminghi/data-view-react"
;
import
{
useWindowSize
}
from
"@/utils/windowsize"
;
const
pageStyle
=
`
@media all {
.page-break {
display: none;
}
}
@media print {
html, body {
height: initial !important;
overflow: initial !important;
position:relative;
-webkit-print-color-adjust: exact;
word-break: break-all;
}
}
@media print {
.page-break {
margin-top:0;
display: block;
page-break-before: auto;
}
}
@media print {
.page-noprint {
display: none !important;
}
}
@page {
size: auto;
margin: 0px;
}
`
;
let
columns
=
[
{
title
:
"物料编码 - 名称"
,
dataIndex
:
"materieName"
,
key
:
"materieName"
,
search
:
false
,
render
:
(
dom
,
row
)
=>
{
return
(
row
.
materieCode
??
""
)
+
" - "
+
(
row
.
materieName
??
""
);
},
},
{
title
:
"出库数量"
,
dataIndex
:
"outstroeNum"
,
key
:
"outstroeNum"
,
search
:
false
,
},
{
title
:
"库存单位"
,
dataIndex
:
"productionUnitName"
,
key
:
"productionUnitName"
,
search
:
false
,
width
:
60
,
},
];
function
PrintDom
({
totalPath
,
val
,
totalParams
,
totalCard
},
ref
)
{
console
.
log
(
totalCard
);
let
printRef
=
useRef
();
const
[
data
,
setdata
]
=
useState
({});
useImperativeHandle
(
ref
,
()
=>
({
dom
:
printRef
,
}));
useEffect
(()
=>
{
if
(
val
==
"detail"
)
{
doFetch
({
url
:
totalPath
,
params
:
totalParams
}).
then
((
res
)
=>
{
if
(
res
.
code
==
"0000"
)
{
setdata
(
res
?.
data
?.
data
);
}
});
}
else
{
}
},
[
val
]);
let
datas
=
data
?.
materialList
?
data
?.
materialList
.
map
((
it
)
=>
{
return
columns
.
map
((
item
)
=>
{
if
(
item
.
render
)
{
return
item
.
render
(
it
,
it
);
}
else
{
return
it
[
item
.
dataIndex
];
}
});
})
:
[];
return
(
<>
<
style
type=
"text/css"
media=
"print"
>
{
pageStyle
}
</
style
>
{
val
==
"detail"
&&
(
<
div
ref=
{
printRef
}
style=
{
{
width
:
"100%"
,
minHeight
:
"100%"
,
overflow
:
"inherit"
,
position
:
"relative"
,
}
}
>
<
div
style=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
padding
:
"0 2%"
,
paddingBottom
:
12
,
}
}
>
<
h1
style=
{
{
width
:
"100%"
,
fontSize
:
40
,
marginTop
:
"-6px"
,
}
}
>
出库工单
</
h1
>
<
img
style=
{
{
width
:
300
,
height
:
"auto"
,
}
}
src=
{
data
?.
qrCodeUrl
}
alt=
""
/>
</
div
>
<
div
style=
{
{
display
:
"flex"
,
flexWrap
:
"wrap"
,
paddingLeft
:
"2%"
,
marginTop
:
24
,
}
}
>
{
totalCard
&&
totalCard
[
0
].
itemData
.
filter
((
it
)
=>
!
(
it
.
noshow
===
true
))
.
map
((
it
)
=>
{
return
(
<
div
style=
{
{
width
:
it
.
noshow
??
"32%"
,
backgroundColor
:
"#f9f9f9"
,
marginRight
:
"1%"
,
marginBottom
:
10
,
padding
:
"4px"
,
fontSize
:
20
,
overflow
:
"hidden"
,
}
}
>
<
b
>
{
it
.
title
}
:
</
b
>
<
span
>
{
data
[
it
.
key
]
||
"-"
}
</
span
>
</
div
>
);
})
}
</
div
>
<
div
style=
{
{
padding
:
"4px 2%"
,
position
:
"relative"
,
width
:
"100%"
,
overflow
:
"hidden"
,
}
}
id=
"large"
>
<
div
style=
{
{
marginBottom
:
18
,
}
}
>
<
b
>
{
totalCard
&&
totalCard
[
1
].
cardTitle
}
</
b
>
</
div
>
<
ScrollBoard
config=
{
{
header
:
columns
.
map
((
it
)
=>
it
.
title
),
data
:
datas
,
rowNum
:
datas
.
length
,
hoverPause
:
false
,
}
}
/>
</
div
>
</
div
>
)
}
</>
);
}
export
default
forwardRef
(
PrintDom
);
src/pages/outsetstore/Otheroutstore/index.jsx
View file @
9335a317
import
React
,
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
{
Dropdown
,
Menu
,
Button
,
message
,
Table
}
from
"antd"
;
import
{
Dropdown
,
Menu
,
Button
,
message
,
Table
,
Select
}
from
"antd"
;
import
AutoTable
from
"@/components/AutoTable"
;
// import defaultFields from "./fields";
import
{
doFetch
}
from
"@/utils/doFetch"
;
...
...
@@ -42,144 +42,37 @@ const keytoval = {
four
:
"其他出库"
,
};
const
EditUpload
=
({
record
,
fid
,
storeId
})
=>
{
const
[
value
,
setvalue
]
=
useState
({
[
record
.
id
]:
record
.
uploadList
,
});
const
{
initialState
,
setInitialState
}
=
useModel
(
"@@initialState"
);
useEffect
(()
=>
{
if
(
!
value
)
{
return
;
}
let
newlist
=
Object
.
keys
(
value
)?.
map
?.((
it
)
=>
{
let
id
=
it
;
let
newArr
=
value
[
id
]?.
filter
((
it
)
=>
typeof
it
.
id
==
"number"
)
??
[];
return
{
id
,
uploadList
:
newArr
.
map
((
its
)
=>
{
return
{
storePositionId
:
its
?.
storePositionId
,
instroeNum
:
its
?.
instroeNum
,
remark
:
its
?.
remark
,
};
}),
};
})
??
[];
setInitialState
((
s
)
=>
{
return
{
...
s
,
submit
:
{
id
:
fid
,
materialList
:
s
.
submit
&&
s
?.
submit
?.
materialList
?
s
?.
submit
?.
materialList
?.
filter
(
(
it
)
=>
newlist
.
map
((
item
)
=>
item
.
id
).
indexOf
(
it
.
id
)
==
-
1
)
?.
concat
(
newlist
)
?.
filter
((
it
)
=>
it
.
uploadList
?.
length
>
0
)
:
[],
},
};
});
},
[
value
]);
return
(
<
EditableProTable
rowKey=
{
"id"
}
maxLength=
{
1000
}
style=
{
{
marginLeft
:
48
}
}
columns=
{
[
{
title
:
(
<
span
>
库位名称
<
b
style=
{
{
color
:
"red"
}
}
>
*
</
b
>
</
span
>
),
dataIndex
:
"storePositionName"
,
key
:
"storePositionId"
,
search
:
false
,
valueType
:
"select"
,
request
:
async
(
params
)
=>
{
const
MySelect
=
({
storeId
,
record
,
value
,
onChange
})
=>
{
console
.
log
(
storeId
,
record
);
const
[
inputValue
,
setInputValue
]
=
useState
(
""
);
const
[
options
,
setoptions
]
=
useState
([]);
const
rref
=
useRef
();
const
createSelectOptions
=
async
(
row
,
storeId
)
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-auth/sysStorePosition/queryByStoreId/selection
"
,
params
:
{
storeId
:
params
.
stor
eId
},
url
:
"/ngic-workmanship/wmsMaterieInventory/query/selectbox
"
,
params
:
{
storeId
,
materieId
:
row
?.
materi
eId
},
});
return
res
?.
data
?.
dataList
;
},
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
params
:
{
storeId
:
storeId
},
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
},
{
title
:
(
<
span
>
上架数量
<
b
style=
{
{
color
:
"red"
}
}
>
*
</
b
>
</
span
>
),
dataIndex
:
"instroeNum"
,
key
:
"instroeNum"
,
search
:
false
,
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
valueType
:
"digit"
,
formItemProps
:
()
=>
{
return
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
setoptions
(
res
?.
data
?.
dataList
??
[]);
};
},
},
{
title
:
"备注"
,
dataIndex
:
"remark"
,
key
:
"remark"
,
search
:
false
,
editable
:
(
text
,
record
,
index
)
=>
{
return
!
record
.
materieOutstoreDetailId
;
},
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
70
,
render
:
(
text
,
record
,
_
,
action
)
=>
[
typeof
record
.
id
==
"number"
&&
(
<
a
key=
"delete"
onClick=
{
()
=>
{}
}
>
删除
</
a
>
),
],
},
]
}
value=
{
value
[
record
.
id
]
}
recordCreatorProps=
{
{
newRecordType
:
"dataSource"
,
record
:
()
=>
({
id
:
Date
.
now
(),
}),
}
}
editable=
{
{
type
:
"multiple"
,
actionRender
:
(
row
,
config
,
defaultDoms
)
=>
{
return
[
defaultDoms
.
delete
];
},
onValuesChange
:
async
(
records
,
recordList
)
=>
{
setvalue
((
s
)
=>
{
return
{
...
s
,
[
record
.
id
]:
recordList
,
const
handleSelectChange
=
(
e
)
=>
{
setInputValue
(
e
);
onChange
(
e
);
console
.
log
(
value
);
};
});
},
}
}
pagination=
{
false
}
useEffect
(()
=>
{
createSelectOptions
(
record
,
storeId
);
},
[]);
return
(
<
Select
ref=
{
rref
}
onChange=
{
handleSelectChange
}
value=
{
inputValue
}
placeholder=
"Select an option"
style=
{
{
width
:
"100%"
}
}
options=
{
options
}
/>
);
};
...
...
@@ -616,15 +509,16 @@ function Outstore(props) {
},
fields
:
{},
width
:
1200
,
storeId
:
""
,
materieId
:
""
,
}),
actionRef
=
useRef
(),
ChildRef
=
null
,
printRef
=
useRef
(),
mutiPrintRef
=
useRef
();
mutiPrintRef
=
useRef
(),
[
storeId
,
setstoreId
]
=
useState
();
const
outStoreFields
=
{
const
outStoreFields
=
useMemo
(()
=>
{
console
.
log
(
storeId
);
return
{
materieOutstoreNo
:
{
value
:
null
,
type
:
"input"
,
...
...
@@ -632,7 +526,7 @@ function Outstore(props) {
name
:
[
"materieOutstoreNo"
],
required
:
false
,
placeholder
:
"不填写系统自动生成"
,
readonly
:
true
,
disabled
:
true
,
},
outstoreTypeName
:
{
value
:
null
,
...
...
@@ -640,7 +534,7 @@ function Outstore(props) {
type
:
"input"
,
name
:
[
"outstoreTypeName"
],
required
:
true
,
readonly
:
true
,
disabled
:
true
,
},
storeId
:
{
value
:
null
,
...
...
@@ -648,7 +542,7 @@ function Outstore(props) {
type
:
"input"
,
name
:
[
"storeId"
],
required
:
true
,
readonly
:
true
,
disabled
:
true
,
},
remark
:
{
value
:
null
,
...
...
@@ -659,39 +553,39 @@ function Outstore(props) {
col
:
{
span
:
24
,
},
readonly
:
true
,
disabled
:
true
,
},
materialList
:
{
value
:
[],
title
:
"物料信息"
,
type
:
"
table"
,
type
:
"Link
table"
,
col
:
{
span
:
24
},
name
:
[
"materialList"
],
recordCreatorProps
:
"false"
,
required
:
true
,
//
linkconfig: {
//
urlchangeval: {
//
//根据url接口 改变某个value
//
database: (params) =>
//
doFetch({
// url: "/ngic-workmanship/wmsMaterieOutstore/download
",
//
params,
//
}),
// params: { labelId
: "linked" },
//
effectresult: {
//
productionUnitName: "productionUnitName",
//
materieCode: "materieCode",
//
supplierId: "supplierId",
//
supplierName: "supplierName",
//
width: "width",
//
ironLoss: "ironLoss",
//
sheetThickness: "sheetThickness",
//
shopSign: "shopSign",
//
weight: "weight",
//
specificationModel: "specificationModel",
//
},
//
},
//
},
linkconfig
:
{
urlchangeval
:
{
//根据url接口 改变某个value
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieInventory/queryByMaterieControlNo
"
,
params
,
}),
params
:
{
materieControlNo
:
"linked"
},
effectresult
:
{
productionUnitName
:
"productionUnitName"
,
materieCode
:
"materieCode"
,
supplierId
:
"supplierId"
,
supplierName
:
"supplierName"
,
width
:
"width"
,
ironLoss
:
"ironLoss"
,
sheetThickness
:
"sheetThickness"
,
shopSign
:
"shopSign"
,
weight
:
"weight"
,
specificationModel
:
"specificationModel"
,
},
},
},
columns
:
[
{
title
:
(
...
...
@@ -710,17 +604,20 @@ function Outstore(props) {
批次号
<
b
style=
{
{
color
:
"red"
}
}
>
*
</
b
>
</
span
>
),
dataIndex
:
"labelId"
,
key
:
"labelId"
,
valueType
:
"select"
,
dataIndex
:
"materieControlNo"
,
key
:
"materieControlNo"
,
width
:
220
,
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieInventory/query/selectbox"
,
params
:
{
storeId
:
drawprops
?.
storeId
},
});
return
res
?.
data
?.
dataList
;
},
// render: () => {
// return <div>123123</div>
// },
// request: async (_) => {
// console.log(_);
// let res = await doFetch({
// url: "/ngic-workmanship/wmsMaterieInventory/query/selectbox",
// params: { storeId: drawprops?.storeId },
// });
// return res?.data?.dataList;
// },
fieldProps
:
{
allowClear
:
true
,
showSearch
:
true
,
...
...
@@ -730,6 +627,11 @@ function Outstore(props) {
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}],
};
},
renderFormItem
:
({
entry
})
=>
{
console
.
log
(
"renderFormItem"
,
storeId
);
return
<
MySelect
storeId=
{
storeId
}
record=
{
entry
}
/>;
// return storeId;
},
},
{
...
...
@@ -785,6 +687,7 @@ function Outstore(props) {
rowKey
:
"id"
,
},
};
},
[
drawprops
,
storeId
]);
//操作完成后刷新
function
reload
()
{
...
...
@@ -797,33 +700,6 @@ function Outstore(props) {
fields
:
{},
}));
}
const
handlePrint
=
useReactToPrint
({
content
:
()
=>
printRef
.
current
.
dom
.
current
,
});
const
mutiPrint
=
useReactToPrint
({
content
:
()
=>
mutiPrintRef
.
current
.
dom
.
current
,
});
const
PrintButton
=
(
<
Button
disabled=
{
!
selectKeys
.
length
}
onClick=
{
()
=>
{
mutiPrint
();
}
}
>
打印
</
Button
>
);
useEffect
(()
=>
{
const
detail
=
defaultFields
.
detail
(
setSelectKeys
,
PrintButton
);
setdrawprops
((
s
)
=>
({
...
s
,
...
detail
,
}));
},
[
selectKeys
]);
const
columns
=
useMemo
(()
=>
{
if
(
activeTabKey
==
"1"
)
{
return
[
...
...
@@ -963,13 +839,14 @@ function Outstore(props) {
id
:
record
?.
id
,
},
});
console
.
log
(
details
?.
data
?.
data
);
const
detailData
=
details
.
data
?.
data
;
if
(
detailData
)
{
for
(
let
i
in
outStoreFields
)
{
outStoreFields
[
i
].
value
=
detailData
[
i
];
}
}
console
.
log
(
"storeId"
,
detailData
?.
storeId
);
setstoreId
(
detailData
?.
storeId
);
setdrawprops
((
s
)
=>
({
...
s
,
visible
:
true
,
...
...
@@ -977,8 +854,6 @@ function Outstore(props) {
val
:
"edit"
,
title
:
`下架采集`
,
fields
:
outStoreFields
,
storeId
:
detailData
?.
storeId
,
materieId
:
detailData
?.
materieId
,
}));
setInitialState
((
s
)
=>
{
return
{
...
...
@@ -1131,6 +1006,34 @@ function Outstore(props) {
];
}
},
[
activeTabKey
]);
useEffect
(()
=>
{
console
.
log
(
"123123"
,
storeId
);
},
[
storeId
]);
const
handlePrint
=
useReactToPrint
({
content
:
()
=>
printRef
.
current
.
dom
.
current
,
});
const
mutiPrint
=
useReactToPrint
({
content
:
()
=>
mutiPrintRef
.
current
.
dom
.
current
,
});
const
PrintButton
=
(
<
Button
disabled=
{
!
selectKeys
.
length
}
onClick=
{
()
=>
{
mutiPrint
();
}
}
>
打印
</
Button
>
);
useEffect
(()
=>
{
const
detail
=
defaultFields
.
detail
(
setSelectKeys
,
PrintButton
);
setdrawprops
((
s
)
=>
({
...
s
,
...
detail
,
}));
},
[
selectKeys
]);
const
tableprops
=
{
...
props
,
...
...
@@ -1205,6 +1108,8 @@ function Outstore(props) {
if
(
res
.
code
==
"0000"
)
{
reload
();
}
}
else
if
(
drawprops
.
val
==
"edit"
)
{
console
.
log
(
value
);
}
}
}
onChange=
{
async
(
changedValues
,
allValues
)
=>
{
...
...
@@ -1338,6 +1243,7 @@ function Outstore(props) {
});
}
}
console
.
log
(
changedValues
,
allValues
);
}
}
reload=
{
reload
}
/>
...
...
src/pages/system/Reservoir/index.jsx
View file @
9335a317
...
...
@@ -394,7 +394,7 @@ const Materiel = (props) => {
title
:
"确认删除该库位?"
,
onConfirm
:
()
=>
{
run
({
url
:
"/ngic-
workmanship/pmMaterie
/deleteById"
,
url
:
"/ngic-
auth/sysStorePosition
/deleteById"
,
params
:
{
id
:
record
.
id
},
});
},
...
...
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