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
3e1a6698
Commit
3e1a6698
authored
Sep 14, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接进销存
parent
df4777ca
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
239 additions
and
164 deletions
+239
-164
memberRoute.ts
config/routes/memberRoute.ts
+0
-24
tranactionRoute.ts
config/routes/tranactionRoute.ts
+2
-9
index.ts
src/constants/index.ts
+17
-0
index.ts
src/pages/member/memberPr1/schema/index.ts
+1
-0
index.ts
src/pages/member/memberPr2/schema/index.ts
+1
-0
auditPrComfirm.tsx
src/pages/member/memberPrConfirm/auditPrComfirm.tsx
+16
-0
index.ts
src/pages/member/memberPrConfirm/schema/index.ts
+10
-2
auditPrSubmit.tsx
src/pages/member/memberPrSubmit/auditPrSubmit.tsx
+20
-12
index.ts
src/pages/member/memberPrSubmit/schema/index.ts
+1
-6
addBillsType.tsx
...s/transaction/stockSellStorage/billsType/addBillsType.tsx
+63
-13
index.tsx
src/pages/transaction/stockSellStorage/billsType/index.tsx
+59
-94
index.tsx
...s/transaction/stockSellStorage/billsType/schema/index.tsx
+46
-4
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+3
-0
No files found.
config/routes/memberRoute.ts
View file @
3e1a6698
...
...
@@ -20,61 +20,52 @@ const MemberRoute = {
{
path
:
'/memberCenter/memberAbility/manage/import'
,
name
:
'memberImport'
,
key
:
'memberImport'
,
component
:
'@/pages/member/memberImport/index'
,
},
{
path
:
'/memberCenter/memberAbility/manage/importDetail'
,
name
:
'importDetail'
,
key
:
'importDetail'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberImport/importDetail'
,
},
{
path
:
'/memberCenter/memberAbility/manage/addMember'
,
name
:
'addMember'
,
key
:
'addMember'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberImport/addMember'
,
},
{
path
:
'/memberCenter/memberAbility/manage/maintain'
,
name
:
'memberMaintain'
,
key
:
'memberMaintain'
,
component
:
'@/pages/member/memberMaintain/index'
,
},
{
path
:
'/memberCenter/memberAbility/manage/maintainDetail'
,
name
:
'maintainDetail'
,
key
:
'maintainDetail'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberMaintain/detailed'
,
routes
:
[
{
path
:
'/memberCenter/memberAbility/manage/maintainDetail/basicInfo'
,
name
:
'basicInfo'
,
key
:
'basicInfo'
,
component
:
'@/pages/member/memberMaintain/detailed/basicInfo'
,
hideInMenu
:
true
,
},
{
path
:
'/memberCenter/memberAbility/manage/maintainDetail/levelInfo'
,
name
:
'levelInfo'
,
key
:
'levelInfo'
,
component
:
'@/pages/member/memberMaintain/detailed/levelInfo'
,
hideInMenu
:
true
,
},
{
path
:
'/memberCenter/memberAbility/manage/maintainDetail/equityInfo'
,
name
:
'equityInfo'
,
key
:
'equityInfo'
,
component
:
'@/pages/member/memberMaintain/detailed/equityInfo'
,
hideInMenu
:
true
,
},
{
path
:
'/memberCenter/memberAbility/manage/maintainDetail/sincerityInfo'
,
name
:
'sincerityInfo'
,
key
:
'sincerityInfo'
,
component
:
'@/pages/member/memberMaintain/detailed/sincerityInfo'
,
hideInMenu
:
true
,
},
...
...
@@ -83,78 +74,66 @@ const MemberRoute = {
{
path
:
'/memberCenter/memberAbility/manage/frozen'
,
name
:
'maintainFrozen'
,
key
:
'maintainFrozen'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberMaintain/frozen'
,
},
{
path
:
'/memberCenter/memberAbility/manage/memberPrSubmit'
,
name
:
'memberPrSubmit'
,
key
:
'memberPrSubmit'
,
component
:
'@/pages/member/memberPrSubmit/index'
},
{
path
:
'/memberCenter/memberAbility/manage/auditPrSubmit'
,
name
:
'auditPrSubmit'
,
key
:
'auditPrSubmit'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberPrSubmit/auditPrSubmit'
},
{
path
:
'/memberCenter/memberAbility/manage/memberPr1'
,
name
:
'memberPr1'
,
key
:
'memberPr1'
,
component
:
'@/pages/member/memberPr1/index'
},
{
path
:
'/memberCenter/memberAbility/manage/auditPr1'
,
name
:
'auditPr1'
,
key
:
'auditPr1'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberPr1/auditPr1'
},
{
path
:
'/memberCenter/memberAbility/manage/memberPr2'
,
name
:
'memberPr2'
,
key
:
'memberPr2'
,
component
:
'@/pages/member/memberPr2/index'
},
{
path
:
'/memberCenter/memberAbility/manage/auditPr2'
,
name
:
'auditPr2'
,
key
:
'auditPr2'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberPr2/auditPr2'
},
{
path
:
'/memberCenter/memberAbility/manage/memberPrConfirm'
,
name
:
'memberPrConfirm'
,
key
:
'memberPrConfirm'
,
component
:
'@/pages/member/memberPrConfirm/index'
},
{
path
:
'/memberCenter/memberAbility/manage/auditPrComfirm'
,
name
:
'auditPrComfirm'
,
key
:
'auditPrComfirm'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberPrConfirm/auditPrComfirm'
},
{
path
:
'/memberCenter/memberAbility/manage/upgradeRule'
,
name
:
'memberUpgradeRule'
,
key
:
'memberUpgradeRule'
,
component
:
'@/pages/member/memberUpgradeRule/index'
,
},
{
path
:
'/memberCenter/memberAbility/manage/level'
,
name
:
'memberLevel'
,
key
:
'memberLevel'
,
component
:
'@/pages/member/memberLevel/index'
},
{
path
:
'/memberCenter/memberAbility/manage/level/addEquity'
,
name
:
'addEquity'
,
key
:
'addEquity'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberLevel/addEquity'
,
},
...
...
@@ -163,13 +142,11 @@ const MemberRoute = {
{
path
:
'/memberCenter/memberAbility/query'
,
name
:
'memberQuery'
,
key
:
'memberQuery'
,
component
:
'@/pages/member/memberQuery/index'
,
},
{
path
:
'/memberCenter/memberAbility/query/detailed'
,
name
:
'memberQueryDetailed'
,
key
:
'memberQueryDetailed'
,
component
:
'@/pages/member/memberQuery/detailed'
,
hideInMenu
:
true
,
routes
:
[
...
...
@@ -206,7 +183,6 @@ const MemberRoute = {
{
path
:
'/memberCenter/memberAbility/update'
,
name
:
'memberUpdate'
,
key
:
'memberUpdate'
,
hideInMenu
:
true
,
component
:
'@/pages/member/memberQuery/update'
,
},
...
...
config/routes/tranactionRoute.ts
View file @
3e1a6698
/*
* @Author: LeeJiancong
* @Date: 2020-07-31 19:56:22
* @LastEditors:
LeeJianc
ong
* @LastEditors:
XieZhiXi
ong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-1
0 17:07:48
* @LastEditTime: 2020-09-1
4 19:37:53
*/
const
TranactionRoute
=
{
...
...
@@ -20,46 +20,39 @@ const TranactionRoute = {
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/warehouse'
,
name
:
'warehouse'
,
key
:
'warehouse'
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/index'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/addWarehouse'
,
name
:
'addWarehouse'
,
key
:
'addWarehouse'
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/warehouse/addWarehouse'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/billsType'
,
name
:
'billsType'
,
key
:
'billsType'
,
component
:
'@/pages/transaction/stockSellStorage/billsType/index'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/addBillsType'
,
name
:
'addBillsType'
,
key
:
'addBillsType'
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/billsType/addBillsType'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/bills'
,
name
:
'bills'
,
key
:
'bills'
,
component
:
'@/pages/transaction/stockSellStorage/bills/index'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/addBills'
,
name
:
'addBills'
,
key
:
'addBills'
,
hideInMenu
:
true
,
component
:
'@/pages/transaction/stockSellStorage/bills/addBills'
,
},
{
path
:
'/memberCenter/tranactionAbility/stockSellStorage/inventory'
,
name
:
'inventory'
,
key
:
'inventory'
,
component
:
'@/pages/transaction/stockSellStorage/inventory/index'
,
},
]
...
...
src/constants/index.ts
View file @
3e1a6698
...
...
@@ -267,3 +267,19 @@ export const POSITION_STATUS = {
[
POSITION_STATUS_EFFECTIVE
]:
'有效'
,
[
POSITION_STATUS_INVALID
]:
'无效'
,
};
// 单据类型状态
export
const
DOC_TYPE_STATUS_EFFECTIVE
=
1
;
// 有效的
export
const
DOC_TYPE_STATUS_INVALID
=
0
;
// 无效的
export
const
DOC_TYPE_STATUS
=
{
[
DOC_TYPE_STATUS_EFFECTIVE
]:
'有效'
,
[
DOC_TYPE_STATUS_INVALID
]:
'无效'
,
};
// 单据类型方向
export
const
DOC_DIRECTION_WAREHOUSING
=
1
;
// 入库
export
const
DOC_DIRECTION_OUTGOING
=
2
;
// 出库
export
const
DOC_DIRECTION
=
{
[
DOC_DIRECTION_WAREHOUSING
]:
'入库 + '
,
[
DOC_DIRECTION_OUTGOING
]:
'出库 - '
,
};
\ No newline at end of file
src/pages/member/memberPr1/schema/index.ts
View file @
3e1a6698
...
...
@@ -134,6 +134,7 @@ export const auditModalSchema: ISchema = {
type
:
'string'
,
title
:
'审核不通过原因'
,
'x-component'
:
'textarea'
,
required
:
true
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
...
...
src/pages/member/memberPr2/schema/index.ts
View file @
3e1a6698
...
...
@@ -133,6 +133,7 @@ export const auditModalSchema: ISchema = {
reason
:
{
type
:
'string'
,
title
:
'审核不通过原因'
,
required
:
true
,
'x-component'
:
'textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
...
...
src/pages/member/memberPrConfirm/auditPrComfirm.tsx
View file @
3e1a6698
...
...
@@ -16,6 +16,7 @@ import { PublicApi } from '@/services/api';
import
{
GetMemberAbilityValidateStep1DetailResponse
}
from
'@/services/MemberApi'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
MEMBER_OUTER_STATUS_SUCCESS
}
from
'@/constants'
;
import
{
MEMBER_INNER_STATUS_BADGE_COLOR
,
MEMBER_STATUS_TAG_MAP
,
MEMBER_OUTER_STATUS_TYPE
}
from
'../constant'
;
import
{
auditModalSchema
}
from
'./schema'
;
import
HeadInfo
from
'../components/HeadInfo'
;
...
...
@@ -85,6 +86,21 @@ const AuditPrComfirm: React.FC<{}> = () => {
}
setMemberInfo
(
res
.
data
||
null
);
// 外部状态为 审核通过 才能选择 审核通过选项
if
(
res
.
data
.
outerStatus
!==
MEMBER_OUTER_STATUS_SUCCESS
)
{
modalFormActions
.
setFieldState
(
'agree'
,
state
=>
{
const
newMenu
=
state
.
props
.
enum
.
map
(
(
item
:
{
label
:
string
,
value
:
any
})
=>
({
...
item
,
disabled
:
item
.
value
===
1
,
})
);
FormPath
.
setIn
(
state
,
'props.enum'
,
newMenu
);
FormPath
.
setIn
(
state
,
'value'
,
0
);
});
}
}).
finally
(()
=>
{
setInfoLoading
(
false
);
});
...
...
src/pages/member/memberPrConfirm/schema/index.ts
View file @
3e1a6698
...
...
@@ -124,8 +124,15 @@ export const auditModalSchema: ISchema = {
type
:
'string'
,
default
:
1
,
enum
:
[
{
label
:
'审核通过'
,
value
:
1
},
{
label
:
'审核不通过'
,
value
:
0
},
{
label
:
'审核通过'
,
value
:
1
,
disabled
:
false
,
},
{
label
:
'审核不通过'
,
value
:
0
,
},
],
'x-component'
:
'radio'
,
'x-component-props'
:
{},
...
...
@@ -133,6 +140,7 @@ export const auditModalSchema: ISchema = {
reason
:
{
type
:
'string'
,
title
:
'审核不通过原因'
,
required
:
true
,
'x-component'
:
'textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
...
...
src/pages/member/memberPrSubmit/auditPrSubmit.tsx
View file @
3e1a6698
...
...
@@ -16,6 +16,10 @@ import { PublicApi } from '@/services/api';
import
{
GetMemberAbilityValidateCommitDetailResponse
}
from
'@/services/MemberApi'
;
import
{
createAsyncFormActions
,
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants'
;
import
{
MEMBER_INNER_STATUS_BADGE_COLOR
,
MEMBER_STATUS_TAG_MAP
,
MEMBER_OUTER_STATUS_TYPE
}
from
'../constant'
;
import
{
channelSchema
,
auditModalSchema
}
from
'./schema'
;
import
HeadInfo
from
'../components/HeadInfo'
;
...
...
@@ -167,20 +171,27 @@ const AuditPrSubmit: React.FC<{}> = () => {
};
// 提交审核
const
handleSubmit
=
values
=>
{
const
handleSubmit
=
async
values
=>
{
setConfirmLoading
(
true
);
// 调用渠道 Form 的 submit
const
promises
:
any
=
[
formActions
.
submit
(),
PublicApi
.
postMemberAbilityValidateCommitSubmit
({
// 存在渠道信息,则先修改渠道信息,在提交审核结果
if
(
memberInfo
.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
)
{
const
updatedRes
:
any
=
await
formActions
.
submit
();
if
(
updatedRes
.
payload
.
code
!==
1000
)
{
setConfirmLoading
(
false
);
return
;
}
}
const
commitRes
=
await
PublicApi
.
postMemberAbilityValidateCommitSubmit
({
memberId
:
id
,
validateId
:
validateId
,
...
values
,
}),
];
});
Promise
.
all
(
promises
).
then
(
resArr
=>
{
if
(
resArr
.
every
((
item
:
{
code
:
number
})
=>
item
.
code
===
1000
))
{
if
(
commitRes
.
code
===
1000
)
{
setModalVisible
(
false
);
setUnsaved
(
false
);
setTimeout
(()
=>
{
...
...
@@ -188,9 +199,6 @@ const AuditPrSubmit: React.FC<{}> = () => {
},
800
);
}
setConfirmLoading
(
false
);
}).
catch
(
err
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
src/pages/member/memberPrSubmit/schema/index.ts
View file @
3e1a6698
...
...
@@ -218,18 +218,13 @@ export const auditModalSchema: ISchema = {
reason
:
{
type
:
'string'
,
title
:
'审核不通过原因'
,
required
:
true
,
'x-component'
:
'textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
// {
// required: true,
// message: '请填写审核不通过原因',
// }
],
},
},
},
...
...
src/pages/transaction/stockSellStorage/billsType/addBillsType.tsx
View file @
3e1a6698
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
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
}
from
'@formily/antd'
;
import
{
Button
,
Card
}
from
'antd'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
...
...
@@ -11,27 +11,68 @@ import { useInitValue } from '@/formSchema/effects/useInitValue';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
billsTypeDetailSchema
}
from
'./schema'
;
const
addSchemaAction
=
createFormActions
();
const
formActions
=
createFormActions
();
const
{
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
(
pageStatus
===
0
)
{
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
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
)
return
history
.
goBack
();
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
}
setUnsaved
(
false
);
};
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
...
...
@@ -49,7 +90,8 @@ const AddWarehouse: React.FC<{}> = props => {
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
onClick=
{
()
=>
addSchemaAction
.
submit
()
}
loading=
{
submitLoading
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
...
...
@@ -61,14 +103,22 @@ const AddWarehouse: React.FC<{}> = props => {
<
NiceForm
previewPlaceholder=
"' '"
editable=
{
pageStatus
!==
PageStatus
.
PREVIEW
}
effects=
{
$
=>
{}
}
initialValues=
{
initValue
}
effects=
{
$
=>
{
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
initialValues=
{
info
}
onSubmit=
{
handleSubmit
}
actions=
{
addSchemaAction
}
actions=
{
formActions
}
schema=
{
billsTypeDetailSchema
}
/>
</
Card
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
PageHeaderWrapper
>
</
Spin
>
);
};
...
...
src/pages/transaction/stockSellStorage/billsType/index.tsx
View file @
3e1a6698
import
React
,
{
use
State
,
useEffect
,
use
Ref
}
from
'react'
;
import
React
,
{
useRef
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Tooltip
,
Input
,
Button
,
Card
,
Row
,
Col
,
Space
,
Popconfirm
,
}
from
'antd'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
StandardTable
}
from
'god'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
StatusSwitch
from
'@/components/StatusSwitch'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
DOC_TYPE_STATUS_EFFECTIVE
,
DOC_TYPE_STATUS_INVALID
,
DOC_DIRECTION
}
from
'@/constants'
;
import
{
searchSchema
}
from
'./schema'
;
const
formActions
=
createFormActions
();
const
billsType
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
searchKey
,
setSearchKey
]
=
useState
<
any
>
({
name
:
''
,
state
:
''
,
});
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
,
align
:
'center'
,
key
:
'id'
,
},
{
title
:
'单据类型编号'
,
dataIndex
:
'number'
,
align
:
'center'
,
key
:
'number'
,
},
{
title
:
'单据名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<
EyePreview
...
...
@@ -57,25 +52,21 @@ const billsType: React.FC<{}> = () => {
title
:
'方向'
,
dataIndex
:
'direction'
,
align
:
'center'
,
key
:
'direction'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
<
span
>
{
record
.
direction
===
1
?
'入库 +'
:
'出库 -'
}
</
span
>;
render
:
text
=>
{
return
<
span
>
{
DOC_DIRECTION
[
text
]
}
</
span
>;
},
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
align
:
'center'
,
key
:
'status'
,
sorter
:
true
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
sorter
:
(
a
,
b
)
=>
a
.
state
-
b
.
state
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
StatusSwitch
handleConfirm=
{
()
=>
handleModify
(
record
)
}
record=
{
record
}
/>
);
},
),
},
{
title
:
'操作'
,
...
...
@@ -83,7 +74,7 @@ const billsType: React.FC<{}> = () => {
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<>
{
record
.
state
!=
1
?
(
{
record
.
state
===
DOC_TYPE_STATUS_INVALID
&&
(
<>
<
Button
type=
"link"
...
...
@@ -96,32 +87,31 @@ const billsType: React.FC<{}> = () => {
编辑
</
Button
>
<
Popconfirm
title=
"确定要
执行这个操作?
"
title=
"确定要
删除该单据类型吗?
"
onConfirm=
{
()
=>
handleDelete
(
record
)
}
onCancel=
{
()
=>
console
.
log
(
'...'
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
>
删除
</
Button
>
<
Button
type=
"link"
danger
>
删除
</
Button
>
</
Popconfirm
>
</>
)
:
(
''
)
}
</>
),
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
const
fetchListData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getWarehouseInvoicesTypeList
({
...
searchKey
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
PublicApi
.
getWarehouseInvoicesTypeList
(
params
)
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
();
})
.
catch
(()
=>
{
reject
();
});
});
};
...
...
@@ -129,9 +119,11 @@ const billsType: React.FC<{}> = () => {
const
handleModify
=
(
record
:
any
)
=>
{
PublicApi
.
postWarehouseInvoicesTypeStateUpdate
({
id
:
record
.
id
,
state
:
record
.
state
===
1
?
0
:
1
,
state
:
record
.
state
===
DOC_TYPE_STATUS_EFFECTIVE
?
DOC_TYPE_STATUS_INVALID
:
DOC_TYPE_STATUS_EFFECTIVE
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
}
});
};
...
...
@@ -139,77 +131,50 @@ const billsType: React.FC<{}> = () => {
PublicApi
.
postWarehouseInvoicesTypeDelete
({
id
:
record
.
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
};
});
};
const
handleJumpAdd
=
()
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addBillsType`
);
};
const
Actions
=
(
<
Space
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleJumpAdd
}
>
新建
</
Button
>
</
Space
>
);
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
onChange
:
(
pagination
,
filters
,
sorter
)
=>
{
let
state
=
sorter
.
order
===
'ascend'
?
1
:
sorter
.
order
===
'descend'
?
0
:
''
;
setSearchKey
({
...
searchKey
,
state
:
state
});
},
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetch
List
Data
(
params
)
}
controlRender=
{
<
Row
justify=
"space-between"
style=
{
{
marginBottom
:
'16px'
}
}
>
<
Col
>
<
Space
>
<
Button
type=
"primary"
onClick=
{
()
=>
history
.
push
(
'/memberCenter/tranactionAbility/stockSellStorage/addBillsType'
,
)
}
>
<
PlusOutlined
/>
新建
</
Button
>
</
Space
>
</
Col
>
<
Col
>
<
Space
style=
{
{
justifyContent
:
'flex-end'
,
width
:
'100%'
}
}
>
<
Tooltip
trigger=
{
[
'focus'
]
}
placement=
"top"
title=
{
<
span
>
输入单据名称进行搜索
</
span
>
}
>
<
Input
.
Search
style=
{
{
width
:
'232px'
}
}
value=
{
searchKey
.
name
}
placeholder=
"搜索"
onChange=
{
e
=>
setSearchKey
({
...
searchKey
,
name
:
e
.
target
.
value
})
}
onSearch=
{
(
val
,
e
)
=>
{
e
.
preventDefault
();
ref
.
current
.
reload
();
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
Actions
,
}
}
/>
</
Tooltip
>
<
Button
onClick=
{
()
=>
{
setSearchKey
({
name
:
''
,
state
:
''
});
ref
.
current
.
reload
();
effects=
{
(
$
,
actions
)
=>
{
}
}
>
重置
</
Button
>
</
Space
>
</
Col
>
</
Row
>
schema=
{
searchSchema
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
/>
}
/>
</
Card
>
...
...
src/pages/transaction/stockSellStorage/billsType/schema/index.tsx
View file @
3e1a6698
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'
,
...
...
@@ -32,16 +33,27 @@ export const billsTypeDetailSchema: ISchema = {
title
:
'单据类型名称'
,
'x-component-props'
:
{
placeholder
:
'最长20个字符,10个汉字'
,
maxLength
:
10
,
},
required
:
true
,
'x-rules'
:
[
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
}
],
},
direction
:
{
type
:
'string'
,
title
:
'
仓库负责人
'
,
title
:
'
单据类型方向
'
,
enum
:
[
{
label
:
'入库'
,
value
:
1
},
{
label
:
'出库'
,
value
:
2
},
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_WAREHOUSING
],
value
:
DOC_DIRECTION_WAREHOUSING
,
},
{
label
:
DOC_DIRECTION
[
DOC_DIRECTION_OUTGOING
],
value
:
DOC_DIRECTION_OUTGOING
,
},
],
'x-component-props'
:
{
placeholder
:
'请选择'
,
...
...
@@ -52,3 +64,33 @@ export const billsTypeDetailSchema: ISchema = {
},
},
};
export
const
searchSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
searchWrap
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
actions
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{Actions}}'
,
},
},
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
advanced
:
false
,
},
},
},
},
},
};
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
3e1a6698
...
...
@@ -25,6 +25,9 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
getWarehouseInfo
=
async
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
const
infoRes
=
await
PublicApi
.
getWarehouseWarehouseDetails
({
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