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
2aefd7f1
Commit
2aefd7f1
authored
Aug 25, 2022
by
huaying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 核销门店,核销记录
parent
9dd4ce79
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
520 additions
and
67 deletions
+520
-67
card.js
src/router/modules/card.js
+10
-0
cardApi.js
src/service/api/cardApi.js
+9
-1
addStoreDialog.vue
src/views/card/addStoreDialog.vue
+4
-10
setStaffDialog.vue
src/views/card/setStaffDialog.vue
+30
-21
store-list.vue
src/views/card/store-list.vue
+8
-3
writeOff.js
src/views/card/writeOff.js
+134
-0
writeOffCard.vue
src/views/card/writeOffCard.vue
+86
-27
writeOffStore.vue
src/views/card/writeOffStore.vue
+117
-5
writeOffStoreDetail.vue
src/views/card/writeOffStoreDetail.vue
+122
-0
No files found.
src/router/modules/card.js
View file @
2aefd7f1
...
...
@@ -272,6 +272,16 @@ export default {
component
:
()
=>
import
(
/* webpackChunkName: "card" */
'../../views/card/hhrecord-list.vue'
),
meta
:
{
path
:
'/card/hhrecord'
},
children
:
[]
},
{
path
:
'storeDetails'
,
name
:
'核销明细'
,
component
:
()
=>
import
(
/* webpackChunkName: "card" */
'../../views/card/writeOffStoreDetail.vue'
),
meta
:
{
type
:
'info'
,
path
:
'/card/storeDetails'
}
}
]
...
...
src/service/api/cardApi.js
View file @
2aefd7f1
...
...
@@ -204,7 +204,7 @@ export const delStore = params => requests(PREFIX + 'delete-write-off-store', pa
// 删除员工
export
const
delstraff
=
params
=>
requests
(
PREFIX
+
'delete-write-off-staff'
,
params
);
// 新增门店
export
const
addStore
=
params
=>
requests
(
PREFIX
+
'save-write-off-store'
,
params
);
export
const
addStore
=
params
=>
requests
(
PREFIX
+
'save-write-off-store'
,
params
,
true
);
// 新增编辑员工
export
const
setStraff
=
params
=>
requests
(
PREFIX
+
'save-write-off-staff'
,
params
);
// 查询手机号是否重复
...
...
@@ -212,3 +212,11 @@ export const searchRePhone = params => requests(PREFIX + 'check-write-off-staff'
export
const
getStoreWidgetStore
=
params
=>
requests
(
'/api-plug/get-store-widget-store'
,
params
);
export
const
importCostStore
=
params
=>
requests
(
'/api-marketing/import-cost-store'
,
params
,
true
);
//卡券核销列表
export
const
getCardLogPage
=
params
=>
requests
(
PREFIX
+
'card-write-off-log-page'
,
params
);
//核销记录导出
export
const
exportCardLog
=
params
=>
requests
(
PREFIX
+
'export-card-write-off-log'
,
params
);
//核销数据 (门店)列表
export
const
getCardStorePage
=
params
=>
requests
(
PREFIX
+
'card-write-off-store-page'
,
params
);
//核销数据 (门店)--明细列表
export
const
getCardDetailPage
=
params
=>
requests
(
PREFIX
+
'card-write-off-page'
,
params
);
src/views/card/addStoreDialog.vue
View file @
2aefd7f1
...
...
@@ -55,16 +55,10 @@ export default {
};
return
para
;
});
await
addStore
(
res
)
.
then
(
res
=>
{
console
.
log
(
res
,
'res'
);
this
.
loadings
=
false
;
this
.
handleClose
();
})
.
catch
(
err
=>
{
this
.
loadings
=
false
;
this
.
$tips
({
type
:
'error'
,
message
:
'操作失败'
});
});
await
addStore
({
storeList
:
res
}).
then
(
res
=>
{
this
.
loadings
=
false
;
this
.
handleClose
();
});
}
else
{
this
.
loadings
=
false
;
this
.
$tips
({
type
:
'waring'
,
message
:
'请完善表单'
});
...
...
src/views/card/setStaffDialog.vue
View file @
2aefd7f1
...
...
@@ -4,12 +4,11 @@
<el-form-item
label=
"员工姓名:"
prop=
"writeOffName"
>
<el-input
class=
"w304"
v-model=
"form.writeOffName"
placeholder=
"请输入内容"
maxlength=
"10"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"手机号码:"
prop=
"writeOffPhone"
>
<el-form-item
label=
"手机号码:"
prop=
"writeOffPhone"
:error=
"errorRe"
>
<el-select
class=
"w116"
:disabled=
"row.writeOffStoreStaffId"
v-model=
"typeSe"
placeholder=
"请选择"
>
<el-option
v-for=
"item in typeList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<el-input
:disabled=
"row.writeOffStoreStaffId"
class=
"w178"
v-model=
"form.writeOffPhone"
@
change=
"phoneChange"
></el-input>
<!--
<el-writeOffPhone-number-input
v-model=
"writeOffPhone"
:onlyCountries=
"onlyCountries"
></el-writeOffPhone-number-input>
-->
<el-input
:disabled=
"row.writeOffStoreStaffId"
class=
"w178"
v-model=
"form.writeOffPhone"
@
blur=
"phoneChange"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
>
...
...
@@ -41,8 +40,6 @@ export default {
callback
(
new
Error
(
'手机号不能为空'
));
}
else
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
'手机号格式错误'
));
}
else
if
(
!
this
.
rePhone
)
{
callback
(
new
Error
(
'手机号码已存在'
));
}
else
{
callback
();
}
...
...
@@ -60,6 +57,7 @@ export default {
writeOffName
:
[{
required
:
true
,
message
:
'请输入员工姓名'
,
trigger
:
'blur'
}],
writeOffPhone
:
[{
required
:
true
,
validator
:
validatorPhone
,
trigger
:
'blur'
}]
},
errorRe
:
''
,
typeSe
:
'1'
,
typeList
:
[
{
...
...
@@ -78,15 +76,19 @@ export default {
value
:
'4'
,
label
:
'台湾 +886'
}
],
rePhone
:
true
]
};
},
methods
:
{
async
phoneChange
(
e
)
{
await
searchRePhone
({
writeOffPhone
:
e
}).
then
(
res
=>
{
async
phoneChange
()
{
await
searchRePhone
({
writeOffPhone
:
this
.
form
.
writeOffPhon
e
}).
then
(
res
=>
{
if
(
res
.
errorCode
==
0
)
{
this
.
rePhone
=
res
.
result
;
// this.rePhone = res.result;
// console.log(this.rePhone, 1);
if
(
!
res
.
result
)
{
console
.
log
(
res
.
result
,
33
);
this
.
errorRe
=
'手机号码已存在'
;
}
}
});
},
...
...
@@ -99,26 +101,26 @@ export default {
},
submit
()
{
this
.
loadings
=
true
;
this
.
$refs
.
form
.
validate
(
async
valid
=>
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
!
this
.
form
.
writeOffStoreStaffId
)
{
delete
this
.
form
.
writeOffStoreStaffId
;
}
await
setStraff
(
this
.
form
)
setStraff
(
this
.
form
)
.
then
(
res
=>
{
if
(
res
.
errorCode
==
0
)
{
this
.
loadings
=
false
;
this
.
handleClose
();
}
this
.
$tips
({
type
:
'success'
,
message
:
'操作成功'
});
this
.
loading
=
false
;
this
.
handleClose
();
return
;
})
.
catch
(
()
=>
{
this
.
loadings
=
false
;
this
.
$tips
({
type
:
'error'
,
message
:
'操作失败'
})
;
.
catch
(
err
=>
{
this
.
$tips
({
type
:
'error'
,
message
:
err
.
message
||
'操作失败'
})
;
this
.
loading
=
false
;
});
}
else
{
this
.
loadings
=
false
;
this
.
$tips
({
type
:
'waring'
,
message
:
'请完善表单'
});
return
false
;
}
this
.
loadings
=
false
;
});
}
},
...
...
@@ -141,6 +143,13 @@ export default {
},
immediate
:
true
}
// rePhone: {
// handler: function(val) {
// this.rePhone = val;
// console.log(this.rePhone, 2);
// },
// immediate: true
// }
}
};
</
script
>
...
...
src/views/card/store-list.vue
View file @
2aefd7f1
...
...
@@ -2,7 +2,7 @@
<div
class=
"storeBox"
v-loading=
"loading"
>
<div>
门店
{{
tableData
.
length
}}
家
</div>
<div
class=
"searchBox"
>
<el-input
class=
"w260"
prefix-icon=
"el-icon-search"
placeholder=
"请输入门店名称/代码"
v-model=
"listParams.search
"
></el-input>
<el-input
class=
"w260"
prefix-icon=
"el-icon-search"
placeholder=
"请输入门店名称/代码"
clearable
v-model=
"listParams.search"
@
change=
"searchEvent
"
></el-input>
<div>
<el-button
@
click=
"qrEvent"
>
核销工具二维码
</el-button>
<el-button
type=
"primary"
@
click=
"addSoreEvent"
>
新增门店
</el-button>
...
...
@@ -22,7 +22,7 @@
</div>
<div
class=
"c_t_right"
>
<el-button
type=
"text"
style=
"margin-right: 12px;"
@
click=
"setStraffEvent(
{ storeId: item.storeId, storeCode: item.storeCode })">新增员工
</el-button>
<el-popconfirm
confirm-button-text=
"删除"
cancel-button-text=
"取消"
icon=
"el-icon-warning"
icon-color=
"#FA8C16"
style=
"margin-left:6px"
@
confirm=
"deleteStoreEvent(
row
)"
title=
"删除后卡券适用门店无法选择,是否继续?"
>
<el-popconfirm
confirm-button-text=
"删除"
cancel-button-text=
"取消"
icon=
"el-icon-warning"
icon-color=
"#FA8C16"
style=
"margin-left:6px"
@
confirm=
"deleteStoreEvent(
item
)"
title=
"删除后卡券适用门店无法选择,是否继续?"
>
<el-button
slot=
"reference"
type=
"text"
>
删除
</el-button>
</el-popconfirm>
</div>
...
...
@@ -83,6 +83,11 @@ export default {
this
.
getList
();
},
methods
:
{
searchEvent
(
val
)
{
this
.
listParams
.
search
=
val
;
this
.
listParams
.
currentPage
=
1
;
this
.
getList
();
},
handleSizeChange
(
val
)
{
this
.
listParams
.
currentPage
=
1
;
this
.
listParams
.
pageSize
=
val
;
...
...
@@ -109,7 +114,7 @@ export default {
},
// 删除门店
async
deleteStoreEvent
(
row
)
{
await
delStore
({
storeId
:
row
.
s
toreId
})
await
delStore
({
writeOffStoreId
:
row
.
writeOffS
toreId
})
.
then
(()
=>
{
this
.
$tips
({
type
:
'success'
,
message
:
'删除成功'
});
if
(
this
.
tableData
.
length
===
1
&&
this
.
listParams
.
currentPage
!==
1
)
{
...
...
src/views/card/writeOff.js
0 → 100644
View file @
2aefd7f1
import
{
exportCardLog
}
from
'@/service/api/cardApi.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
export
default
{
data
()
{
return
{
loading
:
false
,
dateTime
:
[],
defaultAvatar
:
require
(
'../../assets/img/head_default.png'
),
formatDateTimeByType
,
tableData
:
[],
sortColumn
:
''
,
sortType
:
''
,
total
:
0
,
checkedM
:
false
,
checkedT
:
false
};
},
methods
:
{
getDateRange
(
setEndDate
)
{
const
start
=
new
Date
();
let
end
=
new
Date
();
end
=
setEndDate
(
end
);
function
getDate
(
date
)
{
const
result
=
[];
result
.
push
(
date
.
getFullYear
());
result
.
push
((
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
));
result
.
push
(
date
.
getDate
()
.
toString
()
.
padStart
(
2
,
'0'
)
);
return
result
.
join
(
'-'
);
}
// yyyy-MM-dd
return
[
`
${
getDate
(
start
)}
23:59:59`
,
`
${
getDate
(
end
)}
00:00:00`
];
},
// 当月
currentM
(
e
)
{
if
(
e
)
{
this
.
checkedT
=
false
;
this
.
dateTime
=
[];
let
setDate
;
setDate
=
endDate
=>
{
endDate
.
setMonth
(
endDate
.
getMonth
());
endDate
.
setDate
(
1
);
return
new
Date
(
endDate
);
};
const
[
start
,
end
]
=
this
.
getDateRange
(
setDate
);
this
.
dateTime
.
push
(
end
);
this
.
dateTime
.
push
(
start
);
}
else
{
this
.
dateTime
=
[];
}
this
.
refresh
();
},
// 近三个月
reThree
(
e
)
{
if
(
e
)
{
this
.
checkedM
=
false
;
this
.
dateTime
=
[];
let
setDate
;
setDate
=
endDate
=>
{
endDate
.
setMonth
(
endDate
.
getMonth
()
-
2
);
endDate
.
setDate
(
1
);
return
new
Date
(
endDate
);
};
const
[
start
,
end
]
=
this
.
getDateRange
(
setDate
);
this
.
dateTime
.
push
(
end
);
this
.
dateTime
.
push
(
start
);
}
else
{
this
.
dateTime
=
[];
}
this
.
refresh
();
},
refresh
()
{
if
(
!
this
.
dateTime
)
{
this
.
checkedM
=
false
;
this
.
checkedT
=
false
;
}
this
.
params
.
currentPage
=
1
;
this
.
getList
();
},
handleSizeChange
(
val
)
{
this
.
params
.
currentPage
=
1
;
this
.
params
.
pageSize
=
val
;
this
.
getList
();
},
handleCurrentChange
(
val
)
{
this
.
params
.
currentPage
=
val
;
this
.
getList
();
},
// 排序
sortChange
(
column
)
{
this
.
sortColumn
=
column
.
prop
;
this
.
sortType
=
column
.
order
==
'ascending'
?
'asc'
:
'desc'
;
this
.
params
.
sortBy
=
`
${
this
.
sortColumn
}
${
this
.
sortType
}
`
;
this
.
getList
();
},
dataTimeFormat
()
{
if
(
this
.
dateTime
)
{
this
.
params
.
writeOffBeginTime
=
formatDateTimeByType
(
this
.
dateTime
[
0
],
'yyyy-MM-dd HH-mm-ss'
);
this
.
params
.
writeOffEndTime
=
formatDateTimeByType
(
this
.
dateTime
[
1
],
'yyyy-MM-dd HH-mm-ss'
);
}
else
{
this
.
params
.
writeOffBeginTime
=
''
;
this
.
params
.
writeOffEndTime
=
''
;
}
},
exportResult
()
{
const
paras
=
{
search
:
this
.
params
.
search
,
writeOffBeginTime
:
this
.
params
.
writeOffBeginTime
,
writeOffEndTime
:
this
.
params
.
writeOffEndTime
,
sortBy
:
this
.
params
.
sortBy
};
exportCardLog
(
paras
).
then
(
res
=>
{
if
(
res
.
result
.
errorCode
==
'0'
)
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
});
// 3.创建一个临时的url指向blob对象
let
objectUrl
=
window
.
URL
.
createObjectURL
(
blob
);
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
let
a
=
document
.
createElement
(
'a'
);
a
.
setAttribute
(
'href'
,
objectUrl
);
a
.
setAttribute
(
'download'
,
`卡券核销数据-
${
new
Date
().
toLocaleDateString
()}
`
);
a
.
click
();
// 5.释放这个临时的对象url
window
.
URL
.
revokeObjectURL
(
objectUrl
);
}
});
}
}
};
src/views/card/writeOffCard.vue
View file @
2aefd7f1
<
template
>
<div
v-loading=
"loading"
class=
"writeOffCardBox"
>
<div
class=
"searchBox"
>
<el-form
inline
>
<el-form-item>
<el-input
prefix-icon=
"el-icon-search"
placeholder=
"请输入会员信息/卡券信息/门店名称"
class=
"w261"
></el-input>
</el-form-item>
<el-form-item>
<span
class=
"spanBox"
>
核销时间
</span>
<el-date-picker
v-model=
"params.dateTime"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-checkbox
class=
"vertical-middle ml8"
:true-label=
"1"
:false-label=
"0"
label=
"当月"
border
@
change=
"refresh"
/>
</el-form-item>
<el-form-item>
<el-checkbox
class=
"vertical-middle ml8"
:true-label=
"1"
:false-label=
"0"
label=
"最近三个月"
border
@
change=
"refresh"
/>
</el-form-item>
<el-form-item
class=
"frmbt20"
>
<el-button
type=
"primary"
><i
class=
"iconfont icon-xiazai"
style=
"marginRight:2px;fontSize:12px"
/>
查询结果导出
</el-button>
</el-form-item>
</el-form>
<el-input
prefix-icon=
"el-icon-search"
placeholder=
"请输入会员信息/卡券信息/门店名称"
class=
"w261"
v-model=
"params.search"
@
change=
"refresh"
clearable
></el-input>
<span
class=
"spanBox"
>
核销时间
</span>
<el-date-picker
v-model=
"dateTime"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
@
change=
"refresh"
></el-date-picker>
<el-checkbox
class=
"ml16"
v-model=
"checkedM"
label=
"当月"
border
@
change=
"currentM"
/>
<el-checkbox
style=
"margin-left:6px;"
v-model=
"checkedT"
label=
"最近三个月"
border
@
change=
"reThree"
/>
<div
class=
"frmbt20"
>
<el-button
type=
"primary"
@
click=
"exportResult"
><i
class=
"iconfont icon-xiazai"
style=
"marginRight:2px;fontSize:12px"
/>
查询结果导出
</el-button>
</div>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
></el-table>
<el-table
:data=
"tableData"
>
<el-table-column
label=
"领取时间"
prop=
"receiveTime"
min-width=
"128px"
>
<template
slot-scope=
"scope"
>
<p>
{{
formatDateTimeByType
(
scope
.
row
.
receiveTime
,
'yyyy-MM-dd-HH-mm-ss'
,
true
).
y
}}
<br
/>
<span>
{{
formatDateTimeByType
(
scope
.
row
.
receiveTime
,
'yyyy-MM-dd-HH-mm-ss'
,
true
).
h
}}
</span>
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"核销时间"
prop=
"usedTime"
min-width=
"117px"
>
<
template
slot-scope=
"scope"
>
<p>
{{
formatDateTimeByType
(
scope
.
row
.
usedTime
,
'yyyy-MM-dd-HH-mm-ss'
,
true
).
y
}}
<br
/>
<span>
{{
formatDateTimeByType
(
scope
.
row
.
usedTime
,
'yyyy-MM-dd-HH-mm-ss'
,
true
).
h
}}
</span>
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"核销金额"
prop=
"writeOffPrice"
min-width=
"100px"
></el-table-column>
<el-table-column
label=
"成本比例"
prop=
"costValueProportion"
min-width=
"92px"
></el-table-column>
<el-table-column
label=
"成本金额"
prop=
"costValue"
min-width=
"100px"
></el-table-column>
<el-table-column
label=
"核销门店"
prop=
"storeName"
min-width=
"100px"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"核销操作人"
prop=
"writeOffName"
min-width=
"118px"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"会员信息"
min-width=
"137px"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<div>
<img
class=
"vertical-middle table__avatar_40"
:src=
"scope.row.thirdimgurl || defaultAvatar"
width=
"40"
height=
"40"
/>
<div
class=
"inline-block vertical-middle"
>
<p
class=
"overflow-ellipsis"
>
{{
scope
.
row
.
memberName
||
'--'
}}
</p>
<p
class=
"fz12 gray overflow-ellipsis"
>
{{
scope
.
row
.
phoneNum
||
'--'
}}
</p>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"卡券名称"
prop=
"cardName"
min-width=
"111px"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"卡券代码"
prop=
"cardCode"
min-width=
"117px"
show-overflow-tooltip
></el-table-column>
</el-table>
<dm-pagination
v-show=
"tableData.length"
background
class=
"dm-pagination"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"params.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"params.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
</div>
</div>
</template>
<
script
>
import
{
getCardLogPage
}
from
'@/service/api/cardApi.js'
;
import
writeOff
from
'./writeOff'
;
export
default
{
name
:
'writeOffCard'
,
mixins
:
[
writeOff
],
data
()
{
return
{
loading
:
false
,
params
:
{
dateTime
:
''
},
tableData
:
[]
writeOffBeginTime
:
''
,
writeOffEndTime
:
''
,
sortBy
:
'receiveTime desc'
,
search
:
''
,
currentPage
:
1
,
pageSize
:
20
}
};
},
methods
:
{}
mounted
()
{
this
.
getList
();
},
methods
:
{
async
getList
()
{
this
.
dataTimeFormat
();
this
.
loading
=
true
;
await
getCardLogPage
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
errorCode
==
0
)
{
this
.
tableData
=
res
.
result
.
result
||
[];
this
.
total
=
res
.
result
.
totalCount
;
}
else
{
this
.
$tips
({
type
:
'error'
,
message
:
'加载列表失败'
});
}
this
.
loading
=
false
;
});
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.w261
{
width
:
261px
;
}
.ml
8
{
margin-left
:
8
px
;
.ml
16
{
margin-left
:
16
px
;
}
.writeOffCardBox
{
margin-top
:
5px
;
.searchBox
{
.spanBox
{
margin-right
:
10px
;
margin-left
:
1
0
px
;
margin-left
:
1
6
px
;
}
.frmbt20
{
margin-bottom
:
20px
!important
;
...
...
@@ -63,4 +112,14 @@ export default {
}
}
}
.table__avatar_40
{
border-radius
:
20px
;
margin-right
:
7px
;
display
:
inline-block
;
}
.overflow-ellipsis
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
src/views/card/writeOffStore.vue
View file @
2aefd7f1
<
template
>
<div>
门店核销
<div
v-loading=
"loading"
class=
"writeOffCardBox"
>
<div
class=
"searchBox"
>
<el-input
prefix-icon=
"el-icon-search"
placeholder=
"请输入核销门店"
class=
"w261"
v-model=
"params.search"
@
change=
"refresh"
clearable
></el-input>
<span
class=
"spanBox"
>
核销时间
</span>
<el-date-picker
v-model=
"dateTime"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
@
change=
"refresh"
></el-date-picker>
<el-checkbox
class=
"ml16"
v-model=
"checkedM"
label=
"当月"
border
@
change=
"currentM"
/>
<el-checkbox
style=
"margin-left:6px;"
v-model=
"checkedT"
label=
"最近三个月"
border
@
change=
"reThree"
/>
<div
class=
"frmbt20"
>
<el-button
type=
"primary"
@
click=
"exportResult"
><i
class=
"iconfont icon-xiazai"
style=
"marginRight:2px;fontSize:12px"
/>
查询结果导出
</el-button>
</div>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
@
sort-change=
"sortChange"
>
<el-table-column
label=
"核销门店"
prop=
"storeName"
min-width=
"100px"
></el-table-column>
<el-table-column
label=
"券核销数量"
prop=
"writeOffCount"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"核销金额"
prop=
"writeOffPrice"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"成本金额"
prop=
"costValue"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"操作"
prop=
""
min-width=
"100px"
>
<template
slot-scope=
"
{ row }">
<el-button
type=
"text"
@
click=
"details(row)"
>
明细
</el-button>
</
template
>
</el-table-column>
</el-table>
<dm-pagination
v-show=
"tableData.length"
background
class=
"dm-pagination"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"params.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"params.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
</div>
</div>
</template>
<
script
>
import
{
getCardStorePage
}
from
'@/service/api/cardApi.js'
;
import
writeOff
from
'./writeOff'
;
export
default
{
name
:
'writeOffStore'
,
name
:
'writeOffCard'
,
mixins
:
[
writeOff
],
data
()
{
return
{};
return
{
params
:
{
writeOffBeginTime
:
''
,
writeOffEndTime
:
''
,
sortBy
:
'receiveTime desc'
,
search
:
''
,
currentPage
:
1
,
pageSize
:
20
}
};
},
methods
:
{}
mounted
()
{
this
.
getList
();
},
methods
:
{
async
getList
()
{
this
.
loading
=
true
;
this
.
dataTimeFormat
();
await
getCardStorePage
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
errorCode
==
0
)
{
this
.
tableData
=
res
.
result
.
result
||
[];
this
.
total
=
res
.
result
.
totalCount
;
this
.
tableData
=
[
{
storeId
:
1
,
storeName
:
'cehsai'
,
writeOffPrice
:
'23'
,
writeOffCount
:
'66'
,
costValue
:
'66'
},
{
storeId
:
2
,
storeName
:
'daf'
,
writeOffPrice
:
'25'
,
writeOffCount
:
'55'
,
costValue
:
'33'
},
{
storeId
:
3
,
storeName
:
'cehsdfasai'
,
writeOffPrice
:
'21'
,
writeOffCount
:
'88'
,
costValue
:
'44'
}
];
}
else
{
this
.
$tips
({
type
:
'error'
,
message
:
'加载列表失败'
});
}
this
.
loading
=
false
;
});
},
// 明细
details
(
row
)
{
this
.
$router
.
push
(
`/card/storeDetails?id=
${
row
.
storeId
}
`
);
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.w261
{
width
:
261px
;
}
.ml16
{
margin-left
:
16px
;
}
.writeOffCardBox
{
margin-top
:
5px
;
.searchBox
{
.spanBox
{
margin-right
:
10px
;
margin-left
:
16px
;
}
.frmbt20
{
margin-bottom
:
20px
!important
;
margin-right
:
0
!important
;
float
:
right
;
padding-right
:
0
!important
;
}
}
}
.table__avatar_40
{
border-radius
:
20px
;
margin-right
:
7px
;
display
:
inline-block
;
}
.overflow-ellipsis
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
src/views/card/writeOffStoreDetail.vue
0 → 100644
View file @
2aefd7f1
<
template
>
<div
v-loading=
"loading"
class=
"writeOffCardBox"
>
<div
class=
"searchBox"
>
<el-input
prefix-icon=
"el-icon-search"
placeholder=
"请输入卡券名称"
class=
"w261"
v-model=
"params.search"
@
change=
"refresh"
clearable
></el-input>
<span
class=
"spanBox"
>
核销时间
</span>
<el-date-picker
v-model=
"dateTime"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
@
change=
"refresh"
></el-date-picker>
<el-checkbox
class=
"ml16"
v-model=
"checkedM"
label=
"当月"
border
@
change=
"currentM"
/>
<el-checkbox
style=
"margin-left:6px;"
v-model=
"checkedT"
label=
"最近三个月"
border
@
change=
"reThree"
/>
</div>
<div
class=
"content"
>
<el-table
:data=
"tableData"
@
sort-change=
"sortChange"
>
<el-table-column
label=
"卡券名称"
prop=
"storeName"
min-width=
"100px"
></el-table-column>
<el-table-column
label=
"券金额"
prop=
"writeOffCount"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"核销数量"
prop=
"writeOffPrice"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"核销金额"
prop=
"writeOffPrice"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"成本比例"
prop=
"costValue"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
<el-table-column
label=
"成本金额"
prop=
"costValue"
min-width=
"100px"
sortable=
"custom"
></el-table-column>
</el-table>
<dm-pagination
v-show=
"tableData.length"
background
class=
"dm-pagination"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"params.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"params.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
</div>
</div>
</
template
>
<
script
>
import
{
getCardDetailPage
}
from
'@/service/api/cardApi.js'
;
import
writeOff
from
'./writeOff'
;
export
default
{
name
:
'writeOffDetail'
,
mixins
:
[
writeOff
],
data
()
{
return
{
params
:
{
writeOffBeginTime
:
''
,
writeOffEndTime
:
''
,
sortBy
:
'receiveTime desc'
,
search
:
''
,
currentPage
:
1
,
pageSize
:
20
}
};
},
mounted
()
{
this
.
getList
();
},
methods
:
{
async
getList
()
{
this
.
loading
=
true
;
this
.
dataTimeFormat
();
this
.
params
=
{
...
this
.
params
,
storeId
:
this
.
$route
.
query
.
id
};
await
getCardDetailPage
(
this
.
params
).
then
(
res
=>
{
if
(
res
.
errorCode
==
0
)
{
this
.
tableData
=
res
.
result
.
result
||
[];
this
.
total
=
res
.
result
.
totalCount
;
this
.
tableData
=
[
{
storeId
:
1
,
storeName
:
'cehsai'
,
writeOffPrice
:
'23'
,
writeOffCount
:
'66'
,
costValue
:
'66'
},
{
storeId
:
2
,
storeName
:
'daf'
,
writeOffPrice
:
'25'
,
writeOffCount
:
'55'
,
costValue
:
'33'
},
{
storeId
:
3
,
storeName
:
'cehsdfasai'
,
writeOffPrice
:
'21'
,
writeOffCount
:
'88'
,
costValue
:
'44'
}
];
}
else
{
this
.
$tips
({
type
:
'error'
,
message
:
'加载列表失败'
});
}
this
.
loading
=
false
;
});
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.w261
{
width
:
261px
;
}
.ml16
{
margin-left
:
16px
;
}
.writeOffCardBox
{
margin
:
20px
;
.searchBox
{
margin-bottom
:
20px
;
.spanBox
{
margin-right
:
10px
;
margin-left
:
16px
;
}
.frmbt20
{
margin-bottom
:
20px
!important
;
margin-right
:
0
!important
;
float
:
right
;
padding-right
:
0
!important
;
}
}
}
.table__avatar_40
{
border-radius
:
20px
;
margin-right
:
7px
;
display
:
inline-block
;
}
.overflow-ellipsis
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
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