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
9bd7f371
Commit
9bd7f371
authored
Sep 21, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善
parent
943827f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
98 deletions
+125
-98
Roles.tsx
src/layouts/components/Roles.tsx
+4
-2
index.tsx
...ges/transaction/stockSellStorage/bills/addBills/index.tsx
+121
-96
No files found.
src/layouts/components/Roles.tsx
View file @
9bd7f371
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Dropdown
,
Space
,
Menu
,
message
}
from
'antd'
;
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
;
import
{
getAuth
,
setAuth
,
setRouters
}
from
'@/utils/auth'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -65,9 +66,10 @@ const Roles: React.FC = () => {
overlay=
{
menuHeaderDropdown
}
placement=
"bottomRight"
>
<
span
style=
{
{
cursor
:
'pointer'
,
padding
:
'0 15px'
}
}
>
<
Space
size=
{
5
}
style=
{
{
cursor
:
'pointer'
,
padding
:
'0 15px'
}
}
>
{
curRole
?.
memberRoleName
}
</
span
>
<
CaretDownOutlined
/>
</
Space
>
</
Dropdown
>
)
};
...
...
src/pages/transaction/stockSellStorage/bills/addBills/index.tsx
View file @
9bd7f371
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Button
,
Card
,
message
}
from
'antd'
;
import
{
Button
,
Card
,
Spin
,
message
}
from
'antd'
;
import
{
Radio
,
ArrayTable
}
from
'@formily/antd-components'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
...
...
@@ -44,6 +44,7 @@ const AddBills: React.FC<{}> = (props: any) => {
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
type
:
'checkbox'
});
const
[
billInfo
,
setBillInfo
]
=
useState
(
null
);
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
...
...
@@ -99,6 +100,24 @@ const AddBills: React.FC<{}> = (props: any) => {
return
[];
}
// 获取单据详情
const
getBillInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoading
(
true
);
PublicApi
.
getWarehouseInvoicesDetails
({
invoicesId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setBillInfo
(
res
.
data
);
}).
finally
(()
=>
{
setInfoLoading
(
false
);
});
};
// 弹出单据明细
const
handleAdd
=
()
=>
{
const
orderNoVal
=
addSchemaAction
.
getFieldValue
(
'orderNo'
);
...
...
@@ -122,7 +141,7 @@ const AddBills: React.FC<{}> = (props: any) => {
);
useEffect
(()
=>
{
getBillInfo
();
},
[]);
const
handleSubmit
=
value
=>
{
...
...
@@ -137,18 +156,22 @@ const AddBills: React.FC<{}> = (props: any) => {
switch
(
invoicesTypeId
)
{
// 采购入库单只能选择 订单
case
DOC_TYPE_PURCHASE_RECEIPT
:
{
PublicApi
.
postOrderPurchaseReceiptAdd
(
payload
)
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnsaved
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
if
(
!
id
)
{
PublicApi
.
postOrderPurchaseReceiptAdd
(
payload
)
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnsaved
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
// update action
}
break
;
}
...
...
@@ -233,92 +256,94 @@ const AddBills: React.FC<{}> = (props: any) => {
}
return
(
<
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=
{
()
=>
addSchemaAction
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
expressionScope=
{
{
tableAddButton
,
}
}
components=
{
{
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
}
}
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
)
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
onSubmit=
{
handleSubmit
}
actions=
{
addSchemaAction
}
schema=
{
addBillSchema
}
/>
</
Card
>
<
Spin
spinning=
{
infoLoading
}
>
<
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=
{
()
=>
addSchemaAction
.
submit
()
}
>
保存
</
Button
>,
]
:
[]
}
>
<
Card
>
<
NiceForm
expressionScope=
{
{
tableAddButton
,
}
}
components=
{
{
RadioGroup
:
Radio
.
Group
,
ArrayTable
,
}
}
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
)
onFormInputChange$
().
subscribe
(()
=>
{
if
(
!
unsaved
)
{
setUnsaved
(
true
);
}
});
}
}
onSubmit=
{
handleSubmit
}
actions=
{
addSchemaAction
}
schema=
{
addBillSchema
}
/>
</
Card
>
<
ModalTable
modalTitle=
'选择货品'
confirm=
{
handleOkAddProduct
}
cancel=
{
()
=>
setVisible
(
false
)
}
visible=
{
visible
}
columns=
{
goodsColumns
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
goodsSearchSchema
,
components
:
{
Search
,
Submit
,
},
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
useAsyncSelect
(
'brandId'
,
fetchBrand
,
[
'name'
,
'id'
]);
useAsyncSelect
(
'customerCategoryId'
,
fetchCustomerCategory
,
[
'name'
,
'id'
]);
},
inline
:
false
,
<
ModalTable
modalTitle=
'选择货品'
confirm=
{
handleOkAddProduct
}
cancel=
{
()
=>
setVisible
(
false
)
}
visible=
{
visible
}
columns=
{
goodsColumns
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
goodsSearchSchema
,
components
:
{
Search
,
Submit
,
},
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
useAsyncSelect
(
'brandId'
,
fetchBrand
,
[
'name'
,
'id'
]);
useAsyncSelect
(
'customerCategoryId'
,
fetchCustomerCategory
,
[
'name'
,
'id'
]);
},
inline
:
false
,
}
}
}
}
tableProps=
{
{
rowKey
:
'id'
,
}
}
/>
tableProps=
{
{
rowKey
:
'id'
,
}
}
/>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
PageHeaderWrapper
>
<
Prompt
when=
{
unsaved
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
</
PageHeaderWrapper
>
</
Spin
>
);
};
...
...
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