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
035e7412
Commit
035e7412
authored
Feb 09, 2021
by
萱草
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/福利中心-礼品管理' of
http://git.gicdev.com/dm4/welfare
into feature/福利中心-礼品管理
# Conflicts: # src/api/gift.js
parents
559e626f
7567ac82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
1 deletions
+106
-1
gift.js
src/api/gift.js
+3
-1
select-pickup-store.vue
src/views/gift-manage/module/select-pickup-store.vue
+103
-0
No files found.
src/api/gift.js
View file @
035e7412
...
...
@@ -43,7 +43,9 @@ let realGift = {
batchUpdate
:
{
url
:
'/gift/batch-update'
,
method
:
'post'
}
},
getPickupList
:
'/pickup/get-pickup-list'
,
// 获取自提点列表
getGiftShopList
:
'/gift/get-gift-shop-list'
,
// 获取当前礼品的自提点
};
realGift
=
getFetch
(
realGift
,
welfarePrefix
);
...
...
src/views/gift-manage/module/select-pickup-store.vue
0 → 100644
View file @
035e7412
<
template
>
<div>
<!-- 穿梭框 -->
<el-transfer
filterable
filter-placeholder=
"请输入自提点名称"
v-model=
"checked.shopCodeList"
:filter-method=
"(query, item) => (typeof item.name == 'string' && item.name.indexOf(query) >= 0)"
:props=
"
{ key: 'storeCode', label: 'name' }"
:data="pickupList">
</el-transfer>
<!-- 导入 -->
<dm-upload-file
:action=
"`$
{origin}${api.giftShopListUpload}`"
accept=".xls,.xlsx"
with-credentials
:on-success="onUploadSucc">
</dm-upload-file>
</div>
</
template
>
<
script
>
/**
* 所有自提点
* 部分自提点
* 获取所有自提点
* 回显时根据礼品id获取当前礼品的所有自提点
* 批量导入
* 上传礼品自提点列表
* 部分自提点时的回显,只需要回显导入的数量
* 新增时需要回显导入的数量,和导入的文件名称
*/
// 组件的返回结果
/**
* 点击穿梭框下面的确定按钮或者文件上传完成后返回如下数据
* {
* type: 1,
* shopCodeList: [],
* uuid: 123
* }
*/
import
{
origin
}
from
'@/config/index.js'
;
import
api
from
'@/api/gift.js'
;
const
{
getPickupList
,
getGiftShopList
}
=
api
;
export
default
{
name
:
'SelectPickupStore'
,
props
:
{
giftId
:
String
,
// 礼品id
type
:
String
,
// 门店自提类型
sum
:
Number
,
// 批量导入的数量
},
data
()
{
return
{
api
:
{
// method: 'post',
// useFormData: true
giftShopListUpload
:
'/gift-shop-list-upload'
,
// 上传礼品自提点列表EXCEL
giftShopListDownload
:
'/gift-shop-list-download'
,
// 下载礼品自提点列表EXCEL
downloadGiftTemplate
:
'/gift/template-download'
,
// 下载模板
},
pickupList
:
[],
// 所有自提点
giftPickupList
:
[],
// 礼品的自提点
// 选择自提点相关的数据
checked
:
{
shopCodeList
:
[],
uuid
:
''
},
};
},
created
()
{
this
.
init
();
},
methods
:
{
init
()
{
// 获取所有自提点
// TODO 考虑分页加载
this
.
pickupList
=
[];
getPickupList
({
currentPage
:
1
,
pageSize
:
20
}).
then
(
res
=>
{
const
{
result
}
=
res
.
result
||
{};
this
.
pickupList
=
this
.
pickupList
.
concat
(
result
);
});
// 编辑而且是部分自提点时,获取礼品自提点
getGiftShopList
().
then
(
res
=>
{
this
.
giftPickupList
=
res
.
result
||
[];
});
},
// 自提点上传
onUploadSucc
(
resp
)
{
const
{
uuid
,
errorList
}
=
resp
.
result
;
console
.
log
(
uuid
,
errorList
);
},
// 自提点下载
downloadPickup
()
{
window
.
location
.
href
=
`
${
origin
}${
this
.
api
.
giftShopListDownload
}
?id=
${
this
.
giftId
}
`
;
},
// 向外传递数据
onChange
()
{
this
.
$emit
(
'change'
,
this
.
checked
);
}
}
};
</
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