huang_an 2 tahun lalu
induk
melakukan
75af526e8d

+ 9 - 7
src/api/classifyManage/itemInformation.js

@@ -1,14 +1,16 @@
 import request from '@/utils/request';
 // 物品信息列表
-export async function getList (data) {
-  const res = await request.post('/main/category/getList', data);
+export async function getList(data) {
+  const res = await request.get(
+    `/main/category/getList?categoryLevelId=${data.categoryLevelId}&pageNum=${data.pageNum}&size=${data.size}&searchKey=${data.searchKey}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 // 物品信息保存
-export async function informationAdd (data) {
+export async function informationAdd(data) {
   const res = await request.post('/main/category/add', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -17,7 +19,7 @@ export async function informationAdd (data) {
 }
 
 // 物品信息编辑
-export async function informationEdit (data) {
+export async function informationEdit(data) {
   const res = await request.post('/main/category/edit', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -26,7 +28,7 @@ export async function informationEdit (data) {
 }
 
 // 物品信息详情
-export async function getDetails (id) {
+export async function getDetails(id) {
   const res = await request.get(`/main/category/info/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -35,7 +37,7 @@ export async function getDetails (id) {
 }
 
 // 物品信息删除
-export async function removeItem (id) {
+export async function removeItem(id) {
   const res = await request.get(`/main/category/remove/${id}`, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -44,7 +46,7 @@ export async function removeItem (id) {
 }
 
 // 物品信息获取编码
-export async function getOrderNo (prefix) {
+export async function getOrderNo(prefix) {
   const res = await request.get(`/main/category/createOrderNo/${prefix}`, {});
   if (res.data.code == 0) {
     return res.data.data;

+ 19 - 0
src/api/warehouseManagement/warehouseDefinition.js

@@ -119,5 +119,24 @@ export default {
     if (res.data.code == 0) {
       return res.data.data;
     }
+  },
+  //根据仓库查询库区
+  getListByWarehouseId: async (id) => {
+    const res = await request.get(
+      `/wms/warehousearea/getListByWarehouseId/${id}`,
+      {}
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据库区查货架
+  getListByAreaId: async (id) => {
+    const res = await request.get(
+      `/wms/warehouseareagoodsshelves/getListByAreaId/${id}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
   }
 };

+ 11 - 2
src/components/AssetTree/index.vue

@@ -39,7 +39,7 @@
       defaultExpandAll: {
         type: Boolean,
         default: function () {
-          return true;
+          return false;
         }
       },
       // 初始请求treeList
@@ -93,7 +93,7 @@
           this.treeLoading = true;
           const requestApi =
             this.paramsType === 'type'
-              ? getTreeByType.bind(null, this.type)
+              ? getTreeByPid.bind(null, this.type)
               : getTreeByPid.bind(null, this.id);
 
           const res = await requestApi();
@@ -106,6 +106,15 @@
             }
             this.$nextTick(() => {
               // 默认高亮第一级树节点
+              //defaultExpandAll父组件传过来为false 不展开所有树,就默认展开根节点的子节点
+              if (!this.defaultExpandAll) {
+                // 手动展开第一级树节点的子节点
+                const rootNode = this.$refs.tree.getNode(this.treeList[0]);
+                if (rootNode) {
+                  rootNode.expanded = true;
+                }
+              }
+
               if (this.treeList[0]) {
                 this.setCurrentKey(this.treeList[0].id);
                 this.handleNodeClick(

+ 8 - 10
src/views/warehouseManagement/components/WareHouseDailog.vue

@@ -26,7 +26,7 @@
                 v-for="(item, index) in areaList"
                 :key="index"
                 :label="item.name"
-                :value="item.code"
+                :value="item.id"
                 @click.native="formData.area = item"
               ></el-option>
             </el-select> </el-form-item
@@ -126,13 +126,15 @@
         this.locationList = [];
         this.area = '';
       },
-      getshelvesList() {
+      async getshelvesList(e) {
         this.cur = {};
         this.shelves = '';
         this.locationList = [];
         this.shelvesList = this.areaGoodsshelvesList.filter(
           (i) => i.reservoirAreaCode === this.area
         );
+        const rep = await warehouseDefinition.getListByAreaId(e);
+        console.log(rep);
       },
       changeshelvesList() {
         this.cur = {};
@@ -142,12 +144,10 @@
       },
       getStatus: useDict(warehouseDefinition_locationStatus),
       async open(row) {
-        // console.log(item, row);
         this.row = row;
         this.visible = true;
         await this._getWarehouseChildren();
         if (this.row?.warehouseId) {
-          console.log(55555);
           this.warehouse = this.row.warehouseId;
           this.formData.warehouse = this.warehouseList.find(
             (w) => w.id == this.row.warehouseId
@@ -171,8 +171,6 @@
             (w) => w.code == this.row.shelfCode
           );
           this.shelves = this.row.shelfCode;
-          console.log(this.row.shelfCode);
-          console.log(this.shelves);
 
           this.allocationReqList = res.goodsAllocationList || [];
           this.locationList = this.allocationReqList.filter(
@@ -185,11 +183,11 @@
       },
       async changeWarehouse(val) {
         this.formData.warehouse = val;
-        const res = await warehouseDefinition.getById({ id: val.id });
+        const res = await warehouseDefinition.getListByWarehouseId(val.id);
 
         this.area = '';
         this.shelves = '';
-        this.areaList = res.reservoirAreaList || [];
+        this.areaList = res || [];
         this.areaGoodsshelvesList = res.goodsShelvesList || [];
         this.allocationReqList = res.goodsAllocationList || [];
       },
@@ -215,8 +213,8 @@
         this.cancel();
       },
       async _getWarehouseChildren() {
-        const res = await warehouseDefinition.list();
-        this.warehouseList = res.list;
+        const res = await warehouseDefinition.list({});
+        this.warehouseList = res;
 
         // const res = await getWarehouseChildren();
         // if (res?.success) {

+ 2 - 0
src/views/warehouseManagement/components/selectType.vue

@@ -227,8 +227,10 @@
           ...this.pages,
           // type: this.curType,
           // code: this.value,
+          searchKey: this.value,
           categoryLevelId: this.classificationId
         };
+        console.log(params);
         const res = await getList(params);
 
         if (res && this.classificationId == params.categoryLevelId) {

+ 11 - 10
src/views/warehouseManagement/stockManagement/add.vue

@@ -330,7 +330,7 @@
                       "
                     >
                       <template slot="append">
-                        {{ row.minPackUnit }}
+                        {{ row.minPackUnit }}
                       </template>
                     </el-input>
                   </el-form-item>
@@ -1140,15 +1140,16 @@
 
             let obj = { ...this.formData, type: 1 };
             obj.outInDetailAddPOList = arr;
-            this.saveLoading = true;
-            try {
-              const res = await outin.save(obj);
-              if (res.code == 0) {
-                this.$message.success('保存成功!');
-              }
-            } catch (error) {}
-            this.saveLoading = false;
-            this.$router.push('/warehouseManagement/stockManagement');
+            console.log('====数据', obj);
+            // this.saveLoading = true;
+            // try {
+            //   const res = await outin.save(obj);
+            //   if (res.code == 0) {
+            //     this.$message.success('保存成功!');
+            //   }
+            // } catch (error) {}
+            // this.saveLoading = false;
+            // this.$router.push('/warehouseManagement/stockManagement');
           }
         });
       },

+ 10 - 10
src/views/warehouseManagement/stockManagement/index.vue

@@ -17,21 +17,21 @@
               ></el-date-picker> </el-form-item
           ></el-col>
           <el-col :span="4">
-            <el-form-item label="入库单号" prop="bizNo">
+            <el-form-item label="入库单号" prop="bizNum">
               <el-input
                 size="small"
                 class="w100"
                 placeholder="请输入"
-                v-model="formData.bizNo"
+                v-model="formData.bizNum"
               ></el-input> </el-form-item
           ></el-col>
           <el-col :span="4">
-            <el-form-item label="经手人" prop="fromUser">
+            <el-form-item label="经手人" prop="deliveryName">
               <el-input
                 size="small"
                 class="w100"
                 placeholder="请输入"
-                v-model="formData.fromUser"
+                v-model="formData.deliveryName"
               ></el-input> </el-form-item
           ></el-col>
 
@@ -102,9 +102,9 @@
           </span>
         </template>
         <!-- 单号链接 -->
-        <template v-slot:bizNo="{ row }">
+        <template v-slot:bizNum="{ row }">
           <el-link @click="details(row)">
-            {{ row.bizNo }}
+            {{ row.bizNum }}
           </el-link>
         </template>
 
@@ -144,8 +144,8 @@
         sceneState,
         tableData: [],
         formData: {
-          bizNo: '',
-          fromUser: '',
+          bizNum: '',
+          deliveryName: '',
           time: [],
           verifyStatus: ''
           // type: 1
@@ -166,10 +166,10 @@
           },
 
           {
-            prop: 'bizNo',
+            prop: 'bizNum',
             label: '单号',
             align: 'center',
-            slot: 'bizNo',
+            slot: 'bizNum',
             showOverflowTooltip: true
           },
           {