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
shenshaokai
jinfa-platform
Commits
aeb92ad0
Commit
aeb92ad0
authored
Dec 01, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理仓位传参列表传参问题,处理销售订单修改价格和支付比例的价格同步
parent
1288f304
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
28 deletions
+115
-28
index.ts
src/components/ModalTable/schema/index.ts
+1
-1
index.ts
src/components/TableDrawer/schema/index.ts
+1
-1
index.tsx
src/pages/repositories/effects/index.tsx
+25
-0
index.tsx
src/pages/repositories/index.tsx
+20
-0
index.tsx
src/pages/repositories/schema/index.tsx
+50
-20
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+1
-1
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+16
-4
useSelfTable.tsx
...on/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
+1
-1
No files found.
src/components/ModalTable/schema/index.ts
View file @
aeb92ad0
...
...
@@ -72,7 +72,7 @@ export const productModalSchema: ISchema = {
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'请输入商品名称
/ID
'
,
placeholder
:
'请输入商品名称'
,
align
:
'flex-left'
,
},
},
...
...
src/components/TableDrawer/schema/index.ts
View file @
aeb92ad0
...
...
@@ -72,7 +72,7 @@ export const productModalSchema: ISchema = {
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'请输入商品名称
/ID
'
,
placeholder
:
'请输入商品名称'
,
align
:
'flex-left'
,
},
},
...
...
src/pages/repositories/effects/index.tsx
View file @
aeb92ad0
...
...
@@ -48,3 +48,27 @@ export const useUnitPreview = (initValue, context) => {
}
},
[
initValue
])
}
// 高级筛选schema中用于输入搜索品牌的Effect
export
const
searchBrandOptionEffect
=
(
context
:
any
,
fieldName
:
string
)
=>
{
context
.
getFieldState
(
fieldName
,
state
=>
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
})
})
})
}
// 高级筛选schema中用于输入搜索商品品类的Effect
export
const
searchCustomerCategoryOptionEffect
=
(
context
:
any
,
fieldName
:
string
)
=>
{
context
.
getFieldState
(
fieldName
,
state
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
state
.
props
[
'x-component-props'
].
searchValue
}).
then
(
res
=>
{
context
.
setFieldState
(
fieldName
,
state
=>
{
state
.
props
[
'x-component-props'
].
dataoption
=
res
.
data
})
})
})
}
\ No newline at end of file
src/pages/repositories/index.tsx
View file @
aeb92ad0
...
...
@@ -35,11 +35,25 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import
{
repositSchema
}
from
'./schema'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
searchBrandOptionEffect
,
searchCustomerCategoryOptionEffect
}
from
'./effects'
;
const
formActions
=
createFormActions
();
// 模拟请求
const
fetchData
=
async
(
params
:
any
)
=>
{
console
.
log
(
params
)
if
(
params
?.
category
)
{
formActions
.
getFieldState
(
'category'
,
state
=>
{
let
categorys
=
state
.
props
[
'x-component-props'
].
dataoption
params
.
category
=
categorys
.
filter
(
i
=>
i
.
id
===
params
.
category
)[
0
].
name
})
}
if
(
params
?.
brand
)
{
formActions
.
getFieldState
(
'brand'
,
state
=>
{
let
brands
=
state
.
props
[
'x-component-props'
].
dataoption
params
.
brand
=
brands
.
filter
(
i
=>
i
.
id
===
params
.
brand
)[
0
].
name
})
}
const
res
=
await
PublicApi
.
getWarehouseFreightSpaceList
(
params
);
return
res
.
data
;
};
...
...
@@ -190,6 +204,12 @@ const Repositories: React.FC<{}> = () => {
'name'
,
FORM_FILTER_PATH
,
);
FormEffectHooks
.
onFieldChange$
(
'brand'
).
subscribe
(
state
=>
{
searchBrandOptionEffect
(
actions
,
'brand'
)
})
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchCustomerCategoryOptionEffect
(
actions
,
'category'
)
})
}
}
schema=
{
repositSchema
}
/>
...
...
src/pages/repositories/schema/index.tsx
View file @
aeb92ad0
...
...
@@ -99,30 +99,60 @@ export const repositSchema: ISchema = padRequiredMessage({
placeholder
:
'商品名称'
}
},
category
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
fetchSearch
:
PublicApi
.
getProductSelectGetSelectCustomerCategory
,
placeholder
:
'请选择品类'
,
style
:
{
width
:
160
,
}
},
enum
:
[]
},
brand
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
fetchSearch
:
PublicApi
.
getProductSelectGetSelectBrand
,
placeholder
:
'请选择品牌'
,
style
:
{
width
:
160
}
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
placeholder
:
'商品品牌'
,
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'160px'
},
searchValue
:
null
,
dataoption
:
[],
},
enum
:
[]
},
category
:
{
type
:
'string'
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
placeholder
:
'商品品类'
,
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'160px'
},
searchValue
:
null
,
dataoption
:
[]
},
},
// category: {
// type: 'string',
// "x-component": 'SearchSelect',
// "x-component-props": {
// fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
// placeholder: '请选择品类',
// style: {
// width: 160,
// }
// },
// enum: []
// },
// brand: {
// type: 'string',
// "x-component": 'SearchSelect',
// "x-component-props": {
// fetchSearch: PublicApi.getProductSelectGetSelectBrand,
// placeholder: '请选择品牌',
// style: {
// width: 160
// }
// },
// enum: []
// },
}
},
submit
:
{
...
...
src/pages/transaction/components/orderProductTable/index.tsx
View file @
aeb92ad0
...
...
@@ -313,7 +313,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex
:
'memberPrice'
,
align
:
'center'
,
key
:
'memberPrice'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
+
'%'
)
:
null
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
100
+
'%'
)
:
null
},
{
title
:
creditsCommodity
?
'兑换数量'
:
'采购数量'
,
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
aeb92ad0
...
...
@@ -85,6 +85,7 @@ const warehouseColumns: any[] = [
const
modalPriceActions
=
createFormActions
()
// 总计金额联动框
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
const
{
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
orderProductRequests
=
[],
receiverAddressId
,
freight
,
amount
,
orderModel
}
=
dataSource
||
{}
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
...
...
@@ -107,7 +108,11 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
useEffect
(()
=>
{
if
(
changeTotal
){
// 执行修改订单运费
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
freePrice
,
type
:
2
})
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
freePrice
,
type
:
2
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
reloadFormData
()
}
})
}
},
[
amountMoney
])
...
...
@@ -291,7 +296,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
};
const
SaleOrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
(
props
)
=>
{
const
{
ctl
,
data
}
=
useContext
(
OrderDetailContext
)
const
{
ctl
,
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
page_type
}
=
usePageStatus
()
const
{
orderProductRequests
=
[],
orderModel
}
=
data
||
{}
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
...
...
@@ -351,7 +356,11 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
...
row
,
});
// 执行修改订单价格
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
data
.
id
,
orderDetailsId
:
row
.
id
,
price
:
row
.
price
,
type
:
1
})
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
data
.
id
,
orderDetailsId
:
row
.
id
,
price
:
row
.
price
,
type
:
1
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
reloadFormData
()
}
})
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
...
...
@@ -406,7 +415,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex
:
'memberPrice'
,
align
:
'center'
,
key
:
'memberPrice'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
+
'%'
)
:
null
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
100
+
'%'
)
:
null
},
{
title
:
creditsCommodity
?
'兑换数量'
:
'采购数量'
,
...
...
@@ -485,6 +494,9 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
currentRef=
{
warehouseRef
}
confirm=
{
()
=>
setWarehouseVisible
(
false
)
}
fetchTableData=
{
params
=>
fetchWarehouseData
(
params
)
}
resetModal=
{
{
destroyOnClose
:
true
}
}
/>
</
MellowCard
>
)
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
View file @
aeb92ad0
...
...
@@ -64,7 +64,7 @@ export const useSelfTable = () => {
},
{
title
:
'收货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 收货单号跳转
{
title
:
'
收货
单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
title
:
'
入库
单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
...
...
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