基础表建立

This commit is contained in:
shilixia 2021-08-11 08:55:37 +08:00
parent c5aa2a9bd6
commit ffc0a36c63
32 changed files with 397 additions and 179 deletions

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

View File

@ -1,62 +1,72 @@
<template> <template>
<div class="login-container"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left"> <div class="login-form">
<div class="title-container"> <h3 class="title">航玻生产管理系统</h3>
<h3 class="title">系统登陆</h3> <el-tabs v-model="activeName" :stretch="true">
</div>
<el-form-item prop="username"> <el-tab-pane label="账号密码登录">
<span class="svg-container"> <el-form
<svg-icon icon-class="user" /> ref="loginForm"
</span> :model="loginForm"
<el-input :rules="loginRules"
ref="username" >
v-model="loginForm.username" <el-form-item prop="username">
placeholder="账号" <el-input
name="username" ref="username"
type="text" v-model="loginForm.username"
tabindex="1" placeholder="账号"
auto-complete="on" name="username"
/> type="text"
</el-form-item> 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"> <el-form-item prop="password">
<span class="svg-container"> <el-input
<svg-icon icon-class="password" /> :key="passwordType"
</span> ref="password"
<el-input v-model="loginForm.password"
:key="passwordType" :type="passwordType"
ref="password" placeholder="密码"
v-model="loginForm.password" name="password"
:type="passwordType" tabindex="2"
placeholder="密码" auto-complete="on"
name="password" @keyup.enter.native="handleLogin"
tabindex="2" ><svg-icon
auto-complete="on" slot="prefix"
@keyup.enter.native="handleLogin" icon-class="password"
/> class="el-input__icon input-icon"
<span class="show-pwd" @click="showPwd"> /></el-input>
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" /> <span class="show-pwd" @click="showPwd">
</span> <svg-icon
</el-form-item> :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
/>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登陆</el-button> </span>
</el-form-item>
<!-- <div class="tips"> <el-button
<span style="margin-right:20px;">username: admin</span> :loading="loading"
<span> password: any</span> type="primary"
</div> --> style="width: 100%; margin-bottom: 30px"
@click.native.prevent="handleLogin"
</el-form> >登录</el-button
>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</div> </div>
</template> </template>
<script> <script>
// import { validUsername } from '@/utils/validate'
export default { export default {
name: 'Login', name: "Login",
data() { data() {
// const validateUsername = (rule, value, callback) => { // const validateUsername = (rule, value, callback) => {
// if (!validUsername(value)) { // if (!validUsername(value)) {
@ -67,171 +77,156 @@ export default {
// } // }
const validatePassword = (rule, value, callback) => { const validatePassword = (rule, value, callback) => {
if (value.length < 4) { if (value.length < 4) {
callback(new Error('密码长度小于4位!')) callback(new Error("密码长度小于4位!"));
} else { } else {
callback() callback();
} }
} };
return { return {
timer: null,
buttonmsg: "发送验证码",
count: 60,
loginForm: { loginForm: {
username: '', username: "",
password: '' password: "",
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', message: '请输入账户' }], username: [{ required: true, trigger: "blur", message: "请输入账户" }],
password: [{ required: true, trigger: 'blur', validator: validatePassword, message: '请输入密码' }] password: [
{
required: true,
trigger: "blur",
validator: validatePassword,
message: "请输入密码",
},
],
}, },
loading: false, loading: false,
passwordType: 'password', passwordType: "password",
redirect: undefined redirect: undefined,
} };
},
created() {
this.getUP();
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function (route) {
this.redirect = route.query && route.query.redirect this.redirect = route.query && route.query.redirect;
}, },
immediate: true immediate: true,
} },
}, },
methods: { methods: {
showPwd() { showPwd() {
if (this.passwordType === 'password') { if (this.passwordType === "password") {
this.passwordType = '' this.passwordType = "";
} else { } else {
this.passwordType = 'password' this.passwordType = "password";
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.password.focus() this.$refs.password.focus();
}) });
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
this.loading = true this.loading = true;
this.$store.dispatch('user/login', this.loginForm).then(() => { this.$store
this.$router.push({ path: this.redirect || '/' }) .dispatch("user/login", this.loginForm)
this.loading = false .then(() => {
}).catch(() => { this.$router.push({ path: this.redirect || "/" });
this.loading = false this.loading = false;
}) localStorage.setItem("rem_username", this.loginForm.username);
localStorage.setItem("rem_password", this.loginForm.password);
})
.catch(() => {
this.loading = false;
});
} else { } else {
console.log('error submit!!') console.log("error submit!!");
return false return false;
} }
}) });
} },
}
} //读取cookie
getUP() {
this.loginForm.username = localStorage.getItem("rem_username");
this.loginForm.password = localStorage.getItem("rem_password");
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
/* 修复input 背景不协调 和光标变色 */ .login {
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */ display: flex;
justify-content: center;
$bg:#283443; align-items: center;
$light_gray:#fff; height: 100%;
$cursor: #fff; background-image: url("../../assets/beijing.jpg");
background-size: cover;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) { }
.login-container .el-input input { .title {
color: $cursor; margin: 30px auto 30px auto;
} text-align: center;
color: #0174d7;
}
.logo {
width: 350px;
height: 140px;
} }
/* reset element-ui css */ .login-form {
.login-container { border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input { .el-input {
display: inline-block; height: 45px;
height: 47px;
width: 85%;
input { input {
background: transparent; height: 45px;
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;
}
} }
} }
.input-icon {
.el-form-item { height: 39px;
border: 1px solid rgba(255, 255, 255, 0.1); width: 14px;
background: rgba(0, 0, 0, 0.1); margin-left: 2px;
border-radius: 5px;
color: #454545;
} }
} }
</style>
<style lang="scss" scoped> .show-pwd {
$bg:#2d3a4b; height: 39px;
$dark_gray:#889aa4; margin-right: 2px;
$light_gray:#eee; }
.login-tip {
.login-container { font-size: 13px;
min-height: 100%; text-align: center;
width: 100%; color: #bfbfbf;
background-color: $bg; }
overflow: hidden; .login-code {
width: 33%;
.login-form { height: 38px;
position: relative; float: right;
width: 520px; img {
max-width: 100%;
padding: 160px 35px 0;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.title-container {
position: relative;
.title {
font-size: 26px;
color: $light_gray;
margin: 0px auto 40px auto;
text-align: center;
font-weight: bold;
}
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer; cursor: pointer;
user-select: none; vertical-align: middle;
} }
} }
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
cursor: pointer;
user-select: none;
}
.login-code-img {
height: 38px;
}
</style> </style>

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,7 @@
from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'apps.em'
verbose_name = '设备仪器管理'

View File

View File

@ -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

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,7 @@
from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'apps.sam'
verbose_name = '人力资源管理'

View File

@ -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

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,7 @@
from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'apps.pum'
verbose_name = '采购管理'

View File

@ -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

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,7 @@
from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'apps.sam'
verbose_name = '销售管理'

View File

@ -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

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.