Ver código fonte

修改领料界面和逻辑

695593266@qq.com 9 meses atrás
pai
commit
bad51403c9

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

@@ -61,14 +61,20 @@ export async function getByRootLevelId(levelId) {
   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));
+}
 
 //工艺路线
 
-
 export async function produceroutingPage(params) {
   const res = await request.get('/main/producerouting/page', { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
-}
+}

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

@@ -0,0 +1,582 @@
+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));
+  },
+  // 调拨保存
+  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));
+};

+ 839 - 0
src/views/produce/components/picking/AssetsDialog.vue

@@ -0,0 +1,839 @@
+<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>
+          </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: '1',
+        productLists: [],
+        columnsVersion: 1,
+        diffCacheKeyUrl: 'wms-warehouseManagement-components-AssetsDialog',
+        cacheKeyUrl: 'wms-warehouseManagement-components-AssetsDialog1',
+        selection: [],
+        dataIndex: ''
+      };
+    },
+    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',
+            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, warehouseItem, index) {
+        let that = this;
+        this.dataIndex = index;
+        this.productLists = [];
+        this.visible = true;
+        this.searchForm.categoryCode = item.categoryCode
+          ? item.categoryCode
+          : item.code;
+        this.searchForm.warehouseId = warehouseItem.id
+          ? warehouseItem.id
+          : warehouseItem.warehouse_id;
+        this.$nextTick(() => {
+          this.$refs.treeList.getTreeData().then((data) => {
+            // that.$nextTick(() => {
+            //   that.categoryLevelId = data.id;
+            //   that.searchForm.categoryLevelId = data.id;
+            //   that.doSearch();
+            // });
+
+            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/produce/components/picking/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>

+ 1 - 1
src/views/produce/components/picking/detailed.vue

@@ -47,7 +47,7 @@
           </template>
 
           <template v-slot:index="{ row, $index }">
-            {{ $index }}
+            {{ $index + 1 }}
           </template>
           <template v-slot:rootCategoryLevelName="{ row, $index }">
             <el-tag>{{ row.rootCategoryLevelName }}</el-tag>

+ 298 - 24
src/views/produce/components/picking/index.vue

@@ -140,20 +140,16 @@
               show-overflow-tooltip
             >
             </el-table-column>
-            <el-table-column label="批次号" prop="batchNo"> </el-table-column>
+            <!-- <el-table-column label="批次号" prop="batchNo"> </el-table-column> -->
 
-            <el-table-column label="数量" prop="demandQuantity" width="180">
+            <el-table-column label="数量" prop="demandQuantity" width="140">
               <template slot-scope="{ row, $index }">
                 <el-form-item>
                   <el-input
                     v-model="row.demandQuantity"
-                    @input="
-                      row.demandQuantity > row.availableCountBase
-                        ? (row.demandQuantity = row.availableCountBase)
-                        : row.demandQuantity
-                    "
+                    @input="changeInput(row, $index)"
                     size="mini"
-                    style="width: 150px"
+                    style="width: 120px"
                   >
                     <template slot="append">{{ row.measuringUnit }}</template>
                   </el-input>
@@ -161,13 +157,34 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="计量库存数量" prop="availableCountBase">
+            <!-- <el-table-column label="计量库存数量" prop="availableCountBase">
               <template slot-scope="{ row, $index }">
                 {{ row.availableCountBase }} {{ row.measuringUnit }}
               </template>
+            </el-table-column> -->
+
+            <el-table-column
+              label="计量库存数量"
+              prop="availableCountBase"
+              width="220"
+              show-overflow-tooltip
+            >
+              <template slot-scope="{ row, $index }">
+                <div v-for="it of row.warehouseList">
+                  <span
+                    v-if="it.availableCountBase != '0'"
+                    @click="chooseInventoryData(row, it, $index)"
+                    style="cursor: pointer"
+                    >{{ it.name ? it.name : it.warehouse_name }}库存数:<span
+                      style="color: green"
+                      >{{ it.availableCountBase }}</span
+                    >{{ row.measuringUnit }}</span
+                  >
+                </div>
+              </template>
             </el-table-column>
 
-            <el-table-column label="领料仓库" prop="warehouseId">
+            <el-table-column label="领料仓库" prop="warehouseId" width="180">
               <template slot-scope="{ row, $index }">
                 <div
                   v-if="
@@ -176,9 +193,11 @@
                   "
                 >
                   <el-select
-                    v-model="row.warehouseId"
+                    v-model="row.warehouseIdList"
                     placeholder="请选择"
                     filterable
+                    multiple
+                    @change="changeWarehouse(row, $index)"
                   >
                     <el-option
                       v-for="item in row.warehouseList"
@@ -207,9 +226,10 @@
 
                 <div v-else>
                   <el-select
-                    v-model="row.warehouseId"
+                    v-model="row.warehouseIdList"
                     placeholder="请选择"
                     filterable
+                    multiple
                   >
                     <el-option
                       v-for="item in row.warehouseLists"
@@ -223,13 +243,29 @@
               </template>
             </el-table-column>
 
-            <!-- <el-table-column
-              label="所选领料仓库的库存数量"
-              prop="availableCountBase"
+            <el-table-column
+              label="领料信息"
+              prop="warehousePick"
+              width="340"
+              show-overflow-tooltip
             >
-            </el-table-column> -->
+              <template slot-scope="{ $index, row }">
+                <div
+                  v-for="it of row.warehousePick"
+                  :key="it.id"
+                  style="display: flex; flex-direction: row"
+                >
+                  <span>{{ it.warehouseName }}</span
+                  >,批次号:{{ it.batchNo }},出库数:<span
+                    style="color: green"
+                    >{{ it.demandQuantity }}</span
+                  >
+                  {{ row.measuringUnit }}
+                </div>
+              </template>
+            </el-table-column>
 
-            <el-table-column label="操作" fixed="right" width="100px">
+            <el-table-column label="操作" width="100px">
               <template slot-scope="{ $index, row }">
                 <el-link type="danger" @click="removeItem(idx, $index)"
                   >删除</el-link
@@ -257,6 +293,12 @@
       ref="pickingListRef"
       @allSelection="allSelection"
     ></pickingList>
+
+    <AssetsDialog
+      ref="assetsRef"
+      :treeIds="treeId"
+      @detailData="detailData"
+    ></AssetsDialog>
   </ele-modal>
 </template>
 
@@ -270,10 +312,12 @@
   } from '@/api/produce/workOrder';
   import { typeName } from '../common.js';
   import { batchSave, znfindVoucherList } from '@/api/produce/picking';
+  import AssetsDialog from './AssetsDialog.vue';
 
   export default {
     components: {
-      pickingList
+      pickingList,
+      AssetsDialog
     },
     props: {
       workListIds: {
@@ -301,7 +345,9 @@
           height: ''
         },
         isFullscreen: false,
-        tabalHeight: 300
+        tabalHeight: 300,
+        treeId: []
+        // warehouseIdList: []
       };
     },
     computed: {
@@ -370,6 +416,29 @@
             });
             this.pickName = res[0].productName + '领料';
 
+            arr[0].pickList.forEach((it) => {
+              it.warehouseIdList = [];
+              it.warehouseIdList.push(it.warehouseId);
+
+              it.warehouseList.forEach((i) => {
+                i.warehouse_name = i.name;
+                i.warehouse_id = i.id;
+              });
+
+              // const data = it.warehouseList.find((i) => i.id == it.warehouseId);
+
+              // if (data) {
+              //   it.warehousePick.push({
+              //     batchNo: data.batchNo,
+              //     demandQuantity: data.demandQuantity,
+              //     warehouseId: data.id,
+              //     warehouseName: data.name
+              //   });
+              // }
+            });
+
+            console.log(arr, 'e.pickList');
+
             // arr.bomDetailDTOS.map(v=>{
             //   this.getInventoryTotalFn(v.id)
             // })
@@ -379,12 +448,158 @@
             this.$set(this, 'workList', arr);
 
             this.getOrderCode();
-            this.getInventoryTotalFn();
+            // this.getInventoryTotalFn();
             this.$forceUpdate();
           });
         }
       },
 
+      changeWarehouse(item, index) {
+        // const data = [];
+        // if (item.warehouseIdList.length != 0) {
+        //   item.warehouseIdList.forEach((it) => {
+        //     const chooseData = item.warehouseList.find((item) => item.id == it);
+        //     data.push(chooseData);
+        //   });
+        // }
+        // const pickData = [...data];
+        // if (data.length != 0) {
+        //   const totalNum = data.reduce((acc, pro) => {
+        //     return pro.availableCountBase
+        //       ? acc + Number(pro.availableCountBase)
+        //       : acc;
+        //   }, 0);
+        //   this.$set(
+        //     this.workList[0].pickList[index],
+        //     'availableCountBase',
+        //     totalNum
+        //   );
+        //   this.$set(
+        //     this.workList[0].pickList[index],
+        //     'warehousePick',
+        //     pickData
+        //   );
+        //   console.log(this.workList[0], 'this.workList[0]');
+        //   this.$forceUpdate();
+        // } else {
+        //   this.$set(this.workList[0].pickList[index], 'warehousePick', []);
+        //   this.$set(this.workList[0].pickList[index], 'availableCountBase', 0);
+        //   this.$set(this.workList[0].pickList[index], 'demandQuantity', 0);
+        // }
+      },
+
+      changeInput(item, index) {
+        if (Number(item.demandQuantity) >= Number(item.availableCountBase)) {
+          this.$set(
+            this.workList[0].pickList[index],
+            'demandQuantity',
+            Number(item.availableCountBase)
+          );
+          const idsList = [];
+          item.warehouseList.forEach((it) => {
+            idsList.push(it.warehouse_id);
+          });
+          this.$set(
+            this.workList[0].pickList[index],
+            'warehouseIdList',
+            idsList
+          );
+        } else if (!Number(item.demandQuantity)) {
+          this.$set(this.workList[0].pickList[index], 'warehouseIdList', []);
+        } else {
+          const idsList = [];
+          let totalNum = 0;
+          // item.warehouseList.forEach((it) => {
+          //   if(Number(it.availableCountBase))
+          // });
+          for (let i = 0; i < item.warehouseList.length; i++) {
+            totalNum += Number(item.warehouseList[i].availableCountBase);
+
+            if (Number(item.demandQuantity) > totalNum) {
+              idsList.push(item.warehouseList[i].warehouse_id);
+            } else {
+              idsList.push(item.warehouseList[i].warehouse_id);
+              break;
+            }
+          }
+
+          this.$set(
+            this.workList[0].pickList[index],
+            'warehouseIdList',
+            idsList
+          );
+        }
+
+        console.log(item);
+      },
+
+      detailData(data, dimension, index) {
+        const itemData = [];
+        data.forEach((it) => {
+          itemData.push({
+            batchNo: it.batchNo,
+            demandQuantity: it.measureQuantity,
+            warehouseId: it.warehouseId,
+            warehouseName: it.warehouseName
+          });
+        });
+
+        const listData = [];
+
+        if (this.workList[0].pickList[index].warehousePick) {
+          this.workList[0].pickList[index].warehousePick.forEach((it) => {
+            listData.push(it);
+          });
+        }
+
+        itemData.forEach((it) => {
+          listData.push(it);
+        });
+
+        const warehouseIdList = [];
+        listData.forEach((it) => {
+          warehouseIdList.push(it.warehouseId);
+        });
+
+        const uniqueArr = Array.from(new Set(warehouseIdList));
+
+        this.$set(this.workList[0].pickList[index], 'warehousePick', listData);
+        this.$set(
+          this.workList[0].pickList[index],
+          'warehouseIdList',
+          uniqueArr
+        );
+
+        const total = this.workList[0].pickList[index].warehousePick.reduce(
+          (acc, pro) => {
+            return pro.demandQuantity ? acc + Number(pro.demandQuantity) : acc;
+          },
+          0
+        );
+
+        this.$set(this.workList[0].pickList[index], 'demandQuantity', total);
+
+        this.$forceUpdate();
+      },
+
+      warehouseChangeNum(item, index) {
+        item.warehousePick.forEach((it) => {
+          if (Number(it.demandQuantity) > Number(it.availableCountBase)) {
+            it.demandQuantity = it.availableCountBase;
+          }
+
+          const totalNum = item.warehousePick.reduce((acc, pro) => {
+            return pro.demandQuantity ? acc + Number(pro.demandQuantity) : acc;
+          }, 0);
+
+          this.$set(
+            this.workList[0].pickList[index],
+            'demandQuantity',
+            totalNum
+          );
+        });
+      },
+
       async getInventoryTotalFn(id) {
         let ids = [];
         this.workList.map((item) => {
@@ -427,9 +642,28 @@
         this.$refs.pickingListRef.open(id, item, '选择列表');
       },
 
+      chooseInventoryData(item, warehouseItem, index) {
+        console.log(item, warehouseItem, index, '111111');
+        this.treeId.push(item.rootCategoryLevelId);
+        this.$refs.assetsRef.open(item, warehouseItem, index);
+      },
+
       allSelection(id, list) {
-        console.log(id, list, '============>');
-        console.log(this.workList, 'workList============>');
+        list.forEach((item) => {
+          item.warehouseList = item.warehouseList
+            ? item.warehouseList
+            : item.warehouseLists;
+        });
+
+        // list.forEach((it) => {
+        //   if (it.warehouseList.length != 0) {
+        //     if (!it.warehouseIdList) {
+        //       it.warehouseIdList = [];
+        //       it.warehouseIdList.push(it.warehouseList[0].warehouse_id);
+        //     }
+        //   }
+        // });
+
         this.workList.forEach((e) => {
           if (e.id == id) {
             e.pickList = list;
@@ -505,6 +739,28 @@
           };
         });
         this.loadingBtn = true;
+
+        // _arr.forEach((item) => {
+        //   item.pickList.forEach((it) => {
+        //     const warehousePick = [];
+        //     if (it.warehouseIdList.length != 0) {
+        //       it.warehouseIdList.forEach((i) => {
+        //         const data = it.warehouseList.find((ii) => ii.id == i);
+        //         if (data) {
+        //           warehousePick.push({
+        //             availableCountBase: data.availableCountBase,
+        //             demandQuantity: data.demandQuantity,
+        //             warehouseId: data.id
+        //           });
+        //         }
+        //       });
+        //     }
+        //     it.warehousePick = warehousePick;
+        //   });
+        // });
+        console.log(_arr, '_arr');
+        // return;
+
         // if (this.clientEnvironmentId == 21) {
         //   let param = {
         //     workOrderId: this.workListIds[0],
@@ -593,10 +849,28 @@
       padding: 0 6px;
     }
   }
+
+  ::v-deep .pick-input.el-input--medium .el-input__inner {
+    height: 22px;
+    line-height: 22px;
+  }
+
+  // ::v-deep .el-select__tags {
+  //   flex-wrap: nowrap;
+  //   overflow: auto;
+  // }
+
+  // ::v-deep .el-select__tags-text {
+  //   max-width: 90px;
+  // }
+
+  // ::v-deep .el-select__tags::-webkit-scrollbar {
+  //   height: 2px !important;
+  // }
 </style>
 
 <style>
-  :v-deep .el-form-item__error {
+  /* :v-deep .el-form-item__error {
     bottom: -6px !important;
-  }
+  } */
 </style>

+ 8 - 0
src/views/produceOrder/index.vue

@@ -441,6 +441,14 @@
             showOverflowTooltip: true
           },
 
+          {
+            prop: 'lineNumber',
+            label: '行号',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true
+          },
+
           {
             slot: 'code',
             label: '生产工单号',

+ 2 - 2
src/views/taskList/index.vue

@@ -45,13 +45,13 @@
         </el-link>
       </template>
       <template v-slot:action="{ row }">
-        <!-- <el-link
+        <el-link
           v-if="tabValue == '2'"
           :underline="false"
           type="primary"
           @click="reassignTask(row)"
           >转派
-        </el-link> -->
+        </el-link>
         <el-link
           :underline="false"
           type="primary"