Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
welfare
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
达摩4.0重构
welfare
Commits
6e180332
Commit
6e180332
authored
Feb 25, 2021
by
chenxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 库存记录
parent
a12fb374
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
160 additions
and
49 deletions
+160
-49
common.js
src/api/common.js
+1
-0
gic-card.js
src/api/gic-card.js
+2
-1
component.scss
src/assets/styles/component.scss
+1
-0
cover.scss
src/assets/styles/cover.scss
+13
-11
dialog.vue
src/components/stock-list/dialog.vue
+41
-13
index.vue
src/components/stock-list/index.vue
+2
-2
welfare-item.vue
src/components/stock-list/welfare-item.vue
+70
-17
card-package.js
src/router/card-package.js
+9
-0
list.vue
src/views/card-package/list.vue
+2
-2
stock-list.vue
src/views/card-package/stock-list.vue
+16
-0
stock-list.vue
src/views/gic-card/stock-list.vue
+1
-1
real-stock-list.vue
src/views/gift-manage/real-stock-list.vue
+1
-1
virtual-stock-list.vue
src/views/gift-manage/virtual-stock-list.vue
+1
-1
No files found.
src/api/common.js
View file @
6e180332
...
...
@@ -19,6 +19,7 @@ let o2 = {
method
:
'post'
,
useFormData
:
true
,
},
getStockActivityStatistics
:
'/stock/activity-statistics'
,
// 库存记录-统计记录
getRelationId
:
'/gift/get-gift-id'
,
// 随机返回一个ID
};
...
...
src/api/gic-card.js
View file @
6e180332
...
...
@@ -39,6 +39,7 @@ let card = {
url
:
'/coupon-log/coupon-log-page'
,
method
:
'post'
,
},
couponStockInfo
:
'/stock/coupon-stock-info'
,
// 卡券/卡券包的福利详情
};
let
destory
=
{
...
...
@@ -65,5 +66,5 @@ export default { ...card, ...destory };
export
const
downloadCouponCSV
=
config
.
api
+
welfarePrefix
+
'/destroy-plugin/download-destroy-code-template'
;
// 下载导入GIC券号csv示例文件
export
const
importCode
=
config
.
api
+
welfarePrefix
+
'/destroy-plugin/import-destroy-code'
;
// 导入券码
export
const
importDestoryCode
=
welfarePrefix
+
'/destroy-plugin/import-destroy-code'
;
// 上传销毁code列表
export
const
downloadDestroyCodeTemplate
=
config
.
api
+
welfarePrefix
+
'/
destroy-plugin/download-destroy
-code-template'
;
// 下载销毁模板示例
export
const
downloadDestroyCodeTemplate
=
config
.
api
+
welfarePrefix
+
'/
coupon/download
-code-template'
;
// 下载销毁模板示例
src/assets/styles/component.scss
View file @
6e180332
...
...
@@ -528,3 +528,4 @@ p.cell-time {
line-height
:
16px
;
}
}
src/assets/styles/cover.scss
View file @
6e180332
...
...
@@ -15,13 +15,15 @@
display
:
none
!
important
;
}
// TODO:不好使
// // 涉及到main的index
// .damolish .layout .main {
// // 隐藏到dialog的遮罩了,暂时不知道还有什么别的影响
// position: relative;
// z-index: 0;
// }
// .damolish.el-popup-parent--hidden .layout .main {
// position: static;
//
}
\ No newline at end of file
// el-table的小图标暂无数据
.damolish
.el-table.el-table-list-mini-empty
{
.el-table__empty-block
{
min-height
:
150px
!
important
;
}
.el-table__empty-text
:before
{
width
:
50px
!
important
;
margin-bottom
:
5px
!
important
;
height
:
50px
!
important
;
background-size
:
cover
!
important
;
}
}
\ No newline at end of file
src/components/stock-list/dialog.vue
View file @
6e180332
<
template
>
<el-dialog
title=
"活动统计"
:visible
.
sync=
"dialogVisible"
width=
"800px"
@
close=
"close"
>
<div
class=
"mb20"
>
<el-select
class=
"mr10 w140"
clearable
v-model=
"listParams.appCode"
placeholder=
"全部应用"
@
change=
"refresh"
>
<el-option
label=
"福利调整(手动)"
:value=
"1"
></el-option>
<el-option
label=
"福利调整(同步)"
:value=
"2"
></el-option>
<el-option
label=
"积分商城"
:value=
"3"
></el-option>
<el-select
v-model=
"appCodes"
class=
"w140 mr10"
multiple
placeholder=
"全部来源"
clearable
@
change=
"changeAppCode"
>
<el-option
v-for=
"item in appList"
:key=
"item.appCode"
:label=
"item.appName"
:value=
"item.appCode"
></el-option>
</el-select>
<el-input
class=
"mr10 w300"
v-model=
"listParams.activityName"
clearable
placeholder=
"请输入活动名称搜索"
@
change=
"refresh"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i></el-input>
</div>
<el-table
tooltip-effect=
"dark"
:data=
"tableList"
style=
"width:100%"
>
<el-table-column
prop=
"
couponCod
e"
label=
"活动应用名称"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
couponCod
e"
label=
"活动名称"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
couponCode
"
label=
"可用库存"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
couponCode
"
label=
"历史履约库存"
min-width=
"120"
>
</el-table-column>
<el-table
tooltip-effect=
"dark"
v-loading=
"loading"
:data=
"tableList"
style=
"width:100%"
>
<el-table-column
prop=
"
appNam
e"
label=
"活动应用名称"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
activityNam
e"
label=
"活动名称"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
remainedStock
"
label=
"可用库存"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
outStock
"
label=
"历史履约库存"
min-width=
"120"
>
</el-table-column>
</el-table>
<div
class=
"clearfix"
>
<
!--
<
div
class=
"clearfix"
>
<dm-pagination
class=
"fr mb0"
v-if=
"tableList.length"
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listParams.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"listParams.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
</div>
</div>
-->
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
关闭
</el-button>
</span>
...
...
@@ -24,6 +22,8 @@
</
template
>
<
script
>
import
commonApi
from
'@/api/common.js'
;
const
{
getStockActivityStatistics
,
getAppList
}
=
commonApi
;
import
{
page
}
from
'@/mixins/table.js'
;
export
default
{
mixins
:
[
page
],
...
...
@@ -48,19 +48,47 @@ export default {
},
total
:
0
,
tableList
:
[],
appList
:
[],
appCodes
:
''
};
},
methods
:
{
close
()
{
this
.
$emit
(
'update:dialogVisible'
,
false
);
this
.
tableList
=
[];
this
.
appCodes
=
''
;
this
.
listParams
.
appCode
=
''
;
this
.
listParams
.
activityName
=
''
;
this
.
listParams
.
currentPage
=
1
;
},
changeAppCode
(
ids
)
{
this
.
listParams
.
appCodes
=
ids
.
join
(
','
);
this
.
refresh
();
},
getAppList
()
{
getAppList
().
then
(
res
=>
{
this
.
appList
=
res
.
result
||
[];
});
},
getTableList
()
{
return
;
this
.
loading
=
true
;
getStockActivityStatistics
({
welfareId
:
this
.
welfareId
,
...
this
.
listParams
}).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
tableList
=
res
.
total
||
[];
}).
catch
(()
=>
{
this
.
loading
=
false
;
});
}
},
watch
:
{
dialogVisible
(
val
)
{
val
&&
this
.
getTableList
();
if
(
val
)
{
this
.
getTableList
();
this
.
getAppList
();
}
}
}
};
...
...
src/components/stock-list/index.vue
View file @
6e180332
<
template
>
<div
class=
"p20"
v-loading=
"loading"
>
<div
class=
"pb20 clearfix flex-center"
>
<welfare-item
:welfare-id=
"$route.query.id"
></welfare-item>
<welfare-item
:welfare-id=
"$route.query.id"
:type=
"type"
></welfare-item>
</div>
<div
style=
"height:20px;width:calc(100% + 40px);position:relative;left:-20px;"
class=
"bg-color mb20"
></div>
<div>
...
...
@@ -58,7 +58,7 @@ export default {
required
:
true
},
type
:
{
type
:
Number
,
// 1实物礼品 2虚拟礼品 3卡券 4卡券包
type
:
[
Number
,
String
]
,
// 1实物礼品 2虚拟礼品 3卡券 4卡券包
required
:
true
}
},
...
...
src/components/stock-list/welfare-item.vue
View file @
6e180332
...
...
@@ -2,34 +2,40 @@
<div
class=
"welfare-item"
>
<div
class=
"head"
>
<el-tag
type=
"success"
class=
"mr10"
>
使用中
</el-tag>
<label>
更新时间:
</label>
2020-12-21 12:12:12
<label
class=
"ml30"
>
福利ID:
</label>
567856785678567867867
<label>
更新时间:
</label>
<span
v-html=
"formatDateTimeByType(info.updateTime)"
></span><label
class=
"ml30"
>
福利ID:
</label>
{{
welfareId
}}
</div>
<div
class=
"content"
>
<div>
<p>
100元卡券(线下)
</p>
<p
class=
"gray03 fz12"
>
100元卡券(线下)
</p>
<p
class=
"gray03 fz12"
>
创建时间:
2020-12-12 12:12:12
</p>
<p>
{{
info
.
name
||
'--'
}}
</p>
<p
class=
"gray03 fz12"
>
<template
v-if=
"type == 1 || type == 2"
>
礼品编码:
</
template
>
{{ info.remarkName || '--' }}
</p>
<p
class=
"gray03 fz12"
>
创建时间:
<span
v-html=
"formatDateTimeByType(info.createTime)"
></span>
</p>
</div>
<div>
<p>
成本:¥
12.00
</p>
<p>
可占库存:
1000
</p>
<p>
成本:¥
{{ info.costPrice || 0 }}
</p>
<p>
可占库存:
{{ info.remainedStock || 0 }}
</p>
</div>
<div
style=
"position:relative;"
>
<p>
已占用:
200
</p>
<p>
总库存:
1200
</p>
<p>
已履约:
140
</p>
<
el-tag
style=
"position:absolute;right:20px;top:20px;"
>
实际库存
</el-tag
>
<p>
已占用:
{{ info.occupyStock || 0 }}
</p>
<p>
总库存:
{{ info.totalStock || 0 }}
</p>
<p>
已履约:
{{ info.outStock || 0 }}
</p>
<
p
v-if=
"type == 1 || type == 2"
>
待履约:{{ info.reStock || 0 }}
</p
>
</div>
<div
style=
"flex-shrink: 0;width:100px;"
>
<el-button
type=
"primary"
class=
"fr mr20"
@
click=
"dialogVisible = true"
>
活动记录
</el-button>
</div>
</div>
<el-table
:data=
"skuList"
style=
"width: calc(100% - 40px)"
max-height=
"200"
class=
"ml20 mr20 mb10"
>
<el-table-column
prop=
"num"
label=
"SKU信息"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"num"
label=
"SKU编码"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"num"
label=
"总库存"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"num"
label=
"已占用"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"num"
label=
"可占库存"
min-width=
"150"
></el-table-column>
<!-- 实物礼品才有sku列表 -->
<el-table
:data=
"skuList"
v-if=
"type == 1"
style=
"width: calc(100% - 40px)"
max-height=
"200"
class=
"ml20 mr20 mb10 el-table-list-mini-empty"
>
<el-table-column
prop=
"num"
label=
"SKU信息"
min-width=
"200"
>
<
template
slot-scope=
"scope"
>
<img
:src=
"scope.row.giftSkuImgUrl"
width=
"50"
height=
"50"
/>
{{
scope
.
row
.
giftSkuName
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"giftSkuCode"
label=
"SKU编码"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"totalStock"
label=
"总库存"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"occupyStock"
label=
"已占用"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"remainedStock"
label=
"可占库存"
min-width=
"150"
></el-table-column>
<el-table-column
prop=
"num"
label=
"已履约"
min-width=
"150"
></el-table-column>
</el-table>
<act-dialog
:dialog-visible
.
sync=
"dialogVisible"
:welfare-id=
"$route.query.id"
></act-dialog>
...
...
@@ -38,6 +44,12 @@
<
script
>
import
actDialog
from
'./dialog'
;
import
giftApi
from
'@/api/gift.js'
;
import
cardApi
from
'@/api/gic-card.js'
;
const
{
giftGet
}
=
giftApi
;
const
{
couponStockInfo
}
=
cardApi
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
export
default
{
name
:
'WelfareItem'
,
components
:
{
...
...
@@ -47,6 +59,10 @@ export default {
welfareId
:
{
type
:
String
,
required
:
true
},
type
:
{
type
:
[
Number
,
String
],
// 1实物礼品 2虚拟礼品 3卡券 4卡券包
required
:
true
}
},
data
()
{
...
...
@@ -57,8 +73,45 @@ export default {
};
},
methods
:
{
formatDateTimeByType
,
getWelfareInfo
()
{
console
.
log
(
'info'
);
if
(
this
.
type
==
1
||
this
.
type
==
2
)
{
// 礼品
giftGet
({
id
:
this
.
welfareId
}).
then
(
res
=>
{
const
{
updateTime
,
createTime
,
giftName
,
giftNo
,
virCostPrice
,
outStock
,
preStock
,
occupyStock
,
remainedStock
,
totalStock
}
=
res
.
result
;
this
.
info
=
{
updateTime
,
createTime
,
name
:
giftName
,
remarkName
:
giftNo
,
costPrice
:
virCostPrice
,
outStock
,
// 已履约数
preStock
,
// 待履约数
occupyStock
,
// 已占用库存
remainedStock
,
// 可占用库存
totalStock
,
// 总库存
};
this
.
skuList
=
res
.
skuList
||
[];
});
}
if
(
this
.
type
==
3
||
this
.
type
==
4
)
{
// 入参: welfareId福利id, type: 1:卡券,2:卡券包
couponStockInfo
({
welfareId
:
this
.
welfareId
,
type
:
this
.
type
==
3
?
1
:
2
}).
then
(
res
=>
{
const
{
updateTime
,
createTime
,
name
,
remarkName
,
costPriceRemark
,
outStock
,
preStock
,
occupyStock
,
remainedStock
,
totalStock
}
=
res
.
result
;
this
.
info
=
{
updateTime
,
createTime
,
name
,
remarkName
,
costPrice
:
costPriceRemark
,
outStock
,
// 已履约数
preStock
,
// 待履约数
occupyStock
,
// 已占用库存
remainedStock
,
// 可占用库存
totalStock
,
// 总库存
};
});
}
}
},
watch
:
{
...
...
src/router/card-package.js
View file @
6e180332
...
...
@@ -34,6 +34,14 @@ export default [
path
:
'send-list'
,
component
:
()
=>
import
(
/* webpackChunkName: "card-package" */
'@/views/card-package/send-list.vue'
),
},
// 卡券包库存记录
{
path
:
'stock-list'
,
component
:
()
=>
import
(
/* webpackChunkName: "card-package" */
'@/views/card-package/stock-list.vue'
),
meta
:
{
path
:
'/card-package/list'
}
},
],
},
];
\ No newline at end of file
src/views/card-package/list.vue
View file @
6e180332
...
...
@@ -90,8 +90,8 @@
<dm-perm-button
type=
"text"
@
click=
"$router.push(`/card-package/send-list?id=$
{scope.row.couponPackageId}`)">发放记录
</dm-perm-button>
<el-popover
popper-class=
"option-dropdown"
trigger=
"hover"
>
<ul>
<li
v-if=
"scope.row._status == 2"
>
<
dm-perm-button
@
click=
"$router.push(`/card-package/edit?id=$
{scope.row.couponPackageId}`)" type="text">库存记录
</dm-perm
-button>
<li>
<
el-button
@
click=
"$router.push(`/card-package/stock-list?id=$
{scope.row.couponPackageId}`)" type="text">库存记录
</el
-button>
</li>
<li
:class=
"
{ disabled: $itemPerm($itemCode.gicDeletePackage) }">
<dm-perm-button
@
click=
"delOne(scope.row)"
:disabld=
"$itemPerm($itemCode.gicDeletePackage)"
type=
"text"
>
删除
</dm-perm-button>
...
...
src/views/card-package/stock-list.vue
0 → 100644
View file @
6e180332
<
template
>
<stock-list
:welfare-id=
"$route.query.id"
type=
"4"
></stock-list>
</
template
>
<
script
>
import
stockList
from
'@/components/stock-list/index.vue'
;
export
default
{
name
:
'StockList'
,
components
:
{
stockList
},
created
()
{
this
.
$emit
(
'updateBread'
,
[
{
breadName
:
'福利中心'
},
{
breadName
:
'GIC卡券包'
,
breadPath
:
'/card-package/list'
},
{
breadName
:
'库存记录'
}
]);
}
};
</
script
>
src/views/gic-card/stock-list.vue
View file @
6e180332
<
template
>
<stock-list
:welfare-id=
"$route.query.id"
></stock-list>
<stock-list
:welfare-id=
"$route.query.id"
type=
"3"
></stock-list>
</
template
>
<
script
>
...
...
src/views/gift-manage/real-stock-list.vue
View file @
6e180332
<
template
>
<stock-list
:welfare-id=
"$route.query.id"
></stock-list>
<stock-list
:welfare-id=
"$route.query.id"
type=
"1"
></stock-list>
</
template
>
<
script
>
...
...
src/views/gift-manage/virtual-stock-list.vue
View file @
6e180332
<
template
>
<stock-list
:welfare-id=
"$route.query.id"
></stock-list>
<stock-list
:welfare-id=
"$route.query.id"
type=
"2"
></stock-list>
</
template
>
<
script
>
...
...
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