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
968311d7
Commit
968311d7
authored
Nov 24, 2020
by
前端-许佳敏
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
1b64ae16
ee9e16ad
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
492 additions
and
109 deletions
+492
-109
CustomRelevance.tsx
src/components/NiceForm/components/CustomRelevance.tsx
+1
-1
useBusinessEffects.ts
.../bills/components/BillsForm/effects/useBusinessEffects.ts
+203
-73
index.tsx
...ion/stockSellStorage/bills/components/BillsForm/index.tsx
+143
-27
index.ts
...ockSellStorage/bills/components/BillsForm/schema/index.ts
+144
-1
index.tsx
src/pages/transaction/stockSellStorage/inventory/index.tsx
+1
-7
No files found.
src/components/NiceForm/components/CustomRelevance.tsx
View file @
968311d7
...
...
@@ -42,7 +42,7 @@ const Relevance = props => {
fetchTableData
,
title
=
'选择'
,
tip
=
''
,
// 点击按钮前的提示,用于前提需要提示的场景
disabled
=
false
,
disabled
=
false
,
}
=
props
.
props
[
'x-component-props'
];
const
tableRowKey
=
tableProps
.
rowKey
||
'id'
;
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/effects/useBusinessEffects.ts
View file @
968311d7
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-2
3 19:14:12
* @LastEditTime: 2020-11-2
4 17:17:13
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
...
...
@@ -36,6 +36,8 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
purchaseOrderBillSchema
,
machiningWarehousingBillSchema
,
machiningDeliveryBillSchema
,
}
from
'../schema'
;
const
{
...
...
@@ -116,22 +118,22 @@ const salesOrderColumns: any[] = [
},
];
//
生成通知
单列表
const
production
Columns
=
[
//
加工入库
单列表
const
machiningWarehousing
Columns
=
[
{
title
:
'通知单号'
,
align
:
'center'
,
dataIndex
:
'
order
No'
,
dataIndex
:
'
notice
No'
,
},
{
title
:
'通知单摘要'
,
align
:
'center'
,
dataIndex
:
'
invoicesAbstract
'
,
dataIndex
:
'
summary
'
,
},
{
title
:
'加工企业名称'
,
align
:
'center'
,
dataIndex
:
'
member
Name'
,
dataIndex
:
'
process
Name'
,
},
{
title
:
'单据时间'
,
...
...
@@ -141,7 +143,36 @@ const productionColumns = [
{
title
:
'申请单状态'
,
align
:
'center'
,
dataIndex
:
'state'
,
dataIndex
:
'outerStatusName'
,
},
];
// 加工发货单列表
const
machiningDeliveryColumns
=
[
{
title
:
'通知单号'
,
align
:
'center'
,
dataIndex
:
'noticeNo'
,
},
{
title
:
'通知单摘要'
,
align
:
'center'
,
dataIndex
:
'summary'
,
},
{
title
:
'供应会员'
,
align
:
'center'
,
dataIndex
:
'supplierName'
,
},
{
title
:
'单据时间'
,
align
:
'center'
,
dataIndex
:
'createTime'
,
},
{
title
:
'申请单状态'
,
align
:
'center'
,
dataIndex
:
'outerStatusName'
,
},
];
...
...
@@ -180,7 +211,13 @@ const fetchOrderPurchaseReceiptAddList = async (params: any) => {
...
params
,
})
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
return
{
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
memberName
:
item
.
supplyMembersName
,
})),
total
:
res
.
data
.
totalCount
,
};
}
return
[];
};
...
...
@@ -191,7 +228,59 @@ const getOrderSalesInvoiceOrderList = async (params: any) => {
...
params
,
})
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
return
{
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
memberName
:
item
.
memberName
,
})),
total
:
res
.
data
.
totalCount
,
};
}
return
[];
};
// 获取加工入库单单相关数据
const
getMachiningWarehousingList
=
async
(
params
:
any
)
=>
{
const
{
search
,
...
rest
}
=
params
;
const
res
=
await
PublicApi
.
getEnhanceSupplierToBeAddStorageList
({
noticeNo
:
search
,
...
rest
,
})
if
(
res
.
code
===
1000
)
{
return
{
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
memberName
:
item
.
processName
,
deliveryAddresId
:
+
item
.
receiverAddressId
,
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
})),
total
:
res
.
data
.
totalCount
,
};
}
return
[];
};
// 获取加工发货单单相关数据
const
getMachiningDeliveryList
=
async
(
params
:
any
)
=>
{
const
{
search
,
...
rest
}
=
params
;
const
res
=
await
PublicApi
.
getEnhanceProcessToBeAddDeliveryList
({
noticeNo
:
search
,
...
rest
,
})
if
(
res
.
code
===
1000
)
{
return
{
data
:
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
memberName
:
item
.
supplierName
,
deliveryAddresId
:
+
item
.
receiverAddressId
,
fullAddress
:
item
.
receiveAddress
||
''
,
receiverName
:
item
.
receiveUserName
||
''
,
phone
:
item
.
receiveUserTel
||
''
,
})),
total
:
res
.
data
.
totalCount
,
};;
}
return
[];
};
...
...
@@ -249,14 +338,24 @@ const getParams = type => {
basicParams
.
tableProps
.
lableKey
=
'orderNo'
;
break
;
}
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
basicParams
.
modalProps
.
title
=
'选择生产通知单'
;
basicParams
.
columns
=
machiningWarehousingColumns
;
basicParams
.
fetchTableData
=
getMachiningWarehousingList
;
basicParams
.
formilyProps
.
ctx
.
schema
=
machiningWarehousingBillSchema
;
basicParams
.
tableProps
.
lableKey
=
'noticeNo'
;
break
;
}
// 加工发货单
case
DOC_TYPE_PROCESS_INVOICE
:
{
basicParams
.
modalProps
.
title
=
'选择生产通知单'
;
basicParams
.
columns
=
production
Columns
;
basicParams
.
fetchTableData
=
get
OrderSalesInvoiceOrder
List
;
basicParams
.
formilyProps
.
ctx
.
schema
=
{};
// 缺
basicParams
.
tableProps
.
lableKey
=
'
order
No'
;
basicParams
.
columns
=
machiningDelivery
Columns
;
basicParams
.
fetchTableData
=
get
MachiningDelivery
List
;
basicParams
.
formilyProps
.
ctx
.
schema
=
machiningDeliveryBillSchema
;
basicParams
.
tableProps
.
lableKey
=
'
notice
No'
;
break
;
}
...
...
@@ -329,8 +428,12 @@ export const useBusinessEffects = (context, actions) => {
}
linkage
.
value
(
'relevanceInvoices'
,
undefined
);
linkage
.
value
(
'invoicesDetailsRequests'
,
[]);
linkage
.
enum
(
'relevanceInvoices'
,
newEnum
);
const
invoicesDetailsRequestsVal
=
getFieldValue
(
'invoicesDetailsRequests'
);
if
(
invoicesDetailsRequestsVal
&&
invoicesDetailsRequestsVal
.
length
)
{
linkage
.
value
(
'invoicesDetailsRequests'
,
[]);
}
const
orderNoVal
=
getFieldValue
(
'orderNo'
);
if
(
orderNoVal
&&
orderNoVal
.
length
)
{
...
...
@@ -354,58 +457,11 @@ export const useBusinessEffects = (context, actions) => {
// 关联单据改变
onFieldValueChange$
(
'orderNo'
).
subscribe
(
fieldState
=>
{
const
relevanceInvoicesVal
=
getFieldValue
(
'relevanceInvoices'
);
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
const
first
=
fieldState
.
value
&&
fieldState
.
value
[
0
];
console
.
log
(
'first'
,
first
)
switch
(
invoicesTypeIdVal
)
{
// 采购入库单
case
DOC_TYPE_PURCHASE_RECEIPT
:
{
setFieldValue
(
'memberName'
,
first
?
first
.
supplyMembersName
:
''
);
break
;
}
// 销售发货单
case
DOC_TYPE_SALES_INVOICE
:
{
setFieldValue
(
'memberName'
,
first
?
first
.
createMemberName
:
''
);
break
;
}
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
break
;
}
// 加工发货单
case
DOC_TYPE_PROCESS_INVOICE
:
{
setFieldValue
(
'memberName'
,
first
?
first
.
supplierName
:
''
);
break
;
}
// 退货发货单、退货入库单
case
DOC_TYPE_RETURN_INVOICE
:
case
DOC_TYPE_RETURN_RECEIPT
:
{
break
;
}
// 换货发货单、换货入库单
case
DOC_TYPE_EXCHANGE_INVOICE
:
case
DOC_TYPE_EXCHANGE_RECEIPT
:
{
break
;
}
default
:
{
break
;
}
}
// 设置单据公用的数据相关
setFieldValue
(
'memberName'
,
first
?
first
.
memberName
:
''
);
setFieldValue
(
'address'
,
first
?
`
${
first
.
fullAddress
}
${
first
.
receiverName
}
/
${
first
.
phone
}
`
:
''
);
// 以下数据只用于收集,不用于展示
...
...
@@ -440,10 +496,35 @@ export const useBusinessEffects = (context, actions) => {
break
;
}
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
// 从加工单详情获取 商品 数据
PublicApi
.
getEnhanceSupplierToBeAddStorageDetails
({
id
:
first
.
id
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
const
{
details
=
[],
deliveryType
,
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productId
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
.
map
(
item
=>
({
...
item
,
// 这里的数据以采购、销售订单的为准
logistics
:
{
deliveryType
,
// 手动赋值配送方式,同一个通知单下的所有商品都是统一的配送方式
},
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
});
break
;
break
;
}
...
...
@@ -457,14 +538,21 @@ export const useBusinessEffects = (context, actions) => {
return
;
}
const
{
details
,
details
=
[],
deliveryType
,
}
=
res
.
data
;
const
goodOptions
=
details
.
map
(
item
=>
({
label
:
`
${
item
.
productName
}${
item
.
orderNo
?
'---'
+
item
.
orderNo
:
''
}
`
,
value
:
item
.
productId
,
}));
setFieldState
(
'invoicesDetailsRequests.*.product'
,
state
=>
{
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
);
FormPath
.
setIn
(
state
,
'originAsyncData'
,
details
.
map
(
item
=>
({
...
item
,
// 这里的数据以采购、销售订单的为准
logistics
:
{
deliveryType
,
// 手动赋值配送方式,同一个通知单下的所有商品都是统一的配送方式
},
})));
FormPath
.
setIn
(
state
,
'props.enum'
,
goodOptions
);
});
});
...
...
@@ -494,7 +582,10 @@ export const useBusinessEffects = (context, actions) => {
// 关联单据改变
onFieldInputChange$
(
'orderNo'
).
subscribe
(
fieldState
=>
{
setFieldValue
(
'invoicesDetailsRequests'
,
[]);
const
invoicesDetailsRequestsVal
=
getFieldValue
(
'invoicesDetailsRequests'
);
if
(
invoicesDetailsRequestsVal
&&
invoicesDetailsRequestsVal
.
length
)
{
linkage
.
value
(
'invoicesDetailsRequests'
,
[]);
}
});
// 关联明细
...
...
@@ -513,6 +604,8 @@ export const useBusinessEffects = (context, actions) => {
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
productId
===
value
);
console
.
log
(
'current'
,
current
)
// 取消选择
if
(
!
value
)
{
setFieldState
(
...
...
@@ -536,7 +629,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.price`
}),
state
=>
{
state
.
value
=
''
;
state
.
value
=
null
;
}
);
setFieldState
(
...
...
@@ -552,7 +645,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
`¥0.00`
;
state
.
value
=
null
;
}
);
// 配送方式,一个单据只能有一个配送方式
...
...
@@ -574,6 +667,25 @@ export const useBusinessEffects = (context, actions) => {
setFieldValue
(
'transport'
,
''
);
setFieldValue
(
'deliveryType'
,
null
);
}
// 加工发货单
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.orderNo`
}),
state
=>
{
state
.
value
=
''
;
}
);
// 加工发货单
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.id`
}),
state
=>
{
state
.
value
=
''
;
}
);
}
if
(
!
current
)
{
...
...
@@ -601,7 +713,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.price`
}),
state
=>
{
state
.
value
=
current
.
price
?
current
.
price
.
toFixed
(
2
)
:
''
;
state
.
value
=
current
.
price
?
current
.
price
.
toFixed
(
2
)
:
null
;
}
);
setFieldState
(
...
...
@@ -617,7 +729,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
current
.
price
?
`¥
${(
current
.
purchaseCount
*
current
.
price
).
toFixed
(
2
)}
`
:
''
;
state
.
value
=
current
.
price
?
`¥
${(
current
.
purchaseCount
*
current
.
price
).
toFixed
(
2
)}
`
:
null
;
}
);
// 配送方式,一个单据只能有一个配送方式
...
...
@@ -629,6 +741,24 @@ export const useBusinessEffects = (context, actions) => {
state
.
value
=
current
.
logistics
&&
current
.
logistics
.
deliveryType
?
current
.
logistics
.
deliveryType
:
undefined
;
}
);
// 加工发货单
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.orderNo`
}),
state
=>
{
state
.
value
=
current
.
orderNo
;
}
);
// 加工发货单
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.id`
}),
state
=>
{
state
.
value
=
current
.
id
;
}
);
setTimeout
(()
=>
{
const
invoicesDetailsRequestsValue
=
getFieldValue
(
'invoicesDetailsRequests'
);
...
...
@@ -678,13 +808,13 @@ export const useBusinessEffects = (context, actions) => {
state
=>
state
.
value
,
);
const
current
=
originAsyncData
?
originAsyncData
.
find
(
item
=>
item
.
productId
===
goodId
)
:
null
;
const
invoicesTypeIdVal
=
getFieldValue
(
'invoicesTypeId'
);
if
(
!
current
)
{
return
;
}
if
(
+
value
>
current
.
purchaseCount
)
{
Modal
.
destroyAll
();
Modal
.
confirm
({
title
:
'提示'
,
content
:
'单据数量已超过商品数量'
,
...
...
@@ -698,7 +828,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
current
.
price
?
`¥
${(
+
value
*
current
.
price
).
toFixed
(
2
)}
`
:
''
;
state
.
value
=
current
.
price
?
`¥
${(
+
value
*
current
.
price
).
toFixed
(
2
)}
`
:
null
;
}
);
});
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/index.tsx
View file @
968311d7
...
...
@@ -274,7 +274,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
orderNo
,
id
:
+
relevanceInvoicesId
,
deliveryAddresId
:
+
deliveryAddresId
,
createMemberName
,
memberName
:
createMemberName
,
fullAddress
:
deliveryAddressInfo
.
fullAddress
||
''
,
receiverName
:
deliveryAddressInfo
.
receiverName
||
''
,
phone
:
deliveryAddressInfo
.
phone
||
''
,
...
...
@@ -292,7 +292,45 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
setInfoLoading
(
true
);
PublicApi
.
getEnhanceSupplierToBeAddStorageDetails
({
id
:
relevanceInvoicesId
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
const
{
processName
,
receiverAddressId
,
noticeNo
,
receiveAddress
,
receiveUserName
,
receiveUserTel
,
deliveryType
,
}
=
res
.
data
;
setBillInfo
({
invoicesTypeId
:
intInvoicesTypeId
,
relevanceInvoices
:
+
relevanceInvoices
,
orderNo
:
relevanceInvoicesId
?
[
{
orderNo
:
noticeNo
,
id
:
+
relevanceInvoicesId
,
deliveryAddresId
:
+
receiverAddressId
,
memberName
:
processName
,
fullAddress
:
receiveAddress
||
''
,
receiverName
:
receiveUserName
||
''
,
phone
:
receiveUserTel
||
''
,
}
]
:
[]
,
});
}).
finally
(()
=>
{
setInfoLoading
(
false
);
});
break
;
}
...
...
@@ -325,11 +363,10 @@ const BillsForm: React.FC<BillsFormProps> = ({
orderNo
:
noticeNo
,
id
:
+
relevanceInvoicesId
,
deliveryAddresId
:
+
receiverAddressId
,
supplierName
,
memberName
:
supplierName
,
fullAddress
:
receiveAddress
||
''
,
receiverName
:
receiveUserName
||
''
,
phone
:
receiveUserTel
||
''
,
// isDefault: deliveryAddressInfo.isDefault,
}
]
:
[]
...
...
@@ -399,6 +436,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
</
Button
>
)
:
null
;
// 提交
const
handleSubmit
=
value
=>
{
const
{
invoicesTypeId
,
...
...
@@ -421,14 +459,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
}));
const
newTransactionTime
=
transactionTime
?
moment
(
transactionTime
).
valueOf
()
:
null
;
const
payload
=
{
orderNo
:
orderNo
[
0
].
orderNo
,
relevanceInvoicesId
:
orderNo
[
0
].
id
,
transactionTime
:
newTransactionTime
,
invoicesDetailsRequests
:
newInvoicesDetailsRequests
,
...
rest
,
};
setSubmitLoading
(
true
);
switch
(
invoicesTypeId
)
{
// 采购入库单
...
...
@@ -438,7 +468,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
return
;
}
PublicApi
.
postOrderPurchaseReceiptAdd
({
...
payload
,
...
rest
,
orderNo
:
orderNo
[
0
].
orderNo
,
relevanceInvoicesId
:
orderNo
[
0
].
id
,
transactionTime
:
newTransactionTime
,
invoicesDetailsRequests
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
itemNmae
:
item
.
itemName
,
})),
supplyMembersName
:
memberName
,
})
.
then
(
res
=>
{
...
...
@@ -459,11 +496,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
+
id
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
inventoryId
:
payload
.
inventoryId
,
inventoryRole
:
payload
.
inventoryRole
,
transactionTime
:
payload
.
transactionTime
,
invoicesDetailsRequests
:
payload
.
invoicesDetailsRequests
,
invoicesAbstract
:
rest
.
invoicesAbstract
,
inventoryId
:
rest
.
inventoryId
,
inventoryRole
:
rest
.
inventoryRole
,
transactionTime
:
newTransactionTime
,
invoicesDetailsRequests
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
itemNmae
:
item
.
itemName
,
})),
})
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
...
...
@@ -487,7 +527,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
return
;
}
PublicApi
.
postOrderSalesInvoiceOrder
({
...
payload
,
...
rest
,
orderNo
:
orderNo
[
0
].
orderNo
,
relevanceInvoicesId
:
orderNo
[
0
].
id
,
transactionTime
:
newTransactionTime
,
invoicesDetailsRequests
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
itemNmae
:
item
.
itemName
,
})),
createMemberName
:
memberName
,
})
.
then
(
res
=>
{
...
...
@@ -508,11 +555,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
+
id
,
invoicesAbstract
:
payload
.
invoicesAbstract
,
inventoryId
:
payload
.
inventoryId
,
inventoryRole
:
payload
.
inventoryRole
,
transactionTime
:
payload
.
transactionTime
,
invoicesDetailsRequests
:
payload
.
invoicesDetailsRequests
,
invoicesAbstract
:
rest
.
invoicesAbstract
,
inventoryId
:
rest
.
inventoryId
,
inventoryRole
:
rest
.
inventoryRole
,
transactionTime
:
newTransactionTime
,
invoicesDetailsRequests
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
itemNmae
:
item
.
itemName
,
})),
})
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
...
...
@@ -531,13 +581,79 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 加工入库单
case
DOC_TYPE_PROCESS_RECEIPT
:
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
PublicApi
.
postEnhanceSupplierToBeAddStorageSubmit
({
produceNoticeOrderId
:
orderNo
[
0
].
id
,
warehouseId
:
rest
.
inventoryId
,
warehouseRole
:
rest
.
inventoryRole
,
storageSummary
:
rest
.
invoicesAbstract
,
storageTime
:
newTransactionTime
,
storageDetailsDTOList
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
produceNoticeOrderDetailId
:
item
.
id
,
storageCount
:
item
.
productCount
,
})),
})
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnsaved
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
// update action
if
(
!
isEdit
)
{
return
;
}
}
break
;
}
// 加工发货单
case
DOC_TYPE_PROCESS_INVOICE
:
{
if
(
!
id
)
{
if
(
isEdit
)
{
return
;
}
PublicApi
.
postEnhanceProcessToBeAddDeliverySubmit
({
produceNoticeOrderId
:
orderNo
[
0
].
id
,
warehouseId
:
rest
.
inventoryId
,
warehouseRole
:
rest
.
inventoryRole
,
invoiceSummary
:
rest
.
invoicesAbstract
,
invoiceTime
:
newTransactionTime
,
invoiceDetailsDTOList
:
newInvoicesDetailsRequests
.
map
(
item
=>
({
...
item
,
produceNoticeOrderDetailId
:
item
.
id
,
shipmentQuantity
:
item
.
productCount
,
})),
})
.
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnsaved
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
}
else
{
// update action
if
(
!
isEdit
)
{
return
;
}
}
break
;
}
...
...
@@ -582,7 +698,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const
atom
=
{
itemNo
:
item
.
code
,
goodsId
:
item
.
id
,
itemN
ma
e
:
item
.
name
,
itemN
am
e
:
item
.
name
,
specifications
:
item
.
type
,
category
:
item
.
customerCategory
?
item
.
customerCategory
.
name
:
''
,
brand
:
item
.
brand
?
item
.
brand
.
name
:
''
,
...
...
src/pages/transaction/stockSellStorage/bills/components/BillsForm/schema/index.ts
View file @
968311d7
...
...
@@ -419,7 +419,7 @@ export const addBillSchema: ISchema = {
title
:
'货号'
,
'x-component'
:
'Text'
,
},
itemN
ma
e
:
{
itemN
am
e
:
{
type
:
'string'
,
title
:
'货品名称'
,
'x-component'
:
'Text'
,
...
...
@@ -508,6 +508,16 @@ export const addBillSchema: ISchema = {
type
:
'string'
,
display
:
false
,
},
// 明细 商品记录id(加工发货单需要),不用于展示,只收集值
id
:
{
type
:
'string'
,
display
:
false
,
},
// 订单号(加工发货单需要),不用于展示,只收集值
orderNo
:
{
type
:
'string'
,
display
:
false
,
},
},
}
},
...
...
@@ -520,6 +530,7 @@ export const addBillSchema: ISchema = {
},
};
// 采购入库单、销售发货单订单 弹窗 search schema
export
const
purchaseOrderBillSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
...
...
@@ -608,6 +619,138 @@ export const purchaseOrderBillSchema: ISchema = {
},
};
// 加工入库单 弹窗 search schema
export
const
machiningWarehousingBillSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megaLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
properties
:
{
search
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-mega-props'
:
{},
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-start'
,
tip
:
'输入 通知单号 进行搜索'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
3
,
},
properties
:
{
summary
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'通知单摘要'
,
allowClear
:
true
,
},
},
processName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'加工企业'
,
allowClear
:
true
,
},
},
'[startTime, endTime]'
:
{
type
:
'string'
,
'x-component'
:
'DateSelect'
,
'x-component-props'
:
{
placeholder
:
'单据时间'
,
allowClear
:
true
,
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
}
}
},
},
},
},
},
};
// 加工发货单 弹窗 search schema
export
const
machiningDeliveryBillSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megaLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
properties
:
{
search
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-mega-props'
:
{},
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-start'
,
tip
:
'输入 通知单号 进行搜索'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
3
,
},
properties
:
{
summary
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'通知单摘要'
,
allowClear
:
true
,
},
},
supplierName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'供应会员'
,
allowClear
:
true
,
},
},
'[startTime, endTime]'
:
{
type
:
'string'
,
'x-component'
:
'DateSelect'
,
'x-component-props'
:
{
placeholder
:
'单据时间'
,
allowClear
:
true
,
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
}
}
},
},
},
},
},
};
export
const
goodsSearchSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
...
...
src/pages/transaction/stockSellStorage/inventory/index.tsx
View file @
968311d7
...
...
@@ -42,13 +42,7 @@ const Inventory: React.FC<{}> = () => {
title
:
'商品名称'
,
dataIndex
:
'goodsName'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/repositories/viewRepository?id=${record.id}&preview=1`
}
>
{
text
}
</
EyePreview
>
),
render
:
(
text
:
any
,
record
:
any
)
=>
text
,
},
{
title
:
'规格型号'
,
...
...
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