lxf 1 year ago
parent
commit
2794129c34

+ 7 - 6
src/views/group/finance/check-bill/printBOM.vue

@@ -43,18 +43,19 @@ import { ElMessage } from "element-plus";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
-  activeName: String,
-  tabsCard: Number,
+  tabValues: Object,
 });
 const loading = ref(false);
 const tableData = ref([]);
+const tabsCard = ref();
 watch(
-  () => props.activeName,
+  () => props.tabValues,
   (val) => {
-    if (val === "bom" && !(tableData.value && tableData.value.length > 0)) {
+    if (val.activeName === "bom" && val.tabsCard != tabsCard.value) {
+      tabsCard.value = val.tabsCard;
       if (props.rowData && props.rowData.id) {
         loading.value = true;
-        proxy.post("/statementOfAccount/getDocumentByBom", { id: props.rowData.id }).then(
+        proxy.post("/statementOfAccount/getDocumentByBom", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
           (res) => {
             tableData.value = Object.freeze(res);
             loading.value = false;
@@ -188,7 +189,7 @@ const clickCancel = () => {
 const deriveExcel = () => {
   ElMessage("导出文件中,请稍后");
   loading.value = true;
-  proxy.getFile("/statementOfAccount/exportDocumentByBom", { id: props.rowData.id }).then(
+  proxy.getFile("/statementOfAccount/exportDocumentByBom", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
       proxy.downloadFile(res, "BOM对账单.xlsx");
       loading.value = false;

+ 7 - 6
src/views/group/finance/check-bill/printOrder.vue

@@ -26,8 +26,7 @@ import { cloneVNode } from "vue";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
-  activeName: String,
-  tabsCard: Number,
+  tabValues: Object,
 });
 const loading = ref(false);
 const tableData = ref([]);
@@ -42,13 +41,15 @@ const getAggregate = (data) => {
   }
   return total;
 };
+const tabsCard = ref();
 watch(
-  () => props.activeName,
+  () => props.tabValues,
   (val) => {
-    if (val === "order" && !(tableData.value && tableData.value.length > 0)) {
+    if (val.activeName === "order" && val.tabsCard != tabsCard.value) {
+      tabsCard.value = val.tabsCard;
       if (props.rowData && props.rowData.id) {
         loading.value = true;
-        proxy.post("/statementOfAccount/getDocumentByOrder", { id: props.rowData.id }).then(
+        proxy.post("/statementOfAccount/getDocumentByOrder", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
           (res) => {
             let total = getAggregate(proxy.deepClone(res));
             let list = [];
@@ -128,7 +129,7 @@ const clickCancel = () => {
 };
 const deriveExcel = () => {
   loading.value = true;
-  proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id }).then(
+  proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     () => {
       emit("clickCancel", true);
       // proxy.downloadFile(res, "订单对账单.xlsx");

+ 1 - 1
src/views/group/finance/check-bill/printSKU.vue

@@ -176,7 +176,7 @@ const clickCancel = () => {
 const deriveExcel = () => {
   ElMessage("导出文件中,请稍后");
   loading.value = true;
-  proxy.getFile("/statementOfAccount/exportDocumentBySku", { id: props.rowData.id }).then(
+  proxy.getFile("/statementOfAccount/exportDocumentBySku", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
       proxy.downloadFile(res, "SKU对账单.xlsx");
       loading.value = false;

+ 7 - 5
src/views/group/finance/summary/printBOM.vue

@@ -43,18 +43,19 @@ import { ElMessage } from "element-plus";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
-  activeName: String,
-  tabsCard: Number,
+  tabValues: Object,
 });
 const loading = ref(false);
 const tableData = ref([]);
+const tabsCard = ref();
 watch(
-  () => props.activeName,
+  () => props.tabValues,
   (val) => {
-    if (val === "bom" && !(tableData.value && tableData.value.length > 0)) {
+    if (val.activeName === "bom" && val.tabsCard != tabsCard.value) {
+      tabsCard.value = val.tabsCard;
       if (props.rowData && props.rowData.idGroupConcat) {
         loading.value = true;
-        proxy.post("/statementOfAccountMerge/getDocumentByBom", { idGroupConcat: props.rowData.idGroupConcat }).then(
+        proxy.post("/statementOfAccountMerge/getDocumentByBom", { idGroupConcat: props.rowData.idGroupConcat, orderClassify: props.tabValues.tabsCard }).then(
           (res) => {
             tableData.value = Object.freeze(res);
             loading.value = false;
@@ -193,6 +194,7 @@ const deriveExcel = () => {
       idGroupConcat: props.rowData.idGroupConcat,
       departmentName: props.rowData.departmentName,
       beginDate: props.rowData.dimensionality,
+      orderClassify: props.tabValues.tabsCard,
     })
     .then(
       (res) => {

+ 7 - 5
src/views/group/finance/summary/printOrder.vue

@@ -25,8 +25,7 @@ import { cloneVNode } from "vue";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
-  activeName: String,
-  tabsCard: Number,
+  tabValues: Object,
 });
 const loading = ref(false);
 const tableData = ref([]);
@@ -41,13 +40,15 @@ const getAggregate = (data) => {
   }
   return total;
 };
+const tabsCard = ref();
 watch(
-  () => props.activeName,
+  () => props.tabValues,
   (val) => {
-    if (val === "order" && !(tableData.value && tableData.value.length > 0)) {
+    if (val.activeName === "order" && val.tabsCard != tabsCard.value) {
+      tabsCard.value = val.tabsCard;
       if (props.rowData && props.rowData.idGroupConcat) {
         loading.value = true;
-        proxy.post("/statementOfAccountMerge/getDocumentByOrder", { idGroupConcat: props.rowData.idGroupConcat }).then(
+        proxy.post("/statementOfAccountMerge/getDocumentByOrder", { idGroupConcat: props.rowData.idGroupConcat, orderClassify: props.tabValues.tabsCard }).then(
           (res) => {
             let total = getAggregate(proxy.deepClone(res));
             let list = [];
@@ -132,6 +133,7 @@ const deriveExcel = () => {
       idGroupConcat: props.rowData.idGroupConcat,
       departmentName: props.rowData.departmentName,
       beginDate: props.rowData.dimensionality,
+      orderClassify: props.tabValues.tabsCard,
     })
     .then(
       () => {

+ 7 - 5
src/views/group/finance/summary/printSKU.vue

@@ -37,18 +37,19 @@ import { ElMessage } from "element-plus";
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
-  activeName: String,
-  tabsCard: Number,
+  tabValues: Object,
 });
 const loading = ref(false);
 const tableData = ref([]);
+const tabsCard = ref();
 watch(
-  () => props.activeName,
+  () => props.tabValues,
   (val) => {
-    if (val === "sku" && !(tableData.value && tableData.value.length > 0)) {
+    if (val.activeName === "sku" && val.tabsCard != tabsCard.value) {
+      tabsCard.value = val.tabsCard;
       if (props.rowData && props.rowData.idGroupConcat) {
         loading.value = true;
-        proxy.post("/statementOfAccountMerge/getDocumentBySku", { idGroupConcat: props.rowData.idGroupConcat }).then(
+        proxy.post("/statementOfAccountMerge/getDocumentBySku", { idGroupConcat: props.rowData.idGroupConcat, orderClassify: props.tabValues.tabsCard }).then(
           (res) => {
             tableData.value = Object.freeze(res);
             loading.value = false;
@@ -180,6 +181,7 @@ const deriveExcel = () => {
       idGroupConcat: props.rowData.idGroupConcat,
       departmentName: props.rowData.departmentName,
       beginDate: props.rowData.dimensionality,
+      orderClassify: props.tabValues.tabsCard,
     })
     .then(
       (res) => {