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
b67e6c03
Commit
b67e6c03
authored
Oct 23, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整进销存路由相关
parent
b9e57133
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
746 additions
and
547 deletions
+746
-547
index.ts
config/routes/tranactionRoute/index.ts
+7
-7
addBills.tsx
src/pages/transaction/stockSellStorage/bills/addBills.tsx
+22
-0
billsDetail.tsx
src/pages/transaction/stockSellStorage/bills/billsDetail.tsx
+24
-0
index.ts
...ckSellStorage/bills/components/BillsForm/effects/index.ts
+0
-0
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+1
-1
index.less
...on/stockSellStorage/bills/components/BillsForm/index.less
+0
-0
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+38
-20
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+0
-0
editBills.tsx
src/pages/transaction/stockSellStorage/bills/editBills.tsx
+25
-0
addBillsType.tsx
...s/transaction/stockSellStorage/billsType/addBillsType.tsx
+8
-119
billsTypeDetail.tsx
...ransaction/stockSellStorage/billsType/billsTypeDetail.tsx
+14
-0
index.less
...kSellStorage/billsType/components/BillTypeForm/index.less
+0
-0
index.tsx
...ckSellStorage/billsType/components/BillTypeForm/index.tsx
+137
-0
index.ts
...Storage/billsType/components/BillTypeForm/schema/index.ts
+72
-0
editBillsType.tsx
.../transaction/stockSellStorage/billsType/editBillsType.tsx
+14
-0
index.tsx
...s/transaction/stockSellStorage/billsType/schema/index.tsx
+0
-76
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+8
-157
index.less
...SellStorage/warehouse/components/WarehouseForm/index.less
+0
-0
index.tsx
...kSellStorage/warehouse/components/WarehouseForm/index.tsx
+178
-0
index.ts
...torage/warehouse/components/WarehouseForm/schema/index.ts
+169
-0
editWarehouse.tsx
.../transaction/stockSellStorage/warehouse/editWarehouse.tsx
+14
-0
index.tsx
src/pages/transaction/stockSellStorage/warehouse/index.tsx
+1
-1
index.tsx
...s/transaction/stockSellStorage/warehouse/schema/index.tsx
+0
-166
warehouseDetail.tsx
...ransaction/stockSellStorage/warehouse/warehouseDetail.tsx
+14
-0
No files found.
config/routes/tranactionRoute/index.ts
View file @
b67e6c03
...
@@ -90,14 +90,14 @@ const TranactionRoute: RouterChild = {
...
@@ -90,14 +90,14 @@ const TranactionRoute: RouterChild = {
path
:
'/memberCenter/tranactionAbility/stockSellStorage/warehouse/edit'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/warehouse/edit'
,
name
:
'editWarehouse'
,
name
:
'editWarehouse'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/
add
Warehouse'
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/
edit
Warehouse'
,
},
},
// 仓库-详情
// 仓库-详情
{
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/warehouse/detail'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/warehouse/detail'
,
name
:
'warehouseDetail'
,
name
:
'warehouseDetail'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/
addWarehouse
'
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/
warehouseDetail
'
,
},
},
// 单据类型
// 单据类型
{
{
...
@@ -117,14 +117,14 @@ const TranactionRoute: RouterChild = {
...
@@ -117,14 +117,14 @@ const TranactionRoute: RouterChild = {
path
:
'/memberCenter/tranactionAbility/stockSellStorage/billsType/edit'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/billsType/edit'
,
name
:
'editBillsType'
,
name
:
'editBillsType'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/billsType/
add
BillsType'
,
component
:
'@/pages/transaction/stockSellStorage/billsType/
edit
BillsType'
,
},
},
// 单据类型-详情
// 单据类型-详情
{
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/billsType/detail'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/billsType/detail'
,
name
:
'billsTypeDetail'
,
name
:
'billsTypeDetail'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/billsType/
addBillsType
'
,
component
:
'@/pages/transaction/stockSellStorage/billsType/
billsTypeDetail
'
,
},
},
// 单据
// 单据
{
{
...
@@ -137,21 +137,21 @@ const TranactionRoute: RouterChild = {
...
@@ -137,21 +137,21 @@ const TranactionRoute: RouterChild = {
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/add'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/add'
,
name
:
'addBills'
,
name
:
'addBills'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/bills/addBills
/index
'
,
component
:
'@/pages/transaction/stockSellStorage/bills/addBills'
,
},
},
// 单据-编辑
// 单据-编辑
{
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/edit'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/edit'
,
name
:
'editBills'
,
name
:
'editBills'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/bills/
addBills/index
'
,
component
:
'@/pages/transaction/stockSellStorage/bills/
editBills
'
,
},
},
// 单据-详情
// 单据-详情
{
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/detail'
,
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills/detail'
,
name
:
'billsDetail'
,
name
:
'billsDetail'
,
hideInMenu
:
true
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/bills/
addBills/index
'
,
component
:
'@/pages/transaction/stockSellStorage/bills/
billsDetail
'
,
},
},
// 库存
// 库存
{
{
...
...
src/pages/transaction/stockSellStorage/bills/addBills.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
BillsForm
from
'./components/BillsForm'
;
const
AddBills
:
React
.
FC
=
()
=>
{
const
{
invoicesTypeId
,
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
}
=
usePageStatus
();
return
(
<
BillsForm
invoicesTypeId=
{
invoicesTypeId
}
relevanceInvoices=
{
relevanceInvoices
}
relevanceInvoicesId=
{
relevanceInvoicesId
}
/>
);
};
export
default
AddBills
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/bills/billsDetail.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
BillsForm
from
'./components/BillsForm'
;
const
BillsDetail
:
React
.
FC
=
()
=>
{
const
{
id
,
invoicesTypeId
,
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
}
=
usePageStatus
();
return
(
<
BillsForm
id=
{
id
}
invoicesTypeId=
{
invoicesTypeId
}
relevanceInvoices=
{
relevanceInvoices
}
relevanceInvoicesId=
{
relevanceInvoicesId
}
/>
);
};
export
default
BillsDetail
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/bills/
addBills
/effects/index.ts
→
src/pages/transaction/stockSellStorage/bills/
components/BillsForm
/effects/index.ts
View file @
b67e6c03
File moved
src/pages/transaction/stockSellStorage/bills/
addBills
/effects/useBusinessEffects.ts
→
src/pages/transaction/stockSellStorage/bills/
components/BillsForm
/effects/useBusinessEffects.ts
View file @
b67e6c03
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-2
2 18:49:22
* @LastEditTime: 2020-10-2
3 16:00:01
* @Description: 联动逻辑相关
* @Description: 联动逻辑相关
*/
*/
import
{
Modal
}
from
'antd'
;
import
{
Modal
}
from
'antd'
;
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.less
0 → 100644
View file @
b67e6c03
src/pages/transaction/stockSellStorage/bills/
addBills
/index.tsx
→
src/pages/transaction/stockSellStorage/bills/
components/BillsForm
/index.tsx
View file @
b67e6c03
...
@@ -42,15 +42,23 @@ const {
...
@@ -42,15 +42,23 @@ const {
onFormInputChange$
,
onFormInputChange$
,
}
=
FormEffectHooks
;
}
=
FormEffectHooks
;
const
AddBills
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
interface
BillsFormProps
{
const
{
id
?:
string
;
pageStatus
,
validateId
?:
string
;
preview
,
// 是否是编辑的
id
,
isEdit
?:
boolean
;
invoicesTypeId
,
// 单据类型ID
invoicesTypeId
:
string
;
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoices
:
string
;
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
relevanceInvoicesId
:
string
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
}
=
usePageStatus
();
};
const
BillsForm
:
React
.
FC
<
BillsFormProps
>
=
({
id
,
isEdit
=
false
,
invoicesTypeId
,
relevanceInvoices
,
relevanceInvoicesId
,
})
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
type
:
'checkbox'
});
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
type
:
'checkbox'
});
const
[
billInfo
,
setBillInfo
]
=
useState
<
{[
key
:
string
]:
any
}
>
({
transactionTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
)
});
const
[
billInfo
,
setBillInfo
]
=
useState
<
{[
key
:
string
]:
any
}
>
({
transactionTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
)
});
...
@@ -136,8 +144,6 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -136,8 +144,6 @@ const AddBills: React.FC<{}> = (props: any) => {
...
rest
...
rest
}
=
res
.
data
;
}
=
res
.
data
;
console
.
log
(
'res'
,
res
.
data
.
relevanceInvoicesId
)
const
details
=
invoicesDetailsList
?
invoicesDetailsList
.
map
(
item
=>
({
const
details
=
invoicesDetailsList
?
invoicesDetailsList
.
map
(
item
=>
({
...
item
,
...
item
,
product
:
item
.
productId
,
product
:
item
.
productId
,
...
@@ -347,7 +353,7 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -347,7 +353,7 @@ const AddBills: React.FC<{}> = (props: any) => {
setVisible
(
true
);
setVisible
(
true
);
};
};
const
TableAddButton
=
pageStatus
!==
PageStatus
.
PREVIEW
?
(
const
TableAddButton
=
isEdit
||
!
id
?
(
<
Button
<
Button
style=
{
{
marginBottom
:
16
}
}
style=
{
{
marginBottom
:
16
}
}
block
block
...
@@ -393,6 +399,9 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -393,6 +399,9 @@ const AddBills: React.FC<{}> = (props: any) => {
// 采购入库单
// 采购入库单
case
DOC_TYPE_PURCHASE_RECEIPT
:
{
case
DOC_TYPE_PURCHASE_RECEIPT
:
{
if
(
!
id
)
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
PublicApi
.
postOrderPurchaseReceiptAdd
(
payload
)
PublicApi
.
postOrderPurchaseReceiptAdd
(
payload
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
if
(
res
.
code
!==
1000
)
{
...
@@ -407,6 +416,9 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -407,6 +416,9 @@ const AddBills: React.FC<{}> = (props: any) => {
});
});
}
else
{
}
else
{
// update action
// update action
if
(
!
isEdit
)
{
return
;
}
PublicApi
.
postWarehouseInvoicesUpdata
({
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
+
id
,
id
:
+
id
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
...
@@ -433,6 +445,9 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -433,6 +445,9 @@ const AddBills: React.FC<{}> = (props: any) => {
// 销售发货单
// 销售发货单
case
DOC_TYPE_SALES_INVOICE
:
{
case
DOC_TYPE_SALES_INVOICE
:
{
if
(
!
id
)
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
PublicApi
.
postOrderSalesInvoiceOrder
(
payload
)
PublicApi
.
postOrderSalesInvoiceOrder
(
payload
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
if
(
res
.
code
!==
1000
)
{
...
@@ -447,6 +462,9 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -447,6 +462,9 @@ const AddBills: React.FC<{}> = (props: any) => {
});
});
}
else
{
}
else
{
// update action
// update action
if
(
!
isEdit
)
{
return
;
}
PublicApi
.
postWarehouseInvoicesUpdata
({
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
+
id
,
id
:
+
id
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
...
@@ -575,14 +593,14 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -575,14 +593,14 @@ const AddBills: React.FC<{}> = (props: any) => {
onBack=
{
()
=>
history
.
goBack
()
}
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
title=
{
pageStatus
===
0
!
id
?
?
'新建单据'
'新建单据'
:
:
pageStatus
===
1
isEdit
?
?
'编辑单据'
'编辑单据'
:
:
'查看单据'
'查看单据'
}
}
extra=
{
extra=
{
preview
!=
'1'
(
isEdit
||
!
id
)
?
[
?
[
<
Button
<
Button
key=
"1"
key=
"1"
...
@@ -608,7 +626,7 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -608,7 +626,7 @@ const AddBills: React.FC<{}> = (props: any) => {
RadioGroup
:
Radio
.
Group
,
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
ArrayTable
,
}
}
}
}
editable=
{
pageStatus
!==
PageStatus
.
PREVIEW
}
editable=
{
isEdit
||
!
id
}
effects=
{
(
$
,
actions
)
=>
{
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
)
createEffects
(
$
,
actions
)
onFormInputChange$
().
subscribe
(()
=>
{
onFormInputChange$
().
subscribe
(()
=>
{
...
@@ -664,4 +682,4 @@ const AddBills: React.FC<{}> = (props: any) => {
...
@@ -664,4 +682,4 @@ const AddBills: React.FC<{}> = (props: any) => {
);
);
};
};
export
default
AddBills
;
export
default
BillsForm
;
src/pages/transaction/stockSellStorage/bills/
addBills
/schema/index.ts
→
src/pages/transaction/stockSellStorage/bills/
components/BillsForm
/schema/index.ts
View file @
b67e6c03
File moved
src/pages/transaction/stockSellStorage/bills/editBills.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
BillsForm
from
'./components/BillsForm'
;
const
EditBills
:
React
.
FC
=
()
=>
{
const
{
id
,
invoicesTypeId
,
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
}
=
usePageStatus
();
return
(
<
BillsForm
id=
{
id
}
invoicesTypeId=
{
invoicesTypeId
}
relevanceInvoices=
{
relevanceInvoices
}
relevanceInvoicesId=
{
relevanceInvoicesId
}
isEdit
/>
);
};
export
default
EditBills
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/billsType/addBillsType.tsx
View file @
b67e6c03
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
from
'react'
;
import
{
Button
,
Card
,
Spin
}
from
'antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
BillTypeForm
from
'./components/BillTypeForm'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
useInitValue
}
from
'@/formSchema/effects/useInitValue'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
billsTypeDetailSchema
}
from
'./schema'
;
const
formActions
=
createFormActions
();
const
AddBillsType
:
React
.
FC
=
()
=>
{
const
{
const
{
id
}
=
usePageStatus
();
onFormInputChange$
,
}
=
FormEffectHooks
;
const
AddWarehouse
:
React
.
FC
<
{}
>
=
props
=>
{
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
initValue
=
useInitValue
(
PublicApi
.
getWarehouseInvoicesTypeDetails
);
const
[
info
,
setInfo
]
=
useState
({});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
docTypeInfo
=
async
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseInvoicesTypeDetails
({
id
,
});
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
};
useEffect
(()
=>
{
docTypeInfo
();
},
[]);
const
handleSubmit
=
value
=>
{
if
(
!
id
)
{
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
()
},
800
);
};
})
.
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseInvoicesTypeUpdate
({
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
}
setUnsaved
(
false
);
};
return
(
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
BillTypeForm
/>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
pageStatus
===
0
?
'新建单据类型'
:
pageStatus
===
1
?
'编辑单据类型'
:
'查看单据类型'
}
extra=
{
preview
!=
'1'
?
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
previewPlaceholder=
"' '"
editable=
{
pageStatus
!==
PageStatus
.
PREVIEW
}
effects=
{
$
=>
{
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
initialValues=
{
info
}
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
schema=
{
billsTypeDetailSchema
}
/>
</
Card
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
PageHeaderWrapper
>
</
Spin
>
);
);
};
};
export
default
Add
Warehous
e
;
export
default
Add
BillsTyp
e
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/billsType/billsTypeDetail.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
BillTypeForm
from
'./components/BillTypeForm'
;
const
BillsTypeDetail
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
return
(
<
BillTypeForm
id=
{
id
}
/>
);
};
export
default
BillsTypeDetail
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/billsType/components/BillTypeForm/index.less
0 → 100644
View file @
b67e6c03
src/pages/transaction/stockSellStorage/billsType/components/BillTypeForm/index.tsx
0 → 100644
View file @
b67e6c03
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Card
,
Spin
}
from
'antd'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
billsTypeDetailSchema
}
from
'./schema'
;
const
formActions
=
createFormActions
();
const
{
onFormInputChange$
,
}
=
FormEffectHooks
;
interface
BillTypeFormProps
{
id
?:
string
;
validateId
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
};
const
BillTypeForm
:
React
.
FC
<
BillTypeFormProps
>
=
({
id
,
isEdit
=
false
,
})
=>
{
const
[
info
,
setInfo
]
=
useState
({});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
docTypeInfo
=
async
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseInvoicesTypeDetails
({
id
,
});
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
};
useEffect
(()
=>
{
docTypeInfo
();
},
[]);
const
handleSubmit
=
value
=>
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
()
},
800
);
};
})
.
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
if
(
!
isEdit
)
{
return
;
}
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseInvoicesTypeUpdate
({
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
}
setUnsaved
(
false
);
};
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
!
id
?
'新建单据类型'
:
isEdit
?
'编辑单据类型'
:
'查看单据类型'
}
extra=
{
(
isEdit
||
!
id
)
?
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
previewPlaceholder=
"' '"
editable=
{
isEdit
||
!
id
}
effects=
{
$
=>
{
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
initialValues=
{
info
}
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
schema=
{
billsTypeDetailSchema
}
/>
</
Card
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
PageHeaderWrapper
>
</
Spin
>
);
};
export
default
BillTypeForm
;
src/pages/transaction/stockSellStorage/billsType/components/BillTypeForm/schema/index.ts
0 → 100644
View file @
b67e6c03
import
{
ISchema
}
from
'@formily/antd'
;
import
{
DOC_DIRECTION_WAREHOUSING
,
DOC_DIRECTION_OUTGOING
,
DOC_DIRECTION
}
from
'@/constants'
;
export
const
billsTypeDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
12
,
labelAlign
:
'left'
,
},
properties
:
{
number
:
{
type
:
'string'
,
title
:
'单据类型编号'
,
'x-component-props'
:
{
placeholder
:
'最长10个字符'
,
maxLength
:
10
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请输入单据类型编号'
,
},
{
validator
:
value
=>
{
const
CNReg
=
/
[\u
4E00-
\u
9FA5
]
/g
;
return
CNReg
.
test
(
value
)
?
'请输入非中文字符,可以是字母 + 数字 + 字符的组合'
:
''
;
},
},
],
},
name
:
{
type
:
'string'
,
title
:
'单据类型名称'
,
'x-component-props'
:
{
placeholder
:
'最长20个字符,10个汉字'
,
},
required
:
true
,
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
}
],
},
direction
:
{
type
:
'string'
,
title
:
'单据类型方向'
,
enum
:
[
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_WAREHOUSING
],
value
:
DOC_DIRECTION_WAREHOUSING
,
},
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_OUTGOING
],
value
:
DOC_DIRECTION_OUTGOING
,
},
],
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
required
:
true
,
},
},
},
},
};
\ No newline at end of file
src/pages/transaction/stockSellStorage/billsType/editBillsType.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
BillTypeForm
from
'./components/BillTypeForm'
;
const
EditBillsType
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
return
(
<
BillTypeForm
id=
{
id
}
isEdit
/>
);
};
export
default
EditBillsType
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/billsType/schema/index.tsx
View file @
b67e6c03
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
DOC_DIRECTION_WAREHOUSING
,
DOC_DIRECTION_OUTGOING
,
DOC_DIRECTION
}
from
'@/constants'
;
export
const
billsTypeSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{},
};
export
const
billsTypeDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
12
,
labelAlign
:
'left'
,
},
properties
:
{
number
:
{
type
:
'string'
,
title
:
'单据类型编号'
,
'x-component-props'
:
{
placeholder
:
'最长10个字符'
,
maxLength
:
10
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请输入单据类型编号'
,
},
{
validator
:
value
=>
{
const
CNReg
=
/
[\u
4E00-
\u
9FA5
]
/g
;
return
CNReg
.
test
(
value
)
?
'请输入非中文字符,可以是字母 + 数字 + 字符的组合'
:
''
;
},
},
],
},
name
:
{
type
:
'string'
,
title
:
'单据类型名称'
,
'x-component-props'
:
{
placeholder
:
'最长20个字符,10个汉字'
,
},
required
:
true
,
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
}
],
},
direction
:
{
type
:
'string'
,
title
:
'单据类型方向'
,
enum
:
[
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_WAREHOUSING
],
value
:
DOC_DIRECTION_WAREHOUSING
,
},
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_OUTGOING
],
value
:
DOC_DIRECTION_OUTGOING
,
},
],
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
required
:
true
,
},
},
},
},
};
export
const
searchSchema
:
ISchema
=
{
export
const
searchSchema
:
ISchema
=
{
type
:
'object'
,
type
:
'object'
,
...
...
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
b67e6c03
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
from
'react'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
WarehouseForm
from
'./components/WarehouseForm'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Card
,
Spin
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
warehouseDetailSchema
}
from
'./schema'
;
import
{
useLinkEnumEffect
}
from
'@/components/NiceForm/linkages/linkEnum'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
formActions
=
createFormActions
();
const
AddWarehouse
:
React
.
FC
=
()
=>
{
const
{
const
{
id
}
=
usePageStatus
();
onFormInputChange$
,
}
=
FormEffectHooks
;
const
AddWarehouse
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
[
info
,
setInfo
]
=
useState
({});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
getWarehouseInfo
=
async
()
=>
{
if
(
id
)
{
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseWarehouseDetails
({
id
,
});
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
}
else
{
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
}
};
useEffect
(()
=>
{
getWarehouseInfo
();
},
[]);
// 获取手机code
const
fetchTelCode
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageCountryAreaGetTelCode
();
return
data
;
};
const
handleSubmit
=
value
=>
{
if
(
!
id
)
{
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseWarehouseAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
};
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseWarehouseUpdate
({
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
};
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
setUnsaved
(
false
);
};
return
(
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
WarehouseForm
/>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
pageStatus
===
0
?
'新建仓库'
:
pageStatus
===
1
?
'编辑仓库'
:
'查看仓库'
}
extra=
{
preview
!=
'1'
?
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
previewPlaceholder=
"' '"
editable=
{
pageStatus
!==
PageStatus
.
PREVIEW
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
useLinkEnumEffect
(
'areaResponses'
,
result
=>
result
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
})),
);
useAsyncSelect
(
'telCode'
,
fetchTelCode
);
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
initialValues=
{
info
}
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
schema=
{
warehouseDetailSchema
}
/>
</
Card
>
</
PageHeaderWrapper
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
Spin
>
);
);
};
};
export
default
AddWarehouse
;
export
default
AddWarehouse
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/warehouse/components/WarehouseForm/index.less
0 → 100644
View file @
b67e6c03
src/pages/transaction/stockSellStorage/warehouse/components/WarehouseForm/index.tsx
0 → 100644
View file @
b67e6c03
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Card
,
Spin
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
warehouseDetailSchema
}
from
'./schema'
;
import
{
useLinkEnumEffect
}
from
'@/components/NiceForm/linkages/linkEnum'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
formActions
=
createFormActions
();
const
{
onFormInputChange$
,
}
=
FormEffectHooks
;
interface
WarehouseFormProps
{
id
?:
string
;
validateId
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
};
const
WarehouseForm
:
React
.
FC
<
WarehouseFormProps
>
=
({
id
,
isEdit
=
false
,
})
=>
{
const
[
info
,
setInfo
]
=
useState
({});
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
getWarehouseInfo
=
async
()
=>
{
if
(
id
)
{
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseWarehouseDetails
({
id
,
});
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
if
(
infoRes
.
code
===
1000
)
{
setInfo
(
infoRes
.
data
);
}
setInfoLoading
(
false
);
}
else
{
const
areaRes
=
await
PublicApi
.
getManageAreaAll
();
if
(
areaRes
.
code
===
1000
)
{
const
{
data
}
=
areaRes
;
formActions
.
setFieldState
(
'provinceId'
,
targetState
=>
{
targetState
.
originData
=
data
;
targetState
.
props
.
enum
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
}));
});
}
}
};
useEffect
(()
=>
{
getWarehouseInfo
();
},
[]);
// 获取手机code
const
fetchTelCode
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageCountryAreaGetTelCode
();
return
data
;
};
const
handleSubmit
=
value
=>
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseWarehouseAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
};
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
if
(
!
isEdit
)
{
return
;
}
setSubmitLoading
(
true
);
PublicApi
.
postWarehouseWarehouseUpdate
({
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
};
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
setUnsaved
(
false
);
};
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
!
id
?
'新建仓库'
:
isEdit
?
'编辑仓库'
:
'查看仓库'
}
extra=
{
(
isEdit
||
!
id
)
?
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
previewPlaceholder=
"' '"
editable=
{
isEdit
||
!
id
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
useLinkEnumEffect
(
'areaResponses'
,
result
=>
result
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
,
})),
);
useAsyncSelect
(
'telCode'
,
fetchTelCode
);
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
initialValues=
{
info
}
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
schema=
{
warehouseDetailSchema
}
/>
</
Card
>
</
PageHeaderWrapper
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
Spin
>
);
};
export
default
WarehouseForm
;
src/pages/transaction/stockSellStorage/warehouse/components/WarehouseForm/schema/index.ts
0 → 100644
View file @
b67e6c03
import
{
ISchema
}
from
'@formily/antd'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
export
const
warehouseDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
12
,
labelAlign
:
'left'
,
},
properties
:
{
name
:
{
type
:
'string'
,
title
:
'仓库名称'
,
'x-component-props'
:
{
placeholder
:
'请输入'
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请输入仓库名称'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
}
],
required
:
true
,
},
MEGA_LAYOUT1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
label
:
'仓库地址'
,
wrapperCol
:
24
,
},
properties
:
{
MEGA_LAYOUT1_1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
3
,
},
properties
:
{
provinceId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 省 -'
,
},
'x-linkages'
:
[
{
type
:
'value:linkage'
,
condition
:
'{{!!$value}}'
,
origin
:
'provinceId'
,
target
:
'cityId'
,
},
],
required
:
true
,
},
cityId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 市 -'
,
},
'x-linkages'
:
[
{
type
:
'value:linkage'
,
condition
:
'{{!!$value}}'
,
origin
:
'cityId'
,
target
:
'areaId'
,
},
],
required
:
true
,
},
areaId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 县 / 区 -'
,
},
required
:
true
,
},
},
},
address
:
{
type
:
'string'
,
required
:
true
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
placeholder
:
'请输入详细地址(最长50个字符,25个汉字)'
,
rows
:
5
,
},
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
50
,
}
],
},
},
},
principal
:
{
type
:
'string'
,
title
:
'仓库负责人'
,
'x-component-props'
:
{},
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
16
,
}
],
},
MEGA_LAYOUT2
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
label
:
'联系电话'
,
wrapperCol
:
24
,
},
properties
:
{
MEGA_LAYOUT2_1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
},
properties
:
{
telCode
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
},
tel
:
{
type
:
'string'
,
'x-mega-props'
:
{
span
:
3
,
},
'x-component-props'
:
{
placeholder
:
'请输入你的手机号码'
,
maxLength
:
11
,
},
'x-rules'
:
[
{
pattern
:
PATTERN_MAPS
.
phone
,
message
:
'请输入正确格式的手机号'
,
},
],
},
},
},
},
},
},
},
},
};
\ No newline at end of file
src/pages/transaction/stockSellStorage/warehouse/editWarehouse.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
WarehouseForm
from
'./components/WarehouseForm'
;
const
EditWarehouse
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
return
(
<
WarehouseForm
id=
{
id
}
isEdit
/>
);
};
export
default
EditWarehouse
;
\ No newline at end of file
src/pages/transaction/stockSellStorage/warehouse/index.tsx
View file @
b67e6c03
...
@@ -37,7 +37,7 @@ const WareHouse: React.FC<{}> = () => {
...
@@ -37,7 +37,7 @@ const WareHouse: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
return
(
<
EyePreview
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/stockSellStorage/warehouse/detail?id=${record.id}
&preview=1
`
}
url=
{
`/memberCenter/tranactionAbility/stockSellStorage/warehouse/detail?id=${record.id}`
}
>
>
{
text
}
{
text
}
</
EyePreview
>
</
EyePreview
>
...
...
src/pages/transaction/stockSellStorage/warehouse/schema/index.tsx
View file @
b67e6c03
...
@@ -84,172 +84,6 @@ export const warehouseSchema: ISchema = {
...
@@ -84,172 +84,6 @@ export const warehouseSchema: ISchema = {
},
},
};
};
export
const
warehouseDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelCol
:
4
,
wrapperCol
:
12
,
labelAlign
:
'left'
,
},
properties
:
{
name
:
{
type
:
'string'
,
title
:
'仓库名称'
,
'x-component-props'
:
{
placeholder
:
'请输入'
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请输入仓库名称'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
}
],
required
:
true
,
},
MEGA_LAYOUT1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
label
:
'仓库地址'
,
wrapperCol
:
24
,
},
properties
:
{
MEGA_LAYOUT1_1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
3
,
},
properties
:
{
provinceId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 省 -'
,
},
'x-linkages'
:
[
{
type
:
'value:linkage'
,
condition
:
'{{!!$value}}'
,
origin
:
'provinceId'
,
target
:
'cityId'
,
},
],
required
:
true
,
},
cityId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 市 -'
,
},
'x-linkages'
:
[
{
type
:
'value:linkage'
,
condition
:
'{{!!$value}}'
,
origin
:
'cityId'
,
target
:
'areaId'
,
},
],
required
:
true
,
},
areaId
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'- 县 / 区 -'
,
},
required
:
true
,
},
},
},
address
:
{
type
:
'string'
,
required
:
true
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
placeholder
:
'请输入详细地址(最长50个字符,25个汉字)'
,
rows
:
5
,
},
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
50
,
}
],
},
},
},
principal
:
{
type
:
'string'
,
title
:
'仓库负责人'
,
'x-component-props'
:
{},
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
16
,
}
],
},
MEGA_LAYOUT2
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
label
:
'联系电话'
,
wrapperCol
:
24
,
},
properties
:
{
MEGA_LAYOUT2_1
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
},
properties
:
{
telCode
:
{
type
:
'string'
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
},
tel
:
{
type
:
'string'
,
'x-mega-props'
:
{
span
:
3
,
},
'x-component-props'
:
{
placeholder
:
'请输入你的手机号码'
,
maxLength
:
11
,
},
'x-rules'
:
[
{
pattern
:
PATTERN_MAPS
.
phone
,
message
:
'请输入正确格式的手机号'
,
},
],
},
},
},
},
},
},
},
},
};
export
const
searchSchema
:
ISchema
=
{
export
const
searchSchema
:
ISchema
=
{
type
:
'object'
,
type
:
'object'
,
properties
:
{
properties
:
{
...
...
src/pages/transaction/stockSellStorage/warehouse/warehouseDetail.tsx
0 → 100644
View file @
b67e6c03
import
React
from
'react'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
WarehouseForm
from
'./components/WarehouseForm'
;
const
WarehouseDetail
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
return
(
<
WarehouseForm
id=
{
id
}
/>
);
};
export
default
WarehouseDetail
;
\ No newline at end of file
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