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
f6c028ac
Commit
f6c028ac
authored
Jan 27, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'featStrategies' into dev
parents
16ce4590
c3ce66d1
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
336 additions
and
285 deletions
+336
-285
useHttpRequest.ts
src/hooks/useHttpRequest.ts
+4
-5
setPrice.tsx
src/pages/commodity/products/addChannelItem/setPrice.tsx
+1
-1
otherForm.tsx
src/pages/commodity/products/addProductsItem/otherForm.tsx
+2
-0
index.tsx
src/pages/priceManage/constant/index.tsx
+3
-3
MemberModal.tsx
...pages/priceManage/priceStrategy/component/MemberModal.tsx
+3
-2
PriceModal.tsx
src/pages/priceManage/priceStrategy/component/PriceModal.tsx
+1
-1
PriceSetting.tsx
...ages/priceManage/priceStrategy/component/PriceSetting.tsx
+7
-0
ProductModal.tsx
...ages/priceManage/priceStrategy/component/ProductModal.tsx
+9
-1
index.tsx
src/pages/priceManage/priceStrategy/index.tsx
+7
-2
index.tsx
src/pages/priceManage/schema/index.tsx
+1
-1
index.tsx
...pages/transaction/components/approvedOrderModal/index.tsx
+17
-1
index.tsx
...ages/transaction/components/createElectronModal/index.tsx
+3
-3
index.tsx
...pages/transaction/components/orderElectronModal/index.tsx
+19
-4
index.tsx
src/pages/transaction/components/orderMergeInfo/index.tsx
+0
-2
index.tsx
src/pages/transaction/components/orderPayModal/index.tsx
+5
-2
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+1
-0
index.tsx
...ges/transaction/components/orderTransformRecord/index.tsx
+9
-11
useSelfTable.tsx
...aseOrder/addPurchaseWarehouseOrder/model/useSelfTable.tsx
+126
-126
index.ts
...ages/transaction/purchaseOrder/orderCollect/apis/index.ts
+1
-1
index.tsx
...der/orderCollect/components/simpleElectronModal/index.tsx
+2
-3
index.tsx
...aseOrder/orderCollect/components/theInvoiceList/index.tsx
+5
-6
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+2
-2
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+3
-3
index.tsx
.../transaction/purchaseOrder/readyPayOrder/detail/index.tsx
+1
-0
useSelfTable.tsx
...tion/saleOrder/addSaleDelevedOrder/model/useSelfTable.tsx
+1
-1
index.ts
...transaction/saleOrder/addSaleDelevedOrder/schema/index.ts
+1
-1
index.ts
.../transaction/saleOrder/firstApprovedOrder/schema/index.ts
+1
-1
useSelfTable.tsx
...n/saleOrder/readyAddLogisticsOrder/model/useSelfTable.tsx
+1
-1
index.ts
...nsaction/saleOrder/readyAddLogisticsOrder/schema/index.ts
+1
-1
index.ts
.../transaction/saleOrder/readyApprovedOrder/schema/index.ts
+1
-1
useSelfTable.tsx
...saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
+1
-1
index.ts
...action/saleOrder/readyConfirmDelevedOrder/schema/index.ts
+1
-1
index.tsx
.../transaction/saleOrder/readyConfirmOrder/detail/index.tsx
+90
-91
index.ts
...s/transaction/saleOrder/readyConfirmOrder/schema/index.ts
+1
-1
useSelfTable.tsx
.../saleOrder/readyConfirmReturnOrder/model/useSelfTable.tsx
+1
-1
index.ts
...saction/saleOrder/readyConfirmReturnOrder/schema/index.ts
+1
-1
index.ts
...ages/transaction/saleOrder/readyPayResult/schema/index.ts
+1
-1
index.ts
...transaction/saleOrder/readyReturnDocument/schema/index.ts
+1
-1
index.ts
...transaction/saleOrder/secondApprovedOrder/schema/index.ts
+1
-1
No files found.
src/hooks/useHttpRequest.ts
View file @
f6c028ac
...
...
@@ -5,7 +5,7 @@ export interface IHttpRequestReturn<T> {
data
:
T
|
null
,
loading
:
boolean
,
err
:
any
,
run
(
params
?:
any
)
run
(
params
?:
any
,
config
?:
any
)
}
export
interface
useHttpRequestConfig
extends
IApiRequest
{
...
...
@@ -20,10 +20,10 @@ export function useHttpRequest<T>(api: (params?, config?) => Promise<T>, selfCon
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
data
,
setData
]
=
useState
<
T
|
null
>
(
null
)
const
[
err
,
setErr
]
=
useState
()
const
run
=
(
params
)
=>
{
const
run
=
(
params
,
config
?
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setLoading
(
true
)
api
(
params
).
then
((
res
:
any
)
=>
{
api
(
params
,
config
).
then
((
res
:
any
)
=>
{
setData
(
res
.
data
)
resolve
(
res
)
}).
catch
(
err
=>
{
...
...
@@ -43,4 +43,4 @@ export function useHttpRequest<T>(api: (params?, config?) => Promise<T>, selfCon
err
,
run
}
}
\ No newline at end of file
}
src/pages/commodity/products/addChannelItem/setPrice.tsx
View file @
f6c028ac
...
...
@@ -303,7 +303,7 @@ const SetPrice:React.FC<IProps> = (props) => {
},
[]
)
let
result
=
range
.
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
callback
()
}
...
...
src/pages/commodity/products/addProductsItem/otherForm.tsx
View file @
f6c028ac
...
...
@@ -53,6 +53,7 @@ const OtherForm: React.FC<Iprops> = (props) => {
otherForm
.
setFieldsValue
({
"isInvoice"
:
false
})
setDisabledInvoice
(
true
)
}
else
{
otherForm
.
setFieldsValue
({
"isInvoice"
:
true
})
setDisabledInvoice
(
false
)
}
},
[
productPriceType
])
...
...
@@ -74,6 +75,7 @@ const OtherForm: React.FC<Iprops> = (props) => {
required
:
true
,
message
:
"请选择是否提供发票"
}]
}
style=
{
{
display
:
"none"
}
}
>
<
Radio
.
Group
size=
"small"
disabled=
{
disabledInvoice
}
>
<
Radio
.
Button
value=
{
true
}
style=
{
{
width
:
100
,
textAlign
:
'center'
}
}
>
是
</
Radio
.
Button
>
...
...
src/pages/priceManage/constant/index.tsx
View file @
f6c028ac
...
...
@@ -34,10 +34,10 @@ export const columnsSetMember: any[] = [
export
const
columnsSetProduct
:
any
[]
=
[
{
title
:
'商品
ID
'
,
dataIndex
:
'
id
'
,
title
:
'商品
编号
'
,
dataIndex
:
'
code
'
,
align
:
'center'
,
key
:
'
id
'
,
key
:
'
code
'
,
},
{
title
:
'商品名称'
,
...
...
src/pages/priceManage/priceStrategy/component/MemberModal.tsx
View file @
f6c028ac
...
...
@@ -60,16 +60,17 @@ const MemberModal:React.FC<MemberModalProps> = (props) => {
schemaAction
.
setFieldValue
(
'commodityMemberList'
,
hasMember
.
concat
(
rowSelectionCtl
.
selectRow
))
rowSelectionCtl
.
setSelectedRowKeys
([])
rowSelectionCtl
.
setSelectRow
([])
console
.
log
(
hasMember
,
rowSelectionCtl
.
selectRow
)
}
else
{
schemaAction
.
setFieldValue
(
'commodityMemberList'
,
rowSelectionCtl
.
selectRow
)
schemaAction
.
setFieldState
(
'commodityMemberList'
,
state
=>
{
state
.
dataSource
=
rowSelectionCtl
.
selectRow
})
}
}
const
fetchMemberList
=
async
(
params
)
=>
{
const
excludeIds
=
await
PublicApi
.
getProductCommodityGetStrategyMemberByCommodityId
({
commodityId
:
schemaAction
.
getFieldValue
(
"productId"
)},
{
ctlType
:
'none'
})
let
checkedMember
=
schemaAction
.
getFieldValue
(
'commodityMemberList'
)
console
.
log
(
schemaAction
.
getFieldState
(
'commodityMemberList'
),
'state'
)
if
(
schemaAction
.
getFieldState
(
'commodityMemberList'
).
isDelete
)
{
params
.
excludeList
=
checkedMember
.
map
(
item
=>
({
memberId
:
item
.
memberId
,
...
...
src/pages/priceManage/priceStrategy/component/PriceModal.tsx
View file @
f6c028ac
...
...
@@ -126,7 +126,7 @@ const PriceModal:React.FC<PriceModalProps> = (props) => {
},
[]
)
let
result
=
range
.
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
'请正确输入阶梯数量范围'
);
callback
()
}
...
...
src/pages/priceManage/priceStrategy/component/PriceSetting.tsx
View file @
f6c028ac
...
...
@@ -49,6 +49,9 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
PublicApi
.
getProductCommodityGetUnitPriceStrategy
({
id
}).
then
(
res
=>
{
const
{
initValue
}
=
transformDataForNiceForm
(
res
.
data
,
addSchemaAction
)
setInitialFormValue
(
initValue
)
addSchemaAction
.
setFieldState
(
'commodityMemberList'
,
state
=>
{
state
.
dataSource
=
initValue
.
commodityMemberList
})
})
}
},
[])
...
...
@@ -122,6 +125,10 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
let
commodityMemberList
=
addSchemaAction
.
getFieldValue
(
"commodityMemberList"
).
filter
(
item
=>
item
.
name
===
value
)
addSchemaAction
.
setFieldValue
(
"commodityMemberList"
,
commodityMemberList
)
if
(
!
value
)
{
addSchemaAction
.
setFieldValue
(
"commodityMemberList"
,
addSchemaAction
.
getFieldState
(
"commodityMemberList"
)[
"dataSource"
])
}
}
...
...
src/pages/priceManage/priceStrategy/component/ProductModal.tsx
View file @
f6c028ac
...
...
@@ -11,6 +11,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const'
import
ModalSearch
from
'@/components/NiceForm/components/Search'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
{
clearModalParams
}
from
'@/utils'
export
interface
ProductModalProps
{
type
?:
'radio'
|
'checkbox'
,
...
...
@@ -62,13 +63,20 @@ const ProductModal:React.FC<ProductModalProps> = (props) => {
schemaAction
.
setFieldValue
(
'productName'
,
selectResult
.
name
)
schemaAction
.
setFieldValue
(
'productId'
,
selectResult
.
id
)
clearModalParams
()
}
const
handleCancel
=
()
=>
{
setVisible
(
false
)
clearModalParams
()
}
return
(
<
ModalTable
modalTitle=
'选择商品'
confirm=
{
handleOkAddProduct
}
cancel=
{
()
=>
setVisible
(
false
)
}
cancel=
{
handleCancel
}
visible=
{
visible
}
columns=
{
columnsSetProduct
}
rowSelection=
{
rowSelection
}
...
...
src/pages/priceManage/priceStrategy/index.tsx
View file @
f6c028ac
...
...
@@ -37,9 +37,14 @@ const PriceManage: React.FC<{}> = () => {
{
text
}
</
EyePreview
>
},
// {
// title: '商品ID',
// dataIndex: ["commodity", "id"],
// key: 'commodity',
// },
{
title
:
'商品
ID
'
,
dataIndex
:
[
"commodity"
,
"
id
"
],
title
:
'商品
编号
'
,
dataIndex
:
[
"commodity"
,
"
code
"
],
key
:
'commodity'
,
},
{
...
...
src/pages/priceManage/schema/index.tsx
View file @
f6c028ac
...
...
@@ -85,7 +85,7 @@ export const schema: ISchema = {
commodityName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'商品名称'
,
placeholder
:
'商品
编号或
名称'
,
style
:
{
width
:
'174px'
},
}
},
...
...
src/pages/transaction/components/approvedOrderModal/index.tsx
View file @
f6c028ac
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
import
ModalForm
from
'@/components/ModalForm'
import
{
createFormActions
,
registerVirtualBox
}
from
'@formily/antd'
import
{
createFormActions
,
registerVirtualBox
,
FormEffectHooks
}
from
'@formily/antd'
import
{
OrderDetailContext
}
from
'../../_public/order/context'
import
{
Checkbox
}
from
'antd'
...
...
@@ -184,6 +184,14 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
[
checkedContract
,
setCheckedContract
]
=
useState
<
boolean
>
(
false
)
// useEffect(() => {
// console.log(data)
// // 上一级审核不通过
// if(data && data.purchaseOrderInteriorState === 6) {
// approvedActions.setFieldValue("state", 0)
// }
// }, [data])
useEffect
(()
=>
{
if
(
currentRef
)
{
currentRef
.
current
=
Object
.
assign
({},
currentRef
.
current
,
{
actions
:
approvedActions
})
...
...
@@ -212,6 +220,14 @@ const ApprovedOrderModal:React.FC<ApprovedOrderModalProps> = (props) => {
children
:
<><
Checkbox
onChange=
{
onChange
}
/>
<
a
href=
{
data
.
electronicContractUrl
}
target=
"blank"
>
{
data
.
electronicContractName
}
</
a
></>
}
})
if
(
data
&&
data
.
purchaseOrderInteriorState
===
6
)
{
ctx
.
setFieldValue
(
"state"
,
0
)
ctx
.
setFieldState
(
"state"
,
state
=>
{
state
.
props
[
"x-component-props"
]
=
{
disabled
:
true
}
})
}
})
}
}
modalProps=
{
{
confirmLoading
:
loading
}
}
...
...
src/pages/transaction/components/createElectronModal/index.tsx
View file @
f6c028ac
...
...
@@ -126,7 +126,7 @@ const schema: ISchema = {
const
CreateOrderElectronModal
:
React
.
FC
<
OrderElectronModalProps
>
=
(
props
)
=>
{
const
formRef
=
useRef
<
any
>
({})
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrder
Signatur
eSignContractCreate
,
{
ctlType
:
'none'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrder
ContractSignSal
eSignContractCreate
,
{
ctlType
:
'none'
})
const
{
run
:
submitRun
,
loading
:
submitLoading
}
=
useHttpRequest
(
PublicApi
.
postOrderSubmittedReviewOrder
)
const
createElectron
=
async
()
=>
{
const
contractTemplateId
=
schemaActions
.
getFieldValue
(
'contractTemplateId'
)
...
...
@@ -135,12 +135,12 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
return
;
}
const
orderId
=
data
.
orderId
const
signM
emberId
=
data
.
createMemberId
const
m
emberId
=
data
.
createMemberId
const
params
=
{
contractTemplateId
,
orderId
,
signM
emberId
m
emberId
}
const
{
code
,
data
:
resData
}
=
await
run
(
params
)
...
...
src/pages/transaction/components/orderElectronModal/index.tsx
View file @
f6c028ac
...
...
@@ -16,7 +16,10 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
const
{
currentRef
,
type
,
ctx
}
=
props
const
{
data
}
=
useContext
(
OrderDetailContext
)
// @ts-ignore
const
{
run
,
loading
}
=
useHttpRequest
(
type
===
'saleOrder'
?
PublicApi
.
postOrderSignaturePlatformSign
:
PublicApi
.
postOrderElectronicContractsAffirm
)
// 采购过来确认先调用 OrderContractSignProcurementSign 在执行 postOrderElectronicContractsAffirm
// 销售过来确认先调用 OrderContractSignSaleSign 在执行 postOrderConfirmedOrder
// const { run, loading } = useHttpRequest(type === 'saleOrder' ? PublicApi.OrderContractSignSaleSign : PublicApi.postOrderElectronicContractsAffirm)
const
{
run
,
loading
}
=
useHttpRequest
(
type
===
'saleOrder'
?
PublicApi
.
postOrderContractSignSaleSign
:
PublicApi
.
postOrderContractSignProcurementSign
)
const
[
visible
,
setVisible
]
=
useState
(
false
)
useEffect
(()
=>
{
currentRef
.
current
=
{
...
...
@@ -26,13 +29,13 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
},
[])
const
handleSubmit
=
async
()
=>
{
console
.
log
(
'签署'
)
let
params
:
any
=
{}
if
(
type
===
'saleOrder'
)
{
params
.
contractName
=
data
.
electronicContractName
params
.
contractUrl
=
data
.
electronicContractUrl
}
else
{
params
.
id
=
parseInt
(
data
.
id
)
params
.
signatureLogId
=
data
.
signatureLogId
// params.id = parseInt(data.id)
}
const
res
=
await
run
(
params
)
if
(
res
.
code
===
1000
)
{
...
...
@@ -44,7 +47,10 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
signatureLogId
:
res
.
data
.
signatureLogId
})
}
else
{
history
.
goBack
()
// history.goBack()
handleContractsAffirm
({
id
:
Number
(
data
.
id
),
})
}
}
}
...
...
@@ -58,6 +64,15 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}
}
const
handleContractsAffirm
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
postOrderElectronicContractsAffirm
(
params
,
{
ctlType
:
'none'
})
if
(
res
.
code
===
1000
)
{
history
.
goBack
()
}
else
{
message
.
error
(
res
.
message
)
}
}
return
(
<
Modal
width=
{
1000
}
...
...
src/pages/transaction/components/orderMergeInfo/index.tsx
View file @
f6c028ac
...
...
@@ -75,8 +75,6 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
{
title
:
'其他要求'
,
name
:
'restsRequire'
},
]
console
.
log
(
data
,
'data'
)
return
(
<>
<
Row
style=
{
{
marginTop
:
24
}
}
gutter=
{
24
}
>
...
...
src/pages/transaction/components/orderPayModal/index.tsx
View file @
f6c028ac
...
...
@@ -76,7 +76,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
{
id
}
=
usePageStatus
()
const
{
data
,
payList
,
currentPayInfoId
}
=
useContext
(
OrderDetailContext
)
const
transformPayList
:
any
=
data
?
formatting
(
payList
,
"payType"
)
:
[]
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderPendingOrderPay
)
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
checked
,
setChecked
]
=
useState
<
any
>
({})
const
[
current
,
setCurrent
]
=
useState
(
0
)
// 0选择方式 1线下支付方式 2授信支付 3余额支付 4微信支付 5货到付款 6支付宝 1000清除
...
...
@@ -92,6 +91,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const
[
balanceInfo
,
setBalanceInfo
]
=
useState
<
any
>
()
const
[
payOnReceived
,
setPayOnReceived
]
=
useState
<
boolean
>
(
false
)
// 是否要禁用到付方式
const
[
blankAccountInfo
,
setBlankAccountInfo
]
=
useState
<
any
>
()
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderPendingOrderPay
)
useEffect
(()
=>
{
if
(
currentRef
)
{
...
...
@@ -311,7 +311,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
params
.
payOrderUrls
=
payOrderUrls
.
join
(
','
)
}
const
res
=
await
run
(
params
)
const
res
=
await
run
(
params
,
mobilePayFlag
.
current
===
4
?
{
ctlType
:
"none"
}
:
null
)
if
(
res
.
code
===
1000
)
{
if
(
mobilePayFlag
.
current
!==
4
)
{
// 非微信
history
.
goBack
()
...
...
@@ -561,6 +561,9 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
maxLength=
{
number
.
length
}
onChange=
{
onChange
}
visibilityToggle=
{
false
}
readOnly=
{
true
}
onFocus=
{
(
e
)
=>
e
.
target
.
removeAttribute
(
'readonly'
)
}
onBlur=
{
(
e
)
=>
e
.
target
.
setAttribute
(
'readonly'
,
'true'
)
}
/>
</
div
>
</
div
>
...
...
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
f6c028ac
...
...
@@ -122,6 +122,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
title=
'查看支付结果'
visible=
{
visible
}
onCancel=
{
()
=>
setVisible
(
false
)
}
onOk=
{
()
=>
setVisible
(
false
)
}
>
<
List
itemLayout=
"horizontal"
...
...
src/pages/transaction/components/orderTransformRecord/index.tsx
View file @
f6c028ac
...
...
@@ -163,7 +163,7 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
const
{
externalProcurementOrderLogResponses
,
interiorProcurementOrderLogResponses
}
=
data
// 复杂流程或者多次支付显示标题
const
isShowOuterTitle
=
data
?.
processEnum
!==
24
||
data
?.
paymentInformationResponses
?.
length
>
1
//
const isShowOuterTitle = data?.processEnum !== 24 || data?.paymentInformationResponses?.length > 1
return
(
<>
...
...
@@ -171,16 +171,14 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = ({type}) => {
(
externalProcurementOrderLogResponses
?.
length
>
0
||
interiorProcurementOrderLogResponses
?.
length
>
0
)
&&
<
MellowCard
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
>
<
Tabs
defaultActiveKey=
"1"
>
{
isShowOuterTitle
&&
<
Tabs
.
TabPane
tab=
'外部订单流转记录'
key=
"1"
>
<
Table
columns=
{
outOrderCols
}
dataSource=
{
externalProcurementOrderLogResponses
}
pagination=
{
false
}
rowKey=
"id"
/>
</
Tabs
.
TabPane
>
}
<
Tabs
.
TabPane
tab=
'外部订单流转记录'
key=
"1"
>
<
Table
columns=
{
outOrderCols
}
dataSource=
{
externalProcurementOrderLogResponses
}
pagination=
{
false
}
rowKey=
"id"
/>
</
Tabs
.
TabPane
>
{
interiorProcurementOrderLogResponses
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'内部订单流转记录'
key=
"2"
>
<
Table
...
...
src/pages/transaction/purchaseOrder/addPurchaseWarehouseOrder/model/useSelfTable.tsx
View file @
f6c028ac
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
,
Modal
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
PurchaseOrderInsideWorkState
,
DOC_TYPE_PURCHASE_RECEIPT
,
DOC_TYPE_SALES_INVOICE
}
from
'@/constants'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
// 业务hooks, 待支付订单
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
customOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/purchaseOrder/addPurchaseWarehouseOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'订单摘要/下单时间'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
render
:
(
text
,
record
)
=>
<>
<
div
>
{
text
}
</
div
>
<
div
><
FieldTimeOutlined
/>
{
formatTimeString
(
record
.
createTime
)
}
</
div
>
</>,
width
:
200
},
{
title
:
'采购会员'
,
align
:
'left'
,
dataIndex
:
'supplyMembersName'
,
key
:
'supplyMembersName'
,
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'
发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
text
,
record
)
=>
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`
}
>
{
text
}
</
Link
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
)
=>
ORDER_TYPE
[
text
]
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'out'
/>
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'interiorState'
,
key
:
'interiorState'
,
render
:
(
text
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
/>
},
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
READY_WAREHOUSE_APPROVED_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
审核
</
Button
>
}
{
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
WAREHOUSE_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleAdd
(
record
)
}
>
新增入库单
</
Button
>
}
</>
}
]
const
handleConfirm
=
async
(
record
)
=>
{
const
modal
=
Modal
.
confirm
({
title
:
'确认审核操作'
,
content
:
`是否确认审核入库单号为
${
record
.
invoiceNumber
}
的采购入库单?`
,
onOk
:
async
()
=>
{
const
{
code
}
=
await
PublicApi
.
postOrderAuditSalesInvoice
({
id
:
record
.
orderDeliveryDetailsId
,
orderId
:
record
.
id
})
if
(
code
===
1000
)
{
modal
.
destroy
()
ref
.
current
.
reload
()
}
}
})
}
const
handleAdd
=
async
(
record
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=
${
record
.
id
}
&invoicesTypeId=
${
DOC_TYPE_PURCHASE_RECEIPT
}
&relevanceInvoices=1`
)
}
return
{
columns
:
customOrderColumns
,
ref
}
}
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
,
Modal
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
PurchaseOrderInsideWorkState
,
DOC_TYPE_PURCHASE_RECEIPT
,
DOC_TYPE_SALES_INVOICE
}
from
'@/constants'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
// 业务hooks, 待支付订单
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
customOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/purchaseOrder/addPurchaseWarehouseOrder/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'订单摘要/下单时间'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
render
:
(
text
,
record
)
=>
<>
<
div
>
{
text
}
</
div
>
<
div
><
FieldTimeOutlined
/>
{
formatTimeString
(
record
.
createTime
)
}
</
div
>
</>,
width
:
200
},
{
title
:
'采购会员'
,
align
:
'left'
,
dataIndex
:
'supplyMembersName'
,
key
:
'supplyMembersName'
,
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'
已发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'入库单号'
,
align
:
'center'
,
dataIndex
:
'invoiceNumber'
,
key
:
'invoiceNumber'
,
render
:
(
text
,
record
)
=>
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`
}
>
{
text
}
</
Link
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
)
=>
ORDER_TYPE
[
text
]
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'out'
/>
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'interiorState'
,
key
:
'interiorState'
,
render
:
(
text
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
/>
},
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
READY_WAREHOUSE_APPROVED_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
审核
</
Button
>
}
{
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
WAREHOUSE_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleAdd
(
record
)
}
>
新增入库单
</
Button
>
}
</>
}
]
const
handleConfirm
=
async
(
record
)
=>
{
const
modal
=
Modal
.
confirm
({
title
:
'确认审核操作'
,
content
:
`是否确认审核入库单号为
${
record
.
invoiceNumber
}
的采购入库单?`
,
onOk
:
async
()
=>
{
const
{
code
}
=
await
PublicApi
.
postOrderAuditSalesInvoice
({
id
:
record
.
orderDeliveryDetailsId
,
orderId
:
record
.
id
})
if
(
code
===
1000
)
{
modal
.
destroy
()
ref
.
current
.
reload
()
}
}
})
}
const
handleAdd
=
async
(
record
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=
${
record
.
id
}
&invoicesTypeId=
${
DOC_TYPE_PURCHASE_RECEIPT
}
&relevanceInvoices=1`
)
}
return
{
columns
:
customOrderColumns
,
ref
}
}
src/pages/transaction/purchaseOrder/orderCollect/apis/index.ts
View file @
f6c028ac
...
...
@@ -67,7 +67,7 @@ export const fetchOrderApi = {
// 生成电子合同
async
createContract
(
params
)
{
const
{
data
}
=
await
PublicApi
.
postOrder
SignaturePreOrder
SignContractCreate
(
params
,
{
ctlType
:
"none"
})
const
{
data
}
=
await
PublicApi
.
postOrder
ContractSignProcurement
SignContractCreate
(
params
,
{
ctlType
:
"none"
})
return
data
},
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/simpleElectronModal/index.tsx
View file @
f6c028ac
...
...
@@ -12,7 +12,6 @@ export interface SimpleElectronModalProps {
const
SimpleElectronModal
:
React
.
FC
<
SimpleElectronModalProps
>
=
(
props
)
=>
{
const
{
currentRef
,
schemaAction
}
=
props
// @ts-ignore
// const { run, loading } = useHttpRequest(PublicApi.postOrderSignatureOrderSettleSign, { ctlType: "none" })
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
)
const
signatureState
=
useRef
(
null
)
...
...
@@ -39,11 +38,11 @@ const SimpleElectronModal:React.FC<SimpleElectronModalProps> = (props) => {
const
handleSubmit
=
async
()
=>
{
setConfirmLoading
(
true
)
// const res = await run(contracts)
const
res
=
await
PublicApi
.
postOrder
SignatureOrderSettle
Sign
(
contracts
,
{
ctlType
:
"none"
})
const
res
=
await
PublicApi
.
postOrder
ContractSignProcurementOneStep
Sign
(
contracts
,
{
ctlType
:
"none"
})
if
(
res
.
code
===
1000
)
{
timer
=
setInterval
(()
=>
{
if
(
signatureState
.
current
!==
4
)
{
PublicApi
.
getOrder
Signature
OrderSettleSignDetail
({
signatureLogId
:
res
.
data
.
signatureLogId
+
''
}).
then
(
_res
=>
{
PublicApi
.
getOrder
ContractSign
OrderSettleSignDetail
({
signatureLogId
:
res
.
data
.
signatureLogId
+
''
}).
then
(
_res
=>
{
if
(
_res
.
code
===
1000
)
{
signatureState
.
current
=
_res
.
data
.
state
if
(
_res
.
data
.
state
===
4
)
{
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/theInvoiceList/index.tsx
View file @
f6c028ac
...
...
@@ -37,24 +37,25 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
})
}
}
else
if
(
pageStatus
===
PageStatus
.
EDIT
){
// console.log(value, mode, dataSource, 'vvv')
// @bug todo 编辑情况下 默认显示有问题 固定第一个
// console.log(value, mode, dataSource, 'EDIT')
if
(
typeof
value
===
'object'
)
{
// console.log('o')
let
target
=
(
mode
===
'add'
||
mode
===
'delete'
)
?
dataSource
[
0
]
:
value
setFieldState
({
dataSource
,
showMore
,
useValue
:
target
})
// console.log('isObject', target)
mutators
.
change
(
target
)
}
else
{
let
target
=
dataSource
.
find
(
v
=>
v
.
id
===
value
)
// console.log(target, 'target')
let
target
=
dataSource
.
length
?
dataSource
.
find
(
v
=>
v
.
id
===
value
)
:
value
setFieldState
({
dataSource
,
showMore
,
useValue
:
target
})
// console.log('notObject', target)
mutators
.
change
(
target
)
}
}
...
...
@@ -89,9 +90,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
form
.
setFieldValue
(
"needTheInvoice"
,
0
)
}
// 订单新增 重载全部置为第一个
// console.log(value, '-2')
if
(
pageStatus
===
PageStatus
.
ADD
)
{
// console.log(value, '-1')
setFieldState
({
dataSource
:
data
,
showMore
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
f6c028ac
...
...
@@ -290,7 +290,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
if
(
pageStatus
===
PageStatus
.
EDIT
){
if
(
state
?.
dataSource
?.
length
&&
state
.
loading
)
{
ctx
.
submit
((
values
)
=>
{
console
.
log
(
values
,
value
,
path
,
'发票id'
)
//
console.log(values, value, path, '发票id')
if
(
values
){
PublicApi
.
postOrderProcurementOrderUpdate
({
...
values
,
...
...
@@ -313,7 +313,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
if
(
pageStatus
===
PageStatus
.
EDIT
){
if
(
state
?.
dataSource
?.
length
&&
state
.
loading
)
{
ctx
.
submit
((
values
)
=>
{
console
.
log
(
values
,
value
,
path
,
'发货地址id'
)
//
console.log(values, value, path, '发货地址id')
if
(
values
){
PublicApi
.
postOrderProcurementOrderUpdate
({
...
values
,
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
f6c028ac
...
...
@@ -213,8 +213,8 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
if
(
electronicContractId
)
{
fetchOrderApi
.
createContract
({
contractTemplateId
:
electronicContractId
,
signM
emberId
:
value
[
'supplyMembersId'
],
signR
oleId
:
value
[
'supplyMembersRoleId'
],
m
emberId
:
value
[
'supplyMembersId'
],
r
oleId
:
value
[
'supplyMembersRoleId'
],
quotationNo
:
value
[
"quotationNo"
],
orderProductRequests
:
_orderProductRequests
.
map
(
v
=>
{
v
.
price
=
1
...
...
@@ -312,7 +312,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
throw
new
Error
(
'请填写商品采购数量'
)
}
// 使用发票即校验发票id
console
.
log
(
params
,
'params'
)
//
console.log(params, 'params')
if
(
params
.
needTheInvoice
&&
!
params
.
theInvoiceId
)
{
throw
new
Error
(
'请新增或选择需要使用的发票'
)
}
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/detail/index.tsx
View file @
f6c028ac
...
...
@@ -15,6 +15,7 @@ const ReadyConfirmContract: React.FC = () => {
const
payRef
=
useRef
<
any
>
({})
const
handleClick
=
useCallback
(()
=>
{
console
.
log
(
data
,
currentPayInfoId
)
// 处理积分支付跳转
if
(
data
&&
currentPayInfoId
){
if
(
data
.
paymentInformationResponses
.
length
>
0
){
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/model/useSelfTable.tsx
View file @
f6c028ac
...
...
@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'
发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
{
title
:
'
已发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'发货单号'
,
...
...
src/pages/transaction/saleOrder/addSaleDelevedOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/firstApprovedOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyAddLogisticsOrder/model/useSelfTable.tsx
View file @
f6c028ac
...
...
@@ -52,7 +52,7 @@ export const useSelfTable = () => {
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'
发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
{
title
:
'
已发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'发货单号'
,
...
...
src/pages/transaction/saleOrder/readyAddLogisticsOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyApprovedOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
View file @
f6c028ac
...
...
@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key
:
'sumPrice'
,
render
:
(
t
,
r
)
=>
(
r
.
type
===
7
||
r
.
type
===
8
)
?
t
:
'¥'
+
t
},
{
title
:
'
发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
{
title
:
'
已发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'发货单号'
,
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyConfirmOrder/detail/index.tsx
View file @
f6c028ac
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../../components/approvedOrderModal'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
import
OrderElectronModal
from
'@/pages/transaction/components/orderElectronModal'
;
const
ReadyConfirmOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderConfirmedOrder
)
const
approvedRef
=
useRef
<
any
>
({})
const
handleClick
=
useCallback
(()
=>
{
PublicApi
.
getOrderSignatureAuthAuthState
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
approvedRef
.
current
.
setVisible
(
true
)
}
})
},
[])
const
electronRef
=
useRef
<
any
>
({})
// const handleClick = useCallback(() => {
// electronRef.current.setVisible(true)
// }, [])
// 提交表单
const
handleSubmit
=
()
=>
{
approvedRef
.
current
.
actions
.
submit
().
then
(
async
(
v
)
=>
{
const
params
=
{
id
:
Number
(
id
),
state
:
v
.
values
.
state
,
cause
:
v
.
values
.
cause
,
}
if
(
formContext
.
data
.
usingElectronicContracts
&&
v
.
values
.
state
)
{
// 使用合同 并且通过
approvedRef
.
current
.
setVisible
(
false
)
electronRef
.
current
.
setVisible
(
true
)
}
else
{
const
result
=
await
run
(
params
)
if
(
result
.
code
===
1000
)
{
approvedRef
.
current
.
setVisible
(
false
)
history
.
goBack
()
}
}
})
}
return
(
<
div
>
<
OrderDetailContext
.
Provider
value=
{
formContext
}
>
<
OrderDetailHeader
detailList=
{
detailList
}
detailData=
{
formContext
.
data
}
extraRight=
{
<
Button
type=
'primary'
onClick=
{
handleClick
}
>
确认订单
</
Button
>
}
/>
<
OrderDetailWrapper
>
<
PreLoading
loading=
{
!
formContext
.
data
}
active
paragraph=
{
{
rows
:
6
}
}
>
<
OrderDetailSection
formContext=
{
formContext
}
type=
'saleOrder'
/>
</
PreLoading
>
</
OrderDetailWrapper
>
{
/* 提交时触发的弹窗集合 */
}
<
ApprovedOrderModal
currentRef=
{
approvedRef
}
onConfirm=
{
handleSubmit
}
loading=
{
loading
}
isUseElectronicContract=
{
formContext
.
data
?.
usingElectronicContracts
?
true
:
false
}
/>
{
/* 提交时触发的签合同弹窗集合 */
}
<
OrderElectronModal
currentRef=
{
electronRef
}
type=
'saleOrder'
ctx=
{
approvedRef
.
current
.
actions
}
/>
</
OrderDetailContext
.
Provider
>
</
div
>
);
};
export
default
ReadyConfirmOrderDetail
;
\ No newline at end of file
import
React
,
{
useState
,
useCallback
,
useRef
}
from
'react'
;
import
{
OrderDetailContext
}
from
'../../../_public/order/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
Button
}
from
'antd'
;
import
OrderDetailHeader
from
'@/pages/transaction/components/OrderDetailHeader'
;
import
OrderDetailWrapper
from
'@/pages/transaction/components/OrderDetailWrapper'
;
import
PreLoading
from
'@/components/PreLoading'
;
import
{
useOrderDetail
}
from
'../../../_public/order/effects/useOrderDetail'
;
import
ApprovedOrderModal
from
'../../../components/approvedOrderModal'
;
import
{
history
}
from
'umi'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
;
import
OrderDetailSection
from
'../../../components/orderDetailSection'
;
import
OrderElectronModal
from
'@/pages/transaction/components/orderElectronModal'
;
const
ReadyConfirmOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderConfirmedOrder
)
const
approvedRef
=
useRef
<
any
>
({})
const
handleClick
=
useCallback
(()
=>
{
PublicApi
.
getOrderSignatureAuthAuthState
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
approvedRef
.
current
.
setVisible
(
true
)
}
})
},
[])
const
electronRef
=
useRef
<
any
>
({})
// const handleClick = useCallback(() => {
// electronRef.current.setVisible(true)
// }, [])
// 提交表单
const
handleSubmit
=
()
=>
{
approvedRef
.
current
.
actions
.
submit
().
then
(
async
(
v
)
=>
{
const
params
=
{
id
:
Number
(
id
),
state
:
v
.
values
.
state
,
cause
:
v
.
values
.
cause
,
}
if
(
formContext
.
data
.
usingElectronicContracts
&&
v
.
values
.
state
)
{
// 使用合同 并且通过
approvedRef
.
current
.
setVisible
(
false
)
electronRef
.
current
.
setVisible
(
true
)
}
else
{
const
result
=
await
run
(
params
)
if
(
result
.
code
===
1000
)
{
approvedRef
.
current
.
setVisible
(
false
)
history
.
goBack
()
}
}
})
}
return
(
<
div
>
<
OrderDetailContext
.
Provider
value=
{
formContext
}
>
<
OrderDetailHeader
detailList=
{
detailList
}
detailData=
{
formContext
.
data
}
extraRight=
{
<
Button
type=
'primary'
onClick=
{
handleClick
}
>
确认订单
</
Button
>
}
/>
<
OrderDetailWrapper
>
<
PreLoading
loading=
{
!
formContext
.
data
}
active
paragraph=
{
{
rows
:
6
}
}
>
<
OrderDetailSection
formContext=
{
formContext
}
type=
'saleOrder'
/>
</
PreLoading
>
</
OrderDetailWrapper
>
{
/* 提交时触发的弹窗集合 */
}
<
ApprovedOrderModal
currentRef=
{
approvedRef
}
onConfirm=
{
handleSubmit
}
loading=
{
loading
}
isUseElectronicContract=
{
formContext
.
data
?.
usingElectronicContracts
?
true
:
false
}
/>
{
/* 提交时触发的签合同弹窗集合 */
}
<
OrderElectronModal
currentRef=
{
electronRef
}
type=
'saleOrder'
ctx=
{
approvedRef
.
current
.
actions
}
/>
</
OrderDetailContext
.
Provider
>
</
div
>
);
};
export
default
ReadyConfirmOrderDetail
;
src/pages/transaction/saleOrder/readyConfirmOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyConfirmReturnOrder/model/useSelfTable.tsx
View file @
f6c028ac
...
...
@@ -62,7 +62,7 @@ export const useSelfTable = () => {
key
:
'sumPrice'
,
render
:
text
=>
'¥'
+
text
},
{
title
:
'
发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`第
${
text
}
次`
:
''
},
{
title
:
'
已发货批次'
,
align
:
'center'
,
dataIndex
:
'shipmentBatch'
,
key
:
'shipmentBatch'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'发货单号'
,
...
...
src/pages/transaction/saleOrder/readyConfirmReturnOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyPayResult/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/readyReturnDocument/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
src/pages/transaction/saleOrder/secondApprovedOrder/schema/index.ts
View file @
f6c028ac
...
...
@@ -32,7 +32,7 @@ export const tableListSchema: ISchema = {
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
member
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
...
...
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