mg-ocr-invoice 0.1.8 → 0.2.0
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.
- package/dist/index.es.js +4835 -5383
- package/dist/index.umd.js +35 -35
- package/dist/style.css +1 -1
- package/dist/types/components/OCRInvoice/index.vue.d.ts +6 -0
- package/dist/types/components/PaymentMode/index.vue.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/InvoiceList/const.ts +2 -2
- package/src/components/InvoiceList/index.vue +10 -3
- package/src/components/OCRInvoice/index.vue +5 -1
- package/src/components/PaymentMode/index.vue +6 -2
|
@@ -13,6 +13,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
OCR_AuthDomain: {
|
|
14
14
|
required: false;
|
|
15
15
|
};
|
|
16
|
+
batchId: {
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
16
19
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "submit"[], "submit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
20
|
token: {
|
|
18
21
|
required: false;
|
|
@@ -28,6 +31,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
31
|
OCR_AuthDomain: {
|
|
29
32
|
required: false;
|
|
30
33
|
};
|
|
34
|
+
batchId: {
|
|
35
|
+
required: false;
|
|
36
|
+
};
|
|
31
37
|
}>> & {
|
|
32
38
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
33
39
|
}, {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import '@/utils/disableZoom';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<Readonly<{
|
|
3
3
|
multiple?: any;
|
|
4
|
+
batchId?: any;
|
|
4
5
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "uploadSuccess"[], "uploadSuccess", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
|
|
5
6
|
multiple?: any;
|
|
7
|
+
batchId?: any;
|
|
6
8
|
}>>> & {
|
|
7
9
|
onUploadSuccess?: ((...args: any[]) => any) | undefined;
|
|
8
10
|
}, {
|
|
9
11
|
readonly multiple?: any;
|
|
12
|
+
readonly batchId?: any;
|
|
10
13
|
}, {}>;
|
|
11
14
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const const_invoiceStatus: any = {
|
|
2
|
-
invalid: '
|
|
2
|
+
invalid: '异常发票',
|
|
3
3
|
unused: '未使用',
|
|
4
4
|
using: '使用中',
|
|
5
5
|
used: '已使用',
|
|
@@ -8,7 +8,7 @@ export const const_realStatus: any = {
|
|
|
8
8
|
noNeed: '无需验真',
|
|
9
9
|
notCheck: '未验真',
|
|
10
10
|
checked: '已验真',
|
|
11
|
-
checkFail: '
|
|
11
|
+
checkFail: '验真异常',
|
|
12
12
|
}
|
|
13
13
|
export const const_taskStatus: any = {
|
|
14
14
|
init: '初始状态',
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
<Loading class="loading" color="#0094ff">上传中...</Loading>
|
|
136
136
|
</Overlay>
|
|
137
137
|
</template>
|
|
138
|
-
<!--
|
|
138
|
+
<!-- 异常发票, 已使用的, 使用中的, 识别失败 禁止提交 -->
|
|
139
139
|
<script setup lang="ts">
|
|
140
140
|
import 'vant/lib/index.css'
|
|
141
141
|
import { ref, onMounted, computed } from 'vue'
|
|
@@ -280,7 +280,14 @@ const submitBtn = computed(() => {
|
|
|
280
280
|
item.invoiceStatus === 'unused' &&
|
|
281
281
|
(item.taskStatus === 'ocr_success' ||
|
|
282
282
|
item.taskStatus === 'repeat' ||
|
|
283
|
-
item.taskStatus === 'finish'
|
|
283
|
+
item.taskStatus === 'finish' ||
|
|
284
|
+
item.invoiceStatus === 'invalid' ||
|
|
285
|
+
item.invoiceStatus === 'invalid' ||
|
|
286
|
+
item.invoiceStatus === 'used' ||
|
|
287
|
+
item.realStatus === 'noNeed' ||
|
|
288
|
+
item.realStatus === 'notCheck' ||
|
|
289
|
+
item.realStatus === 'checked' ||
|
|
290
|
+
item.realStatus === 'checkFail')
|
|
284
291
|
)
|
|
285
292
|
})
|
|
286
293
|
return flag && list.value.filter((item) => item.selected).length > 0
|
|
@@ -292,7 +299,7 @@ const ok = () => {
|
|
|
292
299
|
return
|
|
293
300
|
}
|
|
294
301
|
if (!submitBtn.value) {
|
|
295
|
-
showToast({ type: 'text', message: '
|
|
302
|
+
showToast({ type: 'text', message: '存在异常发票,无法提交' })
|
|
296
303
|
return
|
|
297
304
|
}
|
|
298
305
|
// showDeleteBtn.value = false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="OCRInvoice">
|
|
3
3
|
<PaymentMode
|
|
4
|
+
:batchId="batchId"
|
|
4
5
|
:multiple="multiple"
|
|
5
6
|
@uploadSuccess="uploadSuccess"
|
|
6
7
|
v-if="activePage === 1"></PaymentMode>
|
|
@@ -34,7 +35,7 @@ const setLog = () => {
|
|
|
34
35
|
}
|
|
35
36
|
setLog()
|
|
36
37
|
const emit = defineEmits(['submit'])
|
|
37
|
-
const { token, multiple, Base_URL, OCR_AuthDomain } = defineProps({
|
|
38
|
+
const { token, multiple, Base_URL, OCR_AuthDomain, batchId } = defineProps({
|
|
38
39
|
token: {
|
|
39
40
|
required: false,
|
|
40
41
|
type: String,
|
|
@@ -49,6 +50,9 @@ const { token, multiple, Base_URL, OCR_AuthDomain } = defineProps({
|
|
|
49
50
|
OCR_AuthDomain: {
|
|
50
51
|
required: false,
|
|
51
52
|
},
|
|
53
|
+
batchId: {
|
|
54
|
+
required: false,
|
|
55
|
+
},
|
|
52
56
|
})
|
|
53
57
|
const tempToken =
|
|
54
58
|
'z7v5gIDRD-sMhb9lRaspBmrWU8y--e5YK2xqWxMCIMTqBReMcoHNTJQ3XyNBdHmLVHiwommCp-HtP4wWSiK9oZDwTWvCW9CZswjLNNL4nGM'
|
|
@@ -32,7 +32,7 @@ import '@/utils/disableZoom'
|
|
|
32
32
|
import { selectPhoto, takePhoto } from '@/utils/upload'
|
|
33
33
|
import { __uploadInvoice } from '@/api/invoice'
|
|
34
34
|
import { showToast, Overlay, Loading, showFailToast } from 'vant'
|
|
35
|
-
const
|
|
35
|
+
const props = defineProps(['multiple', 'batchId'])
|
|
36
36
|
const emit = defineEmits(['uploadSuccess'])
|
|
37
37
|
const payList: any = [
|
|
38
38
|
{
|
|
@@ -60,8 +60,12 @@ const handleClickText = async (text: any) => {
|
|
|
60
60
|
fd = await takePhoto()
|
|
61
61
|
}
|
|
62
62
|
if (text == '相册') {
|
|
63
|
-
fd = await selectPhoto(multiple)
|
|
63
|
+
fd = await selectPhoto(props.multiple)
|
|
64
64
|
}
|
|
65
|
+
if (props.batchId) {
|
|
66
|
+
fd.append('batchId', props.batchId)
|
|
67
|
+
}
|
|
68
|
+
console.log(props.batchId,'props.batchIdprops.batchIdprops.batchId')
|
|
65
69
|
showLoading.value = true
|
|
66
70
|
try {
|
|
67
71
|
const res: any = await __uploadInvoice(fd)
|