Ver código fonte

Merge branch 'dev' of git.echepei.com:zhujiawei/Warehouse_management_ui into dev

caojunjie 3 anos atrás
pai
commit
29ad7d52e2
1 arquivos alterados com 30 adições e 5 exclusões
  1. 30 5
      src/views/system/user/index.vue

+ 30 - 5
src/views/system/user/index.vue

@@ -262,6 +262,18 @@
               </el-radio-group>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="仓库">
+              <el-select v-model="form.warehouseIds" placeholder="请选择仓库" multiple>
+                <el-option
+                  v-for="(item, index) in warehouseOptions"
+                  :key="index.fId"
+                  :label="item.fName"
+                  :value="item.fId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
@@ -357,6 +369,9 @@ import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/system/dept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {
+  listWarehousesss,
+} from "@/api/basicdata/warehouse";
 
 export default {
   name: "User",
@@ -459,14 +474,16 @@ export default {
             trigger: "blur"
           }
         ]
-      }
+      },
+      // 仓库
+      warehouseOptions: [],
     };
   },
   watch: {
     // 根据名称筛选部门树
     deptName(val) {
       this.$refs.tree.filter(val);
-    }
+    },
   },
   created() {
     this.getList();
@@ -483,6 +500,10 @@ export default {
     this.getDicts("user_system").then(response => {
       this.SystemOptions = response.data;
     });
+    listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
+      this.warehouseOptions = response.rows;
+      this.warehouseOptions.unshift({fId: 0,fName: '全部'})
+    });
   },
   methods: {
     /** 查询用户列表 */
@@ -548,7 +569,8 @@ export default {
         remark: undefined,
         postIds: [],
         roleIds: [],
-        userSystem:undefined
+        userSystem:undefined,
+        warehouseIds: [0],
       };
       this.resetForm("form");
     },
@@ -573,6 +595,8 @@ export default {
     handleAdd() {
       this.reset();
       this.getTreeselect();
+      // 默认全部
+      this.$set(this.form, 'warehouseIds', [0])
       getUser().then(response => {
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
@@ -588,6 +612,7 @@ export default {
       const userId = row.userId || this.ids;
       getUser(userId).then(response => {
         this.form = response.data;
+        this.form.warehouseIds = response.warehouseIds
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
         this.form.postIds = response.postIds;
@@ -682,7 +707,7 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
-    }
-  }
+    },
+  },
 };
 </script>