Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
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
marketing-web
marketing
Commits
1e432a1e
Commit
1e432a1e
authored
May 17, 2021
by
黑潮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 库存回显修复
parent
55a5a254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
index.vue
src/components/calculate/index.vue
+20
-11
form.vue
src/views/game/klfl/form.vue
+4
-2
No files found.
src/components/calculate/index.vue
View file @
1e432a1e
...
...
@@ -4,10 +4,10 @@
奖品数量
<el-radio
class=
"ml10"
v-model=
"calculate"
:label=
"true"
>
增加
</el-radio>
<el-radio
v-model=
"calculate"
:label=
"false"
>
减少
</el-radio>
<div
class=
"vl"
>
<el-input-number
controls-position=
"right"
:min=
"0"
:max=
"max"
v-model=
"count"
class=
"w200 block-center"
@
blur=
"checkCalc"
></el-input-number>
<el-input-number
controls-position=
"right"
:min=
"0"
:max=
"max"
v-model=
"count"
class=
"w200 block-center"
></el-input-number>
</div>
<div
class=
"fz14 vl"
v-if=
"needCheck && calculate"
>
可用库存:
{{
maxStock
}}
</div>
<div
class=
"fz14 vl"
v-if=
"!calculate"
>
当前库存:
{{
total
Count
}}
</div>
<div
class=
"fz14 vl"
v-if=
"!calculate"
>
当前库存:
{{
current
Count
}}
</div>
<div
class=
"fz14 vl mb10"
>
结果:
{{
resNum
}}
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -21,6 +21,10 @@
import
{
updatePrizeStock
}
from
'@/service/api/gameApi.js'
;
export
default
{
props
:
{
currentCount
:
{
type
:
Number
,
require
:
true
},
totalCount
:
{
type
:
Number
,
default
:
0
...
...
@@ -70,7 +74,12 @@ export default {
return
isNaN
(
num
)
?
0
:
num
;
},
max
()
{
return
this
.
needCheck
&&
this
.
calculate
?
this
.
maxStock
-
this
.
totalCount
:
1000000
;
if
(
this
.
needCheck
)
{
return
this
.
calculate
?
this
.
maxStock
-
this
.
totalCount
:
this
.
currentCount
;
}
else
{
return
this
.
calculate
?
1000000
:
this
.
currentCount
;
}
// return this.needCheck && this.calculate ? this.maxStock - this.totalCount : 1000000;
}
},
methods
:
{
...
...
@@ -79,14 +88,14 @@ export default {
this
.
needCheck
=
true
;
this
.
maxStock
=
maxStock
;
},
checkCalc
()
{
if
(
!
this
.
calculate
)
{
if
(
this
.
count
>
this
.
totalCount
)
{
this
.
count
=
this
.
totalCount
;
this
.
$tips
({
type
:
'warning'
,
message
:
'输入数量不能大于总数'
});
}
}
},
//
checkCalc() {
//
if (!this.calculate) {
//
if (this.count > this.totalCount) {
//
this.count = this.totalCount;
//
this.$tips({ type: 'warning', message: '输入数量不能大于总数' });
//
}
//
}
//
},
close
()
{
this
.
$emit
(
'update:show'
,
false
);
this
.
count
=
0
;
...
...
src/views/game/klfl/form.vue
View file @
1e432a1e
...
...
@@ -189,7 +189,7 @@
<el-button
@
click=
"$router.go(-1)"
>
返 回
</el-button>
</div>
<vue-gic-card
:showCardDialog
.
sync=
"showCardDialog"
@
selectCard=
"selectCard"
:cardLimit=
"3"
:cardType=
"null"
></vue-gic-card>
<calculate
ref=
"calculate"
:show
.
sync=
"calculateShow"
:gameId=
"form.gameActivityId"
:totalCount=
"currentObj.prizeCount"
:prizeId=
"currentObj.prizeId"
:prizeReferType=
"currentObj.prizeReferType"
:prizeReferId=
"currentObj.prizeReferId"
:useStrategy=
"0"
@
countRefresh=
"countRefresh"
></calculate>
<calculate
ref=
"calculate"
:show
.
sync=
"calculateShow"
:gameId=
"form.gameActivityId"
:
currentCount=
"currentObj.prizeStock"
:
totalCount=
"currentObj.prizeCount"
:prizeId=
"currentObj.prizeId"
:prizeReferType=
"currentObj.prizeReferType"
:prizeReferId=
"currentObj.prizeReferId"
:useStrategy=
"0"
@
countRefresh=
"countRefresh"
></calculate>
<strategy
:show
.
sync=
"strategyShow"
:gameId=
"form.gameActivityId"
:strategyType=
"strategyType"
:dataId=
"gamePrizeStrategyId"
:gameActivityId=
"form.gameActivityId"
:cardObj=
"strategyDialog"
@
set-data=
"setStrategyCard"
@
refesh=
"klflStrategyList"
></strategy>
<code-dialog
:show
.
sync=
"codeDialogShow"
:id=
"form.gameActivityId"
@
selectedCode=
"selectedCode"
></code-dialog>
</el-form>
...
...
@@ -374,11 +374,13 @@ export default {
this
.
calculateShow
=
true
;
if
(
obj
.
prizeReferType
==
2
)
{
// 卡券 获取库存值
console
.
log
(
'nnnnn'
);
this
.
getCouponStock
(
obj
.
card
.
coupCardId
);
}
},
countRefresh
(
val
)
{
this
.
currentObj
.
prizeStock
=
this
.
currentObj
.
prizeCount
=
val
.
calc
?
parseInt
(
this
.
currentObj
.
prizeCount
)
+
parseInt
(
val
.
num
)
:
parseInt
(
this
.
currentObj
.
prizeCount
)
-
parseInt
(
val
.
num
);
this
.
currentObj
.
prizeCount
=
val
.
calc
?
parseInt
(
this
.
currentObj
.
prizeCount
)
+
parseInt
(
val
.
num
)
:
parseInt
(
this
.
currentObj
.
prizeCount
)
-
parseInt
(
val
.
num
);
this
.
currentObj
.
prizeStock
=
val
.
calc
?
parseInt
(
this
.
currentObj
.
prizeStock
)
+
parseInt
(
val
.
num
)
:
parseInt
(
this
.
currentObj
.
prizeStock
)
-
parseInt
(
val
.
num
);
},
selectBg
(
v
,
i
)
{
this
.
currentBg
=
v
;
...
...
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