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
bddcdc38
Commit
bddcdc38
authored
Nov 26, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
94402b84
d7684fbd
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
148 additions
and
117 deletions
+148
-117
index.ts
src/constants/index.ts
+4
-2
index.tsx
...rvice/exchangeApplication/components/DetailInfo/index.tsx
+5
-5
verify.tsx
...vice/exchangeApplication/exchangePrConfirmBack/verify.tsx
+9
-11
verify.tsx
...rService/exchangeApplication/exchangePrDeliver/verify.tsx
+9
-11
verify.tsx
...Service/exchangeApplication/exchangePrFinished/verify.tsx
+11
-11
verify.tsx
...Service/exchangeApplication/exchangePrReceived/verify.tsx
+9
-11
index.tsx
...terService/exchangeManage/components/DetailInfo/index.tsx
+5
-4
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+1
-1
index.tsx
...ages/transaction/components/createElectronModal/index.tsx
+3
-2
index.tsx
...es/transaction/components/saleOrderProductTable/index.tsx
+12
-7
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+2
-1
useProductTable.tsx
...tion/purchaseOrder/orderCollect/model/useProductTable.tsx
+4
-1
index.tsx
src/pages/transaction/purchaseOrder/readyPayOrder/index.tsx
+5
-2
useSelfTable.tsx
...action/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
+38
-14
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+2
-6
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+2
-24
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+12
-4
type.ts
src/utils/type.ts
+15
-0
No files found.
src/constants/index.ts
View file @
bddcdc38
...
...
@@ -798,10 +798,12 @@ export const PurchaseOrderInsideWorkStateTexts = {
2
:
'一级待审核订单'
,
3
:
'二级待审核订单'
,
4
:
'待提交订单'
,
5
:
'待确认电子合同'
,
// 5: '待确认电子合同',
5
:
'提交订单完成'
,
6
:
'提交一级审核订单不通过'
,
7
:
'提交二级审核订单不通过'
,
8
:
'待支付订单'
,
// 8: '待支付订单',
8
:
'确认电子合同'
,
10
:
'支付成功'
,
11
:
'支付失败'
,
12
:
'待确认收货'
,
...
...
src/pages/afterService/exchangeApplication/components/DetailInfo/index.tsx
View file @
bddcdc38
...
...
@@ -20,7 +20,7 @@ import {
GetAsReplaceGoodsGetDetailByConsumerResponse
,
GetAsReplaceGoodsPageReturnedGoodsResponse
,
}
from
'@/services/AfterServiceApi'
;
import
{
CREDIT_INNER_STATUS
,
CREDIT_OUTER_STATUS
,
CREDIT_STATUS
}
from
'@/constants'
;
import
{
EXCHANGE_OUTER_STATUS_FINISHED
}
from
'@/constants'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -317,14 +317,14 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
Row
gutter=
{
24
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 相关不良原因举证附件 */
}
<
Suspense
fallback=
{
null
}
>
<
FileList
fileList=
{
detailInfo
?.
fileList
}
/>
</
Suspense
>
</
Col
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 退货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ReturnAddressInfo
...
...
@@ -346,7 +346,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
Suspense
>
</
Col
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 换货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ExchangeAddressInfo
...
...
@@ -368,7 +368,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
Suspense
>
</
Col
>
{
detailInfo
&&
detailInfo
.
evaluate
&&
(
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
&&
(
<
Col
span=
{
6
}
>
{
/* 售后评价 */
}
<
Suspense
fallback=
{
null
}
>
...
...
src/pages/afterService/exchangeApplication/exchangePrConfirmBack/verify.tsx
View file @
bddcdc38
...
...
@@ -15,17 +15,15 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
return
;
}
setSubmitLoading
(
true
);
// PublicApi.postPayCreditHandleVerifyStepOne({
// applyId: id,
// isPass: values.agree,
// opinion: values.reason,
// }).then(res => {
// if (res.code === 1000) {
// history.goBack();
// }
// }).finally(() => {
// setSubmitLoading(false);
// });
PublicApi
.
postAsReplaceGoodsConfirmAllReturnGoodsReceipt
({
dataId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
};
return
(
...
...
src/pages/afterService/exchangeApplication/exchangePrDeliver/verify.tsx
View file @
bddcdc38
...
...
@@ -17,17 +17,15 @@ const ExchangePrDeliverVerify: React.FC = () => {
return
;
}
setSubmitLoading
(
true
);
// PublicApi.postPayCreditHandleVerifyStepOne({
// applyId: id,
// isPass: values.agree,
// opinion: values.reason,
// }).then(res => {
// if (res.code === 1000) {
// history.goBack();
// }
// }).finally(() => {
// setSubmitLoading(false);
// });
PublicApi
.
postAsReplaceGoodsConfirmReturnDeliveryGoods
({
dataId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
};
const
handleVisible
=
flag
=>
{
...
...
src/pages/afterService/exchangeApplication/exchangePrFinished/verify.tsx
View file @
bddcdc38
...
...
@@ -23,17 +23,17 @@ const ExchangePrFinishedDetailVerify: React.FC = () => {
if
(
!
id
)
{
return
;
}
//
setConfirmLoading(true);
// PublicApi.postAsExchang
eGoodsConfirmComplete({
// repair
Id: id,
//
evaluate: values,
//
}).then(res => {
//
if (res.code === 1000) {
//
history.goBack();
//
}
//
}).finally(() => {
//
setConfirmLoading(false);
//
});
setConfirmLoading
(
true
);
PublicApi
.
postAsReplac
eGoodsConfirmComplete
({
replace
Id
:
id
,
evaluate
:
values
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
return
(
...
...
src/pages/afterService/exchangeApplication/exchangePrReceived/verify.tsx
View file @
bddcdc38
...
...
@@ -17,17 +17,15 @@ const ExchangePrReceivedVerify: React.FC = () => {
return
;
}
setSubmitLoading
(
true
);
// PublicApi.postPayCreditHandleVerifyStepOne({
// applyId: id,
// isPass: values.agree,
// opinion: values.reason,
// }).then(res => {
// if (res.code === 1000) {
// history.goBack();
// }
// }).finally(() => {
// setSubmitLoading(false);
// });
PublicApi
.
postAsReplaceGoodsConfirmReplaceReceiveGoods
({
dataId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
};
const
handleVisible
=
flag
=>
{
...
...
src/pages/afterService/exchangeManage/components/DetailInfo/index.tsx
View file @
bddcdc38
...
...
@@ -20,6 +20,7 @@ import {
GetAsReplaceGoodsGetDetailBySupplierResponse
,
GetAsReplaceGoodsPageReturnedGoodsResponse
,
}
from
'@/services/AfterServiceApi'
;
import
{
EXCHANGE_OUTER_STATUS_FINISHED
}
from
'@/constants'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -362,14 +363,14 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<
Row
gutter=
{
24
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 相关不良原因举证附件 */
}
<
Suspense
fallback=
{
null
}
>
<
FileList
fileList=
{
detailInfo
?.
fileList
}
/>
</
Suspense
>
</
Col
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 退货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ReturnAddressInfo
...
...
@@ -391,7 +392,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
Suspense
>
</
Col
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
evaluate
?
6
:
8
}
>
<
Col
span=
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
?
6
:
8
}
>
{
/* 换货收货地址 */
}
<
Suspense
fallback=
{
null
}
>
<
ExchangeAddressInfo
...
...
@@ -413,7 +414,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
Suspense
>
</
Col
>
{
detailInfo
&&
detailInfo
.
evaluate
&&
(
{
detailInfo
&&
detailInfo
.
outerStatus
===
EXCHANGE_OUTER_STATUS_FINISHED
&&
(
<
Col
span=
{
6
}
>
{
/* 售后评价 */
}
<
Suspense
fallback=
{
null
}
>
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
bddcdc38
...
...
@@ -111,7 +111,7 @@ const ProductImageForm: React.FC<{}> = (props) => {
setIsAllAttributePic
(
setImageType
)
_priceAttributeParams
=
priceAttributeParams
.
map
((
_item
,
_index
)
=>
{
let
_obj
=
{...
_item
,
goodsId
:
_item
.
goods
.
i
d
}
let
_obj
=
{...
_item
,
goodsId
:
_item
?.
goods
?.
id
||
_item
.
goodsI
d
}
_obj
.
commodityPic
=
maintainImageData
[
_index
]
||
[]
return
_obj
})
...
...
src/pages/transaction/components/createElectronModal/index.tsx
View file @
bddcdc38
...
...
@@ -189,8 +189,9 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
effects=
{
(
$
,
actions
)
=>
{
// $('onFormInit').subscribe(() =>
{
if
(
data
.
isElectronicContract
===
1
)
{
useAsyncSelect
(
'contractTemplateId'
,
async
()
=>
(
await
PublicApi
.
getOrderSelectListContractTemplate
()).
data
,
[
'name'
,
'id'
])
actions
.
setFieldValue
(
"contractTemplateId"
,
data
.
contractTemplateId
)
useAsyncSelect
(
'contractTemplateId'
,
async
()
=>
(
await
PublicApi
.
getOrderSelectListContractTemplate
()).
data
,
[
'name'
,
'id'
]).
then
(()
=>
{
actions
.
setFieldValue
(
"contractTemplateId"
,
data
.
contractTemplateId
)
})
}
else
{
actions
.
setFieldState
(
'usingElectronicContracts'
,
state
=>
{
state
.
value
=
0
...
...
src/pages/transaction/components/saleOrderProductTable/index.tsx
View file @
bddcdc38
...
...
@@ -95,20 +95,24 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
}
const
[
amountMoney
,
setAmountMoney
]
=
useState
<
number
>
(
amount
||
sum
+
freePrice
)
// useEffect(() => {
// const _sum = orderProductRequests.reduce((prev, next) => prev + Number((next.money || 0)), 0)
// setSum(_sum)
// }, [])
const
[
changeTotal
,
setChangeTotal
]
=
useState
<
boolean
>
(
false
)
// 是否改变总价
// 总计金额
useEffect
(()
=>
{
setAmountMoney
(()
=>
(
sum
*
1000
+
freePrice
*
1000
)
/
1000
)
},
[
sum
,
freePrice
])
useEffect
(()
=>
{
if
(
changeTotal
){
// 执行修改订单运费
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
dataSource
.
id
,
price
:
freePrice
,
type
:
2
})
}
},
[
amountMoney
])
const
handleConfirm
=
()
=>
{
setFreePrice
(
Number
(
modalPriceActions
.
getFieldValue
(
'freePrice'
)
||
0
))
modelRef
.
current
.
setVisible
(
false
)
setChangeTotal
(
true
)
}
useEffect
(()
=>
{
...
...
@@ -294,7 +298,6 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
warehouseRef
=
useRef
<
any
>
({})
// 判断是否可操作当前表格
console
.
log
(
SaleOrderInsideWorkStateTexts
[
data
.
purchaseOrderInteriorState
],
data
,
'data'
)
const
isEditData
=
SaleOrderInsideWorkStateTexts
[
data
.
purchaseOrderInteriorState
]
===
'待审核订单'
const
productComponents
=
{
body
:
{
...
...
@@ -338,12 +341,14 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
handleSave
=
row
=>
{
const
newData
=
[...
orderProductRequests
];
const
index
=
newData
.
findIndex
(
item
=>
row
.
key
===
item
.
key
);
const
index
=
newData
.
findIndex
(
item
=>
row
.
id
===
item
.
id
);
const
item
=
newData
[
index
];
newData
.
splice
(
index
,
1
,
{
...
item
,
...
row
,
});
// 执行修改订单价格
PublicApi
.
postOrderProductPriceUpdate
({
orderId
:
data
.
id
,
orderDetailsId
:
row
.
id
,
price
:
row
.
price
,
type
:
1
})
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
bddcdc38
...
...
@@ -30,6 +30,7 @@ import { changeRouterTitleByStatus } from '../../_public/order/utils'
import
{
ReadyAddOrderDetailContext
}
from
'../context'
import
AuditProcess
from
'@/components/AuditProcess'
import
styles
from
'./index.less'
import
{
toPoint
}
from
'@/utils/type'
export
interface
PurchaseOrderDetailProps
{}
...
...
@@ -180,7 +181,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
v
.
price
=
1
v
.
isMemberPrice
=
Number
(
v
.
isMemberPrice
)
v
.
memberPrice
=
parseI
nt
(
v
.
memberPrice
)
v
.
memberPrice
=
toPoi
nt
(
v
.
memberPrice
)
v
.
imgUrl
=
v
.
mainPic
v
.
minOrder
=
v
.
minOrder
// v.productId = v.id
...
...
src/pages/transaction/purchaseOrder/orderCollect/model/useProductTable.tsx
View file @
bddcdc38
...
...
@@ -5,6 +5,7 @@ import { productInfoColumns } from '../constant';
import
ProductTableCell
,
{
ProductEditableRow
}
from
'../components/productTableCell'
;
import
{
useModalTable
}
from
'./useModalTable'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
toPoint
}
from
'@/utils/type'
;
export
const
getUnitPriceTotal
=
(
record
)
=>
{
const
purchaseCount
=
Number
(
record
[
'purchaseCount'
])
||
0
...
...
@@ -27,7 +28,9 @@ export const getUnitPriceTotal = (record) => {
return
false
}
})
return
unitPrice
*
purchaseCount
// 考虑会员折扣
let
memberPrice
=
record
?.
memberPrice
?
toPoint
(
record
.
memberPrice
)
:
1
return
unitPrice
*
purchaseCount
*
memberPrice
}
export
const
useProductTable
=
(
ctx
:
ISchemaFormActions
|
ISchemaFormAsyncActions
)
=>
{
const
productRef
=
useRef
<
any
>
({})
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/index.tsx
View file @
bddcdc38
import
React
from
'react'
import
React
,
{
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
}
from
'antd'
import
{
StandardTable
}
from
'god'
...
...
@@ -24,14 +24,17 @@ const fetchTableData = async (params) => {
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
refTable
=
useRef
<
any
>
({})
const
{
columns
}
=
useSelfTable
()
}
=
useSelfTable
(
refTable
)
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
ref=
{
refTable
}
columns=
{
columns
}
rowKey=
{
'orderNo'
}
formilyLayouts=
{
{
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
View file @
bddcdc38
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
,
Progress
}
from
'antd'
import
{
Button
,
Row
,
Col
,
Progress
,
Popconfirm
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
...
...
@@ -49,8 +49,18 @@ const CircleChart = props => {
}
// 业务hooks, 待支付订单
export
const
useSelfTable
=
()
=>
{
export
const
useSelfTable
=
(
props
)
=>
{
const
{
refTable
}
=
props
const
ref
=
useRef
<
any
>
({})
const
handleCancel
=
(
param
)
=>
{
PublicApi
.
postOrderPurchaseOrderCancel
({
id
:
param
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
refTable
.
current
.
reload
()
}
})
}
const
payOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
...
...
@@ -124,27 +134,41 @@ export const useSelfTable = () => {
title
:
'当前支付'
,
align
:
'center'
,
dataIndex
:
'currentPayments'
,
width
:
140
,
render
:
(
text
,
record
)
=>
<>
<
Row
justify=
'space-between'
>
<
Col
>
{
record
.
currentPayments
}
/
{
record
.
sum
}
</
Col
>
<
Col
>
{
/*
<Col>
{
record.currentPayments !== record.sum &&
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
}
</
Col
>
</Col>
*/
}
</
Row
>
<
Progress
percent=
{
Math
.
ceil
(
record
.
currentPayments
/
record
.
sum
)
}
showInfo=
{
false
}
/>
</>
},
// {
// title: '操作',
// align: 'center',
// dataIndex: 'ctl',
// key: 'ctl',
// render: (text, record) => <>
// <Button type='link' onClick={() => handleConfirm(record)}>支付</Button>
// <Button type='link' onClick={() => handleCancel(record.id)}>取消订单</Button>
// </>
// }
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
record
.
currentPayments
!==
record
.
sum
&&
(
record
.
externalState
===
PurchaseOrderOutWorkState
.
PAY_ORDER
||
record
.
externalState
===
PurchaseOrderOutWorkState
.
CONFIRM_NOT_ARRIVED_ACCOUNT
)
&&
<
Link
to=
{
`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`
}
>
去支付
</
Link
>
}
{
(
record
.
externalState
===
PurchaseOrderOutWorkState
.
PAY_ORDER
&&
!
record
.
signatureLogId
||
record
.
externalState
===
PurchaseOrderOutWorkState
.
CONFIRM_NOT_ARRIVED_ACCOUNT
)
&&
<
Popconfirm
title=
"是否要取消该订单?"
onConfirm=
{
()
=>
handleCancel
(
record
.
id
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
'link'
>
取消订单
</
Button
>
</
Popconfirm
>
}
</>
}
]
return
{
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
bddcdc38
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-25 1
6:29:06
* @LastEditTime: 2020-11-25 1
7:25:55
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -314,7 +314,7 @@ const getParams = type => {
},
tableProps
:
{
rowKey
:
'orderNo'
,
lableKey
:
''
,
lableKey
:
'
orderNo
'
,
},
};
...
...
@@ -325,7 +325,6 @@ const getParams = type => {
basicParams
.
columns
=
purchaseOrderColumns
;
basicParams
.
fetchTableData
=
fetchOrderPurchaseReceiptAddList
;
basicParams
.
formilyProps
.
ctx
.
schema
=
purchaseOrderBillSchema
;
basicParams
.
tableProps
.
lableKey
=
'orderNo'
;
break
;
}
...
...
@@ -335,7 +334,6 @@ const getParams = type => {
basicParams
.
columns
=
salesOrderColumns
;
basicParams
.
fetchTableData
=
getOrderSalesInvoiceOrderList
;
basicParams
.
formilyProps
.
ctx
.
schema
=
purchaseOrderBillSchema
;
// 这里用同一个 schema 是因为接口参数名是一样的,后台做了处理
basicParams
.
tableProps
.
lableKey
=
'orderNo'
;
break
;
}
...
...
@@ -345,7 +343,6 @@ const getParams = type => {
basicParams
.
columns
=
machiningWarehousingColumns
;
basicParams
.
fetchTableData
=
getMachiningWarehousingList
;
basicParams
.
formilyProps
.
ctx
.
schema
=
machiningWarehousingBillSchema
;
basicParams
.
tableProps
.
lableKey
=
'noticeNo'
;
break
;
}
...
...
@@ -355,7 +352,6 @@ const getParams = type => {
basicParams
.
columns
=
machiningDeliveryColumns
;
basicParams
.
fetchTableData
=
getMachiningDeliveryList
;
basicParams
.
formilyProps
.
ctx
.
schema
=
machiningDeliveryBillSchema
;
basicParams
.
tableProps
.
lableKey
=
'noticeNo'
;
break
;
}
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
bddcdc38
...
...
@@ -97,28 +97,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
},
]
// 获取品牌
const
fetchBrand
=
async
()
=>
{
const
res
=
await
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
''
,
});
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
}
// 获取会员品类
const
fetchCustomerCategory
=
async
()
=>
{
const
res
=
await
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
''
,
});
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
[];
}
// 获取单据详情
const
getBillInfo
=
()
=>
{
if
(
!
id
)
{
...
...
@@ -660,6 +638,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
produceNoticeOrderDetailId
:
extraData
.
id
,
orderNo
:
extraData
.
orderNo
,
processNum
:
extraData
.
processNum
,
productName
:
extraData
.
productName
,
storageCount
:
productCount
,
};
}),
...
...
@@ -709,6 +688,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
produceNoticeOrderDetailId
:
extraData
.
id
,
orderNo
:
extraData
.
orderNo
,
processNum
:
extraData
.
processNum
,
productName
:
extraData
.
productName
,
shipmentQuantity
:
productCount
,
};
}),
...
...
@@ -902,8 +882,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
'name'
,
FORM_FILTER_PATH
,
);
useAsyncSelect
(
'brandId'
,
fetchBrand
,
[
'name'
,
'id'
]);
useAsyncSelect
(
'customerCategoryId'
,
fetchCustomerCategory
,
[
'name'
,
'id'
]);
},
inline
:
false
,
}
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
bddcdc38
...
...
@@ -18,6 +18,7 @@ import {
DEPENDENT_DOC_INTERNAL
,
}
from
'@/constants'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
orderDetailSchema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -777,18 +778,25 @@ export const goodsSearchSchema: ISchema = {
},
},
customerCategoryId
:
{
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'SearchSelect'
,
'x-component-props'
:
{
placeholder
:
'品类'
,
allowClear
:
true
,
fetchSearch
:
PublicApi
.
getProductSelectGetSelectCustomerCategory
,
style
:
{
width
:
'100%'
,
}
},
},
brandId
:
{
type
:
'string'
,
enum
:
[]
,
'x-component'
:
'SearchSelect'
,
'x-component-props'
:
{
placeholder
:
'品牌'
,
allowClear
:
true
,
fetchSearch
:
PublicApi
.
getProductSelectGetSelectBrand
,
style
:
{
width
:
'100%'
,
}
},
},
submit
:
{
...
...
src/utils/type.ts
View file @
bddcdc38
export
function
isString
(
str
:
any
):
str
is
string
{
return
typeof
str
===
'string'
}
// 分数转小数
export
const
toPoint
=
(
percent
:
string
)
=>
{
let
str
:
any
=
percent
.
replace
(
"%"
,
""
);
str
=
str
/
100
;
return
str
;
}
// 小数转分数
export
const
toPercent
=
(
point
:
number
)
=>
{
let
str
=
Number
(
point
*
100
).
toFixed
(
1
);
str
+=
"%"
;
return
str
;
}
\ No newline at end of file
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