Browse Source

新增生产订单可以查看库存的界面

695593266@qq.com 7 months ago
parent
commit
10a1fa9a37

+ 15 - 6
src/api/classifyManage/itemInformation.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 // 物品信息列表
-export async function getList (params) {
+export async function getList(params) {
   const res = await request.get('/main/category/getList', { params });
   if (res.data.code == 0) {
     return res.data.data;
@@ -8,7 +8,7 @@ export async function getList (params) {
   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 +17,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 +26,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 +35,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,10 +44,19 @@ 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;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 查询仓库下拉列表
+export async function getWarehouseList() {
+  const res = await request.post(`/wms/warehouse/getWarehouseList`, {});
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 598 - 0
src/api/warehouseManagement/index.js

@@ -0,0 +1,598 @@
+import request from '@/utils/request';
+
+export default {
+  //根据人员id获取部门
+  getGroupById: async (id) => {
+    const res = await request.get(`/main/user/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  getApplyoutsource: async (params) => {
+    const res = await request.get(`/mes/applyoutsource/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 入库
+  storage: async (data) => {
+    const res = await request.post('/wms/outintwo/inStorage', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 入库
+  update: async (data) => {
+    const res = await request.post('/wms/outintwo/update', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 批量获取包装编码
+  getAssetNum: async (data) => {
+    const res = await request.post('/wms/outintwo/getAssetNum', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 提交流程(入库)
+  submitTwo: async (data) => {
+    const res = await request.post('/bpm/outinApprove/submitTwo', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 提交流程(出库)
+  submitInsideTwo: async (data) => {
+    const res = await request.post('/bpm/outApprove/submitInsideTwo', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+
+  // 提交质检流程
+  qualityInspectionTwo: async (data) => {
+    const res = await request.post(
+      '/bpm/outinApprove/qualityInspectionTwo',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库列表
+  getList: async (params) => {
+    const res = await request.get(`/wms/outintwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库详情
+  getInboundList: async (params) => {
+    const res = await request.get(`/wms/outintwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库详情
+  getInboundDetailsById: async (id) => {
+    const res = await request.get(`/wms/outintwo/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库详情
+  getInboundDetailsByBizNo: async (id) => {
+    const res = await request.get(`/wms/outintwo/getInfoByBizNo/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 删除入库详情
+  delete: async (data) => {
+    const res = await request.delete('/wms/outintwo/delete', {
+      data
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 物品维度台账列表
+  getProductList: async (params) => {
+    const res = await request.get(`/wms/outindetailtwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 批次维度台账列表
+  getBatchList: async (params) => {
+    const res = await request.get(`/wms/outindetailtwo/batchPage`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 包装维度台账列表
+  getPackingList: async (params) => {
+    const res = await request.get(`/wms/outInDetailRecordTwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取物料维度台账列表
+  getMaterialList: async (params) => {
+    const res = await request.get(`/wms/materialDetail/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过台账id获取出库物品详情
+  getHierarchyList: async (params) => {
+    const res = await request.get(`/wms/outintwo/getHierarchyList`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  getHierarchyFifo: async (data) => {
+    const res = await request.post('/wms/outintwo/getHierarchyFifo', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出库
+  outStorage: async (data) => {
+    const res = await request.post('/wms/outintwo/outStorage', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 更新出库
+  outUpdate: async (data) => {
+    const res = await request.post('/wms/outintwo/outUpdate', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 包装维度流水
+  outInRecordsPage: async (params) => {
+    const res = await request.get(
+      `/wms/outInDetailRecordTwo/outInRecordsPage`,
+      {
+        params
+      }
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 上下架
+  upperLowerShelves: async (data) => {
+    const res = await request.post('/wms/outintwo/listing', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出入库申请列表
+  getinboundRequestsList: async (data) => {
+    const res = await request.get('/wms/applystorage/page', {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出入库申请列表通过入库申请单查询详情
+  getApplystoragedetail: async (data) => {
+    const res = await request.get('/wms/applystoragedetail/list', {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出入库申请列表通过入库申请单查询详情(批量)
+  getApplystoragedetails: async (data) => {
+    const res = await request.post(
+      '/wms/applystoragedetail/listByAppIds',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取物料维度台账列表
+  getInfoBySourceBizNo: async (id) => {
+    const res = await request.get(`/wms/outintwo/getInfoBySourceBizNo/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 质检保存
+  qualityInspection: async (data) => {
+    const res = await request.post(`/wms/outintwo/qualityInspection`, data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过入库申请单查询详情
+  getApplystorageDetailById: async (id) => {
+    const res = await request.get(`/mes/applystorage/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 动态表头
+  fieldModel: async (params) => {
+    const res = await request.get(`/main/fieldmodel/list`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 单价维护
+  unitPriceMaintenance: async (data) => {
+    const res = await request.put(
+      '/wms/stockpackingtwo/unitPriceMaintenance',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 仓库树
+  getWarehouseTrees: async (data) => {
+    const res = await request.get('/wms/warehouse/getTrees', {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过仓库ID获取仓库区域
+  getListByWarehouseId: async (id) => {
+    const res = await request.get(
+      `/wms/warehousearea/getListByWarehouseId/${id}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 根据物品ID获取包装维度
+  getCategoryPackageDisposition: async (data) => {
+    const res = await request.post(
+      '/main/categoryPackageDisposition/list',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过入库单号获取入库明细
+  getOutInRecordsPage: async (data) => {
+    const res = await request.get(
+      `/wms/outInDetailRecordTwo/outInRecordsPage`,
+      {
+        params: data
+      }
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 合并拆分包装
+  disassemblyPackage: async (data) => {
+    const res = await request.post(
+      '/wms/outInDetailRecordTwo/disassemblyPackage',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过物品id获取供货商列表
+  contactQueryByCategoryIdsAPI: async (data) => {
+    const res = await request.post('/eom/contact/queryByCategoryIds', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过销售发货单获取
+  getBySendRecordNo: async (id) => {
+    const res = await request.get(
+      `/eom/saleordersendrecord/getBySendRecordNo/${id}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 调拨出入库
+  allot: async (data) => {
+    const res = await request.post('/wms/outintwo/allot', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 调拨驳回
+  notAllotPass: async (data) => {
+    const res = await request.post('/bpm/outinApprove/notAllotPass', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 调拨保存
+  allotApplySave: async (data) => {
+    const res = await request.post('/wms/allotApply/save', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨列表
+  getAllotApplyPage: async (data) => {
+    const res = await request.get(`/wms/allotApply/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情列表
+  getAllotDetailList: async (data) => {
+    const res = await request.get(`/wms/allotDetail/list`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情
+  getAllotDetail: async (id) => {
+    const res = await request.get(`/wms/allotApply/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 发起库外调拨流程
+  submitAllot: async (data) => {
+    const res = await request.post('/bpm/outinApprove/submitAllot', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  deleteAllot: async (data) => {
+    const res = await request.delete('/wms/allotApply/delete', {
+      data
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出入库列表
+  getOutinList: async (data) => {
+    const res = await request.get(`/wms/outintwo/list`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 拆包
+  takeApartPackage: async (data) => {
+    const res = await request.post(
+      '/wms/outInDetailRecordTwo/takeApartPackage',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 打包
+  combinePackage: async (data) => {
+    const res = await request.post(
+      '/wms/outInDetailRecordTwo/combinePackage',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 保存拣货单
+  savePickgoods: async (data) => {
+    const res = await request.post('/wms/pickgoods/save', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 修改拣货单
+  updatePickgoods: async (data) => {
+    const res = await request.post('/wms/pickgoods/update', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 拣货列表
+  getPickgoodsList: async (data) => {
+    const res = await request.get(`/wms/pickgoods/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取拣货详情
+  getPickgoodsDetails: async (id) => {
+    const res = await request.get(`/wms/pickgoods/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 删除入库详情
+  deletePickgoods: async (data) => {
+    const res = await request.delete('/wms/pickgoods/delete', {
+      data
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 拣货出库
+  pickGoodsOutIn: async (data) => {
+    const res = await request.post('/wms/outintwo/pickGoodsOutIn', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 台账详情调拨列表
+  getAllotDetails: async (data) => {
+    const res = await request.get(`/wms/allotDetail/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 台账详情盘点列表
+  getPlandetails: async (data) => {
+    const res = await request.get(`/wms/plandetail/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+
+  //江南-仓库入库申请
+
+  //入库申请列表
+  getStoreList: async (data) => {
+    const res = await request.get(`/wms/applystoragejn/page`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //入库申请保存
+  saveStoragejn: async (data) => {
+    const res = await request.post('/wms/applystoragejn/save', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //入库申请信息
+  getStoragejnDetails: async (id) => {
+    const res = await request.get(`/wms/applystoragejn/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //入库申请提交
+  submitStoragejn: async (data) => {
+    const res = await request.post('/wms/applystoragejn/submit', data);
+    console.log(res);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //验证是否重复入库
+  isVerifyRepeatIsStock: async (data) => {
+    const res = await request.post(
+      '/wms/outindetailtwo/isVerifyRepeatIsStock',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+};
+
+export const getOutInRecordsPage = async (data) => {
+  const res = await request.get(`/wms/outInDetailRecordTwo/outInRecordsPage`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+};

+ 151 - 0
src/api/warehouseManagement/outin.js

@@ -0,0 +1,151 @@
+import request from '@/utils/request';
+
+export default {
+  //列表
+  list: async (params) => {
+    const res = await request.get('/wms/outin/page', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //列表
+  getAssetNum: async (data) => {
+    const res = await request.post('/wms/outin/getAssetNum', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //保存
+  save: async (data) => {
+    const res = await request.post('/wms/outin/save', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //新保存
+  saveNew: async (data) => {
+    const res = await request.post('/wms/outin/saveNew', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //删除
+  delete: async (data) => {
+    const res = await request.delete('/wms/outin/delete', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //出库实时库存
+  getRealTimeInventory: async (params) => {
+    const res = await request.get(`/wms/outin/getRealTimeInventory`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //出库实时库存
+  pageeLedger: async (params) => {
+    const res = await request.get(`/wms/outin/getOutStock`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //出库物品实时库存
+  getoutDetail: async (params) => {
+    const res = await request.get(`/wms/outin/getOutDetail`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  },
+  //详情
+  getById: async (id) => {
+    const res = await request.get(`/wms/outin/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //出入库单-新增入库单信息
+  addInOut: async (data) => {
+    const res = await request.post('/wms/inout/addInOut', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  },
+  //列表
+  pageWms: async (params) => {
+    const res = await request.get('/wms/inout/page', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  //入库详情
+  getWms: async (id) => {
+    const res = await request.get(`/wms/inout/getInfoById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //库存台账-基本信息
+  getBasicInformation: async (categoryId) => {
+    const res = await request.get(
+      `/wms/outin/getBasicInformation/${categoryId}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  //库存台账-库存明细
+
+  getInventoryDetails: async (params) => {
+    const res = await request.get(`/wms/outin/getInventoryDetails`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //库存台账-库存明细-物料维度
+
+  getMaterielDetails: async (params) => {
+    const res = await request.get(`/wms/outin/getMaterielDetails`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  outApprove: async (params) => {
+    const res = await request.post(`/bpm/outApprove/submit`, params);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  outApproves: async (params) => {
+    const res = await request.post(`/bpm/outinApprove/submit`, params);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  update: async (params) => {
+    const res = await request.put(`/wms/outin/update`, params);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  },
+  updateOutIn: async (params) => {
+    const res = await request.post(`/wms/outin/updateOutIn`, params);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  }
+};

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

@@ -0,0 +1,161 @@
+import request from '@/utils/request';
+
+//条件查询工厂
+// export async function getFactoryarea(params) {
+//   const res = await request.get(`/main/factoryarea/page`, {
+//     params
+//   });
+//   if (res.data.code == 0) {
+//     return res.data.data;
+//   }
+//   return Promise.reject(new Error(res.data.message));
+// }
+
+// // 仓储管理-仓库信息的保存
+// export async function warehouseSave(data) {
+//   return request.post('/warehouseGoodsshelves/newWarehouse/save', data);
+// }
+export default {
+  //条件查询工厂
+  getFactoryarea: async (params) => {
+    const res = await request.get('/main/factoryarea/page', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // /wms/warehouse/page
+  //获取部门
+  tree: async () => {
+    // const res = await request.get('/wms/warehouse/getTrees');
+    const res = await request.get('/main/group/getGroupList');
+    // /wms/warehouse/getTrees
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //根据部门获取员工
+  getUserPage: async (params) => {
+    const res = await request.get('/main/user/getUserPage', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //仓库定义列表
+  list: async (params) => {
+    const res = await request.post(
+      '/wms/warehouse/select/warehouseList',
+      params
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //新增和修改
+  save: function (data) {
+    return request.post('/wms/warehouse/saveNew', data);
+  },
+
+  //新增库区
+  warehouseareaSave: async (data) => {
+    const res = await request.post('/wms/warehouse/save', data);
+
+    return res;
+  },
+  //新增仓库
+  saveOrUpdateWarehouse: async (data) => {
+    const res = await request.post(
+      '/wms/warehouse/saveOrUpdateWarehouse',
+      data
+    );
+
+    return res;
+  },
+  //修改货位状态是不是满的
+  warehouseChangeStatus: async (data) => {
+    const res = await request.put(
+      '/wms/warehouseareagoodsshelvesallocation/update',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+  },
+  //删除
+  delete: async (id) => {
+    const res = await request.get(`/wms/warehouse/delete/${id}`);
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+  },
+  //删除
+  isDelete: async (id) => {
+    const res = await request.get('/wms/warehouse/isDelete/' + id);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据ID获取
+  getById: async (params) => {
+    const res = await request.get(`/wms/warehouse/getById/${params.id}`, {});
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //详情
+  info: function (params) {
+    return request.get('/main/org/info/info', { params });
+  },
+  //树
+  // tree: function (params) {
+  //     return http.asyncCall("/main/org/dept/tree", params,'get')
+  // },
+
+  //查询仓库详情
+
+  warehouseDetail: async (warehouseId) => {
+    const res = await request.post(
+      `/wms/warehouse/warehouseDetail/${warehouseId}`
+    );
+    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;
+    }
+  },
+  //根据货架查货位
+  getListByGoodId: async (goodId) => {
+    const res = await request.get(
+      `/wms/warehouseareagoodsshelvesallocation/getListByGoodId/${goodId}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+
+  eomContact: async (params) => {
+    const res = await request.get(`/eom/contact/page`, params);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  }
+};

+ 25 - 0
src/views/productionPlan/index.vue

@@ -150,6 +150,12 @@
           v-if="$hasPermission('aps:productionplan:changerequest')"
           >变更申请</el-button
         >
+        <el-button
+          class="my-btn"
+          size="mini"
+          v-if="$hasPermission('aps:productionplan:changerequest')"
+          >补料申请</el-button
+        >
         <el-button
           type="info"
           icon="el-icon-upload2"
@@ -1405,6 +1411,25 @@
     margin-bottom: 6px;
   }
 
+  .my-btn {
+    background-color: #d8701b !important;
+    border-color: #d8701b !important;
+    color: #fff !important;
+  }
+
+  .my-btn:hover,
+  .my-btn:focus {
+    background-color: #d8701b !important;
+    border-color: #d8701b !important;
+    color: #fff !important;
+  }
+
+  .my-btn:active {
+    background-color: #d8701b !important;
+    border-color: #d8701b !important;
+    color: #fff !important;
+  }
+
   .check_box {
     width: 100%;
     display: flex;

+ 831 - 0
src/views/workOrder/components/AssetsDialog.vue

@@ -0,0 +1,831 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="物品信息"
+    width="80vw"
+    :maxable="true"
+    append-to-body
+  >
+    <el-form :model="searchForm" label-width="100px">
+      <el-row :gutter="20">
+        <el-col :span="6">
+          <el-form-item label="列表维度:" prop="dimension">
+            <template>
+              <el-select
+                style="width: 100%"
+                @change="changeDimensionHandler"
+                v-model="dimension"
+                placeholder="请选择"
+              >
+                <!-- <el-option label="物料维度" value="4"> </el-option> -->
+                <el-option label="包装维度" value="3"> </el-option>
+                <el-option label="批次维度" value="2"> </el-option>
+                <el-option label="物品维度" value="1"> </el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="物品编码:">
+            <el-input
+              type="text"
+              placeholder="搜索物品编码"
+              v-model="searchForm.categoryCode"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="物品名称:">
+            <el-input
+              type="text"
+              placeholder="搜索物品名称"
+              v-model="searchForm.categoryName"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="批次号:">
+            <el-input
+              type="text"
+              placeholder="搜索批次号"
+              v-model="searchForm.batchNo"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="刻码">
+            <el-input
+              type="text"
+              placeholder="搜索物品刻码"
+              v-model="searchForm.engrave"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="物料代号">
+            <el-input
+              type="text"
+              placeholder="搜索物料代号"
+              v-model="searchForm.materielDesignation"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="发货码">
+            <el-input
+              type="text"
+              placeholder="搜索发货码"
+              v-model="searchForm.barcodes"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="牌号">
+            <el-input
+              type="text"
+              placeholder="搜索牌号"
+              v-model="searchForm.brandNum"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="仓库">
+            <el-select
+              clearable
+              style="width: 100%"
+              v-model="searchForm.warehouseId"
+              disabled
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in warehouseList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="所属工厂" prop="factoryId">
+            <el-select
+              filterable
+              placeholder="请选择"
+              v-model="searchForm.factoryId"
+              clearable
+              class="w100"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="6">
+          <el-form-item label="关键字">
+            <el-input
+              clearable
+              type="text"
+              placeholder="请输入"
+              v-model="searchForm.keyWord"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col>
+          <div style="float: right">
+            <el-button type="primary" @click="doSearch">搜索</el-button>
+            <el-button icon="el-icon-refresh-left" @click="reset"
+              >重置</el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-container class="assets-dialog">
+      <el-aside width="200px" class="wrapper-assets">
+        <AssetTree
+          ref="treeList"
+          :treeIds="treeIds"
+          @handleNodeClick="handleNodeClick"
+        />
+      </el-aside>
+      <el-main>
+        <ele-pro-table
+          row-key="id"
+          :selection.sync="selectionList"
+          ref="table"
+          class="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 550px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :pageSize="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+        >
+          <!-- <template v-slot:outboundNum="{ row }">
+            <el-input
+              type="text"
+              placeholder="请输入"
+              v-model="row.outboundNum"
+              @input="handleInput(row, $event)"
+              :disabled="inputDisabled(row)"
+            ></el-input>
+
+            measureQuantity
+          </template> -->
+          <template v-slot:measureQuantity="{ row }">
+            <span>{{ row.measureQuantity }}{{ row.measureUnit }}</span>
+          </template>
+        </ele-pro-table>
+      </el-main>
+    </el-container>
+
+    <!-- <div slot="footer">
+      <el-button type="primary" @click="confirm">确定</el-button>
+      <el-button @click="cancel">关闭</el-button>
+    </div> -->
+  </ele-modal>
+</template>
+
+<script>
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import storageApi from '@/api/warehouseManagement';
+  import AssetTree from './assetTree.vue';
+  import { getWarehouseList } from '@/api/classifyManage/itemInformation';
+
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  export default {
+    mixins: [tabMixins],
+    components: { AssetTree },
+    props: {
+      treeIds: { type: Array, default: () => [] }
+    },
+    data() {
+      return {
+        factoryList: [],
+        newColumns: [], // 动态表头
+        isShowTable: true,
+        qualityResultOption: [
+          {
+            value: 0,
+            label: '合格'
+          },
+          {
+            value: 1,
+            label: '不合格'
+          }
+        ],
+        qualityStatusOption: [
+          {
+            value: 1,
+            label: '已质检'
+          },
+          {
+            value: 0,
+            label: '未质检'
+          }
+        ],
+        visible: false,
+        tableData: [],
+        total: 0,
+        categoryLevelId: '',
+        searchForm: {
+          categoryCode: '',
+          categoryName: '',
+          batchNo: '',
+          factoryId: '',
+          brandNum: '',
+          engrave: '',
+          barcodes: '',
+          categoryLevelId: '',
+          warehouseId: '',
+          pageNum: 1,
+          size: 20
+        },
+        selectionList: [],
+        materialType: '',
+        warehouseList: [],
+        dimension: '2',
+        productLists: [],
+        columnsVersion: 1,
+        diffCacheKeyUrl: 'wms-warehouseManagement-components-AssetsDialog',
+        cacheKeyUrl: 'wms-warehouseManagement-components-AssetsDialog1',
+        selection: []
+      };
+    },
+    created() {
+      console.log('created');
+
+      this.getFieldModel();
+      this.getWarehouse();
+      this.getFactoryList();
+    },
+    mounted() {
+      // this.$nextTick(() => {
+      //   this.$refs.table.reload();
+      // });
+    },
+    computed: {
+      inputDisabled() {
+        let _this = this;
+        return (row) => {
+          // console.log(row);
+          return (
+            _this.productLists.some((it) => it.categoryId == row.categoryId) ||
+            _this.dimension == '3'
+          );
+        };
+      },
+      columns() {
+        const _this = this;
+        const version = this.columnsVersion;
+
+        let kk = [];
+        let jj = [];
+
+        if (this.dimension == 1) {
+          kk = this.newColumns.map((item) => {
+            return {
+              label: item.label,
+              align: item.align,
+              prop: item.prop,
+              showOverflowTooltip: item.showOverflowTooltip
+            };
+          });
+        } else {
+          kk = [
+            {
+              label: '批次号',
+              prop: 'batchNo',
+              showOverflowTooltip: true
+            }
+          ];
+        }
+
+        if (this.dimension == 3) {
+          jj = [
+            {
+              label: '包装编码',
+              prop: 'packageNo',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '包装数量',
+              prop: 'packingQuantity',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '包装单位',
+              prop: 'packingUnit',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '发货条码',
+              prop: 'barcodes',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '物料代号',
+              prop: 'materielDesignation',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '客户代号',
+              prop: 'clientCode',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '刻码',
+              prop: 'engrave',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              label: '仓库',
+              prop: 'warehouseName',
+              align: 'center',
+              showOverflowTooltip: true
+            }
+          ];
+        }
+
+        let arr = [
+          this.dimension == 1
+            ? {
+                width: 55,
+                type: 'selection',
+                columnKey: 'selection',
+                fixed: 'left',
+                align: 'center',
+                reserveSelection: true,
+                selectable: (row) => {
+                  return !_this.productLists.some(
+                    (it) => it.categoryId == row.categoryId
+                  );
+                }
+              }
+            : {
+                width: 55,
+                type: 'selection',
+                columnKey: 'selection',
+                fixed: 'left',
+                align: 'center',
+                reserveSelection: true,
+                selectable: (row) => {
+                  return !_this.productLists.some(
+                    (it) => it.categoryId == row.categoryId
+                  );
+                }
+              },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 50,
+            align: 'center',
+            label: '序号',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            fixed: 'left',
+            prop: 'categoryCode',
+            label: '物品编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            fixed: 'left',
+            prop: 'categoryName',
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'outboundNum',
+          //   label: '出库数量',
+          //   align: 'center',
+          //   minWidth: '100',
+          //   showOverflowTooltip: true,
+          //   slot: 'outboundNum'
+          // },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryModel',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          ...kk,
+          {
+            prop: 'level',
+            label: '级别',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measureQuantity',
+            slot: 'measureQuantity',
+            label: '库存数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'measureUnit',
+          //   label: '计量单位',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'weight',
+            label: '重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'weightUnit',
+            label: '重量单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          ...jj,
+          {
+            prop: 'supplierName',
+            label: '供应商',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'supplierCode',
+            label: '供应商代号',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ];
+        return arr;
+      }
+    },
+
+    watch: {},
+    methods: {
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+      },
+
+      async getWarehouse() {
+        const { data } = await getWarehouseList();
+        this.warehouseList = data;
+      },
+
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
+
+      // 出库数量限制
+      handleInput(row, value) {
+        if (row.outboundNum <= row.measureQuantity) {
+          // return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
+
+          // 过滤掉非数字和小数点的字符
+          const filteredValue = value.replace(/[^0-9.]/g, '');
+          // 限制只能有一个小数点
+          const singleDotValue = filteredValue.replace(/(\..*)\./g, '$1');
+
+          let finalValue = '';
+          const dotIndex = singleDotValue.indexOf('.');
+          if (dotIndex !== -1) {
+            // 截取小数点后最多两位
+            finalValue = singleDotValue.slice(0, dotIndex + 3);
+          } else {
+            finalValue = singleDotValue;
+          }
+          return (row.outboundNum = finalValue);
+        } else {
+          row.outboundNum = row.measureQuantity;
+        }
+      },
+
+      // 切换维度
+      changeDimensionHandler(e) {
+        this.searchForm.pageNum = 1;
+
+        this.selectionList = [];
+        this.cacheKeyUrl = this.diffCacheKeyUrl + e;
+        this.getTabColumns();
+        this.reload();
+      },
+      async changeDimension(e) {
+        this.dimension = e;
+        if (this.dimension == 1) {
+          // 物品维度
+          const data = await storageApi.getProductList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
+        } else if (this.dimension == 2) {
+          // 批次维度
+          const data = await storageApi.getBatchList(this.searchForm);
+          for (let i = 0; i < data.list.length; i++) {
+            data.list[i].outboundNum = data.list[i].measureQuantity;
+          }
+          this.tableData = data.list;
+          this.total = data.count;
+        } else if (this.dimension == 4) {
+          // 物料维度
+          const data = await storageApi.getMaterialList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
+        } else {
+          // 包装维度
+          const data = await storageApi.getPackingList(this.searchForm);
+          for (let i = 0; i < data.list.length; i++) {
+            data.list[i].outboundNum = data.list[i].packingQuantity;
+          }
+          this.tableData = data.list;
+          this.total = data.count;
+        }
+        console.log(this.tableData);
+        this.updateProductOutboundNums(this.tableData);
+      },
+      updateProductOutboundNums(list) {
+        console.log(this.productLists, 'this.productLists');
+        console.log(this.dimension);
+
+        // 物品时有bug,可能有多条,不用find,用filter
+        if (this.dimension == 1) {
+          //物品层
+          for (let i = 0; i < list.length; i++) {
+            const item = list[i];
+            const matchedProduct = this.productLists.filter(
+              (product) => product.categoryId === item.categoryId
+            );
+            let num = matchedProduct.reduce(
+              (pre, cur) => pre + cur.measureQuantity,
+              0
+            );
+            // console.log(matchedProduct);
+
+            if (matchedProduct.length) {
+              this.$set(item, 'outboundNum', num);
+            }
+            const isSelection = this.selectionList.find(
+              (product) => product.categoryId === item.categoryId
+            );
+            if (isSelection) {
+              this.$set(item, 'outboundNum', isSelection.outboundNum);
+            }
+          }
+        } else {
+          for (let i = 0; i < list.length; i++) {
+            const item = list[i];
+            const matchedProduct = this.productLists.find(
+              (product) => product.id === item.id
+            );
+
+            if (matchedProduct) {
+              this.$set(item, 'outboundNum', matchedProduct.measureQuantity);
+            }
+            const isSelection = this.selectionList.find(
+              (product) => product.id === item.id
+            );
+            if (isSelection) {
+              this.$set(item, 'outboundNum', isSelection.outboundNum);
+            }
+          }
+        }
+      },
+      open(item) {
+        this.productLists = [];
+        this.visible = true;
+        this.searchForm.categoryCode = item.productCode;
+        this.$nextTick(() => {
+          this.$refs.treeList.getTreeData().then((data) => {
+            this.handleNodeClick(data);
+          });
+
+          this.doSearch();
+        });
+      },
+      async confirm() {
+        console.log(this.selectionList);
+
+        if (!this.selectionList.length) {
+          this.$message.error('请至少选择一条数据!');
+          return;
+        }
+        if (this.dimension == 1) {
+          let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+          if (!boolen) {
+            this.$message.error('请输入出库数量!');
+            return;
+          }
+        }
+        console.log(this.selectionList);
+        let data = null;
+        if (this.dimension == 3) {
+          data = await storageApi.getHierarchyList({
+            ids: this.selectionList.map((item) => item.id).join(','),
+            type: this.dimension
+          });
+        } else if (this.dimension == 2) {
+          data = await storageApi.getHierarchyFifo({
+            type: this.dimension,
+            ids: this.selectionList.map((item) => item.id),
+            builders: this.selectionList.map((item) => {
+              return {
+                categoryId: item.categoryId,
+                num: item.outboundNum,
+                id: item.id
+              };
+            })
+          });
+        } else if (this.dimension == 1) {
+          data = await storageApi.getHierarchyFifo({
+            type: this.dimension,
+            builders: this.selectionList.map((item) => {
+              return {
+                categoryId: item.categoryId,
+                num: item.outboundNum,
+                warehouseId: item.warehouseId
+              };
+            })
+          });
+        }
+        // console.log('data-------------------', data);
+        // this.$emit('detailData', data, this.dimension, this.dataIndex);
+        this.cancel();
+      },
+      cancel() {
+        this.selectionList = [];
+        // this.$refs.multipleTable.clearSelection();
+        this.visible = false;
+      },
+      handleSelectionChange(val) {
+        this.selectionList = val;
+      },
+      handleNodeClick(data) {
+        // console.log(data);
+        this.categoryLevelId = data.id;
+        this.searchForm.categoryLevelId = data.id;
+        this.doSearch();
+      },
+      handleCurrentChange() {
+        this.changeDimension(this.dimension);
+      },
+      reset() {
+        this.searchForm = {
+          categoryCode: '',
+          categoryName: '',
+          batchNo: '',
+          brandNum: '',
+          engrave: '',
+          barcodes: '',
+          warehouseId: '',
+          factoryId: '',
+          categoryLevelId: this.categoryLevelId,
+          pageNum: 1,
+          size: 20
+        };
+        this.doSearch();
+      },
+      doSearch() {
+        this.searchForm.pageNum = 1;
+        this.$refs.table.reload();
+        this.$refs.table.reRenderTable();
+      },
+      handleSizeChange() {
+        this.searchForm.pageNum = 1;
+        this.changeDimension(this.dimension, 'page');
+      },
+      // 翻页时,输入的数量会重置
+      updateSelect(data) {
+        if (!this.selectionList.length) {
+          return data;
+        }
+        let ids = this.selectionList.map((item) => item.id);
+        data.list.forEach((item) => {
+          let id = ids.find((id) => item.id === id);
+          if (id) {
+            item.outboundNum = this.selectionList.find(
+              (item) => item.id === id
+            ).outboundNum;
+          }
+        });
+        return data;
+      },
+
+      async datasource({ page, limit, where, order }) {
+        const dimension = this.dimension;
+        let data;
+        // console.log(this.searchForm);
+        // console.log(dimension);
+
+        if (dimension == 1) {
+          data = await storageApi.getProductList({
+            ...where,
+            ...order,
+            ...this.searchForm,
+            pageNum: page,
+            size: limit
+          });
+
+          // console.log(data);
+          // let result = this.updateSelect(data);
+          // return result;
+          this.updateProductOutboundNums(data.list);
+          return data;
+        }
+
+        if (dimension == 2) {
+          data = await storageApi.getBatchList({
+            ...where,
+            ...order,
+            ...this.searchForm,
+            pageNum: page,
+            size: limit
+          });
+          data.list.forEach((item) => {
+            item.outboundNum = item.measureQuantity;
+          });
+          return data;
+        }
+
+        if (dimension == 3) {
+          data = await storageApi.getPackingList({
+            ...where,
+            ...order,
+            ...this.searchForm,
+            pageNum: page,
+            size: limit
+          });
+          data.list.forEach((item) => {
+            item.outboundNum = item.packingQuantity;
+          });
+          this.updateProductOutboundNums(data.list);
+          return data;
+        }
+      },
+      reload(where) {
+        this.$refs.table.reload({
+          pageNum: 1
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .el-dialog__wrapper {
+    ::v-deep .el-aside {
+      background-color: #fff !important;
+      border: 1px solid #ccc;
+    }
+  }
+
+  .wrapper-assets {
+    max-height: 53vh;
+    overflow: auto;
+  }
+</style>

+ 124 - 0
src/views/workOrder/components/assetTree.vue

@@ -0,0 +1,124 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      :default-expanded-keys="current && current.id ? [current.id] : []"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getTreeByIds } from '@/api/classifyManage';
+
+  export default {
+    props: {
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+
+      treeIds: {
+        type: Array,
+        default: []
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+    },
+    data() {
+      return {
+        treeList: [],
+        treeLoading: false,
+        current: {},
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      // 获取树结构数据
+      getTreeData() {
+        return new Promise(async (resolve) => {
+          try {
+            this.treeLoading = true;
+
+            const res = await getTreeByIds({ ids: this.treeIds.join(',') });
+            this.treeLoading = false;
+            if (res?.code === '0') {
+              this.treeList = res.data;
+              this.$emit('setRootId', res.data[0]);
+
+              this.$nextTick(() => {
+                // 默认高亮第一级树节点
+                if (this.treeList[0]) {
+                  this.setCurrentKey(this.treeList[0]);
+                  this.current = this.treeList[0];
+                  // 默认点击加载数据
+                  // const firstNode = document.querySelector('.el-tree-node');
+                  // firstNode.click();
+                  resolve(this.current);
+                }
+              });
+              return this.treeList;
+            }
+          } catch (error) {
+            console.log(error);
+          }
+          this.treeLoading = false;
+        });
+      },
+
+      handleNodeClick(data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 19 - 2
src/views/workOrder/index.vue

@@ -155,6 +155,13 @@
           >
             拆单
           </el-link>
+          <el-link
+            :underline="false"
+            type="primary"
+            @click="checkInventory(row)"
+          >
+            库存
+          </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此子单吗?"
@@ -185,6 +192,8 @@
       :current="dispatchRow"
       :detailsVisible.sync="detailsVisible"
     />
+
+    <AssetsDialog ref="assetsRef" :treeIds="treeId"></AssetsDialog>
   </div>
 </template>
 
@@ -210,6 +219,7 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import BatchDialog from '@/views/workOrder/components/batchDialog.vue';
   import Details from './components/details.vue';
+  import AssetsDialog from './components/AssetsDialog.vue';
   export default {
     mixins: [tabMixins],
     components: {
@@ -218,7 +228,8 @@
       unpackDialog,
       releaseDialog,
       BatchDialog,
-      Details
+      Details,
+      AssetsDialog
     },
     data() {
       return {
@@ -271,7 +282,8 @@
         dispatchVisible: false,
         selectionMap: {},
         detailsVisible: false,
-        tabValue: '1'
+        tabValue: '1',
+        treeId: []
       };
     },
     computed: {
@@ -941,6 +953,11 @@
         this.reload();
       },
 
+      checkInventory(item) {
+        this.treeId.push(item.rootCategoryLevelId);
+        this.$refs.assetsRef.open(item);
+      },
+
       stationChange() {
         this.crewList = [];
         this.crewIds = [];