基础表建立
This commit is contained in:
parent
c5aa2a9bd6
commit
ffc0a36c63
Binary file not shown.
|
After Width: | Height: | Size: 813 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
|
|
@ -1,15 +1,17 @@
|
|||
<template>
|
||||
<div class="login-container">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
||||
<div class="login">
|
||||
<div class="login-form">
|
||||
|
||||
<div class="title-container">
|
||||
<h3 class="title">系统登陆</h3>
|
||||
</div>
|
||||
<h3 class="title">航玻生产管理系统</h3>
|
||||
<el-tabs v-model="activeName" :stretch="true">
|
||||
|
||||
<el-tab-pane label="账号密码登录">
|
||||
<el-form
|
||||
ref="loginForm"
|
||||
:model="loginForm"
|
||||
:rules="loginRules"
|
||||
>
|
||||
<el-form-item prop="username">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="user" />
|
||||
</span>
|
||||
<el-input
|
||||
ref="username"
|
||||
v-model="loginForm.username"
|
||||
|
|
@ -18,13 +20,14 @@
|
|||
type="text"
|
||||
tabindex="1"
|
||||
auto-complete="on"
|
||||
/>
|
||||
><svg-icon
|
||||
slot="prefix"
|
||||
icon-class="user"
|
||||
class="el-input__icon input-icon"
|
||||
/></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="password">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="password" />
|
||||
</span>
|
||||
<el-input
|
||||
:key="passwordType"
|
||||
ref="password"
|
||||
|
|
@ -35,28 +38,35 @@
|
|||
tabindex="2"
|
||||
auto-complete="on"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
><svg-icon
|
||||
slot="prefix"
|
||||
icon-class="password"
|
||||
class="el-input__icon input-icon"
|
||||
/></el-input>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
||||
<svg-icon
|
||||
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
|
||||
/>
|
||||
</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登陆</el-button>
|
||||
|
||||
<!-- <div class="tips">
|
||||
<span style="margin-right:20px;">username: admin</span>
|
||||
<span> password: any</span>
|
||||
</div> -->
|
||||
|
||||
<el-button
|
||||
:loading="loading"
|
||||
type="primary"
|
||||
style="width: 100%; margin-bottom: 30px"
|
||||
@click.native.prevent="handleLogin"
|
||||
>登录</el-button
|
||||
>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { validUsername } from '@/utils/validate'
|
||||
|
||||
export default {
|
||||
name: 'Login',
|
||||
name: "Login",
|
||||
data() {
|
||||
// const validateUsername = (rule, value, callback) => {
|
||||
// if (!validUsername(value)) {
|
||||
|
|
@ -67,171 +77,156 @@ export default {
|
|||
// }
|
||||
const validatePassword = (rule, value, callback) => {
|
||||
if (value.length < 4) {
|
||||
callback(new Error('密码长度小于4位!'))
|
||||
callback(new Error("密码长度小于4位!"));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
timer: null,
|
||||
buttonmsg: "发送验证码",
|
||||
count: 60,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
username: "",
|
||||
password: "",
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', message: '请输入账户' }],
|
||||
password: [{ required: true, trigger: 'blur', validator: validatePassword, message: '请输入密码' }]
|
||||
username: [{ required: true, trigger: "blur", message: "请输入账户" }],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
trigger: "blur",
|
||||
validator: validatePassword,
|
||||
message: "请输入密码",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
loading: false,
|
||||
passwordType: 'password',
|
||||
redirect: undefined
|
||||
}
|
||||
passwordType: "password",
|
||||
redirect: undefined,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getUP();
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler: function (route) {
|
||||
this.redirect = route.query && route.query.redirect
|
||||
this.redirect = route.query && route.query.redirect;
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showPwd() {
|
||||
if (this.passwordType === 'password') {
|
||||
this.passwordType = ''
|
||||
if (this.passwordType === "password") {
|
||||
this.passwordType = "";
|
||||
} else {
|
||||
this.passwordType = 'password'
|
||||
this.passwordType = "password";
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.password.focus()
|
||||
})
|
||||
this.$refs.password.focus();
|
||||
});
|
||||
},
|
||||
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.$store.dispatch('user/login', this.loginForm).then(() => {
|
||||
this.$router.push({ path: this.redirect || '/' })
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
this.loading = true;
|
||||
this.$store
|
||||
.dispatch("user/login", this.loginForm)
|
||||
.then(() => {
|
||||
this.$router.push({ path: this.redirect || "/" });
|
||||
this.loading = false;
|
||||
localStorage.setItem("rem_username", this.loginForm.username);
|
||||
localStorage.setItem("rem_password", this.loginForm.password);
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//读取cookie
|
||||
getUP() {
|
||||
|
||||
this.loginForm.username = localStorage.getItem("rem_username");
|
||||
this.loginForm.password = localStorage.getItem("rem_password");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 修复input 背景不协调 和光标变色 */
|
||||
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
|
||||
|
||||
$bg:#283443;
|
||||
$light_gray:#fff;
|
||||
$cursor: #fff;
|
||||
|
||||
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
|
||||
.login-container .el-input input {
|
||||
color: $cursor;
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
background-image: url("../../assets/beijing.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
.title {
|
||||
margin: 30px auto 30px auto;
|
||||
text-align: center;
|
||||
color: #0174d7;
|
||||
}
|
||||
|
||||
/* reset element-ui css */
|
||||
.login-container {
|
||||
.el-input {
|
||||
display: inline-block;
|
||||
height: 47px;
|
||||
width: 85%;
|
||||
|
||||
input {
|
||||
background: transparent;
|
||||
border: 0px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0px;
|
||||
padding: 12px 5px 12px 15px;
|
||||
color: $light_gray;
|
||||
height: 47px;
|
||||
caret-color: $cursor;
|
||||
|
||||
&:-webkit-autofill {
|
||||
box-shadow: 0 0 0px 1000px $bg inset !important;
|
||||
-webkit-text-fill-color: $cursor !important;
|
||||
.logo {
|
||||
width: 350px;
|
||||
height: 140px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$bg:#2d3a4b;
|
||||
$dark_gray:#889aa4;
|
||||
$light_gray:#eee;
|
||||
|
||||
.login-container {
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
background-color: $bg;
|
||||
overflow: hidden;
|
||||
|
||||
.login-form {
|
||||
position: relative;
|
||||
width: 520px;
|
||||
max-width: 100%;
|
||||
padding: 160px 35px 0;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
border-radius: 6px;
|
||||
background: #ffffff;
|
||||
width: 400px;
|
||||
padding: 25px 25px 5px 25px;
|
||||
.el-input {
|
||||
height: 45px;
|
||||
input {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
margin-bottom: 10px;
|
||||
|
||||
span {
|
||||
&:first-of-type {
|
||||
margin-right: 16px;
|
||||
}
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.svg-container {
|
||||
padding: 6px 5px 6px 15px;
|
||||
color: $dark_gray;
|
||||
vertical-align: middle;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
.show-pwd {
|
||||
height: 39px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
font-size: 26px;
|
||||
color: $light_gray;
|
||||
margin: 0px auto 40px auto;
|
||||
.login-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px;
|
||||
font-size: 16px;
|
||||
color: $dark_gray;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.login-code-img {
|
||||
height: 38px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
class SystemConfig(AppConfig):
|
||||
name = 'apps.em'
|
||||
verbose_name = '设备仪器管理'
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db.models.base import Model
|
||||
import django.utils.timezone as timezone
|
||||
from django.db.models.query import QuerySet
|
||||
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
|
||||
from utils.model import SoftModel, BaseModel
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
|
||||
|
||||
class Equipment(BaseModel):
|
||||
"""
|
||||
设备台账信息
|
||||
"""
|
||||
state_choices = (
|
||||
('启用', '启用'),
|
||||
('停用', '停用'),
|
||||
)
|
||||
node = models.IntegerField('序号', max_length=50, default=0)
|
||||
name = models.CharField('设备名称', max_length=50)
|
||||
number = models.CharField('设备编号', max_length=50,null=True, blank=True, unique=True)
|
||||
model = models.CharField('规格型号', max_length=10,null=True, blank=True)
|
||||
factory = models.CharField('生产厂', max_length=50)
|
||||
country = models.CharField('国别', max_length=50)
|
||||
productiondate = models.DateField('生产日期', max_length=50,null=True, blank=True, unique=True)
|
||||
buydate = models.DateField('购置日期', max_length=10,null=True, blank=True)
|
||||
gznumber = models.IntegerField('购置数量', max_length=10,null=True, blank=True,default=0)
|
||||
state = models.CharField('设备状态', max_length=11,choices=state_choices, default='启用')
|
||||
indicators = models.CharField('技术指标', max_length=50)
|
||||
address = models.CharField('存放位置', max_length=50,null=True, blank=True, unique=True)
|
||||
contact = models.CharField('经管联系人', max_length=20, blank=True, null=True)
|
||||
contactphone = models.CharField('联系电话', max_length=11,unique=True, blank=True, null=True)
|
||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||
class Meta:
|
||||
verbose_name = '供应商信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
class SystemConfig(AppConfig):
|
||||
name = 'apps.sam'
|
||||
verbose_name = '人力资源管理'
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db.models.base import Model
|
||||
import django.utils.timezone as timezone
|
||||
from django.db.models.query import QuerySet
|
||||
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
|
||||
from utils.model import SoftModel, BaseModel
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
|
||||
|
||||
class Employee(BaseModel):
|
||||
"""
|
||||
员工信息
|
||||
"""
|
||||
job_choices = (
|
||||
('在职', '在职'),
|
||||
('离职', '离职'),
|
||||
)
|
||||
name = models.CharField('姓名', max_length=50)
|
||||
number = models.CharField('人员编号', max_length=50,null=True, blank=True, unique=True)
|
||||
gender = models.CharField('性别', max_length=10,null=True, blank=True)
|
||||
phone = models.CharField('手机号', max_length=11,null=True, blank=True, unique=True)
|
||||
jobstate = models.CharField('在职状态', max_length=11,choices=job_choices, default='在职')
|
||||
dept = models.ForeignKey(Organization, verbose_name='关联部门', on_delete=models.CASCADE, related_name='employee_dept')
|
||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||
class Meta:
|
||||
verbose_name = '客户信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
class SystemConfig(AppConfig):
|
||||
name = 'apps.pum'
|
||||
verbose_name = '采购管理'
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db.models.base import Model
|
||||
import django.utils.timezone as timezone
|
||||
from django.db.models.query import QuerySet
|
||||
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
|
||||
from utils.model import SoftModel, BaseModel
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
|
||||
|
||||
class Vendor(BaseModel):
|
||||
"""
|
||||
供应商信息
|
||||
"""
|
||||
|
||||
name = models.CharField('供应商名称', max_length=50)
|
||||
gyname = models.CharField('供应品名称', max_length=50,null=True, blank=True, unique=True)
|
||||
model = models.CharField('规格型号', max_length=10,null=True, blank=True)
|
||||
contact = models.CharField('联系人', max_length=20, blank=True, null=True)
|
||||
contactphone = models.CharField('联系电话', max_length=11,unique=True, blank=True, null=True)
|
||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||
class Meta:
|
||||
verbose_name = '供应商信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
class SystemConfig(AppConfig):
|
||||
name = 'apps.sam'
|
||||
verbose_name = '销售管理'
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db.models.base import Model
|
||||
import django.utils.timezone as timezone
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
from utils.model import SoftModel, BaseModel
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
|
||||
|
||||
class Customer(BaseModel):
|
||||
"""
|
||||
客户信息
|
||||
"""
|
||||
name = models.CharField('客户名称', max_length=50, unique=True)
|
||||
country = models.CharField('所属国家', max_length=20, blank=True, null=True)
|
||||
address = models.CharField('详细地址', max_length=20, blank=True, null=True)
|
||||
contact = models.CharField('联系人', max_length=20, blank=True, null=True)
|
||||
contactphone = models.CharField('联系电话', max_length=11,unique=True, blank=True, null=True)
|
||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '客户信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Contact(BaseModel):
|
||||
"""
|
||||
合同信息
|
||||
"""
|
||||
name = models.CharField('合同名称', max_length=100)
|
||||
number = models.CharField('合同编号', max_length=100, unique=True, blank=True, null=True)
|
||||
money = models.IntegerField('合同金额', default=0, null=True, blank=True)
|
||||
customer = models.ForeignKey(Customer, verbose_name='关联客户', on_delete=models.CASCADE, related_name='contact_customer')
|
||||
# contactuser = models.CharField('合同签订人', max_length=100, unique=True, blank=True, null=True)
|
||||
date = models.DateField('签订日期', null=True, blank=True)
|
||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '合同信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Order(BaseModel):
|
||||
"""
|
||||
订单信息
|
||||
"""
|
||||
number = models.CharField('订单编号', max_length=100)
|
||||
class Meta:
|
||||
verbose_name = '订单信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Loading…
Reference in New Issue