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
491a74e4
Commit
491a74e4
authored
Aug 07, 2021
by
季圣华
Browse files
支持选择多商品(优化)
parent
5f6ab656
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/views/bill/mixins/BillModalMixin.js
View file @
491a74e4
...
...
@@ -185,63 +185,34 @@ export const BillModalMixin = {
mpList
:
getMpListShort
(
Vue
.
ls
.
get
(
'
materialPropertyList
'
)),
//扩展属性
prefixNo
:
this
.
prefixNo
}
if
(
value
.
indexOf
(
'
,
'
)
>-
1
)
{
//多个条码
getMaterialByBarCode
(
param
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
let
mList
=
res
.
data
let
mArr
=
[]
for
(
let
i
=
0
;
i
<
mList
.
length
;
i
++
)
{
let
mInfo
=
mList
[
i
]
let
mObj
=
{
depotId
:
mInfo
.
depotId
,
barCode
:
mInfo
.
mBarCode
,
name
:
mInfo
.
name
,
standard
:
mInfo
.
standard
,
model
:
mInfo
.
model
,
materialOther
:
mInfo
.
materialOther
,
stock
:
mInfo
.
stock
,
unit
:
mInfo
.
commodityUnit
,
sku
:
mInfo
.
sku
,
operNumber
:
1
,
unitPrice
:
mInfo
.
billPrice
,
taxUnitPrice
:
mInfo
.
billPrice
,
allPrice
:
mInfo
.
billPrice
,
taxRate
:
0
,
taxMoney
:
0
,
taxLastMoney
:
mInfo
.
billPrice
}
mArr
.
push
(
mObj
)
}
this
.
materialTable
.
dataSource
=
mArr
getMaterialByBarCode
(
param
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
let
mList
=
res
.
data
if
(
value
.
indexOf
(
'
,
'
)
>
-
1
)
{
//多个条码
let
mArr
=
this
.
materialTable
.
dataSource
for
(
let
i
=
0
;
i
<
mList
.
length
;
i
++
)
{
let
mInfo
=
mList
[
i
]
let
mObj
=
this
.
parseInfoToObj
(
mInfo
)
mObj
.
depotId
=
mInfo
.
depotId
mObj
.
stock
=
mInfo
.
stock
mArr
.
push
(
mObj
)
}
let
taxLastMoneyTotal
=
0
for
(
let
j
=
0
;
j
<
mArr
.
length
;
j
++
)
{
taxLastMoneyTotal
+=
mArr
[
j
].
taxLastMoney
}
});
}
else
{
//单个条码
getMaterialByBarCode
(
param
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
let
mList
=
res
.
data
this
.
materialTable
.
dataSource
=
mArr
target
.
statisticsColumns
.
taxLastMoney
=
taxLastMoneyTotal
that
.
autoChangePrice
(
target
)
}
else
{
//单个条码
let
mArr
=
[]
for
(
let
i
=
0
;
i
<
mList
.
length
;
i
++
)
{
let
mInfo
=
mList
[
i
]
let
mObj
=
{
rowKey
:
row
.
id
,
values
:
{
barCode
:
mInfo
.
mBarCode
,
name
:
mInfo
.
name
,
standard
:
mInfo
.
standard
,
model
:
mInfo
.
model
,
materialOther
:
mInfo
.
materialOther
,
unit
:
mInfo
.
commodityUnit
,
sku
:
mInfo
.
sku
,
operNumber
:
1
,
unitPrice
:
mInfo
.
billPrice
,
taxUnitPrice
:
mInfo
.
billPrice
,
allPrice
:
mInfo
.
billPrice
,
taxRate
:
0
,
taxMoney
:
0
,
taxLastMoney
:
mInfo
.
billPrice
}
values
:
this
.
parseInfoToObj
(
mInfo
)
}
mArr
.
push
(
mObj
)
}
...
...
@@ -250,8 +221,8 @@ export const BillModalMixin = {
target
.
recalcAllStatisticsColumns
()
that
.
autoChangePrice
(
target
)
}
}
);
}
}
}
);
break
;
case
"
operNumber
"
:
operNumber
=
value
-
0
...
...
@@ -315,6 +286,25 @@ export const BillModalMixin = {
break
;
}
},
//转为商品对象
parseInfoToObj
(
mInfo
)
{
return
{
barCode
:
mInfo
.
mBarCode
,
name
:
mInfo
.
name
,
standard
:
mInfo
.
standard
,
model
:
mInfo
.
model
,
materialOther
:
mInfo
.
materialOther
,
unit
:
mInfo
.
commodityUnit
,
sku
:
mInfo
.
sku
,
operNumber
:
1
,
unitPrice
:
mInfo
.
billPrice
,
taxUnitPrice
:
mInfo
.
billPrice
,
allPrice
:
mInfo
.
billPrice
,
taxRate
:
0
,
taxMoney
:
0
,
taxLastMoney
:
mInfo
.
billPrice
}
},
//删除一行或多行的时候触发
onDeleted
(
ids
,
target
)
{
target
.
recalcAllStatisticsColumns
()
...
...
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