|
|
@@ -185,7 +185,7 @@
|
|
|
align="center"
|
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <template v-if="true">
|
|
|
+ <template v-if="row.isSave">
|
|
|
{{ row.minPackingCount }}
|
|
|
</template>
|
|
|
<el-form-item
|
|
|
@@ -224,7 +224,7 @@
|
|
|
{{ row.packingCount }} {{ row.packingUnit }}
|
|
|
</template> -->
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <template v-if="true">
|
|
|
+ <template v-if="row.isSave">
|
|
|
{{ row.packingCount }} {{ row.packingUnit }}
|
|
|
</template>
|
|
|
<el-form-item
|
|
|
@@ -294,8 +294,8 @@
|
|
|
align="center"
|
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <template v-if="true">
|
|
|
- {{ row.packingCount }} {{ row.packingUnit }}
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.price }}
|
|
|
</template>
|
|
|
<el-form-item v-else>
|
|
|
<el-input
|
|
|
@@ -428,7 +428,11 @@
|
|
|
prop="materielCode"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ row.materielCode }}
|
|
|
+ <el-input
|
|
|
+ v-show="!row.isPack"
|
|
|
+ v-model="row.materielCode"
|
|
|
+ ></el-input>
|
|
|
+ <span v-show="row.isPack">{{ row.materielCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -437,18 +441,24 @@
|
|
|
prop="clientCode"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ row.clientCode }}
|
|
|
+ <el-input
|
|
|
+ v-show="!row.isPack"
|
|
|
+ v-model="row.clientCode"
|
|
|
+ ></el-input>
|
|
|
+ <span v-show="row.isPack">{{ row.clientCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- v-if="infoData.bizType == 1" -->
|
|
|
<el-table-column label="刻码" prop="engrave">
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ row.engrave }}
|
|
|
+ <el-input v-show="!row.isPack" v-model="row.engrave"></el-input>
|
|
|
+ <span v-show="row.isPack">{{ row.engrave }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column 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="weightUtil">
|
|
|
@@ -457,6 +467,37 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
+ <el-table-column label="质检结果" prop="result" width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <DictSelection
|
|
|
+ dictName="质检结果"
|
|
|
+ clearable
|
|
|
+ v-model="row.result"
|
|
|
+ v-show="!row.isPack"
|
|
|
+ />
|
|
|
+ <span v-if="row.isPack">{{
|
|
|
+ row.result == 0
|
|
|
+ ? '合格'
|
|
|
+ : row.result == 1
|
|
|
+ ? '不合格'
|
|
|
+ : '让步接收'
|
|
|
+ }}</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">{{
|
|
|
+ row.status == 0 ? '未检' : '已检'
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column label="日期" prop="createTime" width="200">
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
{{ dateTypes == 1 ? '采购日期' : '生产日期' }}
|
|
|
@@ -465,6 +506,27 @@
|
|
|
{{ row.createTime }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="100"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-show="!row.isPack"
|
|
|
+ @click="packSave(row, $index)"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-show="row.isPack"
|
|
|
+ @click="packEdit(row, $index)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="mt20">
|
|
|
@@ -540,6 +602,23 @@
|
|
|
{{ row.weightUnit }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="质检结果" prop="result" width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{
|
|
|
+ row.result == 0
|
|
|
+ ? '合格'
|
|
|
+ : row.result == 1
|
|
|
+ ? '不合格'
|
|
|
+ : '让步接收'
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="质检状态" prop="status" width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.status == 0 ? '未检' : '已检' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -580,6 +659,7 @@
|
|
|
// import { batchBarPrint } from '@/api/ledgerAssets/booksList';
|
|
|
import { tableHeader } from '../common';
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
|
|
+ import { number } from 'echarts/core';
|
|
|
export default {
|
|
|
components: { StatusStep, PageHeader, WareHouseDailog },
|
|
|
data() {
|
|
|
@@ -671,6 +751,138 @@
|
|
|
this._getInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //包装保存
|
|
|
+ async packSave(row, index) {
|
|
|
+ console.log('===', row);
|
|
|
+ console.log('row.minPackingCount', row.minPackingCount);
|
|
|
+ console.log(' this.detailList.length', this.detailList.length);
|
|
|
+ let packNo = 0;
|
|
|
+ this.warehousingMaterialList.forEach((item) => {
|
|
|
+ if (
|
|
|
+ item.categoryCode == row.categoryCode &&
|
|
|
+ item.categoryCode == row.categoryCode
|
|
|
+ ) {
|
|
|
+ packNo = item.packingCount;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log('packNopackNopackNo', packNo);
|
|
|
+
|
|
|
+ if (row.minPackingCount != this.detailList.length) {
|
|
|
+ //存当前没改之前包装数量
|
|
|
+ let count = 0;
|
|
|
+
|
|
|
+ for (const item of this.warehousingMaterialList) {
|
|
|
+ console.log('item', item);
|
|
|
+ if (item.categoryId == row.categoryId) {
|
|
|
+ count = item.outInNum;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(111);
|
|
|
+ //新增包装更新物料
|
|
|
+ const arr = [];
|
|
|
+ row.outInDetailRecordVOList.forEach((it) => {
|
|
|
+ it.outInDetailRecordMaterialDetailVOList.forEach((item) => {
|
|
|
+ arr.push({ ...item });
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ if (row.minPackingCount < Number(count)) {
|
|
|
+ console.log(1);
|
|
|
+ console.log('arr====arr', arr);
|
|
|
+ console.log('rrrr', this.metailList.length);
|
|
|
+ this.metailList = this.metaUpdate(arr, row);
|
|
|
+ } else {
|
|
|
+ console.log(2);
|
|
|
+ this.metailList = this.metaAdd(arr, row);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$set(row, 'isPack', true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$set(row, 'isPack', true);
|
|
|
+ //更新包装明细数据,同步物料明细
|
|
|
+
|
|
|
+ for (const i in this.metailList) {
|
|
|
+ if (this.metailList[i].onlyCode == row.code) {
|
|
|
+ this.metailList[i].clientCode = row.clientCode; //客户代号
|
|
|
+ this.metailList[i].materielCode = row.materielCode; //物料代号
|
|
|
+ this.metailList[i].result = row.result; //质检结果
|
|
|
+ this.metailList[i].status = row.status; //质检状态
|
|
|
+ this.metailList[i].weight = row.weight / row.minPackingCount; //重量
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //更新包装明细重量,更新物品重量
|
|
|
+ const list = this.detailList;
|
|
|
+ let sum = 0;
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ sum += Number(list[i].weight);
|
|
|
+ }
|
|
|
+ // const data = await outin.updateOutInRecord(row);
|
|
|
+ // if (data.code == 0) {
|
|
|
+ // this.$message.success('修改成功');
|
|
|
+ // }
|
|
|
+
|
|
|
+ this.warehousingMaterialList.forEach((item) => {
|
|
|
+ if (
|
|
|
+ item.categoryCode == row.categoryCode &&
|
|
|
+ item.categoryCode == row.categoryCode
|
|
|
+ ) {
|
|
|
+ item.weight = sum;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(this.warehousingMaterialList);
|
|
|
+ },
|
|
|
+ //更新物料
|
|
|
+ metaUpdate(arr, row) {
|
|
|
+ const obj = {
|
|
|
+ assetCode: row.categoryCode,
|
|
|
+ assetName: row.name,
|
|
|
+ batchNo: row.batchNo,
|
|
|
+ clientCode: row.clientCode,
|
|
|
+ createTime: row.createTime,
|
|
|
+ engrave: '',
|
|
|
+ id: '',
|
|
|
+ materielCode: row.materielCode,
|
|
|
+ measuringUnit: row.measuringUnit,
|
|
|
+ minPackingCount: 1,
|
|
|
+ no: '',
|
|
|
+ onlyCode: row.code,
|
|
|
+ outInDetailRecordId: '',
|
|
|
+ pathName: row.position,
|
|
|
+ result: row.result,
|
|
|
+ status: row.status,
|
|
|
+ weight: row.weight / row.minPackingCount,
|
|
|
+ weightUnit: row.weightUtil,
|
|
|
+ counts: row.minPackingCount
|
|
|
+ };
|
|
|
+ // 生成 no 字段的值
|
|
|
+ let newArr = [];
|
|
|
+ for (let i = 1; i <= obj.counts; i++) {
|
|
|
+ newArr.push({
|
|
|
+ ...obj,
|
|
|
+ no: obj.onlyCode + i.toString().padStart(4, '0')
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log('新增', newArr);
|
|
|
+ console.log(arr);
|
|
|
+
|
|
|
+ let data = this.metailList.concat(newArr);
|
|
|
+ const uniqueData = data.reduce((acc, curr) => {
|
|
|
+ acc[curr.no] = curr;
|
|
|
+ return acc;
|
|
|
+ }, {});
|
|
|
+
|
|
|
+ const result = Object.values(uniqueData);
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+ //包装编辑
|
|
|
+ packEdit(row, index) {
|
|
|
+ console.log('row', row);
|
|
|
+ this.$set(row, 'isPack', false);
|
|
|
+ this.$set(row, 'result', row.result ? row.result.toString() : '');
|
|
|
+ this.$set(row, 'status', row.status ? row.status.toString() : '');
|
|
|
+ },
|
|
|
houseData(argum, idx) {
|
|
|
this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
|
|
|
argum.forEach((item) => {
|
|
|
@@ -692,7 +904,6 @@
|
|
|
handleWareHouse(row, idx) {
|
|
|
const a = row.pathIds.split(',');
|
|
|
const b = row.position.split('-');
|
|
|
- console.log('==', row, a);
|
|
|
row.houseList = [
|
|
|
{
|
|
|
warehouseId: a[0],
|
|
|
@@ -706,7 +917,10 @@
|
|
|
num: row.packingCount
|
|
|
}
|
|
|
];
|
|
|
- this.$refs.wareHouseDailogRef.open(row, idx);
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
+ { ...row, outInNum: row.packingCount, warehouseId: a[0] },
|
|
|
+ idx
|
|
|
+ );
|
|
|
},
|
|
|
async handleSave() {
|
|
|
this.saveLoading = true;
|
|
|
@@ -714,9 +928,9 @@
|
|
|
if (this.detailList.length != 0) {
|
|
|
let a = this.infoData;
|
|
|
let array1 = this.warehousingMaterialList;
|
|
|
- let array2 = this.detailList;
|
|
|
- console.log(array1);
|
|
|
- console.log(array2);
|
|
|
+ let array2 = this.detailList.map((item) => {
|
|
|
+ return { ...item, materialDetails: this.metailList };
|
|
|
+ });
|
|
|
// 遍历数组1
|
|
|
array1.forEach((item1) => {
|
|
|
item1.arr = [];
|
|
|
@@ -745,7 +959,6 @@
|
|
|
delete ele.arr;
|
|
|
}
|
|
|
});
|
|
|
- console.log('arr1', array1);
|
|
|
array1.forEach((e) => {
|
|
|
if (e.hasOwnProperty('houseList')) {
|
|
|
e.houseList.forEach((item) => {
|
|
|
@@ -757,17 +970,70 @@
|
|
|
delete array1.houseList;
|
|
|
a.outInDetailUpdatePOList = array1;
|
|
|
a.extInfo = this.extInfo;
|
|
|
- const data = await outin.update(a);
|
|
|
- // console.log('sss', data);
|
|
|
- if (data.code == 0) {
|
|
|
- this.$message.success('修改成功!');
|
|
|
- this.$router.push('/warehouseManagement/stockManagement');
|
|
|
+
|
|
|
+ const obj = this.formatUpdate(a);
|
|
|
+ console.log('sss===》', obj);
|
|
|
+
|
|
|
+ try {
|
|
|
+ const data = await outin.update(obj);
|
|
|
+ if (data.code == 0) {
|
|
|
+ this.$message.success('修改成功!');
|
|
|
+ this.$router.push('/warehouseManagement/stockManagement');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.saveLoading = false;
|
|
|
}
|
|
|
} else {
|
|
|
this.$message.warning('包装明细为空!');
|
|
|
}
|
|
|
this.saveLoading = false;
|
|
|
},
|
|
|
+ formatUpdate(a) {
|
|
|
+ delete a.outInDetailVOList;
|
|
|
+ console.log(a);
|
|
|
+ // 删除 outInDetailVOList 数组对象里面的 outInDetailRecordVOList 数组对象里面的 outInDetailRecordMaterialDetailVOList
|
|
|
+ a.outInDetailUpdatePOList = a.outInDetailUpdatePOList.map((item) => {
|
|
|
+ const newItem = { ...item };
|
|
|
+ delete newItem.outInDetailRecordVOList;
|
|
|
+ return newItem;
|
|
|
+ });
|
|
|
+
|
|
|
+ const newData = {
|
|
|
+ ...a,
|
|
|
+ outInDetailUpdatePOList: a.outInDetailUpdatePOList.map((detail) => {
|
|
|
+ const { outInDetailRecordMaterialDetailVOList, ...rest } = detail;
|
|
|
+ return {
|
|
|
+ ...rest,
|
|
|
+ outInDetailRecordUpdatePOList:
|
|
|
+ rest.outInDetailRecordUpdatePOList.map((record) => {
|
|
|
+ const {
|
|
|
+ outInDetailRecordMaterialDetailVOList,
|
|
|
+ ...recordRest
|
|
|
+ } = record;
|
|
|
+ return { ...recordRest };
|
|
|
+ })
|
|
|
+ };
|
|
|
+ })
|
|
|
+ };
|
|
|
+
|
|
|
+ // 对原始数据进行深拷贝,以避免修改原始数据
|
|
|
+ const arr = JSON.parse(JSON.stringify(newData));
|
|
|
+
|
|
|
+ // 遍历 outInDetailUpdatePOList 数组
|
|
|
+ arr.outInDetailUpdatePOList.forEach((detail) => {
|
|
|
+ // 遍历 outInDetailRecordUpdatePOList 数组
|
|
|
+ detail.outInDetailRecordUpdatePOList.forEach((record) => {
|
|
|
+ // 筛选出与 code 相等的 materialDetails 项
|
|
|
+ const matchedDetails = record.materialDetails.filter(
|
|
|
+ (item) => item.onlyCode === record.code
|
|
|
+ );
|
|
|
+ // 将匹配项放入 materialDetails 数组中
|
|
|
+ record.materialDetails = matchedDetails;
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
packNum(row, value) {
|
|
|
console.log(row);
|
|
|
const total = {
|
|
|
@@ -784,15 +1050,24 @@
|
|
|
},
|
|
|
listEdit(row) {
|
|
|
this.$set(row, 'isSave', false);
|
|
|
+ //包装
|
|
|
const list = this.detailList;
|
|
|
- for (const key in list) {
|
|
|
- if (
|
|
|
- list[key].outInDetailId == row.id &&
|
|
|
- list[key].categoryCode == row.categoryCode &&
|
|
|
- list[key].batchNo == row.batchNo
|
|
|
- ) {
|
|
|
- // this.detailList = [];
|
|
|
- console.log(list[key]);
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].categoryCode === row.categoryCode) {
|
|
|
+ // 删除满足条件的对象
|
|
|
+ this.detailList.splice(i, 1);
|
|
|
+ // 因为删除了一个对象,需要将索引减1
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //物料
|
|
|
+ const lists = this.metailList;
|
|
|
+ for (let i = 0; i < lists.length; i++) {
|
|
|
+ if (lists[i].assetCode === row.categoryCode) {
|
|
|
+ // 删除满足条件的对象
|
|
|
+ this.metailList.splice(i, 1);
|
|
|
+ // 因为删除了一个对象,需要将索引减1
|
|
|
+ i--;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -850,6 +1125,7 @@
|
|
|
});
|
|
|
},
|
|
|
async createMaterialCode(row) {
|
|
|
+ console.log('==--', row);
|
|
|
const {
|
|
|
packingCount,
|
|
|
minPackingCount,
|
|
|
@@ -865,9 +1141,8 @@
|
|
|
// }
|
|
|
const codes = outInDetailRecordVOList[0].code;
|
|
|
const index = outInDetailRecordVOList[0].code.indexOf('636');
|
|
|
- const result = parseInt(codes.substring(index + 3, index + 6));
|
|
|
+ const result = codes.slice(-3);
|
|
|
const dataArray = [];
|
|
|
- console.log('家变', row);
|
|
|
for (let i = 0; i < packingCount; i++) {
|
|
|
const newData = { ...row };
|
|
|
if (outInDetailRecordVOList.length != packingCount) {
|
|
|
@@ -886,13 +1161,104 @@
|
|
|
dataArray.push(newData);
|
|
|
}
|
|
|
for (let j = 0; j < dataArray.length; j++) {
|
|
|
+ const num = Number(result);
|
|
|
+ const nums = num + j;
|
|
|
+ const str = nums.toString().padStart(result.length, '0');
|
|
|
dataArray[j].code =
|
|
|
- dataArray[j].categoryCode + dataArray[j].batchNo + 0 + (result + j);
|
|
|
+ dataArray[j].categoryCode + dataArray[j].batchNo + str;
|
|
|
+ dataArray[j].isPack = true;
|
|
|
}
|
|
|
+ const list = JSON.parse(localStorage.getItem('exitList'));
|
|
|
|
|
|
- this.detailList = dataArray;
|
|
|
+ dataArray.forEach((ele, index) => {
|
|
|
+ if (index < list.length) {
|
|
|
+ if (ele.code === list[index].code) {
|
|
|
+ ele.id = list[index].id;
|
|
|
+ } else {
|
|
|
+ ele.isPack = false;
|
|
|
+ ele.id = ''; // 当 code 不匹配时,将 id 设为空字符串
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ele.isPack = false;
|
|
|
+ ele.id = ''; // 如果 index 超出了 list 的范围,将 id 设为空字符串
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.detailList = this.pacKUpdate(dataArray);
|
|
|
+ this.metailList = this.metailUpdate(dataArray);
|
|
|
+ // this.metailList = this.metaAdd(dataArray);
|
|
|
console.log('====>>>>>1', dataArray);
|
|
|
},
|
|
|
+ //包装修改
|
|
|
+ pacKUpdate(arr) {
|
|
|
+ for (const it of arr) {
|
|
|
+ for (const ti of it.outInDetailRecordVOList) {
|
|
|
+ if (ti.id == it.id) {
|
|
|
+ it.materielCode = ti.materielCode;
|
|
|
+ it.clientCode = ti.clientCode;
|
|
|
+ it.result = ti.result;
|
|
|
+ it.status = ti.status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ //物料新增
|
|
|
+ metaAdd(arr) {
|
|
|
+ const list = arr;
|
|
|
+ let resultArray = [];
|
|
|
+ list.forEach((item) => {
|
|
|
+ for (let i = 1; i <= Number(item.minPackingCount); i++) {
|
|
|
+ resultArray.push({
|
|
|
+ onlyCode: item.code,
|
|
|
+ no: item.code + i.toString().padStart(4, '0'),
|
|
|
+ assetCode: item.categoryCode,
|
|
|
+ assetName: item.name,
|
|
|
+ batchNo: item.batchNo,
|
|
|
+ minPackingCount: 1,
|
|
|
+ measuringUnit: item.measuringUnit,
|
|
|
+ materielCode: item.materielCode,
|
|
|
+ clientCode: item.clientCode,
|
|
|
+ weight: item.weight / Number(item.minPackingCount),
|
|
|
+ weightUnit: item.weightUnit,
|
|
|
+ engrave: item.engrave,
|
|
|
+ result: item.result,
|
|
|
+ status: item.status
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return resultArray;
|
|
|
+ // console.log('物料', resultArray);
|
|
|
+ },
|
|
|
+ //物料修改
|
|
|
+ metailUpdate(arr) {
|
|
|
+ console.log('---', arr);
|
|
|
+
|
|
|
+ const extractedArray = [];
|
|
|
+
|
|
|
+ arr.forEach((item) => {
|
|
|
+ item.outInDetailRecordVOList.forEach((record) => {
|
|
|
+ extractedArray.push(
|
|
|
+ ...record.outInDetailRecordMaterialDetailVOList
|
|
|
+ );
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 用于存储已经遇到的ID
|
|
|
+ let idMap = {};
|
|
|
+ // 用于存储结果的数组
|
|
|
+ let uniqueArray = [];
|
|
|
+ // 遍历原始数据
|
|
|
+ for (let i = 0; i < extractedArray.length; i++) {
|
|
|
+ let currentItem = extractedArray[i];
|
|
|
+ // 检查当前ID是否已经在map中存在
|
|
|
+ if (!idMap[currentItem.id]) {
|
|
|
+ // 如果ID不存在,将当前ID添加到map中,并将当前数据添加到结果数组中
|
|
|
+ idMap[currentItem.id] = true;
|
|
|
+ uniqueArray.push(currentItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return uniqueArray;
|
|
|
+ },
|
|
|
//计算金额
|
|
|
calcSumTotal(PackingCount, outInNum, univalence) {
|
|
|
//最小包装单元,包装数量,单价
|
|
|
@@ -953,8 +1319,12 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ this.exitList = arr;
|
|
|
+ localStorage.setItem('exitList', JSON.stringify(arr));
|
|
|
this.dateTypes = arr[0].dateType;
|
|
|
- this.detailList = arr;
|
|
|
+ this.detailList = arr.map((item) => {
|
|
|
+ return { ...item, isPack: true };
|
|
|
+ });
|
|
|
let iArr = [];
|
|
|
arr.forEach((item) => {
|
|
|
item.outInDetailRecordMaterialDetailVOList.forEach((ele) => {
|