|
@@ -358,7 +358,7 @@
|
|
|
<el-table
|
|
<el-table
|
|
|
v-if="isWeight"
|
|
v-if="isWeight"
|
|
|
:header-cell-style="rowClass"
|
|
:header-cell-style="rowClass"
|
|
|
- ref="multipleTable"
|
|
|
|
|
|
|
+ ref="warehousingMaterialListTable"
|
|
|
:key="formData.extInfo.assetType"
|
|
:key="formData.extInfo.assetType"
|
|
|
:data="warehousingMaterialList"
|
|
:data="warehousingMaterialList"
|
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
@@ -480,13 +480,7 @@
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="row.minPackingCount"
|
|
v-model="row.minPackingCount"
|
|
|
- @input="
|
|
|
|
|
- (value) =>
|
|
|
|
|
- (row.minPackingCount = value.replace(
|
|
|
|
|
- /^(0+)|[^\d]+/g,
|
|
|
|
|
- ''
|
|
|
|
|
- ))
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ @input="minPackingCountChange(row, $event)"
|
|
|
>
|
|
>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -707,6 +701,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else>
|
|
<div v-else>
|
|
|
<div
|
|
<div
|
|
|
|
|
+ class="fontOmitted"
|
|
|
v-for="(item, index) in row.houseList"
|
|
v-for="(item, index) in row.houseList"
|
|
|
:key="index"
|
|
:key="index"
|
|
|
>
|
|
>
|
|
@@ -800,7 +795,7 @@
|
|
|
</header-title>
|
|
</header-title>
|
|
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
|
- ref="multipleTable"
|
|
|
|
|
|
|
+ ref="materialCodeReqListTable"
|
|
|
:data="materialCodeReqList"
|
|
:data="materialCodeReqList"
|
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
|
:key="formData.bizType"
|
|
:key="formData.bizType"
|
|
@@ -824,11 +819,13 @@
|
|
|
label="编码"
|
|
label="编码"
|
|
|
prop="assetCode"
|
|
prop="assetCode"
|
|
|
width="130"
|
|
width="130"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="名称"
|
|
label="名称"
|
|
|
prop="assetName"
|
|
prop="assetName"
|
|
|
width="150"
|
|
width="150"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="批次号"
|
|
label="批次号"
|
|
@@ -839,6 +836,7 @@
|
|
|
:label="`包装编码`"
|
|
:label="`包装编码`"
|
|
|
prop="onlyCode"
|
|
prop="onlyCode"
|
|
|
width="130"
|
|
width="130"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="包装数量"
|
|
label="包装数量"
|
|
@@ -925,29 +923,16 @@
|
|
|
clearable
|
|
clearable
|
|
|
v-model="row.result"
|
|
v-model="row.result"
|
|
|
v-if="!row.isPack"
|
|
v-if="!row.isPack"
|
|
|
- @itemChange="packItem($event, row)"
|
|
|
|
|
|
|
+ @updateVal="changeWrapStatus($event, row)"
|
|
|
/>
|
|
/>
|
|
|
- <span v-else>
|
|
|
|
|
- <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>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="质检状态" prop="status" width="120">
|
|
<el-table-column label="质检状态" prop="status" width="120">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <DictSelection
|
|
|
|
|
- dictName="质检状态"
|
|
|
|
|
- clearable
|
|
|
|
|
- v-model="row.status"
|
|
|
|
|
- v-if="!row.isPack"
|
|
|
|
|
- />
|
|
|
|
|
- <span v-else>
|
|
|
|
|
- <span v-if="row.status == 0">未检</span>
|
|
|
|
|
- <span v-if="row.status == 1">已检</span>
|
|
|
|
|
- <span v-if="row.status == null"></span>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ // <DictSelection // dictName="质检状态" // clearable //
|
|
|
|
|
+ v-model="row.status" // v-if="!row.isPack" // />
|
|
|
|
|
+ <span>{{ qualityStatus[row.status] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
@@ -997,7 +982,7 @@
|
|
|
width="200"
|
|
width="200"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
</template>
|
|
</template>
|
|
|
- <el-table-column label="操作" width="80">
|
|
|
|
|
|
|
+ <el-table-column label="操作" width="80" fixed="right">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-button type="text" @click="packCout(row)">
|
|
<el-button type="text" @click="packCout(row)">
|
|
|
{{ !row.isPack ? '保存' : '编辑' }}
|
|
{{ !row.isPack ? '保存' : '编辑' }}
|
|
@@ -1011,7 +996,7 @@
|
|
|
<div class="mt20" v-if="isDetail">
|
|
<div class="mt20" v-if="isDetail">
|
|
|
<header-title :title="`物料明细`"> </header-title>
|
|
<header-title :title="`物料明细`"> </header-title>
|
|
|
<el-table
|
|
<el-table
|
|
|
- ref="multipleTable"
|
|
|
|
|
|
|
+ ref="resultArrayTable"
|
|
|
:data="resultArray"
|
|
:data="resultArray"
|
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
|
:key="formData.bizType"
|
|
:key="formData.bizType"
|
|
@@ -1023,11 +1008,16 @@
|
|
|
>
|
|
>
|
|
|
<el-table-column label="序号" type="index" width="50">
|
|
<el-table-column label="序号" type="index" width="50">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="编码" prop="assetCode"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="编码"
|
|
|
|
|
+ prop="assetCode"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="名称"
|
|
label="名称"
|
|
|
prop="assetName"
|
|
prop="assetName"
|
|
|
width="200"
|
|
width="200"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="批次号"
|
|
label="批次号"
|
|
@@ -1038,6 +1028,7 @@
|
|
|
label="物料编码"
|
|
label="物料编码"
|
|
|
prop="no"
|
|
prop="no"
|
|
|
width="200"
|
|
width="200"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="计量数量"
|
|
label="计量数量"
|
|
@@ -1057,7 +1048,7 @@
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="row.materielCode"
|
|
v-model="row.materielCode"
|
|
|
- v-if="!row.isMeta"
|
|
|
|
|
|
|
+ v-if="!row.isPack"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
<span v-else>{{ row.materialCode }}</span>
|
|
<span v-else>{{ row.materialCode }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -1070,7 +1061,7 @@
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="row.clientCode"
|
|
v-model="row.clientCode"
|
|
|
- v-if="!row.isMeta"
|
|
|
|
|
|
|
+ v-if="!row.isPack"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
<span v-else> {{ row.clientCode }}</span>
|
|
<span v-else> {{ row.clientCode }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -1081,7 +1072,7 @@
|
|
|
prop="engrave"
|
|
prop="engrave"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.engrave" v-if="!row.isMeta"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="row.engrave" v-if="!row.isPack"></el-input>
|
|
|
<span v-else> {{ row.engrave }}</span>
|
|
<span v-else> {{ row.engrave }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -1092,7 +1083,7 @@
|
|
|
prop="weight"
|
|
prop="weight"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.weight" v-if="!row.isMeta"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="row.weight" v-if="!row.isPack"></el-input>
|
|
|
<span v-else>{{ row.weight }}</span>
|
|
<span v-else>{{ row.weight }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -1100,10 +1091,8 @@
|
|
|
v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
label="重量单位"
|
|
label="重量单位"
|
|
|
prop="weightUnit"
|
|
prop="weightUnit"
|
|
|
|
|
+ width="100"
|
|
|
>
|
|
>
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- {{ row.weightUnit }}
|
|
|
|
|
- </template>
|
|
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="质检结果" prop="result" width="120">
|
|
<el-table-column label="质检结果" prop="result" width="120">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
@@ -1111,36 +1100,21 @@
|
|
|
dictName="质检结果"
|
|
dictName="质检结果"
|
|
|
clearable
|
|
clearable
|
|
|
v-model="row.result"
|
|
v-model="row.result"
|
|
|
- v-if="!row.isMeta"
|
|
|
|
|
- @itemChange="packItem($event, row)"
|
|
|
|
|
|
|
+ v-if="!row.isPack"
|
|
|
|
|
+ @updateVal="changeWrapStatus($event, row)"
|
|
|
/>
|
|
/>
|
|
|
- <span v-else>
|
|
|
|
|
- <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>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="质检状态" prop="status" width="120">
|
|
<el-table-column label="质检状态" prop="status" width="120">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <DictSelection
|
|
|
|
|
- dictName="质检状态"
|
|
|
|
|
- clearable
|
|
|
|
|
- v-model="row.status"
|
|
|
|
|
- v-if="!row.isMeta"
|
|
|
|
|
- />
|
|
|
|
|
- <span v-else>
|
|
|
|
|
- <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>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="80">
|
|
<el-table-column label="操作" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <el-button type="text" @click="packMeta(row)">
|
|
|
|
|
- {{ !row.isMeta ? '保存' : '编辑' }}
|
|
|
|
|
|
|
+ <el-button type="text" @click="materialBtn(row)">
|
|
|
|
|
+ {{ !row.isPack ? '保存' : '编辑' }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -1242,6 +1216,18 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ showMaterialTable: true, // 缓存包装明细列表
|
|
|
|
|
+ isSplit: false, // 是否拆分到物料明细
|
|
|
|
|
+ qualityStatus: {
|
|
|
|
|
+ 0: '未检',
|
|
|
|
|
+ 1: '已检',
|
|
|
|
|
+ 2: '部分检'
|
|
|
|
|
+ }, // 质检状态 0未检 1已检
|
|
|
|
|
+ qualityResults: {
|
|
|
|
|
+ 0: '合格',
|
|
|
|
|
+ 1: '不合格',
|
|
|
|
|
+ 3: '让步接收'
|
|
|
|
|
+ }, // 质检结果 0合格 1不合格 3让步接收
|
|
|
isTask: false,
|
|
isTask: false,
|
|
|
isWeight: true,
|
|
isWeight: true,
|
|
|
resultArray: [],
|
|
resultArray: [],
|
|
@@ -1335,9 +1321,25 @@
|
|
|
this.initData();
|
|
this.initData();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- //包装结果
|
|
|
|
|
- packItem(val, row) {
|
|
|
|
|
- row.status = '1';
|
|
|
|
|
|
|
+ // 包装维度最小包装单元改变——>总重量
|
|
|
|
|
+ minPackingCountChange(row, value) {
|
|
|
|
|
+ row.minPackingCount = value.replace(/^(0+)|[^\d]+/g, '');
|
|
|
|
|
+ if (row.outInNum >= 0 && value >= 0) {
|
|
|
|
|
+ this.packNum(row, row.outInNum);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 选择质检结果改变质检状态
|
|
|
|
|
+ changeWrapStatus(resultValue, row) {
|
|
|
|
|
+ switch (resultValue) {
|
|
|
|
|
+ case '':
|
|
|
|
|
+ // 清空质检状态
|
|
|
|
|
+ row.status = '0';
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ // 默认已检质检状态
|
|
|
|
|
+ row.status = '1';
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
cancel() {
|
|
cancel() {
|
|
|
this.$emit('cancel');
|
|
this.$emit('cancel');
|
|
@@ -1358,10 +1360,14 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleIsDetail(event) {
|
|
handleIsDetail(event) {
|
|
|
|
|
+ this.isSplit = event;
|
|
|
|
|
+ const list = this.materialCodeReqList;
|
|
|
if (event) {
|
|
if (event) {
|
|
|
- const list = this.materialCodeReqList;
|
|
|
|
|
let resultArray = [];
|
|
let resultArray = [];
|
|
|
list.forEach((item) => {
|
|
list.forEach((item) => {
|
|
|
|
|
+ // 包装维度改成已保存状态
|
|
|
|
|
+ item.isPack = true;
|
|
|
|
|
+ // 拆分物料维度并生成列表
|
|
|
for (let i = 1; i <= Number(item.minPackingCount); i++) {
|
|
for (let i = 1; i <= Number(item.minPackingCount); i++) {
|
|
|
resultArray.push({
|
|
resultArray.push({
|
|
|
onlyCode: item.onlyCode,
|
|
onlyCode: item.onlyCode,
|
|
@@ -1378,21 +1384,28 @@
|
|
|
engrave: item.engrave,
|
|
engrave: item.engrave,
|
|
|
result: item.result,
|
|
result: item.result,
|
|
|
status: item.status,
|
|
status: item.status,
|
|
|
- isMeta: false
|
|
|
|
|
|
|
+ isPack: false
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
this.resultArray = resultArray;
|
|
this.resultArray = resultArray;
|
|
|
|
|
+ // 批量修改包装明细
|
|
|
|
|
+ this.isWeight = false;
|
|
|
|
|
+ this.bulkEditingWrap();
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.isWeight = true;
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ // 包装维度改成编辑状态
|
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
|
+ item.isPack = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ // 清空物料维度列表
|
|
|
this.resultArray = [];
|
|
this.resultArray = [];
|
|
|
}
|
|
}
|
|
|
- console.log('this.resultArray', this.resultArray);
|
|
|
|
|
},
|
|
},
|
|
|
//包装明细保存
|
|
//包装明细保存
|
|
|
- packMeta(row) {
|
|
|
|
|
- console.log(row);
|
|
|
|
|
- row.isMeta = !row.isMeta;
|
|
|
|
|
- },
|
|
|
|
|
packCout(row) {
|
|
packCout(row) {
|
|
|
//true保存==》反之
|
|
//true保存==》反之
|
|
|
if (!row.isPack) {
|
|
if (!row.isPack) {
|
|
@@ -1407,7 +1420,7 @@
|
|
|
// (acc, curr) => acc + curr.weight,
|
|
// (acc, curr) => acc + curr.weight,
|
|
|
// 0
|
|
// 0
|
|
|
// );
|
|
// );
|
|
|
-
|
|
|
|
|
|
|
+ // 修改产品信息重量(包装维度累计)
|
|
|
this.isWeight = false;
|
|
this.isWeight = false;
|
|
|
this.warehousingMaterialList.forEach((item) => {
|
|
this.warehousingMaterialList.forEach((item) => {
|
|
|
if (item.assetCode == code && item.batchNo == batchNo) {
|
|
if (item.assetCode == code && item.batchNo == batchNo) {
|
|
@@ -1420,7 +1433,11 @@
|
|
|
arr.push({ ...this.materialCodeReqList[key] });
|
|
arr.push({ ...this.materialCodeReqList[key] });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- const count = arr.reduce((acc, curr) => acc + curr.weight, 0);
|
|
|
|
|
|
|
+ const count = arr.reduce(
|
|
|
|
|
+ (acc, curr) =>
|
|
|
|
|
+ Number(this.$math.format(+acc + +curr.weight, 14)),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
this.$set(item, 'weight', count);
|
|
this.$set(item, 'weight', count);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1434,16 +1451,163 @@
|
|
|
|
|
|
|
|
// }, 100);
|
|
// }, 100);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 批量修改包装明细
|
|
|
|
|
+ bulkEditingWrap() {
|
|
|
|
|
+ // 批量修改包装明细列表状态(已保存)
|
|
|
|
|
+ this.materialCodeReqList.forEach((item) => {
|
|
|
|
|
+ item.isPack = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ // 改变产品明细重量
|
|
|
|
|
+ this.warehousingMaterialList.forEach((outItem) => {
|
|
|
|
|
+ let arr = [];
|
|
|
|
|
+ this.materialCodeReqList.forEach((inneritem) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ inneritem.assetCode == outItem.assetCode &&
|
|
|
|
|
+ inneritem.batchNo == outItem.batchNo
|
|
|
|
|
+ ) {
|
|
|
|
|
+ arr.push(inneritem);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ const count = arr.reduce(
|
|
|
|
|
+ (acc, curr) => Number(this.$math.format(+acc + +curr.weight, 14)),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(outItem, 'weight', count);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 批量修改物料明细
|
|
|
|
|
+ bulkEditingMaterial() {
|
|
|
|
|
+ // 批量修改物料明细列表状态(已保存)
|
|
|
|
|
+ this.resultArray.forEach((item) => {
|
|
|
|
|
+ item.isPack = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ // 改变包装明细重量
|
|
|
|
|
+ this.materialCodeReqList.forEach((outItem) => {
|
|
|
|
|
+ let arr = [];
|
|
|
|
|
+ this.resultArray.forEach((inneritem) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ inneritem.assetCode == outItem.assetCode &&
|
|
|
|
|
+ inneritem.batchNo == outItem.batchNo
|
|
|
|
|
+ ) {
|
|
|
|
|
+ arr.push(inneritem);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ const count = arr.reduce(
|
|
|
|
|
+ (acc, curr) => Number(this.$math.format(+acc + +curr.weight, 14)),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(outItem, 'weight', count);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 物料明细保存
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
packNum(row, value) {
|
|
packNum(row, value) {
|
|
|
const total = {
|
|
const total = {
|
|
|
packingCount: Number(row.minPackingCount),
|
|
packingCount: Number(row.minPackingCount),
|
|
|
outInNum: Number(row.outInNum)
|
|
outInNum: Number(row.outInNum)
|
|
|
};
|
|
};
|
|
|
if (row.measuringUnit == row.weightUnit) {
|
|
if (row.measuringUnit == row.weightUnit) {
|
|
|
- row.weight = total.packingCount * 1 * total.outInNum.toFixed(2);
|
|
|
|
|
|
|
+ row.weight = Number(
|
|
|
|
|
+ this.$math.format(
|
|
|
|
|
+ total.packingCount * 1 * total.outInNum.toFixed(2),
|
|
|
|
|
+ 14
|
|
|
|
|
+ )
|
|
|
|
|
+ );
|
|
|
} else {
|
|
} else {
|
|
|
- const totals = total.packingCount * total.outInNum;
|
|
|
|
|
- row.weight = totals * row.netWeight.toFixed(2);
|
|
|
|
|
|
|
+ const totals = Number(
|
|
|
|
|
+ this.$math.format(total.packingCount * total.outInNum, 14)
|
|
|
|
|
+ );
|
|
|
|
|
+ row.weight = Number(
|
|
|
|
|
+ this.$math.format(totals * row.netWeight.toFixed(2), 14)
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
|
|
return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
|
|
|
},
|
|
},
|
|
@@ -2267,6 +2431,35 @@
|
|
|
houseData(argum, idx) {
|
|
houseData(argum, idx) {
|
|
|
this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
|
|
this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ // 解决右侧悬浮操作栏不对称问题
|
|
|
|
|
+ warehousingMaterialList: {
|
|
|
|
|
+ handler() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.warehousingMaterialListTable.doLayout();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ deep: true
|
|
|
|
|
+ },
|
|
|
|
|
+ // 解决右侧悬浮操作栏不对称问题
|
|
|
|
|
+ materialCodeReqList: {
|
|
|
|
|
+ handler() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.materialCodeReqListTable.doLayout();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ deep: true
|
|
|
|
|
+ },
|
|
|
|
|
+ // 解决右侧悬浮操作栏不对称问题
|
|
|
|
|
+ resultArray: {
|
|
|
|
|
+ handler() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.resultArrayTable.doLayout();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ deep: true
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -2321,4 +2514,22 @@
|
|
|
border-right: 1px solid rgba(222, 222, 222, 1);
|
|
border-right: 1px solid rgba(222, 222, 222, 1);
|
|
|
border-left: 1px solid rgba(222, 222, 222, 1);
|
|
border-left: 1px solid rgba(222, 222, 222, 1);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .fontOmitted {
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+ .table-fixed {
|
|
|
|
|
+ .el-table__fixed-right {
|
|
|
|
|
+ height: 100% !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-table__fixed-left {
|
|
|
|
|
+ height: 100% !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-table__fixed {
|
|
|
|
|
+ height: 100% !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|