修正部分Bug

This commit is contained in:
2025-07-24 16:51:31 +08:00
parent f41444f3f6
commit aab2bc1074
3 changed files with 274 additions and 289 deletions

View File

@@ -1,11 +1,8 @@
<template> <template>
<div class="login-container"> <div class="login-container">
<div class="login-form"> <div class="login-form">
<div class="title-container"> <div class="title-container">
<h3 class="title"> <h3 class="title">供应商验证</h3>
供应商验证
</h3>
<div class="desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div> <div class="desc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
</div> </div>
@@ -16,24 +13,20 @@
<!-- <span class="svg-container"> <!-- <span class="svg-container">
<i class="el-icon-edit"></i> <i class="el-icon-edit"></i>
</span> --> </span> -->
<el-input ref="Username" v-model="loginForm.Username" placeholder="供应商名称" name="Username" type="text" <el-input ref="Username" v-model="loginForm.Username" placeholder="供应商名称" name="Username" type="text" tabindex="2" autocomplete="on" style="width: 85%" />
tabindex="2" autocomplete="on" style="width: 85%" />
</el-form-item> </el-form-item>
<el-tooltip content="Caps lock is On" placement="right" manual> <el-tooltip content="Caps lock is On" placement="right" manual>
<el-form-item prop="Password"> <el-form-item prop="Password">
<!-- <span class="svg-container"> <!-- <span class="svg-container">
<i class="el-icon-edit"></i>ss <i class="el-icon-edit"></i>ss
</span> --> </span> -->
<el-input key="passwordType" ref="Password" v-model="loginForm.Password" placeholder="供应商编码" <el-input key="passwordType" ref="Password" v-model="loginForm.Password" placeholder="供应商编码" name="Password" tabindex="3" autocomplete="on" style="width: 85%" />
name="Password" tabindex="3" autocomplete="on" style="width: 85%" />
</el-form-item> </el-form-item>
</el-tooltip> </el-tooltip>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<div> <div>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:50px;" @click="loginSubmit()"> <el-button :loading="loading" type="primary" style="width: 100%; margin-bottom: 50px" @click="loginSubmit()"> 登录 </el-button>
登录
</el-button>
</div> </div>
</el-tabs> </el-tabs>
@@ -50,22 +43,21 @@
</template> </template>
<script> <script>
import { login } from "@/api/login";
import { loginls } from "@/api/login";
import * as auth from "@/utils/auth.js";
import { getToken } from "@/utils/auth.js";
import axios from "axios";
import { login } from "@/api/login"; export default {
import { loginls } from "@/api/login"; name: "Login",
import * as auth from "@/utils/auth.js"
import { getToken } from "@/utils/auth.js";
import axios from "axios";
export default {
name: 'Login',
data() { data() {
return { return {
loading: false, loading: false,
activeName: 'first', activeName: "first",
loginType: false, loginType: false,
FBILLNO: '', FBILLNO: "",
LS: '', LS: "",
loginForm: { loginForm: {
Username: "", Username: "",
Password: "", Password: "",
@@ -80,52 +72,48 @@ export default {
OrderString: "", OrderString: "",
TopRowCount: "0", TopRowCount: "0",
StartRow: "0", StartRow: "0",
Limit: 100 Limit: 100,
}
}
}, },
watch: { };
}, },
watch: {},
created() { created() {
this.FBILLNO = this.$route.query.FBILLNO this.FBILLNO = this.$route.query.FBILLNO;
this.LS = this.$route.query.LS this.LS = this.$route.query.LS;
if (this.$route.query.FBILLNO !== undefined) { if (this.$route.query.FBILLNO !== undefined) {
this.loginType = true; this.loginType = true;
} }
}, },
mounted() { mounted() {},
destroyed() {},
},
destroyed() {
},
methods: { methods: {
handleWarning(response) { handleWarning(response) {
this.$message({ this.$message({
message: response.message || response, message: response.message || response,
type: 'warning', type: "warning",
duration: 2000 duration: 2000,
}) });
}, },
handleSuccess(response) { handleSuccess(response) {
this.$message({ this.$message({
message: response.message || response, message: response.message || response,
type: 'success', type: "success",
duration: 2000 duration: 2000,
}) });
}, },
loginSubmit() { loginSubmit() {
if(!this.loginType) return if (!this.loginType) return;
let this_ = this console.log(this.loginType);
if (this.LS === '0') { console.log(this.LS);
this.$refs.loginForm.validate(valid => {
let this_ = this;
if (this.LS === "0") {
this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
let FilterString = "FBILLNO like'%" + this.FBILLNO + "'"; let FilterString = "FBILLNO like'%" + this.FBILLNO + "'";
this.data.FilterString = FilterString; this.data.FilterString = FilterString;
let query = {} let query = {};
query.FBILLNO = this.FBILLNO; query.FBILLNO = this.FBILLNO;
query.Username = this.loginForm.Username; query.Username = this.loginForm.Username;
loginls(query).then((response) => { loginls(query).then((response) => {
@@ -134,19 +122,18 @@ export default {
path: "/master?FBILLNO=" + this_.FBILLNO + "&username=" + this_.loginForm.Username + "&password=" + this_.loginForm.Password, path: "/master?FBILLNO=" + this_.FBILLNO + "&username=" + this_.loginForm.Username + "&password=" + this_.loginForm.Password,
}); });
} else { } else {
this.handleWarning("登录失败,请联系管理员") this.handleWarning("登录失败,请联系管理员");
} }
}); });
} }
}) });
} }
if (this.LS === '1') { if (this.LS === "1") {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
let FilterString = "FBILLNO like'%" + this.FBILLNO + "'"; let FilterString = "FBILLNO like'%" + this.FBILLNO + "'";
this.data.FilterString = FilterString; this.data.FilterString = FilterString;
let query = {} let query = {};
query.FBILLNO = this.FBILLNO; query.FBILLNO = this.FBILLNO;
query.Username = this.loginForm.Username; query.Username = this.loginForm.Username;
query.Password = this.loginForm.Password; query.Password = this.loginForm.Password;
@@ -156,32 +143,30 @@ export default {
path: "/master?FBILLNO=" + this_.FBILLNO + "&username=" + this_.loginForm.Username + "&password=" + this_.loginForm.Password, path: "/master?FBILLNO=" + this_.FBILLNO + "&username=" + this_.loginForm.Username + "&password=" + this_.loginForm.Password,
}); });
} else { } else {
this.handleWarning("登录失败,请联系管理员") this.handleWarning("登录失败,请联系管理员");
} }
}); });
} }
}) });
} }
}, },
},
} };
}
</script> </script>
<style lang="scss"> <style lang="scss">
$bg: #283443; $bg: #283443;
$light_gray: #fff; $light_gray: #fff;
$cursor: #fff; $cursor: #fff;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) { @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input { .login-container .el-input input {
color: $cursor; color: $cursor;
} }
} }
/* reset element-ui css */ /* reset element-ui css */
.login-container { .login-container {
.el-input { .el-input {
display: inline-block; display: inline-block;
height: 47px; height: 47px;
@@ -210,23 +195,23 @@ $cursor: #fff;
border-radius: 5px; border-radius: 5px;
color: #454545; color: #454545;
} }
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
$bg: #2d3a4b; $bg: #2d3a4b;
$dark_gray: #889aa4; $dark_gray: #889aa4;
$light_gray: #eee; $light_gray: #eee;
::v-deep .el-tabs__item { ::v-deep .el-tabs__item {
color: white; color: white;
} }
::v-deep .el-tabs__item.is-active { ::v-deep .el-tabs__item.is-active {
color: #1890ff; color: #1890ff;
} }
.login-container { .login-container {
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
background-color: $bg; background-color: $bg;
@@ -298,9 +283,9 @@ $light_gray: #eee;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
} }
} }
.globalFooter { .globalFooter {
margin: 48px 0 24px 0; margin: 48px 0 24px 0;
padding: 0 16px; padding: 0 16px;
text-align: center; text-align: center;
@@ -313,9 +298,9 @@ $light_gray: #eee;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
font-size: 14px; font-size: 14px;
} }
} }
.forgotregister { .forgotregister {
text-align: right; text-align: right;
font-size: 14px; font-size: 14px;
color: white; color: white;
@@ -323,5 +308,5 @@ $light_gray: #eee;
.register { .register {
float: right; float: right;
} }
} }
</style> </style>

View File

@@ -2,13 +2,13 @@ const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true, transpileDependencies: true,
}); });
const port=1573; const port = 1573;
module.exports = { module.exports = {
devServer: { devServer: {
port:port, port: port,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:10002', // 后端接口的地址 target: 'http://127.0.0.1:10002', // 后端接口的地址
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '', // 如果您的后端API路径不包含'/api',可以删除这一行 '^/api': '', // 如果您的后端API路径不包含'/api',可以删除这一行