Kaynağa Gözat

添加采购部门和采购员

xiaodai2022 2 yıl önce
ebeveyn
işleme
b2e431813c

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/index.html


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/css/chunk-eb2aac0a.7c1d831d.css


BIN
dist/static/css/chunk-f6a5093e.3fdfc3a3.css.gz → dist/static/css/chunk-eb2aac0a.7c1d831d.css.gz


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/app.5c051f55.js


BIN
dist/static/js/app.5c051f55.js.gz


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/app.c9b5041a.js


BIN
dist/static/js/app.c9b5041a.js.gz


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-641ec544.79c039a4.js


BIN
dist/static/js/chunk-641ec544.79c039a4.js.gz


BIN
dist/static/js/chunk-641ec544.b3cc8581.js.gz


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-eb2aac0a.e6e9cb02.js


BIN
dist/static/js/chunk-eb2aac0a.e6e9cb02.js.gz


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/chunk-f6a5093e.657ee410.js


BIN
dist/static/js/chunk-f6a5093e.657ee410.js.gz


+ 1 - 2
src/config/env.production.js

@@ -3,8 +3,7 @@ module.exports = {
   title: '采销平台结算系统',
   baseUrl: 'http://wx.wxhr.sit.futurelab.tv',
   api: {
-    baseApi: 'http://inv.sitw.wanyuhengtong.com/',
-    // tableApi: 'http://inv.sit.wanyuhengtong.com/',
+    baseApi: 'http://caixiao.sitw.wanyuhengtong.com/',
     testApi: 'http://inv.test241.wanyuhengtong.com/',
   },
   fileURL: `https://api2.edu.futurelab.tv`,

+ 1 - 0
src/store/getters.js

@@ -9,6 +9,7 @@ const getters = {
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
+  userid: state => state.user.userid,
   introduction: state => state.user.introduction,
   roles: state => state.user.roles,
   errorLogs: state => state.errorLog.logs,

+ 149 - 137
src/store/modules/user.js

@@ -1,144 +1,159 @@
-import { login, logout, userinfo, menuList, dingdingdetail } from '@/apis/user'
+import { login, logout, userinfo, menuList, dingdingdetail } from "@/apis/user";
 import {
   getToken,
   setToken,
   removeToken,
+  setUserId,
+  getUserId,
+  removeUserId,
   getMenu,
   setMenu,
   removeMenu,
   getBtn,
   setBtn,
-  removeBtn
-} from '@/utils/auth'
+  removeBtn,
+} from "@/utils/auth";
 
 const state = {
   token: getToken(),
-  name: '',
-  avatar: require('@/assets/img/avatar.gif'),
-  introduction: '',
-  roles: ['admin'],
+  name: "",
+  userid: getUserId(),
+  avatar: require("@/assets/img/avatar.gif"),
+  introduction: "",
+  roles: ["admin"],
   btnList: getBtn(),
   navList: getMenu(),
-}
+};
 
 const mutations = {
   SET_TOKEN: (state, token) => {
-    state.token = token
+    state.token = token;
+  },
+  SET_USER_ID: (state, userid) => {
+    state.userid = userid;
   },
   SET_MENU: (state, menu) => {
-    state.menu = menu
+    state.menu = menu;
   },
   SET_HAS: (state, has) => {
-    state.has = has
+    state.has = has;
   },
   SET_INTRODUCTION: (state, introduction) => {
-    state.introduction = introduction
+    state.introduction = introduction;
   },
   SET_NAME: (state, name) => {
-    state.name = name
+    state.name = name;
   },
   SET_AVATAR: (state, avatar) => {
-    state.avatar = avatar
+    state.avatar = avatar;
   },
   SET_ROLES: (state, roles) => {
-    state.roles = roles
+    state.roles = roles;
   },
   navListFn(state, val) {
     if (!val) {
       val = [];
     }
     state.navList = val;
-    setMenu(val)
+    setMenu(val);
   },
   btnListFn(state, val) {
     if (!val) {
       val = [];
     }
-    state.btnList = val
-    setBtn(val)
-
+    state.btnList = val;
+    setBtn(val);
   },
-}
+};
 
 const actions = {
   // user login
   login({ commit }, userInfo) {
-    const { username, password } = userInfo
+    const { username, password } = userInfo;
     return new Promise((resolve, reject) => {
       login({ username: username.trim(), password: password })
-        .then(response => {
-          const { data } = response
-          if (response.code === 0) {
-            commit('SET_TOKEN', data.token)
-            setToken(data.token)
+        .then((response) => {
+          const { code, data } = response;
+          if (code === 0) {
+            const { token, userinfo } = data;
+            const { id } = userinfo;
+            console.log(id);
+            commit("SET_TOKEN", token);
+            commit("SET_USER_ID", id);
+            setUserId(id);
+            setToken(token);
           }
-          resolve(response)
-        })
-        .catch(error => {
-          reject(error)
+          resolve(response);
         })
-    })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   dingUserInfor({ commit }, code) {
     return new Promise(async (resolve, reject) => {
       dingdingdetail(code)
-        .then(response => {
-          const { data } = response
-          if (response.code === 0) {
-            commit('SET_TOKEN', data.token)
-            setToken(data.token)
-            resolve("success")
+        .then((response) => {
+          const { code, data } = response;
+          if (code === 0) {
+            const { token, userinfo } = data;
+            const { id } = userinfo;
+            commit("SET_TOKEN", token);
+            setToken(token);
+            commit("SET_USER_ID", id);
+            setUserId(id);
+            resolve("success");
           } else {
-            resolve("error")
+            resolve("error");
           }
         })
-        .catch(error => {
-          reject(error)
-        })
-    })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
   async getMenuList({ commit, that }) {
     return new Promise(async (resolve, reject) => {
       if (!getToken()) {
-        resolve("noToken")
+        resolve("noToken");
       } else {
-        let res = await menuList({})
+        let res = await menuList({});
         if (res.code === 0) {
-          let list = res.data
-          list = list.filter((item) => item.child && item.child.length > 0)
-          let arrag = []
-          let btnList = []
-          console.log(list)
-          list.forEach(v1 => {
+          let list = res.data;
+          list = list.filter((item) => item.child && item.child.length > 0);
+          let arrag = [];
+          let btnList = [];
+          console.log(list);
+          list.forEach((v1) => {
             let pItem = {
               name: v1.menu_route,
               path: `/${v1.menu_route}`,
               meta: {
                 title: v1.menu_name,
-                icon: v1.menu_img
+                icon: v1.menu_img,
               },
-              children: []
-            }
-            v1.child.forEach(v2 => {
+              children: [],
+            };
+            v1.child.forEach((v2) => {
               let item = {
                 path: v2.menu_route,
                 name: v2.menu_route,
                 meta: {
                   title: v2.menu_name,
-                  icon: v2.menu_img
+                  icon: v2.menu_img,
                 },
-                url: v2.menu_url
-              }
+                url: v2.menu_url,
+              };
               let model = {
                 menu_route: v2.menu_route,
-                action: v2.action
-              }
-              btnList.push(model)
-              pItem.children.push(item)
-            })
-            arrag.push(pItem)
-          })
+                action: v2.action,
+              };
+              btnList.push(model);
+              pItem.children.push(item);
+            });
+            arrag.push(pItem);
+          });
           console.log(arrag);
 
           // 生成页面权限
@@ -148,128 +163,125 @@ const actions = {
           // 生成路由
           initRouter(arrag, that);
           // state.commit("loginInfoCommit", res.data);
-          resolve("success")
+          resolve("success");
         } else if (res.code === 101 || res.code === 102) {
-          resolve("noToken")
+          resolve("noToken");
         } else {
-          resolve(res)
+          resolve(res);
         }
       }
-    })
+    });
   },
 
-
-
   // user logout
   logout({ commit, state, dispatch }) {
     return new Promise((resolve, reject) => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', [])
-      removeToken()
-      commit('SET_MENU', '')
-      commit('SET_HAS', '')
+      commit("SET_TOKEN", "");
+      commit("SET_USER_ID", "");
+      commit("SET_ROLES", []);
+      removeToken();
+      removeUserId();
+      commit("SET_MENU", "");
+      commit("SET_HAS", "");
 
-      removeMenu()
-      removeBtn()
+      removeMenu();
+      removeBtn();
       // reset visited views and cached views
       // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
-      dispatch('tagsView/delAllViews', null, { root: true })
-      resolve()
-    })
+      dispatch("tagsView/delAllViews", null, { root: true });
+      resolve();
+    });
   },
 
   // remove token
   resetToken({ commit }) {
-    return new Promise(resolve => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', [])
-      removeToken()
-      resolve()
-    })
+    return new Promise((resolve) => {
+      commit("SET_TOKEN", "");
+      commit("SET_USER_ID", "");
+      commit("SET_ROLES", []);
+      removeToken();
+      removeUserId();
+      resolve();
+    });
   },
-
-
-}
-
-
+};
 
 function initRouter(arr) {
   const IndexRoute = [
-
     // 个人信息
     {
-      path: '/person',
-      component: () => import('@/layout/index'),
-      redirect: '/person/my-message',
+      path: "/person",
+      component: () => import("@/layout/index"),
+      redirect: "/person/my-message",
       hidden: true,
       alwaysShow: true,
       meta: {
-        title: '个人中心',
-        icon: 'user'
+        title: "个人中心",
+        icon: "user",
       },
       children: [
         {
-          path: 'my-message',
-          component: () => import('@/views/person-infor/my-message'),
-          name: 'MyMessage',
+          path: "my-message",
+          component: () => import("@/views/person-infor/my-message"),
+          name: "MyMessage",
           alwaysShow: true,
-          meta: { title: '我的信息', noCache: true, breadcrumb: true }
+          meta: { title: "我的信息", noCache: true, breadcrumb: true },
         },
         {
-          path: 'change-phone',
-          component: () => import('@/views/person-infor/change-phone'),
-          name: 'ChangePhone',
+          path: "change-phone",
+          component: () => import("@/views/person-infor/change-phone"),
+          name: "ChangePhone",
           alwaysShow: true,
-          meta: { title: '更换手机号', noCache: true, breadcrumb: true }
+          meta: { title: "更换手机号", noCache: true, breadcrumb: true },
         },
         {
-          path: 'change-password',
-          component: () => import('@/views/person-infor/change-password'),
-          name: 'ChangePassword',
+          path: "change-password",
+          component: () => import("@/views/person-infor/change-password"),
+          name: "ChangePassword",
           alwaysShow: true,
-          meta: { title: '修改密码', noCache: true, breadcrumb: true }
-        }
-      ]
+          meta: { title: "修改密码", noCache: true, breadcrumb: true },
+        },
+      ],
     },
     //欢迎页
     {
-      path: '/welcome',
-      component: () => import('@/layout/index'),
-      redirect: '/welcome/dashboard',
+      path: "/welcome",
+      component: () => import("@/layout/index"),
+      redirect: "/welcome/dashboard",
       children: [
         {
-          path: 'dashboard',
-          component: () => import('@/views/dashboard/index'),
-          name: 'Dashboard',
-          meta: { title: '首页', icon: 'dashboard', affix: true }
+          path: "dashboard",
+          component: () => import("@/views/dashboard/index"),
+          name: "Dashboard",
+          meta: { title: "首页", icon: "dashboard", affix: true },
         },
-      ]
+      ],
     },
   ];
 
-  arr.map(v1 => {
-    v1.component = (resolve) => require([`@/layout/index.vue`], resolve)
+  arr.map((v1) => {
+    v1.component = (resolve) => require([`@/layout/index.vue`], resolve);
     if (v1.children && v1.children.length > 0) {
-      v1.redirect = `/${v1.name}/${v1.children[0].name}`
-      v1.children.map(v2 => {
-        v2.component = (resolve) => require([`@/views/${v2.url}.vue`], resolve)
-        return v2
-      })
+      v1.redirect = `/${v1.name}/${v1.children[0].name}`;
+      v1.children.map((v2) => {
+        v2.component = (resolve) => require([`@/views/${v2.url}.vue`], resolve);
+        return v2;
+      });
     }
-    return v1
-  })
-  IndexRoute.push(...arr)
+    return v1;
+  });
+  IndexRoute.push(...arr);
   IndexRoute.push({
-    path: '404',
-    component: () => import('@/views/error-page/404'),
+    path: "404",
+    component: () => import("@/views/error-page/404"),
     hidden: false,
-    noCache: true
-  })
+    noCache: true,
+  });
 
   IndexRoute.push({
     path: "*",
-    redirect: '/404',
-  })
+    redirect: "/404",
+  });
   window.vm.$router.addRoutes(IndexRoute);
 }
 
@@ -277,5 +289,5 @@ export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
+  actions,
+};

+ 31 - 19
src/utils/auth.js

@@ -1,58 +1,70 @@
-import Cookies from 'js-cookie'
+import Cookies from "js-cookie";
 
-const TokenKey = 'Purchase-Console-Token'
-const MenuKey = 'Purchase-Console-Menu'
-const BtnKey = 'Purchase-Console-MenuBtn'
-const NoticeKey = "Purchase-Console-Notice"
+const TokenKey = "Purchase-Console-Token";
+const MenuKey = "Purchase-Console-Menu";
+const BtnKey = "Purchase-Console-MenuBtn";
+const NoticeKey = "Purchase-Console-Notice";
+const UserIdKey = "Purchase-Console-UserId";
 export function getToken() {
-  return Cookies.get(TokenKey)
+  return Cookies.get(TokenKey);
 }
 
 export function setToken(token) {
-  return Cookies.set(TokenKey, token)
+  return Cookies.set(TokenKey, token);
 }
 
 export function removeToken() {
-  return Cookies.remove(TokenKey)
+  return Cookies.remove(TokenKey);
+}
+export function getUserId() {
+  return Cookies.get(UserIdKey);
+}
+
+export function setUserId(id) {
+  return Cookies.set(UserIdKey, id);
+}
+
+export function removeUserId() {
+  return Cookies.remove(UserIdKey);
 }
 
 export function getMenu() {
-  const menu = Cookies.get(MenuKey)
+  const menu = Cookies.get(MenuKey);
   if (menu) {
-    return JSON.parse(menu)
+    return JSON.parse(menu);
   } else {
-    return []
+    return [];
   }
 }
 
 export function setMenu(menu) {
-  return Cookies.set(MenuKey, menu)
+  return Cookies.set(MenuKey, menu);
 }
 
 export function removeMenu() {
-  return Cookies.remove(MenuKey)
+  return Cookies.remove(MenuKey);
 }
 
 export function getBtn() {
-  return Cookies.get(BtnKey)
+  return Cookies.get(BtnKey);
 }
 
 export function setBtn(has) {
-  return Cookies.set(BtnKey, has)
+  return Cookies.set(BtnKey, has);
 }
 
 export function removeBtn() {
-  return Cookies.remove(BtnKey)
+  return Cookies.remove(BtnKey);
 }
 
 export function getNotice() {
-  return Cookies.get(NoticeKey)
+  return Cookies.get(NoticeKey);
 }
 
 export function setNotice(has) {
-  return Cookies.set(NoticeKey, has)
+  return Cookies.set(NoticeKey, has);
 }
 
 export function removeNotice() {
-  return Cookies.remove(NoticeKey)
+  return Cookies.remove(NoticeKey);
 }

+ 71 - 22
src/views/network/orderEntry/index.vue

@@ -58,9 +58,9 @@
                     "
                   >
                     <el-option label="确认单编号" value="1"></el-option>
-                     <el-option label="采购单编号" value="2"></el-option>
-                    <el-option label="确认单业务员" value="3"></el-option>
-                    <el-option label="采购单业务员" value="4"></el-option>
+                    <el-option label="采购单编号" value="2"></el-option>
+                    <el-option label="销售员" value="3"></el-option>
+                    <el-option label="采购员" value="4"></el-option>
                   </el-select>
                   <el-button
                     slot="append"
@@ -97,7 +97,7 @@
               </el-col>
             </el-col>
             <el-col :span="24" style="padding: 0">
-              <el-col :span="8" style="width: 470px">
+              <el-col :span="8" style="width: 386px">
                 <search-select
                   :code="code1"
                   :placeholder="'确认单购买方公司名称'"
@@ -106,7 +106,7 @@
                   :size="searchSize"
                 />
               </el-col>
-              <el-col :span="8" style="width: 470px">
+              <el-col :span="8" style="width: 400px">
                 <search-select
                   :code="code2"
                   :placeholder="'采购单供应商名称'"
@@ -115,6 +115,27 @@
                   :size="searchSize"
                 />
               </el-col>
+              <el-col :span="8" style="width: 160px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.suppitem"
+                  placeholder="销售员部门"
+                  @change="
+                    parmValue.page = 1;
+                    pageInfo.curr = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in depart_options"
+                    :key="item.value"
+                    :label="item.value"
+                    :value="item.value"
+                    :disabled="item.status !== '1'"
+                  >
+                  </el-option>
+                </el-select>
+              </el-col>
             </el-col>
           </el-row>
         </div>
@@ -213,8 +234,8 @@
           :type="scope.row.status == '0' ? 'warning' : ''"
           :size="size"
           v-text="
-            (statusOptions.find((item) => item.id == scope.row.status) || {})
-              .label || '--'
+            (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
+            '--'
           "
         ></el-tag>
       </template>
@@ -225,10 +246,7 @@
           v-if="powers.some((item) => item == '007')"
           placement="top"
         >
-          <i
-            class="el-icon-view tb-icon"
-            @click="openModal(scope.row.id, true)"
-          ></i>
+          <i class="el-icon-view tb-icon" @click="openModal(scope.row.id, true)"></i>
         </el-tooltip>
         <el-tooltip
           effect="dark"
@@ -236,10 +254,7 @@
           v-if="powers.some((item) => item == '005')"
           placement="top"
         >
-          <i
-            class="el-icon-edit tb-icon"
-            @click="openModal(scope.row.id, false)"
-          ></i>
+          <i class="el-icon-edit tb-icon" @click="openModal(scope.row.id, false)"></i>
         </el-tooltip>
       </template>
     </ex-table>
@@ -274,12 +289,10 @@ export default {
   mixins: [mixinPage, resToken],
   computed: {
     //组件SIZE设置
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size", "userid"]),
     powers() {
       let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "orderEntry"
-        ) || {};
+        this.$store.getters.btnList.find((item) => item.menu_route == "orderEntry") || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
       } else {
@@ -295,6 +308,36 @@ export default {
       select: "1",
       input: "",
       isDetail: false,
+      depart_options: [
+        {
+          status: "1",
+          value: "网络部",
+        },
+        {
+          status: "1",
+          value: "客服部",
+        },
+        {
+          status: "0",
+          value: "项目部",
+        },
+        {
+          status: "0",
+          value: "平台部",
+        },
+        {
+          status: "0",
+          value: "财务部",
+        },
+        {
+          status: "0",
+          value: "采购部",
+        },
+        {
+          status: "0",
+          value: "产品部",
+        },
+      ],
       // 状态
       statusOptions: [
         { id: "0", label: "禁用" },
@@ -315,7 +358,7 @@ export default {
       parmValue: {
         qrdNo: "", //确认单编号
         cgdNo: "", //采购单编号
-        sale_name: "", //业务
+        sale_name: "", //销售
         cgd_sale: "", //采购员
         endtime: "", //完成时间
         starttime: "", //开始下单时间
@@ -323,6 +366,7 @@ export default {
         supplierNo: "", //供应商编号
         page: 1, // 页码
         size: 15, // 每页显示条数
+        suppitem: "",
       },
       // 表格 - 数据
       tableData: [],
@@ -358,7 +402,7 @@ export default {
         },
         {
           prop: "sale_name",
-          label: "业务员",
+          label: "销售员",
           width: "70px",
         },
         {
@@ -429,12 +473,17 @@ export default {
     };
   },
   mounted() {
+    if (this.userid === "116") {
+      this.parmValue.suppitem = "客服部";
+    }
+    if (this.userid === "65" || this.userid === "71") {
+      this.parmValue.suppitem = "网络部";
+    }
     this.searchList();
   },
   methods: {
     async searchList() {
       this.loading = true;
-      console.log("12345");
       this.parmValue.qrdNo = this.select === "1" ? this.input : "";
       this.parmValue.cgdNo = this.select === "2" ? this.input : "";
       this.parmValue.sale_name = this.select === "3" ? this.input : "";

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor