Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
linweijiong
jinfa-platform
Commits
d467376d
Commit
d467376d
authored
Aug 05, 2020
by
tjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整新增单据页面
parent
0387a36c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
142 additions
and
257 deletions
+142
-257
CustomRelevance.tsx
src/components/NiceForm/components/CustomRelevance.tsx
+18
-0
Search.tsx
src/components/NiceForm/components/Search.tsx
+8
-1
index.tsx
src/components/NiceForm/index.tsx
+2
-0
index.tsx
src/pages/repositories/index.tsx
+92
-51
addBills.tsx
src/pages/transaction/stockSellStorage/bills/addBills.tsx
+20
-41
index.tsx
src/pages/transaction/stockSellStorage/bills/index.tsx
+2
-2
index.tsx
...pages/transaction/stockSellStorage/bills/schema/index.tsx
+0
-0
index.tsx
...s/transaction/stockSellStorage/inventory/schema/index.tsx
+0
-162
No files found.
src/components/NiceForm/components/CustomRelevance.tsx
0 → 100644
View file @
d467376d
import
React
from
'react'
;
import
{
Row
,
Col
,
Input
}
from
'antd'
;
import
styled
from
'styled-components'
;
const
Relevance
=
props
=>
{
return
(
<
Row
>
<
Col
>
123
</
Col
>
<
Col
>
456
</
Col
>
</
Row
>
);
};
Relevance
.
defaultProps
=
{};
Relevance
.
isFieldComponent
=
true
;
export
default
Relevance
;
src/components/NiceForm/components/Search.tsx
View file @
d467376d
...
...
@@ -11,6 +11,7 @@ export interface SearchProps {
}
const
Search
=
props
=>
{
// console.log(props);
const
[
state
,
setState
]
=
useFieldState
({
filterSearch
:
false
,
});
...
...
@@ -41,7 +42,13 @@ const Search = props => {
高级筛选
{
state
.
filterSearch
?
<
CaretUpOutlined
/>
:
<
CaretDownOutlined
/>
}
</
Button
>
<
Button
onClick=
{
()
=>
props
.
form
.
reset
()
}
>
重置
</
Button
>
<
Button
onClick=
{
()
=>
{
props
.
form
.
reset
();
}
}
>
重置
</
Button
>
</
Space
>
);
};
...
...
src/components/NiceForm/index.tsx
View file @
d467376d
...
...
@@ -16,6 +16,7 @@ import Text from './components/Text';
import
CardCheckBox
from
'./components/CardCheckBox'
;
import
MultTable
from
'./components/MultTable'
;
import
CustomRegistryPhone
from
'./components/CustomRegistryPhone'
;
import
CustomRelevance
from
'./components/CustomRelevance'
;
export
interface
NiceFormProps
extends
IAntdSchemaFormProps
{}
...
...
@@ -32,6 +33,7 @@ const NiceForm: React.FC<NiceFormProps> = props => {
CardCheckBox
,
MultTable
,
CustomRegistryPhone
,
CustomRelevance
,
};
const
defineComponents
=
Object
.
assign
(
customComponents
,
components
);
...
...
src/pages/repositories/index.tsx
View file @
d467376d
import
React
,
{
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Popconfirm
,
Card
,
Row
,
Col
,
Dropdown
,
Input
,
Select
,
Space
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
React
,
{
ReactNode
,
useRef
,
useState
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Popconfirm
,
Card
,
Row
,
Col
,
Dropdown
,
Input
,
Select
,
Space
,
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PlusOutlined
,
PlayCircleOutlined
,
...
...
@@ -9,29 +19,32 @@ import {
DownOutlined
,
CaretUpOutlined
,
CaretDownOutlined
,
}
from
'@ant-design/icons'
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
EyePreview
from
'@/components/EyePreview'
import
StatusSwitch
from
'@/components/StatusSwitch'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
repositSchema
}
from
'./schema'
import
{
PublicApi
}
from
'@/services/api'
}
from
'@ant-design/icons'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
IFormFilter
,
IButtonFilter
,
}
from
'god/dist/src/standard-table/TableController'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
StatusSwitch
from
'@/components/StatusSwitch'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
repositSchema
}
from
'./schema'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
formActions
=
createFormActions
()
const
formActions
=
createFormActions
()
;
// 模拟请求
const
fetchData
=
async
(
params
:
any
)
=>
{
const
res
=
await
PublicApi
.
getWarehouseFreightSpaceList
(
params
)
return
res
.
data
}
const
fetchData
=
async
(
params
:
any
)
=>
{
const
res
=
await
PublicApi
.
getWarehouseFreightSpaceList
(
params
)
;
return
res
.
data
;
}
;
const
Repositories
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
ref
=
useRef
<
any
>
({})
;
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -45,7 +58,13 @@ const Repositories: React.FC<{}> = () => {
dataIndex
:
'reposName'
,
align
:
'center'
,
key
:
'reposName'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/repositories/viewRepository?id=${record.key}&preview=1`
}
>
{
text
}
</
EyePreview
>
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/repositories/viewRepository?id=${record.key}&preview=1`
}
>
{
text
}
</
EyePreview
>
),
},
{
title
:
'商品名称'
,
...
...
@@ -82,59 +101,76 @@ const Repositories: React.FC<{}> = () => {
align
:
'center'
,
dataIndex
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
StatusSwitch
handleConfirm=
{
()
=>
handleModify
(
record
)
}
record=
{
record
}
/>
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
StatusSwitch
handleConfirm=
{
()
=>
handleModify
(
record
)
}
record=
{
record
}
/>
),
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
state
===
1
?
<
Button
type=
'link'
onClick=
{
()
=>
handleAdjust
(
record
)
}
>
库存调拨
</
Button
>
:
''
}
{
record
.
state
===
1
?
(
<
Button
type=
"link"
onClick=
{
()
=>
handleAdjust
(
record
)
}
>
库存调拨
</
Button
>
)
:
(
''
)
}
</>
)
}
}
)
;
}
,
}
,
];
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
history
.
push
(
`/repositories/viewRepository?id=
${
record
.
key
}
`
)
}
const
handleSee
=
(
record
:
any
)
=>
{
console
.
log
(
'see'
)
;
history
.
push
(
`/repositories/viewRepository?id=
${
record
.
key
}
`
)
;
}
;
const
confirm
=
()
=>
{
console
.
log
(
'confirm'
)
}
console
.
log
(
'confirm'
)
;
}
;
const
handleModify
=
(
record
:
object
)
=>
{
// 通过传入的params字符串判断是修改那种类型的数据
console
.
log
(
'执行状态修改'
,
record
)
}
console
.
log
(
'执行状态修改'
,
record
)
;
}
;
const
handleAdjust
=
(
record
:
any
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/repositories/adjustRepository?id=
${
record
.
key
}
`
)
}
history
.
push
(
`/memberCenter/commodityAbility/repositories/adjustRepository?id=
${
record
.
key
}
`
,
);
};
const
handleToAdd
=
()
=>
{
history
.
push
(
`/memberCenter/commodityAbility/repositories/addRepository`
)
}
history
.
push
(
`/memberCenter/commodityAbility/repositories/addRepository`
)
;
}
;
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
<
StandardTable
columns=
{
columns
}
currentRef=
{
ref
}
tableProps=
{
{
rowKey
:
"key"
}
}
tableProps=
{
{
rowKey
:
'key'
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
Row
justify=
'space-between'
>
<
Row
justify=
"space-between"
>
<
Col
>
<
Space
>
<
Button
type=
'primary'
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
新建
</
Button
>
<
Button
type=
"primary"
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
新建
</
Button
>
</
Space
>
</
Col
>
<
Col
>
...
...
@@ -142,7 +178,12 @@ const Repositories: React.FC<{}> = () => {
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'search'
,
FORM_FILTER_PATH
)
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'search'
,
FORM_FILTER_PATH
,
);
}
}
schema=
{
repositSchema
}
/>
...
...
@@ -152,7 +193,7 @@ const Repositories: React.FC<{}> = () => {
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
)
;
}
;
export
default
Repositories
export
default
Repositories
;
src/pages/transaction/stockSellStorage/bills/addBills.tsx
View file @
d467376d
...
...
@@ -6,18 +6,28 @@ import { SaveOutlined } from '@ant-design/icons';
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
Button
,
Card
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
FormMegaLayout
,
}
from
'@formily/antd'
;
import
{
Input
,
Select
}
from
'@formily/antd-components'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
getBillsDetailSchema
}
from
'./schema'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
addSchemaAction
=
createFormActions
();
const
AddBills
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
const
[
warehouseList
,
setWarehouseList
]
=
useState
<
any
>
([]);
useEffect
(()
=>
{
PublicApi
.
getWarehouseWarehouseList
({
current
:
'1'
,
pageSize
:
'10000'
,
}).
then
((
res
:
any
)
=>
{
let
list
=
[];
for
(
let
item
of
res
.
data
)
{
list
.
push
({
label
:
item
.
name
,
value
:
item
.
id
});
}
setWarehouseList
(
list
);
});
},
[]);
const
handleSubmit
=
value
=>
{
if
(
usePageStatus
().
pageStatus
===
0
)
...
...
@@ -63,42 +73,11 @@ const AddBills: React.FC<{}> = (props: any) => {
}
>
<
Card
>
<
Schema
Form
editable=
{
usePageStatus
().
preview
!=
'1'
}
<
Nice
Form
onSubmit=
{
handleSubmit
}
actions=
{
addSchemaAction
}
components=
{
{
Input
,
Select
}
}
onSubmit=
{
value
=>
handleSubmit
(
value
)
}
>
<
FormMegaLayout
labelCol=
{
4
}
labelAlign=
"left"
wrapperCol=
{
12
}
>
<
Field
name=
"invoicesNo"
title=
"单据编号"
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'最长10个字符'
,
maxLength
:
10
,
}
}
required
/>
<
Field
name=
"name1"
title=
"单据名称"
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'最长20个字符,10个汉字'
,
maxLength
:
10
,
}
}
required
/>
<
Field
name=
"countryCode"
title=
"仓库负责人"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'请选择'
}
}
/>
</
FormMegaLayout
>
</
SchemaForm
>
schema=
{
getBillsDetailSchema
(
warehouseList
)
}
/>
</
Card
>
</
PageHeaderWrapper
>
);
...
...
src/pages/transaction/stockSellStorage/bills/index.tsx
View file @
d467376d
...
...
@@ -10,7 +10,7 @@ import NiceForm from '@/components/NiceForm';
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
reposit
Schema
}
from
'./schema'
;
import
{
bills
Schema
}
from
'./schema'
;
import
UploadModal
from
'@/components/UploadModal'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
style
from
'./index.less'
;
...
...
@@ -218,7 +218,7 @@ const Bills: React.FC<{}> = () => {
FORM_FILTER_PATH
,
);
}
}
schema=
{
reposit
Schema
}
schema=
{
bills
Schema
}
/>
</
Col
>
</
Row
>
...
...
src/pages/transaction/stockSellStorage/bills/schema/index.tsx
View file @
d467376d
This diff is collapsed.
Click to expand it.
src/pages/transaction/stockSellStorage/inventory/schema/index.tsx
View file @
d467376d
import
React
from
'react'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
Button
}
from
'antd'
;
export
const
inventorySchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -62,162 +59,3 @@ export const inventorySchema: ISchema = {
},
},
};
export
const
repositDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
REPOSIT_TABS
:
{
type
:
'object'
,
'x-component'
:
'tab'
,
'x-component-props'
:
{
type
:
'card'
,
},
properties
:
{
'tab-1'
:
{
type
:
'object'
,
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'基本信息'
,
},
properties
:
{
MEGA_LAYOUT1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
8
,
labelAlign
:
'left'
,
},
properties
:
{
name
:
{
type
:
'string'
,
required
:
true
,
title
:
'仓位名称'
,
'x-component-props'
:
{
placeholder
:
'建议名称:商品名称+商城名称+渠道描述'
,
},
},
productName
:
{
type
:
'string'
,
title
:
'商品名称'
,
required
:
true
,
},
warehouseId
:
{
type
:
'string'
,
title
:
'仓库名称'
,
enum
:
[],
},
itemNo
:
{
type
:
'string'
,
'x-component'
:
'Text'
,
title
:
'对应货品'
,
default
:
'暂无'
,
},
inventory
:
{
type
:
'number'
,
'x-component'
:
'CustomSlider'
,
required
:
true
,
'x-component-props'
:
{
min
:
0
,
max
:
200
,
},
title
:
'分配仓位库存'
,
},
inventoryDeductWay
:
{
type
:
'radio'
,
title
:
'库存扣减方式'
,
required
:
true
,
enum
:
[
{
label
:
'按仓位随机扣减'
,
value
:
1
,
},
{
label
:
'按仓库位置远近扣除'
,
value
:
2
,
},
],
default
:
1
,
},
},
},
},
},
'tab-2'
:
{
type
:
'object'
,
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'适用商城'
,
},
properties
:
{
MEGA_LAYOUT2
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
labelAlign
:
'left'
,
},
properties
:
{
shopIds
:
{
type
:
'array:number'
,
'x-component'
:
'CardCheckBox'
,
'x-component-props'
:
{
dataSource
:
[
{
logo
:
''
,
title
:
'会员'
,
id
:
1
},
{
logo
:
''
,
title
:
'小程序'
,
id
:
2
},
{
logo
:
''
,
title
:
'H5'
,
id
:
3
},
{
logo
:
''
,
title
:
'渠道'
,
id
:
4
},
],
},
title
:
'适用商城'
,
required
:
true
,
},
},
},
},
},
'tab-3'
:
{
type
:
'object'
,
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'适用会员'
,
},
properties
:
{
MEGA_LAYOUT3
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
labelAlign
:
'left'
,
},
properties
:
{
isAllMemberShare
:
{
type
:
'radio'
,
enum
:
[
{
label
:
'所有会员共享(默认)'
,
value
:
1
},
{
label
:
'指定会员'
,
value
:
0
},
],
title
:
'选择渠道会员'
,
default
:
1
,
required
:
true
,
},
applyMember
:
{
type
:
'array:number'
,
'x-component'
:
'MultTable'
,
'x-component-props'
:
{
columns
:
'{{tableColumns}}'
,
},
default
:
[
{
id
:
1
,
name
:
'名称'
,
type
:
'类型'
},
{
id
:
2
,
name
:
'名称1'
,
type
:
'类型1'
},
],
},
},
},
},
},
},
},
},
};
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