浏览代码

修改bug

QuKatie 3 年之前
父节点
当前提交
d40fc4ce3d
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/components/crop-select/main.vue

+ 8 - 4
src/components/crop-select/main.vue

@@ -165,7 +165,11 @@ export default {
     collapseTags: Boolean,
     gysType: String,
     treeType: String,
-    belongtocompany: Number
+    belongtocompany: Number,
+    adminProfiles:{
+      type:Boolean,
+      default:true
+    }
   },
   model: {
     prop: "value",
@@ -177,7 +181,7 @@ export default {
     this.title = getCustomerName(this.corpType);
     allCropList({
       corpType: getCustomerCode(this.corpType),
-      adminProfiles: userObj.role_name != "admin" ? userObj.user_id : null,
+      adminProfiles: userObj.role_name != "admin"&&this.adminProfiles ? userObj.user_id : null,
       corpsTypeName: this.treeType == "CK" ? "货代和物流" : null,
       belongtocompany: this.belongtocompany
     }).then(res => {
@@ -252,7 +256,7 @@ export default {
         current: page.currentPage,
         corpsTypeId: this.treeDeptId,
         corpType: getCustomerCode(this.corpType),
-        adminProfiles: userObj.role_name != "admin" ? userObj.user_id : null,
+        adminProfiles: userObj.role_name != "admin"&&this.adminProfiles ? userObj.user_id : null,
         corpsTypeName: this.treeType == "CK" ? "货代和物流" : null,
         belongtocompany: this.belongtocompany
       });
@@ -326,7 +330,7 @@ export default {
       let userObj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
       allCropList({
         corpType: getCustomerCode(this.corpType),
-        adminProfiles: !userObj.role_name.split(',').some(item => item == 'admin' || item == 'administrator') ? userObj.user_id : null,
+        adminProfiles: !userObj.role_name.split(',').some(item => item == 'admin' || item == 'administrator')&&this.adminProfiles ? userObj.user_id : null,
         belongtocompany: belongToCompany,
       }).then(res => {
         this.corpList = res.data.data;