1、续费记录
This commit is contained in:
@ -52,3 +52,19 @@ export function syncStateAbnormalNumber() {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空所有异常号码
|
||||||
|
export function cleanSmsAbnormalNumber() {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-abnormal-number/clear',
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function batchCancelSmsAbnormalNumber(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-abnormal-number/batch-cancel',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
47
src/api/admin/sms-renewal-log.js
Normal file
47
src/api/admin/sms-renewal-log.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询SmsRenewalLog列表
|
||||||
|
export function listSmsRenewalLog(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-renewal-log',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询SmsRenewalLog详细
|
||||||
|
export function getSmsRenewalLog (id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-renewal-log/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增SmsRenewalLog
|
||||||
|
export function addSmsRenewalLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-renewal-log',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改SmsRenewalLog
|
||||||
|
export function updateSmsRenewalLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-renewal-log/'+data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除SmsRenewalLog
|
||||||
|
export function delSmsRenewalLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/sms-renewal-log',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -21,18 +21,34 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要同步吗?" confirm-button-text="同步"
|
<el-popconfirm class="delete-popconfirm" title="确认要同步吗?" confirm-button-text="同步"
|
||||||
@confirm="handleSync()">
|
@confirm="handleSync()">
|
||||||
<el-button slot="reference" v-permisaction="['admin:smsAbnormalNumber:sync']"
|
<el-button slot="reference" v-permisaction="['admin:smsAbnormalNumber:sync']" size="mini"
|
||||||
size="mini" type="primary" :loading="loading">同步
|
type="primary" :loading="loading">同步
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要批量取消吗?" confirm-button-text="批量取消"
|
||||||
|
@confirm="handleBatchCancel()">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsAbnormalNumber:batchCancel']"
|
||||||
|
size="mini" type="danger" :disabled="multiple" :loading="loading">批量取消
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:smsAbnormalNumber:remove']" type="danger"
|
<el-button v-permisaction="['admin:smsAbnormalNumber:remove']" type="danger"
|
||||||
icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
|
icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要清空吗?" confirm-button-text="清空"
|
||||||
|
@confirm="handleClean()">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsAbnormalNumber:clean']" size="mini"
|
||||||
|
type="danger" :loading="loading">清空
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="smsAbnormalNumberList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="smsAbnormalNumberList" @selection-change="handleSelectionChange">
|
||||||
@ -59,7 +75,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
:limit.sync="queryParams.pageSize" @pagination="getList" :page-sizes="pageSizes" />
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
@ -67,7 +83,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { delSmsAbnormalNumber, listSmsAbnormalNumber,syncStateAbnormalNumber } from '@/api/admin/sms-abnormal-number'
|
import { delSmsAbnormalNumber, listSmsAbnormalNumber, syncStateAbnormalNumber,cleanSmsAbnormalNumber,batchCancelSmsAbnormalNumber } from '@/api/admin/sms-abnormal-number'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SmsAbnormalNumber',
|
name: 'SmsAbnormalNumber',
|
||||||
@ -95,7 +111,7 @@ export default {
|
|||||||
smsAbnormalNumberList: [],
|
smsAbnormalNumberList: [],
|
||||||
platformCodeOptions: [],
|
platformCodeOptions: [],
|
||||||
// 关系表类型
|
// 关系表类型
|
||||||
|
pageSizes:[50,100,200,500],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
@ -203,8 +219,8 @@ export default {
|
|||||||
}).catch(function () {
|
}).catch(function () {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSync(){
|
handleSync() {
|
||||||
this.loading=true
|
this.loading = true
|
||||||
|
|
||||||
syncStateAbnormalNumber().then(response => {
|
syncStateAbnormalNumber().then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -214,12 +230,49 @@ export default {
|
|||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err=>{
|
.catch(err => {
|
||||||
console.log("err:",err)
|
console.log("err:", err)
|
||||||
})
|
})
|
||||||
.finally(()=>{
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBatchCancel(){
|
||||||
|
if(this.ids.length === 0){
|
||||||
|
this.msgError('请选择要取消的异常号码')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading=true
|
||||||
|
|
||||||
|
batchCancelSmsAbnormalNumber({ids:this.ids}).then(res=>{
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.msgSuccess(res.msg)
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(res.msg)
|
||||||
|
}
|
||||||
|
}).finally(()=>{
|
||||||
this.loading=false
|
this.loading=false
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handleClean(){
|
||||||
|
this.loading = true
|
||||||
|
|
||||||
|
cleanSmsAbnormalNumber().then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log("err:", err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,21 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicLayout>
|
<BasicLayout>
|
||||||
<template #wrapper>
|
<template #wrapper>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="80px">
|
||||||
<el-form-item label="服务code" prop="serviceCode"><el-input v-model="queryParams.serviceCode" placeholder="请输入服务code" clearable
|
<el-form-item label="服务名称" prop="serviceCode">
|
||||||
size="small" @keyup.enter.native="handleQuery"/>
|
<el-input v-model="queryParams.serviceCode" placeholder="请输入服务code" clearable size="small"
|
||||||
</el-form-item>
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号码">
|
||||||
|
<el-input v-model="queryParams.phone" clearable placeholder="请输入手机号码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否有效" prop="isActived">
|
||||||
|
<el-select v-model="queryParams.isActived" clearable>
|
||||||
|
<el-option label="有效" :value="1"></el-option>
|
||||||
|
<el-option label="无效" :value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -16,118 +24,86 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button v-permisaction="['admin:smsPhone:add']" type="primary" icon="el-icon-plus"
|
||||||
v-permisaction="['admin:smsPhone:add']"
|
size="mini" @click="handleAdd">新增
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button v-permisaction="['admin:smsPhone:edit']" type="success" icon="el-icon-edit"
|
||||||
v-permisaction="['admin:smsPhone:edit']"
|
size="mini" :disabled="single" @click="handleUpdate">修改
|
||||||
type="success"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button v-permisaction="['admin:smsPhone:remove']" type="danger" icon="el-icon-delete"
|
||||||
v-permisaction="['admin:smsPhone:remove']"
|
size="mini" :disabled="multiple" @click="handleDelete">删除
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="smsPhoneList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="smsPhoneList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/><el-table-column label="sms 服务" align="center" prop="service"
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="服务code" align="center" prop="serviceCode"
|
<el-table-column label="平台" width="80" align="center" prop="platformCode"
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="类型 0-短效 1-长效" align="center" prop="type"
|
:show-overflow-tooltip="true" >
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="时长(月)" align="center" prop="period"
|
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="号码" align="center" prop="phone"
|
|
||||||
:show-overflow-tooltip="true"/>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm
|
{{ platformCodeFormat(scope.row) }}
|
||||||
class="delete-popconfirm"
|
|
||||||
title="确认要修改吗?"
|
|
||||||
confirm-button-text="修改"
|
|
||||||
@confirm="handleUpdate(scope.row)"
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
slot="reference"
|
|
||||||
v-permisaction="['admin:smsPhone:edit']"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
|
||||||
</el-popconfirm>
|
|
||||||
<el-popconfirm
|
|
||||||
class="delete-popconfirm"
|
|
||||||
title="确认要删除吗?"
|
|
||||||
confirm-button-text="删除"
|
|
||||||
@confirm="handleDelete(scope.row)"
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
slot="reference"
|
|
||||||
v-permisaction="['admin:smsPhone:remove']"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</el-popconfirm>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="服务" align="center" prop="service" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="类型" align="center" prop="type" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ typeOptionFormat(scope.row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="时长(月)" align="center" prop="period" width="100" />
|
||||||
|
<el-table-column label="号码" align="center" prop="phone" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="过期时间" align="center" prop="expireTime" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.expireTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要修改吗?" confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsPhone:edit']" size="mini"
|
||||||
|
type="text" icon="el-icon-edit">修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsPhone:remove']" size="mini"
|
||||||
|
type="text" icon="el-icon-delete">删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
||||||
v-show="total>0"
|
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageIndex"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
<el-form-item label="用户Id" prop="userId">
|
<el-form-item label="用户Id" prop="userId">
|
||||||
<el-input v-model="form.userId" placeholder="用户Id"
|
<el-input v-model="form.userId" placeholder="用户Id" />
|
||||||
/>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="sms 服务" prop="service">
|
||||||
<el-form-item label="sms 服务" prop="service">
|
<el-input v-model="form.service" placeholder="sms 服务" />
|
||||||
<el-input v-model="form.service" placeholder="sms 服务"
|
</el-form-item>
|
||||||
/>
|
<el-form-item label="服务code" prop="serviceCode">
|
||||||
</el-form-item>
|
<el-input v-model="form.serviceCode" placeholder="服务code" />
|
||||||
<el-form-item label="服务code" prop="serviceCode">
|
</el-form-item>
|
||||||
<el-input v-model="form.serviceCode" placeholder="服务code"
|
<el-form-item label="类型 0-短效 1-长效" prop="type">
|
||||||
/>
|
<el-input v-model="form.type" placeholder="类型 0-短效 1-长效" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类型 0-短效 1-长效" prop="type">
|
<el-form-item label="时长(月)" prop="period">
|
||||||
<el-input v-model="form.type" placeholder="类型 0-短效 1-长效"
|
<el-input v-model="form.period" placeholder="时长(月)" />
|
||||||
/>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="号码" prop="phone">
|
||||||
<el-form-item label="时长(月)" prop="period">
|
<el-input v-model="form.phone" placeholder="号码" />
|
||||||
<el-input v-model="form.period" placeholder="时长(月)"
|
</el-form-item>
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="号码" prop="phone">
|
|
||||||
<el-input v-model="form.phone" placeholder="号码"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@ -140,73 +116,85 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addSmsPhone, delSmsPhone, getSmsPhone, listSmsPhone, updateSmsPhone} from '@/api/admin/sms-phone'
|
import { addSmsPhone, delSmsPhone, getSmsPhone, listSmsPhone, updateSmsPhone } from '@/api/admin/sms-phone'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SmsPhone',
|
name: 'SmsPhone',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: '',
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
// 类型数据字典
|
// 类型数据字典
|
||||||
typeOptions: [],
|
typeOptions: [],
|
||||||
smsPhoneList: [],
|
smsPhoneList: [],
|
||||||
|
platformCodeOptions: [],
|
||||||
|
typeOptions:[{
|
||||||
|
label: "短效",
|
||||||
|
value: 0
|
||||||
|
},{
|
||||||
|
label: "长效",
|
||||||
|
value: 1
|
||||||
|
}],
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
// 关系表类型
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
// 查询参数
|
pageIndex: 1,
|
||||||
queryParams: {
|
pageSize: 10,
|
||||||
pageIndex: 1,
|
service: undefined,
|
||||||
pageSize: 10,
|
serviceCode: undefined,
|
||||||
service:undefined,
|
isActived: undefined,
|
||||||
serviceCode:undefined,
|
idOrder: "desc"
|
||||||
|
},
|
||||||
},
|
// 表单参数
|
||||||
// 表单参数
|
form: {
|
||||||
form: {
|
},
|
||||||
},
|
// 表单校验
|
||||||
// 表单校验
|
rules: {
|
||||||
rules: {serviceCode: [ {required: true, message: '服务code不能为空', trigger: 'blur'} ],
|
serviceCode: [{ required: true, message: '服务code不能为空', trigger: 'blur' }],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.getDicts('sms_platform').then(response => {
|
||||||
|
this.platformCodeOptions = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSmsPhone(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.smsPhoneList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
created() {
|
// 取消按钮
|
||||||
this.getList()
|
cancel() {
|
||||||
},
|
this.open = false
|
||||||
methods: {
|
this.reset()
|
||||||
/** 查询参数列表 */
|
},
|
||||||
getList() {
|
// 表单重置
|
||||||
this.loading = true
|
reset() {
|
||||||
listSmsPhone(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
this.form = {
|
||||||
this.smsPhoneList = response.data.list
|
|
||||||
this.total = response.data.count
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false
|
|
||||||
this.reset()
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
|
|
||||||
id: undefined,
|
id: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
@ -216,101 +204,108 @@
|
|||||||
period: undefined,
|
period: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function() {
|
getImgList: function () {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function() {
|
fileClose: function () {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
// 关系
|
platformCodeFormat(row) {
|
||||||
// 文件
|
return this.selectDictLabel(this.platformCodeOptions, row.platformCode)
|
||||||
/** 搜索按钮操作 */
|
},
|
||||||
handleQuery() {
|
typeOptionFormat(row){
|
||||||
this.queryParams.pageIndex = 1
|
let item=this.typeOptions.find(item=>item.value==row.type)
|
||||||
this.getList()
|
return item?item.label:'未知'
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
// 关系
|
||||||
resetQuery() {
|
// 文件
|
||||||
this.dateRange = []
|
/** 搜索按钮操作 */
|
||||||
this.resetForm('queryForm')
|
handleQuery() {
|
||||||
this.handleQuery()
|
this.queryParams.pageIndex = 1
|
||||||
},
|
this.getList()
|
||||||
/** 新增按钮操作 */
|
},
|
||||||
handleAdd() {
|
/** 重置按钮操作 */
|
||||||
this.reset()
|
resetQuery() {
|
||||||
this.open = true
|
this.dateRange = []
|
||||||
this.title = '添加号码管理-号码列表'
|
this.resetForm('queryForm')
|
||||||
this.isEdit = false
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
/** 新增按钮操作 */
|
||||||
handleSelectionChange(selection) {
|
handleAdd() {
|
||||||
this.ids = selection.map(item => item.id)
|
this.reset()
|
||||||
this.single = selection.length !== 1
|
this.open = true
|
||||||
this.multiple = !selection.length
|
this.title = '添加号码管理-号码列表'
|
||||||
},
|
this.isEdit = false
|
||||||
/** 修改按钮操作 */
|
},
|
||||||
handleUpdate(row) {
|
// 多选框选中数据
|
||||||
this.reset()
|
handleSelectionChange(selection) {
|
||||||
const id =
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id =
|
||||||
row.id || this.ids
|
row.id || this.ids
|
||||||
getSmsPhone(id).then(response => {
|
getSmsPhone(id).then(response => {
|
||||||
this.form = response.data
|
this.form = response.data
|
||||||
this.open = true
|
this.open = true
|
||||||
this.title = '修改号码管理-号码列表'
|
this.title = '修改号码管理-号码列表'
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function () {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
updateSmsPhone(this.form).then(response => {
|
updateSmsPhone(this.form).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
this.open = false
|
this.open = false
|
||||||
this.getList()
|
this.getList()
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addSmsPhone(this.form).then(response => {
|
addSmsPhone(this.form).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
this.open = false
|
this.open = false
|
||||||
this.getList()
|
this.getList()
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
},
|
})
|
||||||
/** 删除按钮操作 */
|
},
|
||||||
handleDelete(row) {
|
/** 删除按钮操作 */
|
||||||
var Ids = (row.id && [row.id]) || this.ids
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
return delSmsPhone( { 'ids': Ids })
|
return delSmsPhone({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
this.open = false
|
this.open = false
|
||||||
this.getList()
|
this.getList()
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function () {
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
414
src/views/admin/sms-renewal-log/index.vue
Normal file
414
src/views/admin/sms-renewal-log/index.vue
Normal file
@ -0,0 +1,414 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<template #wrapper>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="消费类型" prop="category">
|
||||||
|
|
||||||
|
<el-select v-model="queryParams.category" clearable placeholder="请选择消费类型">
|
||||||
|
<el-option label="购买号码" :value="1" />
|
||||||
|
<el-option label="续费号码" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户名" prop="userName"><el-input v-model="queryParams.userName"
|
||||||
|
placeholder="请输入用户名" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button v-permisaction="['admin:smsRenewalLog:add']" type="primary" icon="el-icon-plus"
|
||||||
|
size="mini" @click="handleAdd">新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-permisaction="['admin:smsRenewalLog:edit']" type="success" icon="el-icon-edit"
|
||||||
|
size="mini" :disabled="single" @click="handleUpdate">修改
|
||||||
|
</el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-permisaction="['admin:smsRenewalLog:remove']" type="danger" icon="el-icon-delete"
|
||||||
|
size="mini" :disabled="multiple" @click="handleDelete">删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="smsRenewalLogList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="电话号码" align="center" prop="phone" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="类型" align="center" prop="type" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getTypeTagType(scope.row.type)" size="small">
|
||||||
|
{{ getTypeFormat(scope.row.type) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="消费类型" align="center" prop="category" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getCategoryTagType(scope.row.category)" size="small">
|
||||||
|
{{ getCategoryFormat(scope.row.category) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="用户" align="center" prop="username" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="扣费金额" align="center" prop="amount" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="续费前过期时间" align="center" prop="beforeTime" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.category === 1 ? "-" : parseTime(scope.row.beforeTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column><el-table-column label="时间段" align="center" prop="period"
|
||||||
|
:show-overflow-tooltip="true" />
|
||||||
|
|
||||||
|
<el-table-column label="订单号" align="center" prop="tradeOrderNo" :show-overflow-tooltip="true">
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getStatusTagType(scope.row.status)" size="small">
|
||||||
|
{{ getStatusFormat(scope.row.status) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="支付时间" align="center" prop="payTime" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要修改吗?" confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsRenewalLog:edit']" size="mini"
|
||||||
|
type="text" icon="el-icon-edit">修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)">
|
||||||
|
<el-button slot="reference" v-permisaction="['admin:smsRenewalLog:remove']" size="mini"
|
||||||
|
type="text" icon="el-icon-delete">删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
|
<el-form-item label="号码id" prop="phoneId">
|
||||||
|
<el-input v-model="form.phoneId" placeholder="号码id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话号码" prop="phone">
|
||||||
|
<el-input v-model="form.phone" placeholder="电话号码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型 0-长效 1-短效" prop="type">
|
||||||
|
<el-input v-model="form.type" placeholder="类型 0-长效 1-短效" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="消费类型 1-购买号码 2-续费号码 3-号码补偿" prop="category">
|
||||||
|
<el-input v-model="form.category" placeholder="消费类型 1-购买号码 2-续费号码 3-号码补偿" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户id" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="用户id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="扣费金额" prop="amount">
|
||||||
|
<el-input v-model="form.amount" placeholder="扣费金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="续费前过期时间" prop="beforeTime">
|
||||||
|
<el-date-picker v-model="form.beforeTime" type="datetime" placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间段" prop="period">
|
||||||
|
<el-input v-model="form.period" placeholder="时间段" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addSmsRenewalLog, delSmsRenewalLog, getSmsRenewalLog, listSmsRenewalLog, updateSmsRenewalLog } from '@/api/admin/sms-renewal-log.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SmsRenewalLog',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
isEdit: false,
|
||||||
|
// 类型数据字典
|
||||||
|
typeOptions: [{
|
||||||
|
label: '长效',
|
||||||
|
value: '0'
|
||||||
|
}, {
|
||||||
|
label: '短效',
|
||||||
|
value: '1'
|
||||||
|
}],
|
||||||
|
smsRenewalLogList: [],
|
||||||
|
categoryOptions: [{
|
||||||
|
label: '购买号码',
|
||||||
|
value: '1'
|
||||||
|
}, {
|
||||||
|
label: '续费号码',
|
||||||
|
value: '2'
|
||||||
|
}],
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
category: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
createdAtOrder: "desc"
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
category: [{ required: true, message: '消费类型 1-购买号码 2-续费号码 3-号码补偿不能为空', trigger: 'blur' }],
|
||||||
|
userId: [{ required: true, message: '用户id不能为空', trigger: 'blur' }],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取类型格式化文本
|
||||||
|
* @param {string|number} type - 类型值 (0-长效, 1-短效)
|
||||||
|
* @returns {string} 格式化后的类型文本
|
||||||
|
*/
|
||||||
|
getTypeFormat(type) {
|
||||||
|
const typeMap = {
|
||||||
|
'0': '长效',
|
||||||
|
'1': '短效'
|
||||||
|
}
|
||||||
|
return typeMap[type] || '未知'
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取类型标签颜色类型
|
||||||
|
* @param {string|number} type - 类型值 (0-长效, 1-短效)
|
||||||
|
* @returns {string} Element UI标签类型
|
||||||
|
*/
|
||||||
|
getTypeTagType(type) {
|
||||||
|
const tagTypeMap = {
|
||||||
|
'0': 'success', // 长效 - 绿色
|
||||||
|
'1': 'warning' // 短效 - 橙色
|
||||||
|
}
|
||||||
|
return tagTypeMap[type] || 'info'
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取消费类型格式化文本
|
||||||
|
* @param {string|number} category - 消费类型值 (1-购买号码, 2-续费号码, 3-号码补偿)
|
||||||
|
* @returns {string} 格式化后的消费类型文本
|
||||||
|
*/
|
||||||
|
getCategoryFormat(category) {
|
||||||
|
const categoryMap = {
|
||||||
|
'1': '购买号码',
|
||||||
|
'2': '续费号码',
|
||||||
|
'3': '号码补偿'
|
||||||
|
}
|
||||||
|
return categoryMap[category] || '未知'
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取消费类型标签颜色类型
|
||||||
|
* @param {string|number} category - 消费类型值 (1-购买号码, 2-续费号码, 3-号码补偿)
|
||||||
|
* @returns {string} Element UI标签类型
|
||||||
|
*/
|
||||||
|
getCategoryTagType(category) {
|
||||||
|
const tagTypeMap = {
|
||||||
|
'1': 'primary', // 购买号码 - 蓝色
|
||||||
|
'2': 'success', // 续费号码 - 绿色
|
||||||
|
'3': 'warning' // 号码补偿 - 橙色
|
||||||
|
}
|
||||||
|
return tagTypeMap[category] || 'info'
|
||||||
|
},
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSmsRenewalLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.smsRenewalLogList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
|
||||||
|
id: undefined,
|
||||||
|
phoneId: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
type: undefined,
|
||||||
|
category: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
beforeTime: undefined,
|
||||||
|
period: undefined,
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
getImgList: function () {
|
||||||
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
|
},
|
||||||
|
fileClose: function () {
|
||||||
|
this.fileOpen = false
|
||||||
|
},
|
||||||
|
// 关系
|
||||||
|
// 文件
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageIndex = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加消费记录'
|
||||||
|
this.isEdit = false
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
getSmsRenewalLog(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改消费记录'
|
||||||
|
this.isEdit = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function () {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
updateSmsRenewalLog(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addSmsRenewalLog(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(function () {
|
||||||
|
return delSmsRenewalLog({ 'ids': Ids })
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
}).catch(function () {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态格式化文本
|
||||||
|
* @param {string|number} status - 状态值 (1-预扣款, 2-成功, 3-失败)
|
||||||
|
* @returns {string} 格式化后的状态文本
|
||||||
|
*/
|
||||||
|
getStatusFormat(status) {
|
||||||
|
const map = {
|
||||||
|
'1': '预扣款',
|
||||||
|
'2': '成功',
|
||||||
|
'3': '失败'
|
||||||
|
}
|
||||||
|
return map[String(status)] || '未知'
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态标签颜色类型
|
||||||
|
* @param {string|number} status - 状态值 (1-预扣款, 2-成功, 3-失败)
|
||||||
|
* @returns {string} Element UI标签类型
|
||||||
|
*/
|
||||||
|
getStatusTagType(status) {
|
||||||
|
const map = {
|
||||||
|
'1': 'warning',
|
||||||
|
'2': 'success',
|
||||||
|
'3': 'danger'
|
||||||
|
}
|
||||||
|
return map[String(status)] || 'info'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user