|
@@ -26,6 +26,7 @@ import { cloneVNode } from "vue";
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const props = defineProps({
|
|
|
rowData: Object,
|
|
|
+ activeName: String,
|
|
|
});
|
|
|
const loading = ref(false);
|
|
|
const tableData = ref([]);
|
|
@@ -40,77 +41,86 @@ const getAggregate = (data) => {
|
|
|
}
|
|
|
return total;
|
|
|
};
|
|
|
-onMounted(() => {
|
|
|
- if (props.rowData && props.rowData.idGroupConcat) {
|
|
|
- loading.value = true;
|
|
|
- proxy.post("/statementOfAccountMerge/getDocumentByOrder", { idGroupConcat: props.rowData.idGroupConcat }).then(
|
|
|
- (res) => {
|
|
|
- let total = getAggregate(proxy.deepClone(res));
|
|
|
- let list = [];
|
|
|
- if (res && res.length > 0) {
|
|
|
- for (let i = 0; i < res.length; i++) {
|
|
|
- if (res[i].skuSpecList && res[i].skuSpecList.length > 0) {
|
|
|
- for (let j = 0; j < res[i].skuSpecList.length; j++) {
|
|
|
- if (res[i].skuSpecList[j].bomSpecList && res[i].skuSpecList[j].bomSpecList.length > 0) {
|
|
|
- for (let y = 0; y < res[i].skuSpecList[j].bomSpecList.length; y++) {
|
|
|
- let indexOne = 0;
|
|
|
- if (j === 0 && y === 0) {
|
|
|
- for (let z = 0; z < res[i].skuSpecList.length; z++) {
|
|
|
- if (res[i].skuSpecList[z].bomSpecList && res[i].skuSpecList[z].bomSpecList.length > 0) {
|
|
|
- indexOne = Number(indexOne + res[i].skuSpecList[z].bomSpecList.length);
|
|
|
+watch(
|
|
|
+ () => props.activeName,
|
|
|
+ (val) => {
|
|
|
+ if (val === "order" && !(tableData.value && tableData.value.length > 0)) {
|
|
|
+ if (props.rowData && props.rowData.idGroupConcat) {
|
|
|
+ loading.value = true;
|
|
|
+ proxy.post("/statementOfAccountMerge/getDocumentByOrder", { idGroupConcat: props.rowData.idGroupConcat }).then(
|
|
|
+ (res) => {
|
|
|
+ let total = getAggregate(proxy.deepClone(res));
|
|
|
+ let list = [];
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ if (res[i].skuSpecList && res[i].skuSpecList.length > 0) {
|
|
|
+ for (let j = 0; j < res[i].skuSpecList.length; j++) {
|
|
|
+ if (res[i].skuSpecList[j].bomSpecList && res[i].skuSpecList[j].bomSpecList.length > 0) {
|
|
|
+ for (let y = 0; y < res[i].skuSpecList[j].bomSpecList.length; y++) {
|
|
|
+ let indexOne = 0;
|
|
|
+ if (j === 0 && y === 0) {
|
|
|
+ for (let z = 0; z < res[i].skuSpecList.length; z++) {
|
|
|
+ if (res[i].skuSpecList[z].bomSpecList && res[i].skuSpecList[z].bomSpecList.length > 0) {
|
|
|
+ indexOne = Number(indexOne + res[i].skuSpecList[z].bomSpecList.length);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ let indexTwo = 0;
|
|
|
+ if (y === 0) {
|
|
|
+ indexTwo = res[i].skuSpecList[j].bomSpecList.length;
|
|
|
+ }
|
|
|
+ list.push({
|
|
|
+ wlnCreateTime: res[i].wlnCreateTime,
|
|
|
+ code: res[i].code,
|
|
|
+ wlnCode: res[i].wlnCode,
|
|
|
+ skuSpecCode: res[i].skuSpecList[j].skuSpecCode,
|
|
|
+ skuSpecName: res[i].skuSpecList[j].skuSpecName,
|
|
|
+ quantitySKU: res[i].skuSpecList[j].quantity,
|
|
|
+ subtotal: res[i].skuSpecList[j].subtotal,
|
|
|
+ bomSpecCode: res[i].skuSpecList[j].bomSpecList[y].bomSpecCode,
|
|
|
+ bomSpecName: res[i].skuSpecList[j].bomSpecList[y].bomSpecName,
|
|
|
+ quantityBOM: res[i].skuSpecList[j].bomSpecList[y].quantity,
|
|
|
+ unitPriceBOM: res[i].skuSpecList[j].bomSpecList[y].unitPrice,
|
|
|
+ laserLogoSummary: res[i].skuSpecList[j].bomSpecList[y].laserLogoSummary,
|
|
|
+ laserMitochondrialSummary: res[i].skuSpecList[j].bomSpecList[y].laserMitochondrialSummary,
|
|
|
+ lssueFeeSummary: res[i].skuSpecList[j].bomSpecList[y].lssueFeeSummary,
|
|
|
+ deliveryMaterialsFeeSummary: res[i].skuSpecList[j].bomSpecList[y].deliveryMaterialsFeeSummary,
|
|
|
+ packingLaborSummary: res[i].skuSpecList[j].bomSpecList[y].packingLaborSummary,
|
|
|
+ managementFeeSummary: res[i].skuSpecList[j].bomSpecList[y].managementFeeSummary,
|
|
|
+ unitPriceSKU: res[i].skuSpecList[j].unitPrice,
|
|
|
+ outerBoxPackingFee: res[i].outerBoxPackingFee,
|
|
|
+ total: res[i].total,
|
|
|
+ indexOne: indexOne,
|
|
|
+ indexTwo: indexTwo,
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
- let indexTwo = 0;
|
|
|
- if (y === 0) {
|
|
|
- indexTwo = res[i].skuSpecList[j].bomSpecList.length;
|
|
|
- }
|
|
|
- list.push({
|
|
|
- wlnCreateTime: res[i].wlnCreateTime,
|
|
|
- code: res[i].code,
|
|
|
- wlnCode: res[i].wlnCode,
|
|
|
- skuSpecCode: res[i].skuSpecList[j].skuSpecCode,
|
|
|
- skuSpecName: res[i].skuSpecList[j].skuSpecName,
|
|
|
- quantitySKU: res[i].skuSpecList[j].quantity,
|
|
|
- subtotal: res[i].skuSpecList[j].subtotal,
|
|
|
- bomSpecCode: res[i].skuSpecList[j].bomSpecList[y].bomSpecCode,
|
|
|
- bomSpecName: res[i].skuSpecList[j].bomSpecList[y].bomSpecName,
|
|
|
- quantityBOM: res[i].skuSpecList[j].bomSpecList[y].quantity,
|
|
|
- unitPriceBOM: res[i].skuSpecList[j].bomSpecList[y].unitPrice,
|
|
|
- laserLogoSummary: res[i].skuSpecList[j].bomSpecList[y].laserLogoSummary,
|
|
|
- laserMitochondrialSummary: res[i].skuSpecList[j].bomSpecList[y].laserMitochondrialSummary,
|
|
|
- lssueFeeSummary: res[i].skuSpecList[j].bomSpecList[y].lssueFeeSummary,
|
|
|
- deliveryMaterialsFeeSummary: res[i].skuSpecList[j].bomSpecList[y].deliveryMaterialsFeeSummary,
|
|
|
- packingLaborSummary: res[i].skuSpecList[j].bomSpecList[y].packingLaborSummary,
|
|
|
- managementFeeSummary: res[i].skuSpecList[j].bomSpecList[y].managementFeeSummary,
|
|
|
- unitPriceSKU: res[i].skuSpecList[j].unitPrice,
|
|
|
- outerBoxPackingFee: res[i].outerBoxPackingFee,
|
|
|
- total: res[i].total,
|
|
|
- indexOne: indexOne,
|
|
|
- indexTwo: indexTwo,
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ list.push({
|
|
|
+ indexOne: 1,
|
|
|
+ indexTwo: 1,
|
|
|
+ total: total,
|
|
|
+ wlnCreateTime: "总计:",
|
|
|
+ });
|
|
|
+ tableData.value = Object.freeze(list);
|
|
|
+ loading.value = false;
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
+ loading.value = false;
|
|
|
}
|
|
|
- }
|
|
|
- list.push({
|
|
|
- indexOne: 1,
|
|
|
- indexTwo: 1,
|
|
|
- total: total,
|
|
|
- wlnCreateTime: "总计:",
|
|
|
- });
|
|
|
- tableData.value = Object.freeze(list);
|
|
|
- loading.value = false;
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log(err);
|
|
|
- loading.value = false;
|
|
|
+ );
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
}
|
|
|
-});
|
|
|
+);
|
|
|
const emit = defineEmits(["clickCancel"]);
|
|
|
const clickCancel = () => {
|
|
|
emit("clickCancel", "");
|