同步代码
parent
a1e4e7e26d
commit
94817e3325
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Created by lk on 17/6/4.
|
||||
*/
|
||||
import axios from "@/utils/axios";
|
||||
// 获取信息
|
||||
export function userInfo(id, token) {
|
||||
return axios({
|
||||
url: "/admin/auth/login/userInfo",
|
||||
method: "get",
|
||||
params: { id, token }
|
||||
});
|
||||
}
|
||||
|
||||
export function loginName(username, password) {
|
||||
console.log(username + " " + password);
|
||||
return axios({
|
||||
url: "/login",
|
||||
method: "post",
|
||||
data: { username, password }
|
||||
});
|
||||
}
|
||||
|
||||
export function logout(uid, token) {
|
||||
return axios({
|
||||
url: "/admin/auth/login/out",
|
||||
method: "post",
|
||||
data: { uid, token }
|
||||
});
|
||||
}
|
||||
|
||||
export function password(data) {
|
||||
return axios({
|
||||
url: "/admin/auth/login/password",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function getRegisters(query) {
|
||||
return axios({
|
||||
url: "/salewarehouse/register/list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function register(data) {
|
||||
return axios({
|
||||
url: "/salewarehouse/register/save",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function checkPass(data) {
|
||||
return axios({
|
||||
url: "/salewarehouse/register/check",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function getCheckcode(data) {
|
||||
return axios({
|
||||
url: "/salewarehouse/register/getCheckcode",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function deleteRe(data) {
|
||||
return axios({
|
||||
url: "/salewarehouse/register/deleteResiter",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function resetPasswd(data) {
|
||||
return axios({
|
||||
url: "/salewarehouse/reset/passwd",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function getCompany(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/warehouse/info/company",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function modifyCompany(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/warehouse/info/modifyCompany",
|
||||
method: "post",
|
||||
data: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getRefid(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/sale/info/refid",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function checkCompany(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/salewarehouse/register/checkCompany",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getRegisterConfig(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/salewarehouse/register/getRegisterConfig",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export function getSubCompany(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/sale/info/getSubCompany",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getSubCompany2(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/sale/info/getSubCompany2",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 配置编译环境和线上环境之间的切换
|
||||
*
|
||||
* baseUrl: 域名地址
|
||||
* routerMode: 路由模式
|
||||
* imgBaseUrl: 图片所在域名地址
|
||||
*
|
||||
*/
|
||||
import '../../public/config'
|
||||
import '../../public/config.json'
|
||||
import axios from 'axios'
|
||||
import myReq from '@/utils/axios'
|
||||
|
||||
let BASE_URL = process.env.VUE_APP_BASE_API
|
||||
let SERVER_IP = ''
|
||||
let ROUTER_MODE = ''
|
||||
let IMG_BASE_URL = BASE_URL
|
||||
export { BASE_URL, ROUTER_MODE, IMG_BASE_URL, SERVER_IP }
|
||||
axios.get('./config.json').then((res) => {
|
||||
// 基础地址
|
||||
BASE_URL = res.data.BASE_URL
|
||||
SERVER_IP = res.data.SERVER_IP
|
||||
myReq.defaults.baseURL = BASE_URL
|
||||
})
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
import axios from "axios";
|
||||
import { Message } from "element-ui";
|
||||
import store from "../store/index";
|
||||
import { BASE_URL } from "../config/app";
|
||||
import router from "../router/index";
|
||||
import "../../public/config";
|
||||
// axios.defaults.baseURL = '/api'
|
||||
|
||||
|
||||
|
||||
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: BASE_URL, // api的base_url
|
||||
timeout: 15000 // 请求超时时间
|
||||
|
||||
});
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// Do something before request is sent
|
||||
if (store.getters.adminId && store.getters.token) {
|
||||
// config.params = {
|
||||
// ADMIN_ID: store.getters.adminId,
|
||||
// ADMIN_TOKEN: store.getters.token,
|
||||
// ...config.params
|
||||
// };
|
||||
config.headers={
|
||||
ADMIN_ID: store.getters.adminId,
|
||||
ADMIN_TOKEN: store.getters.token,
|
||||
};
|
||||
}
|
||||
return config;
|
||||
},
|
||||
error => {
|
||||
// Do something with request error
|
||||
Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// respone拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const data = response.data;
|
||||
if (data.code) {
|
||||
if (data.code === 2) {
|
||||
store.dispatch("fedLogout").then(() => {
|
||||
Message.error("登录失效,请重新登录");
|
||||
router.push({
|
||||
path: "/login",
|
||||
query: { redirect: router.currentRoute.fullPath } // 从哪个页面跳转过来
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
error => {
|
||||
Message({
|
||||
message: error.message,
|
||||
type: "error",
|
||||
duration: 5 * 1000
|
||||
});
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default service;
|
@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<div style="overflow: auto; height: 100%; margin: 0 auto">
|
||||
<el-card
|
||||
class="el-card"
|
||||
style="
|
||||
width: 60%;
|
||||
margin-top: 35px;
|
||||
margin-left:20%;
|
||||
margin-bottom: 35px;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
<div slot="header" style="font-weight: bold">
|
||||
<span>忘记密码</span>
|
||||
</div>
|
||||
<el-form
|
||||
:model="inputQuery"
|
||||
:rules="rules"
|
||||
ref="inputQuery"
|
||||
style="margin-left: 20%"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="register-text">
|
||||
<span>用户账号: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item prop="nickName">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入登录用户账号"
|
||||
v-model="inputQuery.userName"
|
||||
@input="change()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="register-text">
|
||||
<span>新密码: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入密码"
|
||||
type="password"
|
||||
v-model="inputQuery.password"
|
||||
@input="change()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="register-text">
|
||||
<span>确认密码: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item prop="confirmPassword">
|
||||
<el-input
|
||||
size="small"
|
||||
type="password"
|
||||
placeholder="请确认密码"
|
||||
v-model="inputQuery.confirmPassword"
|
||||
@input="change()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="register-text">
|
||||
<span>手机号: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入手机号"
|
||||
v-model="inputQuery.mobile"
|
||||
@input="change()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="search"
|
||||
:disabled="isTimer"
|
||||
style="margin-top: 3.5px"
|
||||
@click="getCheckCode"
|
||||
>
|
||||
<span>{{ btnTitle }}</span>
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="register-text">
|
||||
<span>手机验证码: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item prop="checkCode">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入手机验证码"
|
||||
v-model="inputQuery.checkCode"
|
||||
@input="change()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div style="width: 100%">
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="search"
|
||||
style="margin-top: 20px; "
|
||||
@click="onSubmit('inputQuery')"
|
||||
>重置密码
|
||||
</el-button
|
||||
>
|
||||
|
||||
<el-button type="primary" icon="search" @click="intentBack" style="margin-right: 130px"
|
||||
>返回
|
||||
</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCheckcode, register, resetPasswd} from "@/api/auth/register";
|
||||
import {
|
||||
provinceAndCityData,
|
||||
regionData,
|
||||
provinceAndCityDataPlus,
|
||||
regionDataPlus,
|
||||
CodeToText,
|
||||
TextToCode,
|
||||
} from "element-china-area-data";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
let validatePass2 = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback(new Error("请再次输入密码"));
|
||||
} else if (value !== this.inputQuery.password) {
|
||||
callback(new Error("两次输入密码不一致!"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
inputQuery: {
|
||||
password: "",
|
||||
mobile: "",
|
||||
confirmPassword: "",
|
||||
checkCode: "",
|
||||
userName: "",
|
||||
},
|
||||
isTimer: false,
|
||||
btnTitle: "获取验证码",
|
||||
options: regionDataPlus,
|
||||
selectedOptions: [],
|
||||
|
||||
rules: {
|
||||
password: [{required: true, message: "请输入密码", trigger: "blur"}],
|
||||
|
||||
mobile: [{required: true, message: "请输入手机号", trigger: "blur"}],
|
||||
confirmPassword: [
|
||||
{required: true, message: "请确认密码", trigger: "blur"},
|
||||
{validator: validatePass2, trigger: "blur"},
|
||||
],
|
||||
checkCode: [
|
||||
{required: true, message: "请输入手机验证码", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
resetPasswd(this.inputQuery).then((response) => {
|
||||
if (response.code === 20000) {
|
||||
this.loading = false;
|
||||
this.$alert("密码重置成功,点击确定即可登录", "密码重置", {
|
||||
confirmButtonText: "确定",
|
||||
callback: (action) => {
|
||||
this.$router.push({path: "../login"});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getData() {
|
||||
this.loading = true;
|
||||
getCompany().then((response) => {
|
||||
this.loading = false;
|
||||
this.inputQuery = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
getCheckCode(mobile) {
|
||||
let tquery = {
|
||||
phoneNum: this.inputQuery.mobile,
|
||||
userName: this.inputQuery.userName,
|
||||
};
|
||||
getCheckcode(tquery).then((response) => {
|
||||
if (response.code === 20000) {
|
||||
this.validateBtn();
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
intentBack() {
|
||||
// this.$router.push({path:'../readme/detail',query:{id:row.corpOrderId}});
|
||||
this.$router.go(-1);
|
||||
},
|
||||
validateBtn() {
|
||||
//倒计时
|
||||
let time = 60;
|
||||
let timer = setInterval(() => {
|
||||
if (time === 0) {
|
||||
clearInterval(timer);
|
||||
this.isTimer = false;
|
||||
this.btnTitle = "获取验证码";
|
||||
} else {
|
||||
this.btnTitle = time + "秒后重试";
|
||||
this.isTimer = true;
|
||||
time--;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
handleChange(value) {
|
||||
this.inputQuery.area =
|
||||
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.register-text {
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
font-family: "Microsoft YaHei";
|
||||
float: left;
|
||||
text-align: left;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
margin-right: 20px;
|
||||
margin-top: 15px;
|
||||
/*transition: all .5s;*/
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,478 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form :model="query" class="query-form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="用户账号:" >
|
||||
<el-input v-model="query.userName" style="width: 100%" placeholder="请输入用户账号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="状态:">
|
||||
<el-select v-model="query.userFlag" style="width: 100%" placeholder="请选择状态">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="禁用" value="0"></el-option>
|
||||
<el-option label="正常" value="1"></el-option>
|
||||
<el-option label="未验证" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--
|
||||
<el-form-item class="query-form-item">
|
||||
<el-select v-model="query.roleId" placeholder="角色">
|
||||
<el-option label="全部角色" value=""></el-option>
|
||||
<el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
-->
|
||||
<el-col :span="9">
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="onReset"
|
||||
></el-button>
|
||||
<el-button type="primary" icon="search" @click="onSubmit"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" @click.native="handleForm(null, null)"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column type="index" width="50"> </el-table-column>
|
||||
<el-table-column label="用户账号" prop="userName" > </el-table-column>
|
||||
<el-table-column label="用户名称" prop="employeeName" >
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.userFlag | statusFilterType">{{
|
||||
scope.row.userFlag | statusFilterName
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native="handleForm(scope.$index, scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native="handleDel(scope.$index, scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="query.limit"
|
||||
:page.sync="query.page"
|
||||
@pagination="handleCurrentChange"
|
||||
></pagination>
|
||||
|
||||
<!--表单-->
|
||||
<el-dialog
|
||||
:title="formMap[formName]"
|
||||
:visible.sync="formVisible"
|
||||
:before-close="hideForm"
|
||||
append-to-body
|
||||
:modal-append-to-body="false"
|
||||
:close-on-click-modal="false"
|
||||
width="70%"
|
||||
top="5vh"
|
||||
>
|
||||
<el-form :model="formData" :rules="formRules" ref="dataForm">
|
||||
<el-row :gutter="20" class="el-row" type="flex">
|
||||
<el-col :span="10" class="el-col" type="flex">
|
||||
<div class="text item">
|
||||
<el-form-item label="用户账号" prop="userName">
|
||||
<el-input v-model="formData.userName" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10" class="el-col">
|
||||
<div class="text item">
|
||||
<div class="text item">
|
||||
<el-form-item label="用户名称" prop="employeeName">
|
||||
<el-input
|
||||
v-model="formData.employeeName"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" class="el-row" type="flex">
|
||||
<el-col :span="10" class="el-col" type="flex">
|
||||
<div class="text item">
|
||||
<el-form-item label="登录密码" prop="passWord">
|
||||
<el-input
|
||||
type="password"
|
||||
size="small"
|
||||
v-model="formData.passWord"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10" class="el-col">
|
||||
<div class="text item">
|
||||
<div class="text item">
|
||||
<el-form-item label="确认密码" prop="checkPassword">
|
||||
<el-input
|
||||
type="password"
|
||||
size="small"
|
||||
v-model="formData.checkPassword"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click.native="hideForm" size="small">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click.native="formSubmit()"
|
||||
:loading="formLoading"
|
||||
>提交</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
authAdminList,
|
||||
authCustomerRoles,
|
||||
authAdminSave,
|
||||
authAdminDelete,
|
||||
} from "@/api/auth/authAdmin";
|
||||
|
||||
import { userInfo } from "@/api/auth/login";
|
||||
const formJson = {
|
||||
id: "",
|
||||
passWord: "",
|
||||
userName: "",
|
||||
checkPassword: "",
|
||||
employeeName: "",
|
||||
userFlag: 1,
|
||||
customerId: "",
|
||||
roles: [],
|
||||
};
|
||||
export default {
|
||||
name: "currentCustomer",
|
||||
props: {
|
||||
currentCustomer: "",
|
||||
},
|
||||
data() {
|
||||
let validatePass = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback(new Error("请输入密码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
let validatePass2 = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback(new Error("请再次输入密码"));
|
||||
} else if (value !== this.formData.passWord) {
|
||||
callback(new Error("两次输入密码不一致!"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
roles: [],
|
||||
query: {
|
||||
userName: "",
|
||||
userFlag: "",
|
||||
page: 1,
|
||||
limit: 20,
|
||||
roleId: "",
|
||||
customerId: "",
|
||||
},
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: true,
|
||||
index: null,
|
||||
formName: null,
|
||||
formMap: {
|
||||
add: "新增",
|
||||
edit: "编辑",
|
||||
},
|
||||
|
||||
userInfo: {
|
||||
customerId: "",
|
||||
userId: "",
|
||||
roles: [],
|
||||
},
|
||||
formLoading: false,
|
||||
formVisible: false,
|
||||
formData: formJson,
|
||||
formRules: {},
|
||||
addRules: {
|
||||
userName: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||
passWord: [
|
||||
{ required: true, message: "请输入密码", trigger: "blur" },
|
||||
{ validator: validatePass, trigger: "blur" },
|
||||
],
|
||||
checkPassword: [
|
||||
{
|
||||
required: true,
|
||||
message: "请再次输入密码",
|
||||
trigger: "blur",
|
||||
},
|
||||
{ validator: validatePass2, trigger: "blur" },
|
||||
],
|
||||
userFlag: [
|
||||
{ required: true, message: "请选择状态", trigger: "change" },
|
||||
],
|
||||
},
|
||||
editRules: {
|
||||
userName: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||
userFlag: [
|
||||
{ required: true, message: "请选择状态", trigger: "change" },
|
||||
],
|
||||
},
|
||||
deleteLoading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.query = {
|
||||
userName: "",
|
||||
userFlag: "",
|
||||
page: 1,
|
||||
limit: 20,
|
||||
roleId: "",
|
||||
customerId: this.currentCustomer,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
query: this.query,
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.query.page = val;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
authAdminList(this.query)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
this.roles = [];
|
||||
});
|
||||
},
|
||||
getRoleList() {
|
||||
authCustomerRoles(this.query)
|
||||
.then((response) => {
|
||||
this.roles = response.data.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
this.roles = [];
|
||||
});
|
||||
},
|
||||
|
||||
getUserInfo() {
|
||||
userInfo()
|
||||
.then((response) => {
|
||||
this.userInfo = {
|
||||
customerId: response.data.customerId,
|
||||
userId: response.data.id,
|
||||
roles: response.data.roleIds,
|
||||
};
|
||||
this.query.customerId = response.data.customerId;
|
||||
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {
|
||||
this.customerId = "";
|
||||
});
|
||||
},
|
||||
|
||||
// 刷新表单
|
||||
resetForm() {
|
||||
if (this.$refs["dataForm"]) {
|
||||
// 清空验证信息表单
|
||||
this.$refs["dataForm"].clearValidate();
|
||||
// 刷新表单
|
||||
this.$refs["dataForm"].resetFields();
|
||||
}
|
||||
},
|
||||
// 隐藏表单
|
||||
hideForm() {
|
||||
// 更改值
|
||||
this.formVisible = !this.formVisible;
|
||||
// 清空表单
|
||||
this.$refs["dataForm"].resetFields();
|
||||
return true;
|
||||
},
|
||||
// 显示表单
|
||||
handleForm(index, row) {
|
||||
this.formVisible = true;
|
||||
|
||||
this.formData = JSON.parse(JSON.stringify(formJson));
|
||||
if (row !== null) {
|
||||
this.formData = Object.assign({}, row);
|
||||
}
|
||||
this.formName = "add";
|
||||
this.formRules = this.addRules;
|
||||
if (index !== null) {
|
||||
this.index = index;
|
||||
this.formName = "edit";
|
||||
this.formRules = this.editRules;
|
||||
}
|
||||
},
|
||||
formSubmit() {
|
||||
console.log(
|
||||
this.formData.userName +
|
||||
"-----" +
|
||||
this.formData.employeeName +
|
||||
this.formData.userFlag +
|
||||
this.formData.id
|
||||
);
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.formLoading = true;
|
||||
|
||||
this.formData.userFlag = 1;
|
||||
this.formData.roles = this.userInfo.roles;
|
||||
this.formData.customerId = this.currentCustomer;
|
||||
let data = Object.assign({}, this.formData);
|
||||
let savequery = {
|
||||
id: this.formData.id,
|
||||
userFlag: 1,
|
||||
roles: this.userInfo.roles,
|
||||
customerId: this.currentCustomer,
|
||||
passWord: this.formData.passWord,
|
||||
userName: this.formData.userName,
|
||||
employeeName: this.formData.employeeName,
|
||||
};
|
||||
authAdminSave(savequery, this.formName).then((response) => {
|
||||
this.formLoading = false;
|
||||
if (response.code !== 20000) {
|
||||
this.$message.error(response.message);
|
||||
return false;
|
||||
}
|
||||
this.$message.success("操作成功");
|
||||
this.formVisible = false;
|
||||
if (this.formName === "add") {
|
||||
// 向头部添加数据
|
||||
if (response.data && response.data.id) {
|
||||
data.id = response.data.id;
|
||||
this.list.unshift(data);
|
||||
}
|
||||
} else {
|
||||
this.list.splice(this.index, 1, data);
|
||||
}
|
||||
// 刷新表单
|
||||
this.resetForm();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
handleDel(index, row) {
|
||||
if (row.id === this.userInfo.userId) {
|
||||
this.$message.warning("主账号不能删除");
|
||||
} else if (row.id) {
|
||||
this.$confirm("确认删除该记录吗?", "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
let para = { id: row.id };
|
||||
this.deleteLoading = true;
|
||||
authAdminDelete(para)
|
||||
.then((response) => {
|
||||
this.deleteLoading = false;
|
||||
if (response.code !== 20000) {
|
||||
this.$message.error(response.message);
|
||||
return false;
|
||||
}
|
||||
this.$message.success("操作成功");
|
||||
// 刷新数据
|
||||
this.list.splice(index, 1);
|
||||
})
|
||||
.catch(() => {
|
||||
this.deleteLoading = false;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.info("取消删除");
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
statusFilterType(status) {
|
||||
const statusMap = {
|
||||
0: "gray",
|
||||
1: "success",
|
||||
2: "danger",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
statusFilterName(status) {
|
||||
const statusMap = {
|
||||
0: "禁用",
|
||||
1: "正常",
|
||||
2: "未验证",
|
||||
};
|
||||
return statusMap[status];
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log("----" + this.currentCustomer + "2---");
|
||||
this.query.customerId = this.currentCustomer;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
destroyed() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style type="text/scss" lang="scss">
|
||||
</style>
|
@ -0,0 +1,584 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form :model="filterQuery" class="query-form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="企业名称">
|
||||
<el-input
|
||||
v-model="filterQuery.companyName"
|
||||
style="width: 90%"
|
||||
placeholder="请输入企业名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态">
|
||||
<el-select v-model="filterQuery.checkType" style="width: 90%" placeholder="请选择审核状态">
|
||||
<el-option label="未审核" value="0"></el-option>
|
||||
<el-option label="已审核" value="1"></el-option>
|
||||
<el-option label="未通过" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="onReset"
|
||||
></el-button>
|
||||
<el-button type="primary" icon="search" @click="onSubmit"
|
||||
>查询
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="用户名称" prop="nickName" width="220"></el-table-column>
|
||||
<el-table-column
|
||||
label="企业名称"
|
||||
prop="companyName"
|
||||
width="230"
|
||||
></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
prop="realName"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<el-table-column label="手机" prop="mobile" width="120"></el-table-column>
|
||||
<el-table-column label="电话" prop="tel" width="120"></el-table-column>
|
||||
<el-table-column label="邮箱" prop="email" width="180"></el-table-column>
|
||||
<el-table-column label="企业类型" prop="bussinessStatus">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ bussinessFlag[scope.row.bussinessStatus] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属地区" prop="area" width="200">
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" prop="checkType" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ checkFlag[scope.row.checkType] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作"width="60px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="scope.row.checkType == 1"
|
||||
@click.native.stop="checkDialog(scope.row)"
|
||||
>审核
|
||||
</el-button
|
||||
>
|
||||
|
||||
<!-- <el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.stop="deleteDialog(scope.row)"
|
||||
>删除</el-button
|
||||
> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog
|
||||
title="新用户审核"
|
||||
:visible.sync="centerDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="60%"
|
||||
center
|
||||
>
|
||||
<el-form :model="rowData" :rules="rowDataRules" ref="rowDataForm" style="margin: 0 20px;">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>用户名称: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.nickName"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>企业名称: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="rowData.companyName"
|
||||
filterable
|
||||
remote
|
||||
:disabled="rowData.companyName != null && rowData.companyName != ''"
|
||||
clearable="true"
|
||||
reserve-keyword
|
||||
placeholder="请输入企业名称"
|
||||
:remote-method="findMethod"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
:loading="loading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fromOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>联系人: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.realName"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>企业类型: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="bussinessFlag[rowData.bussinessStatus]"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>电话: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.tel"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>所属地区: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.area"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>手机: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.mobile"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>邮箱: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="rowData.email"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>所属供应商: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="sValue"
|
||||
:multiple="false"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入供应商名称"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="sLoading"
|
||||
@change="selectOne"
|
||||
:disabled="registerConfigMap.companyCheckStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sOptions"
|
||||
:key="id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<span>{{item.name}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>营业执照: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button
|
||||
@click.native="openFile(rowData.licenseUrl)"
|
||||
size="small" type="primary">查看文件
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- <el-divider></el-divider>-->
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<div class="div-text">
|
||||
<span>分配角色: </span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form :model="checkQuery">
|
||||
<el-form-item label="" style="margin-top: 5px">
|
||||
<el-radio-group v-model="check" @change="handleCheckedChange">
|
||||
<el-radio v-for="item in roles" :key="item.roleId" :label="item.roleId">{{
|
||||
item.roleName
|
||||
}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="passRegister">通过</el-button>
|
||||
<el-button type="primary" @click="noPassRegister">不通过</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:limit.sync="filterQuery.limit"
|
||||
:page.sync="filterQuery.page"
|
||||
@pagination="handleCurrentChange"
|
||||
></pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getRegisters, checkPass, deleteRe} from "@/api/auth/register";
|
||||
import {authCustomerRoles} from "@/api/auth/authAdmin";
|
||||
import {getBasicUnitMaintains2} from "@/api/basic/basicUnitMaintain";
|
||||
import {getRegisterConfig} from "@/api/warehouse/company";
|
||||
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
BASE_URL : process.env.VUE_APP_BASE_API,
|
||||
filterQuery: {
|
||||
companyName: "",
|
||||
checkType: "",
|
||||
page: 1,
|
||||
limit: 20,
|
||||
},
|
||||
value: "",
|
||||
total: 0,
|
||||
checkFlag: {
|
||||
0: "未审核",
|
||||
1: "已通过",
|
||||
2: "已拒绝",
|
||||
},
|
||||
bussinessFlag: {
|
||||
1: "医院",
|
||||
2: "经营企业"
|
||||
},
|
||||
checkQuery: {
|
||||
id: "",
|
||||
checkType: "",
|
||||
roles: "",
|
||||
companyName: ""
|
||||
|
||||
},
|
||||
rowDataRules: {
|
||||
nickName: [
|
||||
{required: true, message: "请输入用户名称", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
list: [],
|
||||
roles: [],
|
||||
addDialogVisible: false,
|
||||
centerDialogVisible: false,
|
||||
check: "",
|
||||
rowData: {},
|
||||
sOptions: [],
|
||||
sValue: [],
|
||||
sList: [],
|
||||
sLoading: false,
|
||||
sSelectStatus: false,
|
||||
registerConfigMap: {
|
||||
companyCheckStatus: true
|
||||
},
|
||||
fileUrl: "",
|
||||
fromOptions: [],
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
companyName: "",
|
||||
checkType: "",
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getRegisters(this.filterQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
});
|
||||
},
|
||||
selectOne(event) {
|
||||
this.checkQuery.companyName =this.sOptions.find(item => item.id == event).name
|
||||
this.checkQuery.companyId = this.sOptions.find(item => item.id == event).erpId;
|
||||
this.sSelectStatus = true;
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
this.sLoading = true;
|
||||
let tQuery = {
|
||||
key: query,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
getBasicUnitMaintains2(tQuery)
|
||||
.then((response) => {
|
||||
this.sLoading = false;
|
||||
this.sOptions = response.data.list
|
||||
})
|
||||
.catch(() => {
|
||||
this.sLoading = false;
|
||||
this.sOptions = [];
|
||||
});
|
||||
} else {
|
||||
this.sOptions = [];
|
||||
}
|
||||
},
|
||||
cancelDialog() {
|
||||
this.addDialogVisible = false;
|
||||
},
|
||||
|
||||
handleCheckedChange(val) {
|
||||
},
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.filterQuery.limit = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val.page;
|
||||
this.getList();
|
||||
},
|
||||
findMethod(query) {
|
||||
this.fromOptions = [];
|
||||
let cQuery = {
|
||||
key: query,
|
||||
};
|
||||
getBasicUnitMaintains(cQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
this.fromOptions = response.data.page.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
checkRegister() {
|
||||
this.loading = true;
|
||||
checkPass(this.checkQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
if (response.code === 20000) {
|
||||
this.getList();
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "更新成功!",
|
||||
});
|
||||
} else {
|
||||
this.$message.warning("更新失败");
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
checkDialog(row) {
|
||||
this.check = row.roles;
|
||||
this.checkQuery = {
|
||||
id: row.id + "",
|
||||
checkType: 1,
|
||||
roles: row.roles,
|
||||
};
|
||||
this.rowData = row;
|
||||
if (this.registerConfigMap.companyCheckStatus) {
|
||||
this.sValue = this.rowData.companyName;
|
||||
}
|
||||
this.centerDialogVisible = true;
|
||||
},
|
||||
|
||||
passRegister() {
|
||||
this.checkQuery.roles = this.check;
|
||||
|
||||
if (this.$isBlank(this.rowData.companyName)) {
|
||||
return this.$message.warning("请输入企业名称");
|
||||
}
|
||||
|
||||
this.checkRegister();
|
||||
this.centerDialogVisible = false;
|
||||
},
|
||||
noPassRegister() {
|
||||
this.checkQuery.roles = this.check;
|
||||
this.checkQuery.checkType = 2;
|
||||
this.checkRegister();
|
||||
this.centerDialogVisible = false;
|
||||
},
|
||||
|
||||
deleteDialog(row) {
|
||||
this.$confirm("是否删除该记录?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
let tQuery = {
|
||||
id: row.id,
|
||||
};
|
||||
deleteRe(tQuery).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
getRoleList() {
|
||||
authCustomerRoles()
|
||||
.then((response) => {
|
||||
this.roles = response.data.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
this.checkQuery.roles = [];
|
||||
});
|
||||
},
|
||||
registerConfig() {
|
||||
getRegisterConfig().then((response) => {
|
||||
if (response.code === 20000) {
|
||||
this.registerConfigMap = response.data;
|
||||
this.sSelectStatus = this.registerConfigMap.companyCheckStatus;
|
||||
}
|
||||
});
|
||||
},
|
||||
openFile(path) {
|
||||
debugger
|
||||
window.open(this.fileUrl + path);
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
},
|
||||
created() {
|
||||
this.fileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image1&name=";
|
||||
this.getList();
|
||||
this.getRoleList();
|
||||
this.registerConfig();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.div-text {
|
||||
float: right;
|
||||
text-align: right;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue