|
@@ -14,9 +14,7 @@
|
|
|
<el-table-column align="center">
|
|
|
<template #header>
|
|
|
<div style="text-align: center; font-size: 30px; padding: 8px">{{ props.rowData.departmentName }}-胜德体育对账单</div>
|
|
|
- <div style="text-align: center; font-size: 18px; padding-bottom: 8px">
|
|
|
- ( 对账时间: {{ rowData.timePeriod }} - {{ rowData.timePeriod }} )
|
|
|
- </div>
|
|
|
+ <div style="text-align: center; font-size: 18px; padding-bottom: 8px">( 对账时间: {{ rowData.timePeriod }} - {{ rowData.timePeriod }} )</div>
|
|
|
</template>
|
|
|
<el-table-column label="订单时间" prop="wlnCreateTime" align="center" width="160" />
|
|
|
<el-table-column label="订单号" prop="code" width="180" />
|
|
@@ -56,7 +54,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import $ from "jquery";
|
|
|
+// import $ from "jquery";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const props = defineProps({
|
|
@@ -64,6 +62,7 @@ const props = defineProps({
|
|
|
});
|
|
|
const loading = ref(false);
|
|
|
const tableData = ref([]);
|
|
|
+const total = ref(0);
|
|
|
onMounted(() => {
|
|
|
if (props.rowData && props.rowData.id) {
|
|
|
loading.value = true;
|
|
@@ -74,6 +73,9 @@ onMounted(() => {
|
|
|
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].total) {
|
|
|
+ total.value = Number(Math.round((total.value + res[i].skuSpecList[j].total) * 100) / 100);
|
|
|
+ }
|
|
|
if (res[i].skuSpecList[j].bomSpecList && res[i].skuSpecList[j].bomSpecList.length > 0) {
|
|
|
for (let x = 0; x < res[i].skuSpecList[j].bomSpecList.length; x++) {
|
|
|
list.push({
|
|
@@ -190,7 +192,7 @@ const getSummaries = ({ columns, data }) => {
|
|
|
padding: "0 12px",
|
|
|
height: "35px",
|
|
|
},
|
|
|
- innerHTML: getTotal("total"),
|
|
|
+ innerHTML: total.value,
|
|
|
}),
|
|
|
h("div", {
|
|
|
style: {
|
|
@@ -236,23 +238,22 @@ const getSummaries = ({ columns, data }) => {
|
|
|
});
|
|
|
return sums;
|
|
|
};
|
|
|
-const getTotal = (label) => {
|
|
|
- let list = tableData.value.map((item) => item[label]);
|
|
|
- return Number(Math.round(list.reduce((acc, curr) => acc + curr, 0) * 100) / 100);
|
|
|
-};
|
|
|
const emit = defineEmits(["clickCancel"]);
|
|
|
const clickCancel = () => {
|
|
|
emit("clickCancel", "");
|
|
|
};
|
|
|
const deriveExcel = () => {
|
|
|
- $("#tableId").table2excel({
|
|
|
- exclude: ".noExl",
|
|
|
- sheetName: "BOM对账单",
|
|
|
- filename: "BOM对账单",
|
|
|
- exclude_img: false,
|
|
|
- exclude_links: false,
|
|
|
- exclude_inputs: true,
|
|
|
+ proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id }).then((res) => {
|
|
|
+ proxy.downloadFile(res, "订单对账单.xlsx");
|
|
|
});
|
|
|
+ // $("#tableId").table2excel({
|
|
|
+ // exclude: ".noExl",
|
|
|
+ // sheetName: "订单对账单",
|
|
|
+ // filename: "订单对账单",
|
|
|
+ // exclude_img: false,
|
|
|
+ // exclude_links: false,
|
|
|
+ // exclude_inputs: true,
|
|
|
+ // });
|
|
|
};
|
|
|
const objectSpanMethod = ({ rowIndex, columnIndex }) => {
|
|
|
if ([0, 1, 2, 3, 4, 5, 15, 16, 17].includes(columnIndex)) {
|