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
61456f93
Commit
61456f93
authored
Feb 23, 2021
by
chenxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 库存记录
parent
4745d213
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
62 deletions
+74
-62
common.js
src/api/common.js
+6
-0
component.scss
src/assets/styles/component.scss
+0
-3
index.vue
src/components/stock-list/index.vue
+47
-35
common.js
src/config/mapping/common.js
+2
-5
request.js
src/utils/request.js
+19
-19
No files found.
src/api/common.js
View file @
61456f93
...
...
@@ -13,6 +13,12 @@ let common = {
let
o2
=
{
getSubappList
:
'/area/member-cards'
,
// 获取域列表
getAppList
:
'/stock/application-list'
,
// 获取应用列表
getStockList
:
{
// 库存记录
url
:
'/stock/stock-list'
,
method
:
'post'
,
useFormData
:
true
,
},
};
// other
...
...
src/assets/styles/component.scss
View file @
61456f93
...
...
@@ -310,9 +310,6 @@ body .damo-goods-selector{
// 覆盖部分
.damolish
{
// overflow-y: auto !important;
.el-tooltip__popper
{
max-width
:
400px
;
}
.dm-input__counter
{
bottom
:
2px
!
important
;
}
...
...
src/components/stock-list/index.vue
View file @
61456f93
...
...
@@ -7,31 +7,29 @@
<div>
<p
class=
"fz16 mb15"
>
操作记录
<span
class=
"fz12 ml10 gray03"
>
主要对手动调整库存,应用占用库存,应用释放库存的场景下对福利“可占库存”引起变更进行记录
</span></p>
<div
class=
"table-search-head"
>
<el-select
class=
"mr10 w140"
clearable
v-model=
"listParams.
status
"
placeholder=
"全部操作类型"
@
change=
"refresh"
>
<el-option
v-for=
"item in stockAdjust
Status
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
<el-select
class=
"mr10 w140"
clearable
v-model=
"listParams.
modifyType
"
placeholder=
"全部操作类型"
@
change=
"refresh"
>
<el-option
v-for=
"item in stockAdjust
Type
"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
<el-select
class=
"mr10 w140"
clearable
v-model=
"listParams.status"
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=
"w250 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>
<el-date-picker
class=
"w300 mr10"
v-model=
"dateTime"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
@
change=
"refresh"
></el-date-picker>
</div>
</div>
<el-table
tooltip-effect=
"dark"
:data=
"tableList"
style=
"width:100%"
>
<el-table-column
prop=
"
giveTime"
label=
"操作时间"
min-width=
"120
"
>
<span
slot-scope=
"scope"
v-html=
"listTime(scope.row.
create
Time)"
></span>
<el-table-column
prop=
"
modifyTime"
label=
"操作时间"
min-width=
"120"
fixed=
"left
"
>
<span
slot-scope=
"scope"
v-html=
"listTime(scope.row.
modify
Time)"
></span>
</el-table-column>
<el-table-column
label=
"调整类型"
min-width=
"120"
fixed=
"left"
>
<span
slot-scope=
"scope"
>
{{
scope
.
row
.
t
ype
|
fType
}}
</span>
<el-table-column
label=
"调整类型"
min-width=
"120"
>
<span
slot-scope=
"scope"
>
{{
scope
.
row
.
modifyT
ype
|
fType
}}
</span>
</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-column
prop=
"c
ouponCod
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=
"
couponCod
e"
label=
"活动名称"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
couponCode
"
label=
"备注"
min-width=
"140"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"
modifyStock
"
label=
"调整数量"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"
afterRemainedStock
"
label=
"可占库存"
min-width=
"120"
>
</el-table-column>
<el-table-column
prop=
"c
reatorNam
e"
label=
"操作人"
min-width=
"120"
>
</el-table-column>
<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=
"
descr
"
label=
"备注"
min-width=
"140"
show-overflow-tooltip
>
</el-table-column>
</el-table>
<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>
...
...
@@ -42,14 +40,14 @@
<
script
>
import
{
page
,
formate
}
from
'@/mixins/table.js'
;
import
{
listTime
}
from
'@/utils/index.js'
;
import
fetch
from
'@/api/
gic-card
.js'
;
import
fetch
from
'@/api/
common
.js'
;
import
{
cardType
}
from
'@/config/mapping/gic-card'
;
import
{
stockAdjust
Status
}
from
'@/config/mapping/common'
;
import
{
stockAdjust
Type
}
from
'@/config/mapping/common'
;
import
welfareItem
from
'./welfare-item'
;
const
{
g
iveLog
List
}
=
fetch
;
const
{
g
etStockList
,
getApp
List
}
=
fetch
;
export
default
{
name
:
'S
end
List'
,
name
:
'S
tock
List'
,
components
:
{
welfareItem
,
},
...
...
@@ -58,6 +56,10 @@ export default {
welfareId
:
{
type
:
String
,
required
:
true
},
type
:
{
type
:
Number
,
// 1实物礼品 2虚拟礼品 3卡券 4卡券包
required
:
true
}
},
data
()
{
...
...
@@ -65,23 +67,27 @@ export default {
loading
:
false
,
dateTime
:
[
,
],
listParams
:
{
appCode
:
''
,
welfareId
:
this
.
welfareId
,
modifyType
:
''
,
// 调整类型(1:加,2:减)
startDate
:
''
,
endDate
:
''
,
activityName
:
''
,
receiveBeginTime
:
''
,
receiveEndTime
:
''
,
appCodes
:
''
,
currentPage
:
1
,
pageSize
:
20
},
stockAdjust
Status
:
Object
.
keys
(
stockAdjustStatus
).
map
(
v
=>
{
return
{
label
:
stockAdjustStatus
[
v
],
value
:
v
};
}),
stockAdjust
Type
:
Object
.
keys
(
stockAdjustType
).
map
(
v
=>
{
return
{
label
:
stockAdjustType
[
v
],
value
:
v
};
}),
total
:
0
,
tableList
:
[],
appList
:
[],
appCodes
:
[]
};
},
created
()
{
this
.
$emit
(
'updateBread'
,
[
{
breadName
:
'福利中心'
},
{
breadName
:
'GIC卡券'
},
{
breadName
:
'卡券日志'
},
{
breadName
:
'转赠记录'
}
]);
},
mounted
()
{
this
.
getTableList
();
if
(
this
.
welfareId
)
{
this
.
getAppList
();
this
.
getTableList
();
}
},
methods
:
{
listTime
,
...
...
@@ -96,16 +102,22 @@ export default {
formatCardType
(
row
)
{
return
cardType
[
row
.
cardType
].
label
;
},
changeAppCode
(
ids
)
{
this
.
listParams
.
appCodes
=
ids
.
join
(
','
);
this
.
refresh
();
},
getAppList
()
{
getAppList
().
then
(
res
=>
{
this
.
appList
=
res
.
result
||
[];
});
},
getTableList
()
{
return
;
if
(
this
.
loading
)
{
return
;
}
this
.
formatterTimeFunc
(
'startDate'
,
'endDate'
,
'yyyy-MM-dd'
,
'dateTime'
);
this
.
loading
=
true
;
this
.
formatterTimeFunc
(
'giveBeginTime'
,
'giveEndTime'
,
'yyyy-MM-dd'
,
'dateTime'
);
let
params
=
{
...
this
.
listParams
,
memberCardId
:
this
.
currentAreaId
};
// TODO: search
giveLogList
(
params
).
then
(
res
=>
{
getStockList
(
this
.
listParams
).
then
(
res
=>
{
this
.
loading
=
false
;
const
data
=
res
.
result
;
this
.
tableList
=
data
.
result
||
[];
...
...
@@ -120,9 +132,9 @@ export default {
});
},
},
filter
:
{
filter
s
:
{
fType
(
v
)
{
return
stockAdjust
Status
[
v
]
||
'未知操作
'
;
return
stockAdjust
Type
[
v
]
||
'--
'
;
}
}
};
...
...
src/config/mapping/common.js
View file @
61456f93
...
...
@@ -37,10 +37,8 @@ export const wfTypes = [
{
title
:
'GIC 卡券包'
,
desc
:
'文案描述文案描述文案描述'
,
target
:
'/card-package/list'
,
code
:
'w-card-package'
},
];
export
const
stockAdjust
Status
=
{
// 调整类型(1:加,2:减)
export
const
stockAdjust
Type
=
{
1
:
'增加'
,
2
:
'减少'
,
3
:
'占用'
,
4
:
'释放'
,
};
\ No newline at end of file
src/utils/request.js
View file @
61456f93
...
...
@@ -2,23 +2,23 @@ import axios from 'axios';
import
qs
from
'qs'
;
import
{
Message
}
from
'element-ui'
;
import
{
SUCCESS_CODE
,
origin
}
from
'@/config'
;
import
Store
from
'@/store'
;
//
import Store from '@/store';
/**
* 请求白名单
* 展示左侧菜单但却没有选中的子应用id时这些请求将不会进行过滤
*/
const
whiteList
=
[
'/gic-auth-web/get-login-user-info'
,
'/api-marketing/enterprise-serve-info'
,
'/gic-auth-web/login-user-menu-of-app'
,
'/api-welfare/area/member-cards'
,
'/gic-auth-web/login-collaborator-operation-item'
,
'/gic-auth-web/login-user-operation-item-of-app'
,
'/gic-auth-web/login-collaborator-menu-of-app'
,
'/gic-auth-web/login-user-operation-item'
,
'/application-center-web/business/cooperation-application/find-list'
,
'/gic-auth-web/get-app-by-code'
];
//
const whiteList = [
//
'/gic-auth-web/get-login-user-info',
//
'/api-marketing/enterprise-serve-info',
//
'/gic-auth-web/login-user-menu-of-app',
//
'/api-welfare/area/member-cards',
//
'/gic-auth-web/login-collaborator-operation-item',
//
'/gic-auth-web/login-user-operation-item-of-app',
//
'/gic-auth-web/login-collaborator-menu-of-app',
//
'/gic-auth-web/login-user-operation-item',
//
'/application-center-web/business/cooperation-application/find-list',
//
'/gic-auth-web/get-app-by-code'
//
];
// import { getToken } from '@/'
// rest: 支持restfulapi url里传动态参数
// alertError:是否全局弹出message,默认弹出true
...
...
@@ -47,12 +47,12 @@ function handlerErr(code) {
axios
.
defaults
.
baseURL
=
origin
;
const
request
=
(
opt
,
params
,
restObj
)
=>
{
if
((
!
Store
.
state
.
project
||
(
Store
.
state
.
project
.
includes
(
'card'
)
&&
!
Store
.
state
.
currentAreaId
))
&&
!
whiteList
.
includes
(
opt
.
url
)
)
{
// 有左侧但没有选中子应用id || 禁用
return
new
Promise
((
resolve
,
reject
)
=>
{
reject
();
});
}
//
if ((!Store.state.project || (Store.state.project.includes('card') && !Store.state.currentAreaId)) && !whiteList.includes(opt.url) ) {
//
// 有左侧但没有选中子应用id || 禁用
//
return new Promise((resolve, reject) => {
//
reject();
//
});
//
}
params
=
Object
.
assign
({},
params
);
...
...
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