Kaynağa Gözat

1、修复导出EXCEL格式错误
2、修正部分价格查看权限问题

MY 1 gün önce
ebeveyn
işleme
1a2fe5d5d6

+ 25 - 0
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -31,6 +31,7 @@ import { useRouter } from "vue-router";
 import { useGlobalStore } from "@/stores/modules/global";
 import { storeToRefs } from "pinia";
 import { usePageRouter } from "@/hooks/usePageRouter";
+const { userInfo } = useUserStore();
 // import { title } from "process";
 
 interface defaultState {
@@ -3450,6 +3451,10 @@ export const useHooks = (t?: any) => {
     {
       field: "moneyrate",
       title: "币种",
+      exportMethod: (scope: any) => {
+        if (scope.row.moneyrate > 1) return `美元\r\n${scope.row.moneyrate}`;
+        return "人民币";
+      },
       render: (scope: any) => {
         return (
           <>
@@ -3501,6 +3506,11 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "dannum_cost1",
+      visible: userInfo.usermode !== 1,
+      exportMethod: (scope: any) => {
+        const val = formatAmount3({ val: floatDiv(scope.row?.dannum_cost1 ?? 0, scope.row.moneyrate) });
+        return `${scope.row.moneyrate > 1 ? `$` : ""}${val}`;
+      },
       render: (scope: any) => {
         if (scope.row?.moneyrate > 1) {
           return (
@@ -3518,6 +3528,11 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "dannum_cost2",
+      visible: userInfo.usermode !== 1,
+      exportMethod: (scope: any) => {
+        const val = formatAmount3({ val: floatDiv(scope.row?.dannum_cost2 ?? 0, scope.row.moneyrate) });
+        return `${scope.row.moneyrate > 1 ? `$` : ""}${val}`;
+      },
       render: (scope: any) => {
         if (scope.row?.moneyrate > 1) {
           return (
@@ -3535,6 +3550,11 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "dannum_cost3",
+      visible: userInfo.usermode !== 1,
+      exportMethod: (scope: any) => {
+        const val = formatAmount3({ val: floatDiv(scope.row?.dannum_cost3 ?? 0, scope.row.moneyrate) });
+        return `${scope.row.moneyrate > 1 ? `$` : ""}${val}`;
+      },
       render: (scope: any) => {
         if (scope.row?.moneyrate > 1) {
           return (
@@ -3552,6 +3572,11 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "dannum_cost4",
+      visible: userInfo.usermode !== 1,
+      exportMethod: (scope: any) => {
+        const val = formatAmount3({ val: floatDiv(scope.row?.dannum_cost4 ?? 0, scope.row.moneyrate) });
+        return `${scope.row.moneyrate > 1 ? `$` : ""}${val}`;
+      },
       render: (scope: any) => {
         if (scope.row?.moneyrate > 1) {
           return (