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
黄庭坚
jinfa-platform
Commits
0387a36c
Commit
0387a36c
authored
Aug 05, 2020
by
tjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接交易能力模块接口
parent
e8e5b1cc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
328 additions
and
341 deletions
+328
-341
Search.tsx
src/components/NiceForm/components/Search.tsx
+30
-29
addBills.tsx
src/pages/transaction/stockSellStorage/bills/addBills.tsx
+16
-2
index.tsx
src/pages/transaction/stockSellStorage/bills/index.tsx
+45
-62
addBillsType.tsx
...s/transaction/stockSellStorage/billsType/addBillsType.tsx
+21
-5
index.tsx
src/pages/transaction/stockSellStorage/billsType/index.tsx
+15
-40
index.tsx
src/pages/transaction/stockSellStorage/inventory/index.tsx
+23
-49
index.tsx
...s/transaction/stockSellStorage/inventory/schema/index.tsx
+107
-111
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+58
-8
index.tsx
src/pages/transaction/stockSellStorage/warehouse/index.tsx
+13
-35
No files found.
src/components/NiceForm/components/Search.tsx
View file @
0387a36c
import
React
,
{
useState
}
from
'react'
import
{
Input
,
Space
,
Button
}
from
'antd'
import
{
CaretUpOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
useFieldState
,
FormPath
}
from
'@formily/antd'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
React
,
{
useState
}
from
'react'
;
import
{
Input
,
Space
,
Button
}
from
'antd'
;
import
{
CaretUpOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
;
import
{
useFieldState
,
FormPath
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
export
interface
SearchProps
{
value
:
string
,
mutators
:
any
,
props
:
any
value
:
string
;
mutators
:
any
;
props
:
any
;
}
const
Search
=
(
props
)
=>
{
console
.
log
(
props
)
const
Search
=
props
=>
{
const
[
state
,
setState
]
=
useFieldState
({
filterSearch
:
false
})
filterSearch
:
false
,
})
;
const
justifyAlign
=
props
.
props
[
'x-component-props'
].
align
||
'flex-end'
;
const
changeFilterVisible
=
()
=>
{
if
(
state
.
filterSearch
)
{
props
.
form
.
reset
({
// 清除FILTER_PARAMS下所有字段
selector
:
`*.
${
FORM_FILTER_PATH
}
.*`
})
selector
:
`*.
${
FORM_FILTER_PATH
}
.*`
,
})
;
}
setState
({
filterSearch
:
!
state
.
filterSearch
})
}
filterSearch
:
!
state
.
filterSearch
,
})
;
}
;
return
(
<
Space
size=
{
20
}
style=
{
{
justifyContent
:
'flex-end'
,
width
:
'100%'
}
}
>
<
Space
size=
{
20
}
style=
{
{
justifyContent
:
justifyAlign
,
width
:
'100%'
}
}
>
<
Input
.
Search
value=
{
props
.
value
||
''
}
onChange=
{
e
=>
props
.
mutators
.
change
(
e
.
target
.
value
)
}
onSearch=
{
(
_
,
e
)
=>
{
e
.
preventDefault
()
props
.
form
.
submit
()
onSearch=
{
(
_
,
e
)
=>
{
e
.
preventDefault
()
;
props
.
form
.
submit
()
;
}
}
{
...
props
.
props
['
x
-
component
-
props
']}
/>
<
Button
onClick=
{
changeFilterVisible
}
>
高级筛选
{
state
.
filterSearch
?
<
CaretUpOutlined
/>
:
<
CaretDownOutlined
/>
}
</
Button
>
<
Button
onClick=
{
()
=>
props
.
form
.
reset
()
}
>
重置
</
Button
>
<
Button
onClick=
{
changeFilterVisible
}
>
高级筛选
{
state
.
filterSearch
?
<
CaretUpOutlined
/>
:
<
CaretDownOutlined
/>
}
</
Button
>
<
Button
onClick=
{
()
=>
props
.
form
.
reset
()
}
>
重置
</
Button
>
</
Space
>
)
}
)
;
}
;
Search
.
defaultProps
=
{}
Search
.
defaultProps
=
{}
;
Search
.
isFieldComponent
=
true
;
export
default
Search
\ No newline at end of file
export
default
Search
;
src/pages/transaction/stockSellStorage/bills/addBills.tsx
View file @
0387a36c
...
...
@@ -20,7 +20,21 @@ const AddBills: React.FC<{}> = (props: any) => {
const
ref
=
useRef
({});
const
handleSubmit
=
value
=>
{
console
.
log
(
value
);
if
(
usePageStatus
().
pageStatus
===
0
)
return
PublicApi
.
postWarehouseInvoicesAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
1000
)
{
history
.
goBack
();
}
});
else
return
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
usePageStatus
().
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
1000
)
{
history
.
goBack
();
}
});
};
return
(
<
PageHeaderWrapper
...
...
@@ -57,7 +71,7 @@ const AddBills: React.FC<{}> = (props: any) => {
>
<
FormMegaLayout
labelCol=
{
4
}
labelAlign=
"left"
wrapperCol=
{
12
}
>
<
Field
name=
"
name
"
name=
"
invoicesNo
"
title=
"单据编号"
x
-
component=
"Input"
x
-
component
-
props=
{
{
...
...
src/pages/transaction/stockSellStorage/bills/index.tsx
View file @
0387a36c
...
...
@@ -17,44 +17,24 @@ import style from './index.less';
const
formActions
=
createFormActions
();
const
data
=
[
{
key
:
'1'
,
id
:
'1'
,
no
:
'广州成品仓'
,
noType
:
'成品入库单'
,
remark
:
'进口头层黄牛皮荔枝纹'
,
name
:
'广州白马皮具交易中心'
,
warehouse
:
'广州仓库 A'
,
tranactionTime
:
'2020-05-12 08:08'
,
orderNo
:
'DPTY12'
,
status
:
1
,
},
{
key
:
'2'
,
id
:
'2'
,
no
:
'广州成品仓'
,
noType
:
'采购入库单'
,
remark
:
'进口头层黄牛皮荔枝纹'
,
name
:
'广州白马皮具交易中心'
,
warehouse
:
'广州仓库 A'
,
tranactionTime
:
'2020-05-12 08:08'
,
orderNo
:
'DPTY12'
,
status
:
2
,
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
PublicApi
.
getWarehouseInvoicesList
({
invoicesNo
:
''
,
invoicesType
:
''
,
invoicesAbstract
:
''
,
memberName
:
''
,
inventoryId
:
''
,
startTransactionTime
:
''
,
endTransactionTime
:
''
,
orderNo
:
''
,
state
:
''
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
...
...
@@ -62,6 +42,7 @@ const Bills: React.FC<{}> = () => {
const
ref
=
useRef
<
any
>
({});
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([]);
const
[
visibleModal
,
setVisibleModal
]
=
useState
(
false
);
const
[
moreVisible
,
setMoreVisible
]
=
useState
(
false
);
const
menu
=
(
<
Menu
onClick=
{
e
=>
handleBatchDel
(
e
)
}
>
...
...
@@ -71,34 +52,26 @@ const Bills: React.FC<{}> = () => {
</
Menu
>
);
const
moreMenu
=
(
<
Menu
onClick=
{
e
=>
handleMoreMenu
(
e
)
}
>
<
Menu
.
Item
key=
"1"
>
修改
</
Menu
.
Item
>
<
Menu
.
Item
key=
"2"
>
反审
</
Menu
.
Item
>
<
Menu
.
Item
key=
"3"
>
删除
</
Menu
.
Item
>
</
Menu
>
);
const
handleBatchDel
=
(
e
:
any
)
=>
{};
const
handleMoreMenu
=
(
e
:
any
)
=>
{
if
(
e
.
key
===
'1
'
)
{
const
handleMoreMenu
=
(
e
:
any
,
record
:
any
)
=>
{
if
(
e
.
key
!=
'3
'
)
{
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=
${
''
}
`
,
`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=
${
record
.
id
}
`
,
);
}
else
{
}
// console.log(e);
};
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'单据号'
,
dataIndex
:
'
n
o'
,
dataIndex
:
'
invoicesN
o'
,
align
:
'center'
,
key
:
'
n
o'
,
key
:
'
invoicesN
o'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=${record.
key
}&preview=1`
}
url=
{
`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=${record.
id
}&preview=1`
}
>
{
text
}
</
EyePreview
>
...
...
@@ -107,32 +80,32 @@ const Bills: React.FC<{}> = () => {
{
title
:
'单据类型'
,
align
:
'center'
,
dataIndex
:
'
no
Type'
,
key
:
'
no
Type'
,
dataIndex
:
'
invoices
Type'
,
key
:
'
invoices
Type'
,
},
{
title
:
'单据摘要'
,
align
:
'center'
,
dataIndex
:
'
remark
'
,
key
:
'
remark
'
,
dataIndex
:
'
invoicesAbstract
'
,
key
:
'
invoicesAbstract
'
,
},
{
title
:
'会员名称'
,
align
:
'center'
,
dataIndex
:
'
n
ame'
,
key
:
'
n
ame'
,
dataIndex
:
'
memberN
ame'
,
key
:
'
memberN
ame'
,
},
{
title
:
'对应仓库'
,
align
:
'center'
,
dataIndex
:
'
warehouse
'
,
key
:
'
warehouse
'
,
dataIndex
:
'
inventory
'
,
key
:
'
inventory
'
,
},
{
title
:
'交易时间'
,
align
:
'center'
,
dataIndex
:
'tranactionTime'
,
key
:
'tranactionTime'
,
dataIndex
:
'tran
s
actionTime'
,
key
:
'tran
s
actionTime'
,
},
{
title
:
'订单号'
,
...
...
@@ -165,8 +138,18 @@ const Bills: React.FC<{}> = () => {
return
(
<>
<
Button
type=
"link"
>
审核
</
Button
>
<
Dropdown
overlay=
{
moreMenu
}
trigger=
{
[
'click'
]
}
>
<
Button
type=
"link"
>
<
Dropdown
visible=
{
moreVisible
}
overlay=
{
<
Menu
onClick=
{
e
=>
handleMoreMenu
(
e
,
record
)
}
>
<
Menu
.
Item
key=
"1"
>
修改
</
Menu
.
Item
>
<
Menu
.
Item
key=
"2"
>
反审
</
Menu
.
Item
>
<
Menu
.
Item
key=
"3"
>
删除
</
Menu
.
Item
>
</
Menu
>
}
trigger=
{
[
'click'
]
}
>
<
Button
type=
"link"
onClick=
{
()
=>
setMoreVisible
(
!
moreVisible
)
}
>
更多
<
DownOutlined
/>
</
Button
>
...
...
src/pages/transaction/stockSellStorage/billsType/addBillsType.tsx
View file @
0387a36c
...
...
@@ -19,8 +19,20 @@ const addSchemaAction = createFormActions();
const
AddWarehouse
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
useEffect
(()
=>
{
console
.
log
(
usePageStatus
());
});
const
handleSubmit
=
value
=>
{
console
.
log
(
value
);
if
(
usePageStatus
().
pageStatus
===
0
)
{
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
});
}
else
{
PublicApi
.
postWarehouseInvoicesTypeUpdate
({
id
:
usePageStatus
().
id
,
...
value
,
});
}
history
.
goBack
();
};
return
(
<
PageHeaderWrapper
...
...
@@ -57,7 +69,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
>
<
FormMegaLayout
labelCol=
{
4
}
labelAlign=
"left"
wrapperCol=
{
12
}
>
<
Field
name=
"n
ame
"
name=
"n
umber
"
title=
"单据类型编号"
x
-
component=
"Input"
x
-
component
-
props=
{
{
...
...
@@ -67,7 +79,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
required
/>
<
Field
name=
"name
1
"
name=
"name"
title=
"单据类型名称"
x
-
component=
"Input"
x
-
component
-
props=
{
{
...
...
@@ -77,11 +89,15 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
required
/>
<
Field
name=
"
countryCode
"
name=
"
direction
"
title=
"仓库负责人"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
enum=
{
[
{
label
:
'入库'
,
value
:
1
},
{
label
:
'出库'
,
value
:
2
},
]
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'请选择'
}
}
required
/>
</
FormMegaLayout
>
</
SchemaForm
>
...
...
src/pages/transaction/stockSellStorage/billsType/index.tsx
View file @
0387a36c
...
...
@@ -21,25 +21,19 @@ import StatusSwitch from '@/components/StatusSwitch';
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
style
from
'./index.less'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
data
=
[
{
key
:
'1'
,
id
:
'1'
,
no
:
'DJ001'
,
name
:
'进货入库单'
,
direction
:
1
,
state
:
1
,
},
{
key
:
'2'
,
id
:
'2'
,
no
:
'DJ002'
,
name
:
'退货入库单'
,
direction
:
2
,
state
:
2
,
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getWarehouseInvoicesTypeList
({
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
const
billsType
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
({});
...
...
@@ -54,9 +48,9 @@ const billsType: React.FC<{}> = () => {
},
{
title
:
'单据类型编号'
,
dataIndex
:
'n
o
'
,
dataIndex
:
'n
umber
'
,
align
:
'center'
,
key
:
'n
o
'
,
key
:
'n
umber
'
,
},
{
title
:
'单据名称'
,
...
...
@@ -79,12 +73,7 @@ const billsType: React.FC<{}> = () => {
align
:
'center'
,
key
:
'direction'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<
span
>
{
text
}
{
record
.
direction
===
1
?
' +'
:
' -'
}
</
span
>
);
return
<
span
>
{
record
.
direction
===
1
?
'入库 +'
:
'出库 -'
}
</
span
>;
},
},
{
...
...
@@ -132,20 +121,6 @@ const billsType: React.FC<{}> = () => {
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
});
};
const
handleReset
=
()
=>
{};
const
handleModify
=
(
record
:
object
)
=>
{
...
...
src/pages/transaction/stockSellStorage/inventory/index.tsx
View file @
0387a36c
...
...
@@ -16,53 +16,27 @@ 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
{
inventory
Schema
}
from
'./schema'
;
import
style
from
'./index.less'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
formActions
=
createFormActions
();
const
data
=
[
{
key
:
'1'
,
id
:
'M-111'
,
no
:
'红色/XXL'
,
type
:
'牛皮'
,
brand
:
'PELLE'
,
unit
:
'尺'
,
price
:
'¥ 14.50'
,
name
:
'广州白马皮具交易中心'
,
warehouse
:
'广州仓库 A'
,
inventory
:
'2,000'
,
price2
:
'¥ 25,000'
,
safeInventory
:
'123'
,
},
{
key
:
'2'
,
id
:
'M-111'
,
no
:
'红色/XXL'
,
type
:
'牛皮'
,
brand
:
'PELLE'
,
unit
:
'尺'
,
price
:
'¥ 14.50'
,
name
:
'广州白马皮具交易中心'
,
warehouse
:
'广州仓库 A'
,
inventory
:
'2,000'
,
price2
:
'¥ 25,000'
,
safeInventory
:
''
,
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
PublicApi
.
getWarehouseInventoryList
({
itemNo
:
''
,
goodsName
:
''
,
specifications
:
''
,
category
:
''
,
brand
:
''
,
warehouseId
:
''
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
...
...
@@ -78,9 +52,9 @@ const Inventory: React.FC<{}> = () => {
},
{
title
:
'商品名称'
,
dataIndex
:
'
n
ame'
,
dataIndex
:
'
goodsN
ame'
,
align
:
'center'
,
key
:
'
n
ame'
,
key
:
'
goodsN
ame'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/repositories/viewRepository?id=${record.key}&preview=1`
}
...
...
@@ -92,14 +66,14 @@ const Inventory: React.FC<{}> = () => {
{
title
:
'规格型号'
,
align
:
'center'
,
dataIndex
:
'
no
'
,
key
:
'
no
'
,
dataIndex
:
'
specifications
'
,
key
:
'
specifications
'
,
},
{
title
:
'品类'
,
align
:
'center'
,
dataIndex
:
'
type
'
,
key
:
'
type
'
,
dataIndex
:
'
category
'
,
key
:
'
category
'
,
},
{
title
:
'品牌'
,
...
...
@@ -134,8 +108,8 @@ const Inventory: React.FC<{}> = () => {
{
title
:
'安全库存'
,
align
:
'center'
,
dataIndex
:
'safe
Inventory
'
,
key
:
'safe
Inventory
'
,
dataIndex
:
'safe
Stock
'
,
key
:
'safe
Stock
'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<
Input
...
...
@@ -172,7 +146,7 @@ const Inventory: React.FC<{}> = () => {
FORM_FILTER_PATH
,
);
}
}
schema=
{
reposit
Schema
}
schema=
{
inventory
Schema
}
/>
}
/>
...
...
src/pages/transaction/stockSellStorage/inventory/schema/index.tsx
View file @
0387a36c
import
React
from
'react'
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
reposit
Schema
:
ISchema
=
{
export
const
inventory
Schema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megaLayout
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
'x-component'
:
'mega-layout'
,
properties
:
{
search
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-mega-props"
:
{
'x-component'
:
'Search'
,
'x-mega-props'
:
{},
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-left'
,
},
"x-component-props"
:
{
placeholder
:
'请输入仓位名称'
}
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
"x-component"
:
"mega-layout"
,
'x-component'
:
'mega-layout'
,
visible
:
false
,
"x-component-props"
:
{
inline
:
true
'x-component-props'
:
{
inline
:
true
,
},
properties
:
{
productName
:
{
specifications
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'商品名称'
}
},
productId
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'商品ID'
}
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
enum
:
[],
},
category
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品类'
'x-component-props'
:
{
placeholder
:
'请选择品类'
,
},
enum
:
[]
enum
:
[]
,
},
brand
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品牌'
'x-component-props'
:
{
placeholder
:
'请选择品牌'
,
},
enum
:
[]
enum
:
[],
},
warehouse
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请选择仓库'
,
},
enum
:
[],
},
submit
:
{
"x-component"
:
'Submit'
,
"x-component-props"
:
{
children
:
'查询'
}
}
},
},
}
}
}
}
}
,
}
,
}
,
}
;
export
const
repositDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
REPOSIT_TABS
:
{
type
:
'object'
,
"x-component"
:
"tab"
,
"x-component-props"
:
{
type
:
'card'
'x-component'
:
'tab'
,
'x-component-props'
:
{
type
:
'card'
,
},
properties
:
{
"tab-1"
:
{
"type"
:
"object"
,
"x-component"
:
"tabpane"
,
"x-component-props"
:
{
"tab"
:
"基本信息"
'tab-1'
:
{
type
:
'object'
,
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'基本信息'
,
},
"properties"
:
{
properties
:
{
MEGA_LAYOUT1
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
8
,
labelAlign
:
'left'
labelAlign
:
'left'
,
},
properties
:
{
name
:
{
type
:
'string'
,
required
:
true
,
title
:
'仓位名称'
,
"x-component-props"
:
{
placeholder
:
'建议名称:商品名称+商城名称+渠道描述'
}
'x-component-props'
:
{
placeholder
:
'建议名称:商品名称+商城名称+渠道描述'
,
}
,
},
productName
:
{
type
:
'string'
,
title
:
'商品名称'
,
required
:
true
required
:
true
,
},
warehouseId
:
{
type
:
'string'
,
title
:
'仓库名称'
,
enum
:
[]
enum
:
[]
,
},
itemNo
:
{
type
:
'string'
,
"x-component"
:
'Text'
,
'x-component'
:
'Text'
,
title
:
'对应货品'
,
default
:
'暂无'
default
:
'暂无'
,
},
inventory
:
{
type
:
'number'
,
"x-component"
:
"CustomSlider"
,
'x-component'
:
'CustomSlider'
,
required
:
true
,
"x-component-props"
:
{
'x-component-props'
:
{
min
:
0
,
max
:
200
max
:
200
,
},
title
:
'分配仓位库存'
,
},
...
...
@@ -134,94 +130,94 @@ export const repositDetailSchema: ISchema = {
enum
:
[
{
label
:
'按仓位随机扣减'
,
value
:
1
value
:
1
,
},
{
label
:
'按仓库位置远近扣除'
,
value
:
2
}
value
:
2
,
}
,
],
default
:
1
}
}
}
}
default
:
1
,
}
,
}
,
}
,
}
,
},
"tab-2"
:
{
"type"
:
"object"
,
"x-component"
:
"tabpane"
,
"x-component-props"
:
{
"tab"
:
"适用商城"
'tab-2'
:
{
type
:
'object'
,
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'适用商城'
,
},
"properties"
:
{
properties
:
{
MEGA_LAYOUT2
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
labelAlign
:
'left'
labelAlign
:
'left'
,
},
properties
:
{
"shopIds"
:
{
"type"
:
"array:number"
,
"x-component"
:
'CardCheckBox'
,
"x-component-props"
:
{
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"
:
"适用商城"
,
title
:
'适用商城'
,
required
:
true
,
}
}
}
}
}
,
}
,
}
,
}
,
},
"tab-3"
:
{
'tab-3'
:
{
type
:
'object'
,
"x-component"
:
'tabpane'
,
"x-component-props"
:
{
"tab"
:
"适用会员"
'x-component'
:
'tabpane'
,
'x-component-props'
:
{
tab
:
'适用会员'
,
},
properties
:
{
MEGA_LAYOUT3
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
labelAlign
:
'left'
labelAlign
:
'left'
,
},
properties
:
{
"isAllMemberShare"
:
{
"type"
:
"radio"
,
isAllMemberShare
:
{
type
:
'radio'
,
enum
:
[
{
label
:
'所有会员共享(默认)'
,
value
:
1
},
{
label
:
'指定会员'
,
value
:
0
},
],
"title"
:
"选择渠道会员"
,
title
:
'选择渠道会员'
,
default
:
1
,
required
:
true
,
},
applyMember
:
{
type
:
'array:number'
,
"x-component"
:
'MultTable'
,
"x-component-props"
:
{
columns
:
"{{tableColumns}}"
'x-component'
:
'MultTable'
,
'x-component-props'
:
{
columns
:
'{{tableColumns}}'
,
},
default
:
[
{
id
:
1
,
name
:
'名称'
,
type
:
'类型'
},
{
id
:
2
,
name
:
'名称1'
,
type
:
'类型1'
}
]
}
}
}
}
}
}
}
}
}
{
id
:
2
,
name
:
'名称1'
,
type
:
'类型1'
}
,
]
,
}
,
}
,
}
,
}
,
}
,
}
,
}
,
}
,
}
;
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
0387a36c
...
...
@@ -18,9 +18,57 @@ const addSchemaAction = createFormActions();
const
AddWarehouse
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
const
[
provinceList
,
setProvinceList
]
=
useState
([]);
const
[
cityList
,
setCityList
]
=
useState
([]);
const
[
areaList
,
setAreaList
]
=
useState
([]);
// 初始获取各省选项
useEffect
(()
=>
{
getAddressList
(
'province'
);
},
[]);
const
getAddressList
=
(
type
,
id
?)
=>
{
PublicApi
.
getManageAreaByPcodeAll
({
pcode
:
getCode
(
type
,
id
)
}).
then
(
res
=>
{
let
options
=
[];
for
(
let
item
of
res
.
data
)
{
options
.
push
({
label
:
item
.
name
,
value
:
item
.
id
,
code
:
item
.
code
});
}
if
(
type
===
'province'
)
{
setProvinceList
(
options
);
}
else
if
(
type
===
'city'
)
{
setCityList
(
options
);
setAreaList
([]);
}
else
{
setAreaList
(
options
);
}
},
);
};
// 获取地区code,用于请求下级地区
const
getCode
=
(
type
,
id
)
=>
{
let
code
=
''
;
if
(
type
===
'province'
)
return
'100000'
;
if
(
type
===
'city'
)
{
provinceList
.
find
(
target
=>
{
if
(
target
.
value
===
id
)
{
code
=
target
.
code
;
}
});
}
else
{
cityList
.
find
(
target
=>
{
if
(
target
.
value
===
id
)
{
code
=
target
.
code
;
}
});
}
return
code
;
};
const
handleSubmit
=
value
=>
{
console
.
log
(
value
);
PublicApi
.
postWarehouseWarehouseAdd
({
...
value
}).
then
(
res
=>
{});
};
return
(
<
PageHeaderWrapper
...
...
@@ -60,26 +108,28 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
<
FormMegaLayout
label=
"仓库地址"
wrapperCol=
{
24
}
required
>
<
FormMegaLayout
grid
full
autoRow
columns=
{
3
}
>
<
Field
name=
"province"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
name=
"province
Id
"
enum=
{
provinceList
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'- 省 -'
,
onChange
:
val
=>
getAddressList
(
'city'
,
val
),
}
}
required
/>
<
Field
name=
"city"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
name=
"city
Id
"
enum=
{
cityList
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'- 市 -'
,
onChange
:
val
=>
getAddressList
(
'area'
,
val
),
}
}
required
/>
<
Field
name=
"
county
"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
name=
"
areaId
"
enum=
{
areaList
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'- 县/区 -'
,
...
...
@@ -97,7 +147,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
required
/>
</
FormMegaLayout
>
<
Field
name=
"p
erson
"
title=
"仓库负责人"
x
-
component=
"Input"
/>
<
Field
name=
"p
rincipal
"
title=
"仓库负责人"
x
-
component=
"Input"
/>
<
FormMegaLayout
label=
"联系电话"
grid
full
wrapperCol=
{
24
}
>
<
Field
name=
"countryCode"
...
...
@@ -107,7 +157,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
/>
<
Field
x
-
mega
-
props=
{
{
span
:
3
}
}
name=
"
phoneMobile
"
name=
"
tel
"
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'请输入你的手机号码'
}
}
/>
...
...
src/pages/transaction/stockSellStorage/warehouse/index.tsx
View file @
0387a36c
...
...
@@ -17,39 +17,17 @@ import StatusSwitch from '@/components/StatusSwitch';
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
style
from
'./index.less'
;
const
data
=
[
{
key
:
'1'
,
id
:
'1'
,
name
:
'广州成品仓'
,
address
:
'广东省广州市海珠区新港东路1068号中洲中心北塔6楼'
,
person
:
'蒯美政'
,
phoneMobile
:
'185 2929 5432'
,
state
:
1
,
},
{
key
:
'2'
,
id
:
'2'
,
name
:
'广州成品仓'
,
address
:
'广东省广州市海珠区新港东路1068号中洲中心北塔6楼'
,
person
:
'蒯美政'
,
phoneMobile
:
'185 2929 5432'
,
state
:
2
,
},
];
import
{
PublicApi
}
from
'@/services/api'
;
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
PublicApi
.
getWarehouseWarehouseList
({
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
...
...
@@ -87,21 +65,21 @@ const WareHouse: React.FC<{}> = () => {
},
{
title
:
'仓库负责人'
,
dataIndex
:
'p
erson
'
,
dataIndex
:
'p
rincipal
'
,
align
:
'center'
,
key
:
'p
erson
'
,
key
:
'p
rincipal
'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'
phoneMobile
'
,
dataIndex
:
'
tel
'
,
align
:
'center'
,
key
:
'
phoneMobile
'
,
key
:
'
tel
'
,
},
{
title
:
'状态'
,
dataIndex
:
'stat
us
'
,
dataIndex
:
'stat
e
'
,
align
:
'center'
,
key
:
'stat
us
'
,
key
:
'stat
e
'
,
sorter
:
true
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
...
...
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