Commit 5a520b62ca85787a458e144bb684c456b6be835e

Authored by 柏杨
1 parent 940821bb

修改财务页面

Showing 27 changed files with 211 additions and 49 deletions
src/api/project/invoice.ts
... ... @@ -59,14 +59,14 @@ export const getInvoice = async (params: any) => {
59 59 const formattedRecords = res.records.map((record: any) => {
60 60 return {
61 61 ...record,
62   - actualPayedAmount1: record.actualPayedAmount1?.toFixed(2),
63   - actualPayedAmount2: record.actualPayedAmount2?.toFixed(2),
64   - actualPayedAmount3: record.actualPayedAmount3?.toFixed(2),
65   - actualReceivableAmount: record.actualReceivableAmount?.toFixed(2),
66   - deductAmount: record.deductAmount?.toFixed(2),
67   - otherAmount: record.otherAmount?.toFixed(2),
68   - totalCustomerAmount: record.totalCustomerAmount?.toFixed(2),
69   - totalPayAmount: record.totalPayAmount?.toFixed(2),
  62 + // actualPayedAmount1: record.actualPayedAmount1?.toFixed(2),
  63 + // actualPayedAmount2: record.actualPayedAmount2?.toFixed(2),
  64 + // actualPayedAmount3: record.actualPayedAmount3?.toFixed(2),
  65 + // actualReceivableAmount: record.actualReceivableAmount?.toFixed(2),
  66 + // deductAmount: record.deductAmount?.toFixed(2),
  67 + // otherAmount: record.otherAmount?.toFixed(2),
  68 + // totalCustomerAmount: record.totalCustomerAmount?.toFixed(2),
  69 + // totalPayAmount: record.totalPayAmount?.toFixed(2),
70 70 };
71 71 });
72 72 const orderStore = useOrderStoreWithOut();
... ...
src/router/routes/modules/project/finance.ts
... ... @@ -8,9 +8,9 @@ const finance: AppRouteModule = {
8 8 path: '/finance',
9 9 name: 'Finance',
10 10 component: LAYOUT,
11   - redirect: '/finance',
  11 + redirect: '/finance/financeList',
12 12 meta: {
13   - hideChildrenInMenu: true,
  13 + hideChildrenInMenu: false,
14 14 orderNo: 3,
15 15 icon: 'ant-design:pay-circle-outlined',
16 16 title: '财务管理',
... ... @@ -23,31 +23,31 @@ const finance: AppRouteModule = {
23 23 ],
24 24 },
25 25 children: [
  26 + // {
  27 + // path: '',
  28 + // name: 'Receive',
  29 + // meta: {
  30 + // title: '财务管理',
  31 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  32 + // ignoreKeepAlive: false,
  33 + // },
  34 + // // component: () => import('/@/views/project/finance/index.vue'),
  35 + // },
26 36 {
27   - path: '',
28   - name: 'Receive',
  37 + path: 'financeList',
  38 + name: 'financeList',
29 39 meta: {
30   - title: '财务管理',
  40 + title: '应收款应付款管理',
31 41 roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
32 42 ignoreKeepAlive: false,
33 43 },
34   - component: () => import('/@/views/project/finance/index.vue'),
  44 + component: () => import('/@/views/project/finance/financeList/index.vue'),
35 45 },
36 46 // {
37   - // path: 'receive',
38   - // name: 'Receive',
39   - // meta: {
40   - // title: '应收款',
41   - // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
42   - // ignoreKeepAlive: false,
43   - // },
44   - // component: () => import('/@/views/project/finance/receive/index.vue'),
45   - // },
46   - // {
47   - // path: 'pay',
48   - // name: 'Pay',
  47 + // path: 'financeProfit',
  48 + // name: 'FinanceProfit',
49 49 // meta: {
50   - // title: '应付款',
  50 + // title: '净利润分析',
51 51 // ignoreKeepAlive: true,
52 52 // roles: [
53 53 // RoleEnum.ADMIN,
... ... @@ -58,7 +58,80 @@ const finance: AppRouteModule = {
58 58 // RoleEnum.DATA_REPORT_USER,
59 59 // ],
60 60 // },
61   - // component: () => import('/@/views/project/finance/pay/index.vue'),
  61 + // children: [
  62 + // // {
  63 + // // path: '',
  64 + // // name: 'Receive',
  65 + // // meta: {
  66 + // // title: '财务管理',
  67 + // // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  68 + // // ignoreKeepAlive: false,
  69 + // // },
  70 + // // // component: () => import('/@/views/project/finance/index.vue'),
  71 + // // },
  72 + // {
  73 + // path: 'serviceProfit',
  74 + // name: 'ServiceProfit',
  75 + // meta: {
  76 + // title: '业务研发净利润分析',
  77 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  78 + // ignoreKeepAlive: false,
  79 + // },
  80 + // children: [
  81 + // {
  82 + // path: 'serviceProfit',
  83 + // name: 'ServiceProfit',
  84 + // meta: {
  85 + // title: '业务研发净利润分析',
  86 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  87 + // ignoreKeepAlive: false,
  88 + // },
  89 + // component: () => import('/@/views/project/finance/financeProfit/index.vue'),
  90 + // },
  91 + // {
  92 + // path: 'serviceProfit',
  93 + // name: 'ServiceProfit',
  94 + // meta: {
  95 + // title: '业务研发净利润分析',
  96 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  97 + // ignoreKeepAlive: false,
  98 + // },
  99 + // component: () => import('/@/views/project/finance/financeProfit/index.vue'),
  100 + // },
  101 + // ],
  102 + // },
  103 + // {
  104 + // path: 'productProfit',
  105 + // name: 'ProductProfit',
  106 + // meta: {
  107 + // title: '内部生产净利润分析',
  108 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  109 + // ignoreKeepAlive: false,
  110 + // },
  111 + // children: [
  112 + // {
  113 + // path: 'serviceProfit',
  114 + // name: 'ServiceProfit',
  115 + // meta: {
  116 + // title: '业务研发净利润分析',
  117 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  118 + // ignoreKeepAlive: false,
  119 + // },
  120 + // component: () => import('/@/views/project/finance/index.vue'),
  121 + // },
  122 + // {
  123 + // path: 'serviceProfit',
  124 + // name: 'ServiceProfit',
  125 + // meta: {
  126 + // title: '业务研发净利润分析',
  127 + // roles: [RoleEnum.ADMIN, RoleEnum.FINANCE, RoleEnum.TRACKER, RoleEnum.BUSINESS],
  128 + // ignoreKeepAlive: false,
  129 + // },
  130 + // component: () => import('/@/views/project/finance/index.vue'),
  131 + // },
  132 + // ],
  133 + // },
  134 + // ],
62 135 // },
63 136 ],
64 137 };
... ...
src/views/project/finance/CheckDetailCheck.vue renamed to src/views/project/finance/financeList/CheckDetailCheck.vue
src/views/project/finance/CheckSumCheck.vue renamed to src/views/project/finance/financeList/CheckSumCheck.vue
... ... @@ -79,11 +79,13 @@
79 79 ];
80 80 // const ids = ref<number[]>([]);
81 81 const ids = ref();
  82 + const orderIds = ref();
82 83 // const res = ref();
83 84  
84 85 const [register, { closeModal }] = useModalInner(async (data) => {
85 86 // ids.value = data.data;
86 87 ids.value = data.data;
  88 + orderIds.value = data.id;
87 89 setTimeout(() => {
88 90 reload();
89 91 }, 50);
... ... @@ -91,7 +93,7 @@
91 93 const [registerTable, { reload }] = useTable({
92 94 // api: () => invoiceAnalysis({ ids: ids.value }),
93 95 api: async () => {
94   - const res = await checkAnalysis({ ids: ids.value });
  96 + const res = await checkAnalysis({ ids: ids.value, orderIds: orderIds.value });
95 97 // 计算合计行
96 98 const sum = {
97 99 productionDepartmentTotalPrice: 0,
... ... @@ -133,7 +135,7 @@
133 135 axios
134 136 .post(
135 137 '/basic-api/order/erp/check_bill/export',
136   - { ids: idss },
  138 + { ids: idss, orderIds: orderIds.value },
137 139 {
138 140 responseType: 'blob', // 设置响应类型为 'blob'
139 141 },
... ...
src/views/project/finance/Commit.vue renamed to src/views/project/finance/financeList/Commit.vue
src/views/project/finance/CommitCheck.vue renamed to src/views/project/finance/financeList/CommitCheck.vue
src/views/project/finance/DeductShow.vue renamed to src/views/project/finance/financeList/DeductShow.vue
src/views/project/finance/DeductShowCheck.vue renamed to src/views/project/finance/financeList/DeductShowCheck.vue
src/views/project/finance/EditRefundTime.vue renamed to src/views/project/finance/financeList/EditRefundTime.vue
src/views/project/finance/EditRefundTimeCheck.vue renamed to src/views/project/finance/financeList/EditRefundTimeCheck.vue
src/views/project/finance/FinanceEdit.vue renamed to src/views/project/finance/financeList/FinanceEdit.vue
src/views/project/finance/FinanceEditCheck.vue renamed to src/views/project/finance/financeList/FinanceEditCheck.vue
src/views/project/finance/InvoiceAnalysis.vue renamed to src/views/project/finance/financeList/InvoiceAnalysis.vue
... ... @@ -87,11 +87,13 @@
87 87 ];
88 88 // const ids = ref<number[]>([]);
89 89 const ids = ref();
  90 + const orderIds = ref();
90 91 const tableData = ref([]);
91 92 // const res = ref();
92 93  
93 94 const [register, { closeModal }] = useModalInner(async (data) => {
94 95 ids.value = data.data;
  96 + orderIds.value = data.id;
95 97 setTimeout(() => {
96 98 reload();
97 99 }, 50);
... ... @@ -99,7 +101,7 @@
99 101 const [registerTable, { reload }] = useTable({
100 102 // api: () => invoiceAnalysis({ ids: ids.value }),
101 103 api: async () => {
102   - const res = await invoiceAnalysis({ ids: ids.value });
  104 + const res = await invoiceAnalysis({ ids: ids.value, orderId: orderIds.value });
103 105 // 计算合计行
104 106 const sum = {
105 107 customerTotalPrice: 0,
... ... @@ -139,7 +141,7 @@
139 141 axios
140 142 .post(
141 143 '/basic-api/order/erp/invoice_bill/export',
142   - { ids: idss },
  144 + { ids: idss, orderId: orderIds.value },
143 145 {
144 146 responseType: 'blob', // 设置响应类型为 'blob'
145 147 },
... ...
src/views/project/finance/InvoiceDetail.vue renamed to src/views/project/finance/financeList/InvoiceDetail.vue
src/views/project/finance/InvoiceShowCheck.vue renamed to src/views/project/finance/financeList/InvoiceShowCheck.vue
src/views/project/finance/InvoiceUploadCheck.vue renamed to src/views/project/finance/financeList/InvoiceUploadCheck.vue
src/views/project/finance/Note.vue renamed to src/views/project/finance/financeList/Note.vue
src/views/project/finance/NoteCheck.vue renamed to src/views/project/finance/financeList/NoteCheck.vue
src/views/project/finance/ReUploadBgUrl.vue renamed to src/views/project/finance/financeList/ReUploadBgUrl.vue
src/views/project/finance/TrackEdit.vue renamed to src/views/project/finance/financeList/TrackEdit.vue
src/views/project/finance/TrackEditCheck.vue renamed to src/views/project/finance/financeList/TrackEditCheck.vue
src/views/project/finance/finance.data.tsx renamed to src/views/project/finance/financeList/finance.data.tsx
... ... @@ -4,6 +4,29 @@ import { icon } from &#39;ant-design-vue&#39;;
4 4 import { FolderAddOutlined, FilePptOutlined } from '@ant-design/icons-vue';
5 5 import { size } from 'lodash-es';
6 6 import { view } from '@/utils/pdfShow';
  7 +import { ref } from 'vue';
  8 +import { queryNoOptions } from '/@/api/project/order';
  9 +import { useOrderStoreWithOut } from '/@/store/modules/order';
  10 +import { useOrderInfo } from '/@/hooks/component/order';
  11 +
  12 +const innerNoOptions = ref([]);
  13 +const projectNoOptions = ref([]);
  14 +const orderStore = useOrderStoreWithOut();
  15 +const {
  16 + customerCode,
  17 + projectNo,
  18 + productionDepartment,
  19 + innerNo,
  20 + poColor,
  21 + cnColor,
  22 + productStyle,
  23 + outboundType,
  24 + packetType,
  25 + ideaSource,
  26 + manualPreform,
  27 + midCheckResult,
  28 + endCheckResult,
  29 +} = useOrderInfo(orderStore);
7 30  
8 31 export const searchFormSchema: FormSchema[] = [
9 32 {
... ... @@ -47,32 +70,57 @@ export const searchFormSchema: FormSchema[] = [
47 70 {
48 71 field: 'customerCode',
49 72 label: '客户编码',
50   - component: 'Input',
  73 + component: 'Select',
51 74 colProps: { span: 8 },
  75 +
  76 + componentProps: {
  77 + options: customerCode,
  78 + showSearch: true,
  79 + mode: 'multiple',
  80 + },
52 81 },
53 82 {
54 83 field: 'projectNo',
55 84 label: '项目号',
56   - component: 'Input',
  85 + component: 'Select',
57 86 colProps: { span: 8 },
  87 +
  88 + componentProps: {
  89 + options: projectNo,
  90 + showSearch: true,
  91 + mode: 'multiple',
  92 + // onSearch: async (value: any) => {
  93 + // projectNoOptions.value = await queryNoOptions('projectNo', value);
  94 + // },
  95 + },
58 96 },
59 97 {
60 98 field: 'productionDepartment',
61 99 label: '生产科',
62   - component: 'Input',
  100 + component: 'Select',
63 101 colProps: { span: 8 },
  102 +
  103 + componentProps: {
  104 + mode: 'multiple',
  105 +
  106 + options: productionDepartment,
  107 + showSearch: true,
  108 + },
64 109 },
65 110 {
66 111 field: 'innerNo',
67 112 label: '内部编号',
68   - component: 'Input',
69   - colProps: { span: 8 },
70   - },
71   - {
72   - field: 'customerPo',
73   - label: '客户PO号',
74   - component: 'Input',
  113 + component: 'Select',
75 114 colProps: { span: 8 },
  115 +
  116 + componentProps: {
  117 + options: innerNo,
  118 + showSearch: true,
  119 + mode: 'multiple',
  120 + // onSearch: async (value: any) => {
  121 + // innerNoOptions.value = await queryNoOptions('innerNo', value);
  122 + // },
  123 + },
76 124 },
77 125 {
78 126 field: 'invoiceStartTime',
... ... @@ -213,6 +261,9 @@ export const columns: BasicColumn[] = [
213 261 title: 'Invoice编号',
214 262 dataIndex: 'invoiceNo',
215 263 width: 180,
  264 + customRender: (column) => {
  265 + return <span style="color: red;">{column.record?.invoiceNo}</span>;
  266 + },
216 267 },
217 268 {
218 269 title: '报关单',
... ... @@ -336,6 +387,9 @@ export const columns: BasicColumn[] = [
336 387 title: 'CheckNo编号',
337 388 dataIndex: 'checkNo',
338 389 width: 120,
  390 + customRender: (column) => {
  391 + return <span style="color: red;">{column.record?.checkNo}</span>;
  392 + },
339 393 },
340 394 {
341 395 title: '生产科应付款日期',
... ...
src/views/project/finance/index.vue renamed to src/views/project/finance/financeList/index.vue
... ... @@ -53,7 +53,7 @@
53 53 title="请确认是否删除?"
54 54 ok-text="是"
55 55 cancel-text="否"
56   - @confirm="handleDeleteInvoiceIds"
  56 + @confirm="handleDeleteCheckIds"
57 57 >
58 58 <a-button type="primary" :style="{ borderRadius: '5px 5px 5px 5px' }"
59 59 >应付款删除</a-button
... ... @@ -63,7 +63,7 @@
63 63 title="请确认是否删除?"
64 64 ok-text="是"
65 65 cancel-text="否"
66   - @confirm="handleDeleteCheckIds"
  66 + @confirm="handleDeleteInvoiceIds"
67 67 >
68 68 <a-button type="primary" :style="{ borderRadius: '5px 5px 5px 5px' }"
69 69 >应收款删除</a-button
... ... @@ -247,7 +247,7 @@
247 247 </div>
248 248 </template>
249 249 <script lang="ts" setup>
250   - import { computed, defineComponent, ref } from 'vue';
  250 + import { computed, defineComponent, onMounted, ref } from 'vue';
251 251 import { BasicTable, useTable, BasicColumn, TableAction } from '/@/components/Table';
252 252 // import { searchFormSchema, columns } from './receive.data';
253 253 import { searchFormSchema, columns } from './finance.data';
... ... @@ -287,6 +287,7 @@
287 287 import { ROLE } from './type.d';
288 288 import { useUserStoreWithOut } from '/@/store/modules/user';
289 289 import { useMessage } from '/@/hooks/web/useMessage';
  290 + import { useOrderStoreWithOut } from '/@/store/modules/order';
290 291  
291 292 const [registerInvoiceAnalysis, { openModal: openInvoiceAnalysis }] = useModal();
292 293 const [registerFinanceEdit, { openDrawer: openFinanceEdit }] = useDrawer();
... ... @@ -310,6 +311,7 @@
310 311 const checkedKeys = ref<Array<string | number>>([]);
311 312 const invoiceIdKeys = ref<Array<string | number>>([]);
312 313 const checkIdKeys = ref<Array<string | number>>([]);
  314 + const orderStore = useOrderStoreWithOut();
313 315 const userStore = useUserStoreWithOut();
314 316 const user = userStore.getUserInfo;
315 317 const role = computed(() => {
... ... @@ -347,9 +349,12 @@
347 349 // },
348 350 });
349 351  
  352 + onMounted(async () => {
  353 + await orderStore.getDict();
  354 + });
  355 +
350 356 // 单选函数
351 357 async function onSelect(record, selected: boolean) {
352   -
353 358 if (selected) {
354 359 checkedKeys.value = [...checkedKeys.value, record.id];
355 360  
... ... @@ -484,6 +489,7 @@
484 489 }
485 490 openInvoiceAnalysis(true, {
486 491 data: invoiceIdKeys.value,
  492 + id: checkedKeys.value,
487 493 });
488 494 }
489 495  
... ... @@ -545,6 +551,7 @@
545 551 }
546 552 openCheckSumCheck(true, {
547 553 data: checkIdKeys.value,
  554 + id: checkedKeys.value,
548 555 });
549 556 }
550 557 </script>
... ...
src/views/project/finance/type.d.ts renamed to src/views/project/finance/financeList/type.d.ts
src/views/project/order/InvoiceCreate.vue
... ... @@ -34,9 +34,11 @@
34 34 import { computed, ref } from 'vue';
35 35 import type { UploadProps } from 'ant-design-vue';
36 36 import { getRefundDate, getInvoice, createInvoice } from '@/api/project/invoice';
  37 + import { useMessage } from '/@/hooks/web/useMessage';
37 38  
38 39 const fileList = ref<UploadProps['fileList']>([]);
39   -
  40 + const { createMessage } = useMessage();
  41 + const { error } = createMessage;
40 42 const Input1 = ref('');
41 43 const Input2 = ref();
42 44 const uploadUrl = ref('http://47.104.8.35:8081/api/localStorage/upload_file_oss?name=');
... ... @@ -50,7 +52,16 @@
50 52 orderIds.value = data.data;
51 53 });
52 54 // const title = ref('');
  55 + const isDisabled = ref(false);
53 56 async function handleOk() {
  57 + if (isDisabled.value) {
  58 + error('请勿连续点击生成按钮,需要等待三秒再点击生成');
  59 + return;
  60 + }
  61 + isDisabled.value = true;
  62 + setTimeout(() => {
  63 + isDisabled.value = false;
  64 + }, 3000);
54 65 await createInvoice({
55 66 invoiceNo: Input1.value,
56 67 bgUrl: bgUrl.value,
... ...
src/views/project/order/ProductInvoice.vue
... ... @@ -40,7 +40,10 @@
40 40 import { BasicModal, useModalInner } from '@/components/Modal';
41 41 import { computed, ref } from 'vue';
42 42 import { payDate, checkCreate } from '@/api/project/invoice';
  43 + import { useMessage } from '/@/hooks/web/useMessage';
43 44  
  45 + const { createMessage } = useMessage();
  46 + const { error } = createMessage;
44 47 const Input1 = ref('');
45 48 const Input2 = ref();
46 49 const res = ref();
... ... @@ -48,7 +51,17 @@
48 51 res.value = data.data;
49 52 Input2.value = await payDate({ orderIds: res.value });
50 53 });
  54 + const isDisabled = ref(false);
  55 +
51 56 async function handleOk() {
  57 + if (isDisabled.value) {
  58 + error('请勿连续点击生成按钮,需要等待三秒再点击生成');
  59 + return;
  60 + }
  61 + isDisabled.value = true;
  62 + setTimeout(() => {
  63 + isDisabled.value = false;
  64 + }, 3000);
52 65 await checkCreate({
53 66 orderIds: res.value,
54 67 payedDate: Input2.value,
... ...
vite.config.ts
... ... @@ -31,7 +31,7 @@ export default defineApplicationConfig({
31 31 },
32 32 '/basic-api/order': {
33 33 target: 'http://47.104.8.35:18000',
34   - // target: 'http://localhost:18001',
  34 + // target: 'http://localhost:18000',
35 35 // target: 'http://39.108.227.113:8000',
36 36 // target: 'http://localhost:8000',
37 37 // target: 'http://39.108.227.113:3000/mock/35',
... ... @@ -42,7 +42,7 @@ export default defineApplicationConfig({
42 42 },
43 43 '/api/localStorage/upload': {
44 44 target: 'http://47.104.8.35:18000',
45   - // target: 'http://localhost:18001',
  45 + // target: 'http://localhost:18000',
46 46 // target: 'http://39.108.227.113:8000',
47 47 // target: '192.168.31.250:18000',
48 48 // target: 'http://localhost:8000',
... ...