mg-ocr-invoice 0.2.4-beta0.8 → 0.2.5

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.
@@ -4,3 +4,4 @@ export declare const const_invoiceExceptionInfo: any;
4
4
  export declare const const_manualModify: any;
5
5
  export declare const const_taskStatus: any;
6
6
  export declare const setClass: (type: any) => "error" | "warning" | "ok" | "default";
7
+ export declare const VerificationOfTruth: (obj: any) => any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mg-ocr-invoice",
3
3
  "private": false,
4
- "version": "0.2.4-beta0.8",
4
+ "version": "0.2.5",
5
5
  "type": "module",
6
6
  "types": "dist/types/index.d.ts",
7
7
  "module": "dist/index.es.js",
@@ -55,3 +55,27 @@ export const setClass = (type: any) => {
55
55
  return 'ok'
56
56
  }
57
57
  }
58
+
59
+ export const VerificationOfTruth = (obj: any) => {
60
+ // 验真状态 1,绿色 2,黄色, 3,红色
61
+ let data: any = {}
62
+ if (
63
+ obj.realStatus === 'checked' ||
64
+ (obj.realStatus === 'noNeed' && !obj.manualModify)
65
+ ) {
66
+ data.verifyTruth = 1
67
+ } else if (obj.manualModify) {
68
+ data.verifyTruth = 2
69
+ } else {
70
+ data.verifyTruth = 3
71
+ }
72
+ // 验重状态 1,绿色 2,黄色, 3,红色
73
+ if (obj.invoiceStatus === 'unused') {
74
+ data.checkWeight = 1
75
+ } else if (obj.invoiceStatus === 'invalid') {
76
+ data.checkWeight = 2
77
+ } else {
78
+ data.checkWeight = 3
79
+ }
80
+ return data
81
+ }
@@ -192,6 +192,7 @@ import {
192
192
  const_taskStatus,
193
193
  const_invoiceExceptionInfo,
194
194
  setClass,
195
+ VerificationOfTruth,
195
196
  } from './const'
196
197
  import { showImagePreview } from 'vant'
197
198
  const emit = defineEmits(['edit', 'ok'])
@@ -379,29 +380,11 @@ const ok = () => {
379
380
  const selectData = list.value
380
381
  .filter((item: any) => item.selected)
381
382
  .map((item: any) => {
382
- let obj: any = { ...item }
383
- // 验真状态 1,绿色 2,黄色, 3,红色
384
- if (
385
- item.realStatus === 'checked' ||
386
- (item.realStatus === 'noNeed' && !item.manualModify)
387
- ) {
388
- obj.verifyTruth = 1
389
- } else if (item.manualModify) {
390
- obj.verifyTruth = 2
391
- } else {
392
- obj.verifyTruth = 3
393
- }
394
- // 验重状态 1,绿色 2,黄色, 3,红色
395
- if (item.invoiceStatus === 'unused') {
396
- obj.checkWeight = 1
397
- } else if (item.invoiceStatus === 'invalid') {
398
- obj.checkWeight = 2
399
- } else {
400
- obj.checkWeight = 3
401
- }
383
+ VerificationOfTruth
384
+ let data = VerificationOfTruth(item)
385
+ let obj: any = { ...item, ...data }
402
386
  return obj
403
387
  })
404
- console.log(selectData, 'selectData')
405
388
  emit('ok', selectData, batchId.value)
406
389
  }
407
390
  const timeID: any = ref(null)