mg-ocr-invoice 0.4.1 → 0.4.4
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 +3888 -3612
- package/dist/index.umd.js +36 -35
- package/dist/style.css +1 -1
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/main.d.ts +1 -2
- package/dist/types/styles/vantimpCss.d.ts +15 -0
- package/package.json +2 -2
- package/src/components/Invoice/index.vue +21 -9
- package/src/components/InvoiceList/index.vue +30 -13
- package/src/components/PaymentMode/index.vue +12 -5
- package/src/components/index.ts +0 -1
|
@@ -2,5 +2,4 @@ import Invoice from './Invoice/index.vue';
|
|
|
2
2
|
import InvoiceList from './InvoiceList/index.vue';
|
|
3
3
|
import PaymentMode from './PaymentMode/index.vue';
|
|
4
4
|
import OCRInvoice from './OCRInvoice/index.vue';
|
|
5
|
-
import 'vant/lib/index.css';
|
|
6
5
|
export { Invoice, InvoiceList, PaymentMode, OCRInvoice };
|
package/dist/types/main.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'vant/lib/overlay/index.css';
|
|
2
|
+
import 'vant/lib/loading/index.css';
|
|
3
|
+
import 'vant/lib/image-preview/index.css';
|
|
4
|
+
import 'vant/lib/cell-group/index.css';
|
|
5
|
+
import 'vant/lib/field/index.css';
|
|
6
|
+
import 'vant/lib/form/style/index';
|
|
7
|
+
import 'vant/lib/icon/index.css';
|
|
8
|
+
import 'vant/lib/button/index.css';
|
|
9
|
+
import 'vant/lib/action-sheet/index.css';
|
|
10
|
+
import 'vant/lib/cell/index.css';
|
|
11
|
+
import 'vant/lib/popup/index.css';
|
|
12
|
+
import 'vant/lib/skeleton/index.css';
|
|
13
|
+
import 'vant/lib/dialog/index.css';
|
|
14
|
+
import 'vant/es/toast/index.css';
|
|
15
|
+
import 'vant/lib/skeleton-paragraph/index.css';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mg-ocr-invoice",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"sass": "^1.69.5",
|
|
37
37
|
"typescript": "^5.0.2",
|
|
38
38
|
"vite": "^4.3.9",
|
|
39
|
-
"vue-tsc": "^
|
|
39
|
+
"vue-tsc": "^2.0.24"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"sass": "^1.63.2"
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
@click="openEditpopUp(item, index)">
|
|
159
159
|
<td>{{ item.itemExTaxAmount }}</td>
|
|
160
160
|
<td>{{ item.itemTaxRate }}</td>
|
|
161
|
-
<td>{{item.itemTaxAmount}}</td>
|
|
161
|
+
<td>{{ item.itemTaxAmount }}</td>
|
|
162
162
|
</tr>
|
|
163
163
|
</tbody>
|
|
164
164
|
</table>
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
</Form>
|
|
222
222
|
</div>
|
|
223
223
|
</div>
|
|
224
|
-
<ActionSheet v-model:show="showEdit" :title="editTitle(titleIndex)">
|
|
224
|
+
<ActionSheet :z-index="9527" v-model:show="showEdit" :title="editTitle(titleIndex)">
|
|
225
225
|
<div class="content">
|
|
226
226
|
<Form ref="REF_editForm">
|
|
227
227
|
<Field
|
|
@@ -244,6 +244,7 @@
|
|
|
244
244
|
</div>
|
|
245
245
|
</ActionSheet>
|
|
246
246
|
<Overlay
|
|
247
|
+
:z-index="9527"
|
|
247
248
|
style="
|
|
248
249
|
display: flex;
|
|
249
250
|
justify-content: center;
|
|
@@ -262,7 +263,6 @@ import {
|
|
|
262
263
|
showToast,
|
|
263
264
|
Overlay,
|
|
264
265
|
Loading,
|
|
265
|
-
showFailToast,
|
|
266
266
|
showImagePreview,
|
|
267
267
|
CellGroup,
|
|
268
268
|
Field,
|
|
@@ -291,7 +291,7 @@ const formData = ref({
|
|
|
291
291
|
detailCode: '',
|
|
292
292
|
itemExTaxAmount: 0,
|
|
293
293
|
itemTaxRate: 0,
|
|
294
|
-
itemTaxAmount:0
|
|
294
|
+
itemTaxAmount: 0,
|
|
295
295
|
},
|
|
296
296
|
],
|
|
297
297
|
payerReq: {
|
|
@@ -326,7 +326,7 @@ const isEdit = computed(() => {
|
|
|
326
326
|
props.invoiceData.realStatus === 'noNeed' ||
|
|
327
327
|
props.invoiceData.invoiceExceptionInfo === 'abnormal' ||
|
|
328
328
|
props.invoiceData.manualModify ||
|
|
329
|
-
props.invoiceData.realStatus === 'checkFail'||
|
|
329
|
+
props.invoiceData.realStatus === 'checkFail' ||
|
|
330
330
|
props.invoiceData.realStatus === 'notCheck'
|
|
331
331
|
)
|
|
332
332
|
})
|
|
@@ -339,11 +339,17 @@ const submit = async () => {
|
|
|
339
339
|
type: 'success',
|
|
340
340
|
message: '保存成功',
|
|
341
341
|
teleport: Cookies.get('teleport') || null,
|
|
342
|
+
zIndex: 9527,
|
|
342
343
|
})
|
|
343
344
|
emit('saveSuccess')
|
|
344
345
|
}
|
|
345
346
|
} catch (err: any) {
|
|
346
|
-
|
|
347
|
+
showToast({
|
|
348
|
+
type: 'fail',
|
|
349
|
+
message: err.msg,
|
|
350
|
+
teleport: Cookies.get('teleport') || null,
|
|
351
|
+
zIndex: 9527,
|
|
352
|
+
})
|
|
347
353
|
emit('saveSuccess')
|
|
348
354
|
}
|
|
349
355
|
showLoading.value = false
|
|
@@ -373,7 +379,7 @@ const initData = () => {
|
|
|
373
379
|
detailCode: item.code,
|
|
374
380
|
itemExTaxAmount: item.itemExTaxAmount,
|
|
375
381
|
itemTaxRate: item.itemTaxRate.replace(/%/g, ''),
|
|
376
|
-
itemTaxAmount:item.itemTaxAmount
|
|
382
|
+
itemTaxAmount: item.itemTaxAmount,
|
|
377
383
|
}
|
|
378
384
|
})
|
|
379
385
|
}
|
|
@@ -396,7 +402,11 @@ const confirmEdit = () => {
|
|
|
396
402
|
activeRow.value.itemExTaxAmount
|
|
397
403
|
formData.value.itemAmountReqs[titleIndex.value].itemTaxRate =
|
|
398
404
|
activeRow.value.itemTaxRate
|
|
399
|
-
formData.value.itemAmountReqs[titleIndex.value].itemTaxAmount = Number(
|
|
405
|
+
formData.value.itemAmountReqs[titleIndex.value].itemTaxAmount = Number(
|
|
406
|
+
new Decimal(filterNumber(activeRow.value.itemExTaxAmount))
|
|
407
|
+
.times(new Decimal(filterNumber(activeRow.value.itemTaxRate / 100)))
|
|
408
|
+
.toFixed(2)
|
|
409
|
+
)
|
|
400
410
|
showEdit.value = false
|
|
401
411
|
}
|
|
402
412
|
const blurInput = (e: any, key: any) => {
|
|
@@ -414,7 +424,9 @@ const computed_amount = computed(() => {
|
|
|
414
424
|
// new Decimal(filterNumber(item.itemExTaxAmount)).plus(tax_amount)
|
|
415
425
|
// )
|
|
416
426
|
count = count.plus(
|
|
417
|
-
new Decimal(filterNumber(item.itemExTaxAmount)).plus(
|
|
427
|
+
new Decimal(filterNumber(item.itemExTaxAmount)).plus(
|
|
428
|
+
new Decimal(item.itemTaxAmount)
|
|
429
|
+
)
|
|
418
430
|
)
|
|
419
431
|
})
|
|
420
432
|
return count.toFixed(2)
|
|
@@ -12,14 +12,8 @@
|
|
|
12
12
|
v-model="selectedAll"
|
|
13
13
|
@click.stop
|
|
14
14
|
class="checkbox" />
|
|
15
|
-
<!-- <Checkbox
|
|
16
|
-
@change.self="changeSelectAll"
|
|
17
|
-
v-model="selectedAll"
|
|
18
|
-
@click.stop
|
|
19
|
-
icon-size="22px"></Checkbox> -->
|
|
20
15
|
</div>
|
|
21
16
|
</div>
|
|
22
|
-
|
|
23
17
|
<div class="card">
|
|
24
18
|
<ul>
|
|
25
19
|
<li v-for="(item, index) in list" :key="index" @click="clickItem(item)">
|
|
@@ -36,7 +30,9 @@
|
|
|
36
30
|
class="title"
|
|
37
31
|
:class="{
|
|
38
32
|
company: item.invoiceCompanyType === '公司',
|
|
39
|
-
err:
|
|
33
|
+
err:
|
|
34
|
+
item.invoiceCompanyType === '异常抬头' ||
|
|
35
|
+
item.invoiceCompanyType === '异常税号',
|
|
40
36
|
}">
|
|
41
37
|
{{ item.invoiceCompanyType }}
|
|
42
38
|
</div>
|
|
@@ -62,9 +58,6 @@
|
|
|
62
58
|
<span :class="setClass(item.invoiceStatus)">{{
|
|
63
59
|
const_invoiceStatus[item.invoiceStatus]
|
|
64
60
|
}}</span>
|
|
65
|
-
<!-- <span class="error">识别失败</span>
|
|
66
|
-
<span class="default">已使用</span>
|
|
67
|
-
<span class="success">识别成功</span> -->
|
|
68
61
|
</div>
|
|
69
62
|
<div class="InvoiceInfo">
|
|
70
63
|
<div class="leftinfo">
|
|
@@ -156,6 +149,7 @@
|
|
|
156
149
|
</div>
|
|
157
150
|
</div>
|
|
158
151
|
<Popup
|
|
152
|
+
:z-index="9527"
|
|
159
153
|
v-model:show="showPopup"
|
|
160
154
|
:teleport="Cookies.get('teleport') || null"
|
|
161
155
|
position="bottom"
|
|
@@ -169,6 +163,7 @@
|
|
|
169
163
|
</div>
|
|
170
164
|
</Popup>
|
|
171
165
|
<Overlay
|
|
166
|
+
:z-index="9527"
|
|
172
167
|
style="display: flex; justify-content: center; align-items: center"
|
|
173
168
|
:show="showLoading">
|
|
174
169
|
<Loading class="loading" color="#0094ff">上传中...</Loading>
|
|
@@ -202,6 +197,7 @@ import {
|
|
|
202
197
|
} from './const'
|
|
203
198
|
import Cookies from 'js-cookie'
|
|
204
199
|
import { onUnmounted } from 'vue'
|
|
200
|
+
|
|
205
201
|
const emit = defineEmits(['edit', 'ok'])
|
|
206
202
|
const $props = defineProps({
|
|
207
203
|
listId: {
|
|
@@ -269,12 +265,21 @@ const getList = async () => {
|
|
|
269
265
|
})
|
|
270
266
|
}
|
|
271
267
|
const clickItem = (row: any) => {
|
|
272
|
-
console.log(row
|
|
268
|
+
console.log(row)
|
|
269
|
+
if (!row.invoiceStatus) {
|
|
270
|
+
return showToast({
|
|
271
|
+
type: 'text',
|
|
272
|
+
teleport: Cookies.get('teleport') || null,
|
|
273
|
+
message: '发票无效!',
|
|
274
|
+
zIndex: 9527,
|
|
275
|
+
})
|
|
276
|
+
}
|
|
273
277
|
if (row.invoiceStatus !== 'unused') {
|
|
274
278
|
return showToast({
|
|
275
279
|
type: 'text',
|
|
276
280
|
teleport: Cookies.get('teleport') || null,
|
|
277
281
|
message: '发票已被使用!',
|
|
282
|
+
zIndex: 9527,
|
|
278
283
|
})
|
|
279
284
|
}
|
|
280
285
|
row.selected = !row.selected
|
|
@@ -313,8 +318,9 @@ const changeSelectAll = (v: any) => {
|
|
|
313
318
|
if (selectedAll.value) {
|
|
314
319
|
showToast({
|
|
315
320
|
type: 'text',
|
|
316
|
-
message: '
|
|
321
|
+
message: '已选择全部可用发票',
|
|
317
322
|
teleport: Cookies.get('teleport') || null,
|
|
323
|
+
zIndex: 9527,
|
|
318
324
|
})
|
|
319
325
|
}
|
|
320
326
|
list.value.forEach((item: any) => {
|
|
@@ -333,6 +339,7 @@ const deleteSelectItem = () => {
|
|
|
333
339
|
type: 'text',
|
|
334
340
|
message: '请先选择发票',
|
|
335
341
|
teleport: Cookies.get('teleport') || null,
|
|
342
|
+
zIndex: 9527,
|
|
336
343
|
})
|
|
337
344
|
return
|
|
338
345
|
}
|
|
@@ -340,6 +347,8 @@ const deleteSelectItem = () => {
|
|
|
340
347
|
title: '提醒',
|
|
341
348
|
message: '请确认是否需要移除选中项,移除后不可恢复!',
|
|
342
349
|
teleport: Cookies.get('teleport') || null,
|
|
350
|
+
className: 'OCR-Zindex-OCR',
|
|
351
|
+
overlayClass: 'OCR-Zindex-OCR',
|
|
343
352
|
})
|
|
344
353
|
.then(async () => {
|
|
345
354
|
var urlencoded = new URLSearchParams()
|
|
@@ -352,6 +361,7 @@ const deleteSelectItem = () => {
|
|
|
352
361
|
type: 'success',
|
|
353
362
|
message: '移除成功',
|
|
354
363
|
teleport: Cookies.get('teleport') || null,
|
|
364
|
+
zIndex: 9527,
|
|
355
365
|
})
|
|
356
366
|
getList()
|
|
357
367
|
}
|
|
@@ -383,6 +393,7 @@ const selectImg = async (type: number) => {
|
|
|
383
393
|
type: 'success',
|
|
384
394
|
message: '上传成功',
|
|
385
395
|
teleport: Cookies.get('teleport') || null,
|
|
396
|
+
zIndex: 9527,
|
|
386
397
|
})
|
|
387
398
|
setTimeGetList()
|
|
388
399
|
}
|
|
@@ -416,6 +427,7 @@ const ok = () => {
|
|
|
416
427
|
type: 'text',
|
|
417
428
|
message: '请先选择发票',
|
|
418
429
|
teleport: Cookies.get('teleport') || null,
|
|
430
|
+
zIndex: 9527,
|
|
419
431
|
})
|
|
420
432
|
return
|
|
421
433
|
}
|
|
@@ -424,6 +436,7 @@ const ok = () => {
|
|
|
424
436
|
type: 'text',
|
|
425
437
|
message: '发票无效或已被使用,请进行确认',
|
|
426
438
|
teleport: Cookies.get('teleport') || null,
|
|
439
|
+
zIndex: 9527,
|
|
427
440
|
})
|
|
428
441
|
return
|
|
429
442
|
}
|
|
@@ -436,7 +449,9 @@ const ok = () => {
|
|
|
436
449
|
return obj
|
|
437
450
|
})
|
|
438
451
|
const filterTitleErr = selectData.some(
|
|
439
|
-
(item) =>
|
|
452
|
+
(item) =>
|
|
453
|
+
item.invoiceCompanyType === '异常抬头' ||
|
|
454
|
+
item.invoiceCompanyType === '异常税号'
|
|
440
455
|
)
|
|
441
456
|
console.log(filterTitleErr, 'filterTitleErr')
|
|
442
457
|
if (filterTitleErr) {
|
|
@@ -447,6 +462,8 @@ const ok = () => {
|
|
|
447
462
|
teleport: Cookies.get('teleport') || null,
|
|
448
463
|
cancelButtonText: '返回修改',
|
|
449
464
|
confirmButtonText: '继续提交',
|
|
465
|
+
className: 'OCR-Zindex-OCR',
|
|
466
|
+
overlayClass: 'OCR-Zindex-OCR',
|
|
450
467
|
})
|
|
451
468
|
.then(() => {
|
|
452
469
|
emit('ok', selectData, batchId.value)
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
<Overlay
|
|
23
|
+
:z-index="9527"
|
|
23
24
|
style="display: flex; justify-content: center; align-items: center"
|
|
24
25
|
:show="showLoading">
|
|
25
26
|
<Loading class="loading" color="#0094ff">上传中...</Loading>
|
|
@@ -31,9 +32,9 @@ import { ref } from 'vue'
|
|
|
31
32
|
import '@/utils/disableZoom'
|
|
32
33
|
import { selectPhoto, takePhoto } from '@/utils/upload'
|
|
33
34
|
import { __uploadInvoice } from '@/api/invoice'
|
|
34
|
-
import { showToast, Overlay, Loading
|
|
35
|
+
import { showToast, Overlay, Loading } from 'vant'
|
|
35
36
|
import Cookies from 'js-cookie'
|
|
36
|
-
const props = defineProps(['multiple', 'batchId', 'taxCode','businessLicense'])
|
|
37
|
+
const props = defineProps(['multiple', 'batchId', 'taxCode', 'businessLicense'])
|
|
37
38
|
const emit = defineEmits(['uploadSuccess'])
|
|
38
39
|
const payList: any = [
|
|
39
40
|
{
|
|
@@ -66,8 +67,8 @@ const handleClickText = async (text: any) => {
|
|
|
66
67
|
if (props.batchId) {
|
|
67
68
|
fd.append('batchId', props.batchId)
|
|
68
69
|
}
|
|
69
|
-
fd.append('businessLicense',props.businessLicense||'')
|
|
70
|
-
fd.append('taxCode',props.taxCode||'')
|
|
70
|
+
fd.append('businessLicense', props.businessLicense || '')
|
|
71
|
+
fd.append('taxCode', props.taxCode || '')
|
|
71
72
|
showLoading.value = true
|
|
72
73
|
try {
|
|
73
74
|
const res: any = await __uploadInvoice(fd)
|
|
@@ -76,12 +77,18 @@ const handleClickText = async (text: any) => {
|
|
|
76
77
|
type: 'success',
|
|
77
78
|
message: '上传成功',
|
|
78
79
|
teleport: Cookies.get('teleport') || null,
|
|
80
|
+
zIndex: 9527,
|
|
79
81
|
})
|
|
80
82
|
emit('uploadSuccess', res.data)
|
|
81
83
|
}
|
|
82
84
|
} catch (err: any) {
|
|
83
85
|
console.log(err)
|
|
84
|
-
|
|
86
|
+
showToast({
|
|
87
|
+
type: 'fail',
|
|
88
|
+
message: err.msg,
|
|
89
|
+
teleport: Cookies.get('teleport') || null,
|
|
90
|
+
zIndex: 9527,
|
|
91
|
+
})
|
|
85
92
|
}
|
|
86
93
|
showLoading.value = false
|
|
87
94
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,6 +2,5 @@ import Invoice from './Invoice/index.vue'
|
|
|
2
2
|
import InvoiceList from './InvoiceList/index.vue'
|
|
3
3
|
import PaymentMode from './PaymentMode/index.vue'
|
|
4
4
|
import OCRInvoice from './OCRInvoice/index.vue'
|
|
5
|
-
import 'vant/lib/index.css';
|
|
6
5
|
|
|
7
6
|
export { Invoice, InvoiceList, PaymentMode, OCRInvoice }
|