基于Django+MySQL的仓库库存管理系统设计与实现

目录
第一章绪论 3
1.1课题背景 3
1.2课题研究的目的和意义 3
1.3 研究现状 4
1.4论文所做的主要工作 4
第二章技术介绍 5
2.1B/S结构 5
2.2MySQL数据库技术 5
2.3MySQL环境配置 7
2.4Python语言简介 7
2.5Django框架 7
第三章系统分析与设计 9
3.1系统说明 9
3.2系统可行性分析 9
3.2.1 技术可行性 9
3.2.2 经济可行性 9
3.2.3操作可行性 10
3.2.4运行可行性 10
3.3 性能需求分析 10
3.4系统的设计思想 11
3.5系统功能结构 12
3.6系统流程分析 12
3.6.1操作流程 12
3.6.2添加信息流程 13
3.6.3删除信息流程 14
第四章数据库设计 15
4.1数据库概念设计 15
4.2数据表设计 15
第五章系统的详细设计 20
5. 1管理员功能模块 20
5. 2仓库员功能模块 22
第六章系统测试 24
6.1系统测试方法 24
6.2系统功能测试 24
总结 25
参考文献 26
致谢 27
1.3 研究现状
在国外很多发达国家,软件产业早已得到全面普及,但我国经济已不断发展,不断引进国外信息化建设,使国内软件行业得以不断发展,在摸索中进步,最终也得到一些成果,我国的软件业迎来了高速的发展,使更多的软件系统得以开发出来,从此逐渐地改变人们的生活工作方式。但是,对于信息化的建设,与很多发达国家相比,由于信息化程度的落后以及经费的不足,我国的仓库库存管理系统开发方面还是相对落后的,因此,要不断的努力探索,争取开发出一个实用的信息化的仓库库存管理系统,来实现仓库库存管理的信息化。因此本课题以仓库库存为例,目的是开发一个实用的仓库库存管理系统。
仓库库存管理系统的开发运用Python技术,MIS的总体思想,以及MYSQL等技术的支持下共同完成了该系统的开发,实现了仓库库存管理的信息化,使用户体验到更优秀的仓库库存管理系统,管理员管理操作将更加方便,实现目标。
1.4论文所做的主要工作
本论文的内容是关于仓库库存管理系统的设计与实现,主要内容不仅包括了系统的分析和设计还对几个主要模块进行详细阐述与分析。此仓库库存管理系统分为管理员操作和仓库员操作。管理员的操作,管理员登录后台进行操作,后台管理主要是针对一些仓库库存信息的添加,更新仓库库存信息管理,给管理员权限对用户进行修改等。本文将从分析部分开始论述,用户需要什么样的网站,怎样的操作界面能保证系统的易用性,然后从功能分析开始思考需要怎样的数据逻辑结构,把数据逻辑结构建成数据实体,最后从几个主要模块部分论述如何实现这些功能。

<template>
  <div>
        <div class="container loginIn">

      <div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'">
        <el-form class="login-form" label-position="left" :label-width="2 == 3 || 2 == 2 ? '30px': '0px'">
          <div class="title-container"><h3 class="title">仓库库存管理系统登录</h3></div>
          <el-form-item :style='{
    
    "padding":"0","boxShadow":"0 0 6px rgba(0,0,0,0)","margin":"0 0 12px 0","borderColor":"rgba(0,0,0,0)","backgroundColor":"rgba(0,0,0,0)","borderRadius":"8px","borderWidth":"0","width":"100%","borderStyle":"solid","height":"auto"}' :label="2 == 3 ? '用户名' : ''" :class="'style'+2">
            <span v-if="2 != 3" class="svg-container" style="
			color:#333;
			line-height:40px;
			font-size:14px;
			width:30px;
			padding:0;
			margin:0;
			radius:8px 0 0 8px;
			border-width:0;
			border-style:solid;
			border-color:rgba(0,0,0,0);
			background-color:rgba(236, 236, 236, 0);
			box-shadow:0 0 6px rgba(0,0,0,0);
			}"><svg-icon icon-class="user" /></span>
            <el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" />
          </el-form-item>
          <el-form-item :style='{
    
    "padding":"0","boxShadow":"0 0 6px rgba(0,0,0,0)","margin":"0 0 12px 0","borderColor":"rgba(0,0,0,0)","backgroundColor":"rgba(0,0,0,0)","borderRadius":"8px","borderWidth":"0","width":"100%","borderStyle":"solid","height":"auto"}' :label="2 == 3 ? '密码' : ''" :class="'style'+2">
            <span v-if="2 != 3" class="svg-container" style="color:#333;
			line-height:40px;
			font-size:14px;
			width:30px;
			padding:0;
			margin:0;
			radius:8px 0 0 8px;
			border-width:0;
			border-style:solid;
			border-color:rgba(0,0,0,0);
			background-color:rgba(236, 236, 236, 0);
			box-shadow:0 0 6px rgba(0,0,0,0);"><svg-icon icon-class="password" /></span>
            <el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" />
          </el-form-item>
          <el-form-item v-if="roles.length>1" label="角色" prop="loginInRole" class="role" style="display: flex;align-items: center;">
            <el-radio
              v-for="item in roles"
              v-bind:key="item.roleName"
              v-model="rulesForm.role"
              :label="item.roleName"
            >{
    
    {
    
    item.roleName}}</el-radio>
          </el-form-item>
          <el-form-item v-if="roles.length==1" label=" " prop="loginInRole" class="role" style="display: flex;align-items: center;">
          </el-form-item>
          <el-button type="primary" @click="login()" class="loginInBt">{
    
    {
    
    '1' == '1' ? '登录' : 'login'}}</el-button>
          <el-form-item class="setting">
            <div class="register" @click="register('cangkuyuan')">注册仓库员</div>
            <!-- <div style="color:${template2.back.login.loginInSettingFontColor}" class="reset">修改密码</div> -->
          </el-form-item>
        </el-form>
      </div>

    </div>
  </div>
</template>
<script>

import menu from "@/utils/menu";

export default {
    
    
  data() {
    
    
    return {
    
    
      rulesForm: {
    
    
        username: "",
        password: "",
        role: "",
        code: '',
      },
      menus: [],
      roles: [],
      tableName: "",
      codes: [{
    
    
        num: 1,
        color: '#000',
        rotate: '10deg',
        size: '16px'
      },{
    
    
        num: 2,
        color: '#000',
        rotate: '10deg',
        size: '16px'
      },{
    
    
        num: 3,
        color: '#000',
        rotate: '10deg',
        size: '16px'
      },{
    
    
        num: 4,
        color: '#000',
        rotate: '10deg',
        size: '16px'
      }],
    };
  },
  mounted() {
    
    
	let menus = menu.list();
	this.menus = menus;
    for (let i = 0; i < this.menus.length; i++) {
    
    
      if (this.menus[i].hasBackLogin=='是') {
    
    
            this.roles.push(this.menus[i])
      }
    }
	this.$nextTick(() => {
    
    
	  canvasBg()
	})
  },
  created() {
    
    
    this.getRandCode()
	
  },
  methods: {
    
    
    register(tableName){
    
    
      this.$storage.set("loginTable", tableName);
      this.$router.push({
    
    path:'/register'})
    },
    // 登陆
    login() {
    
    
      if (!this.rulesForm.username) {
    
    
         this.$message.error("请输入用户名");
        return;
      }
      if (!this.rulesForm.password) {
    
    
         this.$message.error("请输入密码");
        return;
      }
      if(this.roles.length>1) {
    
    
          if (!this.rulesForm.role) {
    
    
             this.$message.error("请选择角色");
            return;
          }
          let menus = this.menus;
          for (let i = 0; i < menus.length; i++) {
    
    
            if (menus[i].roleName == this.rulesForm.role) {
    
    
              this.tableName = menus[i].tableName;
            }
          }
      } else {
    
    
          this.tableName = this.roles[0].tableName;
          this.rulesForm.role = this.roles[0].roleName;
      }

      this.$http({
    
    
        url: `${
    
    this.tableName}/login?username=${
    
    this.rulesForm.username}&password=${
    
    this.rulesForm.password}`,
        method: "post"
      }).then(({
    
     data }) => {
    
    
        if (data && data.code === 0) {
    
    
          this.$storage.set("Token", data.token);
          this.$storage.set("role", this.rulesForm.role);
          this.$storage.set("sessionTable", this.tableName);
          this.$storage.set("adminName", this.rulesForm.username);
          this.$router.replace({
    
     path: "/index/" });
        } else {
    
    
          this.$message.error(data.msg);
        }
      });
    },
    getRandCode(len = 4){
    
    
      this.randomString(len)
    },
    randomString(len = 4) {
    
    
      let chars = [
          "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
          "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
          "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
          "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
          "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
          "3", "4", "5", "6", "7", "8", "9"
      ]
      let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
      let sizes = ['14', '15', '16', '17', '18']

      let output = [];
      for (let i = 0; i < len; i++) {
    
    
        // 随机验证码
        let key = Math.floor(Math.random()*chars.length)
        this.codes[i].num = chars[key]
        // 随机验证码颜色
        let code = '#'
        for (let j = 0; j < 6; j++) {
    
    
          let key = Math.floor(Math.random()*colors.length)
          code += colors[key]
        }
        this.codes[i].color = code
        // 随机验证码方向
        let rotate = Math.floor(Math.random()*60)
        let plus = Math.floor(Math.random()*2)
        if(plus == 1) rotate = '-'+rotate
        this.codes[i].rotate = 'rotate('+rotate+'deg)'
        // 随机验证码字体大小
        let size = Math.floor(Math.random()*sizes.length)
        this.codes[i].size = sizes[size]+'px'
      }
    },
  }
};
</script>
<style lang="scss" scoped>
.el-form-item--medium{
    
    
    display: flex;
    justify-content: center;
}
.setting{
    
    
    display: flex;
    justify-content: center;
}
.loginIn {
    
    
  min-height: 100vh;
  position: relative;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
      background-image: url(http://codegen.caihongy.cn/20220404/a2308c37efd74e8fac5c0ce050a09048.png);
    

  .loginInBt {
    
    
    width: auto;
    height: auto;
    line-height: auto;
    margin: 0 auto;
    padding: 25px;
    color: rgba(255, 255, 255, 1);
    font-size: 34px;
    border-radius: 54px;
    border-width: 0;
    border-style: solid;
    border-color: rgba(64, 158, 255, 1);
    background-color: rgba(134, 157, 153, 1);
    box-shadow: 0 0 0px rgba(255,0,0,.1);
  }
  .register {
    
    
    width: auto;
    height: 24px;
    line-height: 24px;
    margin: 0 12px;
    padding: 0;
    color: rgba(130, 130, 130, 1);
    font-size: 14px;
    border-radius: 0;
    border-width: 0;
    border-style: solid;
    border-color: rgba(64, 158, 255, 1);
    background-color: rgba(255, 255, 255, 0);
    box-shadow: 0 0 6px rgba(255,0,0,0);
	cursor: pointer;
  }
  .reset {
    
    
    width: auto;
    height: 24px;
    line-height: 24px;
    margin: 0 12px;
    padding: 0;
    color: rgba(130, 130, 130, 1);
    font-size: 14px;
    border-radius: 0;
    border-width: 0;
    border-style: solid;
    border-color: rgba(64, 158, 255, 1);
    background-color: rgba(255, 255, 255, 0);
    box-shadow: 0 0 6px rgba(255,0,0,0);
  }


  .left {
    
    
    position: absolute;
    left: 0;
    top: 0;
	box-sizing: border-box;
	width: 400px;
	height: auto;
	margin: 0 0 0 300px;
	padding: 120px 16px 16px;
	border-radius: 900px 900px 400px 400px;
	border-width: 20px;
	border-style: solid;
	border-color: rgba(220, 236, 238, 1);
	background-color: rgba(255, 255, 255, 1);
	box-shadow: 0 -30px 0px 45px rgba(193, 217, 213, 1);

    .login-form {
    
    
      background-color: transparent;
      width: 100%;
      right: inherit;
      padding: 0;
      box-sizing: border-box;
      display: flex;
	  position: initial;
      justify-content: center;
      flex-direction: column;
    }

    .title-container {
    
    
      text-align: center;
      font-size: 24px;

      .title {
    
    
        width: 80%;
        line-height: auto;
        margin: -140px auto 16px;
        padding: 10px;
        color: rgba(255, 255, 255, 1);
        font-size: 18px;
        border-radius: 48px;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0,0,0,.3);
        background-color: rgba(134, 157, 153, 1);
        box-shadow: 0 0 6px rgba(0,0,0,0);
      }
    }

    .el-form-item {
    
    
      position: relative;

      & /deep/ .el-form-item__content {
    
    
        line-height: initial;
      }

	  & /deep/ .el-radio__label {
    
    
	    width: auto;
	    height: 14px;
	    line-height: 14px;
	    margin: 0;
	    padding: 0 0 0 10px;
	    color: rgba(156, 156, 156, 1);
	    font-size: 14px;
	    border-radius: 0;
	    border-width: 0;
	    border-style: solid;
	    border-color: rgba(255, 255, 255, 0);
	    background-color: rgba(255, 255, 255, 0);
	    box-shadow: 0 0 6px rgba(255,0,0,0);
	    text-align: left;
	  }
	  & /deep/ .el-radio.is-checked .el-radio__label {
    
    
	    width: auto;
	    height: 14px;
	    line-height: 14px;
	    margin: 0;
	    padding: 0 0 0 10px;
	    color: rgba(0, 0, 0, 1);
	    font-size: 14px;
	    border-radius: 0;
	    border-width: 0;
	    border-style: solid;
	    border-color: rgba(255, 255, 255, 0);
	    background-color: rgba(255, 255, 255, 0);
	    box-shadow: 0 0 6px rgba(255,0,0,0);
	    text-align: left;
	  }
	  & /deep/ .el-radio__inner {
    
    
	    width: 14px;
	    height: 14px;
	    margin: 6px 0;
	    padding: 0;
	    border-radius: 100%;
	    border-width: 1px;
	    border-style: solid;
	    border-color: #dcdfe6;
	    background-color: rgba(255, 255, 255, 1);
	    box-shadow: 0 0 6px rgba(255,0,0,0);
	  }
	  & /deep/ .el-radio.is-checked .el-radio__inner {
    
    
	    width: 14px;
	    height: 14px;
	    margin: 0;
	    padding: 0;
	    border-radius: 100%;
	    border-width: 1px;
	    border-style: solid;
	    border-color: rgba(0, 0, 0, 1);
	    background-color: rgba(0, 0, 0, 1);
	    box-shadow: 0 0 6px rgba(255,0,0,0);
	  }

      .svg-container {
    
    
        padding: 6px 5px 6px 15px;
        color: #889aa4;
        vertical-align: middle;
        display: inline-block;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 1;
        padding: 0;
        line-height: 40px;
        width: 30px;
        text-align: center;
      }

      .el-input {
    
    
        display: inline-block;
        // height: 40px;
        width: 100%;

        & /deep/ input {
    
    
          background: transparent;
          border: 0px;
          -webkit-appearance: none;
          padding: 0 15px 0 30px;
          color: #fff;
          height: 40px;

		  width: 100%;
		  height: 40px;
		  line-height: 40px;
		  margin: 0;
		  padding: 0 30px;
		  color: rgba(0, 0, 0, 1);
		  font-size: 16px;
		  border-radius: 8px;
		  border-width: 0;
		  border-style: solid;
		  border-color: rgba(0,0,0,0);
		  background-color: rgba(236, 236, 236, 1);
		  box-shadow: 0 0 6px rgba(255,0,0,0);
        }
      }

    }


  }

  .center {
    
    
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%,-50%,0);
  }

  .right {
    
    
    position: absolute;
    left: inherit;
    right: 0;
    top: 0;
  }

  .code {
    
    
    .el-form-item__content {
    
    
      position: relative;

      .getCodeBt {
    
    
        position: absolute;
        right: 0;
        top: 50%;
        transform: translate3d(0, -50%, 0);
        line-height: 40px;
        width: 100px;
        background-color: rgba(51,51,51,0.4);
        color: #fff;
        text-align: center;
        border-radius: 0 4px 4px 0;
        height: 40px;
        overflow: hidden;
		padding: 0;
		margin: 0;
		width: 100px;
        height: 40px;
        line-height: 40px;
        border-radius: 0 8px 8px 0;
        border-width: 0;
        border-style: solid;
        border-color: rgba(64, 158, 255, 1);
        background-color: rgba(51, 51, 51, 0.4);
        box-shadow: 0 0 6px rgba(255,0,0,0);

        span {
    
    
          padding: 0 5px;
          display: inline-block;
          font-size: 16px;
          font-weight: 600;
        }
      }

      .el-input {
    
    
        & /deep/ input {
    
    
          padding: 0 130px 0 30px;
        }
      }
    }
  }

  .setting {
    
    
    & /deep/ .el-form-item__content {
    
    
      // padding: 0 15px;
      box-sizing: border-box;
      line-height: 32px;
      height: 32px;
      font-size: 14px;
      color: #999;
      margin: 0 !important;
	  display: flex;

      .register {
    
    
        // float: left;
        // width: 50%;
		text-align: center;
      }

      .reset {
    
    
        float: right;
        width: 50%;
        text-align: right;
      }
    }
  }

  .style2 {
    
    
    padding-left: 30px;

    .svg-container {
    
    
      left: -30px !important;
    }

    .el-input {
    
    
      & /deep/ input {
    
    
        padding: 0 15px !important;
      }
    }
  }

  .code.style2, .code.style3 {
    
    
    .el-input {
    
    
      & /deep/ input {
    
    
        padding: 0 115px 0 15px;
      }
    }
  }

  .style3 {
    
    
    & /deep/ .el-form-item__label {
    
    
      padding-right: 6px;
      height: 40px;
      line-height: 40px;
    }

    .el-input {
    
    
      & /deep/ input {
    
    
        padding: 0 15px !important;
      }
    }
  }
  
  & /deep/ .el-form-item__label {
    
    
	width: 30px;
	height: 40px;
	line-height: 40px;
	margin: 0;
	padding: 0;
	color: #333;
	font-size: 14px;
	border-radius: 8px 0 0 8px;
	border-width: 0;
	border-style: solid;
	border-color: rgba(0,0,0,0);
	background-color: rgba(236, 236, 236, 0);
	box-shadow: 0 0 6px rgba(0,0,0,0);
  }

  .role {
    
    
    & /deep/ .el-form-item__label {
    
    
      width: 56px !important;
      height: 38px;
      line-height: 38px;
      margin: 0;
      padding: 0;
      color: rgba(0, 0, 0, 1);
      font-size: 14px;
      border-radius: 0;
      border-width: 0;
      border-style: solid;
      border-color: rgba(64, 158, 255, 1);
      background-color: rgba(255, 255, 255, 0);
      box-shadow: 0 0 6px rgba(255,0,0,0);
      text-align: left;
    }

    & /deep/ .el-radio {
    
    
      margin-right: 12px;
    }
  }
}
</style>

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/newlw/article/details/131001227