huang_an 1 rok pred
rodič
commit
7d51e70d3e

+ 18 - 26
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/boxTabPage.vue

@@ -1,21 +1,14 @@
 <template>
   <div>
-    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-      <el-tab-pane
-        v-for="item in tabOption"
-        :label="item.label"
-        :name="item.name"
-      >
-      </el-tab-pane>
-    </el-tabs>
-    <keep-alive>
+    <div v-for="item in tabOption" :label="item.label" :name="item.name">
       <component
-        v-if="activeName && isValidComponent(activeName)"
-        :is="activeName"
-        ref="componentRef"
-        v-bind="activeNameProps"
+        :is="item.name"
+        :key="item.name"
+        :ref="'componentRef' + item.name"
+        v-if="form.id"
+        v-bind="activeNameProps(item.name)"
       />
-    </keep-alive>
+    </div>
   </div>
 </template>
 
@@ -25,7 +18,7 @@
     name: 'boxTabPage',
     components: {
       tab1: () => import('./detailDialog.vue'),
-      tab2: () => import('@/views/bpm/outgoingManagement/outbound2.vue')
+      tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue')
     },
     props: {
       taskDefinitionKey: {
@@ -67,7 +60,12 @@
           }
         ];
         return list.filter((item) => item.isShow);
-      },
+      }
+    },
+    async created() {
+      this.form = await getPurchaseOutSourceSendDetailAPI(this.businessId);
+    },
+    methods: {
       activeNameProps() {
         switch (this.activeName) {
           case 'tab1':
@@ -81,13 +79,7 @@
               sourceBizNo: this.form.code
             };
         }
-      }
-    },
-    async created() {
-      this.form = await getPurchaseOutSourceSendDetailAPI(this.businessId);
-      console.log(this.form, 'sssssssssssssssssssssssssssssss');
-    },
-    methods: {
+      },
       isValidComponent(componentName) {
         const validComponents = ['tab1', 'tab2'];
         return validComponents.includes(componentName);
@@ -98,9 +90,9 @@
       async getTableValue() {
         return {
           form: this.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
-            : ''
+          returnStorageData: this.$refs['componentReftab2'][0].getReturnStorage
+            ? await this.$refs['componentReftab2'][0].getReturnStorage()
+            : {}
         };
       }
     }

+ 16 - 16
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/detailDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="ele-body">
     <el-form ref="form" :model="form" label-width="130px">
       <headerTitle title="发货信息"></headerTitle>
       <el-row :gutter="20">
@@ -60,12 +60,12 @@
         </el-col>
       </el-row>
       <el-row :gutter="20">
-
         <el-col :span="12">
           <el-form-item
             label="发货日期:"
             prop="sendDate"
-            style="margin-bottom: 22px">
+            style="margin-bottom: 22px"
+          >
             {{ form.sendDate }}
           </el-form-item>
         </el-col>
@@ -101,17 +101,17 @@
         <el-col :span="12">
           <el-form-item prop="files" label="附件:">
             <fileMain v-model="form.files" type="view"></fileMain>
-<!--            <div v-if="form.files && form.files?.length">-->
-<!--              <el-link-->
-<!--                v-for="link in form.files"-->
-<!--                :key="link.id"-->
-<!--                type="primary"-->
-<!--                :underline="false"-->
-<!--                @click="downloadFile(link)"-->
-<!--              >-->
-<!--                {{ link.name }}-->
-<!--              </el-link>-->
-<!--            </div>-->
+            <!--            <div v-if="form.files && form.files?.length">-->
+            <!--              <el-link-->
+            <!--                v-for="link in form.files"-->
+            <!--                :key="link.id"-->
+            <!--                type="primary"-->
+            <!--                :underline="false"-->
+            <!--                @click="downloadFile(link)"-->
+            <!--              >-->
+            <!--                {{ link.name }}-->
+            <!--              </el-link>-->
+            <!--            </div>-->
           </el-form-item>
         </el-col>
         <el-col :span="12"> </el-col>
@@ -153,10 +153,10 @@
 <script>
   import { getFile } from '@/api/system/file';
   import { getPurchaseOutSourceSendDetailAPI } from '@/api/bpm/components/purchasingManage/outSourceSend';
-  import fileMain from "@/components/addDoc/index.vue";
+  import fileMain from '@/components/addDoc/index.vue';
 
   export default {
-    components: {fileMain},
+    components: { fileMain },
     props: {
       businessId: {
         default: ''

+ 92 - 58
src/views/bpm/handleTask/components/selectedCollectionOutbound/boxTabPage.vue

@@ -1,39 +1,25 @@
 <template>
   <div>
-    <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-        <el-tab-pane
-          v-for="item in tabOption"
-          :label="item.label"
-          :name="item.name"
-        >
-        </el-tab-pane>
-      </el-tabs> -->
-    <keep-alive>
-      <!-- <component
-          v-if="activeName && isValidComponent(activeName)"
-          :is="activeName"
-          :key="activeName"
-          ref="componentRef"
-          v-bind="activeNameProps"
-        /> -->
-
-      <outbound :activeNameProps="activeNameProps"></outbound>
-    </keep-alive>
+    <div v-for="item in tabOption" :label="item.label" :name="item.name">
+      <component
+        :is="item.name"
+        :key="item.name"
+        :ref="'componentRef' + item.name"
+        v-if="form.id"
+        v-bind="activeNameProps(item.name)"
+      />
+    </div>
   </div>
 </template>
 
 <script>
-  // import { deepClone } from '@/components/FormGenerator/utils/index';
-  // import { getPickOrderById } from '@/api/pda';
-
-  import Outbound from '@/views/bpm/outgoingManagement/outbound.vue';
-
+  import { deepClone } from '@/components/FormGenerator/utils/index';
+  import { getPickOrderById } from '@/api/pda';
   export default {
     name: 'boxTabPage',
     components: {
-      Outbound
-      // tab1: () => import('./detailDialog.vue'),
-      // tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue')
+      tab1: () => import('./detailDialog.vue'),
+      tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue')
     },
     props: {
       taskDefinitionKey: {
@@ -56,46 +42,94 @@
     data() {
       return {
         form: {},
-        // activeName: 'tab1',
+        activeName: 'tab1',
         cKey: 1,
         extractedList: [],
-        wwType: '',
-        activeNameProps: {
-          businessId: this.businessId,
-          // form: this.form,
-          bizType: 11,
-          // sourceBizNo: this.form.code,
-          // detailList: this.form.detailList,
-          type: '自选领用出库'
-          // wwType: this.wwType,
-          // extractedList: this.extractedList
-        }
+        wwType: ''
       };
     },
-    computed: {},
-    async created() {},
+    computed: {
+      tabOption() {
+        let list = [
+          {
+            label: '领料单详情',
+            name: 'tab1',
+            isShow: true
+          },
+          {
+            label: '出库',
+            name: 'tab2',
+            isShow: true
+          }
+        ];
+        return list.filter((item) => item.isShow);
+      }
+    },
+    async created() {
+      this.getPickOrderDetail();
+    },
     methods: {
-      // isValidComponent(componentName) {
-      //   const validComponents = ['tab1', 'tab2'];
-      //   return validComponents.includes(componentName);
-      // },
-      // handleClick(val) {
-      //   this.activeName = val.name;
-      //   if (val.name == 'tab2') {
-      //     this.$emit('activeCompChange', 'inoutBound');
-      //   } else {
-      //     console.log('activeCompChange------------');
-      //     this.$emit('activeCompChange', 'inoutBoundView');
-      //   }
-      // },
+      activeNameProps(activeName) {
+        switch (activeName) {
+          case 'tab1':
+            return {
+              businessId: this.businessId,
+              form: this.form
+            };
+          case 'tab2':
+            return {
+              form: this.form,
+              bizType: 11,
+              sourceBizNo: this.form.code,
+              detailList: this.form.detailList,
+              type: '自选领用出库',
+              wwType: this.wwType,
+              extractedList: this.extractedList
+            };
+        }
+      },
+      isValidComponent(componentName) {
+        const validComponents = ['tab1', 'tab2'];
+        return validComponents.includes(componentName);
+      },
+      handleClick(val) {
+        this.activeName = val.name;
+        if (val.name == 'tab2') {
+          this.$emit('activeCompChange', 'inoutBound');
+        } else {
+          console.log('activeCompChange------------');
+          this.$emit('activeCompChange', 'inoutBoundView');
+        }
+      },
       async getTableValue() {
-        console.log(this.$refs.componentRef);
+        console.log(this.$refs['componentReftab2']);
         return {
           form: this.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
-            : ''
+          returnStorageData: this.$refs['componentReftab2'][0].getReturnStorage
+            ? await this.$refs['componentReftab2'][0].getReturnStorage()
+            : {}
         };
+      },
+      getPickOrderDetail() {
+        getPickOrderById(this.businessId).then((data) => {
+          data.detailList = data.detailList.map((item) => {
+            item.code = data.code;
+            return item;
+          });
+          this.wwType = data.type;
+          this.extractedList = data.detailList.map((item) => ({
+            taskId: item.taskId,
+            workOrderId: item.workOrderId
+          }));
+          let categoryLevelTopIds = data.detailList.map(
+            (item) => item.rootCategoryLevelId
+          );
+          let filterCategoryLevelTopIds = Array.from(
+            new Set(categoryLevelTopIds)
+          );
+          data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
+          this.form = deepClone(data);
+        });
       }
     }
   };

+ 0 - 145
src/views/bpm/handleTask/components/selectedCollectionOutbound/boxTabPage2.vue

@@ -1,145 +0,0 @@
-<template>
-  <div>
-    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-      <el-tab-pane
-        v-for="item in tabOption"
-        :label="item.label"
-        :name="item.name"
-      >
-      </el-tab-pane>
-    </el-tabs>
-    <keep-alive>
-      <component
-        v-if="activeName && isValidComponent(activeName)"
-        :is="activeName"
-        :key="activeName"
-        ref="componentRef"
-        v-bind="activeNameProps"
-      />
-    </keep-alive>
-  </div>
-</template>
-
-<script>
-  import { deepClone } from '@/components/FormGenerator/utils/index';
-  import { getPickOrderById } from '@/api/pda';
-  export default {
-    name: 'boxTabPage',
-    components: {
-      tab1: () => import('./detailDialog.vue'),
-      tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue')
-    },
-    props: {
-      taskDefinitionKey: {
-        type: String,
-        default: ''
-      },
-      activeComp: {
-        type: String,
-        default: ''
-      },
-      permissionType: {
-        type: String,
-        default: 'view'
-      },
-      businessId: {
-        type: String,
-        default: ''
-      }
-    },
-    data() {
-      return {
-        form: {},
-        activeName: 'tab1',
-        cKey: 1,
-        extractedList: [],
-        wwType: ''
-      };
-    },
-    computed: {
-      tabOption() {
-        let list = [
-          {
-            label: '领料单详情',
-            name: 'tab1',
-            isShow: true
-          },
-          {
-            label: '出库',
-            name: 'tab2',
-            isShow: true
-          }
-        ];
-        return list.filter((item) => item.isShow);
-      },
-      activeNameProps() {
-        switch (this.activeName) {
-          case 'tab1':
-            return {
-              businessId: this.businessId,
-              form: this.form
-            };
-          case 'tab2':
-            return {
-              form: this.form,
-              bizType: 11,
-              sourceBizNo: this.form.code,
-              detailList: this.form.detailList,
-              type: '自选领用出库',
-              wwType: this.wwType,
-              extractedList: this.extractedList
-            };
-        }
-      }
-    },
-    async created() {
-      this.getPickOrderDetail();
-    },
-    methods: {
-      isValidComponent(componentName) {
-        const validComponents = ['tab1', 'tab2'];
-        return validComponents.includes(componentName);
-      },
-      handleClick(val) {
-        this.activeName = val.name;
-        if (val.name == 'tab2') {
-          this.$emit('activeCompChange', 'inoutBound');
-        } else {
-          console.log('activeCompChange------------');
-          this.$emit('activeCompChange', 'inoutBoundView');
-        }
-      },
-      async getTableValue() {
-        console.log(this.$refs.componentRef);
-        return {
-          form: this.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
-            : ''
-        };
-      },
-      getPickOrderDetail() {
-        getPickOrderById(this.businessId).then((data) => {
-          data.detailList = data.detailList.map((item) => {
-            item.code = data.code;
-            return item;
-          });
-          this.wwType = data.type;
-          this.extractedList = data.detailList.map((item) => ({
-            taskId: item.taskId,
-            workOrderId: item.workOrderId
-          }));
-          let categoryLevelTopIds = data.detailList.map(
-            (item) => item.rootCategoryLevelId
-          );
-          let filterCategoryLevelTopIds = Array.from(
-            new Set(categoryLevelTopIds)
-          );
-          data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
-          this.form = deepClone(data);
-        });
-      }
-    }
-  };
-</script>
-<style scoped lang="scss"></style>

+ 0 - 103
src/views/bpm/handleTask/components/selectedCollectionOutbound/boxTabPage3.vue

@@ -1,103 +0,0 @@
-<template>
-  <div>
-    <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-        <el-tab-pane
-          v-for="item in tabOption"
-          :label="item.label"
-          :name="item.name"
-        >
-        </el-tab-pane>
-      </el-tabs> -->
-    <keep-alive>
-      <!-- <component
-          v-if="activeName && isValidComponent(activeName)"
-          :is="activeName"
-          :key="activeName"
-          ref="componentRef"
-          v-bind="activeNameProps"
-        /> -->
-
-      <outbound :activeNameProps="activeNameProps"></outbound>
-    </keep-alive>
-  </div>
-</template>
-
-<script>
-  // import { deepClone } from '@/components/FormGenerator/utils/index';
-  // import { getPickOrderById } from '@/api/pda';
-
-  import Outbound from '@/views/bpm/outgoingManagement/outbound.vue';
-
-  export default {
-    name: 'boxTabPage',
-    components: {
-      Outbound
-      // tab1: () => import('./detailDialog.vue'),
-      // tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue')
-    },
-    props: {
-      taskDefinitionKey: {
-        type: String,
-        default: ''
-      },
-      activeComp: {
-        type: String,
-        default: ''
-      },
-      permissionType: {
-        type: String,
-        default: 'view'
-      },
-      businessId: {
-        type: String,
-        default: ''
-      }
-    },
-    data() {
-      return {
-        form: {},
-        // activeName: 'tab1',
-        cKey: 1,
-        extractedList: [],
-        wwType: '',
-        activeNameProps: {
-          businessId: this.businessId,
-          // form: this.form,
-          bizType: 11,
-          // sourceBizNo: this.form.code,
-          // detailList: this.form.detailList,
-          type: '自选领用出库'
-          // wwType: this.wwType,
-          // extractedList: this.extractedList
-        }
-      };
-    },
-    computed: {},
-    async created() {},
-    methods: {
-      // isValidComponent(componentName) {
-      //   const validComponents = ['tab1', 'tab2'];
-      //   return validComponents.includes(componentName);
-      // },
-      // handleClick(val) {
-      //   this.activeName = val.name;
-      //   if (val.name == 'tab2') {
-      //     this.$emit('activeCompChange', 'inoutBound');
-      //   } else {
-      //     console.log('activeCompChange------------');
-      //     this.$emit('activeCompChange', 'inoutBoundView');
-      //   }
-      // },
-      async getTableValue() {
-        console.log(this.$refs.componentRef);
-        return {
-          form: this.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
-            : ''
-        };
-      }
-    }
-  };
-</script>
-<style scoped lang="scss"></style>

+ 1 - 1
src/views/bpm/handleTask/components/selectedCollectionOutbound/detailDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="ele-body">
     <headerTitle title="领料单详情"></headerTitle>
     <el-table :data="form.detailList" style="width: 100%">
       <el-table-column prop="code" label="领料单号"> </el-table-column>

+ 2 - 2
src/views/bpm/handleTask/components/selectedCollectionOutbound/submit.vue

@@ -116,11 +116,11 @@
         let data = await this.getTableValue();
         let storageData = data.returnStorageData;
         if (!!status) {
-          if (!storageData.extInfo.verifyDeptCode) {
+          if (!storageData?.extInfo?.verifyDeptCode) {
             this.$message.error('请选择部门');
             return false;
           }
-          if (!storageData.fromUser) {
+          if (!storageData?.fromUser) {
             this.$message.error('请选择领料人');
             return false;
           }

+ 34 - 87
src/views/bpm/outgoingManagement/outbound.vue

@@ -149,30 +149,6 @@
           </el-col>
         </el-row>
       </el-form>
-      <div class="mt20">
-        <headerTitle title="领料单详情"></headerTitle>
-        <el-table :data="form.detailList" style="width: 100%">
-          <el-table-column prop="code" label="领料单号"> </el-table-column>
-          <el-table-column prop="workOrderCode" label="工单编号">
-          </el-table-column>
-          <el-table-column prop="workOrderId" label="工单编号">
-          </el-table-column>
-          <el-table-column prop="categoryCode" label="物品编码">
-          </el-table-column>
-          <el-table-column prop="categoryName" label="物品名称">
-          </el-table-column>
-          <el-table-column label="数量">
-            <template slot-scope="{ row }">
-              {{ row.demandQuantity }}/{{ row.unit }}
-            </template>
-          </el-table-column>
-          <el-table-column label="领料仓库">
-            <template slot-scope="{ row }">
-              {{ row.warehouseName }}
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
       <div>
         <el-button
           style="margin-bottom: 20px; float: right; margin-right: 20px"
@@ -564,23 +540,20 @@
   import { deepClone } from '@/components/FormGenerator/utils/index';
   import { mapGetters } from 'vuex';
 
-  import { getPickOrderById } from '@/api/pda';
-
   export default {
     components: {
       selectTree,
       AssetsDialog
     },
     props: {
-      // form: { type: Object, default: {} },
+      form: { type: Object, default: {} },
       bizType: { type: Number, default: 1 },
-      // sourceBizNo: { type: String, default: '' },
+      sourceBizNo: { type: String, default: '' },
       type: { type: String, default: '正常出库' },
-      // detailList: { type: Array, default: () => [] },
+      detailList: { type: Array, default: () => [] },
       saleProductList: { type: Array, default: () => [] },
-      // extractedList: { type: Array, default: () => [] },
-      // wwType: { type: Number, default: null },
-      activeNameProps: { type: Object, default: {} }
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
@@ -646,12 +619,7 @@
             trigger: 'change'
           }
         },
-        llrLsit: [],
-        form: [],
-        sourceBizNo: '',
-        detailList: [],
-        wwType: '',
-        extractedList: []
+        llrLsit: []
       };
     },
     computed: {
@@ -660,11 +628,10 @@
         return this.$store.state.user.info.clientEnvironmentId;
       }
     },
-    async created() {
-      await this.getPickOrderDetail();
-      await this.getFieldModel();
-      await this.getListItems();
-      await this.initDeptData().then(() => {
+    created() {
+      this.getFieldModel();
+      this.getListItems();
+      this.initDeptData().then(() => {
         this.initFormData();
       });
     },
@@ -683,27 +650,6 @@
           this.newColumns = [...newRes];
         });
       },
-      getPickOrderDetail() {
-        getPickOrderById(this.activeNameProps.businessId).then((data) => {
-          data.detailList = data.detailList.map((item) => {
-            item.code = data.code;
-            return item;
-          });
-          this.wwType = data.type;
-          this.extractedList = data.detailList.map((item) => ({
-            taskId: item.taskId,
-            workOrderId: item.workOrderId
-          }));
-          let categoryLevelTopIds = data.detailList.map(
-            (item) => item.rootCategoryLevelId
-          );
-          let filterCategoryLevelTopIds = Array.from(
-            new Set(categoryLevelTopIds)
-          );
-          data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
-          this.form = deepClone(data);
-        });
-      },
       userSlected(data) {
         this.formData.fromId = data.id;
         this.formData.fromUser = data.name;
@@ -716,6 +662,7 @@
         console.log('清空');
       },
       pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
         if (this.showPackingList.length < this.packingList.length) {
           if (this.packingList.length > this.pageSize) {
             this.pickingPageNum += 1;
@@ -731,6 +678,7 @@
         );
       },
       materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
         if (this.showMaterialList.length < this.materialList.length) {
           if (this.materialList.length > this.pageSize) {
             this.materielPageNum += 1;
@@ -744,6 +692,7 @@
         this.showMaterialList = this.showMaterialList.concat(
           this.materialList.slice(start, end)
         );
+        console.log(this.showMaterialList);
       },
       // 获取物品列表
       async getListItems() {
@@ -772,15 +721,15 @@
                 return {
                   ...packingItem,
                   workOrderId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].workOrderId
                       : '',
                   pickOrderId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].pickOrderId
                       : '',
                   taskId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].taskId
                       : '',
                   categoryName: productItem.categoryName,
@@ -820,7 +769,9 @@
       },
       async getReturnStorage() {
         return new Promise((resolve) => {
+          console.log(this.formData);
           this.$refs.formName.validate(async (valid) => {
+            console.log('valid', valid);
             if (valid) {
               if (!this.productList?.length) {
                 return this.$message.error('请添加出库明细!');
@@ -848,6 +799,7 @@
               });
               obj.warehouseIds = warehouseId;
               obj.warehouseNames = warehouseName;
+              console.log('2222', obj);
               let isPass = false;
               // 1按数量计费 2按重量计费
               if (this.form.pricingWay == 2) {
@@ -919,9 +871,6 @@
         });
       },
       // 初始化用户信息
-      /**
-       * 异步初始化表单数据
-       */
       async initFormData() {
         // const res = await warehouseDefinition.tree();
         // let obj = res.find(
@@ -934,21 +883,22 @@
         // this.formData.extInfo.deptName = obj.name;
         // this.formData.extInfo.createUserName = this.user.info.name;
         // this.formData.createUserId = this.user.info.userId;
+
         // 物品类型
         this.formData.extInfo.assetType = Array.from(
-          new Set(this.form.categoryLevelTopId?.split(','))
+          new Set(this.form.categoryLevelTopId.split(','))
         );
         // 出库类型
-        this.formData.bizType = this.activeNameProps.bizType;
+        this.formData.bizType = this.bizType;
         // 添加单据来源
-        this.formData.sourceBizNo = this.form.code;
+        this.formData.sourceBizNo = this.sourceBizNo;
         // 将出库状态改成出库状态 2出库 1入库
         this.formData.type = 2;
         // 入库登记人
         this.formData.extInfo.createUserName = this.$store.state.user.info.name;
         this.formData.createUserId = this.$store.state.user.info.userId;
         // 生产相关逻辑
-        if (this.form.detailList?.length > 0) {
+        if (this.detailList?.length > 0) {
           // 获取领料人列表
           this.getStaffList({ id: this.form.executorDeptId }).then(() => {
             // 获取领料人和领料部门
@@ -959,7 +909,7 @@
           });
           let pData = {
             type: '1',
-            builders: this.form.detailList.map((item) => {
+            builders: this.detailList.map((item) => {
               return {
                 categoryId: item.instanceId || item.categoryId,
                 num: item.demandQuantity
@@ -969,11 +919,7 @@
           let pData2 = {
             type: this.wwType,
             taskIds: this.extractedList.map((item) => item.taskId),
-            workOrderIds: this.extractedList.map((item) => item.workOrderId),
-            outsourceBatchNos: this.extractedList.map(
-              (item) => item.outsourceBatchNo
-            ),
-            outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
           };
           storageApi
             .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
@@ -987,11 +933,11 @@
         // 销售相关逻辑
         if (this.saleProductList?.length > 0) {
           // 获取领料人列表
-          this.getStaffList({ id: this.form.executorDeptId }).then(() => {
+          this.getStaffList({ id: this.form.deptId }).then(() => {
             // 获取领料人和领料部门
             this.formData.fromId = this.form.makerId;
             this.formData.fromUser = this.form.makerName;
-            this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
+            this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
           let pData = {
@@ -1006,11 +952,7 @@
           let pData2 = {
             type: this.wwType,
             taskIds: this.extractedList.map((item) => item.taskId),
-            workOrderIds: this.extractedList.map((item) => item.workOrderId),
-            outsourceBatchNos: this.extractedList.map(
-              (item) => item.outsourceBatchNo
-            ),
-            outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
           };
           storageApi
             .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
@@ -1037,6 +979,7 @@
         });
       },
       addStock() {
+        console.log(this.formData.extInfo.assetType);
         if (
           !(
             this.formData.extInfo.assetType &&
@@ -1059,6 +1002,8 @@
     watch: {
       packingList: {
         handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数', this.pickingPageNum);
           this.showPackingList = newVal.slice(
             0,
             this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
@@ -1068,6 +1013,8 @@
       },
       materialList: {
         handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
           this.showMaterialList = newVal.slice(
             0,
             this.pageSize *

+ 34 - 87
src/views/bpm/outgoingManagement/outbound3.vue

@@ -149,30 +149,6 @@
           </el-col>
         </el-row>
       </el-form>
-      <div class="mt20">
-        <headerTitle title="领料单详情"></headerTitle>
-        <el-table :data="form.detailList" style="width: 100%">
-          <el-table-column prop="code" label="领料单号"> </el-table-column>
-          <el-table-column prop="workOrderCode" label="工单编号">
-          </el-table-column>
-          <el-table-column prop="workOrderId" label="工单编号">
-          </el-table-column>
-          <el-table-column prop="categoryCode" label="物品编码">
-          </el-table-column>
-          <el-table-column prop="categoryName" label="物品名称">
-          </el-table-column>
-          <el-table-column label="数量">
-            <template slot-scope="{ row }">
-              {{ row.demandQuantity }}/{{ row.unit }}
-            </template>
-          </el-table-column>
-          <el-table-column label="领料仓库">
-            <template slot-scope="{ row }">
-              {{ row.warehouseName }}
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
       <div>
         <el-button
           style="margin-bottom: 20px; float: right; margin-right: 20px"
@@ -564,23 +540,20 @@
   import { deepClone } from '@/components/FormGenerator/utils/index';
   import { mapGetters } from 'vuex';
 
-  import { getPickOrderById } from '@/api/pda';
-
   export default {
     components: {
       selectTree,
       AssetsDialog
     },
     props: {
-      // form: { type: Object, default: {} },
+      form: { type: Object, default: {} },
       bizType: { type: Number, default: 1 },
-      // sourceBizNo: { type: String, default: '' },
+      sourceBizNo: { type: String, default: '' },
       type: { type: String, default: '正常出库' },
-      // detailList: { type: Array, default: () => [] },
+      detailList: { type: Array, default: () => [] },
       saleProductList: { type: Array, default: () => [] },
-      // extractedList: { type: Array, default: () => [] },
-      // wwType: { type: Number, default: null },
-      activeNameProps: { type: Object, default: {} }
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
@@ -646,12 +619,7 @@
             trigger: 'change'
           }
         },
-        llrLsit: [],
-        form: [],
-        sourceBizNo: '',
-        detailList: [],
-        wwType: '',
-        extractedList: []
+        llrLsit: []
       };
     },
     computed: {
@@ -660,11 +628,10 @@
         return this.$store.state.user.info.clientEnvironmentId;
       }
     },
-    async created() {
-      await this.getPickOrderDetail();
-      await this.getFieldModel();
-      await this.getListItems();
-      await this.initDeptData().then(() => {
+    created() {
+      this.getFieldModel();
+      this.getListItems();
+      this.initDeptData().then(() => {
         this.initFormData();
       });
     },
@@ -683,27 +650,6 @@
           this.newColumns = [...newRes];
         });
       },
-      getPickOrderDetail() {
-        getPickOrderById(this.activeNameProps.businessId).then((data) => {
-          data.detailList = data.detailList.map((item) => {
-            item.code = data.code;
-            return item;
-          });
-          this.wwType = data.type;
-          this.extractedList = data.detailList.map((item) => ({
-            taskId: item.taskId,
-            workOrderId: item.workOrderId
-          }));
-          let categoryLevelTopIds = data.detailList.map(
-            (item) => item.rootCategoryLevelId
-          );
-          let filterCategoryLevelTopIds = Array.from(
-            new Set(categoryLevelTopIds)
-          );
-          data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
-          this.form = deepClone(data);
-        });
-      },
       userSlected(data) {
         this.formData.fromId = data.id;
         this.formData.fromUser = data.name;
@@ -716,6 +662,7 @@
         console.log('清空');
       },
       pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
         if (this.showPackingList.length < this.packingList.length) {
           if (this.packingList.length > this.pageSize) {
             this.pickingPageNum += 1;
@@ -731,6 +678,7 @@
         );
       },
       materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
         if (this.showMaterialList.length < this.materialList.length) {
           if (this.materialList.length > this.pageSize) {
             this.materielPageNum += 1;
@@ -744,6 +692,7 @@
         this.showMaterialList = this.showMaterialList.concat(
           this.materialList.slice(start, end)
         );
+        console.log(this.showMaterialList);
       },
       // 获取物品列表
       async getListItems() {
@@ -772,15 +721,15 @@
                 return {
                   ...packingItem,
                   workOrderId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].workOrderId
                       : '',
                   pickOrderId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].pickOrderId
                       : '',
                   taskId:
-                    this.activeNameProps.type === '自选领用出库'
+                    this.type === '自选领用出库'
                       ? this.form.detailList[0].taskId
                       : '',
                   categoryName: productItem.categoryName,
@@ -820,7 +769,9 @@
       },
       async getReturnStorage() {
         return new Promise((resolve) => {
+          console.log(this.formData);
           this.$refs.formName.validate(async (valid) => {
+            console.log('valid', valid);
             if (valid) {
               if (!this.productList?.length) {
                 return this.$message.error('请添加出库明细!');
@@ -848,6 +799,7 @@
               });
               obj.warehouseIds = warehouseId;
               obj.warehouseNames = warehouseName;
+              console.log('2222', obj);
               let isPass = false;
               // 1按数量计费 2按重量计费
               if (this.form.pricingWay == 2) {
@@ -919,9 +871,6 @@
         });
       },
       // 初始化用户信息
-      /**
-       * 异步初始化表单数据
-       */
       async initFormData() {
         // const res = await warehouseDefinition.tree();
         // let obj = res.find(
@@ -934,21 +883,22 @@
         // this.formData.extInfo.deptName = obj.name;
         // this.formData.extInfo.createUserName = this.user.info.name;
         // this.formData.createUserId = this.user.info.userId;
+
         // 物品类型
         this.formData.extInfo.assetType = Array.from(
-          new Set(this.form.categoryLevelTopId?.split(','))
+          new Set(this.form.categoryLevelTopId.split(','))
         );
         // 出库类型
-        this.formData.bizType = this.activeNameProps.bizType;
+        this.formData.bizType = this.bizType;
         // 添加单据来源
-        this.formData.sourceBizNo = this.form.code;
+        this.formData.sourceBizNo = this.sourceBizNo;
         // 将出库状态改成出库状态 2出库 1入库
         this.formData.type = 2;
         // 入库登记人
         this.formData.extInfo.createUserName = this.$store.state.user.info.name;
         this.formData.createUserId = this.$store.state.user.info.userId;
         // 生产相关逻辑
-        if (this.form.detailList?.length > 0) {
+        if (this.detailList?.length > 0) {
           // 获取领料人列表
           this.getStaffList({ id: this.form.executorDeptId }).then(() => {
             // 获取领料人和领料部门
@@ -959,7 +909,7 @@
           });
           let pData = {
             type: '1',
-            builders: this.form.detailList.map((item) => {
+            builders: this.detailList.map((item) => {
               return {
                 categoryId: item.instanceId || item.categoryId,
                 num: item.demandQuantity
@@ -969,11 +919,7 @@
           let pData2 = {
             type: this.wwType,
             taskIds: this.extractedList.map((item) => item.taskId),
-            workOrderIds: this.extractedList.map((item) => item.workOrderId),
-            outsourceBatchNos: this.extractedList.map(
-              (item) => item.outsourceBatchNo
-            ),
-            outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
           };
           storageApi
             .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
@@ -987,11 +933,11 @@
         // 销售相关逻辑
         if (this.saleProductList?.length > 0) {
           // 获取领料人列表
-          this.getStaffList({ id: this.form.executorDeptId }).then(() => {
+          this.getStaffList({ id: this.form.deptId }).then(() => {
             // 获取领料人和领料部门
             this.formData.fromId = this.form.makerId;
             this.formData.fromUser = this.form.makerName;
-            this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
+            this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
           let pData = {
@@ -1006,11 +952,7 @@
           let pData2 = {
             type: this.wwType,
             taskIds: this.extractedList.map((item) => item.taskId),
-            workOrderIds: this.extractedList.map((item) => item.workOrderId),
-            outsourceBatchNos: this.extractedList.map(
-              (item) => item.outsourceBatchNo
-            ),
-            outsourceCodes: this.extractedList.map((item) => item.outsourceCode)
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
           };
           storageApi
             .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
@@ -1037,6 +979,7 @@
         });
       },
       addStock() {
+        console.log(this.formData.extInfo.assetType);
         if (
           !(
             this.formData.extInfo.assetType &&
@@ -1059,6 +1002,8 @@
     watch: {
       packingList: {
         handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数', this.pickingPageNum);
           this.showPackingList = newVal.slice(
             0,
             this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
@@ -1068,6 +1013,8 @@
       },
       materialList: {
         handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
           this.showMaterialList = newVal.slice(
             0,
             this.pageSize *