mg-ocr-invoice 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,79 +1,79 @@
1
- export const const_invoiceStatus: any = {
2
- invalid: '异常发票',
3
- unused: '未使用',
4
- using: '使用中',
5
- used: '已使用',
6
- }
7
- export const const_realStatus: any = {
8
- noNeed: '无需验真',
9
- notCheck: '未验真',
10
- checked: '验真通过',
11
- checkFail: '验真异常',
12
- }
13
- export const const_invoiceExceptionInfo: any = {
14
- abnormal: '异常发票',
15
- invalid: '无效发票',
16
- }
17
- export const const_manualModify: any = {
18
- 手动录入: true,
19
- 非手动录入: false,
20
- }
21
- export const const_taskStatus: any = {
22
- init: '初始状态',
23
- upload_fail_cos: 'COS 上传失败',
24
- upload_fail_nuonuo: '诺诺上传失败',
25
- initiate_ocr_fail: '发起识别失败',
26
- ocr_doing: '识别中',
27
- ocr_fail: '识别失败',
28
- ocr_success: '识别成功',
29
- repeat: '数据库存在相同发票',
30
- finish: '处理正常结束',
31
- }
32
- export const setClass = (type: any) => {
33
- switch (type) {
34
- case 'invalid':
35
- return 'error'
36
- case 'unused':
37
- return 'ok'
38
- case 'using':
39
- return 'error'
40
- case 'used':
41
- return 'default'
42
- case 'noNeed':
43
- return 'ok'
44
- case 'notCheck':
45
- return 'warning'
46
- case 'checked':
47
- return 'ok'
48
- case 'checkFail':
49
- return 'error'
50
- case 'abnormal':
51
- return 'error'
52
- default:
53
- return 'ok'
54
- }
55
- }
56
-
57
- export const VerificationOfTruth = (obj: any) => {
58
- // 验真状态 1,绿色 2,黄色, 3,红色
59
- let data: any = {}
60
- if (
61
- obj.realStatus === 'checked' ||
62
- (obj.realStatus === 'noNeed' && !obj.manualModify)
63
- ) {
64
- data.verifyTruth = 1
65
- } else if (obj.manualModify) {
66
- data.verifyTruth = 2
67
- } else {
68
- data.verifyTruth = 3
69
- }
70
- // 验重状态 1,绿色 2,黄色, 3,红色
71
- if (obj.invoiceStatus === 'unused') {
72
- data.checkWeight = 1
73
- } else if (obj.invoiceStatus === 'invalid') {
74
- data.checkWeight = 2
75
- } else {
76
- data.checkWeight = 3
77
- }
78
- return data
79
- }
1
+ export const const_invoiceStatus: any = {
2
+ invalid: '异常发票',
3
+ unused: '未使用',
4
+ using: '使用中',
5
+ used: '已使用',
6
+ }
7
+ export const const_realStatus: any = {
8
+ noNeed: '无需验真',
9
+ notCheck: '未验真',
10
+ checked: '验真通过',
11
+ checkFail: '验真异常',
12
+ }
13
+ export const const_invoiceExceptionInfo: any = {
14
+ abnormal: '异常发票',
15
+ invalid: '无效发票',
16
+ }
17
+ export const const_manualModify: any = {
18
+ 手动录入: true,
19
+ 非手动录入: false,
20
+ }
21
+ export const const_taskStatus: any = {
22
+ init: '初始状态',
23
+ upload_fail_cos: 'COS 上传失败',
24
+ upload_fail_nuonuo: '诺诺上传失败',
25
+ initiate_ocr_fail: '发起识别失败',
26
+ ocr_doing: '识别中',
27
+ ocr_fail: '识别失败',
28
+ ocr_success: '识别成功',
29
+ repeat: '数据库存在相同发票',
30
+ finish: '处理正常结束',
31
+ }
32
+ export const setClass = (type: any) => {
33
+ switch (type) {
34
+ case 'invalid':
35
+ return 'error'
36
+ case 'unused':
37
+ return 'ok'
38
+ case 'using':
39
+ return 'error'
40
+ case 'used':
41
+ return 'default'
42
+ case 'noNeed':
43
+ return 'ok'
44
+ case 'notCheck':
45
+ return 'warning'
46
+ case 'checked':
47
+ return 'ok'
48
+ case 'checkFail':
49
+ return 'error'
50
+ case 'abnormal':
51
+ return 'error'
52
+ default:
53
+ return 'ok'
54
+ }
55
+ }
56
+
57
+ export const VerificationOfTruth = (obj: any) => {
58
+ // 验真状态 1,绿色 2,黄色, 3,红色
59
+ let data: any = {}
60
+ if (
61
+ obj.realStatus === 'checked' ||
62
+ (obj.realStatus === 'noNeed' && !obj.manualModify)
63
+ ) {
64
+ data.verifyTruth = 1
65
+ } else if (obj.manualModify) {
66
+ data.verifyTruth = 2
67
+ } else {
68
+ data.verifyTruth = 3
69
+ }
70
+ // 验重状态 1,绿色 2,黄色, 3,红色
71
+ if (obj.invoiceStatus === 'unused') {
72
+ data.checkWeight = 1
73
+ } else if (obj.invoiceStatus === 'invalid') {
74
+ data.checkWeight = 2
75
+ } else {
76
+ data.checkWeight = 3
77
+ }
78
+ return data
79
+ }