Преглед на файлове

feat:超管列表筛选

snow преди 2 години
родител
ревизия
d7e9a93a5e

+ 69 - 76
src/store/modules/user.js

@@ -331,24 +331,19 @@ const actions = {
           commit('setCurrentLevel', level)
           //获取公司列表(区分超管和普通账户api)
           const api = isSupertube ? requsetSupertubeCompany : requsetUserBindingCompany
-
           //获取缓存里的业务公司 => 公司名称搜索 => 存在设置为默认公司
           const { data: companyData, code: companyCode } = await api({
             ...(!isSupertube ? ({size: 10000}) : {type: '1'}),
             ...({token: getToken()}),
           })
-          
            //保存公司列表 普通用户和超管使用两个列表需要转换
            let _companylist = []
            if(companyCode === 0) {
             _companylist = isSupertube ? companyData.list : convertCompanylist(companyData.list);
-
             //超管 + 业务公司 需要将 relation_code 设置为 code
             if(isSupertube) _companylist = _companylist.map(item => ({...item, code: item.relation_code}))
-
             commit('setCompanylist', _companylist)
            }
-
            if(companyCode >= 100 && companyCode <= 104){
              resolve("noToken")
              return
@@ -457,7 +452,6 @@ async function getRoleProcess(roleid) {
         return sii;
       });
     }
-
     return si;
   });
   return {
@@ -467,74 +461,73 @@ async function getRoleProcess(roleid) {
   };
 }
 
-function isHasRoute(routes){
-  let isHas = false
-  const chunks = location.hash.split('/')
-  const currentPath = chunks[chunks.length - 1]
-
-  const dfs = (routes) => {
-    routes.forEach(route => {
-      if(route.path === currentPath) isHas = true;
-      if(route.children && route.children.length > 0) dfs(route.children)
-    })
-  }
-
-  dfs([ 
-  {
-    path: "/person",
-    component: () => import("@/layout/index"),
-    redirect: "/person/my-message",
-    hidden: true,
-    alwaysShow: true,
-    meta: {
-      title: "个人中心",
-      icon: "user",
-    },
-    children: [
-      {
-        path: "my-message",
-        component: () => import("@/views/person-infor/my-message"),
-        name: "MyMessage",
-        alwaysShow: true,
-        meta: { title: "我的信息", noCache: true, breadcrumb: true },
-      },
-      {
-        path: "change-phone",
-        component: () => import("@/views/person-infor/change-phone"),
-        name: "ChangePhone",
-        alwaysShow: true,
-        meta: { title: "更换手机号", noCache: true, breadcrumb: true },
-      },
-      {
-        path: "change-password",
-        component: () => import("@/views/person-infor/change-password"),
-        name: "ChangePassword",
-        alwaysShow: true,
-        meta: { title: "修改密码", noCache: true, breadcrumb: true },
-      },
-      {
-        path:'/reload',
-        component:() => import('@/views/reload/index')
-      }
-    ],
-  },
-  //欢迎页
-  {
-    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 },
-      },
-    ],
-  },...routes])
-
-  return isHas
-}
+// function isHasRoute(routes){
+//   let isHas = false
+//   const chunks = location.hash.split('/')
+//   const currentPath = chunks[chunks.length - 1]
+
+//   const dfs = (routes) => {
+//     routes.forEach(route => {
+//       if(route.path === currentPath) isHas = true;
+//       if(route.children && route.children.length > 0) dfs(route.children)
+//     })
+//   }
+
+//   dfs([ 
+//   {
+//     path: "/person",
+//     component: () => import("@/layout/index"),
+//     redirect: "/person/my-message",
+//     hidden: true,
+//     alwaysShow: true,
+//     meta: {
+//       title: "个人中心",
+//       icon: "user",
+//     },
+//     children: [
+//       {
+//         path: "my-message",
+//         component: () => import("@/views/person-infor/my-message"),
+//         name: "MyMessage",
+//         alwaysShow: true,
+//         meta: { title: "我的信息", noCache: true, breadcrumb: true },
+//       },
+//       {
+//         path: "change-phone",
+//         component: () => import("@/views/person-infor/change-phone"),
+//         name: "ChangePhone",
+//         alwaysShow: true,
+//         meta: { title: "更换手机号", noCache: true, breadcrumb: true },
+//       },
+//       {
+//         path: "change-password",
+//         component: () => import("@/views/person-infor/change-password"),
+//         name: "ChangePassword",
+//         alwaysShow: true,
+//         meta: { title: "修改密码", noCache: true, breadcrumb: true },
+//       },
+//       {
+//         path:'/reload',
+//         component:() => import('@/views/reload/index')
+//       }
+//     ],
+//   },
+//   //欢迎页
+//   {
+//     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 },
+//       },
+//     ],
+//   },...routes])
+//   return isHas
+// }
 
 // 区分供应商和业务公司获取不同的菜单列表
 async function getRoleMenuList(level = "") {
@@ -595,8 +588,8 @@ async function getRoleMenuList(level = "") {
     });
   }
 
-  const isHas = isHasRoute(arrag)
-  if(!isHas) router.push('/welcome/dashboard')
+  // const isHas = isHasRoute(arrag)
+  // if(!isHas) router.push('/welcome/dashboard')
   
   return {
     mcode: code,

+ 6 - 2
src/views/sellOut/bargainList/index.vue

@@ -186,12 +186,13 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/bargainList";
+import companyHelper from "@/mixins/companyHelper"
 import { listCol, statusList } from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
   name: "bargainList",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -375,10 +376,13 @@ export default {
       this.parmValue.bidsNo = this.select === "2" ? this.s_input : "";
       this.parmValue.infoNo = this.select === "3" ? this.s_input : "";
       this.parmValue.company_name = this.select === "4" ? this.s_input : "";
+      
       const res = await asyncRequest.list({
         ...this.parmValue,
-        khNo: Array.isArray(this.parmValue.khNo) ? this.parmValue.khNo[0] : ""
+        khNo: Array.isArray(this.parmValue.khNo) ? this.parmValue.khNo[0] : "",
+        needRela: true
       });
+
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 6 - 1
src/views/sellOut/project/index.vue

@@ -431,7 +431,12 @@ export default {
         return;
       }
       this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
+      
+      const res = await asyncRequest.list({
+        ...this.parmValue,
+        needRela: true
+      });
+
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.tableData.map((v) => {

+ 6 - 4
src/views/sellOut/returnOrder/detail.vue

@@ -48,9 +48,9 @@
               title="退货验收审核"
               name="1"
               v-if="
-                status == '2' ||
+               (status == '2' ||
                 status == '3' ||
-                (status == '4' && newTime !== '' && sitem && sitem.return_tag === '2')
+                (status == '4' && newTime !== '' && sitem && sitem.return_tag === '2')) && !isSupertube
               "
             >
               <!----042--->
@@ -65,8 +65,8 @@
               title="业务审核"
               name="2"
               v-if="
-                status == '3' ||
-                (status == '4' && newTime !== '' && sitem && sitem.return_tag === '2')
+                (status == '3' ||
+                (status == '4' && newTime !== '' && sitem && sitem.return_tag === '2')) && !isSupertube
               "
             >
               <audit-form
@@ -105,6 +105,7 @@ import ReturnRecord from "./components/return-record";
 import ReturnCheck from "./components/returnCheck";
 import auditForm from "./components/auditForm";
 import ShowDataTableColumns from "./ShowDataTableColumns";
+import { mapGetters } from "vuex";
 
 export default {
   name: "returnOrderDetail",
@@ -115,6 +116,7 @@ export default {
     auditForm,
   },
   computed: {
+    ...mapGetters(['isSupertube']),
     powers() {
       const tran =
         this.$store.getters.btnList.find(

+ 9 - 3
src/views/sellOut/returnOrder/index.vue

@@ -235,9 +235,11 @@ import asyncRequest from "@/apis/service/sellOut/returnOrder";
 import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
 import { xs_order_source_options, xs_order_type_options } from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+
 export default {
   name: "returnOrder",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   components: {
     addEdit,
   },
@@ -321,7 +323,6 @@ export default {
       const { page, size } = this.parmValue;
       // this.parmValue.start = start || last_start;
       // this.parmValue.end = end || last_end;
-      console.log("11111", this.parmValue.customer_code);
       if (this.parmValue.customer_code.length > 0) {
         this.customerCode = [this.parmValue.customer_code];
       }
@@ -428,7 +429,12 @@ export default {
       this.parmValue.order_code = this.select === "orderNo" ? this.s_input : "";
       let model = JSON.parse(JSON.stringify(this.parmValue));
       model.post_compay = model.post_compay.toString();
-      const res = await asyncRequest.list(model);
+      
+      const res = await asyncRequest.list({
+        ...model,
+        needRela: true
+      });
+
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 1 - 1
src/views/sellOut/salesOrder/index.vue

@@ -519,7 +519,7 @@ export default {
 
       const res = await asyncRequest.list({
         ...this.parmValue,
-        companyNo: this.currentCompany
+        needRela: true
       });
 
       if (res && res.code === 0 && res.data) {

+ 1 - 1
src/views/sellOut/sellAfterApply/detail.vue

@@ -173,7 +173,7 @@ export default {
     ApprovalResults
   },
   computed: {
-    ...mapGetters(['isSuppertube']),
+    ...mapGetters(['isSupertube']),
     powers() {
       const tran = this.$store.getters.btnList.find(
           (item) => item.menu_route == "sellAfterApplyDetail"

+ 9 - 2
src/views/sellOut/sellAfterApply/index.vue

@@ -278,9 +278,11 @@ import { columns } from "./columns";
 import { mapGetters } from "vuex";
 import urlConfig from "@/apis/url-config";
 import { xs_order_source_options, xs_order_type_options } from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
+
 export default {
   name: "sellAfterApply",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -540,7 +542,12 @@ export default {
       this.parmValue.company_name = this.select === "company_name" ? this.s_input : ""; // 申请人部门
 
       let model = JSON.parse(JSON.stringify(this.parmValue));
-      const res = await asyncRequest.list(model);
+      
+      const res = await asyncRequest.list({
+        ...model,
+        needRela: true
+      });
+
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 7 - 2
src/views/sellOut/sellOutOrder/index.vue

@@ -276,9 +276,10 @@ import addEdit from "./components/addEdit.vue";
 import { columns } from "./columns";
 import { shareWebUrl } from "@/config";
 import { xs_order_source_options, xs_order_type_options } from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper";
 export default {
   name: "sellOutOrder",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   components: {
     addEdit,
   },
@@ -576,7 +577,11 @@ export default {
       this.loading = true;
       let model = JSON.parse(JSON.stringify(this.parmValue));
 
-      const res = await asyncRequest.list(model);
+      const res = await asyncRequest.list({
+        ...model,
+        needRela: true
+      });
+      
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 1 - 0
src/views/sellOut/sellReturn/detail.vue

@@ -444,6 +444,7 @@ export default {
     hasPermission({status, process}){
       return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
     },
+    
     async initData() {
       const { code, data, message } = await asyncRequest.detail({
         returnCode: this.queryId,

+ 7 - 2
src/views/sellOut/sellReturn/index.vue

@@ -205,10 +205,11 @@ import asyncRequest from "@/apis/service/sellOut/sellReturn";
 import { mapGetters } from "vuex";
 import urlConfig from "@/apis/url-config";
 import { xs_order_type_options } from "@/assets/js/statusList";
+import companyHelper from "@/mixins/companyHelper"
 
 export default {
   name: "sellReturn",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -476,7 +477,11 @@ export default {
 
       let model = JSON.parse(JSON.stringify(this.parmValue));
 
-      const res = await asyncRequest.list(model);
+      const res = await asyncRequest.list({
+        ...model,
+        needRela: true
+      });
+
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 3 - 1
src/views/sellOut/stockApply/index.vue

@@ -189,12 +189,13 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
+import companyHelper from "@/mixins/companyHelper"
 import asyncRequest from "@/apis/service/sellOut/stockApply";
 import { mapGetters } from "vuex";
 import { columns } from "./columns";
 export default {
   name: "stockApply",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size", "isSupertube"]),
     powers() {
@@ -373,6 +374,7 @@ export default {
       this.parmValue.company_name = this.select === "5" ? this.input : "";
       const res = await asyncRequest.list({
         ...this.parmValue,
+        needRela: true,
         khNo:Array.isArray(this.parmValue.khNo) ? this.parmValue.khNo[0] : ""
       });
       if (res && res.code === 0 && res.data) {

+ 5 - 1
src/views/sellOut/zixunOrder/index.vue

@@ -384,7 +384,11 @@ export default {
       model.salesman = this.select === "3" ? this.s_input : "";
       model.company_name = this.select === "4" ? this.s_input : "";
 
-      const res = await asyncRequest.list(model);
+      const res = await asyncRequest.list({
+        ...model,
+        needRela: true
+      });
+      
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);

+ 3 - 1
src/views/sellOut/zxDiffOrder/detail.vue

@@ -80,7 +80,7 @@
             <el-collapse-item
               title="业务审核"
               name="3"
-              v-if="sitem && sitem.status + '' === '1'"
+              v-if="(sitem && sitem.status + '' === '1') && !isSupertube"
             >
               <add-form
                 :sitem="sitem"
@@ -117,6 +117,7 @@ import asyncRequest from "@/apis/service/sellOut/zxDiffOrder";
 import addForm from "./components/addForm";
 import { showColumns } from "./columns";
 import { xs_order_type_options } from "@/assets/js/statusList";
+import { mapGetters } from "vuex";
 export default {
   name: "zxDiffOrderDetail",
   mixins: [mixinPage, resToken],
@@ -124,6 +125,7 @@ export default {
     addForm,
   },
   computed: {
+    ...mapGetters(['isSupertube']),
     powers() {
       const tran =
         this.$store.getters.btnList.find(

+ 10 - 3
src/views/sellOut/zxDiffOrder/index.vue

@@ -155,15 +155,17 @@
     </div>
   </div>
 </template>
-   <script>
+<script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/zxDiffOrder";
+import companyHelper from "@/mixins/companyHelper";
 import { mapGetters } from "vuex";
 import { columns } from "./columns";
+
 export default {
   name: "zxDiffOrder",
-  mixins: [mixinPage, resToken],
+  mixins: [mixinPage, resToken, companyHelper],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -390,7 +392,12 @@ export default {
       this.parmValue.zxNo = this.select === "1" ? this.input : ""; //竞价类型
       this.parmValue.salesman = this.select === "2" ? this.input : ""; //申请人
       this.parmValue.cpName = this.select === "3" ? this.input : ""; //商品名称
-      const res = await asyncRequest.list(this.parmValue);
+     
+      const res = await asyncRequest.list({
+        ...this.parmValue,
+        needRela: true
+      });
+     
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.tableData.map((v) => {