|
|
@@ -6,7 +6,7 @@
|
|
|
ref="table"
|
|
|
row-key="id"
|
|
|
:columns="materialColumns"
|
|
|
- :datasource="materialList"
|
|
|
+ :datasource="localPickDetails"
|
|
|
cache-key="prenatal-examination-material-list-table-2511031522"
|
|
|
autoAmendPage
|
|
|
:needPage="false"
|
|
|
@@ -18,12 +18,52 @@
|
|
|
>
|
|
|
</template>
|
|
|
|
|
|
+ <template v-if="outputType == 1" v-slot:selectColumnHeader>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="selectedAll"
|
|
|
+ @change="selectedAllChange"
|
|
|
+ :indeterminate="isIndeterminate"
|
|
|
+ ></el-checkbox>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-slot:selectColumn="{ row }">
|
|
|
<el-checkbox
|
|
|
v-model="row.selected"
|
|
|
@change="selectedChange(row)"
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template v-slot:feedQuantityHeader>
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ content="数量是指存在多次投料时,本道工序在本次记录表报工时的累计当时投料数量;"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <span>数量</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="margin-left: 4px; color: #909399"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:sumConsumeQuantityHeader>
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ content="累计消耗数量是指存在多次记录表报工时,本次记录表报工时的累计实时消耗数量;"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <span>累计消耗数量</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="margin-left: 4px; color: #909399"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
<header-title title="产出清单" style="margin-top: 20px"></header-title>
|
|
|
@@ -80,6 +120,54 @@
|
|
|
@change="$emit('update:outputDetails', localOutputDetails)"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template v-slot:sumReportQuantityHeader>
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ content="已报工数量是指存在多次记录表报工时,多次报工数量的累计实时已报工数量;"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <span>已报工数量</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="margin-left: 4px; color: #909399"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:sumQualifiedQuantityHeader>
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ content="合格品数量是指存在多次记录表报工时,多次报工数量的累计实时合格品数量;"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <span>合格总数</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="margin-left: 4px; color: #909399"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:sumNoQualifiedQuantityHeader>
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ content="不合格品数量是指存在多次记录表报工时,多次报工数量的累计实时不合格品数量;"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <span>不合格总数</span>
|
|
|
+ <i
|
|
|
+ class="el-icon-info"
|
|
|
+ style="margin-left: 4px; color: #909399"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
<materialModal ref="materialModalRef" @confirm="materialConfirm" />
|
|
|
@@ -244,13 +332,23 @@
|
|
|
this.getCategoryAndLevelByCategoryId();
|
|
|
},
|
|
|
immediate: true
|
|
|
+ },
|
|
|
+ localPickDetails: {
|
|
|
+ handler(newVal) {
|
|
|
+ // 如果全选则更新 selectdAll
|
|
|
+ if (
|
|
|
+ newVal.length > 0 &&
|
|
|
+ newVal.every((item) => item.selected === true)
|
|
|
+ ) {
|
|
|
+ this.selectedAll = true;
|
|
|
+ } else {
|
|
|
+ this.selectedAll = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- // 物料清单(包含上到工序产出明细)
|
|
|
- materialList() {
|
|
|
- return [...this.preOutputDetails, ...this.localPickDetails];
|
|
|
- },
|
|
|
// 物料清单表头
|
|
|
materialColumns() {
|
|
|
const list = [
|
|
|
@@ -304,7 +402,8 @@
|
|
|
minWidth: 120,
|
|
|
formatter: (row) => {
|
|
|
return (row.quantity || 0) + (row.unit || '');
|
|
|
- }
|
|
|
+ },
|
|
|
+ headerSlot: 'feedQuantityHeader'
|
|
|
},
|
|
|
{
|
|
|
label: '当次消耗数量',
|
|
|
@@ -317,10 +416,12 @@
|
|
|
const outputItem = this.localOutputDetails.find(
|
|
|
(item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
- return (
|
|
|
- (outputItem ? outputItem.reportQuantity : 0) +
|
|
|
- (row.unit || '')
|
|
|
- );
|
|
|
+
|
|
|
+ if (outputItem) {
|
|
|
+ return outputItem.reportQuantity + (row.unit || '');
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0 + (row.unit || '');
|
|
|
} else {
|
|
|
// 产出为在制品 或 BOM标准产出
|
|
|
// 查询基数
|
|
|
@@ -352,7 +453,9 @@
|
|
|
return '0' + (row.unit || '');
|
|
|
}
|
|
|
// 当次消耗
|
|
|
- let needQuantity = outputItem.reportQuantity * count;
|
|
|
+ let needQuantity = this.formatNumber(
|
|
|
+ outputItem.reportQuantity * count
|
|
|
+ );
|
|
|
return needQuantity + (row.unit || '');
|
|
|
}
|
|
|
}
|
|
|
@@ -389,7 +492,9 @@
|
|
|
this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -400,7 +505,9 @@
|
|
|
item.categoryCode === this.categoryInfo.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -479,7 +586,9 @@
|
|
|
this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
// 在制品
|
|
|
@@ -492,7 +601,9 @@
|
|
|
item.categoryCode === this.categoryInfo.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -508,17 +619,19 @@
|
|
|
cumulativeOutputQuantity =
|
|
|
outputItem.sumReportQuantity + outputItem.reportQuantity;
|
|
|
}
|
|
|
- const needQuantity = cumulativeOutputQuantity * proportion;
|
|
|
+ const needQuantity = this.formatNumber(
|
|
|
+ cumulativeOutputQuantity * proportion
|
|
|
+ );
|
|
|
|
|
|
// 已消耗数量转换
|
|
|
- // const sumReportQuantity = row.sumReportQuantity * proportion;
|
|
|
const sumReportQuantity = row.sumReportQuantity;
|
|
|
|
|
|
return (
|
|
|
needQuantity + preCount + sumReportQuantity + (row.unit || '')
|
|
|
);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ headerSlot: 'sumConsumeQuantityHeader'
|
|
|
}
|
|
|
];
|
|
|
if (this.outputType == 1) {
|
|
|
@@ -527,23 +640,15 @@
|
|
|
label: '选择',
|
|
|
slot: 'selectColumn',
|
|
|
align: 'center',
|
|
|
- fixed: 'right'
|
|
|
+ fixed: 'right',
|
|
|
+ headerSlot: 'selectColumnHeader'
|
|
|
});
|
|
|
}
|
|
|
return list;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- data() {
|
|
|
- return {
|
|
|
- localPickDetails: [],
|
|
|
- localOutputDetails: [],
|
|
|
- // bom配置的 标准产出信息
|
|
|
- materialQuotaInfo: null,
|
|
|
- // 在制品信息
|
|
|
- categoryInfo: null,
|
|
|
- // 产出清单表头
|
|
|
- outputDetailsColumns: [
|
|
|
+ },
|
|
|
+ // 产出清单表头
|
|
|
+ outputDetailsColumns() {
|
|
|
+ return [
|
|
|
{
|
|
|
width: 45,
|
|
|
type: 'index',
|
|
|
@@ -616,27 +721,105 @@
|
|
|
label: '已报工数量',
|
|
|
prop: 'sumReportQuantity',
|
|
|
minWidth: 120,
|
|
|
- formatter(row) {
|
|
|
- return (row.sumReportQuantity || 0) + row.unit;
|
|
|
- }
|
|
|
+ formatter: (row) => {
|
|
|
+ let count = row.sumReportQuantity || 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ count += row.reportQuantity - row.reportQuantityCopy;
|
|
|
+ } else {
|
|
|
+ count += row.reportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ return count + (row.unit || '');
|
|
|
+ },
|
|
|
+ headerSlot: 'sumReportQuantityHeader'
|
|
|
},
|
|
|
{
|
|
|
label: '合格总数',
|
|
|
prop: 'sumQualifiedQuantity',
|
|
|
minWidth: 120,
|
|
|
- formatter(row) {
|
|
|
- return (row.sumQualifiedQuantity || 0) + (row.unit || '');
|
|
|
- }
|
|
|
+ formatter: (row) => {
|
|
|
+ // 已报工数量
|
|
|
+ let sumReportQuantity = row.sumReportQuantity || 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ sumReportQuantity +=
|
|
|
+ row.reportQuantity - row.reportQuantityCopy;
|
|
|
+ } else {
|
|
|
+ sumReportQuantity += row.reportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ let count = row.sumQualifiedQuantity || 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumQualifiedQuantity包含了当前报工数量
|
|
|
+ count += row.qualifiedQuantity - row.qualifiedQuantityCopy;
|
|
|
+ } else {
|
|
|
+ count += row.qualifiedQuantity;
|
|
|
+ }
|
|
|
+ // 处理缓存后,物料被其他工单报工超出已报工数量问题
|
|
|
+ if (count > sumReportQuantity) {
|
|
|
+ count = sumReportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ return count + (row.unit || '');
|
|
|
+ },
|
|
|
+ headerSlot: 'sumQualifiedQuantityHeader'
|
|
|
},
|
|
|
{
|
|
|
label: '不合格总数',
|
|
|
prop: 'sumNoQualifiedQuantity',
|
|
|
minWidth: 120,
|
|
|
- formatter(row) {
|
|
|
- return (row.sumNoQualifiedQuantity || 0) + (row.unit || '');
|
|
|
- }
|
|
|
+ formatter: (row) => {
|
|
|
+ // 已报工数量
|
|
|
+ let sumReportQuantity = row.sumReportQuantity || 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
+ sumReportQuantity +=
|
|
|
+ row.reportQuantity - row.reportQuantityCopy;
|
|
|
+ } else {
|
|
|
+ sumReportQuantity += row.reportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ let count = row.sumNoQualifiedQuantity || 0;
|
|
|
+
|
|
|
+ if (this.executeStatus === 2) {
|
|
|
+ // 已执行,处理重新一键报工时,sumNoQualifiedQuantity包含了当前报工数量
|
|
|
+ count += row.noQualifiedQuantity - row.noQualifiedQuantityCopy;
|
|
|
+ } else {
|
|
|
+ count += row.noQualifiedQuantity;
|
|
|
+ }
|
|
|
+ // 处理缓存后,物料被其他工单报工超出已报工数量问题
|
|
|
+ if (count > sumReportQuantity) {
|
|
|
+ count = sumReportQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ return count + (row.unit || '');
|
|
|
+ },
|
|
|
+ headerSlot: 'sumNoQualifiedQuantityHeader'
|
|
|
}
|
|
|
- ]
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ isIndeterminate() {
|
|
|
+ return (
|
|
|
+ this.localPickDetails.some((item) => item.selected) &&
|
|
|
+ !this.selectedAll
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ localPickDetails: [],
|
|
|
+ localOutputDetails: [],
|
|
|
+ // bom配置的 标准产出信息
|
|
|
+ materialQuotaInfo: null,
|
|
|
+ // 在制品信息
|
|
|
+ categoryInfo: null,
|
|
|
+ selectedAll: false
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -648,7 +831,6 @@
|
|
|
ruleId: this.ruleId,
|
|
|
produceTaskId: this.produceTaskId
|
|
|
},
|
|
|
- // ...this.localPickDetails, ...this.preOutputDetails
|
|
|
[]
|
|
|
);
|
|
|
},
|
|
|
@@ -681,6 +863,8 @@
|
|
|
// 不存在则添加
|
|
|
this.localPickDetails.push({
|
|
|
...newItem,
|
|
|
+ // 物料的类型
|
|
|
+ outputType: 1,
|
|
|
reportQuantity: 0,
|
|
|
ruleId: this.ruleId,
|
|
|
bomCategoryId: this.bomCategoryId,
|
|
|
@@ -690,7 +874,8 @@
|
|
|
workOrderId: this.workOrderId,
|
|
|
sumQualifiedQuantity,
|
|
|
sumNoQualifiedQuantity,
|
|
|
- sumReportQuantity
|
|
|
+ sumReportQuantity,
|
|
|
+ selected: false
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -775,6 +960,7 @@
|
|
|
noQualifiedQuantityMax(row) {
|
|
|
return row.reportQuantity;
|
|
|
},
|
|
|
+ // 单选
|
|
|
selectedChange(row) {
|
|
|
console.log('row', row);
|
|
|
if (this.outputType != 1) return;
|
|
|
@@ -829,9 +1015,25 @@
|
|
|
(item) => !(item.categoryId === row.categoryId)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
console.log('this.localOutputDetails', this.localOutputDetails);
|
|
|
+
|
|
|
this.$emit('update:outputDetails', this.localOutputDetails);
|
|
|
},
|
|
|
+ // 全选
|
|
|
+ selectedAllChange() {
|
|
|
+ this.localPickDetails = this.localPickDetails.map((item) => {
|
|
|
+ if (item.selected == this.selectedAll) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
+ item.selected = this.selectedAll;
|
|
|
+
|
|
|
+ this.selectedChange(item);
|
|
|
+
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ },
|
|
|
// getCategoryAndLevelByCategoryId 获取产品 在制品信息
|
|
|
async getCategoryAndLevelByCategoryId() {
|
|
|
const data = await getCategoryAndLevelByCategoryId(this.categoryId);
|
|
|
@@ -885,10 +1087,20 @@
|
|
|
reportQuantitymax(row) {
|
|
|
if (this.outputType == 1) {
|
|
|
// 查询物料本身
|
|
|
- const pickItem = this.localPickDetails.find(
|
|
|
+ let pickItem = this.localPickDetails.find(
|
|
|
(item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
|
|
|
+ if (!pickItem) {
|
|
|
+ // 查询上到工序产出明细
|
|
|
+ pickItem = this.preOutputDetails.find(
|
|
|
+ (item) => item.categoryCode === row.categoryCode
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 未找到物料,则不限制
|
|
|
+ if (!pickItem) return Infinity;
|
|
|
+
|
|
|
// 查询其他工单sumOutputDetails中已产生的bom标准产出和在制品的累计消耗数量
|
|
|
let preCount = 0;
|
|
|
if (this.materialQuotaInfo) {
|
|
|
@@ -909,7 +1121,9 @@
|
|
|
this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -919,15 +1133,14 @@
|
|
|
(item) => item.categoryCode === this.categoryInfo.categoryCode
|
|
|
);
|
|
|
if (preItem) {
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
+ preCount += this.formatNumber(
|
|
|
+ preItem.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 未找到物料,则返回剩余数量
|
|
|
- if (!pickItem) return pickItem.quantity - preCount;
|
|
|
-
|
|
|
// 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
if (this.executeStatus == 2) {
|
|
|
const count =
|
|
|
@@ -951,6 +1164,7 @@
|
|
|
(item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
|
|
|
|
+ // debugger;
|
|
|
// 存在则当前row为在制品或BOM标准产出
|
|
|
if (preOutputItem) {
|
|
|
// 区分已执行状态
|
|
|
@@ -975,9 +1189,17 @@
|
|
|
|
|
|
// 计算每个物料的最大可报工数量
|
|
|
const maxQuantities = quota.map((item) => {
|
|
|
- const pickItem = this.localPickDetails.find(
|
|
|
+ let pickItem = this.localPickDetails.find(
|
|
|
(p) => p.categoryCode === item.categoryCode
|
|
|
);
|
|
|
+
|
|
|
+ // 从上一道工序产出物中找
|
|
|
+ if (!pickItem) {
|
|
|
+ pickItem = this.preOutputDetails.find(
|
|
|
+ (p) => p.categoryCode === item.categoryCode
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
if (!pickItem) {
|
|
|
return Infinity;
|
|
|
}
|
|
|
@@ -1001,8 +1223,9 @@
|
|
|
this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
);
|
|
|
if (preStd) {
|
|
|
- preOutputConsumedProportion +=
|
|
|
- preStd.sumReportQuantity * proportion;
|
|
|
+ preOutputConsumedProportion += this.formatNumber(
|
|
|
+ preStd.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1015,8 +1238,9 @@
|
|
|
(s) => s.categoryCode === this.categoryInfo.categoryCode
|
|
|
);
|
|
|
if (preWip) {
|
|
|
- preOutputConsumedProportion +=
|
|
|
- preWip.sumReportQuantity * proportion;
|
|
|
+ preOutputConsumedProportion += this.formatNumber(
|
|
|
+ preWip.sumReportQuantity * proportion
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1026,7 +1250,9 @@
|
|
|
: row.sumReportQuantity;
|
|
|
|
|
|
// 已执行的比例换算,换算为需要多少物料数量
|
|
|
- const consumedProportion = consumedQuantity * proportion;
|
|
|
+ const consumedProportion = this.formatNumber(
|
|
|
+ consumedQuantity * proportion
|
|
|
+ );
|
|
|
|
|
|
// 最大可报工数量
|
|
|
let maxQuantity =
|
|
|
@@ -1070,15 +1296,17 @@
|
|
|
}
|
|
|
|
|
|
for (const item of this.localOutputDetails) {
|
|
|
- const pickitem = this.localPickDetails.find(
|
|
|
- (pick) => pick.categoryCode == item.categoryCode
|
|
|
- );
|
|
|
-
|
|
|
- const prePickitem = this.preOutputDetails.find(
|
|
|
+ let pickitem = this.localPickDetails.find(
|
|
|
(pick) => pick.categoryCode == item.categoryCode
|
|
|
);
|
|
|
+ // 从上一道工序产出物中找
|
|
|
+ if (!pickitem) {
|
|
|
+ pickitem = this.preOutputDetails.find(
|
|
|
+ (pick) => pick.categoryCode == item.categoryCode
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- if (pickitem == null && prePickitem == null) {
|
|
|
+ if (!pickitem) {
|
|
|
this.$message.warning(
|
|
|
`所需物料【${item.categoryName}】未在物料清单中找到`
|
|
|
);
|
|
|
@@ -1122,6 +1350,11 @@
|
|
|
} else {
|
|
|
this.setMaterialQuotaInfo();
|
|
|
}
|
|
|
+ },
|
|
|
+ // 处理数字精度问题,不使用toFixed,避免4舍5入
|
|
|
+ formatNumber(value, decimalPlaces = 4) {
|
|
|
+ const factor = Math.pow(10, decimalPlaces);
|
|
|
+ return Math.floor(value * factor) / factor;
|
|
|
}
|
|
|
}
|
|
|
};
|