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
407b9a93
Commit
407b9a93
authored
Aug 23, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 奥莱抵金券
parent
5425978f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
25 deletions
+125
-25
cardApi.js
src/service/api/cardApi.js
+2
-0
form.js
src/views/card/form.js
+112
-15
form.vue
src/views/card/form.vue
+11
-10
No files found.
src/service/api/cardApi.js
View file @
407b9a93
...
...
@@ -196,3 +196,5 @@ export const listConsumeCouponDetail = params => requests(PREFIX + '/list-consum
export
const
isAolai
=
params
=>
requests
(
PREFIX
+
'/is-aolai'
,
params
);
export
const
getStoreList
=
params
=>
requests
(
'/api-plug/get-store-widget-store'
,
params
);
export
const
importCostStore
=
params
=>
requests
(
'/api-marketing/import-cost-store'
,
params
,
true
);
src/views/card/form.js
View file @
407b9a93
...
...
@@ -9,14 +9,14 @@ import sendPreview from './partials/send-preview';
import
{
formatDateTimeByType
,
deepClone
,
getTimesByReq
}
from
'@/utils/index.js'
;
import
xxSysp_mix
from
'@/mixins/selector.js'
;
// 商品选择器方法
import
{
listEntepriseWeimobShop
,
listEntepriseWeimobCoupon
}
from
'@/service/api/commonApi.js'
;
import
{
getCardDetail
,
saveUpdateCard
,
copyCardDetailService
,
getCardManualSetting
,
getCategoryList
,
getPropertyList
,
getLatestReptileTime
,
getPropertyValueList
,
getWeimobCouponBindCount
,
getCardEffectiveMode
,
getStoreList
}
from
'@/service/api/cardApi.js'
;
import
{
getCardDetail
,
saveUpdateCard
,
copyCardDetailService
,
getCardManualSetting
,
getCategoryList
,
getPropertyList
,
getLatestReptileTime
,
getPropertyValueList
,
getWeimobCouponBindCount
,
getCardEffectiveMode
,
getStoreList
,
importCostStore
}
from
'@/service/api/cardApi.js'
;
import
dmGoodsInput
from
'@/components/goods-input/index.vue'
;
import
{
getLinkResourceStatus
}
from
'@/service/api/ecmApi.js'
;
import
{
RecycleScroller
}
from
'vue-virtual-scroller'
;
import
'vue-virtual-scroller/dist/vue-virtual-scroller.css'
;
const
initForm
=
{
auditingStatus
:
''
,
cardType
:
3
,
// 1.卡券类型: 抵金券: 0; 折扣券: 1; 兑换券: 2
cardType
:
0
,
// 1.卡券类型: 抵金券: 0; 折扣券: 1; 兑换券: 2
cardName
:
''
,
// 2.卡券名称
cardApplyChannel
:
[],
// 卡券适用渠道
channelTip
:
''
,
...
...
@@ -76,7 +76,7 @@ const initForm = {
useCardCodePrefix
:
0
,
//code类型随机生时 前缀复选框的值
cardCodePrefix
:
''
,
// code类型随机生成 前缀值
costValueProportionFlag
:
1
,
// 卡券成本比例 1:开 0:关
costValueType
:
1
,
// 成本费用 0:固定成本 1:门店成本
costValueType
:
0
,
// 成本费用 0:固定成本 1:门店成本
costValueProportion
:
undefined
,
// 成本比例
only
:
true
// 默认优惠不共享 true
};
...
...
@@ -151,9 +151,30 @@ export default {
};
const
that
=
this
;
return
{
initStoreSelector
:
true
,
// 商场抵金券适用门店-部分门店列表数据
originStoreList
:
[],
// 商场抵金券适用门店-门店选择器选中的数据
selectedStoreList
:
[],
searchStore
:
''
,
sortType
:
undefined
,
importCost
:
{
visible
:
false
,
loading
:
false
,
costStoreList
:
[],
options
:
{
desc
:
'文件条数单次不超过5000条,上传文件不可大于2M,支持XLSX、XLS'
,
maxSize
:
2097152
,
maxSizeDesc
:
'2M'
,
accept
:
[
'.xlsx'
,
'.xls'
],
downloadTemplate
:
[
{
url
:
'/api-marketing/download-import-cost-store?requestProject=marketing'
,
name
:
'下载模板'
}
]
}
},
isEffective
:
false
,
requestProject
:
'marketing'
,
gicCouponType
:
''
,
// gic定义的卡券类型(0:普通卡券, 1:e待洗, 2:好办卡券, 3:微盟外部券, 4:通用外部券
...
...
@@ -414,26 +435,29 @@ export default {
return
false
;
}
},
// 固定成本
// 输入成本比例,显示成本金额 done
// 保存时设置成本金额字段
// 门店成本
// 根据门店选择器获取门店列表 done
// 输入成本比例,显示成本金额 done
// 搜索门店 done
// 排序 done
// 导入门店
// 导入门店后与现有门店列表数据合并
// 保存时设置成本金额字段
methods
:
{
onStoreChange
(
id
)
{
// 编辑卡券时,不保存门店选择器初始化的数据
if
((
this
.
isEdit
||
this
.
isInfo
)
&&
this
.
initStoreSelector
)
{
this
.
initStoreSelector
=
false
;
return
;
}
getStoreList
({
key
:
id
,
pageSize
:
99999
,
currentPage
:
1
}).
then
(
res
=>
{
const
{
result
,
errorCode
}
=
res
||
{};
if
(
errorCode
==
0
&&
Array
.
isArray
(
result
.
result
))
{
this
.
origin
StoreList
=
result
.
result
.
map
(
el
=>
{
this
.
selected
StoreList
=
result
.
result
.
map
(
el
=>
{
const
{
storeId
,
storeCode
,
storeName
}
=
el
;
return
{
storeId
,
storeCode
,
storeName
,
costValueProportion
:
undefined
,
costValue
:
0
};
});
if
(
this
.
isEdit
)
{
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this
.
selectedStoreList
=
this
.
selectedStoreList
.
filter
(
el
=>
this
.
form
.
costStoreList
.
every
(
item
=>
item
.
storeId
!=
el
.
storeId
));
this
.
originStoreList
=
[...
this
.
selectedStoreList
,
...
this
.
form
.
costStoreList
];
}
else
if
(
this
.
isAdd
||
this
.
isCopy
)
{
// 新建卡券时直接覆盖
this
.
originStoreList
=
this
.
selectedStoreList
;
}
}
});
},
...
...
@@ -455,6 +479,46 @@ export default {
});
}
},
onCloseImportCost
()
{
if
(
this
.
importCost
.
loading
)
{
this
.
importCost
.
visible
=
true
;
return
;
}
this
.
$refs
.
importFile
.
reset
();
},
handleFileChange
({
files
})
{
if
(
!
Array
.
isArray
(
files
)
||
files
.
length
==
0
)
{
return
;
}
this
.
importCost
.
loading
=
true
;
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
files
[
0
]);
formData
.
append
(
'requestProject'
,
'marketing'
);
importCostStore
(
formData
)
.
then
(
res
=>
{
const
{
importId
,
importCount
,
importSuccessCount
,
costStoreList
}
=
res
.
result
;
this
.
importCost
.
costStoreList
=
costStoreList
;
this
.
$message
.
success
(
`上传
${
importCount
}
条数据,
${
importSuccessCount
}
条数据上传成功`
);
if
(
importCount
-
importSuccessCount
>
0
)
{
this
.
importCost
.
options
.
downloadTemplate
.
push
({
url
:
`/api-marketing/download-cost-store-error?requestProject=marketing&importId=
${
importId
}
`
,
name
:
'下载错误数据'
});
}
})
.
finally
(()
=>
{
setTimeout
(()
=>
{
this
.
importCost
.
loading
=
false
;
},
500
);
});
},
onSaveImportCost
()
{
if
(
this
.
isAdd
||
this
.
isCopy
)
{
// 新建卡券导入的数据覆盖之前的数据
this
.
originStoreList
=
this
.
importCost
.
costStoreList
;
}
this
.
importCost
.
visible
=
false
;
},
getLinkResourceStatus
(
v
)
{
let
result
=
JSON
.
parse
(
v
);
const
params
=
{
...
...
@@ -750,6 +814,13 @@ export default {
this
.
coupGoodsWeimobList
=
card
.
coupGoodsWeimobList
;
}
if
(
card
.
cardType
==
3
)
{
this
.
form
.
costValueType
=
card
.
costValueType
;
//成本费用0固定成本1门店成本
this
.
form
.
costValueProportion
=
card
.
costValueProportion
;
//成本比例
this
.
form
.
costStoreList
=
(
this
.
isEdit
||
this
.
isInfo
)
&&
Array
.
isArray
(
card
.
costStoreList
)
?
card
.
costStoreList
:
[];
this
.
originStoreList
=
this
.
form
.
costStoreList
;
}
// 线下适用商品
if
(
card
.
goodsSearchDetail
&&
card
.
goodsFilterId
)
{
this
.
xxSysp
.
goodsFilterId
=
card
.
goodsFilterId
;
...
...
@@ -1083,6 +1154,32 @@ export default {
if
(
this
.
form
.
only
)
{
card
.
useCondition
.
only
=
Number
(
this
.
form
.
only
);
}
}
else
if
(
this
.
form
.
cardType
==
3
)
{
card
.
useCondition
=
{
sale_limit
:
{
fee
:
this
.
sale_limit
.
fee
}
};
card
.
costValueType
=
this
.
form
.
costValueType
;
//成本费用0固定成本1门店成本
card
.
costValueProportion
=
this
.
form
.
costValueProportion
;
//成本比例
if
(
card
.
costValueType
==
0
)
{
card
.
costValue
=
typeof
this
.
form
.
costValueProportion
==
'number'
&&
typeof
this
.
form
.
cardDenomination
==
'number'
?
this
.
form
.
costValueProportion
*
this
.
form
.
cardDenomination
:
0
;
//成本
card
.
costStoreList
=
[];
}
if
(
card
.
costValueType
==
1
)
{
card
.
costValue
=
undefined
;
if
(
this
.
isEdit
)
{
card
.
costStoreList
=
this
.
selectedStoreList
.
map
(
el
=>
{
el
.
costValue
=
typeof
this
.
form
.
cardDenomination
==
'number'
&&
typeof
el
.
costValueProportion
==
'number'
?
this
.
form
.
cardDenomination
*
el
.
costValueProportion
:
0
;
return
el
;
});
}
else
if
(
this
.
isAdd
||
this
.
isCopy
)
{
card
.
costStoreList
=
this
.
originStoreList
.
map
(
el
=>
{
el
.
costValue
=
typeof
this
.
form
.
cardDenomination
==
'number'
&&
typeof
el
.
costValueProportion
==
'number'
?
this
.
form
.
cardDenomination
*
el
.
costValueProportion
:
0
;
return
el
;
});
}
}
}
// 适用商品额度
...
...
src/views/card/form.vue
View file @
407b9a93
...
...
@@ -105,7 +105,7 @@
</div>
<div
class=
"store-cost-search"
>
<el-input
v-model=
"searchStore"
placeholder=
"请输入门店名称/code"
prefix-icon=
"el-icon-search"
clearable
style=
"width: 260px"
></el-input>
<el-button
v-if=
"!isEdit && !isInfo"
type=
"primary"
style=
"border: none"
><i
class=
"iconfont icon-shangc"
></i>
成本批量导入
</el-button>
<el-button
v-if=
"!isEdit && !isInfo"
@
click=
"importCost.visible = true"
type=
"primary"
style=
"border: none"
><i
class=
"iconfont icon-shangc"
></i>
成本批量导入
</el-button>
</div>
<div
class=
"store-list"
>
<div
class=
"store-row store-header"
>
...
...
@@ -117,13 +117,7 @@
<i
:class=
"['sort-icon descending', { descend: sortType == 1 }]"
@
click=
"onSortStore(1)"
></i>
</span>
</div>
<div
class=
"store-cell store-header-cell"
style=
"width: 135px"
>
成本金额
<!-- <span class="sort-handle">
<i :class="['sort-icon ascending', { ascend: sortType == 0 }]" @click="onSortStore(0)"></i>
<i :class="['sort-icon descending', { descend: sortType == 1 }]" @click="onSortStore(1)"></i>
</span> -->
</div>
<div
class=
"store-cell store-header-cell"
style=
"width: 135px"
>
成本金额
</div>
</div>
<recycle-scroller
:items=
"storeList"
key-field=
"storeId"
:style=
"{ height: storeList.length > 6 ? '287px' : 'auto' }"
:itemSize=
"48"
v-slot=
"{ item }"
>
<div
class=
"store-row"
>
...
...
@@ -131,7 +125,7 @@
<div
class=
"store-name"
>
{{ item.storeName }}
</div>
<div
class=
"store-code"
>
code:{{ item.storeCode }}
</div>
</div>
<div
class=
"store-cell"
style=
"width: 284px"
><el-input-number
v-model=
"item.costValueProportion"
:disabled=
"isEdit
|| isInfo
"
:min=
"0"
:max=
"100"
:precision=
"0"
:controls=
"false"
style=
"margin-right: 10px; width: 130px"
placeholder=
"请输入成本比例"
></el-input-number>
%
</div>
<div
class=
"store-cell"
style=
"width: 284px"
><el-input-number
v-model=
"item.costValueProportion"
:disabled=
"isEdit
&& form.costStoreList.some(el => el.storeId == item.storeId)
"
:min=
"0"
:max=
"100"
:precision=
"0"
:controls=
"false"
style=
"margin-right: 10px; width: 130px"
placeholder=
"请输入成本比例"
></el-input-number>
%
</div>
<div
class=
"store-cell"
style=
"width: 135px"
>
{{ typeof item.costValueProportion == 'number'
&&
typeof form.cardDenomination == 'number' ? (item.costValueProportion * form.cardDenomination) / 100 : 0 }} 元
</div>
</div>
</recycle-scroller>
...
...
@@ -427,7 +421,7 @@
<
dm
-
input
class
=
"w400"
v
-
model
=
"form.cardExplain"
:
disabled
=
"isInfo"
:
maxlength
=
"50"
><
/dm-input
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"适用门店"
>
<
el
-
form
-
item
label
=
"适用门店"
v
-
if
=
"form.cardType != 3"
>
<
el
-
radio
:
disabled
=
"isEdit"
v
-
model
=
"storeMode"
:
label
=
"0"
>
所有门店
<
/el-radio
>
<
el
-
radio
:
disabled
=
"isEdit"
v
-
model
=
"storeMode"
:
label
=
"1"
>
部分门店
<
/el-radio
>
<
div
v
-
if
=
"isEdit"
class
=
"fz12 gray"
>
...
...
@@ -472,6 +466,13 @@
<
el
-
button
v
-
if
=
"isAdd || isCopy"
type
=
"primary"
@
click
=
"xxSyspConfirm"
>
确定
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
el
-
dialog
title
=
"成本批量导入"
:
visible
.
sync
=
"importCost.visible"
width
=
"720px"
@
close
=
"onCloseImportCost"
>
<
dm
-
import
-
file
ref
=
"importFile"
style
=
"width:680px"
:
options
=
"importCost.options"
@
change
=
"handleFileChange"
:
echo
=
"fileEcho"
><
/dm-import-file
>
<
template
slot
=
"footer"
>
<
el
-
button
:
disabled
=
"importCost.loading"
@
click
=
"importCost.visible = false"
>
取消
<
/el-button
>
<
el
-
button
:
disabled
=
"importCost.loading"
:
loading
=
"importCost.loading"
@
click
=
"onSaveImportCost"
type
=
"primary"
>
确认
<
/el-button
>
<
/template
>
<
/el-dialog
>
<
dm
-
send
-
preview
:
data
=
"form"
:
visible
.
sync
=
"preview.visible"
/>
<!--
转赠预览
-->
<
linktools
showType
=
"5"
:
canSave
=
"!isInfo"
:
linkVisible
.
sync
=
"linkToolsVisible"
@
linkSelect
=
"linkSelect"
:
linkData
=
"form.jumpLink"
/>
<!--
链接小工具
-->
<
linktools
showType
=
"5"
:
canSave
=
"isAdd || isCopy"
:
linkVisible
.
sync
=
"linkToolsVisible2"
@
linkSelect
=
"linkSelect2"
:
linkData
=
"form.bannerJumpUrl"
/>
<!--
链接小工具
-
转赠
-->
...
...
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