Commit cf269d58b36b1022a7cfe6eabad83a8a46f0c6be
1 parent
95d5c63d
feat: 增加最终状态
Showing
3 changed files
with
104 additions
and
0 deletions
src/api/project/invoice.ts
... | ... | @@ -19,6 +19,7 @@ enum Api { |
19 | 19 | SETBACKREFUNDDATE = '/order/erp/invoice_bill/setBackRefundDate', //必须回款日期 |
20 | 20 | NOTE = '/order/erp/invoice_bill/notes', //备注 |
21 | 21 | DELETEDEDUCT = '/order/erp/invoice_bill/deleteDeductUrl_by_id', //扣款单删除 |
22 | + SETINVOICEFINISHSTATUS = '/order/erp/invoice_bill/setFinishStatus', //设置invoice为最终完成状态(手动设置)。 | |
22 | 23 | |
23 | 24 | PRODUCT_CREATE = '/order/erp/check_bill/create', //创建生产科应付单据 |
24 | 25 | PAYED_DATE = '/order/erp/check_bill/get_payed_date', //获取生产科应回款日期 |
... | ... | @@ -37,6 +38,7 @@ enum Api { |
37 | 38 | SETPADYEDDATE = '/order/erp/check_bill/setPayedDate', //修改应付款日期 |
38 | 39 | CHECKNOTE = '/order/erp/check_bill/notes', //备注 |
39 | 40 | CHECKDELETEDEDUCT = '/order/erp/check_bill/deleteDeductUrl_by_id', //扣款单删除 |
41 | + SETCHECKFINISHSTATUS = '/order/erp/check_bill/setFinishStatus', //设置check对账单为最终完成状态(手动设置)。 | |
40 | 42 | |
41 | 43 | PACKAGEPROFIT = '/order/cost/BusinessProfitDetail/listByPage', //包装费用明细表 |
42 | 44 | INNERPROFIT = '/order/cost/InnerProfitDetail/listByPage', //内部生产费用明细表 |
... | ... | @@ -461,3 +463,17 @@ export const checkDeleteDeduct = async (params: any) => { |
461 | 463 | params, |
462 | 464 | }); |
463 | 465 | }; |
466 | + | |
467 | +export const invoiceSetFinishStatus = async (params: any) => { | |
468 | + return await defHttp.post<any>({ | |
469 | + url: Api.SETINVOICEFINISHSTATUS, | |
470 | + params, | |
471 | + }); | |
472 | +}; | |
473 | + | |
474 | +export const checkSetFinishStatus = async (params: any) => { | |
475 | + return await defHttp.post<any>({ | |
476 | + url: Api.SETCHECKFINISHSTATUS, | |
477 | + params, | |
478 | + }); | |
479 | +}; | |
464 | 480 | \ No newline at end of file | ... | ... |
src/views/project/finance/financeList/finance.data.tsx
... | ... | @@ -57,6 +57,30 @@ export const searchFormSchema: FormSchema[] = [ |
57 | 57 | }, |
58 | 58 | }, |
59 | 59 | { |
60 | + field: 'invoiceFinishStatus', | |
61 | + label: 'invoice最终状态', | |
62 | + component: 'Select', | |
63 | + colProps: { span: 8 }, | |
64 | + componentProps: { | |
65 | + options: [ | |
66 | + { label: '未完成', value: 0 }, | |
67 | + { label: '已完成', value: 10 }, | |
68 | + ], | |
69 | + }, | |
70 | + }, | |
71 | + { | |
72 | + field: 'checkFinishStatus', | |
73 | + label: 'checkNo最终状态', | |
74 | + component: 'Select', | |
75 | + colProps: { span: 8 }, | |
76 | + componentProps: { | |
77 | + options: [ | |
78 | + { label: '未完成', value: 0 }, | |
79 | + { label: '已完成', value: 10 }, | |
80 | + ], | |
81 | + }, | |
82 | + }, | |
83 | + { | |
60 | 84 | field: 'customerCode', |
61 | 85 | label: '客户编码', |
62 | 86 | component: 'Select', |
... | ... | @@ -367,6 +391,23 @@ export const columns: BasicColumn[] = [ |
367 | 391 | }, |
368 | 392 | }, |
369 | 393 | { |
394 | + title: '最终状态', | |
395 | + dataIndex: 'invoiceFinishStatus', | |
396 | + width: 120, | |
397 | + customRender: (column) => { | |
398 | + let statusText = ''; | |
399 | + let statusColor = ''; | |
400 | + if (column.record.invoiceFinishStatus == null || column.record.invoiceFinishStatus == undefined || column.record.invoiceFinishStatus == 0) { | |
401 | + statusText = '未完成'; | |
402 | + statusColor = 'red'; // 设置红色 | |
403 | + } else if (column.record.checkFinishStatus == 10) { | |
404 | + statusText = '已完成'; | |
405 | + statusColor = 'green'; // 设置绿色 | |
406 | + } | |
407 | + return <span style={{ color: statusColor }}>{statusText}</span>; | |
408 | + }, | |
409 | + }, | |
410 | + { | |
370 | 411 | title: 'Action', |
371 | 412 | key: 'action', // 对应 #bodyCell 中的 column.key |
372 | 413 | width: 280, |
... | ... | @@ -503,6 +544,23 @@ export const columns: BasicColumn[] = [ |
503 | 544 | }, |
504 | 545 | }, |
505 | 546 | { |
547 | + title: '最终状态', | |
548 | + dataIndex: 'checkFinishStatus', | |
549 | + width: 120, | |
550 | + customRender: (column) => { | |
551 | + let statusText = ''; | |
552 | + let statusColor = ''; | |
553 | + if (column.record.checkFinishStatus == null || column.record.checkFinishStatus == undefined || column.record.checkFinishStatus == 0) { | |
554 | + statusText = '未完成'; | |
555 | + statusColor = 'red'; // 设置红色 | |
556 | + } else if (column.record.checkFinishStatus == 10) { | |
557 | + statusText = '已完成'; | |
558 | + statusColor = 'green'; // 设置绿色 | |
559 | + } | |
560 | + return <span style={{ color: statusColor }}>{statusText}</span>; | |
561 | + }, | |
562 | + }, | |
563 | + { | |
506 | 564 | title: 'Action', |
507 | 565 | key: 'action2', // 对应 #bodyCell 中的 column.key |
508 | 566 | width: 280, | ... | ... |
src/views/project/finance/financeList/index.vue
... | ... | @@ -168,6 +168,14 @@ |
168 | 168 | }, |
169 | 169 | ] |
170 | 170 | : []), |
171 | + ...(role == ROLE.ADMIN | |
172 | + ? [ | |
173 | + { | |
174 | + label: '设置invoice最终完成', | |
175 | + onClick: handleInvoiceSetFinishStatus.bind(null, record), | |
176 | + }, | |
177 | + ] | |
178 | + : []), | |
171 | 179 | ]" |
172 | 180 | /> |
173 | 181 | </template> |
... | ... | @@ -250,6 +258,14 @@ |
250 | 258 | }, |
251 | 259 | ] |
252 | 260 | : []), |
261 | + ...(role == ROLE.ADMIN | |
262 | + ? [ | |
263 | + { | |
264 | + label: '设置对账单最终完成', | |
265 | + onClick: handleCheckSetFinishStatus.bind(null, record), | |
266 | + }, | |
267 | + ] | |
268 | + : []), | |
253 | 269 | ]" |
254 | 270 | /> |
255 | 271 | <TableAction |
... | ... | @@ -306,6 +322,8 @@ |
306 | 322 | getBaseInvoice, |
307 | 323 | deleteDeduct, |
308 | 324 | checkDeleteDeduct, |
325 | + invoiceSetFinishStatus, | |
326 | + checkSetFinishStatus, | |
309 | 327 | } from '@/api/project/invoice'; |
310 | 328 | import { useModal } from '/@/components/Modal'; |
311 | 329 | import { CheckOutlined, FilePptOutlined } from '@ant-design/icons-vue'; |
... | ... | @@ -579,4 +597,16 @@ |
579 | 597 | id: checkedKeys.value, |
580 | 598 | }); |
581 | 599 | } |
600 | + function handleInvoiceSetFinishStatus(record) { | |
601 | + invoiceSetFinishStatus({id:record.invoiceId}); | |
602 | + setTimeout(() => { | |
603 | + reloadTable(); | |
604 | + }, 50); | |
605 | + } | |
606 | + function handleCheckSetFinishStatus(record) { | |
607 | + checkSetFinishStatus({id:record.checkId}); | |
608 | + setTimeout(() => { | |
609 | + reloadTable(); | |
610 | + }, 50); | |
611 | + } | |
582 | 612 | </script> | ... | ... |