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

+ 12 - 0
src/api/classifyManage/index.js

@@ -89,6 +89,18 @@ export async function getOutInBySourceBizNo(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 来源id查入库详情(error)
+export async function getOutInBySourceBizNoOrError(id) {
+  const res = await request.get(`/wms/outin/getOutInBySourceBizNo/${id}`);
+  console.log('code-------', res.data.code);
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data.data);
+  } else {
+    return Promise.reject('error');
+  }
+}
+
 // 质检
 export async function updateOutInRecord(data) {
   const res = await request.post(`wms/outin/updateOutInRecord`, data);

+ 248 - 47
src/views/bpm/handleTask/components/inoutBound/detailDialog.vue

@@ -4,7 +4,6 @@
       <div>
         <div class="content-detail">
           <header-title title="基本信息" size="16px"></header-title>
-
           <div class="mt20">
             <el-form label-width="120px">
               <el-col :span="8">
@@ -134,7 +133,7 @@
                 :show-message="false"
               >
                 <el-table
-                  ref="multipleTable"
+                  ref="warehousingMaterialListTable"
                   :data="warehousingMaterialList"
                   tooltip-effect="dark"
                   :key="infoData.assetType"
@@ -398,7 +397,7 @@
           <header-title :title="`包装明细`" size="16px"></header-title>
 
           <el-table
-            ref="multipleTable"
+            ref="detailListTable"
             :data="detailList"
             tooltip-effect="dark"
             :header-cell-style="rowClass"
@@ -479,30 +478,15 @@
                   dictName="质检结果"
                   clearable
                   v-model="row.result"
-                  v-show="!row.isPack"
-                  @itemChange="packItem($event, row)"
+                  v-if="!row.isPack"
+                  @updateVal="changeWrapStatus($event, row)"
                 />
-                <span v-if="row.isPack">
-                  <span v-if="row.result == 0">合格</span>
-                  <span v-else-if="row.result == 1">不合格</span>
-                  <span v-else-if="row.result == 3">让步接收</span>
-                  <span v-else-if="row.result == null"></span>
-                </span>
+                <span v-else>{{ qualityResults[row.result] }}</span>
               </template>
             </el-table-column>
             <el-table-column label="质检状态" prop="status" width="120">
               <template slot-scope="{ row }">
-                <DictSelection
-                  dictName="质检状态"
-                  clearable
-                  v-model="row.status"
-                  v-show="!row.isPack"
-                />
-                <span v-if="row.isPack">
-                  <span v-if="row.status == 0">未检</span>
-                  <span v-if="row.status == 1">已检</span>
-                  <span v-if="row.status == null"></span>
-                </span>
+                <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
 
@@ -540,7 +524,7 @@
         <div class="mt20">
           <header-title :title="`物料明细`" size="16px"> </header-title>
           <el-table
-            ref="multipleTable"
+            ref="metailListTable"
             :data="metailList"
             tooltip-effect="dark"
             :header-cell-style="rowClass"
@@ -601,7 +585,8 @@
             </el-table-column>
             <el-table-column width="100" label="重量" prop="weight">
               <template slot-scope="{ row }">
-                {{ row.weight }}
+                <el-input v-show="!row.isPack" v-model="row.weight"></el-input>
+                <span v-show="row.isPack">{{ row.weight }}</span>
               </template>
             </el-table-column>
             <el-table-column label="重量单位" prop="weightUnit">
@@ -612,30 +597,38 @@
 
             <el-table-column label="质检结果" prop="result" width="120">
               <template slot-scope="{ row }">
-                <span>
-                  <span v-if="row.result == 0">合格</span>
-                  <span v-else-if="row.result == 1">不合格</span>
-                  <span v-else-if="row.result == 3">让步接收</span>
-                  <span v-else-if="row.result == null"></span>
-                </span>
+                <DictSelection
+                  dictName="质检结果"
+                  clearable
+                  v-model="row.result"
+                  v-if="!row.isPack"
+                  @updateVal="changeWrapStatus($event, row)"
+                />
+                <span v-else>{{ qualityResults[row.result] }}</span>
               </template>
             </el-table-column>
             <el-table-column label="质检状态" prop="status" width="120">
               <template slot-scope="{ row }">
-                <span>
-                  <span v-if="row.status == 0">未检</span>
-                  <span v-if="row.status == 1">已检</span>
-                  <span v-if="row.status == null"></span>
-                </span>
+                <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
             <el-table-column
               label="操作"
               width="80"
+              fixed="right"
               v-if="taskDefinitionKey == 'qualityInspection'"
             >
               <template slot-scope="{ row }">
-                <el-button type="text" @click="packMeta(row)"> 提交 </el-button>
+                <el-button
+                  v-show="!row.isPack"
+                  type="text"
+                  @click="packMeta(row)"
+                >
+                  保存
+                </el-button>
+                <el-button v-show="row.isPack" type="text" @click="edit(row)">
+                  编辑
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -665,6 +658,7 @@
   import {
     getTreeByPid,
     getOutInBySourceBizNo,
+    getOutInBySourceBizNoOrError,
     updateOutInRecord,
     updateMaterialById
   } from '@/api/classifyManage';
@@ -697,6 +691,16 @@
     },
     data() {
       return {
+        qualityStatus: {
+          0: '未检',
+          1: '已检',
+          2: '部分检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          0: '合格',
+          1: '不合格',
+          3: '让步接收'
+        },
         qualityFile: '',
         saveLoading: false,
         metailList: [],
@@ -758,6 +762,33 @@
             this.stepsStatus = 'error';
           }
         }
+      },
+      // 解决右侧悬浮操作栏不对称问题
+      warehousingMaterialList: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.warehousingMaterialListTable.doLayout();
+          });
+        },
+        deep: true
+      },
+      // 解决右侧悬浮操作栏不对称问题
+      detailList: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.detailListTable.doLayout();
+          });
+        },
+        deep: true
+      },
+      // 解决右侧悬浮操作栏不对称问题
+      metailList: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.metailListTable.doLayout();
+          });
+        },
+        deep: true
       }
     },
     computed: {
@@ -781,23 +812,92 @@
       // }
     },
     created() {
-      this.requestDict('类型用途');
+      // this.requestDict('类型用途');
       this._getInfo();
     },
     methods: {
+      // 选择质检结果改变质检状态
+      changeWrapStatus(resultValue, row) {
+        switch (resultValue) {
+          case '':
+            // 清空质检状态
+            row.status = '0';
+            break;
+          default:
+            // 默认已检质检状态
+            row.status = '1';
+            break;
+        }
+      },
       //包装结果
       packItem(val, row) {
         row.status = '1';
       },
+      edit(data) {
+        this.$set(data, 'isPack', false);
+      },
       //质检物料提交
       async packMeta(data) {
         if (!data.result) {
           return this.$message.error('请选择质检结果!');
         }
-        data.status = 1;
-        data.result = Number(data.result);
+        this.$set(data, 'isPack', true);
+        // data.status = 1;
+        // data.result = Number(data.result);
         await updateMaterialById(data);
-        this._getInfo();
+        // this._getInfo();
+        this.detailList.forEach((outItem) => {
+          let arr = [];
+          this.metailList.forEach((inneritem) => {
+            if (inneritem.onlyCode == outItem.code) {
+              arr.push(inneritem);
+            }
+          });
+          console.log('arr-----------', arr);
+          // 首先判断是未填/合格不合格
+          let boolen = arr.every((item) => {
+            return item.result == '' || item.result == undefined;
+          });
+          // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
+          if (boolen) {
+            this.$set(outItem, 'result', '');
+            this.$set(outItem, 'status', '0');
+          } else {
+            // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
+            let boolen = arr.some((item) => {
+              return item.result == '1';
+            });
+            if (boolen) {
+              this.$set(outItem, 'result', '1');
+              this.$set(outItem, 'status', '1');
+            } else {
+              // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
+              let boolen = arr.some((item) => {
+                return item.result == '3';
+              });
+              if (boolen) {
+                // 让步接收 已检
+                this.$set(outItem, 'result', '3');
+                this.$set(outItem, 'status', '1');
+              } else {
+                // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
+                let boolen = arr.every((item) => {
+                  return item.result == '0';
+                });
+                if (boolen) {
+                  // 合格 已检
+                  this.$set(outItem, 'result', '0');
+                  this.$set(outItem, 'status', '1');
+                } else {
+                  // 合格 部分检
+                  this.$set(outItem, 'result', '0');
+                  this.$set(outItem, 'status', '2');
+                }
+              }
+            }
+          }
+          // this.$set(outItem, 'result', boolen ? '1' : '0');
+        });
       },
       //质检提交
       async packCout(data) {
@@ -821,6 +921,7 @@
         console.log('===', row);
         console.log('row.minPackingCount', row.minPackingCount);
         console.log(' this.detailList.length', this.detailList.length);
+        console.log(this.warehousingMaterialList);
         let packNo = 0;
         this.warehousingMaterialList.forEach((item) => {
           if (
@@ -850,9 +951,17 @@
           console.log(111);
           //新增包装更新物料
           const arr = [];
-          row.outInDetailRecordVOList.forEach((it) => {
-            it.outInDetailRecordMaterialDetailVOList.forEach((item) => {
-              arr.push({ ...item });
+          console.log('==================', row);
+          // row.outInDetailRecordVOList.forEach((it) => {
+          //   it.outInDetailRecordMaterialDetailVOList.forEach((item) => {
+          //     arr.push({ ...item });
+          //   });
+          // });
+          this.warehousingMaterialList.forEach((item) => {
+            item.outInDetailRecordVOList.forEach((it) => {
+              it.outInDetailRecordMaterialDetailVOList.forEach((item) => {
+                arr.push({ ...item });
+              });
             });
           });
 
@@ -1220,7 +1329,7 @@
         const codes = outInDetailRecordVOList[0].code;
         const index = outInDetailRecordVOList[0].code.indexOf('636');
         const result = codes.slice(-3);
-        const dataArray = [];
+        const dataArray = []; // 物品列表
         for (let i = 0; i < packingCount; i++) {
           const newData = { ...row };
           if (outInDetailRecordVOList.length != packingCount) {
@@ -1247,7 +1356,7 @@
           dataArray[j].isPack = true;
         }
         const list = JSON.parse(localStorage.getItem('exitList'));
-
+        console.log('list', '-------------');
         dataArray.forEach((ele, index) => {
           if (index < list.length) {
             if (ele.code === list[index].code) {
@@ -1261,7 +1370,7 @@
             ele.id = ''; // 如果 index 超出了 list 的范围,将 id 设为空字符串
           }
         });
-
+        console.log('dataArray----', dataArray);
         this.detailList = this.pacKUpdate(dataArray);
         this.metailList = this.metailUpdate(dataArray);
         // this.metailList = this.metaAdd(dataArray);
@@ -1308,6 +1417,96 @@
         return resultArray;
         // console.log('物料', resultArray);
       },
+      // 物料明细保存
+      materialBtn(row) {
+        console.log(row);
+        console.log(this.resultArray);
+        console.log(this.materialCodeReqList);
+        // true保存 false编辑
+        if (!row.isPack) {
+          row.isPack = true;
+          // 物料维度修改质检改变包装维度质检(结果和状态)
+          this.materialCodeReqList.forEach((outItem) => {
+            let arr = [];
+            this.resultArray.forEach((inneritem) => {
+              if (inneritem.onlyCode == outItem.onlyCode) {
+                arr.push(inneritem);
+              }
+            });
+            console.log(arr);
+            // 首先判断是未填/合格不合格
+            let boolen = arr.every((item) => {
+              return item.result === '' || item.result === undefined;
+            });
+            // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
+            if (boolen) {
+              this.$set(outItem, 'result', '');
+              this.$set(outItem, 'status', '0');
+            } else {
+              // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
+              let boolen = arr.some((item) => {
+                return item.result === '1';
+              });
+              if (boolen) {
+                this.$set(outItem, 'result', '1');
+                this.$set(outItem, 'status', '1');
+              } else {
+                // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
+                let boolen = arr.some((item) => {
+                  return item.result === '3';
+                });
+                if (boolen) {
+                  // 让步接收 已检
+                  this.$set(outItem, 'result', '3');
+                  this.$set(outItem, 'status', '1');
+                } else {
+                  // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
+                  let boolen = arr.every((item) => {
+                    return item.result === '0';
+                  });
+                  if (boolen) {
+                    // 合格 已检
+                    this.$set(outItem, 'result', '0');
+                    this.$set(outItem, 'status', '1');
+                  } else {
+                    // 合格 部分检
+                    this.$set(outItem, 'result', '0');
+                    this.$set(outItem, 'status', '2');
+                  }
+                }
+              }
+            }
+            // this.$set(outItem, 'result', boolen ? '1' : '0');
+          });
+          // 物料维度修改重量改变包装维度重量
+          let onlyCode = row.onlyCode;
+          this.materialCodeReqList.forEach((item) => {
+            if (item.onlyCode === onlyCode) {
+              let arr = [];
+              for (const key in this.resultArray) {
+                if (this.resultArray[key].onlyCode == item.onlyCode) {
+                  arr.push({ ...this.resultArray[key] });
+                }
+              }
+              const count = arr.reduce(
+                (acc, curr) =>
+                  Number(this.$math.format(+acc + +curr.weight, 14)),
+                0
+              );
+              this.$set(item, 'weight', count);
+            }
+          });
+          // 包装维度修改重量改变产品信息
+          this.isWeight = false;
+          // 批量修改包装明细
+          this.bulkEditingWrap();
+          this.$nextTick(() => {
+            this.isWeight = true;
+          });
+        } else {
+          row.isPack = false;
+        }
+      },
       //物料修改
       metailUpdate(arr) {
         console.log('---', arr);
@@ -1378,16 +1577,17 @@
 
         return { background: '#EEEEEE', border: 'none' };
       },
+      // 初始化数据
       async _getInfo() {
         const res =
           this.type == 'sourceBizNo'
             ? await getOutInBySourceBizNo(this.businessId)
             : await outin.getById(this.businessId);
         console.log('===', res);
-        console.log('===', res);
         if (res) {
           this.infoData = res;
           this.extInfo = res.extInfo;
+          // 获取物品维度列表
           this.warehousingMaterialList = res.outInDetailVOList.map((item) => {
             return { ...item, isSave: true };
           });
@@ -1404,6 +1604,7 @@
           this.exitList = arr;
           localStorage.setItem('exitList', JSON.stringify(arr));
           this.dateTypes = arr[0].dateType;
+          // 获取包装维度列表
           this.detailList = arr.map((item) => {
             return { ...item, isPack: true };
           });

+ 54 - 28
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -153,6 +153,15 @@
       ref="detailDialog"
       :taskDefinitionKey="taskDefinitionKey"
     ></detailDialog>
+    <procurementWarehousing
+      v-if="activeComp == 'inoutBoundEdit'"
+      :businessId="form.receiveNo"
+      type="sourceBizNo"
+      :infoData="form"
+      ref="procurementWarehousing"
+      :taskDefinitionKey="taskDefinitionKey"
+    >
+    </procurementWarehousing>
     <add
       ref="add"
       v-if="activeComp == 'inoutBound'"
@@ -168,8 +177,9 @@
   import { reviewStatusEnum } from '@/enum/dict';
   import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
   import detailDialog from '@/views/bpm/handleTask/components/inoutBound/detailDialog.vue';
+  import procurementWarehousing from '@/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing';
   import add from '@/views/bpm/stockManagement/add.vue';
-  import { getOutInBySourceBizNo } from '@/api/classifyManage';
+  import { getOutInBySourceBizNoOrError } from '@/api/classifyManage';
 
   export default {
     props: {
@@ -185,6 +195,7 @@
     },
     components: {
       detailDialog,
+      procurementWarehousing,
       add
     },
     mixins: [dictMixins],
@@ -342,32 +353,33 @@
     },
     async created() {
       await this.getDetailData(this.businessId);
-      try {
-        const data = await getOutInBySourceBizNo(this.form.receiveNo);
-        console.log('aa==', data);
-        if (data != null) {
-          this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
-          this.activeComp = 'inoutBoundView';
-          return;
-        }
-      } catch (error) {
-        if (
-          !['starter', 'deptLeaderApprove', 'storeManagerApprove'].includes(
-            this.taskDefinitionKey
-          )
-        ) {
-          this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
-          this.activeComp = 'inoutBoundView';
-        }
-        if (this.taskDefinitionKey == 'storeManagerApprove') {
-          this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
-          this.activeComp = 'inoutBound';
-          this.$emit('activeCompChange', 'inoutBound');
-          this.$nextTick(() => {
-            this.$refs.add.pickerSuccess(this.form);
+      getOutInBySourceBizNoOrError(this.form.receiveNo)
+        .then(() => {
+          this.tabOptions.push({
+            key: 'inoutBoundEdit',
+            name: '入库单详情(已入库)'
           });
-        }
-      }
+          this.activeComp = 'inoutBoundEdit';
+        })
+        .catch(() => {
+          // 未查询到相关信息(未入库)
+          if (
+            !['starter', 'deptLeaderApprove', 'storeManagerApprove'].includes(
+              this.taskDefinitionKey
+            )
+          ) {
+            this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
+            this.activeComp = 'inoutBoundView';
+          }
+          if (this.taskDefinitionKey == 'storeManagerApprove') {
+            this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
+            this.activeComp = 'inoutBound';
+            this.$emit('activeCompChange', 'inoutBound');
+            this.$nextTick(() => {
+              this.$refs.add.pickerSuccess(this.form);
+            });
+          }
+        });
     },
 
     methods: {
@@ -395,16 +407,30 @@
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
       },
+      // 判断质检状态是否全部已检
+      allListChecked() {
+        return (
+          this.$refs.procurementWarehousing &&
+          this.$refs.procurementWarehousing.getStatus()
+        );
+      },
       getTableValue() {
         return {
           form: this.form,
+          isAllChecked:
+            this.$refs.procurementWarehousing &&
+            this.$refs.procurementWarehousing.getStatus(),
           statusList:
             (this.$refs.detailDialog && this.$refs.detailDialog.getStatus()) ||
             [],
           qualityInspector:
-            (this.$refs.detailDialog &&
-              this.$refs.detailDialog.getQualityFile()) ||
+            (this.$refs.procurementWarehousing &&
+              this.$refs.procurementWarehousing.getQualityFile()) ||
             {}
+          // qualityInspector:
+          //   (this.$refs.detailDialog &&
+          //     this.$refs.detailDialog.getQualityFile()) ||
+          //   {}
         };
       },
       async getDetailData(id) {

+ 17 - 12
src/views/bpm/handleTask/components/purchaseOrder/invoice/submit.vue

@@ -52,7 +52,7 @@
         v-if="
           !['storeManagerApprove'].includes(taskDefinitionKey) ||
           (['storeManagerApprove'].includes(taskDefinitionKey) &&
-            [2].includes(outInData.verifyStatus))
+            [2].includes(+outInData.flowableStatus))
         "
         >通过
       </el-button>
@@ -64,7 +64,7 @@
         v-if="
           ['storeManagerApprove'].includes(taskDefinitionKey) &&
           activeComp == 'inoutBound' &&
-          ![1, 2].includes(outInData.verifyStatus)
+          ![1, 2].includes(+outInData.flowableStatus)
         "
         >申请入库
       </el-button>
@@ -74,8 +74,9 @@
         size="mini"
         @click="handleAudit(0)"
         v-if="
-          !['starter'].includes(taskDefinitionKey) &&
-          ![1, 2].includes(outInData.verifyStatus)
+          !['starter', 'qualityInspectionFeedback'].includes(
+            taskDefinitionKey
+          ) && ![1, 2].includes(+outInData.flowableStatus)
         "
         >驳回
       </el-button>
@@ -160,7 +161,7 @@
           reason: ''
         },
         outInData: {
-          verifyStatus: ''
+          flowableStatus: ''
         },
         visible: false,
         userOptions: [],
@@ -176,9 +177,13 @@
         let data = await getReceiveSaleOrderrecordDetail(this.businessId);
         try {
           this.outInData = await getOutInBySourceBizNo(data.receiveNo);
+          console.log('outInData----------', this.outInData);
         } catch (error) {}
       }
     },
+    mounted() {
+      console.log('taskDefinitionKey-------------', this.taskDefinitionKey);
+    },
     methods: {
       cancel() {
         this.visible = false;
@@ -223,23 +228,24 @@
           let data = await getWarehouseListByIds(ids || []);
           storemanIds = data.map((item) => item.ownerId);
         }
-        if (this.taskDefinitionKey === 'QCLeaderApprove') {
+        if (this.taskDefinitionKey === 'QCLeaderApprove' && status) {
           if (!this.form.qualityInspector) {
             return this.$message.error('请选择质检员!');
           }
         }
-        if (this.taskDefinitionKey === 'qualityInspection') {
-          let arr = await this.getTableValue();
-          if (arr.statusList.length == 0) {
+        if (this.taskDefinitionKey === 'qualityInspection' && status) {
+          let arr = await this.getTableValue(); // 是否全部已检
+          if (!arr.isAllChecked) {
             return this.$message.error('请完成质检!');
           }
         }
-        if (this.taskDefinitionKey === 'qualityInspectionFeedback') {
+        if (this.taskDefinitionKey === 'qualityInspectionFeedback' && status) {
           let arr = await this.getTableValue();
-          console.log(arr, 'arr.qualityInspector');
+          console.log('arr.qualityInspector', arr);
           if (arr.qualityInspector.qualityFile.length == 0) {
             return this.$message.error('请上传回执附件!');
           }
+          console.log(arr);
           await uploadQualityFile(arr.qualityInspector);
         }
         this._approveTaskWithVariables(
@@ -273,7 +279,6 @@
           }
         });
       },
-
       getTableValue() {
         return new Promise((resolve, reject) => {
           this.$emit('getTableValue', async (data) => {

+ 589 - 558
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -107,7 +107,11 @@
                 :prop="'detailList.' + $index + '.reason'"
                 :rules="{ required: true, trigger: 'blur', message: '请输入' }"
               >
-                <el-input type="textarea" v-if="isTrue" v-model="row.reason"></el-input>
+                <el-input
+                  type="textarea"
+                  v-if="isTrue"
+                  v-model="row.reason"
+                ></el-input>
                 <div v-else>{{ row.reason }}</div>
               </el-form-item>
             </template>
@@ -180,8 +184,8 @@
                   clearable
                   style="width: 100%"
                 >
-                  <el-option label="是" :value="1"/>
-                  <el-option label="否" :value="0"/>
+                  <el-option label="是" :value="1" />
+                  <el-option label="否" :value="0" />
                 </el-select>
                 <div v-else>{{ row.ifPackageOk ? '是' : '否' }}</div>
               </el-form-item>
@@ -228,8 +232,8 @@
                   clearable
                   style="width: 100%"
                 >
-                  <el-option label="是" :value="1"/>
-                  <el-option label="否" :value="0"/>
+                  <el-option label="是" :value="1" />
+                  <el-option label="否" :value="0" />
                 </el-select>
                 <div v-else>{{ row.ifReasonMatch ? '是' : '否' }}</div>
               </el-form-item>
@@ -259,14 +263,25 @@
                 :prop="'detailList.' + $index + '.unqualifiedType'"
                 :rules="{ required: true, trigger: 'blur', message: '请输入' }"
               >
-                <DictSelection dict-name="产品不合格类型"
-                               multiple
-                               collapse-tags
-                               clearable
-                               v-if="isTrue"
-                               v-model="row.unqualifiedTypeList"
-                               @change="(val)=>changeGetValue(val,row,'dictList','unqualifiedType','unqualifiedTypeName',$index)">
-
+                <DictSelection
+                  dict-name="产品不合格类型"
+                  multiple
+                  collapse-tags
+                  clearable
+                  v-if="isTrue"
+                  v-model="row.unqualifiedTypeList"
+                  @change="
+                    (val) =>
+                      changeGetValue(
+                        val,
+                        row,
+                        'dictList',
+                        'unqualifiedType',
+                        'unqualifiedTypeName',
+                        $index
+                      )
+                  "
+                >
                 </DictSelection>
 
                 <!--                <el-input-->
@@ -305,14 +320,26 @@
             </template>
             <!--////-->
             <!--  ///  生产员审核 -->
-            <template v-slot:inOrOut="{ row,$index }">
-              <el-form-item :prop="'detailList.' + $index + '.inOrOut'"
-                            :rules="{ required: true, trigger: 'change', message: '请选择' }">
-                <el-select v-if="isTrue" v-model="row.inOrOut" @change="()=>row.outerInfo=''">
-                  <el-option label="内部" :value="1"/>
-                  <el-option label="外部" :value="2"/>
+            <template v-slot:inOrOut="{ row, $index }">
+              <el-form-item
+                :prop="'detailList.' + $index + '.inOrOut'"
+                :rules="{
+                  required: true,
+                  trigger: 'change',
+                  message: '请选择'
+                }"
+              >
+                <el-select
+                  v-if="isTrue"
+                  v-model="row.inOrOut"
+                  @change="() => (row.outerInfo = '')"
+                >
+                  <el-option label="内部" :value="1" />
+                  <el-option label="外部" :value="2" />
                 </el-select>
-                <div v-else>{{ row.inOrOut && (row.inOrOut == 1 ? '内部' : '外部') }}</div>
+                <div v-else>{{
+                  row.inOrOut && (row.inOrOut == 1 ? '内部' : '外部')
+                }}</div>
               </el-form-item>
             </template>
             <template v-slot:headerInOrOut="{ column }">
@@ -320,7 +347,10 @@
             </template>
             <template v-slot:outerInfo="{ row }">
               <el-form-item prop="outerInfo">
-                <el-input v-if="isTrue&&row.inOrOut==2" v-model="row.outerInfo"></el-input>
+                <el-input
+                  v-if="isTrue && row.inOrOut == 2"
+                  v-model="row.outerInfo"
+                ></el-input>
                 <div v-else>{{ row.outerInfo }}</div>
               </el-form-item>
             </template>
@@ -378,607 +408,608 @@
 </template>
 
 <script>
-import inboundDetails from './inboundDetails.vue';
-import outboundDetailsDialog from './outboundDetailsDialog.vue';
-import headList from '@/components/headList';
-import {
-  getOutInByIdAPI,
-  saleReturnGetByIdAPI
-} from '@/api/bpm/components/saleManage/saleorder';
-import {deepClone} from '@/utils';
-import {EventBus} from './eventBus.js';
-import {mapActions, mapGetters} from "vuex";
-import dictEnum from "@/enum/dict";
+  import inboundDetails from './inboundDetails.vue';
+  import outboundDetailsDialog from './outboundDetailsDialog.vue';
+  import headList from '@/components/headList';
+  import {
+    getOutInByIdAPI,
+    saleReturnGetByIdAPI
+  } from '@/api/bpm/components/saleManage/saleorder';
+  import { deepClone } from '@/utils';
+  import { EventBus } from './eventBus.js';
+  import { mapActions, mapGetters } from 'vuex';
+  import dictEnum from '@/enum/dict';
 
-export default {
-  name: 'customerReturnOrder',
-  props: {
-    taskDefinitionKey: {
-      type: String,
-      default: 'stater'
-    },
-    activeComp: {
-      type: String,
-      default: 'stater'
-    },
-    permissionType: {
-      type: String,
-      default: 'view'
-    },
-    businessId: {
-      type: String,
-      default: ''
-    }
-  },
-  components: {outboundDetailsDialog, headList, inboundDetails},
-  data() {
-    return {
-      activeName: '退货物品明细',
-      title: '客户退货处理单',
-      outboundDetailsDialogFlag: false,
-      isTrue: false,
-      warehousingMaterialList: [],
-      materialCodeReqList: [],
-      metaList: [],
-      form: {
-        detailList: []
+  export default {
+    name: 'customerReturnOrder',
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: 'stater'
       },
-      rules: {}
-    };
-  },
-  computed: {
-    columns() {
-      let basicFields = [
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true
-        },
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          minWidth: 120,
-          prop: 'name',
-          label: '名称',
-          align: 'center',
-          slot: 'name'
-        },
-        {
-          minWidth: 120,
-          prop: 'categoryCode',
-          label: '编码',
-          align: 'center',
-          slot: 'categoryCode'
-        },
-        // {
-        //   minWidth: 120,
-        //   prop: 'modelType',
-        //   label: '型号',
-        //   align: 'center',
-        //   slot: 'modelType'
-        // },
-        {
-          minWidth: 120,
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          slot: 'specification'
-        },
-        {
-          minWidth: 120,
-          prop: 'packageCount',
-          label: '包装数量',
-          align: 'center',
-          slot: 'packageCount',
-          headerSlot: 'headerPackageCount'
-        },
-        {
-          minWidth: 80,
-          prop: 'packingUnit',
-          label: '包装单位',
-          align: 'center',
-          slot: 'packingUnit'
-        },
-        {
-          minWidth: 80,
-          prop: 'measurementCount',
-          label: '计量数量',
-          align: 'center',
-          slot: 'measurementCount',
-          headerSlot: 'headerCount'
-        },
-        {
-          minWidth: 80,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          align: 'center',
-          slot: 'measuringUnit'
-        },
-        {
-          minWidth: 80,
-          prop: 'weight',
-          label: '重量',
-          align: 'center',
-          slot: 'weight',
-          headerSlot: 'headerWeight'
-        },
-        {
-          minWidth: 80,
-          prop: 'weightUtil',
-          label: '重量单位',
-          align: 'center',
-          slot: 'weightUtil'
+      activeComp: {
+        type: String,
+        default: 'stater'
+      },
+      permissionType: {
+        type: String,
+        default: 'view'
+      },
+      businessId: {
+        type: String,
+        default: ''
+      }
+    },
+    components: { outboundDetailsDialog, headList, inboundDetails },
+    data() {
+      return {
+        activeName: '退货物品明细',
+        title: '客户退货处理单',
+        outboundDetailsDialogFlag: false,
+        isTrue: false,
+        warehousingMaterialList: [],
+        materialCodeReqList: [],
+        metaList: [],
+        form: {
+          detailList: []
         },
-        {
-          minWidth: 120,
-          prop: 'carveCode',
-          label: '刻码',
-          slot: 'carveCode',
-          align: 'center',
-          headerSlot: 'headerCarveCode'
-        }
-      ];
-      let processNodes = {
-        //发起人
-        stater: [
-          {
-            minWidth: 140,
-            prop: 'reason',
-            label: '客户退货理由',
-            align: 'center',
-            slot: 'reason',
-            headerSlot: 'headerReason'
-          },
-          {
-            minWidth: 180,
-            prop: 'feedbackDate',
-            label: '客户反馈日期',
-            align: 'center',
-            slot: 'feedbackDate',
-            headerSlot: 'headerFeedbackDate'
-          },
-          {
-            minWidth: 180,
-            prop: 'sendDate',
-            label: '客户发出日期',
-            slot: 'sendDate',
-            align: 'center',
-            headerSlot: 'headerSendDate'
-          }
-        ],
-        //销售主管审批
-        deptLeader: [
-          {
-            minWidth: 140,
-            prop: 'reason',
-            label: '客户退货理由',
-            align: 'center',
-            slot: 'reason',
-            headerSlot: 'headerReason'
-          },
-          {
-            minWidth: 140,
-            prop: 'feedbackDate',
-            label: '客户反馈日期',
-            align: 'center',
-            slot: 'feedbackDate',
-            headerSlot: 'headerFeedbackDate'
-          },
-          {
-            minWidth: 140,
-            prop: 'sendDate',
-            label: '客户发出日期',
-            slot: 'sendDate',
-            align: 'center',
-            headerSlot: 'headerSendDate'
-          }
-        ],
-        //仓管入库
-        storeman: [
-          {
-            minWidth: 140,
-            prop: 'ifPackageOk',
-            label: '包装完好与否',
-            align: 'center',
-            slot: 'ifPackageOk',
-            headerSlot: 'headerIfPackageOk'
-          },
-          {
-            minWidth: 140,
-            prop: 'unpackUserName',
-            label: '拆包装责任人',
-            align: 'center',
-            slot: 'unpackUserName',
-            headerSlot: 'headerUnpackUserName'
-          }
-        ],
-        //质量部主管指派
-        QCLeader: [
-          {
-            minWidth: 140,
-            prop: 'ifPackageOk',
-            label: '包装完好与否',
-            align: 'center',
-            slot: 'ifPackageOk',
-            headerSlot: 'headerIfPackageOk'
-          },
-          {
-            minWidth: 140,
-            prop: 'unpackUserName',
-            label: '拆包装责任人',
-            align: 'center',
-            slot: 'unpackUserName',
-            headerSlot: 'headerUnpackUserName'
-          }
-        ],
-        //质检员审核
-        QCApprove: [
-          {
-            minWidth: 250,
-            prop: 'ifReasonMatch',
-            label: '退货原因是否与退货信息一致',
-            align: 'center',
-            slot: 'ifReasonMatch',
-            headerSlot: 'headerIfReasonMatch'
-          },
-          {
-            minWidth: 140,
-            prop: 'reason',
-            label: '客户退货理由',
-            align: 'center',
-            slot: 'reason',
-            headerSlot: 'headerReason'
-          },
-        ],
-        //技术部主管指派
-        techLeader: [
+        rules: {}
+      };
+    },
+    computed: {
+      columns() {
+        let basicFields = [
           {
-            minWidth: 250,
-            prop: 'ifReasonMatch',
-            label: '退货原因是否与退货信息一致',
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
             align: 'center',
-            slot: 'ifReasonMatch',
-            headerSlot: 'headerIfReasonMatch'
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
           },
           {
-            minWidth: 140,
-            prop: 'reason',
-            label: '客户退货理由',
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
             align: 'center',
-            slot: 'reason',
-            headerSlot: 'headerReason'
+            fixed: 'left'
           },
-        ],
-        //技术员审核
-        techApprove: [
           {
-            minWidth: 250,
-            prop: 'unqualifiedReasonAnalysis',
-            label: '不合格原因分析',
+            minWidth: 120,
+            prop: 'name',
+            label: '名称',
             align: 'center',
-            slot: 'unqualifiedReasonAnalysis',
-            headerSlot: 'headerUnqualifiedReasonAnalysis'
+            slot: 'name'
           },
           {
-            minWidth: 200,
-            prop: 'unqualifiedType',
-            label: '不合格类型',
+            minWidth: 120,
+            prop: 'categoryCode',
+            label: '编码',
             align: 'center',
-            slot: 'unqualifiedType',
-            headerSlot: 'headerUnqualifiedType'
+            slot: 'categoryCode'
           },
           // {
-          //   minWidth: 250,
-          //   prop: 'handleWay',
-          //   label: '不合格品处理方式',
+          //   minWidth: 120,
+          //   prop: 'modelType',
+          //   label: '型号',
           //   align: 'center',
-          //   slot: 'handleWay',
-          //   headerSlot: 'headerHandleWay'
+          //   slot: 'modelType'
           // },
           {
-            minWidth: 250,
-            prop: 'handleOpinion',
-            label: '对不合格品的处理意见',
+            minWidth: 120,
+            prop: 'specification',
+            label: '规格',
             align: 'center',
-            slot: 'handleOpinion',
-            headerSlot: 'headerHandleOpinion'
-          }
-        ],
-        //生产部主管指派
-        produceLeader: [
+            slot: 'specification'
+          },
           {
-            minWidth: 250,
-            prop: 'unqualifiedReasonAnalysis',
-            label: '不合格原因分析',
+            minWidth: 120,
+            prop: 'packageCount',
+            label: '包装数量',
             align: 'center',
-            slot: 'unqualifiedReasonAnalysis',
-            headerSlot: 'headerUnqualifiedReasonAnalysis'
+            slot: 'packageCount',
+            headerSlot: 'headerPackageCount'
           },
           {
-            minWidth: 250,
-            prop: 'unqualifiedType',
-            label: '不合格类型',
+            minWidth: 80,
+            prop: 'packingUnit',
+            label: '包装单位',
             align: 'center',
-            slot: 'unqualifiedType',
-            headerSlot: 'headerUnqualifiedType'
+            slot: 'packingUnit'
           },
           {
-            minWidth: 250,
-            prop: 'handleOpinion',
-            label: '对不合格品的处理意见',
+            minWidth: 80,
+            prop: 'measurementCount',
+            label: '计量数量',
             align: 'center',
-            slot: 'handleOpinion',
-            headerSlot: 'headerHandleOpinion'
-          }
-        ],
-        //生产员审核
-        produceApprove: [
+            slot: 'measurementCount',
+            headerSlot: 'headerCount'
+          },
           {
-            minWidth: 130,
-            prop: 'inOrOut',
-            label: '内部或外部',
+            minWidth: 80,
+            prop: 'measuringUnit',
+            label: '计量单位',
             align: 'center',
             slot: 'inOrOut',
             headerSlot: 'headerInOrOut'
-
           },
           {
-            minWidth: 120,
-            prop: 'outerInfo',
-            label: '外协单位',
+            minWidth: 80,
+            prop: 'weight',
+            label: '重量',
             align: 'center',
-            slot: 'outerInfo',
+            slot: 'weight',
+            headerSlot: 'headerWeight'
           },
-        ],
-        //质检员反馈
-        QCApprove2: [
           {
-            minWidth: 250,
-            prop: 'improveCorrect',
-            label: '不合格原因是否改善到位',
+            minWidth: 80,
+            prop: 'weightUtil',
+            label: '重量单位',
             align: 'center',
-            slot: 'improveCorrect',
-            headerSlot: 'headerImproveCorrect'
+            slot: 'weightUtil'
           },
           {
-            minWidth: 250,
-            prop: 'improveOpinion',
-            label: '对改善后产品处理意见',
+            minWidth: 120,
+            prop: 'carveCode',
+            label: '刻码',
+            slot: 'carveCode',
             align: 'center',
-            slot: 'improveOpinion',
-            headerSlot: 'headerImproveOpinion'
+            headerSlot: 'headerCarveCode'
           }
-        ]
-      };
-      processNodes[this.activeComp] &&
-      basicFields.push(...processNodes[this.activeComp]);
-      //
-      this.isTrue =
-        this.activeComp == this.taskDefinitionKey &&
-        this.permissionType !== 'view';
-      return basicFields;
-    },
-    ...mapGetters(['dict', 'getDict']),
-    dictList() {
-      return this.dict[dictEnum['产品不合格类型']] || [];
-    },
-  },
-  created() {
-  },
-  mounted() {
-    this.getReturnInfo(this.businessId);
-  },
-  methods: {
-    handleClick(val) {
-      this.activeName = val.name;
-      if (val.name === '入库明细') {
-        this.$refs.inboundDetails.initialize();
+        ];
+        let processNodes = {
+          //发起人
+          stater: [
+            {
+              minWidth: 140,
+              prop: 'reason',
+              label: '客户退货理由',
+              align: 'center',
+              slot: 'reason',
+              headerSlot: 'headerReason'
+            },
+            {
+              minWidth: 180,
+              prop: 'feedbackDate',
+              label: '客户反馈日期',
+              align: 'center',
+              slot: 'feedbackDate',
+              headerSlot: 'headerFeedbackDate'
+            },
+            {
+              minWidth: 180,
+              prop: 'sendDate',
+              label: '客户发出日期',
+              slot: 'sendDate',
+              align: 'center',
+              headerSlot: 'headerSendDate'
+            }
+          ],
+          //销售主管审批
+          deptLeader: [
+            {
+              minWidth: 140,
+              prop: 'reason',
+              label: '客户退货理由',
+              align: 'center',
+              slot: 'reason',
+              headerSlot: 'headerReason'
+            },
+            {
+              minWidth: 140,
+              prop: 'feedbackDate',
+              label: '客户反馈日期',
+              align: 'center',
+              slot: 'feedbackDate',
+              headerSlot: 'headerFeedbackDate'
+            },
+            {
+              minWidth: 140,
+              prop: 'sendDate',
+              label: '客户发出日期',
+              slot: 'sendDate',
+              align: 'center',
+              headerSlot: 'headerSendDate'
+            }
+          ],
+          //仓管入库
+          storeman: [
+            {
+              minWidth: 140,
+              prop: 'ifPackageOk',
+              label: '包装完好与否',
+              align: 'center',
+              slot: 'ifPackageOk',
+              headerSlot: 'headerIfPackageOk'
+            },
+            {
+              minWidth: 140,
+              prop: 'unpackUserName',
+              label: '拆包装责任人',
+              align: 'center',
+              slot: 'unpackUserName',
+              headerSlot: 'headerUnpackUserName'
+            }
+          ],
+          //质量部主管指派
+          QCLeader: [
+            {
+              minWidth: 140,
+              prop: 'ifPackageOk',
+              label: '包装完好与否',
+              align: 'center',
+              slot: 'ifPackageOk',
+              headerSlot: 'headerIfPackageOk'
+            },
+            {
+              minWidth: 140,
+              prop: 'unpackUserName',
+              label: '拆包装责任人',
+              align: 'center',
+              slot: 'unpackUserName',
+              headerSlot: 'headerUnpackUserName'
+            }
+          ],
+          //质检员审核
+          QCApprove: [
+            {
+              minWidth: 250,
+              prop: 'ifReasonMatch',
+              label: '退货原因是否与退货信息一致',
+              align: 'center',
+              slot: 'ifReasonMatch',
+              headerSlot: 'headerIfReasonMatch'
+            },
+            {
+              minWidth: 140,
+              prop: 'reason',
+              label: '客户退货理由',
+              align: 'center',
+              slot: 'reason',
+              headerSlot: 'headerReason'
+            }
+          ],
+          //技术部主管指派
+          techLeader: [
+            {
+              minWidth: 250,
+              prop: 'ifReasonMatch',
+              label: '退货原因是否与退货信息一致',
+              align: 'center',
+              slot: 'ifReasonMatch',
+              headerSlot: 'headerIfReasonMatch'
+            },
+            {
+              minWidth: 140,
+              prop: 'reason',
+              label: '客户退货理由',
+              align: 'center',
+              slot: 'reason',
+              headerSlot: 'headerReason'
+            }
+          ],
+          //技术员审核
+          techApprove: [
+            {
+              minWidth: 250,
+              prop: 'unqualifiedReasonAnalysis',
+              label: '不合格原因分析',
+              align: 'center',
+              slot: 'unqualifiedReasonAnalysis',
+              headerSlot: 'headerUnqualifiedReasonAnalysis'
+            },
+            {
+              minWidth: 200,
+              prop: 'unqualifiedType',
+              label: '不合格类型',
+              align: 'center',
+              slot: 'unqualifiedType',
+              headerSlot: 'headerUnqualifiedType'
+            },
+            // {
+            //   minWidth: 250,
+            //   prop: 'handleWay',
+            //   label: '不合格品处理方式',
+            //   align: 'center',
+            //   slot: 'handleWay',
+            //   headerSlot: 'headerHandleWay'
+            // },
+            {
+              minWidth: 250,
+              prop: 'handleOpinion',
+              label: '对不合格品的处理意见',
+              align: 'center',
+              slot: 'handleOpinion',
+              headerSlot: 'headerHandleOpinion'
+            }
+          ],
+          //生产部主管指派
+          produceLeader: [
+            {
+              minWidth: 250,
+              prop: 'unqualifiedReasonAnalysis',
+              label: '不合格原因分析',
+              align: 'center',
+              slot: 'unqualifiedReasonAnalysis',
+              headerSlot: 'headerUnqualifiedReasonAnalysis'
+            },
+            {
+              minWidth: 250,
+              prop: 'unqualifiedType',
+              label: '不合格类型',
+              align: 'center',
+              slot: 'unqualifiedType',
+              headerSlot: 'headerUnqualifiedType'
+            },
+            {
+              minWidth: 250,
+              prop: 'handleOpinion',
+              label: '对不合格品的处理意见',
+              align: 'center',
+              slot: 'handleOpinion',
+              headerSlot: 'headerHandleOpinion'
+            }
+          ],
+          //生产员审核
+          produceApprove: [
+            {
+              minWidth: 130,
+              prop: 'inOrOut',
+              label: '内部或外部',
+              align: 'center',
+              slot: 'inOrOut'
+            },
+            {
+              minWidth: 120,
+              prop: 'outerInfo',
+              label: '外协单位',
+              align: 'center',
+              slot: 'outerInfo'
+            }
+          ],
+          //质检员反馈
+          QCApprove2: [
+            {
+              minWidth: 250,
+              prop: 'improveCorrect',
+              label: '不合格原因是否改善到位',
+              align: 'center',
+              slot: 'improveCorrect',
+              headerSlot: 'headerImproveCorrect'
+            },
+            {
+              minWidth: 250,
+              prop: 'improveOpinion',
+              label: '对改善后产品处理意见',
+              align: 'center',
+              slot: 'improveOpinion',
+              headerSlot: 'headerImproveOpinion'
+            }
+          ]
+        };
+        processNodes[this.activeComp] &&
+          basicFields.push(...processNodes[this.activeComp]);
+        //
+        this.isTrue =
+          this.activeComp == this.taskDefinitionKey &&
+          this.permissionType !== 'view';
+        return basicFields;
+      },
+      ...mapGetters(['dict', 'getDict']),
+      dictList() {
+        return this.dict[dictEnum['产品不合格类型']] || [];
       }
     },
-    async getReturnInfo(businessId) {
-      this.form = await saleReturnGetByIdAPI(businessId);
+    created() {},
+    mounted() {
+      this.getReturnInfo(this.businessId);
+    },
+    methods: {
+      handleClick(val) {
+        this.activeName = val.name;
+        if (val.name === '入库明细') {
+          this.$refs.inboundDetails.initialize();
+        }
+      },
+      async getReturnInfo(businessId) {
+        this.form = await saleReturnGetByIdAPI(businessId);
 
-      let outInIds = [
-        ...new Set(this.form?.detailList?.map((item) => item.outInId))
-      ];
-      for (const outInId of outInIds) {
-        //拼接信息
-        const data = await getOutInByIdAPI(outInId);
-        this.infoData = deepClone(data);
-        //出库物料明细
-        this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
-        //出库包装明细
-        if (this.warehousingMaterialList.length) {
-          this.materialCodeReqList = [];
-          this.warehousingMaterialList.forEach((item) => {
-            if (item.outInDetailRecordVOList?.length) {
-              item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
-                (i) => {
-                  return {
-                    ...i,
-                    outInCode: this.infoData.bizNo,
-                    outInId: item.outInId,
-                    measurementCount: i.totalCount,
-                    outboundDetailId: i.id,
-                    outboundType: 1,
-                    packageCount: i.packingCount,
-                    packingUnit: i.packingUnit,
-                    weight: i.weight,
-                    specification: item.specification,
-                    name: i.name,
-                    categoryCode: i.categoryCode,
-                    id: ''
-                  };
-                }
-              );
-              this.materialCodeReqList.push(...item.outInDetailRecordVOList);
-            }
-          });
+        let outInIds = [
+          ...new Set(this.form?.detailList?.map((item) => item.outInId))
+        ];
+        for (const outInId of outInIds) {
+          //拼接信息
+          const data = await getOutInByIdAPI(outInId);
+          this.infoData = deepClone(data);
           //出库物料明细
-          if (this.materialCodeReqList.length) {
-            this.metaList = [];
-            this.materialCodeReqList.forEach((item) => {
-              if (item.outInDetailRecordMaterialDetailVOList?.length) {
-                item.outInDetailRecordMaterialDetailVOList =
-                  item.outInDetailRecordMaterialDetailVOList.map((i) => {
+          this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
+          //出库包装明细
+          if (this.warehousingMaterialList.length) {
+            this.materialCodeReqList = [];
+            this.warehousingMaterialList.forEach((item) => {
+              if (item.outInDetailRecordVOList?.length) {
+                item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
+                  (i) => {
                     return {
                       ...i,
+                      outInCode: this.infoData.bizNo,
                       outInId: item.outInId,
-                      outInCode: item.outInCode,
-                      measurementCount: 1,
+                      measurementCount: i.totalCount,
                       outboundDetailId: i.id,
-                      outboundType: 2,
+                      outboundType: 1,
                       packageCount: i.packingCount,
                       packingUnit: i.packingUnit,
                       weight: i.weight,
-                      weightUtil: i.weightUnit,
                       specification: item.specification,
-                      categoryCode: i.assetCode,
-                      name: i.assetName,
+                      name: i.name,
+                      categoryCode: i.categoryCode,
                       id: ''
                     };
-                  });
-                this.metaList.push(
-                  ...item.outInDetailRecordMaterialDetailVOList
+                  }
                 );
+                this.materialCodeReqList.push(...item.outInDetailRecordVOList);
               }
             });
+            //出库物料明细
+            if (this.materialCodeReqList.length) {
+              this.metaList = [];
+              this.materialCodeReqList.forEach((item) => {
+                if (item.outInDetailRecordMaterialDetailVOList?.length) {
+                  item.outInDetailRecordMaterialDetailVOList =
+                    item.outInDetailRecordMaterialDetailVOList.map((i) => {
+                      return {
+                        ...i,
+                        outInId: item.outInId,
+                        outInCode: item.outInCode,
+                        measurementCount: 1,
+                        outboundDetailId: i.id,
+                        outboundType: 2,
+                        packageCount: i.packingCount,
+                        packingUnit: i.packingUnit,
+                        weight: i.weight,
+                        weightUtil: i.weightUnit,
+                        specification: item.specification,
+                        categoryCode: i.assetCode,
+                        name: i.assetName,
+                        id: ''
+                      };
+                    });
+                  this.metaList.push(
+                    ...item.outInDetailRecordMaterialDetailVOList
+                  );
+                }
+              });
+            }
           }
+          this.form.detailList.forEach((item) => {
+            if (item.outboundType == 1) {
+              let find =
+                this.materialCodeReqList.find(
+                  (i) => i.outboundDetailId == item.outboundDetailId
+                ) || {};
+              item.name = find.name;
+              item.categoryCode = find.categoryCode;
+              item.specification = find.specification;
+              item.weightUtil = find.weightUtil;
+              item.packingUnit = find.packingUnit;
+              item.measuringUnit = find.measuringUnit;
+            } else {
+              let find =
+                this.metaList.find(
+                  (i) => i.outboundDetailId == item.outboundDetailId
+                ) || {};
+              item.name = find.name;
+              item.categoryCode = find.categoryCode;
+              item.specification = find.specification;
+              item.weightUtil = find.weightUtil;
+              item.packingUnit = find.packingUnit;
+              item.measuringUnit = find.measuringUnit;
+            }
+            item.unqualifiedTypeList = item.unqualifiedType
+              ? item.unqualifiedType?.split(',')
+              : [];
+          });
         }
-        this.form.detailList.forEach((item) => {
-          if (item.outboundType == 1) {
-            let find =
-              this.materialCodeReqList.find(
-                (i) => i.outboundDetailId == item.outboundDetailId
-              ) || {};
-            item.name = find.name;
-            item.categoryCode = find.categoryCode;
-            item.specification = find.specification;
-            item.weightUtil = find.weightUtil;
-            item.packingUnit = find.packingUnit;
-            item.measuringUnit = find.measuringUnit;
 
-          } else {
-            let find =
-              this.metaList.find(
-                (i) => i.outboundDetailId == item.outboundDetailId
-              ) || {};
-            item.name = find.name;
-            item.categoryCode = find.categoryCode;
-            item.specification = find.specification;
-            item.weightUtil = find.weightUtil;
-            item.packingUnit = find.packingUnit;
-            item.measuringUnit = find.measuringUnit;
-          }
-          item.unqualifiedTypeList = item.unqualifiedType ? item.unqualifiedType?.split(',') : []
+        this.$nextTick(() => {
+          this.$refs.table.reRenderTable();
         });
-      }
-
-      this.$nextTick(() => {
-        this.$refs.table.reRenderTable();
-      });
-    },
-    changeGetValue(val, row, list, key, value, index) {
-      if (!val.length) {
-        row[value] = ''
-        row[key] = ''
-      }
-      let findList = this[list].filter(item => val.includes(item.dictCode)) || []
-      row[value] = findList.map(item => item.dictValue).join(',')
-      row[key] = val.join(',')
-      this.$set(this.form.detailList, index, row)
-    },
-    handleSelectGoods() {
-      this.outboundDetailsDialogFlag = true;
-      this.$nextTick(() => {
-        this.$refs.outboundDetailsDialogRef.init();
-      });
-    },
-    //删除
-    remove(row, index) {
-      this.form.detailList.splice(index, 1);
-    },
-    //选择退货信息回调
-    saveDate(data) {
-      this.form.detailList.push(...data);
-    },
-    //选择负责人
-    handHead(row, index) {
-      let item = {
-        id: row.unpackUserId
-      };
-      this.$refs.headRef.open(item, index);
-    },
-    //选择负责人回调
-    changeHead(obj, index) {
-      this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
-      this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
-    },
-    // 获取销售退货信息
-    getReturnStorage() {
-      return Promise.resolve(this.$refs.inboundDetails.infoData);
-    },
-    getTableValue() {
-      return new Promise((resolve) => {
-        this.$refs.formRef.validate((validate) => {
-          if (!validate) {
-            resolve(false);
-          } else {
-            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);
-          }
+      },
+      changeGetValue(val, row, list, key, value, index) {
+        if (!val.length) {
+          row[value] = '';
+          row[key] = '';
+        }
+        let findList =
+          this[list].filter((item) => val.includes(item.dictCode)) || [];
+        row[value] = findList.map((item) => item.dictValue).join(',');
+        row[key] = val.join(',');
+        this.$set(this.form.detailList, index, row);
+      },
+      handleSelectGoods() {
+        this.outboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.outboundDetailsDialogRef.init();
+        });
+      },
+      //删除
+      remove(row, index) {
+        this.form.detailList.splice(index, 1);
+      },
+      //选择退货信息回调
+      saveDate(data) {
+        this.form.detailList.push(...data);
+      },
+      //选择负责人
+      handHead(row, index) {
+        let item = {
+          id: row.unpackUserId
+        };
+        this.$refs.headRef.open(item, index);
+      },
+      //选择负责人回调
+      changeHead(obj, index) {
+        this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
+        this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
+      },
+      // 获取销售退货信息
+      getReturnStorage() {
+        console.log(this.$refs.inboundDetails.infoData);
+        return Promise.resolve(this.$refs.inboundDetails.infoData);
+      },
+      getTableValue() {
+        return new Promise((resolve) => {
+          this.$refs.formRef.validate((validate) => {
+            if (!validate) {
+              resolve(false);
+            } else {
+              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>

+ 84 - 24
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue

@@ -400,7 +400,7 @@
   // import { tableHeader } from '../common';
 	import WareHouseDailog from '@/components/WareHouseDailog/index.vue'
   import { mapGetters, mapActions } from 'vuex';
-	import { getOutInBySourceBizNo } from '@/api/classifyManage/index'
+	import { getOutInBySourceBizNoOrError } from '@/api/classifyManage/index'
   //import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
 
   // import {
@@ -469,7 +469,7 @@
             let house = this.infoData.outInDetailAddPOList[key].houseList[k];
 						this.infoData.outInDetailAddPOList[key].pathName = `${house.warehouseName},${house.areaName},${house.shelfCode},${house.cargoSpaceCode}`,
 						this.infoData.outInDetailAddPOList[key].pathIds = `${house.warehouseId},${house.areaId},${house.shelfId},${house.cargoSpaceId}`
-						this.infoData.outInDetailAddPOList[key].num = house.num
+						this.infoData.outInDetailAddPOList[key].num = 1 // 有问题
             // this.infoData.outInDetailAddPOList[key].warehouseName =
             //   house.warehouseName;
 						// 	this.infoData.outInDetailAddPOList[key].areaName = house.areaName;
@@ -491,6 +491,60 @@
       handleWareHouse(row, idx) {
 					this.$refs.wareHouseDailogRef.open(row, idx);
       },
+      // 包装维度修改质检改变物料维度质检(结果和状态)
+      changeMaterialResult() {
+        this.metaList.forEach((outItem) => {
+          let arr = [];
+          this.materialCodeReqList.forEach((inneritem) => {
+            if (inneritem.onlyCode == outItem.code) {
+              arr.push(inneritem);
+            }
+          });
+          console.log(arr);
+          // 首先判断是未填/合格不合格
+          let boolen = arr.every((item) => {
+            return item.result === '' || item.result === undefined;
+          });
+          // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
+          if (boolen) {
+            this.$set(outItem, 'result', '');
+            this.$set(outItem, 'status', '0');
+          } else {
+            // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
+            let boolen = arr.some((item) => {
+              return item.result === '1';
+            });
+            if (boolen) {
+              this.$set(outItem, 'result', '1');
+              this.$set(outItem, 'status', '1');
+            } else {
+              // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
+              let boolen = arr.some((item) => {
+                return item.result === '3';
+              });
+              if (boolen) {
+                // 让步接收 已检
+                this.$set(outItem, 'result', '3');
+                this.$set(outItem, 'status', '1');
+              } else {
+                // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
+                let boolen = arr.every((item) => {
+                  return item.result === '0';
+                });
+                if (boolen) {
+                  // 合格 已检
+                  this.$set(outItem, 'result', '0');
+                  this.$set(outItem, 'status', '1');
+                } else {
+                  // 合格 部分检
+                  this.$set(outItem, 'result', '0');
+                  this.$set(outItem, 'status', '2');
+                }
+              }
+            }
+          }
+        });
+      },
       // 物料维度修改质检改变包装维度质检(结果和状态)
       changeWrapResult() {
         this.materialCodeReqList.forEach((outItem) => {
@@ -561,6 +615,10 @@
           this.$nextTick(() => {
             this.changeWrapResult();
           });
+        } else {
+          this.$nextTick(() => {
+            this.changeMaterialResult()
+          })
         }
         // 缺少包装明细让步接收物料如何选择结果
       },
@@ -575,34 +633,35 @@
         return total.PackingCount * total.outInNum * total.univalence;
       },
       // 获取出库单详情
-      async initialize() {
+      initialize() {
         // returnHandleNo 有单据来源说明已入库(被驳回状态)
-				let res = await getOutInBySourceBizNo(this.returnDetailsForm.returnHandleNo)
-				console.log(res)
-				if (this.returnDetailsForm.returnHandleNo && res.code != -1) {
-					this.isEdit = false
-					this.infoData = deepClone(res.data)
+				getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
+          console.log(data)
+          console.log('有订单来源')
+          this.isEdit = false
+					this.infoData = deepClone(data)
 					// 增加是否已经入库字段
 					this.infoData.isStorage = true
 					// 填充遍历数据
 					if (this.infoData.outInDetailVOList?.length > 0) {
-          this.warehousingMaterialList = []; // 物品列表
-          this.materialCodeReqList = []; // 包装列表
-          this.metaList = []; // 物料列表
-          this.infoData.outInDetailVOList.forEach((goodsiItem) => {
-            this.warehousingMaterialList.push(goodsiItem);
-            goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
-							wrapItem.count =
-                wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
-              this.materialCodeReqList.push(wrapItem);
-              wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
-                this.metaList.push(materialItem);
+            this.warehousingMaterialList = []; // 物品列表
+            this.materialCodeReqList = []; // 包装列表
+            this.metaList = []; // 物料列表
+            this.infoData.outInDetailVOList.forEach((goodsiItem) => {
+              this.warehousingMaterialList.push(goodsiItem);
+              goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
+                wrapItem.count =
+                  wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
+                this.materialCodeReqList.push(wrapItem);
+                wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
+                  this.metaList.push(materialItem);
+                });
               });
             });
-          });
-        }
-				} else {
-					this.isEdit = true
+          }
+        }).catch(async() => {
+          console.log('没有订单来源')
+          this.isEdit = true
 					// outboundType 1包装 2物料
 					let sendNo = this.returnDetailsForm.detailList[0]?.outInId;
 					// 将退货物品明细划分为包装和物料(从物料往上反推形成tree)
@@ -682,7 +741,7 @@
 						}
 					);
 					this.initData();
-				}
+        })
       },
       // 初始化显示数据
       async initData() {
@@ -702,6 +761,7 @@
             this.warehousingMaterialList.push(goodsiItem);
             goodsiItem.outInDetailRecordAddPOList.forEach((wrapItem) => {
               wrapItem.minUnit = wrapItem.minPackingCount;
+              wrapItem.minPackingCount = wrapItem.minPackingCount;
               wrapItem.minPositionId = wrapItem.cargoSpaceId;
               wrapItem.unit = wrapItem.packingUnit;
               wrapItem.count =

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

@@ -368,6 +368,7 @@
       },
       open(data) {
         this.listData = data;
+        console.log('实例流程~~~~~~', data);
         this.dialogVisible = true;
         this.getDetail();
       },

+ 17 - 22
src/views/bpm/outgoingManagement/add.vue

@@ -324,20 +324,13 @@
           </el-col>
         </el-row>
       </el-form>
-
+      <div>
+        <el-button type="primary" @click="addStock">添加</el-button>
+      </div>
       <div class="material">
-        <div style="width: 100%; text-align: right"
-          ><el-button type="primary" @click="addStock" v-if="!isTask"
-            >添加</el-button
-          ></div
-        >
+        <div style="width: 100%; text-align: right"></div>
         <div v-if="dimension != 4">
-          <div class="flex">
-            <div><span class="red">*</span>物品清单</div>
-            <div>
-              <!-- <el-button type="primary" @click="addStock">添加</el-button> -->
-            </div>
-          </div>
+          <header-title title="物品清单"></header-title>
           <div class="mt10 form-table">
             <el-form
               ref="warehousingMaterialListRef"
@@ -436,7 +429,8 @@
                   </el-row>
                 </template>
               </el-table-column> -->
-                <el-table-column label="操作" width="200" v-if="!isTask">
+                <!-- <el-table-column label="操作" width="200" v-if="!isTask"> -->
+                <el-table-column label="操作" width="200">
                   <template slot-scope="{ row, $index }">
                     <el-button type="text" @click="listDel(row, $index)"
                       >删除</el-button
@@ -446,9 +440,7 @@
               </el-table>
             </el-form>
           </div>
-          <div class="flex" style="margin-top: 20px">
-            <div><span class="red">*</span>包装清单</div>
-          </div>
+          <header-title class="mt20" title="包装清单"></header-title>
           <div class="mt10 form-table">
             <BatchDetail
               :assetType="formData.extInfo.assetType"
@@ -486,7 +478,7 @@
                   min-width="100"
                   prop="assetCode"
                 ></el-table-column>
-                <el-table-column label="名称" prop="name" width="50">
+                <el-table-column label="名称" prop="name" width="200">
                 </el-table-column>
 
                 <el-table-column label="批次号" prop="batchNo">
@@ -648,6 +640,7 @@
     },
     data() {
       return {
+        infoData: {},
         isTask: false,
         dimension: '3',
         llList: [],
@@ -897,7 +890,8 @@
               obj.num = this.materialCodeReqList.length;
             }
             console.log('2222', obj);
-
+            // 入库来源storageSource 0-正常  1-外部
+            obj.storageSource = 1;
             try {
               const res = await outin.saveNew(obj);
               if (res.code == 0) {
@@ -929,6 +923,7 @@
         this.$forceUpdate();
       },
       eomSuccess(row) {
+        console.log('row--------------------');
         console.log(row);
         this.formData.extInfo.assetType = row.categoryLevelTopId || '9';
         this.formData.bizType = '3';
@@ -941,10 +936,10 @@
         this.formData.clientName = row.contactName;
         this.formData.clientUser = row.linkName;
         this.formData.clientPhone = row.linkPhone;
-        this.onSelectTableData(row.tableData || row.productList, 1);
-        if (row.productList.length > 0) {
-          this.$refs.assetsDialogRef.confirm(row.productList, '3');
-        }
+        // this.onSelectTableData(row.tableData || row.productList, 1);
+        // if (row.productList.length > 0) {
+        //   this.$refs.assetsDialogRef.confirm(row.productList, '3');
+        // }
         this.$forceUpdate();
       },
       pickOrderRow(row) {

+ 20 - 9
src/views/bpm/outgoingManagement/components/AssetsDialog.vue

@@ -113,6 +113,15 @@
           :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
           @selection-change="handleSelectionChange"
         >
+          <el-table-column
+            type="selection"
+            :reserve-selection="true"
+            width="55"
+            align="center"
+            fixed="left"
+            :selectable="selectable"
+          >
+          </el-table-column>
           <el-table-column
             prop="assetCode"
             label="编码"
@@ -235,14 +244,6 @@
           ></el-table-column>
 
           <!-- <el-table-column prop="pathName" label="仓库"> </el-table-column> -->
-          <el-table-column
-            type="selection"
-            :reserve-selection="true"
-            width="55"
-            align="center"
-            :selectable="selectable"
-          >
-          </el-table-column>
         </el-table>
         <div style="text-align: right; padding: 10px">
           <el-pagination
@@ -299,7 +300,17 @@
         return tableHeader(this.assetType);
       }
     },
-
+    watch: {
+      // 解决右侧悬浮操作栏不对称问题
+      tableData: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.multipleTable.doLayout();
+          });
+        },
+        deep: true
+      }
+    },
     data() {
       return {
         visible: false,

+ 2 - 3
src/views/bpm/stockManagement/add.vue

@@ -930,8 +930,6 @@
             </el-table-column>
             <el-table-column label="质检状态" prop="status" width="120">
               <template slot-scope="{ row }">
-                // <DictSelection // dictName="质检状态" // clearable //
-                v-model="row.status" // v-if="!row.isPack" // />
                 <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
@@ -1111,7 +1109,7 @@
                 <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="操作" width="80">
+            <el-table-column label="操作" width="80" fixed="right">
               <template slot-scope="{ row }">
                 <el-button type="text" @click="materialBtn(row)">
                   {{ !row.isPack ? '保存' : '编辑' }}
@@ -2287,6 +2285,7 @@
           dateValue: it[this.curDateType],
           minUnit: it.minPackingCount,
           minPositionId: it.cargoSpaceId,
+          minPackingCount: it.minPackingCount,
           name: it.assetName,
           pathIds: item.pathIds,
           unit: it.unit,