mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-10 00:48:12 +08:00
update 添加鉴权卡
This commit is contained in:
@@ -106,9 +106,6 @@ public class MemberBasicInfoController extends BaseController {
|
|||||||
@GetMapping("/getMerchantListByAuth")
|
@GetMapping("/getMerchantListByAuth")
|
||||||
public RestApiResponse<?> getMerchantListByAuth() {
|
public RestApiResponse<?> getMerchantListByAuth() {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
// List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth(deptIds);
|
|
||||||
// List<MerchantInfoVO> list = memberBasicInfoService.getMerchantListByAuth();
|
|
||||||
// List<MerchantInfoVO> list = UserUtils.getMerchantListByAuth();
|
|
||||||
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
||||||
List<MerchantInfoVO> list = loginUserDetail.getMerchantInfoVOList();
|
List<MerchantInfoVO> list = loginUserDetail.getMerchantInfoVOList();
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
#url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: jsowell_dev
|
#username: jsowell_dev
|
||||||
# url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: jsowell_prd_copy
|
username: jsowell_prd_copy
|
||||||
password: 123456
|
password: 123456
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
|
|||||||
@@ -1,382 +1,378 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||||
<el-form-item label="逻辑卡号" prop="logicCard">
|
label-width="68px">
|
||||||
<el-input
|
<el-form-item label="逻辑卡号" prop="logicCard">
|
||||||
v-model="queryParams.logicCard"
|
<el-input
|
||||||
placeholder="请输入逻辑卡号"
|
v-model="queryParams.logicCard"
|
||||||
clearable
|
placeholder="请输入逻辑卡号"
|
||||||
@keyup.enter.native="handleQuery"
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- v-model="queryParams.physicsCard"-->
|
||||||
|
<!-- placeholder="请输入物理卡号"-->
|
||||||
|
<!-- clearable-->
|
||||||
|
<!-- @keyup.enter.native="handleQuery"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="手机号码" prop="phoneNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.phoneNumber"
|
||||||
|
placeholder="请输入手机号码"
|
||||||
|
clearable
|
||||||
|
@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
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['pile:card:add']"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['pile:card:edit']"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['pile:card:remove']"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="warning"-->
|
||||||
|
<!-- plain-->
|
||||||
|
<!-- icon="el-icon-download"-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- @click="handleExport"-->
|
||||||
|
<!-- v-hasPermi="['pile:card:export']"-->
|
||||||
|
<!-- >导出</el-button>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="cardList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
||||||
|
<el-table-column label="逻辑卡号" align="center" prop="logicCard"/>
|
||||||
|
<el-table-column label="卡状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.card_status"
|
||||||
|
:value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="密钥" align="center" prop="secretKey"/>
|
||||||
|
<!-- <el-table-column label="物理卡号" align="center" prop="physicsCard" />-->
|
||||||
|
<el-table-column label="所属用户" align="center" prop="nickName">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<router-link
|
||||||
|
:to="'/member/detail/index/'+scope.row.memberId"
|
||||||
|
class="link-type"
|
||||||
|
>
|
||||||
|
<span>{{ scope.row.nickName }}</span>
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号码" align="center" prop="phoneNumber"/>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['pile:card:edit']"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-circle-close"
|
||||||
|
@click="handleDeactivateCard(scope.row)"
|
||||||
|
v-hasPermi="['pile:card:remove']"
|
||||||
|
>停用
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.physicsCard"-->
|
|
||||||
<!-- placeholder="请输入物理卡号"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="手机号码" prop="phoneNumber">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.phoneNumber"
|
|
||||||
placeholder="请输入手机号码"
|
|
||||||
clearable
|
|
||||||
@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-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-button
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
type="primary"
|
<el-form-item label="选择运营商" prop="merchantId">
|
||||||
plain
|
<el-select
|
||||||
icon="el-icon-plus"
|
v-model="form.merchantId"
|
||||||
size="mini"
|
clearable placeholder="请选择运营商"
|
||||||
@click="handleAdd"
|
>
|
||||||
v-hasPermi="['pile:card:add']"
|
<el-option
|
||||||
>新增</el-button>
|
v-for="item in merchantList"
|
||||||
</el-col>
|
:key="item.merchantId"
|
||||||
<el-col :span="1.5">
|
:label="item.merchantName"
|
||||||
<el-button
|
:value="item.merchantId">
|
||||||
type="success"
|
</el-option>
|
||||||
plain
|
</el-select>
|
||||||
icon="el-icon-edit"
|
</el-form-item>
|
||||||
size="mini"
|
<el-form-item label="逻辑卡号" prop="logicCard">
|
||||||
:disabled="single"
|
<el-input v-model="form.logicCard" :disabled="isDisabled" placeholder="请输入逻辑卡号"/>
|
||||||
@click="handleUpdate"
|
</el-form-item>
|
||||||
v-hasPermi="['pile:card:edit']"
|
<el-form-item label="手机号码" prop="phoneNumber">
|
||||||
>修改</el-button>
|
<el-input v-model="form.phoneNumber" placeholder="请输入会员的手机号码"/>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="1.5">
|
</el-form>
|
||||||
<el-button
|
<div slot="footer" class="dialog-footer">
|
||||||
type="danger"
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
plain
|
<el-button @click="cancel">取 消</el-button>
|
||||||
icon="el-icon-delete"
|
</div>
|
||||||
size="mini"
|
</el-dialog>
|
||||||
:disabled="multiple"
|
</div>
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['pile:card:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="1.5">-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="warning"-->
|
|
||||||
<!-- plain-->
|
|
||||||
<!-- icon="el-icon-download"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="handleExport"-->
|
|
||||||
<!-- v-hasPermi="['pile:card:export']"-->
|
|
||||||
<!-- >导出</el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="cardList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
|
||||||
<el-table-column label="逻辑卡号" align="center" prop="logicCard" />
|
|
||||||
<el-table-column label="卡状态" align="center" prop="status" >
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.card_status"
|
|
||||||
:value="scope.row.status"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="密钥" align="center" prop="secretKey" />
|
|
||||||
<!-- <el-table-column label="物理卡号" align="center" prop="physicsCard" />-->
|
|
||||||
<el-table-column label="所属用户" align="center" prop="nickName" >
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<router-link
|
|
||||||
:to="'/member/detail/index/'+scope.row.memberId"
|
|
||||||
class="link-type"
|
|
||||||
>
|
|
||||||
<span>{{ scope.row.nickName }}</span>
|
|
||||||
</router-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="手机号码" align="center" prop="phoneNumber" />
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['pile:card:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-circle-close"
|
|
||||||
@click="handleDeactivateCard(scope.row)"
|
|
||||||
v-hasPermi="['pile:card:remove']"
|
|
||||||
>停用</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改充电站鉴权卡对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
||||||
<el-form-item label="一级运营商" prop="merchantId">
|
|
||||||
<el-select
|
|
||||||
v-model="form.merchantId"
|
|
||||||
clearable placeholder="请选择一级运营商"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in firstLevelMerchantList"
|
|
||||||
:key="item.merchantName"
|
|
||||||
:label="item.merchantName"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="逻辑卡号" prop="logicCard">
|
|
||||||
<el-input v-model="form.logicCard" :disabled = "isDisabled" placeholder="请输入逻辑卡号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="手机号码" prop="phoneNumber">
|
|
||||||
<el-input v-model="form.phoneNumber" placeholder="请输入会员的手机号码" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="选择状态" prop="status">-->
|
|
||||||
<!-- <el-select-->
|
|
||||||
<!-- placeholder="请选择状态"-->
|
|
||||||
<!-- v-model="form.status"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <el-option-->
|
|
||||||
<!-- v-for="item in dict.type.card_status"-->
|
|
||||||
<!-- :key="item.value"-->
|
|
||||||
<!-- :label="item.label"-->
|
|
||||||
<!-- :value="item.value"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- </el-option>-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
|
||||||
<!-- <el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="会员id" prop="memberId">-->
|
|
||||||
<!-- <el-input v-model="form.memberId" placeholder="请输入所属用户" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="删除标识" prop="delFlag">-->
|
|
||||||
<!-- <el-input v-model="form.delFlag" 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>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listCard, getCard, delCard, addCard, updateCard, deactivateCard} from "@/api/pile/card";
|
import {listCard, getCard, delCard, addCard, updateCard, deactivateCard} from "@/api/pile/card";
|
||||||
import {queryFirstLevelMerchant} from "@/api/pile/merchant";
|
import {queryFirstLevelMerchant} from "@/api/pile/merchant";
|
||||||
|
import {getMerchantList} from "@/api/member/info";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "card",
|
name: "card",
|
||||||
dicts: ['card_status'],
|
dicts: ['card_status'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 充电站鉴权卡表格数据
|
// 充电站鉴权卡表格数据
|
||||||
cardList: [],
|
cardList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 卡号是否可填写
|
// 卡号是否可填写
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
firstLevelMerchantList: [],
|
firstLevelMerchantList: [],
|
||||||
// 查询参数
|
merchantList: [],
|
||||||
queryParams: {
|
// 查询参数
|
||||||
pageNum: 1,
|
queryParams: {
|
||||||
pageSize: 10,
|
pageNum: 1,
|
||||||
logicCard: null,
|
pageSize: 10,
|
||||||
merchantId: null,
|
logicCard: null,
|
||||||
physicsCard: null,
|
merchantId: null,
|
||||||
memberId: null,
|
physicsCard: null,
|
||||||
phoneNumber: null
|
memberId: null,
|
||||||
},
|
phoneNumber: null
|
||||||
// 表单参数
|
},
|
||||||
form: {},
|
// 表单参数
|
||||||
// 表单校验
|
form: {},
|
||||||
rules: {
|
// 表单校验
|
||||||
merchantId:[
|
rules: {
|
||||||
{
|
merchantId: [
|
||||||
required: true,
|
{
|
||||||
message: "请选择一级运营商",
|
required: true,
|
||||||
trigger: "blur"
|
message: "请选择一级运营商",
|
||||||
}
|
trigger: "blur"
|
||||||
],
|
}
|
||||||
phoneNumber: [
|
],
|
||||||
{
|
phoneNumber: [
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
{
|
||||||
message: "请输入正确的手机号码",
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
trigger: "blur"
|
message: "请输入正确的手机号码",
|
||||||
}
|
trigger: "blur"
|
||||||
],
|
}
|
||||||
logicCard:[
|
],
|
||||||
{
|
logicCard: [
|
||||||
required: true,
|
{
|
||||||
max: 16,
|
required: true,
|
||||||
message: "长度最长为16字符!",
|
max: 16,
|
||||||
trigger: 'blur'
|
message: "长度最长为16字符!",
|
||||||
}
|
trigger: 'blur'
|
||||||
],
|
}
|
||||||
}
|
],
|
||||||
};
|
}
|
||||||
},
|
};
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.getFirstLevelMerchantList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询充电站鉴权卡列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listCard(this.queryParams).then(response => {
|
|
||||||
this.cardList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 获取一级运营商列表
|
created() {
|
||||||
getFirstLevelMerchantList() {
|
|
||||||
queryFirstLevelMerchant().then(response =>{
|
|
||||||
console.log("getFirstLevelMerchantList", response)
|
|
||||||
this.firstLevelMerchantList = response.rows;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
logicCard: null,
|
|
||||||
physicsCard: null,
|
|
||||||
memberId: null,
|
|
||||||
merchantId: null,
|
|
||||||
phoneNumber: null,
|
|
||||||
createTime: null,
|
|
||||||
createBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
delFlag: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加充电站鉴权卡";
|
|
||||||
this.isDisabled = false;
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getCard(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.isDisabled = true;
|
|
||||||
this.title = "修改充电站鉴权卡";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
console.log("submitForm", this.form);
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateCard(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addCard(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除充电站鉴权卡编号为"' + ids + '"的数据项?').then(function() {
|
|
||||||
return delCard(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
// this.getFirstLevelMerchantList();
|
||||||
}).catch(() => {});
|
this.getMerchantList();
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询充电站鉴权卡列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listCard(this.queryParams).then(response => {
|
||||||
|
this.cardList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取一级运营商列表
|
||||||
|
getFirstLevelMerchantList() {
|
||||||
|
queryFirstLevelMerchant().then(response => {
|
||||||
|
console.log("getFirstLevelMerchantList", response)
|
||||||
|
this.firstLevelMerchantList = response.rows;
|
||||||
|
|
||||||
// 停用按钮
|
});
|
||||||
handleDeactivateCard(row) {
|
},
|
||||||
const id = row.id;
|
// 获取运营商列表
|
||||||
this.$modal.confirm('是否确认停用卡号为"' + row.logicCard + '"的鉴权卡?').then(function() {
|
getMerchantList() {
|
||||||
return deactivateCard(id);
|
getMerchantList().then((response) => {
|
||||||
}).then(() => {
|
console.log("getMerchantList response", response)
|
||||||
this.getList();
|
this.merchantList = response.obj;
|
||||||
this.$modal.msgSuccess("停用成功");
|
this.form.merchantId = this.merchantList[0].merchantId
|
||||||
}).catch(() => {});
|
})
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
// 取消按钮
|
||||||
handleExport() {
|
cancel() {
|
||||||
this.download('pile/card/export', {
|
this.open = false;
|
||||||
...this.queryParams
|
this.reset();
|
||||||
}, `card_${new Date().getTime()}.xlsx`)
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
logicCard: null,
|
||||||
|
physicsCard: null,
|
||||||
|
memberId: null,
|
||||||
|
phoneNumber: null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
if (this.merchantList.length > 0) {
|
||||||
|
this.form.merchantId = this.merchantList[0].merchantId
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
// this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加充电站鉴权卡11";
|
||||||
|
this.isDisabled = false;
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getCard(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.isDisabled = true;
|
||||||
|
this.title = "修改充电站鉴权卡";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
console.log("submitForm", this.form);
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateCard(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCard(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除充电站鉴权卡编号为"' + ids + '"的数据项?').then(function () {
|
||||||
|
return delCard(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 停用按钮
|
||||||
|
handleDeactivateCard(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal.confirm('是否确认停用卡号为"' + row.logicCard + '"的鉴权卡?').then(function () {
|
||||||
|
return deactivateCard(id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("停用成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('pile/card/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `card_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user