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
c8b6fb22
Commit
c8b6fb22
authored
Jul 01, 2022
by
何洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 业务员剩余数量0时输入框禁用
parent
a293f812
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
28 deletions
+30
-28
index.tsx
...orderCollectSrm/components/orderMaterialsDrawer/index.tsx
+30
-28
No files found.
src/pages/transaction/purchaseOrder/orderCollectSrm/components/orderMaterialsDrawer/index.tsx
View file @
c8b6fb22
...
...
@@ -326,35 +326,37 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
title: '下单数量',
dataIndex: 'materielNo',
width: 372,
render: (text, record, index) => (
<div className={styles['member-rights-editable']}>
<Form.Item
name={['materials', 'requisitionList', `
$
{
record
.
key
}
`]}
rules={[
{
required: checkedKeysState.includes(record.key) ? true : false,
message: '请输入下单数量',
},
{
pattern: PATTERN_MAPS.quantity,
message: '请输入整数',
},
{
validator: (_, value) => {
const intVal = +value;
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0;
if (intVal > max) {
return Promise.reject('下单数量不可超过业务员剩余数量');
}
return Promise.resolve();
render: (text, record, index) => {
const max = record.purchaseProductSalesManResponse?.purchaseRemainingQuantity || 0
return (
<div className={styles['member-rights-editable']}>
<Form.Item
name={['materials', 'requisitionList', `
$
{
record
.
key
}
`]}
rules={[
{
required: checkedKeysState.includes(record.key) ? true : false,
message: '请输入下单数量',
},
},
]}
>
<Input />
</Form.Item>
</div>
),
{
pattern: PATTERN_MAPS.quantity,
message: '请输入整数',
},
{
validator: (_, value) => {
const intVal = +value;
if (intVal > max) {
return Promise.reject('下单数量不可超过业务员剩余数量');
}
return Promise.resolve();
},
},
]}
>
<Input disabled={ max <= 0 }/>
</Form.Item>
</div>
)
},
},
];
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