tangning hace 2 años
padre
commit
77e8e4446b

+ 3 - 1
src/api/finance/index.ts

@@ -1,5 +1,7 @@
 import { defHttp } from '/@/utils/http/axios';
 import { Result, FileStream } from '/#/axios';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
 
 enum Api {
   logData = '/service/agent/log/logData',
@@ -42,7 +44,7 @@ enum Api {
   defHttp.downloadFile<FileStream>({
     url: Api.export,
     params: params,
-    fileName:'销售统计.xlsx',
+    fileName:t('routes.equity.listTitle')+'.xlsx',
     // data: params,
     headers: {
       // @ts-ignore

+ 2 - 1
src/locales/lang/en/common.ts

@@ -14,7 +14,8 @@ export default {
 
   redo: 'Refresh',
   back: 'Back',
-
+  yes: 'yes',
+  no: 'no',
   light: 'Light',
   dark: 'Dark',
   reminder:'reminder',

+ 7 - 1
src/locales/lang/en/routes/equity.ts

@@ -15,7 +15,7 @@ export default {
   newTime:'Latest Authorization Time',
   time:'Start Date',
   Type:'Type',
-  giveType:'Authorization Methods',
+  giveType:'Methods',
   nickName:'Nickname',
   userName1:'Account',
   email:'Email',
@@ -37,6 +37,7 @@ export default {
   CardHighNum: "Last Month's Senior Membership Sales (Monthly)",
   CardDownNum: "Last Month's Download Sales",
   syks:'surplus',
+  addcount:'New Downloads',
   rules:{
     userName:'Please enter the user account',
     userName1:'Please enter the correct user account',
@@ -47,6 +48,11 @@ export default {
     2:'',
     '-1':'Year',
     '-2':'Month',
+  },
+  titleHelpMessage:{
+    1:'Statistical Guidelines',
+    2:'Membership subscription: current records of new authorizations by dealers and related ID renewal records, including dealer authorizations and renewals, platform authorizations (renewals), and official website purchases (renewals).',
+    3:'Scene Download: Statistical information on the number of downloads of current new authorizations by sales (excluding associated users);',
   }
 }
 

+ 1 - 1
src/locales/lang/en/routes/finance.ts

@@ -18,7 +18,7 @@ export default {
   },
   giveType: {
     0: 'Dealer Authorization',
-    1: 'Reseller Renewal',
+    1: 'Dealer Renewals',
     2: 'Official Website Purchase',
     3: 'Platform Authorization',
   },

+ 2 - 0
src/locales/lang/en/routes/scene.ts

@@ -18,6 +18,8 @@ export default {
   userName:'Bind account',
   viewCount:'Views',
   status:'Status',
+  copyTime:'Scene Copied Time',
+  isCopy:'Confirm to copy',
   statusType:{
     '0':'In calculation',
     '1':'Calculation succeeded',

+ 6 - 0
src/locales/lang/zh-CN/routes/equity.ts

@@ -38,6 +38,7 @@ export default {
   CardHighNum: '上月销售高级会员(月)',
   CardDownNum: '上月销售场景下载',
   syks:'剩余可售',
+  addcount:'新增次数',
   rules:{
     userName:'请输入用户账号',
     userName1:'请输入正确的用户账号',
@@ -48,6 +49,11 @@ export default {
     2:'次',
     '-1':'年',
     '-2':'月',
+  },
+  titleHelpMessage:{
+    1:'统计规则:',
+    2:'1、会员权益:统计当前经销商新授权的记录、以及相关权益ID续费记录,包括经销商授权和续费、平台授权(续费)、官网自购(续费);',
+    3:'2、场景下载:统计当前经销售新授权(除相关用户)的下载次数;',
   }
 }
 

+ 5 - 5
src/views/equity/DownModal.vue

@@ -2,7 +2,7 @@
   <BasicModal
     v-bind="$attrs"
     @register="register"
-    title="新增下载"
+    :title="t('routes.equity.addDowm')"
     height="500"
     @visible-change="handleVisibleChange"
     @cancel="resetFields"
@@ -53,7 +53,7 @@
         {
             field: 'userName',
             component: 'Input',
-            label: '用户账号',
+            label: t('routes.equity.userName'),
             required: true,
             componentProps: {
               autoComplete:'off',
@@ -89,9 +89,9 @@
         },{
             field: 'count',
             component: 'InputNumber',
-            label: ' 新增次数',
+            label: t('routes.equity.addcount'),
             required: true,
-            suffix:`剩余可售 ${agent.value.downSubNum} 个`,
+            suffix:`${t('routes.equity.syks')} ${agent.value.downSubNum} ${t('routes.equity.unit.1')}`,
             // defaultValue:1,
             componentProps:{
               max:agent.value.downSubNum,
@@ -116,7 +116,7 @@
       const [register, { closeModal }] = useModalInner((data) => {
         resetFields();
         updateSchema([
-          {field: 'count',suffix:`剩余可售 ${agent.value.downSubNum} 个`,
+          {field: 'count',suffix:`${t('routes.equity.syks')} ${agent.value.downSubNum} ${t('routes.equity.unit.1')}`,
             componentProps:{
               max:agent.value.downSubNum,
               min:1,

+ 5 - 2
src/views/finance/data.tsx

@@ -1,6 +1,6 @@
 import { Time } from '/@/components/Time';
 import { FormProps, BasicColumn } from '/@/components/Table';
-import { h, ref } from 'vue';
+import { h, ref, computed } from 'vue';
 import { FormSchema } from '/@/components/Form/index';
 import { useI18n } from '/@/hooks/web/useI18n';
 const { t } = useI18n();
@@ -8,6 +8,9 @@ import { dincrementList } from '/@/api/equity'
 import type { Dayjs } from 'dayjs';
 const selectPriceDate = ref('')
 import dayjs from 'dayjs';
+import { useLocaleStore } from '/@/store/modules/locale';
+const localeStore = useLocaleStore();
+const isEn = computed(() => localeStore.getLocale === 'en');
 
 export const columns: BasicColumn[] = [
         
@@ -66,7 +69,7 @@ export const columns: BasicColumn[] = [
   },
 ];
 export const searchForm: Partial<FormProps> = {
-  labelWidth: 100,
+  labelWidth: isEn.value?120:100,
   schemas: [
     {
       field: 'type',

+ 10 - 3
src/views/finance/index.vue

@@ -11,7 +11,7 @@
   </div>
 </template>
 <script lang="ts">
-import { defineComponent, h, reactive, ref, onMounted } from 'vue';
+import { defineComponent, h, reactive, ref, onMounted, computed } from 'vue';
 import GrowCard from '../dashboard/analysis/components/GrowCard.vue';
 import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
 import { PageWrapper } from '/@/components/Page';
@@ -24,6 +24,8 @@ import { searchForm, columns } from './data';
 import AddModal from './InvoiceModal.vue';
 import EditModal from './EditModal.vue';
 import { usePermissionStore } from '/@/store/modules/permission';
+import { useLocaleStore } from '/@/store/modules/locale';
+
 interface apiDataParam {
   orderSn?: string;
   payTimeStart?: string;
@@ -57,6 +59,8 @@ export default defineComponent({
     const { t } = useI18n();
     const loading = ref(true);
     const growCardList = ref<GrowCardItem[]>([]);
+    const localeStore = useLocaleStore();
+    const isEn = computed(() => localeStore.getLocale === 'en');
     onMounted(async () => {
       const {lastDownNum = 0,lastHighNum = 0,lastMajorNum = 0} = await logData({})
       loading.value = false
@@ -103,7 +107,7 @@ export default defineComponent({
     const [registerTable, { reload }] = useTable({
       api: logList,
       title: t('routes.equity.listTitle'),
-      titleHelpMessage: ['统计规则:', '1、会员权益:统计当前经销商新授权的记录、以及相关权益ID续费记录,包括经销商授权和续费、平台授权(续费)、官网自购(续费);','2、场景下载:统计当前经销售新授权(除相关用户)的下载次数;'],
+      titleHelpMessage: [t('routes.equity.titleHelpMessage.1'), t('routes.equity.titleHelpMessage.2'),t('routes.equity.titleHelpMessage.3'),],
       columns: columns,
       useSearchForm: true,
       formConfig: searchForm,
@@ -159,7 +163,10 @@ export default defineComponent({
         title: () => h('span', t('common.reminder')),
         content: () => h('span', t('routes.equity.excelTitle')),
         onOk: async () => {
-          await DownExport(apiData);
+          await DownExport({
+            ...apiData,
+            lang:isEn.value?'en':'zh'
+          });
         },
       });
     }