Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue
Z 2 лет назад
Родитель
Сommit
536eee8baf

+ 4 - 4
src/utils/dict/warehouse.js

@@ -34,10 +34,10 @@ export const warehousingType = [
 export const sceneState = [
   { code: 1, label: '生产入库' },
   { code: 2, label: '采购入库' },
-  { code: 3, label: '赠送入库' },
-  { code: 4, label: '借用入库' },
-  // { code: 5, label: '退还入库' },
-  { code: 6, label: '其他入库' }
+  { code: 3, label: '归还入库' },
+  { code: 4, label: '领料退货入库' },
+  { code: 6, label: '销售退货入库' },
+  { code: 5, label: '其他入库' }
 ];
 export const outputSceneState = [
   { code: 1, label: '退供出库' },

+ 6 - 3
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -801,7 +801,9 @@
         return this.dict[dictEnum['产品不合格类型']] || [];
       }
     },
-    created() {},
+    created() {
+      console.log(this.isShowReturnOrder, '====');
+    },
     mounted() {
       this.getReturnInfo(this.businessId);
     },
@@ -955,7 +957,7 @@
       },
       getTableValue() {
         return new Promise((resolve) => {
-          this.$refs.formRef.validate((validate) => {
+          this.$refs.formRef.validate(async (validate) => {
             if (!validate) {
               resolve(false);
             } else {
@@ -998,7 +1000,8 @@
                 }),
                 returnRecordId: this.form.returnRecordId,
                 id: this.form.id,
-                returnStorageData: this.$refs.inboundDetails?.infoData
+                returnStorageData:
+                  await this.$refs.inboundDetails?.getReturnStorage()
               };
               resolve(params);
             }

+ 969 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails copy.vue

@@ -0,0 +1,969 @@
+<template>
+  <div class="inboundDetails mt20">
+    <div class="content-detail">
+      <header-title title="基本信息" size="16px"></header-title>
+      <div class="mt20">
+        <el-form label-width="110px">
+          <el-col :span="8">
+            <el-form-item label="物品类型">
+              <!-- <span>{{ codeList[infoData.extInfo.assetType] }}</span> -->
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="入库类型">
+              <span>销售退货入库</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="退货订单">
+              <span>{{ infoData.clientName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="送货人">
+              <span>{{ infoData.deliveryName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="送货人联系方式">
+              <span>{{ infoData.deliveryPhone }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="16">
+            <el-form-item label="备注">
+              <span>{{ infoData.remark }}</span>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+    </div>
+    <div class="content-detail mt20">
+      <header-title title="物品明细" size="16px"></header-title>
+      <div class="mt20">
+        <div class="mt10">
+          <el-table
+            v-if="showTable"
+            ref="multipleTable"
+            :data="warehousingMaterialList"
+            tooltip-effect="dark"
+            style="width: 100%"
+            stripe
+            :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+          >
+            <el-table-column
+              label="序号"
+              type="index"
+              width="50"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="categoryCode"
+              align="center"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              align="center"
+              prop="name"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              align="center"
+              prop="modelType"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              align="center"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              align="center"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <!-- <el-table-column
+              label="最小包装单元"
+              align="center"
+              prop="minPackingCount"
+              width="100"
+            >
+              <template slot-scope="{ row, $index }">
+                {{ row.measuringUnit }} /{{ row.minPackUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="outInNum"
+              width="150"
+              align="center"
+            >
+              <template slot-scope="{ row, $index }">
+                <template> {{ row.outInNum }} {{ row.minPackUnit }} </template>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="计量数量" prop="counts">
+              <template slot-scope="{ row, $index }">
+                {{ row.count }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measuringUnit"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量"
+              align="center"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              align="center"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="单价"
+              prop="univalence"
+              width="150"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              label="金额"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row, $index }">
+                {{
+                  calcSumTotal(
+                    row.outInNum,
+                    row.minPackingCount,
+                    row.univalence
+                  )
+                }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="货位"
+              prop="houseList"
+              :show-overflow-tooltip="true"
+              width="250"
+              required
+            >
+              <template slot-scope="{ row, $index }">
+                <div v-if="isEdit" @click="handleWareHouse(row, $index)">
+                  <div style="color: #ff4949" v-if="row.houseList.length === 0">
+                    ---(必填)
+                  </div>
+                  <div v-else>
+                    <div
+                      class="fontOmitted"
+                      v-for="(item, index) in row.houseList"
+                      :key="index"
+                    >
+                      {{ item.warehouseName }}- {{ item.areaName }}-
+                      {{ item.shelfCode }}- {{ item.cargoSpaceCode
+                      }}<span style="color: #ff4949" v-if="item.num">
+                        - {{ item.num }}(数)</span
+                      >
+                      <br />
+                    </div>
+                  </div>
+                </div>
+                <div v-else>{{ row.position }}</div>
+              </template>
+            </el-table-column>
+            <!-- <el-table-column
+                label="质检单"
+                align="center"
+                prop="weightUnit"
+                :show-overflow-tooltip="true"
+              > -->
+            <!-- <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column label="编码" prop="categoryCode"></el-table-column>
+            <el-table-column label="名称" prop="name"></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <el-table-column label="最小包装单元" width="120">
+              <template slot-scope="{ row }">
+                {{ row.minPackingCount }}{{ row.measuringUnit }}/{{
+                  row.packingUnit
+                }}
+              </template>
+            </el-table-column>
+            <el-table-column label="包装数量" prop="availableCountBase">
+              <template slot-scope="{ row }">
+                {{ row.packingCount }}{{ row.packingUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column label="计量数量" prop="count"></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measuringUnit"
+            ></el-table-column>
+            <el-table-column label="重量" prop="weight"></el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+            ></el-table-column>
+            <el-table-column label="单价">
+              <template slot-scope="{ row }">
+                {{ row.price ? row.price : '-' }}元/{{ row.measuringUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column label="金额" prop="totalMoney"></el-table-column>
+            <el-table-column label="领料部门" prop="llbm"></el-table-column> -->
+          </el-table>
+        </div>
+      </div>
+    </div>
+    <div class="mt20">
+      <header-title :title="`包装明细`" size="16px"></header-title>
+      <el-table
+        ref="multipleTable"
+        :data="materialCodeReqList"
+        tooltip-effect="dark"
+        style="width: 100%"
+        stripe
+        :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+      >
+        <el-table-column label="序号" type="index" width="50">
+        </el-table-column>
+        <!-- <el-table-column :label="`编码`" prop="assetCode"></el-table-column> -->
+        <el-table-column :label="`编码`" prop="categoryCode"></el-table-column>
+        <!-- <el-table-column :label="`名称`" prop="assetName"></el-table-column> -->
+        <el-table-column :label="`名称`" prop="name"></el-table-column>
+        <el-table-column label="批次号" prop="batchNo"></el-table-column>
+        <!-- <el-table-column
+          label="包装编码"
+          prop="onlyCode"
+          width="80"
+        ></el-table-column> -->
+        <el-table-column
+          label="包装编码"
+          prop="code"
+          width="80"
+        ></el-table-column>
+        <el-table-column label="包装数量" prop="packingCount" width="80">
+          <template slot-scope="{ row }">
+            {{ row.packingCount == 0 ? '0' : row.packingCount }}
+          </template>
+        </el-table-column>
+        <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
+        <!-- <el-table-column label="计量数量" prop="totalCount"></el-table-column> -->
+        <el-table-column label="计量数量" prop="count"></el-table-column>
+
+        <el-table-column
+          label="计量单位"
+          prop="measuringUnit"
+        ></el-table-column>
+        <!-- <el-table-column label="领料部门" prop=""></el-table-column> -->
+        <el-table-column
+          v-if="infoData.bizType == 2 || infoData.bizType == 1"
+          label="物料代号"
+          prop="materielCode"
+        >
+          <template slot-scope="{ row }">
+            {{ row.materielCode }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-if="infoData.bizType == 2 || infoData.bizType == 1"
+          label="客户代号"
+          prop="clientCode"
+        >
+          <template slot-scope="{ row }">
+            {{ row.clientCode }}
+          </template>
+        </el-table-column>
+        <!-- v-if="infoData.bizType == 1" -->
+        <el-table-column label="刻码" prop="engrave">
+          <template slot-scope="{ row }">
+            {{ row.engrave }}
+          </template>
+        </el-table-column>
+        <el-table-column label="重量" prop="weight">
+          <template slot-scope="{ row }">
+            {{ row.weight }}
+          </template>
+        </el-table-column>
+        <el-table-column label="重量单位" prop="weightUtil">
+          <template slot-scope="{ row }">
+            {{ row.weightUtil }}
+          </template>
+        </el-table-column>
+        <el-table-column label="质检结果" prop="result" width="120">
+          <template slot-scope="{ row }">
+            <DictSelection
+              v-if="isEdit && metaList?.length <= 0"
+              @updateVal="changeWrapStatus($event, row, '包装明细')"
+              dictName="质检结果"
+              clearable
+              v-model="row.result"
+            />
+            <span v-else>{{ qualityResults[row.result] }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="质检状态" prop="status" width="120">
+          <template slot-scope="{ row }">
+            <span>{{ qualityStatus[row.status] }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="生产日期"
+          prop="manufactureTime"
+          width="200"
+        ></el-table-column>
+        <el-table-column
+          label="采购日期"
+          prop="procurementTime"
+          width="200"
+        ></el-table-column>
+      </el-table>
+    </div>
+    <div class="mt20">
+      <header-title :title="`物料明细`" size="16px"></header-title>
+      <el-table
+        ref="multipleTable1"
+        :data="metaList"
+        tooltip-effect="dark"
+        style="width: 100%"
+        stripe
+        :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+      >
+        <el-table-column label="序号" type="index" width="50">
+        </el-table-column>
+        <el-table-column label="编码" prop="assetCode"></el-table-column>
+        <el-table-column label="名称" prop="assetName"></el-table-column>
+        <el-table-column label="批次号" prop="batchNo"></el-table-column>
+        <el-table-column label="物料编码" prop="no"></el-table-column>
+        <el-table-column label="计量数量" prop="">
+          <template slot-scope="{ row }">1</template>
+        </el-table-column>
+        <el-table-column label="计量单位" prop="measuringUnit">
+        </el-table-column>
+        <el-table-column label="物料代号" prop="meterielCode">
+        </el-table-column>
+        <el-table-column label="客户代号" prop="clientCode"> </el-table-column>
+        <el-table-column label="刻码" prop="engrave"></el-table-column>
+        <el-table-column label="重量" prop="weight"></el-table-column>
+        <el-table-column label="重量单位" prop="weightUnit"> </el-table-column>
+        <el-table-column label="质检结果" prop="result" width="120">
+          <template slot-scope="{ row }">
+            <DictSelection
+              v-if="isEdit && metaList?.length > 0"
+              @updateVal="changeWrapStatus($event, row, '物料明细')"
+              dictName="质检结果"
+              clearable
+              v-model="row.result"
+            />
+            <span v-else>{{ qualityResults[row.result] }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="质检状态" prop="status" width="120">
+          <template slot-scope="{ row }">
+            <span>{{ qualityStatus[row.status] }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <WareHouseDailog
+      ref="wareHouseDailogRef"
+      @houseData="houseData"
+    ></WareHouseDailog>
+  </div>
+</template>
+
+<script>
+  // import { getInfo } from '@/api/stockManagement/outgoingManagement' '@/components/PageHeader'
+  // import PageHeader from '@/components/PageHeader';
+  // import { tableHeader } from '../common';
+  import WareHouseDailog from '@/components/WareHouseDailog/index.vue';
+  import { mapGetters, mapActions } from 'vuex';
+  import {
+    getOutInBySourceBizNoOrError,
+    getTreeByGroup
+  } from '@/api/classifyManage/index';
+  //import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+
+  // import {
+  //   materialType,
+  //   warehousingType,
+  //   useDict,
+  //   useDictLabel,
+  //   inputStatus,
+  //   outputSceneState,
+  //   auditStatus
+  // } from '@/utils/dict/index';
+  import { getUser } from '@/api/system/user';
+  import { getOutInByIdAPI } from '@/api/bpm/components/saleManage/saleorder';
+  import { deepClone } from '@/utils';
+
+  export default {
+    props: {
+      returnDetailsForm: {
+        type: Object,
+        default: {
+          detailList: []
+        }
+      }
+    },
+    components: {
+      WareHouseDailog
+    },
+    data() {
+      return {
+        codeList: {}, // 物品类型键值对
+        isEdit: true, // 是否可以编辑(货位和质检状态)
+        showTable: true, // 解决set数组Table不刷新问题
+        title: '信息',
+        qualityStatus: {
+          0: '未检',
+          1: '已检',
+          2: '部分检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          0: '合格',
+          1: '不合格',
+          3: '让步接收'
+        }, // 质检结果 0合格 1不合格 3让步接收
+        infoData: {}, // 上传入库信息
+        warehousingMaterialList: [], // 物品列表
+        materialCodeReqList: [], // 包装列表
+        metaList: [] // 物料列表
+      };
+    },
+    computed: {
+      ...mapGetters(['getDictValue'])
+    },
+    created() {
+      this.getCodeList();
+    },
+    methods: {
+      // 仓库选择
+      houseData(argum, idx) {
+        console.log(argum);
+        console.log(idx);
+        this.showTable = false;
+        this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
+        this.$set(this.infoData.outInDetailAddPOList[idx], 'houseList', argum);
+        this.$nextTick(() => {
+          this.showTable = true;
+          // 添加货位字段
+          for (let key in this.infoData.outInDetailAddPOList) {
+            for (let k in this.infoData.outInDetailAddPOList[key].houseList) {
+              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 = 1; // 有问题
+              // this.infoData.outInDetailAddPOList[key].warehouseName =
+              //   house.warehouseName;
+              // 	this.infoData.outInDetailAddPOList[key].areaName = house.areaName;
+              // 	this.infoData.outInDetailAddPOList[key].shelfCode = house.shelfCode;
+              // 	this.infoData.outInDetailAddPOList[key].cargoSpaceCode =
+              //   house.cargoSpaceCode;
+              // 	this.infoData.outInDetailAddPOList[key].warehouseId = house.warehouseId;
+              // 	this.infoData.outInDetailAddPOList[key].areaId = house.areaId;
+              // 	this.infoData.outInDetailAddPOList[key].shelfId = house.shelfId;
+              // 	this.infoData.outInDetailAddPOList[key].cargoSpaceId = house.cargoSpaceId;
+              // 	this.infoData.outInDetailAddPOList[key].num = house.num;
+            }
+          }
+          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);
+      },
+      // 包装维度修改质检改变物料维度质检(结果和状态)
+      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) => {
+            console.log(item.result);
+            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) => {
+          let arr = [];
+          this.metaList.forEach((inneritem) => {
+            if (inneritem.onlyCode == outItem.code) {
+              arr.push(inneritem);
+            }
+          });
+          console.log('arr--', arr);
+          // 首先判断是未填/合格不合格
+          let boolen = arr.every((item) => {
+            console.log(item.result);
+            return (
+              item.result === '' ||
+              item.result === undefined ||
+              item.result === null
+            );
+          });
+          // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
+          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');
+                }
+              }
+            }
+          }
+        });
+      },
+      // 选择质检结果改变质检状态
+      changeWrapStatus(resultValue, row, type) {
+        switch (resultValue) {
+          case '':
+            // 清空质检状态
+            row.status = '0';
+            break;
+          default:
+            // 默认已检质检状态
+            row.status = '1';
+            break;
+        }
+        if (type === '物料明细') {
+          this.$nextTick(() => {
+            this.changeWrapResult();
+          });
+        } else {
+          this.$nextTick(() => {
+            this.changeMaterialResult();
+          });
+        }
+        // 缺少包装明细让步接收物料如何选择结果
+      },
+      //计算金额
+      calcSumTotal(packingCount, outInNum, univalence) {
+        //最小包装单元,包装数量,单价
+        const total = {
+          PackingCount: Number(packingCount > 0 ? packingCount : 0),
+          outInNum: Number(outInNum > 0 ? outInNum : 0),
+          univalence: Number(univalence > 0 ? univalence : 0)
+        };
+        return total.PackingCount * total.outInNum * total.univalence;
+      },
+      // 获取出库单详情
+      async initialize() {
+        // returnInReceiptId退货入库单id(有说明已入库)
+        if (this.returnDetailsForm.returnInReceiptId) {
+          getOutInByIdAPI(this.returnDetailsForm.returnInReceiptId).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);
+                      }
+                    );
+                  });
+                });
+              }
+            }
+          );
+        } else {
+          console.log('没有订单来源');
+          this.isEdit = true;
+          // outboundType 1包装 2物料
+          let sendNo = this.returnDetailsForm.detailList[0]?.outInId;
+          // 将退货物品明细划分为包装和物料(从物料往上反推形成tree)
+          // 包装清单
+          let wrapList =
+            this.returnDetailsForm.detailList?.length > 0
+              ? this.returnDetailsForm.detailList.filter(
+                  (item) => item.outboundType === 1
+                )
+              : [];
+          // 物料清单
+          let material =
+            this.returnDetailsForm.detailList?.length > 0
+              ? this.returnDetailsForm.detailList.filter(
+                  (item) => item.outboundType === 2
+                )
+              : [];
+          // 获取出库单详情
+          const data = await getOutInByIdAPI(sendNo);
+          // 复制出库单详情
+          this.infoData = deepClone(data);
+          // 添加单据来源
+          this.infoData.sourceBizNo = this.returnDetailsForm.returnHandleNo;
+          // 增加是否已经入库字段
+          this.infoData.isStorage = false;
+          // 将出库状态改成入库状态 2出库 1入库
+          this.infoData.type = 1;
+          // 通过物料过滤出库单详情树
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            // 过滤物料维度
+            goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+              wrapItem.outInDetailRecordMaterialDetailVOList =
+                wrapItem.outInDetailRecordMaterialDetailVOList.map(
+                  (materialItem) => {
+                    let hasMaterialItem = material.some(
+                      (item) => item.outboundDetailId === materialItem.id
+                    );
+                    if (hasMaterialItem) {
+                      console.log(materialItem);
+                      return materialItem;
+                    }
+                  }
+                );
+            });
+          });
+          // 通过包装过滤出库单详情树
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            // 过滤包装维度
+            goodsItem.outInDetailRecordVOList =
+              goodsItem.outInDetailRecordVOList.map((wrapItem) => {
+                // 过滤在包装清单内或者存在过滤物料的包装
+                if (wrapList.length > 0) {
+                  let hasWrapItem = wrapList.some((item) => {
+                    return (
+                      item.outboundDetailId === wrapItem.id ||
+                      wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+                    );
+                  });
+                  if (hasWrapItem) {
+                    return wrapItem;
+                  }
+                } else {
+                  // 返回存在物料维度的包装维度
+                  if (
+                    wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+                  ) {
+                    return wrapItem;
+                  }
+                }
+              });
+          });
+          // 过滤没有包装的物品维度
+          this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.map(
+            (goodsItem) => {
+              if (goodsItem.outInDetailRecordVOList?.length > 0) {
+                return goodsItem;
+              }
+            }
+          );
+          // 处理过滤map为空的数组
+          this.infoData.outInDetailVOList =
+            this.infoData.outInDetailVOList.filter((item) => !!item);
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            goodsItem.outInDetailRecordVOList =
+              goodsItem.outInDetailRecordVOList.filter(
+                (wrapItem) => !!wrapItem
+              );
+          });
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+              wrapItem.outInDetailRecordMaterialDetailVOList =
+                wrapItem.outInDetailRecordMaterialDetailVOList.filter(
+                  (metail) => !!metail
+                );
+            });
+          });
+          this.initData();
+        }
+        // returnHandleNo 有单据来源说明已入库(被驳回状态)
+        // 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);
+        //         });
+        //       });
+        //     });
+        //   }
+        // }).catch(async() => {
+        //   console.log('没有订单来源')
+        //   this.isEdit = true
+        // 	// outboundType 1包装 2物料
+        // 	let sendNo = this.returnDetailsForm.detailList[0]?.outInId;
+        // 	// 将退货物品明细划分为包装和物料(从物料往上反推形成tree)
+        // 	// 包装清单
+        // 	let wrapList =
+        // 		this.returnDetailsForm.detailList?.length > 0
+        // 			? this.returnDetailsForm.detailList.filter(
+        // 					(item) => item.outboundType === 1
+        // 				)
+        // 			: [];
+        // 	// 物料清单
+        // 	let material =
+        // 		this.returnDetailsForm.detailList?.length > 0
+        // 			? this.returnDetailsForm.detailList.filter(
+        // 					(item) => item.outboundType === 2
+        // 				)
+        // 			: [];
+        // 	// 获取出库单详情
+        // 	const data = await getOutInByIdAPI(sendNo);
+        // 	// 复制出库单详情
+        // 	this.infoData = deepClone(data);
+        // 	// 添加单据来源
+        // 	this.infoData.sourceBizNo = this.returnDetailsForm.returnHandleNo
+        // 	// 增加是否已经入库字段
+        // 	this.infoData.isStorage = false
+        // 	// 将出库状态改成入库状态 2出库 1入库
+        // 	this.infoData.type = 1;
+        // 	// 通过物料过滤出库单详情树
+        // 	this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        // 		// 过滤物料维度
+        // 		goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+        // 			wrapItem.outInDetailRecordMaterialDetailVOList =
+        // 				wrapItem.outInDetailRecordMaterialDetailVOList.map(
+        // 					(materialItem) => {
+        // 						let hasMaterialItem = material.some(
+        // 							(item) => item.outboundDetailId === materialItem.id
+        // 						);
+        // 						if (hasMaterialItem) {
+        //               console.log(materialItem)
+        // 							return materialItem;
+        // 						}
+        // 					}
+        // 				);
+        // 		});
+        // 	});
+        // 	// 通过包装过滤出库单详情树
+        // 	this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        // 		// 过滤包装维度
+        // 		goodsItem.outInDetailRecordVOList =
+        // 			goodsItem.outInDetailRecordVOList.map((wrapItem) => {
+        // 				// 过滤在包装清单内或者存在过滤物料的包装
+        // 				if (wrapList.length > 0) {
+        // 					let hasWrapItem = wrapList.some((item) => {
+        // 						return (
+        // 							item.outboundDetailId === wrapItem.id ||
+        // 							wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+        // 						);
+        // 					});
+        // 					if (hasWrapItem) {
+        // 						return wrapItem;
+        // 					}
+        // 				} else {
+        // 					// 返回存在物料维度的包装维度
+        // 					if (
+        // 						wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+        // 					) {
+        // 						return wrapItem;
+        // 					}
+        // 				}
+        // 			});
+        // 	});
+        // 	// 过滤没有包装的物品维度
+        // 	this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.map(
+        // 		(goodsItem) => {
+        // 			if (goodsItem.outInDetailRecordVOList?.length > 0) {
+        // 				return goodsItem;
+        // 			}
+        // 		}
+        // 	);
+        //   // 处理过滤map为空的数组
+        //   this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.filter((item) => !!item)
+        //   this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        //     goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
+        // 	});
+        //   this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        //     goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+        //       wrapItem.outInDetailRecordMaterialDetailVOList = wrapItem.outInDetailRecordMaterialDetailVOList.filter((metail) => !!metail)
+        //     })
+        //   })
+        //   console.log(this.infoData)
+        // 	this.initData();
+        // })
+      },
+      // 初始化显示数据
+      async initData() {
+        this.infoData.outInDetailAddPOList = this.infoData.outInDetailVOList;
+        delete this.infoData.outInDetailVOList;
+        console.log(this.infoData);
+        if (this.infoData.outInDetailAddPOList?.length > 0) {
+          this.warehousingMaterialList = []; // 物品列表
+          this.materialCodeReqList = []; // 包装列表
+          this.metaList = []; // 物料列表
+          this.infoData.outInDetailAddPOList.forEach((goodsiItem) => {
+            goodsiItem.houseList = [];
+            goodsiItem.count = goodsiItem.outInDetailRecordVOList.length;
+            goodsiItem.outInDetailRecordAddPOList =
+              goodsiItem.outInDetailRecordVOList;
+            delete goodsiItem.outInDetailRecordVOList;
+            console.log(goodsiItem);
+
+            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 =
+                wrapItem.outInDetailRecordMaterialDetailVOList.length;
+              wrapItem.materialDetails =
+                wrapItem.outInDetailRecordMaterialDetailVOList;
+              delete wrapItem.outInDetailRecordMaterialDetailVOList;
+              this.materialCodeReqList.push(wrapItem);
+              wrapItem.materialDetails.forEach((materialItem) => {
+                this.metaList.push(materialItem);
+              });
+            });
+          });
+        }
+        console.log(this.warehousingMaterialList);
+        console.log(this.materialCodeReqList);
+        console.log(this.metaList);
+        console.log('------------------');
+        console.log(this.infoData);
+      },
+      ...mapActions('dict', ['requestDict'])
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // 货位省略号样式
+  .fontOmitted {
+    text-overflow: ellipsis;
+    overflow: hidden;
+    word-break: break-all;
+    white-space: nowrap;
+  }
+
+  .mt20 {
+    margin-top: 20px;
+  }
+
+  .content-detail {
+    overflow: hidden;
+  }
+</style>

Разница между файлами не показана из-за своего большого размера
+ 778 - 326
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue


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

@@ -79,7 +79,7 @@
               <span v-else>{{ formData.extInfo.deliveryPhone }}</span>
             </el-form-item>
           </el-col>
-          <el-col :span="12" v-if="taskDefinitionKey === 'innerInQCFeedback'">
+          <el-col :span="12" v-if="taskDefinitionKey === 'outerInQCFeedback'">
             <el-form-item
               prop="qualityFile"
               label="回执附件"
@@ -590,10 +590,10 @@
               isStorage
                 ? materialCodeReqListOrStorage.length != 0 &&
                   resultArray.length <= 0 &&
-                  taskDefinitionKey === 'innerInQC'
+                  taskDefinitionKey === 'outerInQC'
                 : materialCodeReqList.length != 0 &&
                   resultArray.length <= 0 &&
-                  taskDefinitionKey === 'innerInQC'
+                  taskDefinitionKey === 'outerInQC'
             "
             type="success"
             plain
@@ -806,7 +806,7 @@
               </template>
             </el-table-column>
             <el-table-column
-              v-if="taskDefinitionKey === 'innerInQC' && wrapControl"
+              v-if="taskDefinitionKey === 'outerInQC' && wrapControl"
               label="操作"
               width="80"
               fixed="right"
@@ -961,7 +961,7 @@
               </template>
             </el-table-column>
             <el-table-column
-              v-if="taskDefinitionKey === 'innerInQC' && materialControl"
+              v-if="taskDefinitionKey === 'outerInQC' && materialControl"
               label="操作"
               width="80"
               fixed="right"
@@ -1234,7 +1234,7 @@
               goodsiItem.outInNum = goodsiItem.packingCount;
               this.warehousingMaterialList.push(goodsiItem);
               goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
-                if (this.taskDefinitionKey === 'innerInQC') {
+                if (this.taskDefinitionKey === 'outerInQC') {
                   // 生产性采购
                   if (
                     wrapItem.outInDetailRecordMaterialDetailVOList.length > 0
@@ -1263,7 +1263,7 @@
                         materialItem.result === null
                           ? ''
                           : String(materialItem.result);
-                      if (this.taskDefinitionKey === 'innerInQC') {
+                      if (this.taskDefinitionKey === 'outerInQC') {
                         // 生产性采购
                         materialItem.isPack = false;
                         this.materialControl = true;
@@ -1467,7 +1467,7 @@
       wrapListSave() {
         let materialCodeReqList = [];
         // 生产性入库没入库用materialCodeReqList字段
-        if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+        if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
           materialCodeReqList = this.materialCodeReqListOrStorage;
         } else {
           materialCodeReqList = this.materialCodeReqList;
@@ -1539,14 +1539,14 @@
       //包装明细保存
       packCout(row) {
         // 生产性质检必须已检才能通过
-        if (this.taskDefinitionKey === 'innerInQC' && row.status != '1') {
+        if (this.taskDefinitionKey === 'outerInQC' && row.status != '1') {
           this.$message.error('请选择质检结果');
           return false;
         }
         //true保存==》反之
         if (!row.isPack) {
           // 生产性采购审核
-          if (this.taskDefinitionKey === 'innerInQC') {
+          if (this.taskDefinitionKey === 'outerInQC') {
             this.isWrapTable = false;
             row.isPack = true;
             this.$nextTick(() => {
@@ -1567,7 +1567,7 @@
           // );
           let materialCodeReqList = [];
           // 生产性入库没入库用materialCodeReqList字段
-          if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+          if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
             materialCodeReqList = this.materialCodeReqListOrStorage;
           } else {
             materialCodeReqList = this.materialCodeReqList;
@@ -1595,14 +1595,14 @@
           });
           this.$nextTick(() => {
             // 生产性包装保存
-            if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+            if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
               this.initFormData();
             }
             this.isWeight = true;
           });
         } else {
           // 生产性
-          if (this.taskDefinitionKey === 'innerInQC') {
+          if (this.taskDefinitionKey === 'outerInQC') {
             this.isWrapTable = false;
             row.isPack = false;
             this.$nextTick(() => {
@@ -1620,7 +1620,7 @@
       bulkEditingWrap() {
         let materialCodeReqList = [];
         // 生产性入库没入库用materialCodeReqList字段
-        if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+        if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
           materialCodeReqList = this.materialCodeReqListOrStorage;
         } else {
           materialCodeReqList = this.materialCodeReqList;
@@ -1652,7 +1652,7 @@
       bulkEditingMaterial() {
         let materialCodeReqList = [];
         // 生产性入库没入库用materialCodeReqList字段
-        if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+        if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
           materialCodeReqList = this.materialCodeReqListOrStorage;
         } else {
           materialCodeReqList = this.materialCodeReqList;
@@ -1688,7 +1688,7 @@
         // 是否单点
         if (!isLonely) {
           // 生产性质检必须已检才能通过
-          if (this.taskDefinitionKey === 'innerInQC' && row.status != '1') {
+          if (this.taskDefinitionKey === 'outerInQC' && row.status != '1') {
             this.$message.error('请选择质检结果');
             return false;
           }
@@ -1696,7 +1696,7 @@
         let materialCodeReqList = [];
         let code = 'onlyCode';
         // 生产性入库没入库用materialCodeReqList字段
-        if (this.taskDefinitionKey === 'innerInQC' && this.isStorage) {
+        if (this.taskDefinitionKey === 'outerInQC' && this.isStorage) {
           materialCodeReqList = this.materialCodeReqListOrStorage;
           code = 'code';
         } else {
@@ -1706,7 +1706,7 @@
         // true保存 false编辑
         if (!row.isPack) {
           // 生产性采购审核
-          if (this.taskDefinitionKey === 'innerInQC') {
+          if (this.taskDefinitionKey === 'outerInQC') {
             this.isWrapTable = false;
             this.isMaterialTable = false;
             row.isPack = true;
@@ -1803,7 +1803,7 @@
           });
         } else {
           // 生产性采购审核
-          if (this.taskDefinitionKey === 'innerInQC') {
+          if (this.taskDefinitionKey === 'outerInQC') {
             this.isMaterialTable = false;
             this.isWrapTable = false;
             row.isPack = false;

+ 1 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -130,9 +130,8 @@
         this.activeComp = row.activeComp;
         this.childActiveComp = row.childActiveComp;
         this.permissionType = row.permissionType;
-        console.log(this.childActiveComp,this.taskDefinitionKey,'=====');
+        console.log(this.childActiveComp, this.taskDefinitionKey, '=====');
       });
-
     },
     mounted() {},
     methods: {

Некоторые файлы не были показаны из-за большого количества измененных файлов