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
eb662144
Commit
eb662144
authored
Jan 05, 2021
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
7a9592eb
04a3136b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
219 additions
and
155 deletions
+219
-155
index.ts
src/constants/index.ts
+2
-2
global.less
src/global/styles/global.less
+1
-1
useBusinessEffects.ts
...components/ReturnInfoDrawer/effects/useBusinessEffects.ts
+65
-64
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+7
-2
index.ts
.../afterService/components/ReturnInfoDrawer/schema/index.ts
+0
-0
useBusinessEffects.ts
...mit/components/ExchangeForm/effects/useBusinessEffects.ts
+1
-1
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+23
-23
useBusinessEffects.ts
...ubmit/components/RepairForm/effects/useBusinessEffects.ts
+1
-1
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+20
-21
useBusinessEffects.ts
...ubmit/components/ReturnForm/effects/useBusinessEffects.ts
+1
-1
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+31
-30
info.tsx
src/pages/balance/settleRules/memberSettle/info.tsx
+1
-1
index.tsx
src/pages/home/components/UserCenter/index.tsx
+1
-1
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+27
-1
index.tsx
src/pages/member/memberLevel/components/DetailInfo/index.tsx
+0
-0
index.tsx
src/pages/payandSettle/creditManage/quotaMenage/index.tsx
+3
-3
billsDetail.tsx
src/pages/transaction/stockSellStorage/bills/billsDetail.tsx
+4
-0
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+27
-3
editBills.tsx
src/pages/transaction/stockSellStorage/bills/editBills.tsx
+4
-0
No files found.
src/constants/index.ts
View file @
eb662144
...
...
@@ -1855,7 +1855,7 @@ export const PAY_CHANNEL_UNION = 3;
*/
export
const
PAY_CHANNEL_BALANCE
=
4
;
/**
* 线下支付
* 线下支付
线上确认
*/
export
const
PAY_CHANNEL_OFFLINE
=
5
;
/**
...
...
@@ -1875,7 +1875,7 @@ export const PAY_CHANNEL = {
[
PAY_CHANNEL_WECHAT
]:
'微信'
,
[
PAY_CHANNEL_UNION
]:
'银联'
,
[
PAY_CHANNEL_BALANCE
]:
'余额'
,
[
PAY_CHANNEL_OFFLINE
]:
'线下支付'
,
[
PAY_CHANNEL_OFFLINE
]:
'线下支付
线上确认
'
,
[
PAY_CHANNEL_CREDIT
]:
'授信'
,
[
PAY_CHANNEL_COD
]:
'货到付款'
,
};
src/global/styles/global.less
View file @
eb662144
...
...
@@ -359,6 +359,6 @@ a {
}
}
.
ant-form-horizontal .ant-form-item-control
{
.
mega-layout-container-content
{
overflow: hidden;
}
src/pages/afterService/components/ReturnInfoDrawer/effects/useBusinessEffects.ts
View file @
eb662144
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-08 09:53:29
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
{
onFieldInputChange$
,
onFieldValueChange$
,
}
=
FormEffectHooks
;
export
const
useBusinessEffects
=
(
context
,
actions
)
=>
{
const
{
getFieldValue
,
setFieldValue
,
getFieldState
,
setFieldState
,
}
=
actions
;
const
linkage
=
useLinkageUtils
();
// 联动退款金额
onFieldValueChange$
(
'payList.*.refundAmount'
).
subscribe
(
fieldState
=>
{
const
payListValue
=
getFieldValue
(
'payList'
);
const
amount
=
payListValue
.
reduce
((
pre
,
now
)
=>
+
now
.
refundAmount
+
pre
,
0
);
setFieldValue
(
'refundAmount'
,
amount
);
});
// 退款数量 联动,支付信息里边的 退款金额
onFieldInputChange$
(
'returnCount'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
const
purchasePriceValue
=
getFieldValue
(
'purchasePrice'
);
const
newData
=
[...
getFieldValue
(
'payList'
)].
map
(
item
=>
{
return
{
...
item
,
refundAmount
:
+
(
+
value
*
purchasePriceValue
*
(
item
.
payRatio
/
100
)).
toFixed
(
2
),
};
});
setFieldValue
(
'payList'
,
newData
);
});
// 校验退货数量
onFieldInputChange$
(
'returnCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
// 采购数量
const
purchaseCountValue
=
getFieldValue
(
'purchaseCount'
);
setFieldState
(
'returnCount'
,
state
=>
{
if
(
+
value
>
purchaseCountValue
)
{
state
.
errors
=
'填写值已超过最大可退货数量,请重新填写'
;
}
else
{
state
.
errors
=
''
;
}
}
);
});
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
1-01-05 13:53:58
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
{
onFieldInputChange$
,
onFieldValueChange$
,
}
=
FormEffectHooks
;
export
const
useBusinessEffects
=
(
context
,
actions
)
=>
{
const
{
getFieldValue
,
setFieldValue
,
getFieldState
,
setFieldState
,
}
=
actions
;
const
linkage
=
useLinkageUtils
();
// 联动退款金额
onFieldValueChange$
(
'payList.*.refundAmount'
).
subscribe
(
fieldState
=>
{
const
payListValue
=
getFieldValue
(
'payList'
);
const
amount
=
payListValue
.
reduce
((
pre
,
now
)
=>
+
now
.
refundAmount
+
pre
,
0
);
setFieldValue
(
'refundAmount'
,
amount
);
});
// 退款数量 联动,支付信息里边的 退款金额
onFieldInputChange$
(
'returnCount'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
const
purchasePriceValue
=
getFieldValue
(
'purchasePrice'
);
const
newData
=
[...
getFieldValue
(
'payList'
)].
map
(
item
=>
{
return
{
...
item
,
refundAmount
:
+
(
+
value
*
purchasePriceValue
*
(
item
.
payRatio
/
100
)).
toFixed
(
2
),
};
});
setFieldValue
(
'payList'
,
newData
);
});
// 校验退货数量
onFieldInputChange$
(
'returnCount'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
// 采购数量
const
remainingValue
=
getFieldValue
(
'remaining'
);
setFieldState
(
'returnCount'
,
state
=>
{
if
(
+
value
>
remainingValue
)
{
state
.
errors
=
'填写值已超过最大可退货数量,请重新填写'
;
}
else
{
state
.
errors
=
''
;
}
}
);
});
}
\ No newline at end of file
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
eb662144
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-21 11:13
:21
* @LastEditTime: 202
1-01-05 13:51
:21
* @Description: 查看退货数量与退款金额 抽屉
*/
import
React
from
'react'
;
...
...
@@ -94,6 +94,10 @@ export interface OrderInfo {
*/
payList
:
PayListItem
;
/**
* 剩余可退货数量
*/
remaining
:
number
;
/**
* 退款数量
*/
returnCount
?:
number
|
string
;
...
...
@@ -130,7 +134,8 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
const
handleSubmit
=
values
=>
{
if
(
onSubmit
)
{
onSubmit
(
values
);
const
{
remaining
,
...
rest
}
=
values
;
onSubmit
(
rest
);
}
else
{
onClose
();
}
...
...
src/pages/afterService/components/ReturnInfoDrawer/schema/index.ts
View file @
eb662144
This diff is collapsed.
Click to expand it.
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/effects/useBusinessEffects.ts
View file @
eb662144
...
...
@@ -58,7 +58,7 @@ export const useBusinessEffects = (context, actions) => {
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`replaceGoodsList.
${
$1
}
.extraData`
}),
state
=>
state
.
value
.
re
placedCount
,
state
=>
state
.
value
.
re
maining
,
);
setFieldState
(
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
eb662144
...
...
@@ -5,6 +5,7 @@ import { DeleteOutlined } from '@ant-design/icons';
import
{
Radio
,
ArrayTable
}
from
'@formily/antd-components'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
import
{
findLastIndex
}
from
'lodash'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
...
...
@@ -251,7 +252,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
data
:
goodsDetailList
.
map
(
item
=>
({
...
item
,
extraData
:
{
re
placedCount
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
re
maining
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
id
:
item
.
orderRecordId
,
taskType
,
},
...
...
@@ -426,30 +427,29 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const
value
=
[];
values
.
forEach
(
item
=>
{
const
existing
=
preValues
.
find
(
val
=>
val
.
id
===
item
.
id
);
const
atom
=
existing
?
existing
:
{
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchasePrice
:
item
.
price
,
purchaseCount
:
item
.
purchaseCount
,
purchaseAmount
:
+
(
item
.
price
*
item
.
purchaseCount
).
toFixed
(
2
),
replaceReason
:
''
,
extraData
:
{
replacedCount
:
item
.
replaceCount
||
item
.
purchaseCount
||
0
,
// 已换货数量
id
:
item
.
id
,
taskType
:
item
.
processEnum
,
},
};
const
atom
=
{
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchasePrice
:
item
.
price
,
purchaseCount
:
item
.
purchaseCount
,
purchaseAmount
:
+
(
item
.
price
*
item
.
purchaseCount
).
toFixed
(
2
),
replaceReason
:
''
,
extraData
:
{
remaining
:
item
.
purchaseCount
-
(
item
.
replaceCount
||
0
),
// 可换货数量
id
:
item
.
id
,
taskType
:
item
.
processEnum
,
},
};
value
.
push
(
atom
);
});
addSchemaAction
.
setFieldValue
(
'replaceGoodsList'
,
value
);
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
addSchemaAction
.
setFieldValue
(
'replaceGoodsList'
,
newData
);
};
const
handleGoodsChange
=
values
=>
{
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/effects/useBusinessEffects.ts
View file @
eb662144
...
...
@@ -35,7 +35,7 @@ export const useBusinessEffects = (context, actions) => {
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`repairGoodsList.
${
$1
}
.extraData`
}),
state
=>
state
.
value
.
re
pairedCount
,
state
=>
state
.
value
.
re
maining
,
);
setFieldState
(
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
eb662144
...
...
@@ -4,6 +4,7 @@ import { DeleteOutlined } from '@ant-design/icons';
import
{
Radio
,
ArrayTable
}
from
'@formily/antd-components'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
import
{
findLastIndex
}
from
'lodash'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
...
...
@@ -129,7 +130,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
extraData
:
{
id
:
item
.
orderRecordId
,
orderId
:
item
.
orderId
,
re
pairedCount
:
item
.
purchaseCount
||
0
,
// 已维修数量,这里取 采购数量判断即可
re
maining
:
item
.
purchaseCount
||
0
,
// 已维修数量,这里取 采购数量判断即可
},
})),
totalCount
:
res
.
data
.
totalCount
,
...
...
@@ -271,28 +272,26 @@ const RepairForm: React.FC<BillsFormProps> = ({
const
value
=
[];
values
.
forEach
(
item
=>
{
const
existing
=
preValues
.
find
(
val
=>
val
.
id
===
item
.
id
);
const
atom
=
existing
?
existing
:
{
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchaseCount
:
item
.
purchaseCount
,
repairReason
:
''
,
extraData
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
repairedCount
:
item
.
repairCount
||
item
.
purchaseCount
||
0
,
// 已维修数量
},
};
const
atom
=
{
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchaseCount
:
item
.
purchaseCount
,
repairReason
:
''
,
extraData
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
remaining
:
item
.
purchaseCount
-
(
item
.
repairCount
||
0
),
// 可维修数量
},
};
value
.
push
(
atom
);
});
addSchemaAction
.
setFieldValue
(
'repairGoodsList'
,
value
);
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
addSchemaAction
.
setFieldValue
(
'repairGoodsList'
,
newData
);
};
const
handleGoodsChange
=
values
=>
{
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/effects/useBusinessEffects.ts
View file @
eb662144
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-12-09 16:18:4
5
* @LastEditTime: 202
1-01-05 11:40:3
5
* @Description: 联动逻辑相关
*/
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
eb662144
...
...
@@ -5,6 +5,7 @@ import { DeleteOutlined } from '@ant-design/icons';
import
{
Radio
,
ArrayTable
}
from
'@formily/antd-components'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
import
{
findLastIndex
}
from
'lodash'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
...
...
@@ -60,7 +61,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
});
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
...
...
@@ -89,6 +89,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
title
:
'下单时间'
,
dataIndex
:
'createTime'
,
align
:
'center'
,
render
:
text
=>
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
},
{
title
:
'订单状态'
,
...
...
@@ -252,7 +253,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
setReturnGoodsList
({
data
:
goodsDetailList
.
map
(
item
=>
({
...
item
,
re
turnedCount
:
item
.
purchaseCount
||
0
,
// 已
退货数量,这里取 采购数量判断即可
re
maining
:
item
.
purchaseCount
||
0
,
// 可
退货数量,这里取 采购数量判断即可
extraData
:
{
returnReason
:
item
.
returnReason
,
payList
:
item
.
payList
||
[],
...
...
@@ -448,36 +449,35 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
value
=
[];
values
.
forEach
(
item
=>
{
const
existing
=
preValues
.
find
(
val
=>
val
.
extraData
.
id
===
item
.
id
);
const
atom
=
existing
?
existing
:
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchasePrice
:
item
.
price
,
purchaseCount
:
item
.
purchaseCount
,
purchaseAmount
:
+
(
item
.
price
*
item
.
purchaseCount
).
toFixed
(
2
),
returnedCount
:
item
.
returnCount
||
item
.
purchaseCount
||
0
,
// 已退货数量
payAmount
:
item
.
payAmount
,
returnCount
:
''
,
refundAmount
:
''
,
extraData
:
{
id
:
item
.
id
,
returnReason
:
''
,
payList
:
item
.
payList
,
taskType
:
item
.
processEnum
,
},
};
const
atom
=
{
id
:
item
.
id
,
orderId
:
item
.
orderId
,
orderNo
:
item
.
orderNo
,
productId
:
item
.
productId
,
productName
:
item
.
productName
,
category
:
item
.
category
,
brand
:
item
.
brand
,
unit
:
item
.
unit
,
purchasePrice
:
item
.
price
,
purchaseCount
:
item
.
purchaseCount
,
purchaseAmount
:
+
(
item
.
price
*
item
.
purchaseCount
).
toFixed
(
2
),
payAmount
:
item
.
payAmount
,
returnCount
:
''
,
refundAmount
:
''
,
extraData
:
{
id
:
item
.
id
,
returnReason
:
''
,
payList
:
item
.
payList
,
taskType
:
item
.
processEnum
,
remaining
:
item
.
purchaseCount
-
(
item
.
returnCount
||
0
),
// 可退货数量
},
};
value
.
push
(
atom
);
});
addSchemaAction
.
setFieldValue
(
'returnGoodsList'
,
value
);
const
concated
=
[...
value
,
...
preValues
];
const
newData
=
concated
.
filter
((
item
,
index
)
=>
findLastIndex
(
concated
,
val
=>
val
.
extraData
.
id
===
item
.
extraData
.
id
)
===
index
).
reverse
();
addSchemaAction
.
setFieldValue
(
'returnGoodsList'
,
newData
);
};
const
handleGoodsChange
=
values
=>
{
...
...
@@ -493,6 +493,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
index
,
...
item
,
payList
:
item
.
extraData
.
payList
,
remaining
:
item
.
extraData
.
remaining
,
});
setVisibleReturnInfoDrawer
(
true
)
};
...
...
src/pages/balance/settleRules/memberSettle/info.tsx
View file @
eb662144
...
...
@@ -279,7 +279,7 @@ const MemberSettleAdd: React.FC = () => {
}
/>
</
Card
>
<
Prompt
when=
{
unsaved
}
message=
"内容还没保存,确定离开吗?"
/>
<
Prompt
when=
{
unsaved
&&
(
isAdd
||
isEdit
)
}
message=
"内容还没保存,确定离开吗?"
/>
</
PageHeaderWrapper
>
)
}
...
...
src/pages/home/components/UserCenter/index.tsx
View file @
eb662144
...
...
@@ -42,7 +42,7 @@ const UserCenter: React.FC<Iprops> = (props) => {
// const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL);
// const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL);
const
currentRole
=
userAuth
?.
roles
?.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
?.
logo
})
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
?.
logo
})
if
(
!
userAuth
)
{
return
null
}
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
eb662144
...
...
@@ -861,11 +861,37 @@ const CommodityDetail = (props) => {
*/
const
getAmount
=
(
state
=
true
)
=>
{
const
unitPrice
=
getUnitPrice
()
const
amount
=
unitPrice
*
(
Number
(
buyCount
)
||
0
)
const
amount
=
accMul
(
unitPrice
,
buyCount
)
return
state
?
priceFormat
(
amount
)
:
amount
}
/**
** 乘法函数,用来得到精确的乘法结果
** 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
** 调用:accMul(arg1,arg2)
** 返回值:arg1乘以 arg2的精确结果
**/
const
accMul
=
(
arg1
:
number
,
arg2
:
number
)
=>
{
if
(
!
arg1
||
!
arg2
){
return
0
}
let
m
=
0
const
s1
=
arg1
.
toString
()
const
s2
=
arg2
.
toString
()
try
{
m
+=
s1
.
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
console
.
log
(
e
)
}
try
{
m
+=
s2
.
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
console
.
log
(
e
)
}
return
Number
(
s1
.
replace
(
"."
,
""
))
*
Number
(
s2
.
replace
(
"."
,
""
))
/
Math
.
pow
(
10
,
m
);
}
/**
* 获取金额区间中数量最大的区间
*/
const
getMaxCountRange
=
()
=>
{
...
...
src/pages/member/memberLevel/components/DetailInfo/index.tsx
View file @
eb662144
This diff is collapsed.
Click to expand it.
src/pages/payandSettle/creditManage/quotaMenage/index.tsx
View file @
eb662144
...
...
@@ -289,9 +289,9 @@ const QuotaMenage: React.FC = () => {
}
=
data
;
return
{
level
:
memberTypes
.
map
(
item
=>
({
label
:
item
.
memberTypeName
,
value
:
item
.
memberTypeId
})),
memberTyp
eId
:
roles
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})),
subRoleId
:
levels
.
map
(
item
=>
({
label
:
item
.
levelTag
,
value
:
item
.
level
})),
memberTypeId
:
memberTypes
.
map
(
item
=>
({
label
:
item
.
memberTypeName
,
value
:
item
.
memberTypeId
})),
subRol
eId
:
roles
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})),
level
:
levels
.
map
(
item
=>
({
label
:
item
.
levelTag
,
value
:
item
.
level
})),
};
}
return
{};
...
...
src/pages/transaction/stockSellStorage/bills/billsDetail.tsx
View file @
eb662144
...
...
@@ -5,6 +5,8 @@ import BillsForm from './components/BillsForm';
const
BillsDetail
:
React
.
FC
=
()
=>
{
const
{
id
,
deliveryNo
=
0
,
storageNo
=
0
,
invoicesTypeId
,
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
...
...
@@ -13,6 +15,8 @@ const BillsDetail: React.FC = () => {
return
(
<
BillsForm
id=
{
id
}
deliveryNo=
{
deliveryNo
}
storageNo=
{
storageNo
}
invoicesTypeId=
{
invoicesTypeId
}
relevanceInvoices=
{
relevanceInvoices
}
relevanceInvoicesId=
{
relevanceInvoicesId
}
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
eb662144
...
...
@@ -44,13 +44,33 @@ const {
}
=
FormEffectHooks
;
interface
BillsFormProps
{
/**
* 单据id
*/
id
?:
string
;
/**
* 发货单号
*/
deliveryNo
?:
number
;
/**
* 入库单号
*/
storageNo
?:
number
;
validateId
?:
string
;
// 是否是编辑的
isEdit
?:
boolean
;
invoicesTypeId
:
string
;
// 单据类型ID
relevanceInvoices
:
string
;
// 对应单据
relevanceInvoicesId
:
string
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
/**
* 单据类型ID
*/
invoicesTypeId
:
string
;
/**
* 对应单据
*/
relevanceInvoices
:
string
;
/**
* 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
*/
relevanceInvoicesId
:
string
;
};
function
transforDirection
(
type
)
{
...
...
@@ -72,6 +92,8 @@ function transforDirection(type) {
const
BillsForm
:
React
.
FC
<
BillsFormProps
>
=
({
id
,
deliveryNo
=
0
,
storageNo
=
0
,
isEdit
=
false
,
invoicesTypeId
,
relevanceInvoices
,
...
...
@@ -143,6 +165,8 @@ const BillsForm: React.FC<BillsFormProps> = ({
setInfoLoading
(
true
);
PublicApi
.
getWarehouseInvoicesDetails
({
invoicesId
:
id
,
deliveryNo
,
storageNo
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
...
...
src/pages/transaction/stockSellStorage/bills/editBills.tsx
View file @
eb662144
...
...
@@ -5,6 +5,8 @@ import BillsForm from './components/BillsForm';
const
EditBills
:
React
.
FC
=
()
=>
{
const
{
id
,
deliveryNo
=
0
,
storageNo
=
0
,
invoicesTypeId
,
// 单据类型ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
...
...
@@ -13,6 +15,8 @@ const EditBills: React.FC = () => {
return
(
<
BillsForm
id=
{
id
}
deliveryNo=
{
deliveryNo
}
storageNo=
{
storageNo
}
invoicesTypeId=
{
invoicesTypeId
}
relevanceInvoices=
{
relevanceInvoices
}
relevanceInvoicesId=
{
relevanceInvoicesId
}
...
...
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