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
5308c476
Commit
5308c476
authored
Sep 27, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2d9447fc
a9045c0b
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
333 additions
and
71 deletions
+333
-71
index.less
src/components/MellowCard/index.less
+21
-0
index.tsx
src/components/MellowCard/index.tsx
+9
-5
index.ts
src/constants/index.ts
+2
-2
addressForm.tsx
src/pages/logistics/list/components/addressForm.tsx
+1
-1
index.tsx
src/pages/lxMall/order/components/addAddress/index.tsx
+1
-1
index.tsx
...action/electronicContracts/components/corporate/index.tsx
+1
-1
index.tsx
...transaction/electronicContracts/components/test/index.tsx
+1
-1
index.tsx
...rchaseOrder/orderDetail/components/addressModal/index.tsx
+1
-1
index.tsx
...eOrder/orderDetail/components/productModalTable/index.tsx
+2
-0
useProductTable.tsx
...ction/purchaseOrder/orderDetail/model/useProductTable.tsx
+11
-2
index.less
...haseOrder/orderPreview/components/ContractList/index.less
+38
-0
index.tsx
...chaseOrder/orderPreview/components/ContractList/index.tsx
+71
-0
index.less
...seOrder/orderPreview/components/orderMergeInfo/index.less
+0
-5
index.tsx
...aseOrder/orderPreview/components/orderMergeInfo/index.tsx
+19
-7
index.tsx
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
+42
-19
useSelfTable.tsx
...purchaseOrder/readyConfirmContract/model/useSelfTable.tsx
+14
-6
index.tsx
src/pages/transaction/saleOrder/constant/index.tsx
+1
-1
index.tsx
...Order/orderPreview/components/orderProductTable/index.tsx
+73
-9
index.tsx
src/pages/transaction/saleOrder/orderPreview/index.tsx
+18
-5
index.tsx
...ges/transaction/stockSellStorage/bills/addBills/index.tsx
+6
-4
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+1
-1
No files found.
src/components/MellowCard/index.less
View file @
5308c476
...
...
@@ -20,4 +20,24 @@
}
}
}
&.fullHeight {
height: 100%;
:global {
.ant-card {
height: 100%;
display: flex;
flex-direction: column !important;
&-head {
flex-shrink: 0;
}
&-body {
flex: 1;
}
}
}
}
}
\ No newline at end of file
src/components/MellowCard/index.tsx
View file @
5308c476
...
...
@@ -2,24 +2,28 @@
* @Author: XieZhiXiong
* @Date: 2020-08-26 17:32:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-2
2 20:54:42
* @LastEditTime: 2020-09-2
7 15:00:07
* @Description: 基于 antd Card 封装的适合项目 UI 的 Card,使用方式跟 antd Card 一样,这里只是修改了样式
*/
import
React
from
'react'
;
import
{
Card
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
CardProps
}
from
'antd/lib/card'
;
import
styles
from
'./index.less'
;
import
cx
from
'classnames'
export
interface
MellowCardProps
extends
CardProps
{
blockClassName
?:
string
blockClassName
?:
string
;
fullHeight
?:
boolean
;
// 是否占满父级的高度,一般用于多列使用改组件的情况
}
const
MellowCard
:
React
.
FC
<
MellowCardProps
>
=
props
=>
{
const
{
children
,
blockClassName
,
...
rest
}
=
props
;
const
{
children
,
blockClassName
,
fullHeight
,
...
rest
}
=
props
;
const
cls
=
classNames
(
styles
.
mellow
,
{
[
styles
.
fullHeight
]:
fullHeight
,
});
return
(
<
div
className=
{
styles
.
mellow
}
>
<
div
className=
{
cls
}
>
<
Card
bordered=
{
false
}
{
...
rest
}
>
{
children
}
</
Card
>
...
...
src/constants/index.ts
View file @
5308c476
...
...
@@ -774,7 +774,7 @@ export const PurchaseOrderInsideWorkStateTexts = {
2
:
'一级审核订单'
,
3
:
'二级审核订单'
,
4
:
'提交订单'
,
5
:
'
提交订单完成
'
,
5
:
'
待确认电子合同
'
,
6
:
'提交一级审核订单不通过'
,
7
:
'提交二级审核订单不通过'
,
8
:
'确认电子合同'
,
...
...
@@ -788,7 +788,7 @@ export const PurchaseOrderInsideWorkStateTexts = {
// 销售订单内部显示文案
export
const
SaleOrderInsideWorkStateTexts
=
{
1
:
'
提交
审核订单'
,
1
:
'
待
审核订单'
,
2
:
'一级审核订单'
,
3
:
'二级审核订单'
,
4
:
'确认订单'
,
...
...
src/pages/logistics/list/components/addressForm.tsx
View file @
5308c476
...
...
@@ -177,7 +177,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
console
.
log
(
typeof
(
id
))
let
title
=
id
===
0
?
'新建'
:
'编辑'
history
.
location
.
query
.
page_type
==
'1'
?
setHeaderTitle
(
`
${
title
}
发货地址`
)
:
setHeaderTitle
(
`
${
title
}
收货地址`
)
PublicApi
.
getManageGetTelCode
().
then
(
res
=>
{
PublicApi
.
getManage
CountryArea
GetTelCode
().
then
(
res
=>
{
res
.
data
.
forEach
((
item
,
index
)
=>
{
TelCodeList
.
push
({
label
:
item
,
value
:
(
index
).
toString
()
})
})
...
...
src/pages/lxMall/order/components/addAddress/index.tsx
View file @
5308c476
...
...
@@ -97,7 +97,7 @@ const AddAddress: React.FC<AddAddressPropsType> = (props) => {
useEffect
(()
=>
{
PublicApi
.
getManageGetTelCode
().
then
(
res
=>
{
PublicApi
.
getManage
CountryArea
GetTelCode
().
then
(
res
=>
{
res
.
data
.
forEach
((
item
,
index
)
=>
{
TelCodeList
.
push
({
label
:
item
,
value
:
(
index
).
toString
()
})
})
...
...
src/pages/transaction/electronicContracts/components/corporate/index.tsx
View file @
5308c476
...
...
@@ -61,7 +61,7 @@ const Corporate: React.FC<queryProps> = (props) => {
useEffect
(()
=>
{
CheckPayWay
(
1
);
PublicApi
.
getManageGetTelCode
().
then
(
res
=>
{
PublicApi
.
getManage
CountryArea
GetTelCode
().
then
(
res
=>
{
setOptions
(
res
.
data
)
})
},
[])
...
...
src/pages/transaction/electronicContracts/components/test/index.tsx
View file @
5308c476
...
...
@@ -50,7 +50,7 @@ const Test:React.FC<queryProps> = (props) => {
actionRef
.
current
=
userAction
;
}
}
PublicApi
.
getManageGetTelCode
().
then
(
res
=>
{
PublicApi
.
getManage
CountryArea
GetTelCode
().
then
(
res
=>
{
setOptions
(
res
.
data
)
})
},
[])
...
...
src/pages/transaction/purchaseOrder/orderDetail/components/addressModal/index.tsx
View file @
5308c476
...
...
@@ -23,7 +23,7 @@ const titleMaps = {
const
addressSchemaAction
=
createFormActions
()
// 获取手机区号
const
fetchTelCode
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageGetTelCode
()
const
{
data
}
=
await
PublicApi
.
getManage
CountryArea
GetTelCode
()
return
data
}
...
...
src/pages/transaction/purchaseOrder/orderDetail/components/productModalTable/index.tsx
View file @
5308c476
...
...
@@ -136,10 +136,12 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
const
fetchProductList
=
(
values
)
=>
{
const
modelType
=
schemaAction
.
getFieldValue
(
'orderModel'
)
const
supplyMembersId
=
schemaAction
.
getFieldValue
(
'supplyMembersId'
)
const
params
=
{
...
values
,
shopType
:
orderProductShopTypeMaps
[
modelType
],
environment
:
1
,
memberId
:
supplyMembersId
,
// 手工下单/合并订单下单时,查询现货价格商品
priceTypeList
:
modelType
===
(
OrderModalType
.
CONSOLIDATED_ORDER
||
OrderModalType
.
HAND_ORDER
)
?
[
1
]
:
undefined
}
...
...
src/pages/transaction/purchaseOrder/orderDetail/model/useProductTable.tsx
View file @
5308c476
import
React
,
{
useRef
,
useMemo
,
useState
}
from
'react'
import
{
ISchemaFormActions
,
ISchemaFormAsyncActions
,
createControllerBox
,
useFormSpy
}
from
'@formily/antd'
;
import
{
Button
,
Row
,
Col
}
from
'antd'
;
import
{
Button
,
Row
,
Col
,
message
}
from
'antd'
;
import
{
productInfoColumns
}
from
'../constant'
;
import
ProductTableCell
,
{
ProductEditableRow
}
from
'../components/productTableCell'
;
import
{
useModalTable
}
from
'./useModalTable'
;
...
...
@@ -53,7 +53,16 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
return
productInfoColumns
})
const
productAddButton
=
<
Button
onClick=
{
()
=>
productRef
.
current
.
setVisible
(
true
)
}
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
const
handleShowProduct
=
()
=>
{
const
supplyMembersId
=
ctx
.
getFieldValue
(
'supplyMembersId'
)
if
(
supplyMembersId
)
{
productRef
.
current
.
setVisible
(
true
)
}
else
{
message
.
error
(
'请先选择供应会员'
)
}
}
const
productAddButton
=
<
Button
onClick=
{
handleShowProduct
}
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
const
productComponents
=
{
body
:
{
row
:
ProductEditableRow
,
...
...
src/pages/transaction/purchaseOrder/orderPreview/components/ContractList/index.less
0 → 100644
View file @
5308c476
@import '../../../../../../global/styles/utils.less';
.contractList {
padding: 0;
margin: 0;
&-item {
padding: 6px 8px;
background: #F4F5F7;
border-radius: 4px;
list-style: none;
> a {
display: flex;
align-items: center;
}
&-icon {
flex-shrink: 0;
margin-right: 4px;
color: #7178EA;
}
&-name {
flex: 1;
.textOverflow();
}
&:not(:last-child) {
margin-bottom: 8px;
}
}
}
.noData {
color: #909399;
}
\ No newline at end of file
src/pages/transaction/purchaseOrder/orderPreview/components/ContractList/index.tsx
0 → 100644
View file @
5308c476
import
React
from
'react'
;
import
{
FilePdfOutlined
,
FileWordOutlined
,
FileOutlined
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./index.less'
;
interface
ContractItem
{
electronicContractUrl
?:
string
;
electronicContractName
?:
string
;
};
interface
ContractList
{
dataSource
:
ContractItem
[];
};
const
IconMap
=
{
'.pdf'
:
<
FilePdfOutlined
/>
,
'.doc'
:
<
FileWordOutlined
/>
,
'.doxc'
:
<
FileWordOutlined
/>
,
};
const
ContractItem
:
React
.
FC
<
ContractItem
>
=
({
electronicContractUrl
,
electronicContractName
,
})
=>
{
const
index1
=
electronicContractUrl
.
lastIndexOf
(
'.'
);
const
suffix
=
electronicContractUrl
.
slice
(
index1
);
const
index2
=
electronicContractUrl
.
lastIndexOf
(
'/'
);
// 如果没有文件名,但是有链接就从链接截取文件名
const
fileName
=
electronicContractName
?
electronicContractName
:
electronicContractUrl
.
slice
(
index2
+
1
);
const
handleDownload
=
(
name
,
url
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
name
}
&contractUrl=
${
url
}
`
;
};
return
(
<
li
className=
{
styles
[
'contractList-item'
]
}
onClick=
{
()
=>
handleDownload
(
fileName
,
electronicContractUrl
)
}
>
<
a
>
<
div
className=
{
styles
[
'contractList-item-icon'
]
}
>
{
IconMap
[
suffix
]
||
<
FileOutlined
/>
}
</
div
>
<
div
className=
{
styles
[
'contractList-item-name'
]
}
title=
{
fileName
}
>
{
fileName
}
</
div
>
</
a
>
</
li
>
);
};
const
ContractList
:
React
.
FC
<
ContractList
>
=
({
dataSource
})
=>
{
if
(
!
Array
.
isArray
(
dataSource
))
{
return
<
div
className=
{
styles
.
noData
}
>
没有相关数据~
</
div
>;
}
return
(
<
ul
className=
{
styles
.
contractList
}
>
{
dataSource
.
map
((
item
,
index
)
=>
(
<
ContractItem
key=
{
index
}
electronicContractUrl=
{
item
.
electronicContractUrl
}
electronicContractName=
{
item
.
electronicContractName
}
/>
))
}
</
ul
>
);
};
export
default
ContractList
;
\ No newline at end of file
src/pages/transaction/purchaseOrder/orderPreview/components/orderMergeInfo/index.less
View file @
5308c476
...
...
@@ -6,8 +6,4 @@
.card-list_title {
font-size: 14px;
color: #909399;
}
.fullHeight {
height: 100%;
}
\ No newline at end of file
src/pages/transaction/purchaseOrder/orderPreview/components/orderMergeInfo/index.tsx
View file @
5308c476
...
...
@@ -6,6 +6,7 @@ import { formatTimeString } from '@/utils'
import
{
DELIVERY_TYPE
}
from
'@/constants'
import
style
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
import
ContractList
from
'../ContractList'
export
interface
OrderMergeInfoProps
{
}
const
payInfo
=
[
...
...
@@ -50,20 +51,31 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
const
{
data
,
ctl
}
=
orderDetailCtx
return
(
<
Row
style=
{
{
marginTop
:
24
}
}
>
<
Row
style=
{
{
marginTop
:
24
}
}
gutter=
{
24
}
>
<
Col
span=
{
12
}
>
<
MellowCard
title=
'交易信息'
blockClassName=
{
style
.
fullHeight
}
className=
{
style
.
fullHeight
}
>
<
MellowCard
title=
'交易信息'
fullHeight
>
<
RenderCard
infoList=
{
payInfo
}
dataSource=
{
data
}
/>
</
MellowCard
>
</
Col
>
<
Col
span=
{
6
}
push=
{
1
}
>
<
MellowCard
title=
'其他信息'
blockClassName=
{
style
.
fullHeight
}
className=
{
style
.
fullHeight
}
>
<
Col
span=
{
6
}
>
<
MellowCard
title=
'其他信息'
fullHeight
>
<
RenderCard
infoList=
{
otherInfo
}
dataSource=
{
data
}
/>
</
MellowCard
>
</
Col
>
<
Col
span=
{
4
}
push=
{
2
}
>
<
MellowCard
title=
'电子合同'
blockClassName=
{
style
.
fullHeight
}
className=
{
style
.
fullHeight
}
>
<
RenderCard
infoList=
{
electronInfo
}
dataSource=
{
data
}
/>
<
Col
span=
{
6
}
>
<
MellowCard
title=
'电子合同'
fullHeight
>
<
ContractList
dataSource=
{
data
.
electronicContractUrl
?
[
{
electronicContractUrl
:
data
.
electronicContractUrl
,
electronicContractName
:
data
.
electronicContractName
,
},
]
:
null
}
/>
</
MellowCard
>
</
Col
>
</
Row
>
...
...
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
View file @
5308c476
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
,
useCallback
}
from
'react'
import
OrderDetailHeader
from
'../../components/OrderDetailHeader'
import
{
Button
,
Row
,
Col
}
from
'antd'
import
{
Link
,
history
}
from
'umi'
...
...
@@ -20,14 +20,16 @@ import ModalForm from '@/components/ModalForm'
import
{
createFormActions
}
from
'@formily/antd'
import
OrderPayModal
from
'./components/orderPayModal'
import
OrderDeleveRecord
from
'./components/orderDeleveRecord'
import
{
PurchaseOrderInsideWorkState
}
from
'@/constants'
export
interface
CommonOrderDetailProps
{
}
const
approvedActions
=
createFormActions
()
const
btnApprovedTitles
=
[
PURCHASE_ORDER_STATUS
.
ONE_LEVEL_APPROVED_ORDER
,
PURCHASE_ORDER_STATUS
.
TWO_LEVEL_APPROVED_ORDER
,
PURCHASE_ORDER_STATUS
.
READY_SUBMIT_ORDER
]
const
btnApprovedTitles
=
[
PURCHASE_ORDER_STATUS
.
ONE_LEVEL_APPROVED_ORDER
,
PURCHASE_ORDER_STATUS
.
TWO_LEVEL_APPROVED_ORDER
]
const
CommonOrderDetail
:
React
.
FC
<
CommonOrderDetailProps
>
=
(
props
)
=>
{
const
[
btnLoading
,
setBtnLoading
]
=
useState
<
boolean
>
(
false
)
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
const
[
payList
,
setPaylist
]
=
useState
<
any
[]
>
([])
let
{
id
,
pageStatus
,
page_type
=
PURCHASE_ORDER_STATUS
.
PREVIEW_ORDER
}
=
usePageStatus
()
...
...
@@ -64,6 +66,7 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
let
result
:
any
=
{}
const
caseData
=
typeof
page_type
===
'string'
?
parseInt
(
page_type
)
:
page_type
setBtnLoading
(
true
)
switch
(
caseData
)
{
case
PURCHASE_ORDER_STATUS
.
ONE_LEVEL_APPROVED_ORDER
:
{
const
params
=
{
...
...
@@ -94,11 +97,12 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
}
case
PURCHASE_ORDER_STATUS
.
READY_CONFIRM_ELECTRON_ORDER
:
{
const
params
=
{
id
:
parseInt
(
id
),
state
:
1
}
result
=
await
PublicApi
.
postOrderElectronicContractsAffirm
(
params
)
console
.
log
(
'确认'
)
// const params = {
// id: parseInt(id),
// state: 1
// }
// result = await PublicApi.postOrderElectronicContractsAffirm(params)
break
;
}
...
...
@@ -134,6 +138,7 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
approvedRef
.
current
.
setVisible
(
false
)
history
.
goBack
()
}
setBtnLoading
(
false
)
}
const
handleStartApply
=
()
=>
{
...
...
@@ -162,19 +167,37 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
}
}
const
extraRight
=
formData
&&
pageStatus
!==
PageStatus
.
PREVIEW
&&
<
div
>
<
Button
type=
'primary'
onClick=
{
handleStartApply
}
>
{
btnApprovedTitles
.
includes
(
page_type
)
?
'提交审核'
:
'提交'
}
</
Button
>
{
page_type
===
PURCHASE_ORDER_STATUS
.
READY_PAY_ORDER
&&
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
p
style=
{
{
marginTop
:
12
,
fontSize
:
12
,
color
:
'#909399'
}
}
>
本次需支付
</
p
>
<
p
>
¥
{
formData
.
sumPrice
}
</
p
>
</
div
>
const
extraRight
=
useCallback
(()
=>
{
if
(
!
formData
||
page_type
===
PURCHASE_ORDER_STATUS
.
PREVIEW_ORDER
)
{
return
null
}
let
text
=
''
switch
(
page_type
)
{
case
PURCHASE_ORDER_STATUS
.
READY_CONFIRM_ELECTRON_ORDER
:
{
text
=
'确认电子合同'
break
;
}
default
:
{
text
=
'提交审核'
break
;
}
}
return
<>
<
Button
type=
'primary'
onClick=
{
handleStartApply
}
loading=
{
btnLoading
}
>
{
text
}
</
Button
>
{
page_type
===
PURCHASE_ORDER_STATUS
.
READY_PAY_ORDER
&&
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
p
style=
{
{
marginTop
:
12
,
fontSize
:
12
,
color
:
'#6B778C'
}
}
>
本次需支付
</
p
>
<
p
>
¥
{
formData
.
sumPrice
}
</
p
>
</
div
>
}
</>
},
[
formData
])
</
div
>
const
detailList
=
[
{
label
:
'对应报价单号'
,
name
:
'quotationNo'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'orderThe'
,
span
:
8
},
...
...
@@ -199,7 +222,7 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
return
formData
?
(
<
div
>
<
OrderDetailContext
.
Provider
value=
{
formContext
}
>
<
OrderDetailHeader
headerTitle=
{
headerTiTle
}
detailList=
{
detailList
}
detailData=
{
formData
}
extraRight=
{
extraRight
}
/>
<
OrderDetailHeader
headerTitle=
{
headerTiTle
}
detailList=
{
detailList
}
detailData=
{
formData
}
extraRight=
{
extraRight
()
}
/>
<
OrderDetailWrapper
>
<
div
className=
'gray-wrap'
>
{
/* 工作流进度 */
}
...
...
src/pages/transaction/purchaseOrder/readyConfirmContract/model/useSelfTable.tsx
View file @
5308c476
import
React
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
}
from
'antd'
import
{
Button
,
Popconfirm
}
from
'antd'
import
{
baseOrderListColumns
}
from
'../../constant'
import
{
PublicApi
}
from
'@/services/api'
// 业务hooks, 待新增订单
export
const
useSelfTable
=
()
=>
{
const
[
isSign
,
setIsSign
]
=
useState
(
false
)
const
handleConfirm
=
async
(
record
)
=>
{
//@todo 是否签约电子签章, 如果没有,需跳转至签约页面
const
{
data
}
=
await
PublicApi
.
getOrderSignatureAuthAuthState
()
const
flag
=
true
if
(
flag
||
data
.
state
===
1
)
{
if
(
isSign
)
{
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/orderPreview?page_type=4&id=
${
record
.
id
}
&preview=0`
)
}
else
{
// 未认证
console
.
log
(
'未认证电子合同'
)
}
}
useEffect
(()
=>
{
PublicApi
.
getOrderSignatureAuthAuthState
().
then
(({
data
})
=>
{
setIsSign
(
data
.
state
===
1
)
})
},
[])
const
secondColumns
:
any
[]
=
baseOrderListColumns
.
concat
([
{
title
:
'操作'
,
...
...
@@ -23,7 +29,9 @@ export const useSelfTable = () => {
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认电子合同
</
Button
>
<
Popconfirm
title=
'您未申请电子签章是否需要立即前往?'
>
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认电子合同
</
Button
>
</
Popconfirm
>
</>
}
])
...
...
src/pages/transaction/saleOrder/constant/index.tsx
View file @
5308c476
...
...
@@ -13,7 +13,7 @@ export const baseOrderListColumns: any[] = [
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/
purchas
eOrder/orderPreview?page_type=-1&id=${record.id}&preview=1`
}
>
return
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/
sal
eOrder/orderPreview?page_type=-1&id=${record.id}&preview=1`
}
>
{
text
}
</
EyePreview
>
}
...
...
src/pages/transaction/saleOrder/orderPreview/components/orderProductTable/index.tsx
View file @
5308c476
import
React
,
{
useContext
,
useState
,
useRef
,
useEffect
}
from
'react'
import
React
,
{
useContext
,
useState
,
useRef
,
useEffect
,
useCallback
}
from
'react'
import
{
StandardTable
}
from
'god'
import
{
Card
,
Table
,
Form
,
Input
,
Row
,
Col
,
Button
,
Modal
}
from
'antd'
import
{
OrderDetailContext
}
from
'../../context'
...
...
@@ -11,6 +11,8 @@ import { createFormActions } from '@formily/antd'
import
MellowCard
from
'@/components/MellowCard'
import
{
SALE_ORDER_STATUS
}
from
'../../constant'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
import
ModalTable
from
'@/components/ModalTable'
import
{
formatTimeString
}
from
'@/utils'
export
interface
OrderProductTableProps
{}
...
...
@@ -39,6 +41,45 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
}
`
const
warehouseColumns
:
any
[]
=
[
{
dataIndex
:
'freightSpaceId'
,
key
:
'freightSpaceId'
,
title
:
'仓位ID'
,
align
:
'center'
},
{
dataIndex
:
'freightSpaceName'
,
key
:
'freightSpaceName'
,
title
:
'仓位名称'
,
align
:
'center'
},
{
dataIndex
:
'warehouseName'
,
key
:
'warehouseName'
,
title
:
'对应仓库'
,
align
:
'center'
},
{
dataIndex
:
'goodsName'
,
key
:
'goodsName'
,
title
:
'对应货品'
,
align
:
'center'
},
{
dataIndex
:
'reductionInventory'
,
key
:
'reductionInventory'
,
title
:
'扣减仓位库存'
,
align
:
'center'
},
{
dataIndex
:
'createTime'
,
key
:
'createTime'
,
title
:
'扣减时间'
,
align
:
'center'
,
render
:
text
=>
formatTimeString
(
text
)
}
]
const
modalPriceActions
=
createFormActions
()
// 总计金额联动框
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
...
...
@@ -211,6 +252,11 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
{
ctl
,
data
}
=
useContext
(
OrderDetailContext
)
const
{
page_type
}
=
usePageStatus
()
const
{
orderProductRequests
=
[]
}
=
data
||
{}
const
[
warehouseVisible
,
setWarehouseVisible
]
=
useState
(
false
)
const
[
checkProductId
,
setCheckProductId
]
=
useState
(
0
)
// 选中的商品id
const
warehouseRef
=
useRef
<
any
>
({})
// 判断是否可操作当前表格
const
isEditData
=
SALE_ORDER_STATUS
.
READY_APPROVED_ORDER
===
parseInt
(
page_type
)
const
productComponents
=
{
...
...
@@ -265,6 +311,11 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
})
};
const
handlePreviewWarehouse
=
(
record
)
=>
{
setCheckProductId
(
record
.
id
)
setWarehouseVisible
(
true
)
}
const
productInfoColumns
:
any
[]
=
[
{
title
:
'ID'
,
...
...
@@ -274,21 +325,21 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
},
{
title
:
'商品名称'
,
dataIndex
:
'
n
ame'
,
dataIndex
:
'
productN
ame'
,
align
:
'center'
,
key
:
'
n
ame'
,
key
:
'
productN
ame'
,
},
{
title
:
'品类'
,
dataIndex
:
'c
ustomerCategoryName
'
,
dataIndex
:
'c
ategory
'
,
align
:
'center'
,
key
:
'c
ustomerCategoryName
'
,
key
:
'c
ategory
'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand
Name
'
,
dataIndex
:
'brand'
,
align
:
'center'
,
key
:
'brand
Name
'
,
key
:
'brand'
,
},
{
title
:
'单位'
,
...
...
@@ -343,11 +394,14 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
align
:
'center'
,
key
:
'record'
,
// @todo 尚未实现, 需UI设计
render
:
text
=>
<
Button
type=
'link'
>
查看(未实现)
</
Button
>
render
:
(
_
,
record
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
handlePreviewWarehouse
(
record
)
}
>
查看
</
Button
>
},
]
const
fetchWarehouseData
=
useCallback
(
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getWarehousePositionDeductionRecordList
({...
params
,
productId
:
String
(
checkProductId
)})
return
data
},
[
checkProductId
])
const
columns
=
productInfoColumns
.
map
(
col
=>
{
if
(
!
col
.
editable
)
{
...
...
@@ -374,6 +428,16 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
pagination=
{
false
}
/>
<
MoneyTotalBox
dataSource=
{
data
}
isEditData=
{
isEditData
}
/>
<
ModalTable
columns=
{
warehouseColumns
}
modalTitle=
'仓位库存扣减记录'
visible=
{
warehouseVisible
}
cancel=
{
()
=>
setWarehouseVisible
(
false
)
}
currentRef=
{
warehouseRef
}
confirm=
{
()
=>
setWarehouseVisible
(
false
)
}
fetchTableData=
{
params
=>
fetchWarehouseData
(
params
)
}
/>
</
MellowCard
>
)
}
...
...
src/pages/transaction/saleOrder/orderPreview/index.tsx
View file @
5308c476
...
...
@@ -24,6 +24,7 @@ import OrderDeleveRecord from './components/orderDeleveRecord'
export
interface
CommonOrderDetailProps
{}
const
CommonOrderDetail
:
React
.
FC
<
CommonOrderDetailProps
>
=
(
props
)
=>
{
const
[
btnLoading
,
setBtnLoading
]
=
useState
<
boolean
>
(
false
)
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
let
{
id
,
pageStatus
,
page_type
=
SALE_ORDER_STATUS
.
READY_APPROVED_ORDER
,
orderDeliveryDetailsId
}
=
usePageStatus
()
page_type
=
Number
(
page_type
)
...
...
@@ -52,6 +53,8 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
const
handleSubmit
=
async
()
=>
{
let
result
:
any
=
{}
const
caseData
=
typeof
page_type
===
'string'
?
parseInt
(
page_type
)
:
page_type
setBtnLoading
(
true
)
switch
(
caseData
)
{
case
SALE_ORDER_STATUS
.
READY_APPROVED_ORDER
:
{
//@todo 暂时写死
...
...
@@ -133,6 +136,7 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
if
(
result
.
code
===
1000
)
{
history
.
goBack
()
}
setBtnLoading
(
false
)
}
const
startPush
=
()
=>
{
...
...
@@ -145,26 +149,35 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
}
const
renderExtra
=
()
=>
{
if
(
!
formData
)
{
if
(
!
formData
||
page_type
===
SALE_ORDER_STATUS
.
PREVIEW_ORDER
)
{
return
null
}
let
text
=
''
switch
(
formData
.
purchaseOrderInteriorState
)
{
case
SaleOrderInsideWorkState
.
CONFIRM_ORDER
:
{
text
=
'确认提交'
break
;
}
case
SaleOrderInsideWorkState
.
CONFIRM_DELIVERY_ORDER
:
{
return
<
Button
type=
'primary'
onClick=
{
startPush
}
>
确认全部已发货
</
Button
>
text
=
'确认全部已发货'
break
;
}
case
SaleOrderInsideWorkState
.
CONFIRM_RECEIPT
:
{
return
<
Button
type=
'primary'
onClick=
{
startPush
}
>
确认全部已回单
</
Button
>
text
=
'确认全部已回单'
break
;
}
default
:
{
return
<
Button
type=
'primary'
onClick=
{
startPush
}
>
提交审核
</
Button
>
text
=
'提交审核'
break
;
}
}
return
<
Button
type=
'primary'
onClick=
{
startPush
}
loading=
{
btnLoading
}
>
{
text
}
</
Button
>
}
const
detailList
=
[
{
label
:
'对应报价单号'
,
name
:
'quotationNo'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'orderThe'
,
span
:
8
},
{
label
:
'供应会员'
,
name
:
'supplyMembersName'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'供应会员'
,
name
:
'supplyMembersName'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderModel'
,
span
:
8
,
render
:
text
=>
GlobalConfig
.
web
.
orderMode
[
text
].
label
},
{
label
:
'订单类型'
,
name
:
'type'
,
span
:
8
,
render
:
text
=>
orderTypeLabel
[
text
]
},
{
label
:
'下单时间'
,
name
:
'createTime'
,
span
:
8
,
render
:
text
=>
formatTimeString
(
text
)
},
...
...
src/pages/transaction/stockSellStorage/bills/addBills/index.tsx
View file @
5308c476
...
...
@@ -47,7 +47,7 @@ const AddBills: React.FC<{}> = (props: any) => {
pageStatus
,
preview
,
id
,
invoicesTypeId
,
// 单据类型
编码
invoicesTypeId
,
// 单据类型
ID
relevanceInvoices
,
// 对应单据
relevanceInvoicesId
,
// 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
}
=
usePageStatus
();
...
...
@@ -186,7 +186,9 @@ const AddBills: React.FC<{}> = (props: any) => {
return
;
}
switch
(
invoicesTypeId
)
{
const
intInvoicesTypeId
=
+
invoicesTypeId
;
switch
(
intInvoicesTypeId
)
{
// 采购入库单
case
DOC_TYPE_PURCHASE_RECEIPT
:
{
setInfoLoading
(
true
);
...
...
@@ -216,7 +218,7 @@ const AddBills: React.FC<{}> = (props: any) => {
}
);
setBillInfo
({
invoicesTypeId
,
invoicesTypeId
:
intInvoicesTypeId
,
relevanceInvoices
:
+
relevanceInvoices
,
orderNo
:
relevanceInvoicesId
?
...
...
@@ -271,7 +273,7 @@ const AddBills: React.FC<{}> = (props: any) => {
}
);
setBillInfo
({
invoicesTypeId
,
invoicesTypeId
:
intInvoicesTypeId
,
relevanceInvoices
:
+
relevanceInvoices
,
orderNo
:
relevanceInvoicesId
?
...
...
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
5308c476
...
...
@@ -68,7 +68,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
// 获取手机code
const
fetchTelCode
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageGetTelCode
();
const
{
data
}
=
await
PublicApi
.
getManage
CountryArea
GetTelCode
();
return
data
;
};
...
...
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