master
wangwei 2 years ago
parent f796d153b4
commit 9e56990bfb

@ -0,0 +1,20 @@
import request from "@/utils/request";
export function insertInitial(param) {
return request({
url: "/admin/auth/register/insertInitial",
method: "get",
params :param
});
}
export function saveAllInfo(param) {
return request({
url: "/admin/auth/register/saveAllInfo",
method: "post",
data :param
});
}

@ -1,4 +1,4 @@
import request from "@/utils/request";
import request from "@/utils/request";
// 登录方法
export function login(username, password, code, uuid) {

@ -0,0 +1,35 @@
import request from "@/utils/request";
export function filterCompanyCert(param) {
return request({
url: "/sup/company/cert/filterList",
method: "get",
params :param
});
}
export function isertCert(param) {
return request({
url: "/sup/company/cert/isertCert",
method: "post",
data :param
});
}
export function deleteCert(param) {
return request({
url: "/sup/company/cert/deleteCert",
method: "post",
data :param
});
}
export function updateCert(param) {
return request({
url: "/sup/info/updateCert",
method: "post",
data :param
});
}

@ -0,0 +1,15 @@
import request from "@/utils/request";
export function search(param) {
return request({
url: "/udi/auth/user/comapny/search",
method: "get",
params :param
});
}

@ -14,6 +14,7 @@ const whiteList = [
"/bind",
"/register",
"/userInformation",
"/improveInfo",
];
router.beforeEach((to, from, next) => {

@ -46,6 +46,11 @@ export const constantRoutes = [
component: (resolve) => require([`@/views/myLogin`], resolve),
hidden: true,
},
{
path: "/improveInfo",
component: (resolve) => require([`@/views/improveInfo`], resolve),
hidden: true,
},
{
path: "/register",
component: (resolve) => require([`@/views/register`], resolve),

@ -0,0 +1,860 @@
<template>
<!-- 本企业资质页面 -->
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="500px"
>
<el-card class="el-card">
<div style=" margin-left: 40%">
<span>
本企业信息审核状态
<el-tag :type="inputQuery.ucstatus | statusFilterType" >
{{checkSupFlag[inputQuery.ucstatus] }}
</el-tag>
</span>
<span>
说明
<el-tag>
{{inputQuery.ucstatus }}
</el-tag>
</span>
</div>
<div style="float: right; margin-top: -20px">
<el-button
type="primary"
size="mini"
icon="search"
@click="onModifySubmit()"
>草稿保存
</el-button>
<el-button
type="primary"
size="mini"
icon="search"
@click="onModifySubmit('key')"
>提交审核
</el-button>
</div>
<el-row
:gutter="20"
class="el-row"
type="flex"
style="margin-top: 25px"
>
<el-col :span="10" class="el-col">
<el-form-item
label=" 企业名称:"
label-width="150px"
prop="companyName"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.companyName"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label=" 社会信用号:"
label-width="150px"
prop="creditNum"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.creditNum"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item
label="邮箱:"
label-width="150px"
prop="email"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.email"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="企业类型:" label-width="150px" prop="bussinessStatus">
<el-select
size="small"
v-model="inputQuery.bussinessStatus"
placeholder="企业类型"
style="width: 100%"
>
<el-option
label="生产企业"
value="1"
></el-option>
<el-option label="流通企业" value="2"></el-option>
<el-option label="医疗机构" value="3"></el-option>
<el-option label="监管机构" value="4"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item
label=" 法人名称 :"
label-width="150px"
prop="legalPerson"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.legalPerson"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item
label="法人身份证号 :"
label-width="150px"
prop="legalIdCard"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.legalIdCard"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item
label="注册地址:"
label-width="150px"
prop="registerAddress"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.registerAddress"
></el-input>
</el-form-item>
</el-col>
</el-row>
<!--<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">-->
<!-- <el-col :span="10" class="el-col">-->
<!-- <el-form-item label="备注:" label-width="150px" prop="remark">-->
<!-- <el-input-->
<!-- size="small"-->
<!-- v-model="inputQuery.remark"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!--</el-row>-->
</el-card>
<el-card class="el-card">
<div>
<span>
个人基本信息
</span>
</div>
<el-row
:gutter="20"
class="el-row"
type="flex"
style="margin-top: 25px"
>
<el-col :span="10" class="el-col">
<el-form-item label="手机:" label-width="150px" prop="mobile">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.mobile"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item label="邮箱:" label-width="150px" prop="email">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.email"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label="系统负责人姓名:"
label-width="150px"
prop="name"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.name"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label="系统负责人电话:"
label-width="150px"
prop="tel"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.tel"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label="系统负责人QQ:"
label-width="150px"
prop="qq"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.qq"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label="系统负责人微信:"
label-width="150px"
prop="weChat"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.weChat"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="20"
class="el-row"
type="flex"
>
<el-col :span="10" class="el-col">
<el-form-item
label="系统负责人邮箱:"
label-width="150px"
prop="xemail"
>
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.xemail"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div style="float: right; text-align: right; margin-bottom: 8px">
<el-button
type="primary"
size="mini"
icon="search"
@click="addCert()"
style="text-align: right"
>添加资质证书
</el-button>
</div>
<el-table
v-loading="certLoading"
:data="certList"
style="width: 100%"
border
highlight-current-row
>
<el-table-column
type="index"
label="序号"
width="50"
></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="code"></el-table-column>
<el-table-column label="生效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="确认状态" prop="status" width="120">
<template slot-scope="scope">
<el-tag >
</el-tag>
</template>
</el-table-column>
<el-table-column
label="确认说明"
prop="auditComment"
show-overflow-tooltip
></el-table-column>
<el-table-column label="状态" prop="checkStatus" width="120">
<template slot-scope="scope">
<el-tag >
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click.native="showImgViewer(scope.row)"
>预览</el-button
>
<el-button
type="text"
size="small"
@click.native="deleteCompanyCert(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="certTotal > 0"
:total="certTotal"
:limit.sync="query.limit"
:page.sync="query.page"
@pagination="certHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
:title="formMap[formName]"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="60%"
v-if="addCertVisible"
append-to-body
@close="closeLocalDialog"
:before-close="closeLocal"
>
<companyAddCert
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
:ucId="ucId"
></companyAddCert>
</el-dialog>
<el-image-viewer
v-if="imgViewerVisible"
style="z-index: 9999"
:on-close="closeImgViewer"
:url-list="imgList"
/>
</el-form>
</div>
</template>
<script>
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import {insertInitial,saveAllInfo} from "@/api/auth/registComPer";
import {filterCompanyCert,deleteCert,updateCert} from "@/api/sup/userCert";
import { previewImage } from "@/api/purchase/supCompany";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import {isBlank} from "@/utils/strUtil";
export default {
name: "supCompanyEdit",
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
inputQuery: {
ucstatus:0,
formData:{},
},
headers: {},
imgViewerVisible: false,
imgList: [],
fromOptions: [],
classesDisplay: false,
corpLoading: false,
mobile:"",
selectedOptions: [],
query:{
page: 1,
limit: 20,
},
upId:"",
urId:"",
ucId:"",
rules: {
companyName: [
{
required: true,
message: "请输入企业名称",
trigger: "blur",
},
],
creditNum: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur",
},
],
bussinessStatus: [
{
required: true,
message: "请选择企业类别",
trigger: "change",
},
],
name: [
{
required: true,
message: "请输入姓名",
trigger: "change",
},
],
tel: [
{
required: true,
message: "请输入电话",
trigger: "change",
},
],
contacts: [
{
required: true,
message: "请输入联系人",
trigger: "change",
},
],
mobile: [
{
required: true,
message: "请输入联系电话",
trigger: "change",
},
],
email: [
{
required: true,
message: "请输入邮箱",
trigger: "change",
},
],
updateCause: [
{
required: true,
message: "请输入变更原因",
trigger: "change",
},
],
},
uploadUrl: "",
fileUrl: "",
certFileUrl: "",
url: "http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg",
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
certType: 1,
salesmanQuery: {
name: "",
page: 1,
limit: 20,
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: "身份证",
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: "",
cpmctymc: "",
ggxh: "",
page: 1,
limit: 20,
},
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
explainCertVisible: false,
explainMsg: "",
companyEditDisabled: true,
companyEditButtonStr: "编辑",
addType: "1", //1:2.3.
editTye: 1,
checkFlag: {
0: "未认证",
1: "已确认",
2: "已拒绝",
3: "变更未确认",
6: "未确认",
},
checkSupFlag: {
0: "未认证",
1: "通过",
2: "已拒绝",
3: "待审核",
},
statusFlag: {
0: "有效",
1: "失效",
},
formName: 1,
formMap: {
1: "新增本企业资质证书",
2: "编辑本企业资质证书",
},
selectCertVisible: false,
};
},
created() {
this.mobile=this.$route.query.mobile;
this.inputQuery.mobile=this.$route.query.mobile;
this.getInfo();
this.getCert();
},
components: { companyAddCert,ElImageViewer
},
methods: {
onModifySubmit(val){
let mess ="";
if(this.$isNotBlank(val)){
mess='审核提交';
}else{
mess='草稿保存'
}
this.$confirm("是否"+mess, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(()=>{
this.inputQuery.upId=this.upId;
this.inputQuery.urId=this.urId;
this.inputQuery.ucId=this.ucId;
this.inputQuery.list=this.certList;
if(this.$isNotBlank(val)){
this.inputQuery.key=val;
}
saveAllInfo(this.inputQuery)
.then((res)=>{
if(res.code = 20000){
this.$message.success("提交成功");
this.getInfo();
}
})
})
},
deleteCompanyCert(row){
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(()=>{
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCert(tquery).then((res)=>{
this.certLoading = false;
if (res.code === 20000) {
this.$message({
type: "success",
message: "删除成功!",
});
this. getCert();
}else{
this.$message.error(res.message);
}
}).catch(()=>{
this.certLoading = false;
})
}).catch(()=>{
})
},
getInfo(){
debugger
let param ={
mobile :this.mobile
}
insertInitial(param)
.then((res)=>{
if(!isBlank(res.data['registComPerResponse'])){
debugger
this.inputQuery =res.data['registComPerResponse'];
// this.upId=res.data['registComPerResponse'].upId;
this.urId=res.data['registComPerResponse'].id;
this.ucId=res.data['registComPerResponse'].ucId;
}else{
// this.upId=res.data['upId'];
this.urId=res.data['urId'];
this.ucId=res.data['ucId'];
}
})
},
getCert(){
this.query.businessId=this.ucId;
filterCompanyCert( this.query)
.then((res)=>{
if(res.code == 20000){
this.certList= res.data.list || [];
this.certTotal = res.data.total;
}
})
},
certHandleCurrentChange(val){
this.query.page = val.page;
this.getCert();
},
addCert(row){
if (this.$isNotBlank(row)) {
this.formName = 2;
this.inputQuery.formData = row;
this.editTye = 2;
}else{
this.formName = 1;
this.inputQuery.formData = {};
this.editTye = 1;
}
this.addCertVisible = true;
},
closeLocalDialog() {
this.addCertVisible = false;
this.getCert();
},
closeLocal() {
this.addCertVisible = false;
},
showImgViewer(row){
this.certFileUrl =
this.BASE_URL +
"/udiwms/image/register/file/getImage?type=image2&name=";
this.imgList = [];
previewImage({
imageUrl: row.filePath,
certFileUrl: this.certFileUrl,
}).then((response) => {
if (response.code === 20000) {
this.imgList = response.data;
}
console.log(this.imgList);
this.imgViewerVisible = true;
});
const m = (e) => {
e.preventDefault();
};
document.body.style.overflow = "hidden";
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() {
this.imgViewerVisible = false;
const m = (e) => {
e.preventDefault();
};
document.body.style.overflow = "auto";
document.removeEventListener("touchmove", m, true);
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
3: "warning",
};
return statusMap[status];
},
statusType(status) {
const statusMap = {
0: "success",
1: "danger",
};
return statusMap[status];
},
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*width: 50%;*/
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
margin: auto;
}
</style>

@ -7,63 +7,57 @@
<el-form
class="card-box login-form"
autocomplete="on"
:model="ruleForm"
:model="inputQuery"
:rules="rules"
ref="ruleForm"
ref="inputQuery"
label-position="left"
>
<el-card class="box-card">
<div style="text-align: center; margin-top: 10px">
<img alt="element-logo" src="@/assets/logo/logo.png" />
</div>
<h3 class="title">用户登录</h3>
<el-form-item prop="username" class="item" style="margin-top: -20px">
<h3 class="title">用户注册</h3>
<el-form-item prop="mobile" class="item" style="margin-top: -20px">
<el-input
placeholder="账号"
name="username"
autocomplete="on"
v-model="loginForm.username"
size="small"
placeholder="请输入手机号"
v-model="inputQuery.mobile"
@input="change()"
></el-input>
<el-button
type="primary"
size="small"
icon="search"
:disabled="isTimer"
style="margin-top: 0.5px"
@click="getCheckCode"
>
<i slot="prefix" class="el-input__icon">
<icon-svg icon-class="user" />
</i>
</el-input>
<span>{{ btnTitle }}</span>
</el-button>
</el-form-item>
<el-form-item prop="password" class="item">
<el-input
placeholder="密码"
name="password"
:type="isShowPwd ? 'text' : 'password'"
@keyup.enter.native="handleLogin"
v-model="loginForm.password"
autocomplete="on"
>
<i slot="prefix" class="el-input__icon">
<icon-svg icon-class="pwd" />
</i>
<i
slot="suffix"
class="el-input__icon"
@click="isShowPwd = !isShowPwd"
>
<icon-svg icon-class="eye" />
</i>
</el-input>
size="small"
placeholder="请输入手机验证码"
v-model="inputQuery.checkCode"
@input="change()"
></el-input>
</el-form-item>
<el-form-item
prop="verificationCode"
class="item"
style="background-color: white"
>
<Verify
ref="checkV"
:showButton="false"
:barSize="{ width: '305px', height: '37px' }"
:vOffset="5"
@success="verifyAlert('success')"
@error="verifyAlert('error')"
:type="3"
></Verify>
<!--<Verify-->
<!-- ref="checkV"-->
<!-- :showButton="false"-->
<!-- :barSize="{ width: '305px', height: '37px' }"-->
<!-- :vOffset="5"-->
<!-- @success="verifyAlert('success')"-->
<!-- @error="verifyAlert('error')"-->
<!-- :type="3"-->
<!--&gt;</Verify>-->
</el-form-item>
<div style="text-align: center; margin-top: 15px">
<el-button
@ -71,9 +65,9 @@
style="width: 60%; margin-bottom: 30px"
:loading="loading"
@click.native="handleLogin()"
>登录
>登录/注册
</el-button>
</div>
</el-card>
</el-form>
@ -98,162 +92,91 @@ import Verify from "vue2-verify";
import axios from "axios";
import Cookies from "js-cookie";
import { decrypt, encrypt } from "@/utils/jsencrypt";
import {checkCode,getCheckcode} from "@/api/login";
export default {
data() {
let validatePwd = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
//
const validatePhone = (rule, value, callback) => {
if (/^1[3-9]\d{9}$/.test(value) === false) {
callback(new Error("请输入正确的电话号码"));
} else {
//
callback();
}
};
return {
ruleForm: {
userName: "",
pwd: "",
checked: true,
verificationCode: false,
},
loginForm: {
username: "",
password: "",
rememberMe: false,
verificationCode: false,
code: "",
uuid: "",
inputQuery :{
mobile : "",
checkCode : "",
},
rules: {
userName: [
{ required: true, message: "请输入登录名", trigger: "blur" },
tel: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
// { pattern:/^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/, message: "", trigger: "blur" }
],
checkCode: [
{ required: true, message: "请输入手机验证码", trigger: "blur" },
],
pwd: [{ validator: validatePwd, trigger: "blur" }],
},
isShowPwd: false, //
loading: false, // loading
showDialog: false, // dialog
redirect: null, //
hospName: "",
isTimer: false,
btnTitle: "获取验证码",
};
},
methods: {
verifyAlert(text) {
if (text === "success") {
this.loginForm.verificationCode = true;
}
handleLogin(){
checkCode(this.inputQuery).then( (res) => {
if(res.code == 20000 ){
//
this.$router.push({path: "/improveInfo",query:{mobile:res.data}});
}else{
this.$message.error(res.message);
}
})
},
// handleLogin() {
// if (!this.ruleForm.verificationCode) {
// this.$message({
// message: '',
// center: true,
// type: 'warning'
// });
// return;
// }
// this.$refs["ruleForm"].validate((valid) => {
// if (valid) {
// this.loading = true;
// this.$store
// .dispatch("loginName", this.ruleForm)
// .then((response) => {
// this.loading = false;
// if (response.code !== 20000) {
// console.log("--code = " + response.code);
// this.ruleForm.verificationCode = false;
// this.$refs.checkV.refresh();
// this.$message.error(response.message);
// return;
// }
// let path = "/";
// if (this.redirect) {
// path = this.redirect;
// }
// console.log("path = " + path);
// this.$router.push({
// path: "../main",
// });
// // window.location.replace(path);
// // this.showDialog = true
// })
// .catch(() => {
// this.ruleForm.verificationCode = false;
// this.$refs.checkV.refresh();
// this.loading = false;
// });
// } else {
// return false;
// }
// });
// },
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
// const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password:
password === undefined ? this.loginForm.password : decrypt(password),
// rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
getCheckCode() {
let tquery = {
mobile: this.inputQuery.mobile,
};
},
handleLogin() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.loginForm.verificationCode) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
// Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
} else {
Cookies.remove("username");
Cookies.remove("password");
// Cookies.remove('rememberMe');
}
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
this.$router
.push({ path: this.redirect || "/" })
.catch((res) => {});
})
.catch((res) => {
this.loading = false;
this.$message.error(res);
if (this.captchaEnabled) {
this.getCode();
}
});
} else {
this.$message({
message: "请向右滑动完成验证",
type: "warning",
});
}
getCheckcode(tquery).then((response) => {
if (response.code === 20000) {
this.validateBtn();
} else {
this.$message.error(response.message);
}
});
},
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);
},
},
components: {
Verify,
},
created() {
//
let query = this.$route.query;
if (query.redirect) {
// URL Encode
this.redirect = decodeURIComponent(query.redirect);
}
axios.get("./config.json").then((res) => {
this.hospName = res.data.hosp_name;
});
this.getCookie();
},
};
</script>

@ -0,0 +1,386 @@
<template>
<div class="login-container">
<div class="textTitle">
<h3 class="toptitle">UDI协调平台</h3>
<h3 class="topSubtitle">UDI监管系统</h3>
</div>
<el-form
class="card-box login-form"
autocomplete="on"
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-position="left"
>
<el-card class="box-card">
<div style="text-align: center; margin-top: 10px">
<img alt="element-logo" src="@/assets/logo/logo.png" />
</div>
<h3 class="title">用户登录</h3>
<el-form-item prop="username" class="item" style="margin-top: -20px">
<el-input
placeholder="账号"
name="username"
autocomplete="on"
v-model="loginForm.username"
>
<i slot="prefix" class="el-input__icon">
<icon-svg icon-class="user" />
</i>
</el-input>
</el-form-item>
<el-form-item prop="password" class="item">
<el-input
placeholder="密码"
name="password"
:type="isShowPwd ? 'text' : 'password'"
@keyup.enter.native="handleLogin"
v-model="loginForm.password"
autocomplete="on"
>
<i slot="prefix" class="el-input__icon">
<icon-svg icon-class="pwd" />
</i>
<i
slot="suffix"
class="el-input__icon"
@click="isShowPwd = !isShowPwd"
>
<icon-svg icon-class="eye" />
</i>
</el-input>
</el-form-item>
<el-form-item
prop="verificationCode"
class="item"
style="background-color: white"
>
<Verify
ref="checkV"
:showButton="false"
:barSize="{ width: '305px', height: '37px' }"
:vOffset="5"
@success="verifyAlert('success')"
@error="verifyAlert('error')"
:type="3"
></Verify>
</el-form-item>
<div style="text-align: center; margin-top: 15px">
<el-button
type="primary"
style="width: 60%; margin-bottom: 30px"
:loading="loading"
@click.native="handleLogin()"
>登录
</el-button>
</div>
</el-card>
</el-form>
<div
style="
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%, -50%);
font-size: 12px;
color: white;
"
>
开发单位厦门高立新鹏软件科技有限公司 技术支持13459286066
</div>
</div>
</template>
<script>
import Verify from "vue2-verify";
import axios from "axios";
import Cookies from "js-cookie";
import { decrypt, encrypt } from "@/utils/jsencrypt";
export default {
data() {
let validatePwd = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
callback();
}
};
return {
ruleForm: {
userName: "",
pwd: "",
checked: true,
verificationCode: false,
},
loginForm: {
username: "",
password: "",
rememberMe: false,
verificationCode: false,
code: "",
uuid: "",
},
rules: {
userName: [
{ required: true, message: "请输入登录名", trigger: "blur" },
],
pwd: [{ validator: validatePwd, trigger: "blur" }],
},
isShowPwd: false, //
loading: false, // loading
showDialog: false, // dialog
redirect: null, //
hospName: "",
};
},
methods: {
verifyAlert(text) {
if (text === "success") {
this.loginForm.verificationCode = true;
}
},
// handleLogin() {
// if (!this.ruleForm.verificationCode) {
// this.$message({
// message: '',
// center: true,
// type: 'warning'
// });
// return;
// }
// this.$refs["ruleForm"].validate((valid) => {
// if (valid) {
// this.loading = true;
// this.$store
// .dispatch("loginName", this.ruleForm)
// .then((response) => {
// this.loading = false;
// if (response.code !== 20000) {
// console.log("--code = " + response.code);
// this.ruleForm.verificationCode = false;
// this.$refs.checkV.refresh();
// this.$message.error(response.message);
// return;
// }
// let path = "/";
// if (this.redirect) {
// path = this.redirect;
// }
// console.log("path = " + path);
// this.$router.push({
// path: "../main",
// });
// // window.location.replace(path);
// // this.showDialog = true
// })
// .catch(() => {
// this.ruleForm.verificationCode = false;
// this.$refs.checkV.refresh();
// this.loading = false;
// });
// } else {
// return false;
// }
// });
// },
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
// const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password:
password === undefined ? this.loginForm.password : decrypt(password),
// rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
},
handleLogin() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.loginForm.verificationCode) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
// Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
} else {
Cookies.remove("username");
Cookies.remove("password");
// Cookies.remove('rememberMe');
}
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
this.$router
.push({ path: this.redirect || "/" })
.catch((res) => {});
})
.catch((res) => {
this.loading = false;
this.$message.error(res);
if (this.captchaEnabled) {
this.getCode();
}
});
} else {
this.$message({
message: "请向右滑动完成验证",
type: "warning",
});
}
}
});
},
},
components: {
Verify,
},
created() {
//
let query = this.$route.query;
if (query.redirect) {
// URL Encode
this.redirect = decodeURIComponent(query.redirect);
}
axios.get("./config.json").then((res) => {
this.hospName = res.data.hosp_name;
});
this.getCookie();
},
};
</script>
<style type="text/scss" lang="scss">
@import "../assets/styles/mixin";
$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.login-container {
@include relative;
background-color: white;
background-image: url("../assets/login.jpg");
background-size: 100vw 100vh;
height: 100%;
overflow: hidden;
display: flex;
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-transition-delay: 99999s;
-webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
}
.item {
width: 20em;
margin-left: 5em;
.el-form-item__content {
display: flex;
flex-flow: row;
}
}
input {
background: transparent;
border: 0;
-webkit-appearance: none;
border-radius: 0;
padding: 0.46rem 0.0666rem 0.16rem 0.2rem;
color: $dark_gray;
height: 100%;
}
.el-input {
display: inline-block;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 0.13333rem;
}
.svg-container {
padding: 0.08rem 0.0666rem 0.08rem 0.2rem;
color: $dark_gray;
vertical-align: middle;
display: inline-block;
&_login {
font-size: 20px;
}
}
.title {
font-size: 26px;
color: #2d3a4b;
margin: 0 auto 0.5333rem auto;
text-align: center;
font-weight: bold;
margin-bottom: 50px;
}
.textTitle {
width: 50%;
font-size: 45px;
}
.toptitle {
color: #ffffff;
text-align: center;
margin-top: 132px;
margin-bottom: -10px;
}
.topSubtitle {
color: #fcd38b;
text-align: center;
}
.login-form {
//@include fxied-center;
margin: 0px 100px auto auto;
width: 50em;
/*background-color: silver;*/
/*background: #fff;*/
padding: 10em 10em 15em 10em;
}
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.1);
border-radius: 0.0666rem;
color: #454545;
}
.show-pwd {
position: absolute;
right: 0.1333rem;
top: 0.09333rem;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
}
.thirdparty-button {
/*position: absolute;*/
/*right: .4666rem;*/
/*bottom: .37333rem;*/
}
.box-card {
margin-top: -20px;
height: 550px;
width: 490px;
}
}
</style>

@ -0,0 +1,353 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-card style="margin-top: -30px">
<el-button-group style="display: flex">
<el-button type="primary" @click.native="submitUpload()" style="margin: 0 60px 10px auto; height: 35px"
:loading="loading">提交
</el-button>
</el-button-group>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>证书名称</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="name">
<el-input v-model="formData.name" auto-complete="off" :disabled="formData.auditStatus == 1"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>证书编号</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="code">
<el-input v-model="formData.code" auto-complete="off" :disabled="formData.auditStatus == 1"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>起始日期</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="vailDate">
<el-date-picker
v-model="formData.vailDate"
type="date"
:disabled="formData.auditStatus == 1"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择生效期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>有效期</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="expireDate">
<el-date-picker
v-model="formData.expireDate"
type="date"
:disabled="formData.auditStatus == 1"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择失效期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>证书状态</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="remark">
<el-select
size="small"
v-model="formData.status"
placeholder="证书状态"
style="width: 100%"
>
<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="3">
<div class="ao-text">
<span>备注</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="remark">
<el-input v-model="formData.remark" auto-complete="off" type="textarea" autosize></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>证书照片</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item>
<el-upload
class="upload-demo"
ref="upload"
:action="this.uploadUrl"
:on-preview="uploadHandlePreview"
:on-remove="uploadHandleRemove"
:headers="headers"
:on-exceed="uploadHandleExceed"
accept=".jpg,.png"
:on-change="uploadOnchange"
:on-success="uploadHandleSuccess"
:on-error="uploadHandleError"
:file-list="fileList"
:data="{type:'image2'}"
:auto-upload="true">
<el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1">
{{ choiceFile }}
</el-button>
<div>只能上传 jpg,png 文件且不超过 3 MB</div>
</el-upload>
<!-- <el-button type="primary" size="mini" icon="search" @click="toViewCompanyCert"-->
<!-- style="text-align:right"-->
<!-- >文件预览-->
<!-- </el-button-->
<!-- >-->
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</div>
</template>
<script>
import {isertCert, filterCompanyCert, updateCert} from "@/api/sup/userCert";
import store from "../../../store";
export default {
name: "supCompanyCertAdd",
props: {
closeDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editTye: {
type: Object,//1:2
required: true,
},
ucId: {
type: Object,
required: true,
},
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
code: "",
isCleck:false,
formData: {
vailDate: null,
expireDate: null,
remark: null,
checkComment:null,
code: null,
name: null,
manufacturerIdFk: null,
status: null,
},
formRules: {
name: [
{required: true, message: "请输入证书名称", trigger: "blur"}
],
code: [
{required: true, message: "请输入证书编号", trigger: "blur"}
],
},
loading: false,
uploadUrl: "",
fileList: [],
headers: {},
choiceFile: "选取文件",
};
},
components: {
},
methods: {
uploadHandlePreview(file) {
console.log(file);
console.log(this.fileList);
},
uploadHandleRemove(file, fileList) {
this.formData.filePath="";
for (var i=0;i<fileList.length;i++){
this.formData.filePath+=fileList[i].response.data.name+",";
}
},
uploadHandleExceed(files, fileList) {
},
uploadOnchange(file, fileList) {
let fileName = file.name;
let uid = file.uid
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png" && lastName.toLowerCase() !== ".doc") {
this.$message.error("上传文件只能是 jpg,png格式");
for (let i = 0; i < fileList.length; i++) {//list
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
return;
}
//
const isLt = file.size / 1024 / 1024 / 3 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 3MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
}
return isLt;
},
uploadHandleSuccess(response, file, fileList) {
if (response.code === 20000) {
if(this.formData.filePath==null || this.isCleck==true){
this.formData.filePath=response.data.name+",";
this.isCleck=false;
}else{
this.formData.filePath+=response.data.name+",";
}
} else {
this.$message.error("文件上传失败:" + response.message);
}
},
uploadHandleError() {
},
submitUpload(){
debugger
if(this.editTye == 1){
this.onConfirmSubmit();
}else{
this.updateCert();
}
},
onConfirmSubmit() {
this.formData.businessId=this.ucId;
isertCert(this.formData).then( (res)=>{
if(res.code == 20000){
this.$message.success("添加成功!")
this.closeDialog();
}
})
},
updateCert(){
updateCert(this.formData).then((res)=>{
if(res.code == 20000){
debugger
this.$message.success("修改成功!")
this.closeDialog();
}
})
},
},
filters: {},
mounted() {
},
created() {
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
if (this.inputQuery.formData == null) {
this.formData = {};
}else {
this.formData = this.inputQuery.formData;
}
if (this.formData.filePath != null) {
this.choiceFile = "更换文件";
this.isCleck=true;
} else {
this.choiceFile = "选取文件";
}
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>
Loading…
Cancel
Save