huang_an 2 лет назад
Родитель
Сommit
a415afc19d

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

@@ -139,5 +139,11 @@ export default {
     if (res.data.code == 0) {
       return res.data;
     }
+  },
+  updateOutIn: async (params) => {
+    const res = await request.post(`/wms/outin/updateOutIn`, params);
+    if (res.data.code == 0) {
+      return res.data;
+    }
   }
 };

+ 7 - 6
src/views/bpm/handleTask/components/inoutBound/detailDialog.vue

@@ -365,7 +365,7 @@
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column
+                  <!-- <el-table-column
                     label="操作"
                     width="200"
                     fixed="right"
@@ -385,7 +385,7 @@
                         >编辑</el-button
                       >
                     </template>
-                  </el-table-column>
+                  </el-table-column> -->
                 </el-table>
               </el-form>
             </div>
@@ -498,7 +498,7 @@
                 {{ row.createTime }}
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="操作"
               width="100"
               fixed="right"
@@ -518,7 +518,7 @@
                   >编辑</el-button
                 >
               </template>
-            </el-table-column>
+            </el-table-column> -->
           </el-table>
         </div>
         <div class="mt20">
@@ -612,7 +612,7 @@
                 <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="操作"
               width="80"
               fixed="right"
@@ -630,7 +630,7 @@
                   编辑
                 </el-button>
               </template>
-            </el-table-column>
+            </el-table-column> -->
           </el-table>
         </div>
       </div>
@@ -1617,6 +1617,7 @@
           this.metailList = iArr.map((item) => {
             return {
               ...item,
+              isPack: true,
               result:
                 item.result == 0
                   ? '0'

+ 105 - 36
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing.vue

@@ -589,7 +589,15 @@
             </div>
           </header-title>
           <el-button
-            v-if="materialCodeReqList.length != 0 && !isConfig"
+            v-if="
+              isStorage
+                ? materialCodeReqListOrStorage.length != 0 &&
+                  resultArray.length <= 0 &&
+                  taskDefinitionKey === 'qualityInspection'
+                : materialCodeReqList.length != 0 &&
+                  resultArray.length <= 0 &&
+                  taskDefinitionKey === 'qualityInspection'
+            "
             type="success"
             plain
             style="margin-bottom: 20px; float: right; margin-right: 20px"
@@ -819,7 +827,7 @@
         <div class="mt20" v-if="isDetail">
           <header-title :title="`物料明细`"> </header-title>
           <el-button
-            v-if="resultArray.length != 0 && !isConfig"
+            v-if="resultArray.length != 0"
             type="success"
             plain
             style="margin-bottom: 20px; float: right; margin-right: 20px"
@@ -1306,11 +1314,51 @@
       getSceneState: useDictLabel(sceneState),
       // 物料批量保存
       materialListSave() {
-        this.resultArray.forEach((item) => {
-          if (!item.isPack) {
-            this.materialBtn(item);
-          }
+        let boolen = this.resultArray.every((item) => item.status == 1);
+        if (boolen) {
+          let showSuccessMsg = false;
+          this.resultArray.forEach((item, index) => {
+            if (!item.isPack) {
+              this.materialBtn(item, index, true);
+              if (!showSuccessMsg) {
+                showSuccessMsg = true;
+              }
+            }
+          });
+          // 更新数据
+          this.initFormData();
+        } else {
+          this.$message.error('请选择质检结果');
+        }
+      },
+      // 格式化数据并更新(用于质检员批量质检)
+      async initFormData() {
+        console.log(this.warehousingMaterialList);
+        console.log(this.materialCodeReqListOrStorage);
+        console.log(this.resultArray);
+        this.warehousingMaterialList.forEach((goodsItem) => {
+          goodsItem.outInDetailRecordUpdatePOList =
+            this.materialCodeReqListOrStorage.filter(
+              (wrapItem) =>
+                goodsItem.assetCode == wrapItem.assetCode &&
+                goodsItem.batchNo == wrapItem.batchNo
+            );
+        });
+        this.warehousingMaterialList.forEach((goodsItem) => {
+          goodsItem.outInDetailRecordUpdatePOList.forEach((wrapItem) => {
+            wrapItem.materialDetails = this.resultArray.filter(
+              (metialItem) => metialItem.onlyCode == wrapItem.code
+            );
+          });
         });
+        console.log(this.warehousingMaterialList);
+        const res = await outin.updateOutIn(this.warehousingMaterialList);
+        console.log(res);
+        if (res.code == 0) {
+          this.$message.success('保存成功');
+        } else {
+          this.$message.success('保存失败');
+        }
       },
       async initData() {
         const batchNo = await getCode('lot_number_code'); // 生成批次号编码
@@ -1416,12 +1464,28 @@
       },
       // 包装批量保存
       wrapListSave() {
-        // 批量修改包装明细
-        this.isWeight = false;
-        this.bulkEditingWrap();
-        this.$nextTick(() => {
-          this.isWeight = true;
-        });
+        let materialCodeReqList = [];
+        // 生产性入库没入库用materialCodeReqList字段
+        if (this.taskDefinitionKey === 'qualityInspection' && this.isStorage) {
+          materialCodeReqList = this.materialCodeReqListOrStorage;
+        } else {
+          materialCodeReqList = this.materialCodeReqList;
+        }
+        let boolen = materialCodeReqList.every((item) => item.status == 1);
+        if (boolen) {
+          // 批量修改包装明细
+          this.isWeight = false;
+          this.isWrapTable = false;
+          this.bulkEditingWrap();
+          this.$nextTick(() => {
+            // 更新数据
+            this.initFormData();
+            this.isWeight = true;
+            this.isWrapTable = true;
+          });
+        } else {
+          this.$message.error('请选择质检结果');
+        }
       },
       handleIsDetail(event) {
         this.isSplit = event;
@@ -1540,9 +1604,7 @@
               this.taskDefinitionKey === 'qualityInspection' &&
               this.isStorage
             ) {
-              updateOutInRecord(row).then(() => {
-                this.$message.success('保存包装成功');
-              });
+              this.initFormData();
             }
             this.isWeight = true;
           });
@@ -1575,6 +1637,7 @@
         materialCodeReqList.forEach((item) => {
           item.isPack = true;
         });
+        console.log(materialCodeReqList);
         // 改变产品明细重量
         this.warehousingMaterialList.forEach((outItem) => {
           let arr = [];
@@ -1624,19 +1687,22 @@
           this.$set(outItem, 'weight', count);
         });
       },
-      // 物料明细保存
-      materialBtn(row, index) {
+      // 物料明细保存(单独保存)
+      materialBtn(row, index, isLonely) {
         console.log(row);
         console.log(index);
         console.log(this.resultArray);
         console.log(this.materialCodeReqList);
-        // 生产性质检必须已检才能通过
-        if (
-          this.taskDefinitionKey === 'qualityInspection' &&
-          row.status != '1'
-        ) {
-          this.$message.error('请选择质检结果');
-          return false;
+        // 是否单点
+        if (!isLonely) {
+          // 生产性质检必须已检才能通过
+          if (
+            this.taskDefinitionKey === 'qualityInspection' &&
+            row.status != '1'
+          ) {
+            this.$message.error('请选择质检结果');
+            return false;
+          }
         }
         let materialCodeReqList = [];
         let code = 'onlyCode';
@@ -1740,16 +1806,9 @@
           // 批量修改包装明细
           this.bulkEditingWrap();
           this.$nextTick(() => {
-            if (
-              this.taskDefinitionKey === 'qualityInspection' &&
-              this.isStorage
-            ) {
-              updateOutInRecord(warpRow).then(() => {
-                this.$message.success('保存包装成功');
-              });
-              updateMaterialById(row).then(() => {
-                this.$message.success('保存物料成功');
-              });
+            if (!isLonely) {
+              // 更新数据
+              this.initFormData();
             }
             this.isWeight = true;
           });
@@ -2000,6 +2059,9 @@
         this.$set(row, 'isSave', false);
         row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
         row.warehouseLedgerDetails = [];
+        // 清空物料明细防止数据错乱
+        this.resultArray = [];
+        this.isDetail = false;
       },
       listSave(row, index) {
         const fileds = [
@@ -2388,7 +2450,14 @@
           this.$message.error('请添加产品信息和包装明细');
           return false;
         }
-
+        // // 默认全部保存(需要后台修改)
+        // if (this.resultArray?.length > 0) {
+        //   // 物料批量保存
+        //   this.materialListSave();
+        // } else {
+        //   // 包装批量保存
+        //   this.wrapListSave();
+        // }
         this.formatWarehouseMaterialList();
 
         let arr = this.warehousingMaterialList.map((item) => {
@@ -2435,7 +2504,7 @@
         // 入库来源storageSource 0-正常  1-外部
         obj.storageSource = 1;
         try {
-          const res = await outin.save(obj);
+          const res = await outin.updateOutIn(obj);
           if (res.code == 0) {
             this.isConfig = true;
             this.$message.success('保存成功!');

+ 206 - 175
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue

@@ -31,187 +31,218 @@
 </template>
 
 <script>
-import {EventBus} from './eventBus.js';
-import {getOutInByIdAPI, saleReturnGetByIdAPI} from "@/api/bpm/components/saleManage/saleorder";
-import {deepClone} from "@/utils";
+  import { EventBus } from './eventBus.js';
+  import {
+    getOutInByIdAPI,
+    saleReturnGetByIdAPI
+  } from '@/api/bpm/components/saleManage/saleorder';
+  import { deepClone } from '@/utils';
 
-export default {
-  name: 'customerReturnOrderDialog',
-  props: {
-    taskDefinitionKey: {
-      type: String,
-      default: 'stater'
+  export default {
+    name: 'customerReturnOrderDialog',
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: 'stater'
+      },
+      businessId: {
+        type: String,
+        default: ''
+      }
     },
-    businessId: {
-      type: String,
-      default: ''
-    }
-  },
-  components: {
-    repairTabsPage: () => import('./repair-tabs-page'),
-    customerReturnOrder: () => import('./customerReturnOrder')
-  },
-
-  data() {
-    //innerOuterBoth 1 只有内部  2 只有外部 9 都有
-    return {
-      dialogType: 'add',
-      pageName: '',
-      repairTabsOptions: [
-        {key: 'outerStoremanOut', isOutOrIn: 'outerStore', name: '物品出库给外协'},
-        {key: 'outerStoremanIn', isOutOrIn: 'outerStore', name: '外协返修物品入库'},
-        {key: 'outerInQC', isOutOrIn: 'outerStore', name: '外协返修入库质检'},
-        {key: 'innerStoremanIn', isOutOrIn: 'innerStore', name: '内部生产物品入库'},
-        {key: 'innerInQC', isOutOrIn: 'innerStore', name: '内部生产入库质检'}
-      ],
-      activeComp: '',
-      permissionType: '',
-      isShowReturnOrder: '',
-      warehousingMaterialList: [],
-      materialCodeReqList: [],
-      metaList: [],
-      form: {},
-      innerOuterBoth: '',
-      loading: false,
-      key: 1
-    };
-  },
-  computed: {
-    tabOptions() {
-      let list = [
-        {
-          key: 'stater',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '发起人申请',
-          isShow: true
-        },
-        {
-          key: 'deptLeader',
-          permissionType: 'view',
-          isShowReturnOrder: false,
-          name: '销售主管审批',
-          isShow: true
-        },
-        {
-          key: 'storeman',
-          permissionType: 'update',
-          isShowReturnOrder: true,
-          name: '仓管入库',
-          isShow: true
-        },
-        {
-          key: 'QCLeader',
-          permissionType: 'view',
-          isShowReturnOrder: false,
-          name: '质量部主管指派',
-          isShow: true
-        },
-        {
-          key: 'QCApprove',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '质检员审核',
-          isShow: true
-        },
-        {
-          key: 'techLeader',
-          permissionType: 'view',
-          isShowReturnOrder: false,
-          name: '技术部主管指派',
-          isShow: true
-        },
-        {
-          key: 'techApprove',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '技术员审核',
-          isShow: true
-        },
-        {
-          key: 'produceLeader',
-          permissionType: 'view',
-          isShowReturnOrder: false,
-          name: '生产部主管指派',
-          isShow: true
-        },
-        {
-          key: 'produceApprove',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '生产员审核',
-          isShow: true
-        },
-        {
-          key: 'outerStore',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '外部处理',
-          isShow: [2, 9].includes(this.innerOuterBoth)
-        },
-        {
-          key: 'innerStore',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '内部处理',
-          isShow: [1, 9].includes(this.innerOuterBoth)
-        },
-        {
-          key: 'QCApprove2',
-          permissionType: 'update',
-          isShowReturnOrder: false,
-          name: '质检员反馈',
-          isShow: true
-        }
-      ]
-      return list.filter(item => item.isShow)
-    }
-  },
-  async created() {
-    //返修节点中有可能多流程
-    let find = this.repairTabsOptions.find(item => item.key == this.taskDefinitionKey)?.isOutOrIn || '';
-    let optionKey = find || this.taskDefinitionKey
-    this.activeComp = optionKey || 'stater';
-    this.permissionType = this.tabOptions.find(
-      (item) => item.key == this.activeComp
-    )?.permissionType;
-    find && await this.getReturnInfo(this.businessId)
-    this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp) ? 'repairTabsPage' : 'customerReturnOrder';
-  },
-  mounted() {
-    setTimeout(() => {
-      this.getActiveCompValue();
-    }, 400);
-  },
-  methods: {
-    getTableValue() {
-      return this.$refs.componentRef.getTableValue();
+    components: {
+      repairTabsPage: () => import('./repair-tabs-page'),
+      customerReturnOrder: () => import('./customerReturnOrder')
     },
-    getReturnStorage() {
-      return this.$refs.componentRef.getReturnStorage();
+
+    data() {
+      //innerOuterBoth 1 只有内部  2 只有外部 9 都有
+      return {
+        dialogType: 'add',
+        pageName: '',
+        repairTabsOptions: [
+          {
+            key: 'outerStoremanOut',
+            isOutOrIn: 'outerStore',
+            name: '物品出库给外协'
+          },
+          {
+            key: 'outerStoremanIn',
+            isOutOrIn: 'outerStore',
+            name: '外协返修物品入库'
+          },
+          {
+            key: 'outerInQC',
+            isOutOrIn: 'outerStore',
+            name: '外协返修入库质检'
+          },
+          {
+            key: 'innerStoremanIn',
+            isOutOrIn: 'innerStore',
+            name: '内部生产物品入库'
+          },
+          {
+            key: 'innerInQC',
+            isOutOrIn: 'innerStore',
+            name: '内部生产入库质检'
+          }
+        ],
+        activeComp: '',
+        permissionType: '',
+        isShowReturnOrder: '',
+        warehousingMaterialList: [],
+        materialCodeReqList: [],
+        metaList: [],
+        form: {},
+        innerOuterBoth: '',
+        loading: false,
+        key: 1
+      };
     },
-    handleCard(val) {
-      this.activeComp = val.key
-      this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp) ? 'repairTabsPage' : 'customerReturnOrder';
-      this.permissionType = val.permissionType;
-      this.isShowReturnOrder = val.isShowReturnOrder;
-      this.key++;
-      this.getActiveCompValue();
+    computed: {
+      tabOptions() {
+        let list = [
+          {
+            key: 'stater',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '发起人申请',
+            isShow: true
+          },
+          {
+            key: 'deptLeader',
+            permissionType: 'view',
+            isShowReturnOrder: false,
+            name: '销售主管审批',
+            isShow: true
+          },
+          {
+            key: 'storeman',
+            permissionType: 'update',
+            isShowReturnOrder: true,
+            name: '仓管入库',
+            isShow: true
+          },
+          {
+            key: 'QCLeader',
+            permissionType: 'view',
+            isShowReturnOrder: false,
+            name: '质量部主管指派',
+            isShow: true
+          },
+          {
+            key: 'QCApprove',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '质检员审核',
+            isShow: true
+          },
+          {
+            key: 'techLeader',
+            permissionType: 'view',
+            isShowReturnOrder: false,
+            name: '技术部主管指派',
+            isShow: true
+          },
+          {
+            key: 'techApprove',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '技术员审核',
+            isShow: true
+          },
+          {
+            key: 'produceLeader',
+            permissionType: 'view',
+            isShowReturnOrder: false,
+            name: '生产部主管指派',
+            isShow: true
+          },
+          {
+            key: 'produceApprove',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '生产员审核',
+            isShow: true
+          },
+          {
+            key: 'outerStore',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '外部处理',
+            isShow: [2, 9].includes(this.innerOuterBoth)
+          },
+          {
+            key: 'innerStore',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '内部处理',
+            isShow: [1, 9].includes(this.innerOuterBoth)
+          },
+          {
+            key: 'QCApprove2',
+            permissionType: 'update',
+            isShowReturnOrder: false,
+            name: '质检员反馈',
+            isShow: true
+          }
+        ];
+        return list.filter((item) => item.isShow);
+      }
     },
-    getActiveCompValue() {
-      EventBus.$emit('getActiveCompValue', {
-        activeComp: this.activeComp,
-        permissionType: this.permissionType
-      });
+    async created() {
+      //返修节点中有可能多流程
+      let find =
+        this.repairTabsOptions.find(
+          (item) => item.key == this.taskDefinitionKey
+        )?.isOutOrIn || '';
+      let optionKey = find || this.taskDefinitionKey;
+      this.activeComp = optionKey || 'stater';
+      this.permissionType = this.tabOptions.find(
+        (item) => item.key == this.activeComp
+      )?.permissionType;
+      find && (await this.getReturnInfo(this.businessId));
+      this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp)
+        ? 'repairTabsPage'
+        : 'customerReturnOrder';
     },
-    async getReturnInfo(businessId) {
-      this.form = await saleReturnGetByIdAPI(businessId);
-      this.innerOuterBoth = this.form.innerOuterBoth
-      // this.$nextTick(() => {
-      //   this.$refs.table.reRenderTable();
-      // });
+    mounted() {
+      setTimeout(() => {
+        this.getActiveCompValue();
+      }, 400);
     },
-  }
-};
+    methods: {
+      getTableValue() {
+        return this.$refs.componentRef.getTableValue();
+      },
+      // 获取销售退货仓管入库数据
+      getReturnStorage() {
+        return this.$refs.componentRef.getReturnStorage();
+      },
+      handleCard(val) {
+        this.activeComp = val.key;
+        this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp)
+          ? 'repairTabsPage'
+          : 'customerReturnOrder';
+        this.permissionType = val.permissionType;
+        this.isShowReturnOrder = val.isShowReturnOrder;
+        this.key++;
+        this.getActiveCompValue();
+      },
+      getActiveCompValue() {
+        EventBus.$emit('getActiveCompValue', {
+          activeComp: this.activeComp,
+          permissionType: this.permissionType
+        });
+      },
+      async getReturnInfo(businessId) {
+        this.form = await saleReturnGetByIdAPI(businessId);
+        this.innerOuterBoth = this.form.innerOuterBoth;
+        // this.$nextTick(() => {
+        //   this.$refs.table.reRenderTable();
+        // });
+      }
+    }
+  };
 </script>
 <style scoped lang="scss"></style>

+ 19 - 6
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue

@@ -6,11 +6,7 @@
         <el-form label-width="110px">
           <el-col :span="8">
             <el-form-item label="物品类型">
-              <span>{{
-                infoData.bizType == 3
-                  ? '物品'
-                  : getDictValue('类型用途', infoData.assetType)
-              }}</span>
+              <span>{{ codeList[infoData.extInfo.assetType] }}</span>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -396,7 +392,10 @@
   // import { tableHeader } from '../common';
   import WareHouseDailog from '@/components/WareHouseDailog/index.vue';
   import { mapGetters, mapActions } from 'vuex';
-  import { getOutInBySourceBizNoOrError } from '@/api/classifyManage/index';
+  import {
+    getOutInBySourceBizNoOrError,
+    getTreeByGroup
+  } from '@/api/classifyManage/index';
   //import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
 
   // import {
@@ -427,6 +426,7 @@
 
     data() {
       return {
+        codeList: {}, // 物品类型键值对
         isEdit: true, // 是否可以编辑(货位和质检状态)
         showTable: true, // 解决set数组Table不刷新问题
         title: '信息',
@@ -449,6 +449,9 @@
     computed: {
       ...mapGetters(['getDictValue'])
     },
+    created() {
+      this.getCodeList();
+    },
     methods: {
       // 仓库选择
       houseData(argum, idx) {
@@ -486,6 +489,16 @@
           console.log(this.infoData.outInDetailAddPOList);
         });
       },
+      // 获取物品类型
+      async getCodeList() {
+        const { data } = await getTreeByGroup({ type: 1 });
+        console.log(data);
+        let arr = {};
+        data.forEach((item) => {
+          arr[item.id] = item.name;
+        });
+        this.codeList = arr;
+      },
       // 仓库编辑
       handleWareHouse(row, idx) {
         this.$refs.wareHouseDailogRef.open(row, idx);

+ 151 - 97
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/repair-tabs-page.vue

@@ -1,7 +1,11 @@
 <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
+        v-for="item in tabOption"
+        :label="item.label"
+        :name="item.name"
+      >
       </el-tab-pane>
     </el-tabs>
     <component
@@ -17,107 +21,157 @@
   </div>
 </template>
 
-
 <script>
-
-import {EventBus} from "@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/eventBus";
-
-export default {
-  name: 'repairTabsPage',
-  components: {
-    outerStoremanOut: () => import('./page1.vue'),
-    outerStoremanIn: () => import('./page2.vue'),
-    outerInQC: () => import('./page1.vue'),
-    innerStoremanIn: () => import('./page2.vue'),
-    innerInQC: () => import('./page1.vue'),
-  },
-  props: {
-    taskDefinitionKey: {
-      type: String,
-      default: ''
+  import { EventBus } from '@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/eventBus';
+  import { saleReturnGetByIdAPI } from '@/api/bpm/components/saleManage/saleorder';
+  export default {
+    name: 'repairTabsPage',
+    components: {
+      outerStoremanOut: () => import('./page1.vue'),
+      outerStoremanIn: () => import('./page2.vue'),
+      outerInQC: () => import('./page1.vue'),
+      innerStoremanIn: () => import('./interiorProductionStorage'),
+      innerInQC: () => import('./interiorProductionStorageQuality')
     },
-    activeComp: {
-      type: String,
-      default: ''
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: ''
+      },
+      activeComp: {
+        type: String,
+        default: ''
+      },
+      permissionType: {
+        type: String,
+        default: 'view'
+      },
+      businessId: {
+        type: String,
+        default: ''
+      },
+      innerOuterBoth: {
+        type: Number,
+        default: ''
+      }
     },
-    permissionType: {
-      type: String,
-      default: 'view'
+    data() {
+      return {
+        activeName: '',
+        cKey: 1
+      };
     },
-    businessId: {
-      type: String,
-      default: ''
+    computed: {
+      tabOption() {
+        let list = [
+          {
+            label: '内部生产物品入库',
+            name: 'innerStoremanIn',
+            parentType: '1'
+          },
+          {
+            label: '内部生产入库质检',
+            name: 'innerInQC',
+            parentType: '1'
+          },
+          {
+            label: '物品出库给外协',
+            name: 'outerStoremanOut',
+            parentType: '2'
+          },
+          {
+            label: '外协返修物品入库',
+            name: 'outerStoremanIn',
+            parentType: '2'
+          },
+          {
+            label: '外协返修入库质检',
+            name: 'outerInQC',
+            parentType: '2'
+          }
+        ];
+        return list.filter((item) => item.parentType == this.innerOuterBoth);
+      }
     },
-    innerOuterBoth: {
-      type: Number,
-      default: ''
+    async created() {
+      this.activeName = this.taskDefinitionKey;
     },
-  },
-  data() {
-    return {
-      activeName: '',
-      cKey: 1,
-    }
-  },
-  computed: {
-    tabOption() {
-      let list = [
-        {
-          label: '内部生产物品入库',
-          name: 'innerStoremanIn',
-          parentType: '1'
-        },
-        {
-          label: '内部生产入库质检',
-          name: 'innerInQC',
-          parentType: '1'
-        },
-        {
-          label: '物品出库给外协',
-          name: 'outerStoremanOut',
-          parentType: '2'
-        },
-        {
-          label: '外协返修物品入库',
-          name: 'outerStoremanIn',
-          parentType: '2'
-        },
-        {
-          label: '外协返修入库质检',
-          name: 'outerInQC',
-          parentType: '2'
-        },
-      ]
-      return list.filter(item => item.parentType == this.innerOuterBoth)
-    }
-  },
-  async created() {
-    this.activeName = this.taskDefinitionKey
-  },
-  mounted() {
-    setTimeout(() => {
-      this.getActiveCompValue();
-    }, 400);
-  },
-  methods: {
-    isValidComponent(componentName) {
-      const validComponents = ['outerStoremanOut', 'outerStoremanIn', 'outerInQC', 'innerStoremanIn', 'innerInQC'];
-      return validComponents.includes(componentName);
+    mounted() {
+      setTimeout(() => {
+        this.getActiveCompValue();
+      }, 400);
     },
-    handleClick(val) {
-      this.activeName = val.name
-      this.getActiveCompValue()
-    },
-    getActiveCompValue() {
-      EventBus.$emit('getActiveCompValue', {
-        activeComp: this.activeComp,
-        childActiveComp: this.activeName,
-        permissionType: this.permissionType
-      });
-    },
-  }
-}
+    methods: {
+      isValidComponent(componentName) {
+        const validComponents = [
+          'outerStoremanOut',
+          'outerStoremanIn',
+          'outerInQC',
+          'innerStoremanIn',
+          'innerInQC'
+        ];
+        return validComponents.includes(componentName);
+      },
+      handleClick(val) {
+        this.activeName = val.name;
+        this.getActiveCompValue();
+      },
+      getActiveCompValue() {
+        EventBus.$emit('getActiveCompValue', {
+          activeComp: this.activeComp,
+          childActiveComp: this.activeName,
+          permissionType: this.permissionType
+        });
+      },
+      getReturnStorage() {
+        return Promise.resolve(this.$refs.componentRef.getReturnStorage());
+      },
+      getTableValue() {
+        return new Promise(async (resolve) => {
+          this.form = await saleReturnGetByIdAPI(this.businessId);
+          let params = {
+            detailList: this.form.detailList.map((i) => {
+              return {
+                outInId: i.outInId,
+                outInCode: i.outInCode,
+                measurementCount: i.measurementCount,
+                outboundDetailId: i.outboundDetailId,
+                outboundType: i.outboundType,
+                packageCount: i.packageCount,
+                packingUnit: i.packingUnit,
+                weight: i.weight,
+                weightUtil: i.weightUtil,
+                specification: i.specification,
+                categoryCode: i.categoryCode,
+                carveCode: i.carveCode,
+                name: i.name,
+                reason: i.reason,
+                sendDate: i.sendDate,
+                feedbackDate: i.feedbackDate,
+                id: i.id,
+                handleOpinion: i.handleOpinion,
+                handleWay: i.handleWay,
+                ifPackageOk: i.ifPackageOk,
+                ifReasonMatch: i.ifReasonMatch,
+                improveCorrect: i.improveCorrect,
+                improveOpinion: i.improveOpinion,
+                outerInfo: i.outerInfo,
+                inOrOut: i.inOrOut,
+                remark: i.remark,
+                unpackUserId: i.unpackUserId,
+                unpackUserName: i.unpackUserName,
+                unqualifiedReasonAnalysis: i.unqualifiedReasonAnalysis,
+                unqualifiedType: i.unqualifiedType,
+                unqualifiedTypeName: i.unqualifiedTypeName
+              };
+            }),
+            returnRecordId: this.form.returnRecordId,
+            id: this.form.id
+          };
+          resolve(params);
+        });
+      }
+    }
+  };
 </script>
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>

+ 177 - 163
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -1,5 +1,11 @@
 <template>
-  <el-col :span="16" :offset="6" v-if="activeComp == taskDefinitionKey || childActiveComp ==taskDefinitionKey">
+  <el-col
+    :span="16"
+    :offset="6"
+    v-if="
+      activeComp == taskDefinitionKey || childActiveComp == taskDefinitionKey
+    "
+  >
     <el-form label-width="100px" ref="formRef" :rules="rules" :model="form">
       <el-form-item
         v-if="
@@ -44,7 +50,7 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
-      >通过
+        >通过
       </el-button>
 
       <el-button
@@ -53,164 +59,98 @@
         size="mini"
         v-if="taskDefinitionKey !== 'stater'"
         @click="handleAudit(0)"
-      >驳回
+        >驳回
       </el-button>
     </div>
   </el-col>
 </template>
 
 <script>
-import {
-  approveTaskWithVariablesAPI,
-  saleReturnUpdateAPI
-} from '@/api/bpm/components/saleManage/saleorder';
-import {listAllUserBind} from '@/api/system/organization';
-import {EventBus} from './eventBus.js';
-import outin from '@/api/warehouseManagement/outin';
-// 流程实例的详情页,可用于审批
-//qcId techId produceId
-export default {
-  name: '',
-  components: {
-    //   Parser
-  },
-  props: {
-    businessId: {
-      default: ''
+  import {
+    approveTaskWithVariablesAPI,
+    saleReturnUpdateAPI
+  } from '@/api/bpm/components/saleManage/saleorder';
+  import { listAllUserBind } from '@/api/system/organization';
+  import { EventBus } from './eventBus.js';
+  import outin from '@/api/warehouseManagement/outin';
+  // 流程实例的详情页,可用于审批
+  //qcId techId produceId
+  export default {
+    name: '',
+    components: {
+      //   Parser
     },
-    taskId: {
-      default: ''
-    },
-    id: {
-      default: ''
-    },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      form: {
-        userId: '',
-        reason: ''
+    props: {
+      businessId: {
+        default: ''
       },
-      submitParams: {
-        QCLeader: 'qcId',
-        techLeader: 'techId',
-        produceLeader: 'produceId'
+      taskId: {
+        default: ''
       },
-      rules: {
-        reason: {
-          required: true,
-          message: '请输入审批建议',
-          trigger: 'blur'
-        },
-        userId: {required: true, message: '请选择指派人', trigger: 'change'}
+      id: {
+        default: ''
       },
-      userOptions: [],
-      activeComp: '',
-      permissionType: '',
-      childActiveComp: '',
-    };
-  },
-  async created() {
-    this.userOptions = [];
-    listAllUserBind().then((data) => {
-      this.userOptions.push(...data);
-    });
-    this.activeComp = this.taskDefinitionKey;
-    EventBus.$on('getActiveCompValue', (row) => {
-      this.activeComp = row.activeComp;
-      this.childActiveComp = row.childActiveComp;
-      this.permissionType = row.permissionType;
-    });
-  },
-  mounted() {
-  },
-  methods: {
-    // 销售退货入库
-    async salesReturnsInStorage(data, pass) {
-      // 获取销售退货入库信息
-      let storageData = await this.getReturnStorage();
-      // 是否已经入库
-      if (storageData.isStorage) {
-        approveTaskWithVariablesAPI({
-          id: this.taskId,
-          reason: this.form.reason,
-          variables: {
-            pass: !!pass
-          }
-        }).then((res) => {
-          if (res.code != '-1') {
-            this.$emit('handleAudit', {
-              status: pass,
-              title: !pass ? '驳回' : ''
-            });
-          }
-        });
-      } else {
-        // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
-        storageData.storageSource = 1;
-        // 获取货位信息(判断货位信息是否填写)
-        let houseListLength = storageData.outInDetailAddPOList.map((item) => {
-          return item.houseList.length;
-        });
-        let boolen = houseListLength.every((item) => item > 0);
-        if (boolen) {
-          try {
-            const res = await outin.save(storageData);
-            console.log('res------------------', res);
-            data.returnInReceiptId = res.data;
-            const updateRes = await saleReturnUpdateAPI(data);
-            if (updateRes.code == 0) {
-              approveTaskWithVariablesAPI({
-                id: this.taskId,
-                reason: this.form.reason,
-                variables: {
-                  pass: !!pass
-                }
-              }).then((res) => {
-                if (res.code != '-1') {
-                  this.$emit('handleAudit', {
-                    status: pass,
-                    title: !pass ? '驳回' : ''
-                  });
-                }
-              });
-            }
-          } catch (error) {
-            console.error('保存失败:', error);
-          }
-        } else {
-          this.$message.error('请选择物品货位信息');
-        }
+      taskDefinitionKey: {
+        default: ''
       }
     },
-    //保存表格数据
-    async handleAudit(pass) {
-      let data = await this.getTableValue();
-      let updateCode = '1'; //判断saleReturnUpdateAPI方法是否执行成功
-      this.$refs.formRef.validate(async (validate) => {
-        if ((!validate || !data) && !!pass)
-          return this.$message.warning('有必填项未填,请检查');
-        // 销售退货入库节点
-        if (this.taskDefinitionKey === 'storeman' && !!pass) {
-          this.salesReturnsInStorage(data, pass);
-        } else {
-          if (this.permissionType == 'update' && !!pass)
-            updateCode = await saleReturnUpdateAPI(data);
-          if (typeof updateCode !== 'string') return;
-          let variables = {
-            pass: !!pass
-          };
-          if (this.submitParams[this.taskDefinitionKey]) {
-            variables[this.submitParams[this.taskDefinitionKey]] =
-              this.form.userId;
-          }
+    data() {
+      return {
+        form: {
+          userId: '',
+          reason: ''
+        },
+        submitParams: {
+          QCLeader: 'qcId',
+          techLeader: 'techId',
+          produceLeader: 'produceId'
+        },
+        rules: {
+          reason: {
+            required: true,
+            message: '请输入审批建议',
+            trigger: 'blur'
+          },
+          userId: { required: true, message: '请选择指派人', trigger: 'change' }
+        },
+        userOptions: [],
+        activeComp: '',
+        permissionType: '',
+        childActiveComp: ''
+      };
+    },
+    async created() {
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+      this.activeComp = this.taskDefinitionKey;
+      EventBus.$on('getActiveCompValue', (row) => {
+        this.activeComp = row.activeComp;
+        this.childActiveComp = row.childActiveComp;
+        this.permissionType = row.permissionType;
+      });
+    },
+    mounted() {},
+    methods: {
+      // 内部生产物品入库
+      async interiorProductionStorage(data) {
+        let storageData = await this.getReturnStorage();
+        console.log(data);
+        console.log(storageData);
+      },
+      // 销售退货入库
+      async salesReturnsInStorage(data, pass) {
+        // 获取销售退货入库信息
+        let storageData = await this.getReturnStorage();
+        // 是否已经入库
+        if (storageData.isStorage) {
           approveTaskWithVariablesAPI({
             id: this.taskId,
             reason: this.form.reason,
-            variables
+            variables: {
+              pass: !!pass
+            }
           }).then((res) => {
             if (res.code != '-1') {
               this.$emit('handleAudit', {
@@ -219,28 +159,102 @@ export default {
               });
             }
           });
+        } else {
+          // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
+          storageData.storageSource = 1;
+          // 获取货位信息(判断货位信息是否填写)
+          let houseListLength = storageData.outInDetailAddPOList.map((item) => {
+            return item.houseList.length;
+          });
+          let boolen = houseListLength.every((item) => item > 0);
+          if (boolen) {
+            try {
+              const res = await outin.save(storageData);
+              console.log('res------------------', res);
+              data.returnInReceiptId = res.data;
+              const updateRes = await saleReturnUpdateAPI(data);
+              if (updateRes.code == 0) {
+                approveTaskWithVariablesAPI({
+                  id: this.taskId,
+                  reason: this.form.reason,
+                  variables: {
+                    pass: !!pass
+                  }
+                }).then((res) => {
+                  if (res.code != '-1') {
+                    this.$emit('handleAudit', {
+                      status: pass,
+                      title: !pass ? '驳回' : ''
+                    });
+                  }
+                });
+              }
+            } catch (error) {
+              console.error('保存失败:', error);
+            }
+          } else {
+            this.$message.error('请选择物品货位信息');
+          }
         }
-      });
-    },
-    getTableValue() {
-      return new Promise((resolve, reject) => {
-        this.$emit('getTableValue', async (data) => {
-          resolve(await data);
+      },
+      //保存表格数据
+      async handleAudit(pass) {
+        let data = await this.getTableValue();
+        let updateCode = '1'; //判断saleReturnUpdateAPI方法是否执行成功
+        this.$refs.formRef.validate(async (validate) => {
+          if ((!validate || !data) && !!pass)
+            return this.$message.warning('有必填项未填,请检查');
+          if (this.taskDefinitionKey === 'storeman' && !!pass) {
+            // 销售退货入库节点
+            this.salesReturnsInStorage(data, pass);
+          } else if (this.taskDefinitionKey === 'innerStoremanIn' && !!pass) {
+            // 内部生产物品入库
+            this.interiorProductionStorage(data);
+          } else {
+            if (this.permissionType == 'update' && !!pass)
+              updateCode = await saleReturnUpdateAPI(data);
+            if (typeof updateCode !== 'string') return;
+            let variables = {
+              pass: !!pass
+            };
+            if (this.submitParams[this.taskDefinitionKey]) {
+              variables[this.submitParams[this.taskDefinitionKey]] =
+                this.form.userId;
+            }
+            approveTaskWithVariablesAPI({
+              id: this.taskId,
+              reason: this.form.reason,
+              variables
+            }).then((res) => {
+              if (res.code != '-1') {
+                this.$emit('handleAudit', {
+                  status: pass,
+                  title: !pass ? '驳回' : ''
+                });
+              }
+            });
+          }
         });
-      });
-    },
-    getReturnStorage() {
-      return new Promise((resolve, reject) => {
-        this.$emit('getReturnStorage', async (data) => {
-          resolve(await data);
+      },
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
         });
-      });
+      },
+      getReturnStorage() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getReturnStorage', async (data) => {
+            resolve(await data);
+          });
+        });
+      }
+    },
+    beforeDestroy() {
+      EventBus.$off('getActiveCompValue');
     }
-  },
-  beforeDestroy() {
-    EventBus.$off('getActiveCompValue');
-  }
-};
+  };
 </script>
 
 <style lang="scss"></style>

+ 1 - 0
src/views/bpm/handleTask/index.vue

@@ -607,6 +607,7 @@
       getTableValue(fn) {
         fn(this.$refs.bziRef.getTableValue());
       },
+      // 获取销售退货仓管入库数据
       getReturnStorage(fn) {
         fn(this.$refs.bziRef.getReturnStorage());
       }

+ 51 - 8
src/views/bpm/stockManagement/add.vue

@@ -793,7 +793,15 @@
               >
             </div>
           </header-title>
-
+          <el-button
+            v-if="materialCodeReqList.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="wrapListSave"
+            >批量保存</el-button
+          >
           <el-table
             ref="materialCodeReqListTable"
             :data="materialCodeReqList"
@@ -993,6 +1001,15 @@
         </div>
         <div class="mt20" v-if="isDetail">
           <header-title :title="`物料明细`"> </header-title>
+          <el-button
+            v-if="resultArray.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="materialListSave"
+            >批量保存</el-button
+          >
           <el-table
             ref="resultArrayTable"
             :data="resultArray"
@@ -1176,7 +1193,7 @@
   import { approveTaskWithVariables } from '@/api/bpm/task';
   import { getProductList } from '@/api/bpm/components/saleManage/contact';
   import { getLoginUser } from '@/api/login';
-  import picker from './components/picker.vue';
+  import picker from '@/views/bpm/stockManagement/components/picker.vue';
   import outin from '@/api/warehouseManagement/outin';
   import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
@@ -1190,13 +1207,13 @@
   } from '@/utils/dict/index';
   // import { getInfo, warehousingAdd, getAssetNum } from '@/api/stockManagement';
   import selectTree from '@/components/selectTree';
-  import selectType from './components/selectType.vue';
-  import WareHouseDailog from './components/WareHouseDailog.vue';
-  import ReturnSelect from './components/ReturnSelect.vue';
+  import selectType from '@/views/bpm/stockManagement/components/selectType.vue';
+  import WareHouseDailog from '@/views/bpm/stockManagement/components/WareHouseDailog.vue';
+  import ReturnSelect from '@/views/bpm/stockManagement/components/ReturnSelect.vue';
   // import supplier from '@/api/main/supplier';
   // import org from '@/api/main/org';
   // import user from '@/api/main/user';
-  import { tableHeader } from '../handleTask/components/inoutBound/common';
+  import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
   import { getCode } from '@/api/codeManagement/index.js';
   import { number } from 'echarts/core';
   // import { purchaseorderGetById, contactlink } from '@/api/mes';
@@ -1811,6 +1828,9 @@
         this.$set(row, 'isSave', false);
         row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
         row.warehouseLedgerDetails = [];
+        // 清空物料明细防止数据错乱
+        this.resultArray = [];
+        this.isDetail = false;
       },
       listSave(row, index) {
         const fileds = [
@@ -2177,7 +2197,23 @@
           });
         }
       },
-
+      // 包装批量保存
+      wrapListSave() {
+        // 批量修改包装明细
+        this.isWeight = false;
+        this.bulkEditingWrap();
+        this.$nextTick(() => {
+          this.isWeight = true;
+        });
+      },
+      // 物料批量保存
+      materialListSave() {
+        this.resultArray.forEach((item) => {
+          if (!item.isPack) {
+            this.materialBtn(item);
+          }
+        });
+      },
       handleSave(data) {
         this.$refs.formName.validate(async (valid) => {
           if (valid) {
@@ -2188,7 +2224,14 @@
             ) {
               return this.$message.error('请保存入库明细!');
             }
-
+            // 默认全部保存
+            if (this.resultArray?.length > 0) {
+              // 物料批量保存
+              this.materialListSave();
+            } else {
+              // 包装批量保存
+              this.wrapListSave();
+            }
             this.formatWarehouseMaterialList();
 
             let arr = this.warehousingMaterialList.map((item) => {

+ 2 - 3
src/views/bpm/stockManagement/components/selectType.vue

@@ -42,6 +42,8 @@
             :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
             @selection-change="handleSelectionChange"
           >
+            <el-table-column type="selection" width="55" align="center">
+            </el-table-column>
             <el-table-column width="55px" label="序号" type="index">
               <!-- <template slot-scope="{ $index }">
                 {{ $tableIndex($index, pages.pageNum, pages.size) }}
@@ -106,9 +108,6 @@
               label="分类"
               :show-overflow-tooltip="true"
             ></el-table-column>
-
-            <el-table-column type="selection" width="55" align="center">
-            </el-table-column>
           </el-table>
           <div class="right mt10" v-if="bizScene != 5">
             <el-pagination