Login.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="login">
  3. <div class="login-par">
  4. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
  5. <div class="login-logo">
  6. <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
  7. </div>
  8. <h3 class="title">工时管家</h3>
  9. <el-form-item class="login-input" prop="username">
  10. <el-input type="text" v-model="ruleForm.username" autocomplete="off" placeholder="账号" clearable prefix-icon="el-icon-user-solid"></el-input>
  11. </el-form-item>
  12. <el-form-item class="login-input" prop="password">
  13. <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" placeholder="密码" show-password prefix-icon="el-icon-lock"></el-input>
  14. </el-form-item>
  15. <el-form-item class="login-button" style="width:100%;">
  16. <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">登录</el-button>
  17. </el-form-item>
  18. <div class="toRegister">
  19. <el-link type="primary" class="btn" style="float:left;" :underline="false">联系客服
  20. <div class="service">
  21. <p style="color: #333">扫码加客服微信</p>
  22. <img src="../assets/image/code.jpg">
  23. <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
  24. </div>
  25. </el-link>
  26. <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
  27. 使用说明
  28. </el-link>
  29. <el-link type="primary" @click="jumpTo" :underline="false">企业注册</el-link>
  30. </div>
  31. </el-form>
  32. </div>
  33. <el-dialog title="使用说明" :visible.sync="dialogVisible" width="500px">
  34. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_管理员.docx" download="工时管家使用说明_管理员.docx"
  35. target="_blank">工时管家使用说明_管理员.docx</a></p>
  36. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx"
  37. target="_blank">工时管家使用说明_项目经理.docx</a></p>
  38. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx"
  39. target="_blank">工时管家使用说明_普通员工.docx</a></p>
  40. </el-dialog>
  41. </div>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. dialogVisible: false,
  48. logining: false,
  49. // 登录信息
  50. ruleForm: {
  51. username: '',
  52. password: ''
  53. },
  54. rules: {
  55. username: [{ required: true, message: '请输入账号', trigger: 'blur' },],
  56. password: [{ required: true, message: '请输入密码', trigger: 'blur' },]
  57. }
  58. };
  59. },
  60. methods: {
  61. handleReset2() {
  62. this.$refs.ruleForm.resetFields();
  63. },
  64. jumpTo() {
  65. this.$router.push({ path: '/register' });
  66. },
  67. handleSubmit(ev) {
  68. this.$refs.ruleForm.validate((valid) => {
  69. if (valid) {
  70. var _this = this;
  71. this.logining = true;
  72. this.http.post(this.port.manage.login, this.ruleForm , res => {
  73. this.logining = false;
  74. if (res.code == "ok") {
  75. sessionStorage.setItem('user', JSON.stringify(res.data));
  76. this.$router.push({ path: '/daily' });
  77. } else {
  78. this.$message({
  79. message: res.msg,
  80. type: 'error'
  81. });
  82. }
  83. }, error => {
  84. this.logining = false;
  85. this.$message({
  86. message: error,
  87. type: 'error'
  88. });
  89. })
  90. }
  91. });
  92. },
  93. },
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .login {
  98. height: 100%;
  99. .login-par {
  100. width: 100%;
  101. min-height: 100%;
  102. background: #f0f2f5 url('../assets/image/background.png') no-repeat 50%;
  103. background-size: 100%;
  104. padding: 110px 0 144px;
  105. position: relative;
  106. box-sizing: border-box;
  107. .login-logo {
  108. text-align: center;
  109. margin: 0 0 20px 0;
  110. }
  111. .login-container {
  112. -webkit-border-radius: 5px;
  113. border-radius: 5px;
  114. -moz-border-radius: 5px;
  115. background-clip: padding-box;
  116. width: 315px;
  117. height: 380px;
  118. padding: 25px 35px 25px 35px;
  119. background: #fff;
  120. border: 1px solid #eaeaea;
  121. box-shadow: 0 0 5px #cac6c6;
  122. border-top: 10px solid #20a0ff;
  123. margin:auto;
  124. .title {
  125. font-size: 20px;
  126. margin: 0px auto 40px auto;
  127. text-align: center;
  128. color: #505458;
  129. }
  130. .remember {
  131. margin: 0px 0px 35px 0px;
  132. }
  133. .login-input {
  134. margin: 30px 0 0 0;
  135. }
  136. .login-button {
  137. margin: 30px 0 0 0;
  138. }
  139. .login-button .el-button {
  140. padding: 14px;
  141. }
  142. }
  143. }
  144. }
  145. .toRegister {
  146. margin: 15px 0;
  147. text-align: right;
  148. position: relative;
  149. .service {
  150. display: none;
  151. width: 120px;
  152. position: absolute;
  153. background: #fff;
  154. text-align: center;
  155. padding: 10px;
  156. left: -30px;
  157. top: -210px;
  158. border-radius: 5px;
  159. box-shadow: 3px 3px 10px #dfdfdf;
  160. img {
  161. width: 80px;
  162. }
  163. }
  164. }
  165. .btn:hover .service {
  166. display: block;
  167. }
  168. </style>