+
+
+
{{ title }}
+
{{ subTitle }}
+
高效、安全的进销存管理系统
-
用户登录
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
+
+
+ 确认
-
-
-
@@ -145,57 +120,60 @@
import Verify from "vue2-verify";
import axios from "axios";
import Cookies from "js-cookie";
-import {decrypt, encrypt} from "@/utils/jsencrypt";
import {getTitleConfig} from "@/api/login";
import {forceModifyPasswd, modifyPasswd} from "@/api/auth/authAdmin";
export default {
data() {
- let validatePwd = (rule, value, callback) => {
- if (value === "") {
- callback(new Error("请输入密码"));
+ const validatePass2 = (rule, value, callback) => {
+ if (value === '') {
+ callback(new Error('请再次输入密码'));
+ } else if (value !== this.passwordFormData.newPassword) {
+ callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
+
return {
- ruleForm: {
- userName: "",
- pwd: "",
- checked: true,
- verificationCode: false,
- },
+ title: "",
+ subTitle: "",
+ hospName: "",
loginForm: {
username: "",
password: "",
- rememberMe: false,
- verificationCode: false,
- code: "",
- uuid: "",
},
rules: {
- userName: [
- {required: true, message: "请输入登录名", trigger: "blur"},
- ],
- pwd: [{validator: validatePwd, trigger: "blur"}],
+ username: [{ required: true, message: "请输入账号", trigger: "blur" }],
+ password: [{ required: true, message: "请输入密码", trigger: "blur" }],
},
- isShowPwd: false, // 是否显示密码
- loading: false, // 登录loading
- showDialog: false, // 显示dialog
- redirect: null, // 回调地址
- hospName: "",
- title: "福建省XXX医院",
- subTitle: "医院UDI管理系统",
+ loading: false,
+ isShowPwd: false,
+ redirect: undefined,
passwordFormVisible: false,
passwordFormData: {
oldPassword: "",
newPassword: "",
confirmPassword: "",
+ token: "",
},
+ passwordFormDataRules: {
+ oldPassword: [
+ { required: true, message: "请输入旧密码", trigger: "blur" },
+ ],
+ newPassword: [
+ { required: true, message: "请输入新密码", trigger: "blur" },
+ { min: 6, message: "密码长度不能小于6位", trigger: "blur" },
+ ],
+ confirmPassword: [
+ { required: true, message: "请确认密码", trigger: "blur" },
+ { validator: validatePass2, trigger: "blur" }
+ ],
+ },
+ otherQuery: {},
};
},
methods: {
- // 滑块验证
verifyAlert(text) {
if (text === "success") {
this.loginForm.verificationCode = true;
@@ -203,152 +181,87 @@ export default {
this.loginForm.verificationCode = false;
}
},
- /* // 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)
- };
+ if (username && password) {
+ this.loginForm.username = username;
+ this.loginForm.password = password;
+ }
},
handleLogin() {
- this.$refs.ruleForm.validate((valid) => {
+ if (!this.loginForm.verificationCode) {
+ this.$message({
+ message: "请完成滑块验证",
+ type: "warning",
+ center: true,
+ });
+ return;
+ }
+
+ this.$refs.loginForm.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,
- });
- } else {
- Cookies.remove("username");
- Cookies.remove("password");
- }
- this.$store
- .dispatch("Login", this.loginForm)
- .then((res) => {
- if (res.data.needChangePwd == true) {
- this.$confirm('系统检测到您的密码长时间未修改,为保证您的账号安全建议立即修改密码?', '提示', {
- confirmButtonText: '立即修改',
- cancelButtonText: '忽略',
- type: 'warning'
- }).then(() => {
- this.passwordFormVisible = true;
- this.passwordFormData = {
- oldPassword: "",
- newPassword: "",
- confirmPassword: "",
- };
- }).catch(() => {
- this.$router
- .push({path: this.redirect || "/"})
- .catch((res) => {
- });
- });
-
+ this.loading = true;
+ this.$store
+ .dispatch("Login", this.loginForm)
+ .then((res) => {
+ this.loading = false;
+ if (res.code === 20000) {
+ if (res.data.needModifyPassword) {
+ this.passwordFormVisible = true;
+ this.passwordFormData.token = res.data.token;
} else {
- this.$router
- .push({path: this.redirect || "/"})
- .catch((res) => {
- });
- }
- })
- .catch((res) => {
- this.loading = false;
- this.$message.error(res);
- if (this.captchaEnabled) {
- this.getCode();
+ this.$router.push({path: this.redirect || "/"});
}
- });
- } else {
- this.$message({
- message: "请向右滑动完成验证",
- type: "warning",
+ } else {
+ this.$message.error(res.msg);
+ this.$refs.checkV.refresh();
+ }
+ })
+ .catch(() => {
+ this.loading = false;
+ this.$refs.checkV.refresh();
});
- }
+ } else {
+ return false;
}
});
},
getTitleConfig() {
- getTitleConfig().then(res => {
- this.title = res.data.title;
- this.subTitle = res.data.subTitle;
+ getTitleConfig().then((response) => {
+ this.title = response.data.title;
+ this.subTitle = response.data.subTitle;
});
},
passwdSubmit() {
- if (this.passwordFormData.newPassword != this.passwordFormData.confirmPassword) {
- this.$message.error("新密码与确认密码不一致!!!!");
- return
- }
- if (this.passwordFormData.passWord == this.passwordFormData.newPassword) {
- this.$message.error("旧密码与新密码不能相同!!!!");
- return
- }
- this.loading = true;
- forceModifyPasswd(this.passwordFormData).then((response) => {
- if (response.code === 20000) {
- this.loading = false;
- this.$confirm('密码重置成功,请点击确定重新登录', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.$store.dispatch('LogOut').then(() => {
- location.href = process.env.VUE_APP_CONTEXT_PATH;
- })
- }).catch(() => {
+ this.$refs.passwordFormData.validate((valid) => {
+ if (!valid) {
+ return false;
+ }
+
+ const data = {
+ oldPassword: this.passwordFormData.oldPassword,
+ newPassword: this.passwordFormData.newPassword,
+ };
+
+ if (this.passwordFormData.token) {
+ data.token = this.passwordFormData.token;
+ forceModifyPasswd(data).then((response) => {
+ if (response.code === 200) {
+ this.passwordFormVisible = false;
+ this.$router.push({path: this.redirect || "/"});
+ } else {
+ this.$message.error(response.message);
+ }
});
} else {
- this.$message.error(response.message);
+ modifyPasswd(data).then((response) => {
+ if (response.code === 200) {
+ this.passwordFormVisible = false;
+ } else {
+ this.$message.error(response.message);
+ }
+ });
}
});
},
@@ -373,129 +286,231 @@ export default {
};
-
diff --git a/src/views/purchase/purApply/modernPurApply.vue b/src/views/purchase/purApply/modernPurApply.vue
new file mode 100644
index 0000000..6ab74cf
--- /dev/null
+++ b/src/views/purchase/purApply/modernPurApply.vue
@@ -0,0 +1,423 @@
+
+
+
+
+ 采购申请列表
+ {{ showSearch ? '隐藏搜索' : '显示搜索' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+ 新增单据
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.billDate, '{y}-{m}-{d}') }}
+
+
+
+
+
+
+
+
+
+ {{ statusMap[scope.row.status] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 申购明细
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+