Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
9f754125
Commit
9f754125
authored
Aug 11, 2021
by
v-yuchenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:库存问题修改
parent
3c70e391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
14 deletions
+34
-14
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+34
-14
No files found.
src/pages/Activity/releaseProduc/components/addProduc.vue
View file @
9f754125
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
<el-input
<el-input
v-model=
"commodityForm.inventory_total"
v-model=
"commodityForm.inventory_total"
placeholder=
""
placeholder=
""
oninput=
"this.value = this.value.replace(/[^0-9]/g, '');
"
@
input=
"inventoryIpt
"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<div
style=
"display: inline-block; height: 42px; margin-left: 33px"
>
<div
style=
"display: inline-block; height: 42px; margin-left: 33px"
>
...
@@ -294,21 +294,24 @@ export default {
...
@@ -294,21 +294,24 @@ export default {
multipleSelection
:
[],
// 勾选的数据
multipleSelection
:
[],
// 勾选的数据
goodsSkuID
:
""
,
goodsSkuID
:
""
,
inventoryTotal
:
0
,
// 总库存
inventoryRest
:
0
,
// 剩余库存
};
};
},
},
computed
:
{
//
computed: {
// 计算剩余库存
//
// 计算剩余库存
inventoryRest
()
{
//
inventoryRest() {
if
(
this
.
commodityForm
.
inventory_total
==
null
)
{
//
if (this.commodityForm.inventory_total == null) {
return
0
;
//
return 0;
}
else
{
//
} else {
return
Number
(
//
return Number(
this
.
commodityForm
.
inventory_total
-
//
this.commodityForm.inventory_total -
this
.
commodityForm
.
total_amount_order
//
this.commodityForm.total_amount_order
);
//
);
}
//
}
},
//
},
},
//
},
methods
:
{
methods
:
{
// 上移
// 上移
upMove
(
index
)
{
upMove
(
index
)
{
...
@@ -332,6 +335,21 @@ export default {
...
@@ -332,6 +335,21 @@ export default {
}
}
},
},
// 库存计算
inventoryIpt
(
val
)
{
var
pattern
=
/^-
?[
1-9
]\d
*$|^0$/g
;
if
(
!
pattern
.
test
(
this
.
commodityForm
.
inventory_total
))
{
this
.
commodityForm
.
inventory_total
=
""
;
this
.
inventoryRest
=
this
.
inventoryTotal
-
this
.
commodityForm
.
total_amount_order
;
}
else
{
this
.
inventoryRest
=
Number
(
val
)
+
this
.
inventoryTotal
-
this
.
commodityForm
.
total_amount_order
;
}
},
// 展示商品大图
// 展示商品大图
previewImage
(
file
)
{
previewImage
(
file
)
{
this
.
popoverImage
=
file
.
url
;
this
.
popoverImage
=
file
.
url
;
...
@@ -377,6 +395,8 @@ export default {
...
@@ -377,6 +395,8 @@ export default {
this
.
picUrlList
=
[];
this
.
picUrlList
=
[];
let
params
=
{
goods_sku_id
:
goodSkuID
,
marketing_type
:
"4"
};
let
params
=
{
goods_sku_id
:
goodSkuID
,
marketing_type
:
"4"
};
const
res
=
await
markGoodsInfo
(
params
);
const
res
=
await
markGoodsInfo
(
params
);
this
.
inventoryRest
=
res
.
result
.
goods_info
.
inventory_rest
;
this
.
inventoryTotal
=
res
.
result
.
goods_info
.
inventory_total
;
this
.
commodityForm
=
res
.
result
.
goods_info
;
this
.
commodityForm
=
res
.
result
.
goods_info
;
this
.
commodityForm
.
business1
=
res
.
result
.
goods_info
.
ota_id
;
this
.
commodityForm
.
business1
=
res
.
result
.
goods_info
.
ota_id
;
for
(
var
i
in
res
.
result
.
goods_info
.
desc_pic_url_list
)
{
for
(
var
i
in
res
.
result
.
goods_info
.
desc_pic_url_list
)
{
...
...
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