Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
dd274a42
Commit
dd274a42
authored
Dec 22, 2022
by
shenshaokai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jinfa-20221102' into 'jinfa-20221102'
fix: bugID=36488 不点击采购物料tab,直接生成合同或者保存的取值问题 See merge request project/jinfa-platform!480
parents
43abac58
db0481db
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
8 deletions
+118
-8
.gitignore
.gitignore
+2
-2
ContractText.tsx
src/pages/contract/manage/add/components/ContractText.tsx
+6
-4
FormList.tsx
src/pages/contract/manage/add/components/FormList.tsx
+0
-1
contracAdd.tsx
src/pages/contract/manage/add/contracAdd.tsx
+3
-1
index.ts
src/pages/contract/manage/add/utils/index.ts
+107
-0
No files found.
.gitignore
View file @
dd274a42
...
@@ -23,11 +23,11 @@ pnpm-lock.yaml
...
@@ -23,11 +23,11 @@ pnpm-lock.yaml
# mockStatic
# mockStatic
/.idea
/.idea
#
/config/base.config.json
/config/base.config.json
/src/services/index.ts
/src/services/index.ts
.vscode
.vscode
#
config/base.config.json
config/base.config.json
config/base.router.ts
config/base.router.ts
src/global/config/global.d.ts
src/global/config/global.d.ts
...
...
src/pages/contract/manage/add/components/ContractText.tsx
View file @
dd274a42
...
@@ -8,6 +8,7 @@ import { getIntl } from 'umi';
...
@@ -8,6 +8,7 @@ import { getIntl } from 'umi';
import
FileHt
from
'@/pages/contract/components/fileHt'
;
import
FileHt
from
'@/pages/contract/components/fileHt'
;
import
UploadFiles
from
'@/components/UploadFiles/UploadFiles'
import
UploadFiles
from
'@/components/UploadFiles/UploadFiles'
import
{
CloudUploadOutlined
}
from
'@ant-design/icons'
;
import
{
CloudUploadOutlined
}
from
'@ant-design/icons'
;
import
{
getPurchaseList
}
from
'../utils'
const
intl
=
getIntl
();
const
intl
=
getIntl
();
...
@@ -25,7 +26,7 @@ const imgLimitList = [
...
@@ -25,7 +26,7 @@ const imgLimitList = [
]
]
const
ContractText
=
(
props
:
any
)
=>
{
const
ContractText
=
(
props
:
any
)
=>
{
const
{
currentRef
,
memberId
,
purchaseMate
,
roleId
,
basicsVO
,
currency
,
Price
,
tabIndex
,
getOtherInfo
}
=
props
;
const
{
currentRef
,
memberId
,
purchaseMate
,
roleId
,
basicsVO
,
currency
,
Price
,
tabIndex
,
getOtherInfo
,
sourceType
}
=
props
;
const
[
templatePage
,
setTemplatePage
]
=
useState
<
any
>
([]);
const
[
templatePage
,
setTemplatePage
]
=
useState
<
any
>
([]);
const
[
template
,
setTemplate
]
=
useState
<
any
>
({});
const
[
template
,
setTemplate
]
=
useState
<
any
>
({});
const
[
templateDemo
,
setTemplateDemo
]
=
useState
<
any
>
({});
const
[
templateDemo
,
setTemplateDemo
]
=
useState
<
any
>
({});
...
@@ -87,9 +88,10 @@ const ContractText = (props: any) => {
...
@@ -87,9 +88,10 @@ const ContractText = (props: any) => {
/* 生成电子合同 */
/* 生成电子合同 */
const
generate
=
async
()
=>
{
const
generate
=
async
()
=>
{
const
purchaseMaterielList
=
const
purchaseMaterielList
=
(
await
purchaseMate
.
current
.
length
)
!=
0
(
purchaseMate
.
current
.
length
)
!=
0
?
await
purchaseMate
.
current
.
get
()
?
await
purchaseMate
.
current
.
get
()
:
[];
:
{
data
:
{
list
:
getPurchaseList
(
sourceType
)
}
};
if
(
!
template
.
id
)
{
if
(
!
template
.
id
)
{
message
.
info
(
intl
.
formatMessage
({
id
:
'contract.qingxianxuanzehetongmoban'
}))
message
.
info
(
intl
.
formatMessage
({
id
:
'contract.qingxianxuanzehetongmoban'
}))
}
else
{
}
else
{
...
@@ -221,7 +223,7 @@ const ContractText = (props: any) => {
...
@@ -221,7 +223,7 @@ const ContractText = (props: any) => {
>
>
</
Select
>
</
Select
>
{
{
<
Button
style=
{
{
marginLeft
:
20
}
}
type=
'link'
onClick=
{
()
=>
generate
()
}
>
{
intl
.
formatMessage
({
id
:
'contract.shengchenghetong'
})
}
</
Button
>
<
Button
style=
{
{
marginLeft
:
20
}
}
type=
'link'
onClick=
{
generate
}
>
{
intl
.
formatMessage
({
id
:
'contract.shengchenghetong'
})
}
</
Button
>
}
}
</
Form
.
Item
>
</
Form
.
Item
>
{
{
...
...
src/pages/contract/manage/add/components/FormList.tsx
View file @
dd274a42
...
@@ -179,7 +179,6 @@ const FormList = (props: any) => {
...
@@ -179,7 +179,6 @@ const FormList = (props: any) => {
i
.
bidAmount
=
(
i
.
bidCount
&&
i
.
price
)
?
new
BigNumber
(
+
i
.
bidCount
).
multipliedBy
(
i
.
price
).
toNumber
().
toFixed
(
2
)
:
''
i
.
bidAmount
=
(
i
.
bidCount
&&
i
.
price
)
?
new
BigNumber
(
+
i
.
bidCount
).
multipliedBy
(
i
.
price
).
toNumber
().
toFixed
(
2
)
:
''
})
})
console
.
log
(
'list'
,
newList
);
setData
(
newList
)
setData
(
newList
)
setIsPurchaseModalVisible
(
false
)
setIsPurchaseModalVisible
(
false
)
...
...
src/pages/contract/manage/add/contracAdd.tsx
View file @
dd274a42
...
@@ -14,6 +14,7 @@ import BigNumber from 'bignumber.js'
...
@@ -14,6 +14,7 @@ import BigNumber from 'bignumber.js'
import
FreightInfo
from
'./components/FreightInfo'
import
FreightInfo
from
'./components/FreightInfo'
import
OtherInfo
from
'./components/OtherInfo'
import
OtherInfo
from
'./components/OtherInfo'
import
BankInfo
from
'./components/BankInfo'
import
BankInfo
from
'./components/BankInfo'
import
{
getPurchaseList
}
from
'./utils'
const
intl
=
getIntl
();
const
intl
=
getIntl
();
...
@@ -235,6 +236,7 @@ const Add: React.FC<{}> = (props: any) => {
...
@@ -235,6 +236,7 @@ const Add: React.FC<{}> = (props: any) => {
Price=
{
Price
}
Price=
{
Price
}
tabIndex=
{
tabIndex
}
tabIndex=
{
tabIndex
}
form=
{
form
}
form=
{
form
}
sourceType=
{
type
}
/>
/>
},
},
]
]
...
@@ -291,7 +293,7 @@ const Add: React.FC<{}> = (props: any) => {
...
@@ -291,7 +293,7 @@ const Add: React.FC<{}> = (props: any) => {
delete
contractSourceVO
.
sourceId
delete
contractSourceVO
.
sourceId
}
}
/* 选择物料 */
/* 选择物料 */
const
purchaseMaterielList
=
await
purchaseMate
.
current
.
length
!=
0
?
await
purchaseMate
.
current
.
get
()
:
[]
;
const
purchaseMaterielList
=
purchaseMate
.
current
.
length
!=
0
?
await
purchaseMate
.
current
.
get
()
:
{
data
:
{
list
:
getPurchaseList
(
sourceType
)
}
}
;
if
(
purchaseMaterielList
.
length
!=
0
)
{
if
(
purchaseMaterielList
.
length
!=
0
)
{
purchaseMaterielList
.
data
.
list
.
map
(
item
=>
{
purchaseMaterielList
.
data
.
list
.
map
(
item
=>
{
totalAmount
+=
Number
(
item
.
bidAmount
)
totalAmount
+=
Number
(
item
.
bidAmount
)
...
...
src/pages/contract/manage/add/utils/index.ts
0 → 100644
View file @
dd274a42
import
BigNumber
from
'bignumber.js'
;
//相同物料组合成同一条
const
handlePurchaseData
=
(
selectRow
,
sourceType
:
number
)
=>
{
let
data
=
selectRow
;
let
newArray
=
data
.
reduce
((
total
,
cur
,
index
)
=>
{
let
hasValue
=
total
.
findIndex
(
current
=>
{
return
current
.
productNo
===
cur
.
productNo
;
});
hasValue
===
-
1
&&
total
.
push
(
cur
);
hasValue
!==
-
1
&&
(
total
[
hasValue
].
quantity
=
new
BigNumber
(
+
total
[
hasValue
].
quantity
)
.
plus
(
cur
.
quantity
)
.
toNumber
());
hasValue
!==
-
1
&&
(
total
[
hasValue
].
prpIds
=
total
[
hasValue
].
prpIds
+
','
+
cur
.
prpIds
);
return
total
;
},
[]);
return
newArray
.
map
((
item
:
any
,
index
:
number
)
=>
{
let
num
=
0
;
let
prpIdsList
=
item
.
prpIds
.
toString
().
split
(
','
);
selectRow
.
forEach
(
item
=>
{
if
(
prpIdsList
?.
length
&&
prpIdsList
.
indexOf
(
item
.
prpId
.
toString
())
>
-
1
)
{
if
(
item
.
productNo
==
item
.
productNo
&&
item
.
prpId
==
prpIdsList
[
prpIdsList
.
indexOf
(
item
.
prpId
.
toString
())]
)
{
num
=
new
BigNumber
(
+
item
.
num
).
plus
(
num
).
toNumber
();
}
}
});
return
{
id
:
0
,
materielId
:
item
.
id
,
materielNo
:
sourceType
!=
4
?
item
.
code
:
item
.
productNo
,
productNo
:
sourceType
!=
4
?
item
.
code
:
item
.
productNo
,
materielName
:
item
.
name
,
type
:
item
.
type
,
category
:
item
.
customerCategory
!=
null
?
item
.
customerCategory
.
name
:
''
,
brand
:
item
.
brand
!=
null
?
item
.
brand
.
name
:
''
,
unit
:
item
.
unitName
,
isHasTax
:
item
.
isHasTax
,
taxRate
:
item
.
taxRate
,
materialNo
:
item
.
materialNo
,
deliveryType
:
item
.
deliveryType
||
item
.
deliveryMethod
,
remark
:
item
.
remark
,
purchaseCount
:
sourceType
==
4
?
0
:
item
.
purchaseCount
,
price
:
item
.
price
||
''
,
advanceDeliveryDate
:
item
.
advanceDeliveryDate
,
bidCount
:
String
(
num
).
replace
(
/^
(
.*
\.
.
{4})
.*$/
,
'$1'
),
bidAmount
:
num
&&
item
.
price
?
new
BigNumber
(
+
num
)
.
multipliedBy
(
item
.
price
)
.
toNumber
()
.
toFixed
(
2
)
:
''
,
associatedMaterielName
:
item
.
associatedMaterielName
,
associatedGoods
:
item
.
associatedGoods
,
associatedDataId
:
item
.
associatedDataId
,
associatedMaterielNo
:
item
.
associatedMaterielNo
,
associatedType
:
item
.
associatedType
,
associatedCategory
:
item
.
associatedCategory
,
associatedBrand
:
item
.
associatedBrand
,
prpIds
:
sourceType
==
4
?
item
.
prpIds
?.
toString
().
split
(
','
)
:
null
,
goodsPic
:
item
.
goodsPic
||
[],
};
});
};
// 采购物料默认取值问题
// 假如不切换到采购物料的tab的话,拿不到值默认给他那缓存的数据生成
export
const
getPurchaseList
=
(
sourceType
:
number
)
=>
{
if
(
sourceType
==
4
)
{
try
{
let
list
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'recordList'
));
list
=
list
?.
map
((
item
:
any
)
=>
{
item
.
id
=
item
.
prpId
;
item
.
customerCategory
=
{
name
:
item
.
category
||
''
,
};
item
.
brand
=
{
name
:
item
.
brand
||
''
,
};
item
.
unitName
=
item
.
unit
;
item
.
type
=
item
.
spec
;
item
.
bidCount
=
item
.
quantity
;
item
.
num
=
item
.
quantity
;
item
.
quantity
=
item
.
quantity
;
item
.
prpIds
=
item
.
prpId
;
item
.
isHasTax
=
!!
item
.
taxPoint
?
1
:
0
;
item
.
taxRate
=
(
item
.
taxPoint
||
0
)
*
100
;
return
item
;
});
return
handlePurchaseData
(
JSON
.
parse
(
JSON
.
stringify
(
list
)),
sourceType
);
}
catch
(
error
)
{
return
[];
}
}
return
[];
};
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