You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
764 lines
27 KiB
764 lines
27 KiB
<template>
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item :label="$t('userManager.userRegister.account')" prop="account">
|
|
<el-input
|
|
v-model="queryParams.account"
|
|
:placeholder="$t('userManager.userRegister.accountPlaceholder')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('userManager.userRegister.phone')" prop="phone">
|
|
<el-input
|
|
v-model="queryParams.phone"
|
|
:placeholder="$t('userManager.userRegister.phonePlaceholder')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('userManager.userRegister.userLevel')" prop="userLevel">
|
|
<el-select v-model="queryParams.userLevel" size="medium" :placeholder="$t('userManager.userRegister.userLevelPlaceholder')">
|
|
<el-option
|
|
v-for="item in options_userLevel"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{
|
|
$t('common.button.search')
|
|
}}
|
|
</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.button.reset') }}</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="['business:userRegister:add']"
|
|
>{{ $t('common.button.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="['business:userRegister:edit']"
|
|
>{{ $t('common.button.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="['business:userRegister:remove']"
|
|
>{{ $t('common.button.delete') }}
|
|
</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['business:userRegister:export']"
|
|
>{{ $t('common.button.export') }}
|
|
</el-button>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table v-loading="loading" :data="userRegisterList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
<el-table-column :label="$t('userManager.userRegister.account')" align="center" prop="account"/>
|
|
<el-table-column :label="$t('userManager.userRegister.status')" align="center" prop="status">
|
|
<template slot-scope="scope">
|
|
<el-tag type="primary" v-if="scope.row.status == '0'">{{ $t('userManager.userRegister.statusInit') }}</el-tag>
|
|
<el-tag type="warning" v-if="scope.row.status == '1'">{{ $t('userManager.userRegister.statusReject') }}</el-tag>
|
|
<el-tag type="success" v-if="scope.row.status == '2'">{{ $t('userManager.userRegister.statusPass') }}</el-tag>
|
|
<el-tag type="danger" v-if="scope.row.status == '3'">{{ $t('userManager.userRegister.statusFreeze') }}</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('userManager.userRegister.userType')" align="center" prop="userType">
|
|
<template slot-scope="scope">
|
|
<el-tag type="success" v-if="scope.row.userType == '0'">{{ $t('userManager.userRegister.normalUser') }}</el-tag>
|
|
<el-tag type="warning" v-if="scope.row.userType == '1'">{{ $t('userManager.userRegister.businessUser') }}</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('userManager.userRegister.userLevel')" align="center" prop="userLevel">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.userLevel == '0'">{{ $t('userManager.userRegister.normalUser') }}</span>
|
|
<span v-if="scope.row.userLevel == '1'">{{ $t('userManager.userRegister.vipUser') }}</span>
|
|
<span v-if="scope.row.userLevel == '2'">{{ $t('userManager.userRegister.businessUser') }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('userManager.userRegister.phone')" align="center" prop="phone"/>
|
|
<el-table-column :label="$t('userManager.userRegister.address')" align="center">
|
|
<template #default="scope">
|
|
<span v-if="scope.row.userType == '0'">{{ scope.row.addressInfo }}</span>
|
|
<span v-if="scope.row.userType == '1'">{{ scope.row.address }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('common.button.operation')" align="center" width="200" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<el-button v-if="(scope.row.addressInfo == '')"
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-document-add"
|
|
@click="handleAddInfo(scope.row)"
|
|
>{{ $t('business.userManage.supplement') }}
|
|
</el-button>
|
|
<el-button v-if="(scope.row.addressInfo != '')"
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-view"
|
|
@click="handleDetail(scope.row)"
|
|
>{{ $t('common.button.detail') }}
|
|
</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['business:userRegister:edit']"
|
|
>{{ $t('common.button.edit') }}
|
|
</el-button>
|
|
<el-dropdown>
|
|
<span class="el-dropdown-link">
|
|
{{ $t('common.button.more') }}
|
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
</span>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-item>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-refresh"
|
|
@click="passwordReset(scope.row)"
|
|
v-hasPermi="['business:userRegister:edit']">
|
|
{{ $t('business.userManage.passwordReset') }}
|
|
</el-button>
|
|
</el-dropdown-item>
|
|
<el-dropdown-item>
|
|
<el-button v-if="(scope.row.status != '3')"
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-lock"
|
|
@click="accountLock(scope.row)"
|
|
v-hasPermi="['business:userRegister:edit']">
|
|
{{ $t('business.userManage.accountFreezing') }}
|
|
</el-button>
|
|
<el-button v-if="(scope.row.status == '3')"
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-unlock"
|
|
@click="accountUnlock(scope.row)"
|
|
v-hasPermi="['business:userRegister:edit']">
|
|
{{ $t('business.userManage.accountUnfreezing') }}
|
|
</el-button>
|
|
</el-dropdown-item>
|
|
<el-dropdown-item>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['business:userRegister:remove']"
|
|
>删除
|
|
</el-button>
|
|
</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</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="700px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
|
|
<el-form-item :label="$t('userManager.userRegister.account')" prop="account">
|
|
<el-input v-model="form.account" :placeholder="$t('userManager.userRegister.namePlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('userManager.userRegister.phone')" prop="phone">
|
|
<el-input v-model="form.phone" :placeholder="$t('userManager.userRegister.phonePlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('userManager.userRegister.userType')" prop="userType">
|
|
<el-select v-model="form.userType" :placeholder="$t('userManager.userRegister.userTypePlaceholder')">
|
|
<el-option
|
|
v-for="item in options_userType"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('userManager.userRegister.userLevel')" prop="userLevel">
|
|
<el-select v-model="form.userLevel" size="medium" :placeholder="$t('userManager.userRegister.userLevelPlaceholder')">
|
|
<el-option
|
|
v-for="item in options_userLevel"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">{{
|
|
$t('common.button.confirm')
|
|
}}
|
|
</el-button>
|
|
<el-button @click="cancel">{{ $t('common.button.cancel') }}</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!--添加用户注册信息弹窗-->
|
|
<el-dialog :title="title" :visible.sync="openInfo" width="700px" append-to-body>
|
|
<el-form ref="formInfo" :model="formInfo" :rules="rules" label-width="auto">
|
|
<el-form-item :label="$t('business.userInfo.name')" prop="name">
|
|
<el-input v-model="formInfo.name" :placeholder="$t('business.userInfo.namePlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('business.userInfo.gender')" prop="gender">
|
|
<el-radio-group v-model="formInfo.gender">
|
|
<el-radio :label="1">{{ $t('business.userInfo.male') }}</el-radio>
|
|
<el-radio :label="0">{{ $t('business.userInfo.female') }}</el-radio>
|
|
</el-radio-group>
|
|
<!-- <el-input v-model="form.gender" :placeholder="$t('business.userInfo.genderPlaceholder')" />-->
|
|
</el-form-item>
|
|
<el-form-item :label="$t('business.userInfo.idCard')" prop="idCard">
|
|
<el-input v-model="formInfo.idCard" :placeholder="$t('business.userInfo.idCardPlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('business.userInfo.phone')" prop="phone">
|
|
<el-input v-model="formInfo.phone" :placeholder="$t('business.userInfo.phonePlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('business.userInfo.age')" prop="age">
|
|
<el-input v-model="formInfo.age" :placeholder="$t('business.userInfo.agePlaceholder')"/>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('business.userInfo.addr')" prop="addr">
|
|
<el-input v-model="formInfo.addr" :placeholder="$t('business.userInfo.addrPlaceholder')"/>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitFormInfo">{{
|
|
$t('common.confirm')
|
|
}}
|
|
</el-button>
|
|
<el-button @click="cancel">{{ $t('common.cancel') }}</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!-- 添加或修改用户信息-商户扩展对话框 -->
|
|
<el-dialog :title="title" :visible.sync="openInfoBus" width="700px" append-to-body>
|
|
<el-form ref="formInfoBus" :model="formInfoBus" :rules="rules" label-width="auto">
|
|
<el-form-item label="营业执照" prop="license">
|
|
<el-input v-model="formInfoBus.license" placeholder="请输入营业执照"/>
|
|
</el-form-item>
|
|
<el-form-item label="其它证照信息" prop="licenseOther">
|
|
<el-input v-model="formInfoBus.licenseOther" placeholder="请输入其它证照信息"/>
|
|
</el-form-item>
|
|
<el-form-item label="法人姓名" prop="legalPerson">
|
|
<el-input v-model="formInfoBus.legalPerson" placeholder="请输入法人姓名"/>
|
|
</el-form-item>
|
|
<el-form-item label="营业状态" prop="operateStatus">
|
|
<el-select v-model="formInfoBus.operateStatus" placeholder="请选择营业状态">
|
|
<el-option
|
|
v-for="item in options_operateStatus"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="经营地址" prop="operateAddr">
|
|
<el-input v-model="formInfoBus.operateAddr" placeholder="请输入经营地址"/>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitFormInfoBus">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!-- 用户注册详情-个人 -->
|
|
<el-dialog :title="title" :visible.sync="detailOpen" width="700px" append-to-body>
|
|
<el-form ref="formDetail" :model="formDetail" label-width="auto">
|
|
<el-form-item label="登录账号:">
|
|
{{ formDetail.account }}
|
|
</el-form-item>
|
|
<el-form-item label="用户姓名:">
|
|
{{ formDetail.userInfoVo.name }}
|
|
</el-form-item>
|
|
<el-form-item label="用户性别:">
|
|
<span v-if="formDetail.userInfoVo.gender == '1'">男</span>
|
|
<span v-if="formDetail.userInfoVo.gender == '0'">女</span>
|
|
</el-form-item>
|
|
<el-form-item label="用户年龄:">
|
|
{{ formDetail.userInfoVo.age }}
|
|
</el-form-item>
|
|
<el-form-item label="身份证号:">
|
|
{{ formDetail.userInfoVo.idCard }}
|
|
</el-form-item>
|
|
<el-form-item label="用户地址:">
|
|
{{ formDetail.userInfoVo.addr }}
|
|
</el-form-item>
|
|
<el-form-item label="联系电话:">
|
|
{{ formDetail.userInfoVo.phone }}
|
|
</el-form-item>
|
|
<el-form-item label="用户类型:">
|
|
<template slot-scope="scope">
|
|
<span v-if="formDetail.userType == '0'">普通用户</span>
|
|
<span v-if="formDetail.userType == '1'">商企用户</span>
|
|
</template>
|
|
</el-form-item>
|
|
<el-form-item label="用户级别:">
|
|
<template slot-scope="scope">
|
|
<span v-if="formDetail.userLevel == '0'">普通用户</span>
|
|
<span v-if="formDetail.userLevel == '1'">VIP用户</span>
|
|
<span v-if="formDetail.userLevel == '2'">商企用户</span>
|
|
</template>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="cancel">关 闭</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!-- 用户注册详情-商企-->
|
|
<el-dialog :title="title" :visible.sync="detailOpenBus" width="700px" append-to-body>
|
|
<el-form ref="formDetail" :model="formDetailBus" label-width="auto">
|
|
<el-form-item label="登录账号:">
|
|
{{ formDetailBus.account }}
|
|
</el-form-item>
|
|
<el-form-item label="营业执照:">
|
|
{{ formDetailBus.userInfoBusVo.license }}
|
|
</el-form-item>
|
|
<el-form-item label="其它证照:">
|
|
{{ formDetailBus.userInfoBusVo.licenseOther }}
|
|
</el-form-item>
|
|
<el-form-item label="法人姓名:">
|
|
{{ formDetailBus.userInfoBusVo.legalPerson }}
|
|
</el-form-item>
|
|
<el-form-item label="营业状态:">
|
|
{{ formDetailBus.userInfoBusVo.operateStatus }}
|
|
</el-form-item>
|
|
<el-form-item label="经营地址:">
|
|
{{ formDetailBus.userInfoBusVo.operateAddr }}
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="cancel">关 闭</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
listUserRegister,
|
|
getUserRegister,
|
|
delUserRegister,
|
|
addUserRegister,
|
|
updateUserRegister,
|
|
addUserInfo,
|
|
addUserInfoBus,
|
|
resetUserPassword,
|
|
accountLock
|
|
} from "@/api/business/userRegister";
|
|
|
|
export default {
|
|
name: "UserRegister",
|
|
data() {
|
|
return {
|
|
// 按钮loading
|
|
buttonLoading: false,
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
// 用户注册表格数据
|
|
userRegisterList: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
// 是否显示详情弹出层-个人
|
|
detailOpen: false,
|
|
// 是否显示详情弹出层-商企
|
|
detailOpenBus: false,
|
|
// 是否展示用户信息弹窗层-个人
|
|
openInfo: false,
|
|
// 是否展示用户信息弹窗层-商企
|
|
openInfoBus: false,
|
|
options_operateStatus: [{
|
|
value: '存续',
|
|
label: '存续'
|
|
}, {
|
|
value: '注销',
|
|
label: '注销'
|
|
}],
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
userId: undefined,
|
|
account: undefined,
|
|
phone: undefined,
|
|
passwd: undefined,
|
|
status: undefined,
|
|
userType: undefined,
|
|
userLevel: undefined,
|
|
},
|
|
// 表单参数
|
|
form: {
|
|
userInfoVo: {},
|
|
userInfoBusVo: {}
|
|
},
|
|
// 用户详情表单参数
|
|
formDetail: {
|
|
userInfoVo: {}
|
|
},
|
|
// 用户详情表单参数-商企
|
|
formDetailBus: {
|
|
userInfoBusVo: {}
|
|
},
|
|
// 用户信息表单参数-个人
|
|
formInfo: {},
|
|
// 用户信息表单参数-商企
|
|
formInfoBus: {},
|
|
// 表单校验
|
|
rules: {
|
|
account: [
|
|
{required: true, message: this.$t('userManager.userRegister.accountRequired'), trigger: "blur"}
|
|
],
|
|
userType: [
|
|
{required: true, message: this.$t('userManager.userRegister.userTypeRequired'), trigger: "change"}
|
|
],
|
|
userLevel: [
|
|
{required: true, message: this.$t('userManager.userRegister.userLevelRequired'), trigger: "change"}
|
|
],
|
|
legalPerson: [
|
|
{required: true, message: this.$t('userManager.userRegister.legalPersonRequired'), trigger: "blur"}
|
|
],
|
|
operateStatus: [
|
|
{required: true, message: this.$t('userManager.userRegister.operateStatusRequired'), trigger: "change"}
|
|
],
|
|
operateAddr: [
|
|
{required: true, message: this.$t('userManager.userRegister.operateAddrRequired'), trigger: "blur"}
|
|
],
|
|
name: [
|
|
{required: true, message: this.$t('userManager.userRegister.nameRequired'), trigger: "blur"}
|
|
],
|
|
gender: [
|
|
{required: true, message: this.$t('userManager.userRegister.genderRequired'), trigger: "blur"}
|
|
],
|
|
idCard: [
|
|
{required: true, message: this.$t('userManager.userRegister.idCardRequired'), trigger: "blur"}
|
|
],
|
|
phone: [
|
|
{required: true, message: this.$t('userManager.userRegister.phoneRequired'), trigger: "blur"}
|
|
],
|
|
age: [
|
|
{required: true, message: this.$t('userManager.userRegister.ageRequired'), trigger: "blur"}
|
|
],
|
|
addr: [
|
|
{required: true, message: this.$t('userManager.userRegister.addrRequired'), trigger: "blur"}
|
|
],
|
|
},
|
|
options_userType: [{
|
|
value: '0',
|
|
label: this.$t('userManager.userRegister.userTypeOptions.normal')
|
|
}, {
|
|
value: '1',
|
|
label: this.$t('userManager.userRegister.userTypeOptions.business')
|
|
}],
|
|
options_userLevel: [{
|
|
value: '0',
|
|
label: this.$t('userManager.userRegister.userLevelOptions.normal')
|
|
}, {
|
|
value: '1',
|
|
label: this.$t('userManager.userRegister.userLevelOptions.vip')
|
|
}, {
|
|
value: '2',
|
|
label: this.$t('userManager.userRegister.userLevelOptions.business')
|
|
}]
|
|
};
|
|
},
|
|
created() {
|
|
this.getList();
|
|
},
|
|
methods: {
|
|
/** 查询用户注册列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
listUserRegister(this.queryParams).then(response => {
|
|
this.userRegisterList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.open = false;
|
|
this.detailOpen = false;
|
|
this.detailOpenBus = false;
|
|
this.openInfo = false;
|
|
this.openInfoBus = false;
|
|
this.reset();
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: undefined,
|
|
userId: undefined,
|
|
account: undefined,
|
|
phone: undefined,
|
|
passwd: undefined,
|
|
status: undefined,
|
|
delFlag: undefined,
|
|
userType: undefined,
|
|
createBy: undefined,
|
|
createTime: undefined,
|
|
updateBy: undefined,
|
|
updateTime: undefined
|
|
};
|
|
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.$t('userManager.userRegister.addTitle');
|
|
},
|
|
/** 详情按钮操作 */
|
|
handleDetail(row) {
|
|
this.loading = true;
|
|
this.reset();
|
|
const id = row.id || this.ids
|
|
getUserRegister(id).then(response => {
|
|
this.loading = false;
|
|
if (row.userType == "0") {
|
|
this.formDetail = response.data;
|
|
this.detailOpen = true;
|
|
}
|
|
if (row.userType == "1") {
|
|
this.formDetailBus = response.data;
|
|
this.detailOpenBus = true;
|
|
}
|
|
this.title = this.$t('userManager.userRegister.detailTitle');
|
|
});
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
this.loading = true;
|
|
this.reset();
|
|
const id = row.id || this.ids
|
|
getUserRegister(id).then(response => {
|
|
this.loading = false;
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.title = this.$t('userManager.userRegister.editRegisterTitle');
|
|
});
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
this.buttonLoading = true;
|
|
if (this.form.id != null) {
|
|
updateUserRegister(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.getList();
|
|
}).finally(() => {
|
|
this.buttonLoading = false;
|
|
});
|
|
} else {
|
|
addUserRegister(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.getList();
|
|
}).finally(() => {
|
|
this.buttonLoading = false;
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
/** 用户信息-提交按钮-个人 */
|
|
submitFormInfo() {
|
|
this.$refs["formInfo"].validate(valid => {
|
|
if (valid) {
|
|
addUserInfo(this.formInfo).then(response => {
|
|
this.$modal.msgSuccess(this.$t('common.addSuccess'));
|
|
this.openInfo = false;
|
|
this.getList();
|
|
}).finally(() => {
|
|
this.buttonLoading = false;
|
|
});
|
|
}
|
|
});
|
|
},
|
|
/** 用户信息-提交按钮-商企 */
|
|
submitFormInfoBus() {
|
|
this.$refs["formInfoBus"].validate(valid => {
|
|
if (valid) {
|
|
addUserInfoBus(this.formInfoBus).then(response => {
|
|
this.$modal.msgSuccess(this.$t('common.addSuccess'));
|
|
this.openInfoBus = false;
|
|
this.getList();
|
|
}).finally(() => {
|
|
this.buttonLoading = false;
|
|
});
|
|
}
|
|
});
|
|
},
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const account = row.account;
|
|
this.$modal.confirm('是否确认删除登录账号为"' + account + '"的数据项?').then(() => {
|
|
this.loading = true;
|
|
return delUserRegister(ids);
|
|
}).then(() => {
|
|
this.loading = false;
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {
|
|
}).finally(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
this.download('business/userRegister/export', {
|
|
...this.queryParams
|
|
}, `userRegister_${new Date().getTime()}.xlsx`)
|
|
},
|
|
handleAddInfo(row) {
|
|
this.reset();
|
|
if (row.userType == "0") {
|
|
this.formInfo = row;
|
|
this.openInfo = true;
|
|
}
|
|
if (row.userType == "1") {
|
|
this.formInfoBus = row;
|
|
this.openInfoBus = true;
|
|
}
|
|
this.title = this.$t('business.userInfo.addTitle');
|
|
},
|
|
|
|
/**
|
|
* 密码重置
|
|
* @param row
|
|
*/
|
|
passwordReset(row) {
|
|
this.$modal.confirm('是否确认重置登录密码?').then(() => {
|
|
this.loading = true;
|
|
return resetUserPassword(row.id);
|
|
}).then(() => {
|
|
this.loading = false;
|
|
this.getList();
|
|
this.$modal.msgSuccess("重置成功");
|
|
}).catch(() => {
|
|
}).finally(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 账号冻结
|
|
* @param row
|
|
*/
|
|
accountLock(row) {
|
|
this.$modal.confirm('是否确认对账号"' + row.account + '"进行冻结?').then(() => {
|
|
this.loading = true;
|
|
return accountLock(row);
|
|
}).then(() => {
|
|
this.loading = false;
|
|
this.getList();
|
|
this.$modal.msgSuccess("冻结成功");
|
|
}).catch(() => {
|
|
}).finally(() => {
|
|
this.loading = false;
|
|
});
|
|
},
|
|
/**
|
|
* 账号解冻
|
|
* @param row
|
|
*/
|
|
accountUnlock(row) {
|
|
this.$modal.confirm('是否确认解除账号"' + row.account + '"的冻结?').then(() => {
|
|
this.loading = true;
|
|
return accountLock(row);
|
|
}).then(() => {
|
|
this.loading = false;
|
|
this.getList();
|
|
this.$modal.msgSuccess("解除冻结成功");
|
|
}).catch(() => {
|
|
}).finally(() => {
|
|
this.loading = false;
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
.el-dropdown-link {
|
|
cursor: pointer;
|
|
color: #409EFF;
|
|
}
|
|
|
|
.el-icon-arrow-down {
|
|
font-size: 12px;
|
|
}
|
|
</style>
|
|
|