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
9b4456f6
Commit
9b4456f6
authored
Jan 18, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 更改商品分类选择组件
parent
afce4a6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
39 deletions
+35
-39
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+6
-1
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+21
-27
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+8
-11
No files found.
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
9b4456f6
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-
08 10:46:53
* @LastEditTime: 2021-01-
18 14:11:18
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -339,9 +339,14 @@ export const useBusinessEffects = (context, actions) => {
// 采购入库单、销售发货单
case
DOC_TYPE_PURCHASE_RECEIPT
:
case
DOC_TYPE_SALES_INVOICE
:
{
// 设置配送方式相关字段数据
setFieldValue
(
'transport'
,
DELIVERY_TYPE
[
first
.
deliveryType
]);
setFieldValue
(
'deliveryType'
,
first
.
deliveryType
);
// 根据选择的订单查询 订单对应的商品,并给 Table 的商品下拉框赋值
PublicApi
.
getOrderProcurementOrderProductList
({
id
:
first
.
id
,
orderNo
:
''
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
goodOptions
=
res
.
data
.
map
(
item
=>
({
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
9b4456f6
...
...
@@ -17,6 +17,7 @@ import ModalTable from '@/components/ModalTable';
import
Search
from
'@/components/NiceForm/components/Search'
;
import
Submit
from
'@/components/NiceForm/components/Submit'
;
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
;
import
CustomCategorySearch
from
'@/components/NiceForm/components/CustomCategorySearch'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
...
...
@@ -156,10 +157,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
// 获取会员品类
const
fetchCustomerCategory
=
async
(
name
=
''
)
=>
{
const
res
=
await
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
,
});
const
fetchCustomerCategory
=
async
()
=>
{
const
res
=
await
PublicApi
.
getProductCustomerGetCustomerCategoryTree
();
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
...
...
@@ -173,7 +172,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
setInfoLoading
(
true
);
PublicApi
.
getWarehouseInvoicesDetails
({
invoicesId
:
id
,
invoicesId
:
`
${
id
}
`
,
deliveryNo
,
storageNo
,
}).
then
(
res
=>
{
...
...
@@ -1895,6 +1894,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
Search
,
Submit
,
SearchSelect
,
CustomCategorySearch
,
},
effects
:
(
$
,
actions
)
=>
{
const
linkage
=
useLinkageUtils
();
...
...
@@ -1906,33 +1906,27 @@ const BillsForm: React.FC<BillsFormProps> = ({
FORM_FILTER_PATH
,
);
useAsyncSelect
(
'brandId'
,
fetchBrand
,
[
'name'
,
'id'
]);
useAsyncSelect
(
'customerCategoryId'
,
fetchCustomerCategory
,
[
'name'
,
'id'
]);
onFormInit$
().
subscribe
(()
=>
{
// 初始化远程检索逻辑
linkage
.
componentProps
(
'customerCategoryId'
,
{
onSearch
:
async
value
=>
{
linkage
.
loading
(
'customerCategoryId'
);
const
dataSource
=
await
fetchCustomerCategory
(
value
);
linkage
.
enum
(
'customerCategoryId'
,
dataSource
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
})));
linkage
.
loaded
(
'customerCategoryId'
);
},
fetchCustomerCategory
().
then
(
res
=>
{
linkage
.
componentProps
(
'customerCategoryId'
,
{
dataoption
:
res
,
});
});
// 初始化远程检索逻辑
linkage
.
componentProps
(
'brandId'
,
{
onSearch
:
async
value
=>
{
linkage
.
loading
(
'brandId'
);
const
dataSource
=
await
fetchCustomerCategory
(
value
);
linkage
.
enum
(
'brandId'
,
dataSource
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
})));
linkage
.
loaded
(
'brandId'
);
},
});
//
linkage.componentProps('brandId',
{
//
onSearch: async value =>
{
//
linkage.loading('brandId');
// const dataSource = await fetchBrand
(value);
//
linkage.enum('brandId', dataSource.map(item => (
{
//
label: item.name,
//
value: item.id,
//
})));
//
linkage.loaded('brandId');
//
},
//
});
});
},
inline
:
false
,
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
9b4456f6
...
...
@@ -880,14 +880,14 @@ export const goodsSearchSchema: ISchema = {
},
},
customerCategoryId
:
{
type
:
'string'
,
enum
:
[],
type
:
'string'
,
'x-component'
:
'CustomCategorySearch'
,
'x-component-props'
:
{
placeholder
:
'品类'
,
showSearch
:
true
,
defaultActiveFirstOption
:
false
,
showArrow
:
true
,
fi
lterOption
:
false
,
placeholder
:
'品类'
,
showSearch
:
true
,
notFoundContent
:
null
,
dataoption
:
[],
fi
eldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
},
},
brandId
:
{
...
...
@@ -895,10 +895,7 @@ export const goodsSearchSchema: ISchema = {
enum
:
[],
'x-component-props'
:
{
placeholder
:
'品牌'
,
showSearch
:
true
,
defaultActiveFirstOption
:
false
,
showArrow
:
true
,
filterOption
:
false
,
allowClear
:
true
,
},
},
submit
:
{
...
...
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