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
1ea7e354
Commit
1ea7e354
authored
Feb 19, 2021
by
萱草
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 礼品管理
parent
8bd0d381
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
31 deletions
+104
-31
gift.js
src/api/gift.js
+4
-0
check-upload-detail.vue
src/views/gift-manage/module/check-upload-detail.vue
+13
-12
real-gift-detail.vue
src/views/gift-manage/real-gift-detail.vue
+8
-5
virtual-gift-detail.vue
src/views/gift-manage/virtual-gift-detail.vue
+79
-14
No files found.
src/api/gift.js
View file @
1ea7e354
...
...
@@ -58,6 +58,10 @@ let realGift = {
getPickupList
:
'/pickup/get-pickup-list'
,
// 获取自提点列表
getGiftShopList
:
'/gift/get-gift-shop-list'
,
// 获取当前礼品的自提点
updateName
:
'/gift/update-name'
,
// 修改礼品名称
virtualGiftUpload
:
{
url
:
'/gift/vir-gift-upload'
,
useFormData
:
true
,
},
// 虚拟礼品卡密卡号上传
};
realGift
=
getFetch
(
realGift
,
welfarePrefix
);
...
...
src/views/gift-manage/module/check-upload-detail.vue
View file @
1ea7e354
...
...
@@ -22,8 +22,8 @@
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
virtualCardList
}
=
api
;
//
import api from '@/api/gift.js';
//
const { virtualCardList } = api;
export
default
{
data
()
{
return
{
...
...
@@ -51,26 +51,27 @@ export default {
},
methods
:
{
getTableList
(){
this
.
loading
=
true
;
let
params
=
{
id
:
''
,
key
:
''
};
virtualCardList
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
}).
finally
(()
=>
this
.
loading
=
false
);
console
.
log
(
'查看内容'
);
// this.loading = true;
// let params = {
// id: '',
// key: ''
// };
// virtualCardList(params).then(res =>{
// console.log(res);
// }).finally(() => this.loading = false);
},
submitProNanme
()
{
this
.
dialogVisible
=
false
;
// setInterval(() => {
// this.$emit('closeUpdateCost
');
this
.
$emit
(
'closeUploadDetail
'
);
// }, 10);
},
// 取消修改
cancelSubmit
()
{
this
.
dialogVisible
=
false
;
// setInterval(() => {
// this.$emit('closeUpdateCost
');
this
.
$emit
(
'closeUploadDetail
'
);
// }, 10);
}
}
...
...
src/views/gift-manage/real-gift-detail.vue
View file @
1ea7e354
...
...
@@ -335,9 +335,9 @@ export default {
checkList
:
[],
refundFlag
:
0
,
operatorAuth
:
''
,
// 操作人权限
shopCodeList
:
[],
deliveryType
:
[],
// 配送方式 1物流发货 2门店自提 3文本券码
stockUseType
:
''
,
// 库存使用类型(0:占用,1:动态 , 2占用+动态)
shopCodeList
:
''
,
// 门店code
},
validateTime
,
pickerOptions
:
{
...
...
@@ -400,7 +400,7 @@ export default {
this
.
$emit
(
'updateBread'
,
this
.
bread
);
this
.
$emit
(
'showAside'
,
true
);
this
.
getLoginUser
();
this
.
goodsType
=
this
.
$route
.
query
.
goodsType
;
//
this.goodsType = this.$route.query.goodsType;
this
.
giftId
=
this
.
$route
.
query
.
giftId
;
// this.goodsId = this.$route.query.goodsId;
if
(
this
.
giftId
)
{
...
...
@@ -528,6 +528,9 @@ export default {
this
.
goodsForm
.
spuList
[
0
].
costPrice
=
resResult
.
costPrice
;
// 成本价
this
.
goodsForm
.
spuList
[
0
].
stock
=
resResult
.
stock
;
// 库存
this
.
goodsForm
.
marketPrice
=
resResult
.
marketPrice
;
// 市场价
this
.
goodsForm
.
operatorAuth
=
resResult
.
operatorAuth
;
// 操作人权限
// this.goodsForm.shopCodeList = resResult.shopId; // 操作人权限code
this
.
goodsForm
.
checkList
=
resResult
.
stockUseType
==
2
?
[
1
,
2
]
:
(
resResult
.
stockUseType
==
1
?
[
1
]
:
[
0
]);
// 库存消耗方式
let
img
=
resResult
.
giftImages
.
split
(
','
);
// this.goodsForm.giftImages = [];
if
(
img
.
length
)
{
...
...
@@ -596,9 +599,9 @@ export default {
}).
finally
(()
=>
this
.
$emit
(
'updateLoading'
));
console
.
log
(
222
);
},
handleChangeRdio
()
{
this
.
goodsForm
.
spuList
[
0
].
stock
=
0
;
},
//
handleChangeRdio() {
//
this.goodsForm.spuList[0].stock = 0;
//
},
// 上传前
beforeUpload
(
file
)
{
if
(
file
.
size
>
2
*
1024
*
1024
)
{
...
...
src/views/gift-manage/virtual-gift-detail.vue
View file @
1ea7e354
...
...
@@ -73,15 +73,19 @@
<el-form-item
label=
"发货内容"
required
>
<
template
>
<div
style=
"display:flex;"
>
<dm-editor
width=
"500"
height=
"300"
:value=
"goodsForm.
giftDescrption"
@
change=
"handleChange2
"
></dm-editor>
<dm-editor
width=
"500"
height=
"300"
:value=
"goodsForm.
template"
@
change=
"handleChange2"
:readonly=
"readonly
"
></dm-editor>
<div
class=
"ml20"
>
<p>
用户申请履约后,发货内容将自动发送
</p>
<p>
第一步:编辑发货内容,变量使用大括号标记"{}"
</p>
<p>
第一步:保存内容,并下载模板。
<el-button
type=
"text"
>
点击下载
</el-button></p>
<p>
第一步:编辑发货内容,变量使用大括号标记"{}"
<
el-button
type=
"text"
@
click=
"generateTemplate"
>
点击生成模板
</el-button><
/p>
<p>
第一步:保存内容,并下载模板。
<el-button
type=
"text"
@
click=
"downloadTemplate"
>
点击下载
</el-button></p>
<p>
第一步:上传模板。
</p>
<div
class=
"upload-btn"
>
<el-upload
class=
"upload-ele"
show-file-list
:action=
"uploadAction"
:on-success=
"uploadFile"
with-credentials
>
<el-button><i
class=
"el-icon-upload2"
style=
"margin-right:5px"
></i>
点击上传
</el-button>
<!--
<el-upload
class=
"upload-ele"
show-file-list
:action=
"uploadAction"
:on-success=
"uploadFile"
:before-upload=
"beforeUpload"
:on-change=
"uploadChange"
with-credentials
>
-->
<el-upload
class=
"upload-ele"
:action=
"uploadAction"
:show-file-list=
"false"
:on-change=
"beforeUploadFile"
with-credentials
>
<!--
<div
class=
"upload-ele"
>
-->
<el-button
@
click=
"templateUpload"
><i
class=
"el-icon-upload2"
style=
"margin-right:5px"
></i>
点击上传
</el-button>
<span>
{{
fileName
}}
</span>
<!--
</div>
-->
</el-upload>
</div>
<div
style=
"display:flex;justify-content:space-between;width:400px"
><span>
导入说明:
</span><el-button
type=
"text"
@
click=
"checkUploadDetail"
>
查看内容
</el-button></div>
...
...
@@ -147,7 +151,8 @@ import { request } from '../../utils/request';
// import { deepClone } from '../../utils/index';
import
api
from
'@/api/gift.js'
;
import
uploadUrl
from
'@/api/common.js'
;
const
{
giftGet
,
giftUpdate
,
giftSave
}
=
api
;
const
{
giftGet
,
giftUpdate
,
giftSave
,
virtualGiftUpload
}
=
api
;
// const { giftGet, giftUpdate, giftSave } = api;
import
checkUploadDetail
from
'./module/check-upload-detail'
;
export
default
{
components
:
{
...
...
@@ -193,16 +198,17 @@ export default {
checkList
:
[],
refundFlag
:
0
,
operatorAuth
:
''
,
// 操作人权限
shopCodeList
:
[],
deliveryType
:
[],
// 配送方式 1物流发货 2门店自提 3文本券码
stockUseType
:
''
,
// 库存使用类型(0:占用,1:动态 , 2占用+动态)
shopCodeList
:
''
,
// 门店code
tableData
:
[
{
giftNo
:
''
,
stock
:
undefined
,
giftBarNo
:
''
}
]
],
template
:
''
,
},
goodsRules
:
{
giftName
:
[
{
required
:
true
,
message
:
'请输入礼品名称'
,
trigger
:
'blur'
}
],
...
...
@@ -231,7 +237,10 @@ export default {
skuBarCode
:
''
},
dialogVisible
:
false
,
description
:
''
description
:
''
,
fileName
:
''
,
readonly
:
false
,
isSave
:
false
};
},
mounted
()
{
...
...
@@ -239,7 +248,11 @@ export default {
this
.
$emit
(
'showAside'
,
true
);
this
.
getLoginUser
();
this
.
giftId
=
this
.
$route
.
query
.
giftId
;
this
.
goodsForm
.
template
=
`示例1:<br>卡号:{01}<br>卡密:{02}<br><br>示例2:<br>点击卡密链接,使用星巴克电子券二维码直接在门店核销。
<br>{卡密链接}<br> 使用条款:<br>本电子代金券需一次性使用完毕,不可兑换现金,不找零,不与其他优惠同享。<br>
您可凭以上所示二维码在有效期内前往中国大陆地区星巴克门店购买商品`
;
if
(
this
.
giftId
)
{
this
.
readonly
=
true
;
this
.
bread
[
2
].
breadName
=
'编辑礼品'
;
this
.
getMess
();
}
...
...
@@ -252,9 +265,40 @@ export default {
checkUploadDetail
(){
this
.
dialogVisible
=
true
;
},
uploadFile
(
file
){
closeUploadDetail
(){
this
.
dialogVisible
=
false
;
},
// uploadFile(file){
// console.log(file);
// },
beforeUploadFile
(
file
,
fileList
){
console
.
log
(
file
);
console
.
log
(
fileList
);
this
.
fileName
=
file
.
name
;
console
.
log
(
file
.
response
);
let
result
=
file
.
response
.
result
;
console
.
log
(
result
);
let
fileUrl
=
result
.
url
;
console
.
log
(
fileUrl
);
let
params
=
{
giftId
:
this
.
giftId
,
file
:
fileUrl
};
virtualGiftUpload
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
});
},
// uploadChange(file){
// console.log(file);
// let params = {
// giftId: this.giftId,
// file: this.fileName
// };
// virtualGiftUpload(params).then(res =>{
// console.log(res);
// });
// },
// templateUpload(){},
// 表头添加必填标识符
starAdd
(
obj
){
if
(
obj
.
column
.
label
===
'库存'
||
obj
.
column
.
label
===
'成本价(元)'
)
{
...
...
@@ -265,6 +309,7 @@ export default {
this
.
description
=
value
;
console
.
log
(
this
.
goodsForm
.
giftDescrption
);
},
// 保存发货内容 校验
saveDescription
(){
console
.
log
(
this
.
description
);
let
index
=
this
.
description
.
indexOf
(
'{'
);
// 字符出现的位置
...
...
@@ -282,6 +327,7 @@ export default {
console
.
log
(
index
-
indexCopy
==
1
);
if
(
index
-
indexCopy
==
1
){
this
.
$message
.
error
(
'{}不能嵌套出现'
);
this
.
isSave
=
false
;
}
}
while
(
index2
!==
-
1
)
{
...
...
@@ -292,8 +338,22 @@ export default {
console
.
log
(
num
,
num2
);
if
(
num
!==
num2
||
num
>
3
||
num2
>
3
){
this
.
$message
.
error
(
'请填写正确的格式'
);
this
.
isSave
=
false
;
};
this
.
isSave
=
true
;
},
// 生成模板
generateTemplate
(){
if
(
this
.
isSave
){
console
.
log
(
'生成模板'
);
}
else
{
this
.
$message
.
error
(
'请先保存发货内容'
);
}
},
// 下载模板
downloadTemplate
(){
console
.
log
(
'下载模板'
);
},
changeDelivery
(
value
){
console
.
log
(
value
);
},
...
...
@@ -304,6 +364,7 @@ export default {
}
else
{
this
.
goodsForm
.
stockUseType
=
value
[
0
];
};
console
.
log
(
value
);
},
// 获取商户信息
getLoginUser
(){
...
...
@@ -396,10 +457,14 @@ export default {
let
resResult
=
res
.
result
;
this
.
goodsForm
.
changeDelivery
=
resResult
.
changeDelivery
;
// 兑换方式
this
.
goodsForm
.
giftName
=
resResult
.
giftName
;
// 礼品名称
this
.
goodsForm
.
tableData
.
giftNo
=
resResult
.
giftNo
;
this
.
tableData
.
stock
=
resResult
.
stock
;
this
.
tableData
.
giftBarNo
=
resResult
.
giftBarNo
;
this
.
goodsForm
.
tableData
[
0
]
.
giftNo
=
resResult
.
giftNo
;
this
.
goodsForm
.
tableData
[
0
]
.
stock
=
resResult
.
stock
;
this
.
goodsForm
.
tableData
[
0
]
.
giftBarNo
=
resResult
.
giftBarNo
;
this
.
goodsForm
.
marketPrice
=
resResult
.
marketPrice
;
// 市场价
this
.
goodsForm
.
operatorAuth
=
resResult
.
operatorAuth
;
// 操作人权限
// this.goodsForm.shopCodeList = resResult.shopId; // 操作人权限code
this
.
goodsForm
.
template
=
resResult
.
template
;
// 虚拟礼品模板
this
.
goodsForm
.
checkList
=
resResult
.
stockUseType
==
2
?
[
1
,
2
]
:
(
resResult
.
stockUseType
==
1
?
[
1
]
:
[
0
]);
// 库存消耗方式
let
img
=
resResult
.
giftImages
.
split
(
','
);
// this.goodsForm.giftImages = [];
if
(
img
.
length
)
{
...
...
@@ -478,7 +543,7 @@ export default {
this
.
$emit
(
'updateLoading'
);
let
params
=
{
// giftId: this.giftId,
giftType
:
1
,
// 实物礼品
giftType
:
2
,
// 实物礼品
// shopId: '', // 门店id
giftName
:
this
.
goodsForm
.
giftName
,
// 礼品名称
marketPrice
:
this
.
goodsForm
.
marketPrice
,
// 市场价
...
...
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