|
@@ -838,7 +838,7 @@
|
|
|
<td style="text-align: center" v-if="[3].includes(openStatus)">
|
|
|
{{ dictValueLabel(item.productUnit, productUnit) }}
|
|
|
</td>
|
|
|
- <td style="text-align: center">{{ item.quantity }}</td>
|
|
|
+ <td style="text-align: center">{{ item.sumQuantity }}</td>
|
|
|
|
|
|
<td
|
|
|
style="text-align: center"
|
|
@@ -3150,32 +3150,32 @@ const clickPrint = (status) => {
|
|
|
.then((res) => {
|
|
|
if (res.data.content) {
|
|
|
res.data.content = JSON.parse(res.data.content);
|
|
|
- // if (
|
|
|
- // res.data.content.products &&
|
|
|
- // res.data.content.products.length > 0
|
|
|
- // ) {
|
|
|
- // let arr = [];
|
|
|
- // for (let i = 0; i < res.data.content.products.length; i++) {
|
|
|
- // const ele = res.data.content.products[i];
|
|
|
- // let index = -1;
|
|
|
- // if (i === 0) {
|
|
|
- // arr.push(ele);
|
|
|
- // } else {
|
|
|
- // const isHaveProduct = arr.some((x, i) => {
|
|
|
- // if (x.productId === ele.productId) {
|
|
|
- // index = i;
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // if (isHaveProduct && index >= 0) {
|
|
|
- // arr[index].quantity += ele.quantity;
|
|
|
- // } else {
|
|
|
- // arr.push(ele);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // res.data.content.products = arr;
|
|
|
- // }
|
|
|
+ if (
|
|
|
+ res.data.content.products &&
|
|
|
+ res.data.content.products.length > 0
|
|
|
+ ) {
|
|
|
+ let arr = [];
|
|
|
+ for (let i = 0; i < res.data.content.products.length; i++) {
|
|
|
+ const ele = res.data.content.products[i];
|
|
|
+ let index = -1;
|
|
|
+ if (i === 0) {
|
|
|
+ arr.push(ele);
|
|
|
+ } else {
|
|
|
+ const isHaveProduct = arr.some((x, i) => {
|
|
|
+ if (x.productId === ele.productId) {
|
|
|
+ index = i;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (isHaveProduct && index >= 0) {
|
|
|
+ arr[index].quantity += ele.quantity;
|
|
|
+ } else {
|
|
|
+ arr.push(ele);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.data.content.products = arr;
|
|
|
+ }
|
|
|
}
|
|
|
printCustomsDeclaration.value = res.data;
|
|
|
});
|