소스 검색

多条件判断;批次维度默认取样计量数量;

yijing 1 년 전
부모
커밋
92ce3f82e9

+ 17 - 2
src/views/bpm/outgoingManagement/components/AssetsDialog.vue

@@ -282,6 +282,9 @@ export default {
       } 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) {
@@ -360,12 +363,24 @@ export default {
       }
       console.log(this.selectionList);
       let data = null;
-      if (this.dimension != 1) {
+      if (this.dimension == 3) {
         data = await storageApi.getHierarchyList({
           ids: this.selectionList.map((item) => item.id).join(','),
           type: this.dimension
         });
-      } else {
+      } else if (this.dimension == 2) {
+        data = await storageApi.getHierarchyFifo({
+          type: this.dimension,
+          ids: this.selectionList.map((item) => item.id).join(','),
+          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) => {

+ 2 - 2
src/views/bpm/outgoingManagement/outbound.vue

@@ -421,7 +421,7 @@ export default {
     },
     // 获取物品列表
     async getListItems() {
-      const { data } = await getTreeByGroup({ type: 2 });
+      const { data } = await getTreeByGroup({});
       this.goodsLists = data;
     },
     // 打开单据来源弹窗
@@ -668,7 +668,7 @@ export default {
 
       //委外出库
       if (this.bizType == 7 && this.form.productList) {
-        const categoryids = this.form.productList.map(p => p.productCategoryId)
+        const categoryids = this.form.productList.map(p => p.categoryLevelTopId)
         console.log(categoryids, '委外出库的物品id')
         this.formData.extInfo.assetType = categoryids
       }

+ 1 - 1
src/views/bpm/stockManagement/storage.vue

@@ -1381,7 +1381,7 @@ export default {
       const defaultTime = '00:00:00';
       const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
 
-      if (this.bizType === '2' || this.bizType === '6') {
+      if (this.bizType === 2 || this.bizType === '2' || this.bizType === 6 || this.bizType === '6') {
         this.formData.storageTime = this.form.receiveDate
           ? `${this.form.receiveDate} ${defaultTime}`
           : `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;