howie vor 3 Jahren
Ursprung
Commit
787d606e98

+ 14 - 2
src/App.vue

@@ -1,3 +1,13 @@
+<!--
+ * @Author: howie
+ * @Date: 2022-06-02 09:55:42
+ * @LastEditors: howie
+ * @LastEditTime: 2022-07-08 16:40:44
+ * @FilePath: \supply-front\src\App.vue
+ * @Description:
+ *
+ * Copyright (c) 2022, All Rights Reserved.
+-->
 <template>
   <div id="app">
     <router-view />
@@ -6,6 +16,8 @@
 
 <script>
 export default {
-  name: 'App'
+  name: 'App',
+
+
 }
-</script>
+</script>

BIN
src/assets/login/icon_0001.png


BIN
src/assets/login/icon_001.png


BIN
src/assets/login/icon_002.png


BIN
src/assets/login/icon_003.png


BIN
src/assets/login/icon_004.png


BIN
src/assets/login/icon_005.png


+ 4 - 1
src/views/basic_data/logistics/logistics_list.vue

@@ -40,10 +40,11 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" icon="el-icon-plus" size="small" @click="hanleAdd"
+        <el-button type="primary" icon="el-icon-plus" size="small" @click="hanleAdd" v-if="$checkBtnRole('add', $route.meta.roles)"
           >新增</el-button
         >
         <el-popconfirm
+        v-if="$checkBtnRole('del', $route.meta.roles)"
           confirm-button-text="好的"
           cancel-button-text="不用了"
           icon="el-icon-info"
@@ -173,11 +174,13 @@
               > -->
               <el-button
                 type="text"
+                v-if="$checkBtnRole('edit', $route.meta.roles)"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row)"
                 >编辑</el-button
               >
               <el-popconfirm
+              v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"

+ 4 - 0
src/views/basic_data/material/machine_list.vue

@@ -59,6 +59,7 @@
     <div class="btn-group clearfix">
       <div class="fl">
         <el-button
+         v-if="$checkBtnRole('add', $route.meta.roles)"
           type="primary"
           size="small"
              icon="el-icon-plus"
@@ -66,6 +67,7 @@
           >新增</el-button
         >
         <el-popconfirm
+         v-if="$checkBtnRole('del', $route.meta.roles)"
           confirm-button-text="好的"
           cancel-button-text="不用了"
           icon="el-icon-info"
@@ -198,12 +200,14 @@
           >
             <template slot-scope="scope">
               <el-button
+               v-if="$checkBtnRole('edit', $route.meta.roles)"
                 type="text"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row)"
                 >编辑</el-button
               >
               <el-popconfirm
+               v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"

+ 2 - 1
src/views/basic_data/material/modify_list.vue

@@ -61,9 +61,10 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary"   icon="el-icon-plus" size="small" @click="addFn">新增</el-button>
+          <el-button type="primary"  v-if="$checkBtnRole('add', $route.meta.roles)"  icon="el-icon-plus" size="small" @click="addFn">新增</el-button>
           <!-- <el-button type="primary" size="small">编辑</el-button> -->
           <el-popconfirm
+           v-if="$checkBtnRole('del', $route.meta.roles)"
             confirm-button-text="好的"
             cancel-button-text="不用了"
             icon="el-icon-info"

+ 1 - 0
src/views/basic_data/material/price_list.vue

@@ -286,6 +286,7 @@
                 >作废</el-button
               >
               <el-button
+               v-if="$checkBtnRole('del', $route.meta.roles)"
                 type="text"
                 size="small"
                 @click="handleDelete(scope.row.id)"

+ 4 - 0
src/views/basic_data/material/relation_list.vue

@@ -116,6 +116,7 @@
     <div class="btn-group clearfix">
       <div class="fl">
         <el-button
+         v-if="$checkBtnRole('add', $route.meta.roles)"
           type="primary"
              icon="el-icon-plus"
           size="small"
@@ -124,6 +125,7 @@
         >
 
         <el-popconfirm
+         v-if="$checkBtnRole('del', $route.meta.roles)"
           confirm-button-text="好的"
           cancel-button-text="不用了"
           icon="el-icon-info"
@@ -260,12 +262,14 @@
           >
             <template slot-scope="scope">
               <el-button
+               v-if="$checkBtnRole('edit', $route.meta.roles)"
                 type="text"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row, scope.$index)"
                 >编辑</el-button
               >
               <el-popconfirm
+               v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"

+ 4 - 0
src/views/basic_data/warehouse/warehouse_cost.vue

@@ -36,12 +36,14 @@
         <el-button
           type="primary"
           size="small"
+           v-if="$checkBtnRole('add', $route.meta.roles)"
           icon="el-icon-plus"
           @click="(showDialog = true), (type = 1)"
           >新增</el-button
         >
 
         <el-popconfirm
+         v-if="$checkBtnRole('del', $route.meta.roles)"
           confirm-button-text="好的"
           cancel-button-text="不用了"
           icon="el-icon-info"
@@ -159,11 +161,13 @@
             <template slot-scope="scope">
               <el-button
                 type="text"
+                 v-if="$checkBtnRole('edit', $route.meta.roles)"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row)"
                 >编辑</el-button
               >
               <el-popconfirm
+               v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"

+ 4 - 1
src/views/basic_data/warehouse/warehouse_site.vue

@@ -41,7 +41,7 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" icon="el-icon-plus" size="small" @click="newData(), (type = 1)"
+        <el-button type="primary" icon="el-icon-plus" size="small" @click="newData(), (type = 1)" v-if="$checkBtnRole('add', $route.meta.roles)"
           >新增</el-button
         >
   <el-popconfirm
@@ -51,6 +51,7 @@
                 icon-color="red"
                 title="内容确定删除吗?"
                 @onConfirm="handleDeleteAll"
+                v-if="$checkBtnRole('del', $route.meta.roles)"
               >
                 <el-button
                   slot="reference"
@@ -170,12 +171,14 @@
                 >详情</el-button
               > -->
               <el-button
+                 v-if="$checkBtnRole('edit', $route.meta.roles)"
                 type="text"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row), (type = 2)"
                 >编辑</el-button
               >
               <el-popconfirm
+                 v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"

+ 371 - 119
src/views/login/index.vue

@@ -1,103 +1,200 @@
 <template>
   <div class="login-container">
-    <el-form
-      ref="loginForm"
-      :model="loginForm"
-      :rules="loginRules"
-      class="login-form"
-      auto-complete="on"
-      label-position="left"
-    >
-      <!-- <div class="title-container">
-        <img src="@/assets/login/title.png" alt="">
-      </div> -->
-      <div class="image-container">
-        <img src="@/assets/login/image.png" alt="" />
-      </div>
-      <div class="right-container">
-        <div class="empty-height" />
-        <div class="form-container">
-          <div class="title">供应链管理系统</div>
-          <!--      <div class="logo">-->
-          <!--        <img src="@/assets/login/logo.png" alt="">-->
-          <!--      </div>-->
-
-          <el-form-item prop="username">
-            <span class="svg-container">
-              <svg-icon icon-class="user" />
-            </span>
-            <el-input
-              ref="username"
-              v-model="loginForm.username"
-              placeholder="请输入用户名"
-              name="username"
-              type="text"
-              tabindex="1"
-              auto-complete="on"
-            />
-          </el-form-item>
-
-          <el-form-item prop="password">
-            <span class="svg-container">
-              <svg-icon icon-class="password" />
-            </span>
-            <el-input
-              :key="passwordType"
-              ref="password"
-              v-model="loginForm.password"
-              :type="passwordType"
-              placeholder="请输入密码"
-              name="password"
-              tabindex="2"
-              auto-complete="off"
-              @keyup.enter.native="handleLogin"
-            />
-            <span class="show-pwd" @click="showPwd">
-              <svg-icon
-                :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
-              />
-            </span>
-          </el-form-item>
-
-          <el-form-item prop="codeValue">
-            <span class="svg-container">
-              <svg-icon icon-class="password" />
-            </span>
-            <el-input
-              ref="codeValue"
-              v-model="loginForm.codeValue"
-              placeholder="请输入验证码"
-              name="codeValue"
-              type="text"
-              tabindex="3"
-              auto-complete="off"
-              @keyup.enter.native="handleLogin"
-            />
-            <div class="code" @click="getCode">
-              <img :src="'data:image/jpeg;base64,' + codeImage" alt="" />
+    <div class="flexBox">
+      <div>
+        <el-form
+          ref="loginForm"
+          :model="loginForm"
+          :rules="loginRules"
+          class="login-form"
+          auto-complete="on"
+          label-position="left"
+         @submit.native.prevent="handleLogin"
+        >
+          <div class="flex">
+            <div class="image-container">
+              <div class="empty-height">
+                <img class="logo" src="@/assets/login/logo.png" alt="" />
+              </div>
+              <el-carousel
+                :interval="5000"
+                arrow="always"
+                height="440px"
+                class="carousel"
+              >
+                <el-carousel-item v-for="item in banner" :key="item.id">
+                  <el-image :z-index="1" :src="item.imgCarouselUrl"></el-image>
+                </el-carousel-item>
+              </el-carousel>
+            </div>
+            <div class="right-container">
+              <div class="empty-height" />
+              <div class="form-container">
+                <div class="flex title">
+                  <div
+                    class="title-item"
+                    :class="acitve == 'pas' ? 'acitve' : ''"
+                    @click="hanleTabs('pas')"
+                  >
+                    密码登录
+                  </div>
+                  <div
+                    class="title-item"
+                    :class="acitve == 'wei' ? 'acitve' : ''"
+                    @click="hanleTabs('wei')"
+                  >
+                    微信登录
+                  </div>
+                </div>
+
+                <div v-if="acitve == 'pas'">
+                  <el-form-item prop="username" class="input-box">
+                    <span class="svg-container">
+                      <el-image
+                        style="width: 20px; height: 20px"
+                        :src="require('@/assets/login/icon_001.png')"
+                        fit="contain "
+                      ></el-image>
+                    </span>
+                    <el-input
+                      ref="username"
+                      v-model="loginForm.username"
+                      placeholder="请输入用户名"
+                      name="username"
+                      type="text"
+                      tabindex="1"
+                      auto-complete="on"
+                    />
+                  </el-form-item>
+
+                  <el-form-item prop="password" class="input-box">
+                    <span class="svg-container">
+                      <el-image
+                        style="width: 20px; height: 20px"
+                        :src="require('@/assets/login/icon_002.png')"
+                        fit="contain "
+                      ></el-image>
+                    </span>
+                    <el-input
+                      :key="passwordType"
+                      ref="password"
+                      v-model="loginForm.password"
+                      :type="passwordType"
+                      placeholder="请输入密码"
+                      name="password"
+                      tabindex="2"
+                      auto-complete="off"
+                      @keyup.enter.native="handleLogin"
+                    />
+                    <span class="show-pwd" @click="showPwd">
+                      <svg-icon
+                        :icon-class="
+                          passwordType === 'password' ? 'eye' : 'eye-open'
+                        "
+                      />
+                    </span>
+                  </el-form-item>
+
+                  <div class="input-box">
+                    <el-form-item prop="codeValue">
+                      <span class="svg-container">
+                        <el-image
+                          style="width: 20px; height: 20px"
+                          :src="require('@/assets/login/icon_003.png')"
+                          fit="contain "
+                        ></el-image>
+                      </span>
+                      <el-input
+                        ref="codeValue"
+                        v-model="loginForm.codeValue"
+                        placeholder="请输入验证码"
+                        name="codeValue"
+                        type="text"
+                        tabindex="3"
+                        auto-complete="off"
+                        @keyup.enter.native="handleLogin"
+                      />
+                    </el-form-item>
+                    <div class="code" @click.stop="getCode">
+                      <img
+                        :src="'data:image/jpeg;base64,' + codeImage"
+                        alt=""
+                      />
+                    </div>
+                  </div>
+
+                  <div class="checkbox">
+                    <div class="check-yes">
+                      <el-image
+                        style="width: 16px; height: 16px"
+                        :src="require('@/assets/login/icon_004.png')"
+                        fit="contain "
+                      ></el-image>
+                      <el-image
+                        v-if="isRemenberPw"
+                        class="yes"
+                        style="width: 11px; height: 11px"
+                        :src="require('@/assets/login/icon_005.png')"
+                        fit="contain "
+                      ></el-image>
+                    </div>
+                    <el-checkbox v-model="isRemenberPw"
+                      >记住账号密码</el-checkbox
+                    >
+                  </div>
+
+                  <div class="button-container">
+                    <el-button
+                      :loading="loading"
+                      type="primary"
+                      @click.native.prevent="handleLogin"
+                      >登录</el-button
+                    >
+                  </div>
+                </div>
+                <div v-else class="wei">
+                  <div style="width: 250px; height: 250px">
+                    <!-- <el-image
+                      style="width: 250px; height: 250px"
+                      :src="require('@/assets/login/icon_001.png')"
+                      fit="contain "
+                    ></el-image> -->
+                  </div>
+                  <div>
+                    <div class="wei-item-tip">使用手机微信扫码登录</div>
+                    <div class="wei-item-text">网页版微信需要配合手机使用</div>
+                  </div>
+                </div>
+              </div>
             </div>
-          </el-form-item>
-
-          <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
-
-          <div class="button-container">
-            <el-button
-              :loading="loading"
-              type="primary"
-              @click.native.prevent="handleLogin"
-              >登录</el-button
-            >
           </div>
+        </el-form>
+      </div>
+      <div class="info">
+        <div class="info-item">
+          <a :href="companyList[0].icpRecordLink">{{
+            companyList[0].icpRecord
+          }}</a>
+          <div style="margin: 0 20px">|</div>
+          <a :href="companyList[0].pubSecurityRecordLink">
+          <el-image
+            style="width: 14px; height: 16px;"
+            :src="require('@/assets/login/icon_0001.png')"
+          ></el-image>
+          {{
+            companyList[0].pubSecurityRecord
+          }}</a>
         </div>
+        <div>{{ companyList[0].companyName }}</div>
       </div>
-    </el-form>
+    </div>
   </div>
 </template>
 
 <script>
 import { validUsername } from "@/utils/validate";
 import Cookies from "js-cookie";
-import { getCode } from "@/api/user";
+import { getCode, getCompanyList, getList } from "@/api/user";
 
 export default {
   name: "Login",
@@ -146,6 +243,9 @@ export default {
       redirect: undefined,
       isRemenberPw: false,
       codeImage: "",
+      acitve: "pas",
+      banner: [],
+      companyList: [],
     };
   },
   watch: {
@@ -168,6 +268,8 @@ export default {
     }
 
     this.getCode();
+    this.getList();
+    this.getCompanyList();
   },
   methods: {
     // 获取验证码
@@ -178,7 +280,21 @@ export default {
         this.codeImage = res.data.pic;
       });
     },
+    getCompanyList() {
+      getCompanyList().then((res) => {
+        this.companyList = res.data;
+
+      });
+    },
+    getList() {
+      getList().then((res) => {
+        this.banner = res.data;
 
+      });
+    },
+    hanleTabs(val) {
+      this.acitve = val;
+    },
     // 显示隐藏密码
     showPwd() {
       if (this.passwordType === "password") {
@@ -193,7 +309,7 @@ export default {
 
     // 登录
     handleLogin() {
-      console.log(this.loginForm);
+      console.log(this.loginForm,'lll');
       this.$refs.loginForm.validate((valid) => {
         if (valid) {
           this.loading = true;
@@ -201,11 +317,8 @@ export default {
             .dispatch("user/login", this.loginForm)
             .then(() => {
               console.log(this.redirect);
-
               this.$router.push({ path: this.redirect || "/" });
-              this.$store.commit("user/showMessage", "yes");
               this.saveUnAndPw();
-
               this.loading = false;
             })
             .catch(() => {
@@ -309,14 +422,22 @@ $back: #333;
       color: $back;
       height: 47px;
       caret-color: $back;
-      border-bottom: 1px solid #eaeaea;
+      // border-bottom: 1px solid #eaeaea;
       &:-webkit-autofill {
         box-shadow: 0 0 0px 1000px $cursor inset !important;
         -webkit-text-fill-color: $back !important;
       }
     }
   }
-
+  .el-carousel__arrow--left,
+  .el-carousel__arrow--right {
+    display: none;
+  }
+  .carousel {
+    border-top-left-radius: 15px;
+    border-bottom-left-radius: 15px;
+    overflow: hidden;
+  }
   .el-form-item {
     border: 1px solid rgba(255, 255, 255, 0.1);
     // background: rgba(0, 0, 0, 0.1);
@@ -325,14 +446,71 @@ $back: #333;
     margin-bottom: 10px;
   }
 
-  .el-checkbox {
-    margin-top: 10px;
-    margin-left: 6px;
+  .el-checkbox__input {
+    display: none;
   }
-
   .el-form-item__error {
     left: 30px;
   }
+  .el-form-item__content {
+    display: flex;
+    align-items: center;
+    line-height: 0;
+  }
+  .show-pwd {
+    line-height: 40px;
+  }
+  .el-checkbox__input.is-checked + .el-checkbox__label {
+    color: #4684f4db;
+  }
+  .checkbox {
+    display: flex;
+    align-items: center;
+    margin-left: 1px;
+    .check-yes {
+      position: relative;
+      line-height: 0;
+    }
+    .yes {
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%, -50%);
+    }
+  }
+  /* 可以设置不同的进入和离开动画 */
+  /* 设置持续时间和动画函数 */
+  .slide-fade-enter-active {
+    transition: all 0.3s ease;
+  }
+  .slide-fade-leave-active {
+    transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
+  }
+  .slide-fade-enter, .slide-fade-leave-to
+/* .slide-fade-leave-active for below version 2.1.8 */ {
+    transform: translateX(10px);
+    opacity: 0;
+  }
+  .wei {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    margin-top: 35px;
+    text-align: center;
+    text-align-last: center;
+    &-item-tip {
+      height: 19px;
+      font-size: 20px;
+      margin-top: 17px;
+    }
+    &-item-text {
+      height: 12px;
+      font-size: 14px;
+      margin-top: 17px;
+      color: #999;
+    }
+  }
 }
 </style>
 
@@ -340,7 +518,83 @@ $back: #333;
 $bg: #2d3a4b;
 $dark_gray: #889aa4;
 $light_gray: #eee;
+.info {
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
+  width: 1080px;
+  margin-top: 50px;
+  line-height: 30px;
+  text-align: center;
+  text-align-last: center;
+  color: #fff;
+}
+.info-item {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.title-item {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  padding: 0 30px;
+  cursor: pointer;
+  font-size: 24px;
+  color: #666666;
+}
+.acitve {
+  font-weight: bold;
+  color: #4684f4;
+}
+.acitve::after {
+  display: block;
+  content: "";
+  margin-top: 7.5px;
+  width: 115px;
+  height: 3px;
+  background-color: #4684f4;
+}
+.flexBox {
+  display: flex;
+  padding-top: calc(50vh - 230px);
+  justify-content: space-between;
+  flex-direction: column;
+  align-items: center;
+}
+.input-box {
+  position: relative;
+  width: 360px;
+  height: 50px;
+  margin-bottom: 20px;
+  background: #ffffff;
+  border: 1px solid #e6e6e6;
+  border-radius: 4px;
+}
+.input-box:last-child {
+  margin-bottom: 10px;
+}
+.flex {
+  display: flex;
+  flex-direction: row;
+}
+.empty-height {
+  height: 46px;
+  margin: 15px 0;
+}
+.logo {
+  height: 46px;
+  width: 460px;
+}
+.el-carousel__item:nth-child(2n) {
+  background-color: #99a9bf;
+}
 
+.el-carousel__item:nth-child(2n + 1) {
+  background-color: #d3dce6;
+}
 .login-container {
   min-height: 100%;
   width: 100%;
@@ -349,39 +603,35 @@ $light_gray: #eee;
 
   .login-form {
     position: relative;
-    width: 1070px;
+    width: 1920px;
     max-width: 100%;
-    padding: 0 35px 0;
-    padding-top: calc(50vh - 230px);
-    margin: 0 auto;
-    overflow: hidden;
+    height: 100%;
+
     display: flex;
+    flex-direction: column;
+    align-items: center;
   }
 
   .image-container {
-    img {
-      width: 560px;
-      height: 460px;
-    }
+    width: 700px;
+    height: 516px;
+    //  overflow: hidden;
   }
 
   .right-container {
     width: 440px;
-    height: 460px;
-    .empty-height {
-      height: 77px;
-    }
+    height: 516px;
     .form-container {
+      height: 440px;
       padding: 20px 30px 27px 40px;
       background: #fff;
       border-radius: 0 15px 15px 0;
       .title {
-        font-size: 24px;
-        font-weight: bold;
+        justify-content: center;
         letter-spacing: 4px;
         text-align: center;
-        padding: 10px 0 13px;
-        color: #3a8ee6;
+        margin-bottom: 35px;
+        padding: 10px 0 0 0;
       }
     }
   }
@@ -399,7 +649,8 @@ $light_gray: #eee;
   }
 
   .svg-container {
-    padding: 6px 5px 6px 5px;
+    margin: 0 0 0 14px;
+    // padding: 6px 5px 6px 5px;
     color: #33aef7;
     vertical-align: middle;
     width: 30px;
@@ -429,6 +680,7 @@ $light_gray: #eee;
     position: absolute;
     right: 30px;
     top: 7px;
+    z-index: 99;
     cursor: pointer;
     img {
       height: 30px;
@@ -442,9 +694,9 @@ $light_gray: #eee;
       font-size: 16px;
       width: 100%;
       height: 45px;
-      border-radius: 45px;
-      background: #33aef7;
-      box-shadow: 2px 3px 8px 0px rgba(5, 155, 245, 0.75);
+      border-radius: 4px;
+      background: #4684f4;
+      box-shadow: 2px 3px 8px 0px #4684f46b;
     }
   }
 }

+ 460 - 0
src/views/login/index2.vue

@@ -0,0 +1,460 @@
+<template>
+  <div class="login-container">
+    <el-form
+      ref="loginForm"
+      :model="loginForm"
+      :rules="loginRules"
+      class="login-form"
+      auto-complete="on"
+      label-position="left"
+    >
+      <!-- <div class="title-container">
+        <img src="@/assets/login/title.png" alt="">
+      </div> -->
+      <div class="image-container">
+        <img src="@/assets/login/image.png" alt="" />
+      </div>
+      <div class="right-container">
+        <div class="empty-height" />
+        <div class="form-container">
+          <div class="title">供应链管理系统</div>
+          <!--      <div class="logo">-->
+          <!--        <img src="@/assets/login/logo.png" alt="">-->
+          <!--      </div>-->
+
+          <el-form-item prop="username">
+            <span class="svg-container">
+              <svg-icon icon-class="user" />
+            </span>
+            <el-input
+              ref="username"
+              v-model="loginForm.username"
+              placeholder="请输入用户名"
+              name="username"
+              type="text"
+              tabindex="1"
+              auto-complete="on"
+            />
+          </el-form-item>
+
+          <el-form-item prop="password">
+            <span class="svg-container">
+              <svg-icon icon-class="password" />
+            </span>
+            <el-input
+              :key="passwordType"
+              ref="password"
+              v-model="loginForm.password"
+              :type="passwordType"
+              placeholder="请输入密码"
+              name="password"
+              tabindex="2"
+              auto-complete="off"
+              @keyup.enter.native="handleLogin"
+            />
+            <span class="show-pwd" @click="showPwd">
+              <svg-icon
+                :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
+              />
+            </span>
+          </el-form-item>
+
+          <el-form-item prop="codeValue">
+            <span class="svg-container">
+              <svg-icon icon-class="password" />
+            </span>
+            <el-input
+              ref="codeValue"
+              v-model="loginForm.codeValue"
+              placeholder="请输入验证码"
+              name="codeValue"
+              type="text"
+              tabindex="3"
+              auto-complete="off"
+              @keyup.enter.native="handleLogin"
+            />
+            <div class="code" @click="getCode">
+              <img :src="'data:image/jpeg;base64,' + codeImage" alt="" />
+            </div>
+          </el-form-item>
+
+          <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
+
+          <div class="button-container">
+            <el-button
+              :loading="loading"
+              type="primary"
+              @click.native.prevent="handleLogin"
+              >登录</el-button
+            >
+          </div>
+        </div>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import { validUsername } from "@/utils/validate";
+import Cookies from "js-cookie";
+import { getCode } from "@/api/user";
+
+export default {
+  name: "Login",
+  data() {
+    const validateUsername = (rule, value, callback) => {
+      if (value.length <= 0) {
+        callback(new Error("请输入用户名"));
+      } else {
+        callback();
+      }
+    };
+    const validatePassword = (rule, value, callback) => {
+      if (value.length <= 0) {
+        callback(new Error("请输入密码"));
+      } else {
+        callback();
+      }
+    };
+    const validateCode = (rule, value, callback) => {
+      if (value.length <= 0) {
+        callback(new Error("请输入验证码"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      loginForm: {
+        username: "",
+        password: "",
+        code: "",
+        codeValue: "",
+      },
+      loginRules: {
+        username: [
+          { required: true, trigger: "change", validator: validateUsername },
+        ],
+        password: [
+          { required: true, trigger: "change", validator: validatePassword },
+        ],
+        codeValue: [
+          { required: true, trigger: "change", validator: validateCode },
+        ],
+      },
+      loading: false,
+      passwordType: "password",
+      redirect: undefined,
+      isRemenberPw: false,
+      codeImage: "",
+    };
+  },
+  watch: {
+    $route: {
+      handler: function (route) {
+        this.redirect = route.query && route.query.redirect;
+      },
+      immediate: true,
+    },
+  },
+  created() {
+    // 获取缓存信息
+    if (localStorage.getItem("supply_login")) {
+      let storageData = JSON.parse(localStorage.getItem("supply_login"));
+      this.loginForm.username = storageData.username;
+      this.isRemenberPw = storageData.isRemenberPw;
+    }
+    if (this.isRemenberPw) {
+      this.getCookie();
+    }
+
+    this.getCode();
+  },
+  methods: {
+    // 获取验证码
+    getCode() {
+      getCode().then((res) => {
+        console.log(res);
+        this.loginForm.code = res.data.code;
+        this.codeImage = res.data.pic;
+      });
+    },
+
+    // 显示隐藏密码
+    showPwd() {
+      if (this.passwordType === "password") {
+        this.passwordType = "";
+      } else {
+        this.passwordType = "password";
+      }
+      this.$nextTick(() => {
+        this.$refs.password.focus();
+      });
+    },
+
+    // 登录
+    handleLogin() {
+      console.log(this.loginForm);
+      this.$refs.loginForm.validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          this.$store
+            .dispatch("user/login", this.loginForm)
+            .then(() => {
+              console.log(this.redirect);
+
+              this.$router.push({ path: this.redirect || "/" });
+              this.$store.commit("user/showMessage", "yes");
+              this.saveUnAndPw();
+
+              this.loading = false;
+            })
+            .catch(() => {
+              this.getCode();
+              this.loginForm.codeValue = "";
+              this.loading = false;
+            });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+
+    // 处理账号密码的储存
+    saveUnAndPw() {
+      let storageData = {
+        username: this.loginForm.username,
+        isRemenberPw: this.isRemenberPw,
+      };
+      localStorage.setItem("supply_login", JSON.stringify(storageData));
+
+      if (this.isRemenberPw) {
+        this.setCookie(this.loginForm.username, this.loginForm.password, 7);
+      }
+    },
+
+    //设置cookie
+    setCookie(c_name, c_pwd, exdays) {
+      var exdate = new Date(); //获取时间
+      exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //保存的天数
+      //字符串拼接cookie
+      window.document.cookie =
+        "supply_username" +
+        "=" +
+        c_name +
+        ";path=/;expires=" +
+        exdate.toGMTString();
+      window.document.cookie =
+        "supply_password" +
+        "=" +
+        c_pwd +
+        ";path=/;expires=" +
+        exdate.toGMTString();
+    },
+
+    //读取cookie
+    getCookie: function () {
+      if (document.cookie.length > 0) {
+        var arr = document.cookie.split("; "); //这里显示的格式需要切割一下自己可输出看下
+        for (var i = 0; i < arr.length; i++) {
+          var arr2 = arr[i].split("="); //再次切割
+          //判断查找相对应的值
+          if (arr2[0] == "supply_username") {
+            this.loginForm.username = arr2[1]; //保存到保存数据的地方
+          } else if (arr2[0] == "supply_password") {
+            this.loginForm.password = arr2[1];
+          }
+        }
+      }
+    },
+
+    //清除cookie
+    clearCookie: function () {
+      this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+/* 修复input 背景不协调 和光标变色 */
+/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
+
+$bg: #283443;
+$light_gray: #fff;
+$cursor: #fff;
+$back: #333;
+
+@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+  .login-container .el-input input {
+    color: $cursor;
+  }
+}
+
+/* reset element-ui css */
+.login-container {
+  background: url("~@/assets/login/background.png") center center;
+  background-size: cover;
+  .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: $back;
+      height: 47px;
+      caret-color: $back;
+      border-bottom: 1px solid #eaeaea;
+      &:-webkit-autofill {
+        box-shadow: 0 0 0px 1000px $cursor inset !important;
+        -webkit-text-fill-color: $back !important;
+      }
+    }
+  }
+
+  .el-form-item {
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    // background: rgba(0, 0, 0, 0.1);
+    border-radius: 5px;
+    color: #454545;
+    margin-bottom: 10px;
+  }
+
+  .el-checkbox {
+    margin-top: 10px;
+    margin-left: 6px;
+  }
+
+  .el-form-item__error {
+    left: 30px;
+  }
+}
+</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: 1070px;
+    max-width: 100%;
+    padding: 0 35px 0;
+    padding-top: calc(50vh - 230px);
+    margin: 0 auto;
+    overflow: hidden;
+    display: flex;
+  }
+
+  .image-container {
+    img {
+      width: 560px;
+      height: 460px;
+    }
+  }
+
+  .right-container {
+    width: 440px;
+    height: 460px;
+    .empty-height {
+      height: 77px;
+    }
+    .form-container {
+      padding: 20px 30px 27px 40px;
+      background: #fff;
+      border-radius: 0 15px 15px 0;
+      .title {
+        font-size: 24px;
+        font-weight: bold;
+        letter-spacing: 4px;
+        text-align: center;
+        padding: 10px 0 13px;
+        color: #3a8ee6;
+      }
+    }
+  }
+
+  .tips {
+    font-size: 14px;
+    color: #fff;
+    margin-bottom: 10px;
+
+    span {
+      &:first-of-type {
+        margin-right: 16px;
+      }
+    }
+  }
+
+  .svg-container {
+    padding: 6px 5px 6px 5px;
+    color: #33aef7;
+    vertical-align: middle;
+    width: 30px;
+    display: inline-block;
+  }
+
+  .title-container {
+    border-radius: 15px 15px 0 0;
+    overflow: hidden;
+    img {
+      width: 100%;
+      display: block;
+    }
+  }
+
+  .show-pwd {
+    position: absolute;
+    right: 30px;
+    top: 7px;
+    font-size: 16px;
+    color: $dark_gray;
+    cursor: pointer;
+    user-select: none;
+  }
+
+  .code {
+    position: absolute;
+    right: 30px;
+    top: 7px;
+    cursor: pointer;
+    img {
+      height: 30px;
+    }
+  }
+
+  .button-container {
+    text-align: center;
+    margin-top: 20px;
+    button {
+      font-size: 16px;
+      width: 100%;
+      height: 45px;
+      border-radius: 45px;
+      background: #33aef7;
+      box-shadow: 2px 3px 8px 0px rgba(5, 155, 245, 0.75);
+    }
+  }
+}
+
+@media only screen and (max-width: 600px) {
+  .image-container {
+    display: none;
+  }
+  .form-container {
+    border-radius: 15px !important;
+  }
+}
+</style>

+ 5 - 1
src/views/sales_policy/components/AddPolicy.vue

@@ -521,6 +521,10 @@ export default {
     },
     // 提交审核
     handleAddPolicy(policyCustomers) {
+      if (!this.conditionList.length) {
+           this.$errorMsg("请添加条件信息 ");
+           return
+      }
       if (policyCustomers.length) {
         var arr = [];
 
@@ -538,7 +542,7 @@ export default {
           });
         });
         this.dictList.forEach((k) => {
-          if (k.mainId == this.searchForm.sysDictId) {
+          if (k.sysDictId == this.searchForm.mainId) {
             this.searchForm.mainName = k.dictValue;
           }
         });

+ 26 - 8
src/views/sales_policy/components/Transfer.vue

@@ -29,12 +29,14 @@
             <el-checkbox-group
               v-model="leftData"
               class="left_box_flex"
+
               @change="handleLeft"
             >
               <el-checkbox
                 v-for="(item, index) in dataL"
                 :key="index"
                 :label="item.id"
+                    :disabled="item.disabled"
               >
                 {{ item.name }}</el-checkbox
               >
@@ -90,7 +92,7 @@
             >
           </el-row>
         </el-col>
-        <el-col class="right_box" :span="9">
+        <el-col class="right_box" :span="9" @mouseover="type=1" @mouseleave="type=2">
           <h4 class="transfer_title">已选经销商</h4>
           <el-checkbox-group
             v-model="rightData"
@@ -156,9 +158,11 @@ export default {
       };
       // 获取经销商列表
       getCrList(customerParams).then((res) => {
+        for (let i = 0; i < res.data.records.length; i++) {
+          res.data.records[i].disabled=false
+        }
         this.dataL = res.data.records;
         console.log(res, "获取经销商列表");
-
         this.listTotal = res.data.total;
       });
     },
@@ -172,14 +176,21 @@ export default {
       this.dataR = this.dataL;
     },
     handleAllDelete() {
+      //  for (let j = 0; j < this.dataL.length; j++) {
+      //         this.dataL[j].disabled = false
+      //       }
       this.dataR = [];
     },
     handleAdd() {
       if (this.type == 1) {
+        // console.log(this.leftData,44545);
         for (let i = 0; i < this.dataL.length; i++) {
           for (let k = 0; k < this.leftData.length; k++) {
             if (this.dataL[i].id == this.leftData[k]) {
-              this.dataR = [...new Set([this.dataL[i], ...this.dataR])];
+              this.dataR = [...new Set([...this.dataR,this.dataL[i]])]
+              // this.rightData =[...this.rightData,this.leftData[k]]
+              // this.dataL[i].disabled = true
+
             }
           }
         }
@@ -188,13 +199,20 @@ export default {
     },
     handleDelete() {
       if (this.type == 2) {
-        for (let i = 0; i < this.dataR.length; i++) {
-          for (let k = 0; k < this.rightData.length; k++) {
-            if (this.dataR[i].id == this.rightData[k]) {
-              this.dataR.splice(i, 1);
-            }
+        const dataArr = JSON.parse(JSON.stringify(this.dataR))
+        const dataArrs =JSON.parse(JSON.stringify(this.rightData))
+        for (let i = 0; i < this.rightData.length; i++) {
+          for (let k = 0; k < this.dataR.length; k++) {
+                          if (this.rightData.includes(this.dataR[k].id) ) {
+                              dataArr.splice(i, 1);
+                              dataArrs.splice(k,1)
+                          }
+
+
           }
         }
+        this.dataR = dataArr
+        this.rightData = dataArrs
       }
     },
     handleSubmit() {

+ 5 - 1
src/views/sales_policy/policy_list.vue

@@ -154,6 +154,7 @@
           type="primary"
           icon="el-icon-plus"
           @click="hanlenewInfo"
+          v-if="$checkBtnRole('add', $route.meta.roles)"
           >新增</el-button
         >
       </el-row>
@@ -179,7 +180,10 @@
             >
             <el-button
               type="text"
-              v-if="scope.row.examineStatus == 'WAIT'"
+              v-if="
+                scope.row.examineStatus == 'WAIT' &&
+                $checkBtnRole('examine', $route.meta.roles)
+              "
               @click="
                 (isShow = 8),
                   (id = scope.row.id),

+ 2 - 1
src/views/sales_rebate/rebate_list.vue

@@ -57,6 +57,7 @@
               <el-button
                 type="primary"
                 size="small"
+                v-if="$checkBtnRole('add', $route.meta.roles)"
                 @click="(dialogVisible = true), (type = 1), getDictList()"
                 >新增</el-button
               >
@@ -124,7 +125,7 @@
             <el-button type="text" size="small" @click="hanleDateil(scope.row)"
               >查看</el-button
             >
-            <el-button type="text" size="small" @click="hanleEdit(scope.row)"
+            <el-button type="text" size="small" @click="hanleEdit(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)"
               >编辑</el-button
             >
             <!-- <el-button type="text" size="small">编辑</el-button> -->

+ 3 - 1
src/views/sales_rebate/salestype_list.vue

@@ -60,6 +60,7 @@
       <el-button
         type="primary"
         size="small"
+        v-if="$checkBtnRole('add', $route.meta.roles)"
         @click="(dialogVisible = true), (type = 1)"
         >新增</el-button
       >
@@ -114,13 +115,14 @@
           min-width="160"
         >
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="hanleEdit(scope.row)"
+            <el-button type="text" size="small" @click="hanleEdit(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)"
               >编辑</el-button
             >
             <!-- <el-button type="text" size="small" @click="hanleDateil(scope.row)">详情</el-button> -->
             <el-popconfirm
               title="这是一段内容确定删除吗?"
               style="margin-left: 10px"
+              v-if="$checkBtnRole('del', $route.meta.roles)"
               @onConfirm="hanleDatele(scope.row.id)"
             >
               <el-button slot="reference" type="text" size="small"

+ 6 - 5
src/views/supply/policy/policy_list.vue

@@ -113,6 +113,7 @@
               size="small"
               type="primary"
               icon="el-icon-plus"
+              v-if="$checkBtnRole('add', $route.meta.roles)"
               @click="toForm()"
               >新增</el-button
             >
@@ -350,19 +351,19 @@
                   <el-button slot="reference" type="text">提审</el-button>
                 </el-popconfirm>
                 <el-button
-                  v-if="scope.row.examineStatus == 'WAIT'"
+                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('examine', $route.meta.roles)"
                   type="text"
                   @click="toExamine(scope.row)"
                   >审核</el-button
                 >
                 <el-button
                   type="text"
-                  v-if="scope.row.examineStatus === 'SAVE'"
+                  v-if="scope.row.examineStatus === 'SAVE'&&$checkBtnRole('edit', $route.meta.roles)"
                   @click="toForm(scope.row)"
                   >编辑</el-button
                 >
                 <el-popconfirm
-                  v-if="scope.row.examineStatus == 'WAIT'"
+                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('apply', $route.meta.roles)"
                   style="margin-left: 10px"
                   title="确定撤回?"
                   @onConfirm="handleCancel(scope.row.id)"
@@ -378,10 +379,10 @@
                 <el-button
                   type="text"
                   @click="toReturn(scope.row)"
-                  v-if="scope.row.examineStatus === 'OK'"
+                  v-if="scope.row.examineStatus === 'OK'&&$checkBtnRole('examine', $route.meta.roles)"
                   >退订</el-button
                 >
-   <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime" >
+   <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime&&$checkBtnRole('examine', $route.meta.roles)" >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>