Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
93a384df
Commit
93a384df
authored
Apr 30, 2021
by
季圣华
Browse files
优化采购入库的账户
parent
abc1287b
Changes
3
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/utils/util.js
View file @
93a384df
...
...
@@ -544,4 +544,22 @@ export function removeByVal(arrylist, val) {
break
;
}
}
}
/**
* 将数组单个金额中的数值转为负数
* @param arr
* @returns {Array}
*/
export
function
changeListFmtMinus
(
arr
)
{
var
newArr
=
new
Array
();
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
]
<
0
){
newArr
.
push
((
arr
[
i
]
-
0
).
toString
());
}
else
{
newArr
.
push
((
0
-
arr
[
i
]).
toString
());
}
}
return
newArr
;
}
\ No newline at end of file
jshERP-web/src/views/bill/dialog/ManyAccountModal.vue
View file @
93a384df
...
...
@@ -101,9 +101,9 @@
if
(
idList
[
1
])
{
this
.
model
.
twoAccountId
=
idList
[
1
]
-
0
}
if
(
idList
[
2
])
{
this
.
model
.
threeAccountId
=
idList
[
2
]
-
0
}
let
moneyList
=
moneyStr
.
split
(
"
,
"
)
if
(
moneyList
[
0
])
{
this
.
model
.
oneAccountPrice
=
moneyList
[
0
]}
if
(
moneyList
[
1
])
{
this
.
model
.
twoAccountPrice
=
moneyList
[
1
]}
if
(
moneyList
[
2
])
{
this
.
model
.
threeAccountPrice
=
moneyList
[
2
]}
if
(
moneyList
[
0
])
{
this
.
model
.
oneAccountPrice
=
Math
.
abs
(
moneyList
[
0
]
)
}
if
(
moneyList
[
1
])
{
this
.
model
.
twoAccountPrice
=
Math
.
abs
(
moneyList
[
1
]
)
}
if
(
moneyList
[
2
])
{
this
.
model
.
threeAccountPrice
=
Math
.
abs
(
moneyList
[
2
]
)
}
}
this
.
visible
=
true
;
this
.
$nextTick
(()
=>
{
...
...
jshERP-web/src/views/bill/modules/PurchaseInModal.vue
View file @
93a384df
...
...
@@ -123,7 +123,7 @@
import
{
FormTypes
}
from
'
@/utils/JEditableTableUtil
'
import
{
JEditableTableMixin
}
from
'
@/mixins/JEditableTableMixin
'
import
{
BillModalMixin
}
from
'
../mixins/BillModalMixin
'
import
{
getMpListShort
}
from
"
@/utils/util
"
import
{
getMpListShort
,
changeListFmtMinus
}
from
"
@/utils/util
"
import
JDate
from
'
@/components/jeecg/JDate
'
import
Vue
from
'
vue
'
export
default
{
...
...
@@ -238,7 +238,8 @@
for
(
let
item
of
detailArr
){
totalPrice
+=
item
.
allPrice
-
0
}
billMain
.
totalPrice
=
totalPrice
billMain
.
totalPrice
=
0
-
totalPrice
billMain
.
changeAmount
=
0
-
billMain
.
changeAmount
if
(
billMain
.
accountId
===
0
)
{
billMain
.
accountId
=
''
}
...
...
@@ -254,7 +255,7 @@
},
manyAccountModalFormOk
(
idList
,
moneyList
,
allPrice
)
{
this
.
accountIdList
=
idList
this
.
accountMoneyList
=
moneyList
this
.
accountMoneyList
=
changeListFmtMinus
(
moneyList
)
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
({
'
changeAmount
'
:
allPrice
})
});
...
...
Write
Preview
Supports
Markdown
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