瀏覽代碼

auto commit

gcz 4 年之前
父節點
當前提交
9f62a27f9e

+ 2 - 0
src/store/modules/user.js

@@ -45,6 +45,8 @@ const user = {
     GetInfo({ commit, state }) {
       return new Promise((resolve, reject) => {
         getInfo().then(response => {
+          console.log('用户信息',response.data);
+          localStorage.setItem("permissionList", response.data.resource);
           const data = response.data
           if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
             commit('SET_ROLES', data.roles)

+ 1 - 1
src/views/layout/components/Sidebar/index.vue

@@ -27,7 +27,7 @@ export default {
       'routers'
     ]),
     routes() {
-      console.log('this.routers',JSON.parse(JSON.stringify(this.routers)))
+      // console.log('this.routers',JSON.parse(JSON.stringify(this.routers)))
       // return this.$router.options.routes
       return this.routers
     },

+ 4 - 3
src/views/pms/product/components/ProductInfoDetail.vue

@@ -140,17 +140,18 @@
       selectProductCateValue: function (newValue) {
         // console.log('newValue',newValue);
         if (newValue != null && newValue.length === 2) {
-          this.value.productCategoryId = newValue[1];
-          this.value.productCategoryName= this.getCateNameById(this.value.productCategoryId);
           // 大类ID
           this.value.productBigCategoryId = newValue[0];
           // 大类名称
           this.value.productBigCategoryName= this.getBigCateNameById(this.value.productBigCategoryId);
+
+          this.value.productCategoryId = newValue[1];
+          this.value.productCategoryName= this.getCateNameById(this.value.productCategoryId);          
         } else {
           this.value.productCategoryId = null;
           this.value.productCategoryName=null;
-
           this.value.productBigCategoryId = null;
+          this.value.productBigCategoryName = null;
         }
       }
     },

+ 31 - 3
src/views/pms/product/index.vue

@@ -70,6 +70,7 @@
       <i class="el-icon-tickets"></i>
       <span>数据列表</span>
       <el-button
+        v-if="createPermission"
         class="btn-add"
         @click="handleAddProduct()"
         size="mini">
@@ -163,6 +164,7 @@
                 @click="handleShowProduct(scope.$index, scope.row)">查看
               </el-button> -->
               <el-button
+                v-if="updatePermission"
                 size="mini"
                 @click="handleUpdateProduct(scope.$index, scope.row)">编辑
               </el-button>
@@ -172,10 +174,11 @@
                 size="mini"
                 @click="handleShowLog(scope.$index, scope.row)">日志
               </el-button> -->
-              <el-button size="mini" v-if="scope.row.verifyStatus==0" @click="handleVerify(scope.$index, scope.row)">
+              <el-button size="mini" v-if="scope.row.verifyStatus==0&&verifyPermission" @click="handleVerify(scope.$index, scope.row)">
                 审核
               </el-button>
               <el-button
+                v-if="delPermission"
                 size="mini"
                 type="danger"
                 @click="handleDelete(scope.$index, scope.row)">删除
@@ -311,7 +314,7 @@
           productAttributeCategoryId:null,
           stockList:[],
           productAttr:[],
-          keyword:null
+          keyword:null,          
         },
         operates: [
           {
@@ -369,13 +372,38 @@
         }, {
           value: 0,
           label: '未审核'
-        }]
+        }],
+        permissions:[],
+        verifyPermission:false,//审核权限
+        delPermission:false,//删除权限createPermission
+        updatePermission:false,//编辑权限
+        createPermission:false,//编辑权限
       }
+      
     },
     created() {
       this.getList();
       this.getBrandList();
       this.getProductCateList();
+      //权限列表
+      this.permissions = localStorage.getItem("permissionList").split(',');
+      console.log('this.permissions',this.permissions);
+      // verifyPermission
+      let theverifyPermission = this.permissions.indexOf("/product/update/verify");
+      if(theverifyPermission>=0){this.verifyPermission=true};
+
+      let thedelPermission = this.permissions.indexOf("/update/deleteStatus");
+      if(thedelPermission>=0){this.delPermission=true};
+
+      let theUpdatePermission = this.permissions.indexOf("/product/update/");
+      if(theUpdatePermission>=0){this.updatePermission=true};
+
+      let theCreatePermission = this.permissions.indexOf("/product/create");
+      if(theCreatePermission>=0){this.createPermission=true};      
+      
+
+
+      //权限列表
     },
     watch: {
       selectProductCateValue: function (newValue) {

+ 1 - 1
src/views/ums/company/components/companyDetail.vue

@@ -57,7 +57,7 @@
         <el-input v-model="company.compConPerson"></el-input>
       </el-form-item>
       <el-form-item label="联系方式">
-        <el-input v-model="company.compConType"></el-input>
+        <el-input v-model="company.compConNum"></el-input>
       </el-form-item>
       <el-form-item label="对外企业qq">
         <el-input v-model="company.compQq"></el-input>

+ 1 - 1
src/views/ums/company/index.vue

@@ -99,7 +99,7 @@
           <template slot-scope="scope">{{scope.row.compConPerson}}</template>
         </el-table-column>
         <el-table-column label="联系方式" align="center">
-          <template slot-scope="scope">{{scope.row.compConType}}</template>
+          <template slot-scope="scope">{{scope.row.compConNum}}</template>
         </el-table-column>
         <el-table-column label="对外企业qq" align="center">
           <template slot-scope="scope">{{scope.row.compQq}}</template>