Commit 070d671b by 李伟康

提交

1 parent e4819ff6
import { http } from '@/main'
const getMerchantList = params => {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMerchantList
}
\ No newline at end of file
<template>
<div
class="layout"
v-loading="loading"
>
<div class="content">
<div class="title">积分充值</div>
<el-scrollbar class="box">
<div class="text flex">
<div class="item flex">
<div class="label">批次号:</div>
<div class="value">-</div>
</div>
<div class="item flex">
<div class="label">状态:</div>
<div class="value">-</div>
</div>
</div>
<glsx-combi-form
ref="fromRef"
:isEdit="true"
:isBlock="true"
:formObj="configForm"
:formData="formData"
:formRules="rule"
>
<template #merchantId>
<div class="upload">
<div class="upload-btn">
<el-button
size="small"
@click="relateStoreVisible = true"
>
<i class="el-icon-plus"></i>
选择商户
</el-button>
</div>
</div>
<template v-if="configForm.merchantId">
<GLTable
:tableData="[configForm]"
:tableParams="merchantParams"
:hasPage="false"
class="merchant-box"
>
</GLTable>
</template>
</template>
<template #table>
<div class="upload">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传名单
</el-button>
<input
type="file"
style="opacity: 0"
ref="file"
accept=".xlsx, .xlc, .xlm, .xls"
@change="uploadFile"
/>
</div>
<a
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/红包链接.xlsx"
target="_blank"
>下载模板</a>
</div>
<div class="file-info flex">
<div class="el-icon-success"></div>
文件格式正确(客户名单.xlsx)
</div>
<div class="table-box">
<GLTable
:tableData="[]"
:tableParams="tableParams"
>
</GLTable>
<div class="total">
<template v-for="(i,index) in totalFormData">
<template>
<div
:key="index"
class="item flex"
>
<div class="label">{{i.label}}:</div>
<div class="value"></div>
</div>
</template>
</template>
</div>
</div>
</template>
</glsx-combi-form>
</el-scrollbar>
</div>
<GLFooter class="footer">
<el-button
@click="$router.go(-1)"
size="medium"
>取消</el-button>
<el-button
type="primary"
@click="handleConfirm"
size="medium"
>确定</el-button>
</GLFooter>
<select-store
ref="relateStore"
:dialogVisible.sync="relateStoreVisible"
:storeSelected="selectedList"
:merchantInfo="configForm.merchantId"
@handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="handleRelateStoreClose"
/>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
import selectStore from './components/selectStore'
export default {
components: {
selectStore
},
name: '',
data () {
return {
loading: false,
relateStoreVisible: false,
configForm: {},
formData: [
{
label: '选择商户',
addHtml: 'merchantId'
},
{
label: '导入充值人群',
addHtml: 'table'
},
],
totalForm: {},
totalFormData: [
{
label: '客户数量',
name: 'goodsName',
type: 'showTxt'
},
{
label: '充值积分小计',
name: 'goodsName',
type: 'showTxt'
},
{
label: '通道手续费(2%)',
name: 'goodsName',
type: 'showTxt'
},
{
label: '通道手续费(2%)',
name: 'goodsName',
type: 'showTxt'
},
{
label: '总数',
name: 'goodsName',
type: 'showTxt'
},
],
tableParams: {
tableColumns: [
{
label: '保单号',
prop: 'userPhone',
minWidth: 100
},
{
label: '用户姓名',
prop: 'wechatName',
minWidth: 100
},
{
label: '身份证号',
prop: 'activityName',
minWidth: 100
},
{
label: '用户手机号',
minWidth: 150,
prop: 'activityName',
},
{
label: '返现金额',
minWidth: 100,
prop: 'activityName',
},
{
label: '商品兑换积分',
minWidth: 150,
formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
},
{
label: '赠送油券',
prop: 'activityType',
minWidth: 150,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
}
},
{
label: '赠送自店服务',
prop: 'activityType',
minWidth: 150,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
}
},
{
label: '充值积分小计',
prop: 'link',
minWidth: 150
},
]
},
merchantParams: {
tableColumns: [
{
label: '商户号',
prop: 'merchantId',
minWidth: 100
},
{
label: '商户名称',
prop: 'merchantName',
minWidth: 100
},
]
}
}
},
mounted () {
const { id, type } = this.$route.query
// if (id) {
// }
},
methods: {
async getQuestionnaireDetail () {
try {
const data = await this.$apis.questionnaire.getQuestionnaireDetail()
this.loading = false
} catch (error) {
setTimeout(() => this.$router.go(-1), 1.5e3)
}
},
handleConfirm () {
},
uploadFile () {
},
// 选择门店
handleRelateStoreClose () {
this.relateStoreVisible = false
},
handleRelateStoreConfirm (selectedData) {
console.log(selectedData, '===')
selectedData.merchantId && (this.configForm.merchantId = selectedData.merchantId)
selectedData.merchantName && (this.configForm.merchantName = selectedData.merchantName)
this.handleRelateStoreClose()
},
}
}
</script>
<style scoped lang='scss'>
.layout {
position: absolute;
width: 100%;
height: calc(100vh - 48px);
top: 0;
left: 0;
.box {
width: 100%;
height: calc(100% - 46px);
box-sizing: border-box;
}
.content {
height: calc(100% - 88px);
background-color: #fff;
margin: 16px 24px 0;
border-radius: 0 4px 4px 4px;
.title {
border-bottom: 1px solid #e5e5e5;
padding: 15px 0 14px 20px;
font-weight: 500;
font-size: 16px;
color: #333333;
}
.text {
padding: 32px 0 20px 20px;
font-size: 14px;
color: #666666;
.label {
width: 154px;
text-align: right;
}
.value {
min-width: 232px;
}
}
}
.footer {
padding: 16px 0;
}
}
.upload {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
&:hover {
.el-button {
color: var(--primaryColor, #5850ff);
border-color: #cdcbff;
background-color: #eef;
}
}
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a {
margin-left: 8px;
color: #5850ff;
font-size: 14px;
cursor: pointer;
}
}
.merchant-box{
margin-top: 10px;
}
.file-info {
font-size: 14px;
color: #999999;
.el-icon-success {
color: #67c23a;
line-height: 32px;
margin-right: 4px;
}
}
.table-box {
width: 864px;
background: #f9f9f9;
border-radius: 4px;
padding: 20px;
}
.total {
display: flex;
flex-direction: column;
font-size: 14px;
color: #666666;
.item {
justify-content: flex-end;
line-height: 20px;
margin-top: 10px;
.label {
width: 154px;
text-align: right;
}
.value {
min-width: 90px;
}
}
}
</style>
\ No newline at end of file
<template>
<GLDialog
bigTitle="选择商户"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose"
class="select-store"
>
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData"
>
<span slot="footer">
<el-button
:size="size"
type="primary"
@click="getTable"
>查询</el-button>
<el-button
:size="size"
@click="resetTable"
>重置</el-button>
</span>
</glsx-combi-form>
<GLTable
ref="storeRef"
:noDataImg="url"
:tableTotal="total"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun"
>
<div
slot="radioHtml"
class="store-table"
slot-scope="scope"
>
<el-radio
v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"
></el-radio>
</div>
</GLTable>
</GLDialog>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStore',
data () {
return {
url: url,
searchForm: {
merchantId: '',
merchantName: ''
},
total: 0,
storeList: [],
heightBox: 200,
merchantId: '',
merchantName: '',
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
inputType: 'number',
placeholder: '请输入商户ID',
width: '300px',
labelWidth: '10px'
}
],
pageConfig: {
pageSize: 10,
currentPage: 1
},
tableParams: {
listName: 'list',
// tableOption: true,
// 行数据的key
// mutiSelectUniqueKey: 'staffId',
// checkSelectKey: 'staffId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '商户名称',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '商户id',
prop: 'merchantNo',
formatter: cellValue => {
return cellValue.merchantNo || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
storeSearchForm: {
type: Object
},
merchantInfo: {
required: true
}
// merchantId: {
// type: String,
//
// }
// orderCode: {
// type: String,
// required: true
// }
},
watch: {
dialogVisible (n) {
if (n) this.init()
}
},
mounted () {
},
methods: {
init () {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo
this.getList()
},
getList (pageCon) {
console.log(pageCon, 'pageCon')
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
}
console.log(this.$apis)
this.$apis.common.getMerchantList(params).then(res => {
console.log(res)
this.storeList = res.list
this.total = res.total
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
console.log(nowIndex)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
console.log(this.storeList)
})
},
getTable () {
this.$refs.storeRef.page.currentPage = 1
this.getList()
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick (val) {
console.log(val)
this.merchantId = val.merchantNo
this.merchantName = val.merchantName
},
resetTable () {
this.searchForm = {}
this.getTable()
},
handleClose () {
this.$emit('handleRelateStoreClose')
},
handleConfirm () {
this.$emit('handleRelateStoreConfirm', {
merchantId: this.merchantId,
merchantName: this.merchantName
})
}
}
}
</script>
<style lang="scss">
.select-store {
.storeDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.store-table .el-radio__label {
display: none;
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<GLCombiForm
ref="showSearch"
:rowNumber="2"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<el-button
type="default"
plain
@click="jump"
>门店客户积分充值</el-button>
<el-button @click="handleExport">导出
</el-button>
</div>
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
name: 'RedEnvelopeConfig',
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: {
merchantName: '',
merchantId: '',
staffName: ''
},
searchFormData: [
{
label: '批次',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: 100
},
{
label: '用户姓名',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '用户手机号',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '创建时间',
name: 'showTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate (date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
{
label: '状态',
name: 'statuses',
type: 'select',
maxlength: 100,
optionList: [
{ text: '全部', id: '-1,0,1' },
{ text: '待付款', id: '0' },
{ text: '已取消', id: '1' },
{ text: '发放中', id: '-1' },
{ text: '发放成功', id: '-2' },
{ text: '发放失败', id: '-3' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '审核时间',
name: 'showTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate (date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
],
getListApi: this.$apis.points.getList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商户名称',
prop: 'userPhone',
minWidth: 100
},
{
label: '批次',
prop: 'wechatName',
minWidth: 100
},
{
label: '客户数量',
prop: 'activityName',
minWidth: 100
},
{
label: '充值积分数',
minWidth: 100,
prop: 'activityName',
},
{
label: '状态',
minWidth: 100,
prop: 'activityName',
},
{
label: '创建时间',
minWidth: 150,
formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
},
{
label: '审核人',
prop: 'activityType',
minWidth: 150,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
}
},
{
label: '审核时间',
prop: 'link',
minWidth: 150
},
]
},
tableButtonList: [
{
type: 'el-button',
name: '审核',
attrs: {
type: 'text',
},
condition: row => row.status != 0,
listeners: {
click: row => this.dataObj = {
show: true,
...row
}
}
},
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
},
listeners: {
click: row => this.editForm(row)
}
},
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
},
condition: row => true,
listeners: {
click: row => this.editForm(row, 'edit')
}
},
],
showImportRecord: false,
tableSearchForm: {}
}
},
mounted () {
},
methods: {
handleSearch () {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
handleExport () {
const params = this.getParams()
this.$apis.points.orderExport(params).then(res => {
this.$utils.aToExport(res)
})
},
getParams () {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
this.updateParams(params, 'lotteryDrawTime', 'lotteryDrawTime', 'startLotteryDrawTime', 'endLotteryDrawTime');
return params
},
updateParams (params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
delete params[paramKey];
} else {
delete params[beginKey];
delete params[endKey];
}
// delete params[paramKey];
return params
},
jump () {
this.$router.push({
path: '/storeCredit/add',
query: {
$title: '门店客户积分充值',
}
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.sticky-btns {
margin-bottom: 10px;
display: flex;
justify-content: flex-end;
.el-button {
min-width: 60px;
}
.el-button + .el-button {
margin-left: 10px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!