|
@@ -99,7 +99,7 @@
|
|
|
<strong>主管:</strong>{{ rowItem.verifyName || '' }}
|
|
<strong>主管:</strong>{{ rowItem.verifyName || '' }}
|
|
|
</div>
|
|
</div>
|
|
|
<div style="width: 25%;">
|
|
<div style="width: 25%;">
|
|
|
- <strong>仓库:</strong>{{ warehouseMap[rowItem.id] || '' }}
|
|
|
|
|
|
|
+ <strong>仓库:</strong>{{ getUniqueWarehouses(rowItem) }}
|
|
|
</div>
|
|
</div>
|
|
|
<div style="width: 25%;">
|
|
<div style="width: 25%;">
|
|
|
<strong>记账:</strong>{{ rowItem.extInfo?.createUserName || '' }}
|
|
<strong>记账:</strong>{{ rowItem.extInfo?.createUserName || '' }}
|
|
@@ -135,7 +135,7 @@
|
|
|
return {
|
|
return {
|
|
|
QRvisible: false,
|
|
QRvisible: false,
|
|
|
formData: [],
|
|
formData: [],
|
|
|
- warehouseMap: {}
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -145,10 +145,18 @@
|
|
|
if (!rowItem?.outInDetailList || !Array.isArray(rowItem.outInDetailList)) {
|
|
if (!rowItem?.outInDetailList || !Array.isArray(rowItem.outInDetailList)) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
- return rowItem.outInDetailList.reduce((sum, row) => {
|
|
|
|
|
- const amount = parseFloat(row.measureQuantity || 0);
|
|
|
|
|
- return sum + (isNaN(amount) ? 0 : amount);
|
|
|
|
|
|
|
+ const list = rowItem.outInDetailList;
|
|
|
|
|
+ // 找出最大小数位数,转为整数累加避免精度丢失
|
|
|
|
|
+ const maxDec = Math.max(...list.map((r) => {
|
|
|
|
|
+ const s = String(parseFloat(r.measureQuantity || 0));
|
|
|
|
|
+ const dot = s.indexOf('.');
|
|
|
|
|
+ return dot > -1 ? s.length - dot - 1 : 0;
|
|
|
|
|
+ }), 0);
|
|
|
|
|
+ const factor = Math.pow(10, maxDec);
|
|
|
|
|
+ const total = list.reduce((sum, row) => {
|
|
|
|
|
+ return sum + Math.round(parseFloat(row.measureQuantity || 0) * factor);
|
|
|
}, 0);
|
|
}, 0);
|
|
|
|
|
+ return total / factor;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async init(ids, rows) {
|
|
async init(ids, rows) {
|
|
@@ -161,21 +169,22 @@
|
|
|
})
|
|
})
|
|
|
this.formData = res;
|
|
this.formData = res;
|
|
|
|
|
|
|
|
- // 构建仓库映射
|
|
|
|
|
- this.warehouseMap = {};
|
|
|
|
|
- rows.forEach((row) => {
|
|
|
|
|
- this.warehouseMap[row.id] = row.warehouseName || '';
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- console.log('formData', this.formData, this.warehouseMap);
|
|
|
|
|
|
|
+ console.log('formData', this.formData);
|
|
|
this.QRvisible = true;
|
|
this.QRvisible = true;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
close() {
|
|
close() {
|
|
|
this.formData = [];
|
|
this.formData = [];
|
|
|
- this.warehouseMap = {};
|
|
|
|
|
this.QRvisible = false;
|
|
this.QRvisible = false;
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ getUniqueWarehouses(rowItem) {
|
|
|
|
|
+ return [...new Set(
|
|
|
|
|
+ (rowItem.outInDetailList || [])
|
|
|
|
|
+ .map((r) => r.warehouseName || '')
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ )].join('、');
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
print() {
|
|
print() {
|
|
|
const printSection = document.getElementById('printSectionHt');
|
|
const printSection = document.getElementById('printSectionHt');
|
|
@@ -215,7 +224,7 @@
|
|
|
this.formData.forEach((rowItem) => {
|
|
this.formData.forEach((rowItem) => {
|
|
|
const list = rowItem.outInDetailList || [];
|
|
const list = rowItem.outInDetailList || [];
|
|
|
const totalAmount = this.getTotalAmount(rowItem);
|
|
const totalAmount = this.getTotalAmount(rowItem);
|
|
|
- const warehouseName = this.warehouseMap[rowItem.id] || '';
|
|
|
|
|
|
|
+ const warehouseName = this.getUniqueWarehouses(rowItem);
|
|
|
const isBizType6 = rowItem.bizType == 6;
|
|
const isBizType6 = rowItem.bizType == 6;
|
|
|
const supplierValue = rowItem.supplierNames || '';
|
|
const supplierValue = rowItem.supplierNames || '';
|
|
|
|
|
|