소스 검색

仓库权限

chenrui 2 년 전
부모
커밋
4cff935e71
4개의 변경된 파일22개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 0
      src/api/warehouse.js
  2. 2 1
      src/store/modules/app.js
  3. 11 3
      src/views/common/chooseWarehouse.js
  4. 1 1
      src/views/salesManagement/examineVerify/list.vue

+ 8 - 0
src/api/warehouse.js

@@ -11,6 +11,14 @@ export const warehouseList = (params) => {
     method: 'post'
   })
 }
+//  仓库列表  无分页 有权限
+export const queryAuthWarehouse = (params) => {
+  return axios({
+    url: '/bizuser/queryAuthWarehouse',
+    data: params,
+    method: 'get'
+  })
+}
 //  仓库列表  无分页
 export const warehouseAllList = (params) => {
   const url = '/warehouse/queryList'

+ 2 - 1
src/store/modules/app.js

@@ -40,7 +40,8 @@ const app = {
     priceAuthOptions:[], // 价格权限选项
     curActionPermission: '', // 当前激活状态的权限码
     showPdfPrintView: false, // pdf 打印预览
-    pdfUrl: ''
+    pdfUrl: '',
+    isWarehouse:false,//仓库管理权限
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {

+ 11 - 3
src/views/common/chooseWarehouse.js

@@ -1,4 +1,4 @@
-import { warehouseList } from '@/api/warehouse'
+import { queryAuthWarehouse, warehouseAllList } from '@/api/warehouse'
 const warehouse = {
   template: `
       <a-select
@@ -19,6 +19,10 @@ const warehouse = {
       type: [String, Array],
       defatut: ''
     },
+    isPermission: {// false无权限 true有权限
+      type: Boolean,
+      default: false
+    },
     id: {
       type: String,
       default: ''
@@ -65,9 +69,13 @@ const warehouse = {
     },
     //  获取仓库列表
     getWarehouse () {
-      warehouseList({ pageNo: 1, pageSize: 1000 }).then(res => {
+      const ajaxName = this.isPermission ? queryAuthWarehouse : warehouseAllList
+      ajaxName({}).then(res => {
         if (res.status == 200) {
-          this.warehouseData = res.data.list
+          if (res.data && res.data.length <= 1) {
+
+          }
+          this.warehouseData = res.data
         } else {
           this.warehouseData = []
         }

+ 1 - 1
src/views/salesManagement/examineVerify/list.vue

@@ -65,7 +65,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="仓库">
-                  <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
             </template>